Skip to content

Instantly share code, notes, and snippets.

@tanshio
Last active August 17, 2017 16:52
Show Gist options
  • Save tanshio/c305c179508428dd9c970bac66b8a310 to your computer and use it in GitHub Desktop.
Save tanshio/c305c179508428dd9c970bac66b8a310 to your computer and use it in GitHub Desktop.
.vimrc
" let $PYTHONHOME='/Users/tannoshota/.anyenv/envs/pyenv/versions/3.6.0'
" let $PYTHONHOME=$HOME."/.anyenv/envs/pyenv/versions/2.7.11"
" set pythondll=$HOME/.anyenv/envs/pyenv/versions/2.7.11/lib/libpython2.7.dylib
" py import sys
let $PYTHONHOME=$HOME."/.anyenv/envs/pyenv/versions/3.6.0"
set pythonthreedll=$HOME/.anyenv/envs/pyenv/versions/3.6.0/lib/libpython3.6m.dylib
py3 import sys
"dein Scripts-----------------------------
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=$HOME/.vim/dein/repos/github.com/Shougo/dein.vim
" Required:
if dein#load_state($HOME.'/.vim/dein')
call dein#begin($HOME.'/.vim/dein')
" Let dein manage dein
" Required:
call dein#add($HOME.'/.vim/dein/repos/github.com/Shougo/dein.vim')
" Add or remove your plugins here:
call dein#add('Shougo/neosnippet.vim')
call dein#add('Shougo/neosnippet-snippets')
call dein#add('lambdalisue/vim-pyenv')
" call dein#add('Shougo/unite.vim')
call dein#add('Shougo/denite.nvim')
" Change file_rec command.
call denite#custom#var('file_rec', 'command',
\ ['ag', '--follow', '--nocolor', '--nogroup', '-g', ''])
" " For ripgrep
" " Note: It is slower than ag
" call denite#custom#var('file_rec', 'command',
" \ ['rg', '--files', '--glob', '!.git', ''])
" " For Pt(the platinum searcher)
" " NOTE: It also supports windows.
" call denite#custom#var('file_rec', 'command',
" \ ['pt', '--follow', '--nocolor', '--nogroup', '-g:', ''])
"
" " Change mappings.
" call denite#custom#map(
" \ 'insert',
" \ '<C-j>',
" \ '<denite:move_to_next_line>',
" \ 'noremap'
" \)
" call denite#custom#map(
" \ 'insert',
" \ '<C-k>',
" \ '<denite:move_to_previous_line>',
" \ 'noremap'
" \)
"
" " Change matchers.
" call denite#custom#source(
" \ 'file_mru', 'matchers', ['matcher_fuzzy', 'matcher_project_files'])
" call denite#custom#source(
" \ 'file_rec', 'matchers', ['matcher_cpsm'])
"
" " Change sorters.
" call denite#custom#source(
" \ 'file_rec', 'sorters', ['sorter_sublime'])
"
" " Add custom menus
" let s:menus = {}
"
" let s:menus.zsh = {
" \ 'description': 'Edit your import zsh configuration'
" \ }
" let s:menus.zsh.file_candidates = [
" \ ['zshrc', '~/.config/zsh/.zshrc'],
" \ ['zshenv', '~/.zshenv'],
" \ ]
"
" let s:menus.my_commands = {
" \ 'description': 'Example commands'
" \ }
" let s:menus.my_commands.command_candidates = [
" \ ['Split the window', 'vnew'],
" \ ['Open zsh menu', 'Denite menu:zsh'],
" \ ]
"
" call denite#custom#var('menu', 'menus', s:menus)
"
" " Ag command on grep source
call denite#custom#var('grep', 'command', ['ag'])
call denite#custom#var('grep', 'default_opts',
\ ['-i', '--vimgrep'])
call denite#custom#var('grep', 'recursive_opts', [])
call denite#custom#var('grep', 'pattern_opt', [])
call denite#custom#var('grep', 'separator', ['--'])
call denite#custom#var('grep', 'final_opts', [])
"
" " Ack command on grep source
" call denite#custom#var('grep', 'command', ['ack'])
" call denite#custom#var('grep', 'default_opts',
" \ ['--ackrc', $HOME.'/.ackrc', '-H',
" \ '--nopager', '--nocolor', '--nogroup', '--column'])
" call denite#custom#var('grep', 'recursive_opts', [])
" call denite#custom#var('grep', 'pattern_opt', ['--match'])
" call denite#custom#var('grep', 'separator', ['--'])
" call denite#custom#var('grep', 'final_opts', [])
"
" " Ripgrep command on grep source
" call denite#custom#var('grep', 'command', ['rg'])
" call denite#custom#var('grep', 'default_opts',
" \ ['--vimgrep', '--no-heading'])
" call denite#custom#var('grep', 'recursive_opts', [])
" call denite#custom#var('grep', 'pattern_opt', ['--regexp'])
" call denite#custom#var('grep', 'separator', ['--'])
" call denite#custom#var('grep', 'final_opts', [])
"
" " Pt command on grep source
" call denite#custom#var('grep', 'command', ['pt'])
" call denite#custom#var('grep', 'default_opts',
" \ ['--nogroup', '--nocolor', '--smart-case'])
" call denite#custom#var('grep', 'recursive_opts', [])
" call denite#custom#var('grep', 'pattern_opt', [])
" call denite#custom#var('grep', 'separator', ['--'])
" call denite#custom#var('grep', 'final_opts', [])
"
" call denite#custom#source('file_mru', 'converters',
" \ ['converter_relative_word'])
"
" " Define alias
" call denite#custom#alias('source', 'file_rec/git', 'file_rec')
" call denite#custom#var('file_rec/git', 'command',
" \ ['git', 'ls-files', '-co', '--exclude-standard'])
"
" " Change default prompt
" call denite#custom#option('default', 'prompt', '>')
"
" Change ignore_globs
call denite#custom#filter('matcher_ignore_globs', 'ignore_globs',
\ [ '.git/', '.ropeproject/', '__pycache__/', 'node_modules/',
\ 'venv/', 'images/', '*.min.*', 'img/', 'fonts/','yarn.lock','vendor/'])
call dein#add('Shougo/neocomplcache.vim')
let g:acp_enableAtStartup = 0
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_enable_smart_case = 1
let g:neocomplcache_min_syntax_length = 3
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
let g:neocomplcache_dictionary_filetype_lists = {
\ 'default' : '',
\ 'vimshell' : $HOME.'/.vimshell_hist',
\ 'scheme' : $HOME.'/.gosh_completions'
\ }
if !exists('g:neocomplcache_keyword_patterns')
let g:neocomplcache_keyword_patterns = {}
endif
let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
inoremap <expr><C-g> neocomplcache#undo_completion()
inoremap <expr><C-l> neocomplcache#complete_common_string()
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
return neocomplcache#smart_close_popup() . "\<CR>"
endfunction
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
inoremap <expr><C-h> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplcache#close_popup()
inoremap <expr><C-e> neocomplcache#cancel_popup()
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
if !exists('g:neocomplcache_force_omni_patterns')
let g:neocomplcache_force_omni_patterns = {}
endif
let g:neocomplcache_force_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
let g:neocomplcache_force_omni_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
let g:neocomplcache_force_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
let g:neocomplcache_force_omni_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
call dein#add('nathanaelkane/vim-indent-guides')
" call dein#add('ryanoasis/vim-devicons')
call dein#add('scrooloose/nerdtree')
call dein#add('Xuyuanp/nerdtree-git-plugin')
" call dein#add('tiagofumo/vim-nerdtree-syntax-highlight')
call dein#add('jistr/vim-nerdtree-tabs')
" You can specify revision/branch/tag.
call dein#add('Shougo/vimshell', { 'rev': '3787e5' })
call dein#add('easymotion/vim-easymotion')
call dein#add('vim-scripts/taglist.vim')
call dein#add('szw/vim-tags')
call dein#add('tomtom/tcomment_vim')
call dein#add('vim-airline/vim-airline')
call dein#add('vim-airline/vim-airline-themes')
let g:airline_powerline_fonts = 1
set laststatus=2
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme = 'dark'
call dein#add('tpope/vim-fugitive')
let g:airline#extensions#branch#enabled = 1
" git add % => :Gwrite
" git status => :Gstatus "[-]add [D]Gblame
" git commit => :Gcommit -m 'xxx'
" git push => :Git push
" :Gdiff
" do 取込, dp 書出
" :Gblame
" :Glog
" :Git log
call dein#add('airblade/vim-gitgutter')
call dein#add('ctrlpvim/ctrlp.vim')
call dein#add('w0rp/ale')
call dein#add('posva/vim-vue')
let g:ale_linters = {
\ 'html': [],
\ 'css': ['stylelint'],
\ 'javascript': ['eslint'],
\ 'vue': ['eslint']
\ }
let g:ale_linter_aliases = {'vue': 'css'}
let g:ale_open_list = 1
let g:ale_statusline_format = ['E%d', 'W%d', '']
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$|(node_modules)$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
call dein#add('editorconfig/editorconfig-vim')
" call dein#add('bronson/vim-trailing-whitespace')
call dein#add('jiangmiao/auto-pairs')
" call dein#add('terryma/vim-multiple-cursors')
call dein#add('othree/html5.vim')
call dein#add('mattn/emmet-vim')
call dein#add('digitaltoad/vim-pug')
call dein#add('slim-template/vim-slim')
call dein#add('hail2u/vim-css3-syntax')
call dein#add('othree/yajs')
call dein#add('joshdick/onedark.vim')
call dein#add('cocopon/iceberg.vim')
" Required:
call dein#end()
call dein#save_state()
endif
" Required:
filetype plugin indent on
syntax enable
" If you want to install not installed plugins on startup.
if dein#check_install()
call dein#install()
endif
" NERDTree
let g:nerdtree_tabs_open_on_console_startup=1
let g:nerdtree_tabs_smart_startup_focus=2
let NERDTreeShowHidden = 1
nnoremap <silent><C-e> :NERDTreeFocusToggle<CR>
" mouse
set mouse=a
set ttymouse=xterm2
let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_auto_colors = 0
" autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=red ctermbg=8
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=green ctermbg=234
let g:indent_guides_exclude_filetypes = ['help', 'nerdtree']
" let g:indent_guides_enable_on_vim_startup = 1
" let g:indent_guides_start_level = 2
" autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=red ctermbg=8
" let g:indent_guides_guide_size = 1
" let g:indent_guides_exclude_filetypes = ['help', 'nerdtree', 'tagbar', 'unite']
set encoding=utf-8
set fileformats=unix,dos,mac
setl ff=unix
set formatoptions=q
" tab
set expandtab
set tabstop=2
set softtabstop=2
set shiftwidth=2
set autoindent
set smartindent
set cursorline
" number
set number
" paste
set clipboard=unnamed
au BufRead,BufNewFile,BufReadPre *.jade set filetype=pug
set background=dark
syntax on
colorscheme onedark
set list
" set listchars=tab:>-,trail:-,nbsp:%,extends:>,precedes:<
set listchars=tab:»-,trail:-,eol:↲,extends:»,precedes:«,nbsp:・,space:・
" colorscheme iceberg
:set noswapfile
let g:ctrlp_dont_split = 'NERD_tree'
autocmd FileType html,css,scss,pug,jade,ejs,erb,slim imap <buffer><expr><tab>
\ emmet#isExpandable() ? "\<plug>(emmet-expand-abbr)" :
\ "\<tab>"
"End dein Scripts-------------------------
if !has('nvim')
" let $PYTHONHOME=$HOME."/.anyenv/envs/pyenv/versions/2.7.11"
" set pythondll=$HOME/.anyenv/envs/pyenv/versions/2.7.11/lib/libpython2.7.dylib
" py import sys
let $PYTHONHOME=$HOME."/.anyenv/envs/pyenv/versions/3.6.0"
set pythonthreedll=$HOME/.anyenv/envs/pyenv/versions/3.6.0/lib/libpython3.6m.dylib
py3 import sys
endif
"dein Scripts-----------------------------
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=$HOME/.vim/dein/repos/github.com/Shougo/dein.vim
" Required:
if dein#load_state($HOME.'/.vim/dein')
call dein#begin($HOME.'/.vim/dein')
" Let dein manage dein
" Required:
call dein#add($HOME.'/.vim/dein/repos/github.com/Shougo/dein.vim')
" Add or remove your plugins here:
" let g:neosnippet#enable_snipmate_compatibility
if !has('nvim')
call dein#add('lambdalisue/vim-pyenv')
endif
call dein#add('Shougo/deoplete.nvim')
" call dein#add('Shougo/unite.vim')
call dein#add('Shougo/neosnippet.vim')
call dein#add('Shougo/neosnippet-snippets')
call dein#add('Shougo/denite.nvim')
call dein#add('Shougo/context_filetype.vim')
call dein#add('osyo-manga/vim-precious')
" Change file_rec command.
call denite#custom#var('file_rec', 'command',
\ ['ag', '--follow', '--nocolor', '--nogroup', '-g', ''])
" " For ripgrep
" " Note: It is slower than ag
" call denite#custom#var('file_rec', 'command',
" \ ['rg', '--files', '--glob', '!.git', ''])
" " For Pt(the platinum searcher)
" " NOTE: It also supports windows.
" call denite#custom#var('file_rec', 'command',
" \ ['pt', '--follow', '--nocolor', '--nogroup', '-g:', ''])
"
" " Change mappings.
" call denite#custom#map(
" \ 'insert',
" \ '<C-j>',
" \ '<denite:move_to_next_line>',
" \ 'noremap'
" \)
" call denite#custom#map(
" \ 'insert',
" \ '<C-k>',
" \ '<denite:move_to_previous_line>',
" \ 'noremap'
" \)
"
" " Change matchers.
" call denite#custom#source(
" \ 'file_mru', 'matchers', ['matcher_fuzzy', 'matcher_project_files'])
" call denite#custom#source(
" \ 'file_rec', 'matchers', ['matcher_cpsm'])
"
" " Change sorters.
" call denite#custom#source(
" \ 'file_rec', 'sorters', ['sorter_sublime'])
"
" " Add custom menus
" let s:menus = {}
"
" let s:menus.zsh = {
" \ 'description': 'Edit your import zsh configuration'
" \ }
" let s:menus.zsh.file_candidates = [
" \ ['zshrc', '~/.config/zsh/.zshrc'],
" \ ['zshenv', '~/.zshenv'],
" \ ]
"
" let s:menus.my_commands = {
" \ 'description': 'Example commands'
" \ }
" let s:menus.my_commands.command_candidates = [
" \ ['Split the window', 'vnew'],
" \ ['Open zsh menu', 'Denite menu:zsh'],
" \ ]
"
" call denite#custom#var('menu', 'menus', s:menus)
"
" " Ag command on grep source
call denite#custom#var('grep', 'command', ['ag'])
call denite#custom#var('grep', 'default_opts',
\ ['-i', '--vimgrep'])
call denite#custom#var('grep', 'recursive_opts', [])
call denite#custom#var('grep', 'pattern_opt', [])
call denite#custom#var('grep', 'separator', ['--'])
call denite#custom#var('grep', 'final_opts', [])
"
" " Ack command on grep source
" call denite#custom#var('grep', 'command', ['ack'])
" call denite#custom#var('grep', 'default_opts',
" \ ['--ackrc', $HOME.'/.ackrc', '-H',
" \ '--nopager', '--nocolor', '--nogroup', '--column'])
" call denite#custom#var('grep', 'recursive_opts', [])
" call denite#custom#var('grep', 'pattern_opt', ['--match'])
" call denite#custom#var('grep', 'separator', ['--'])
" call denite#custom#var('grep', 'final_opts', [])
"
" " Ripgrep command on grep source
" call denite#custom#var('grep', 'command', ['rg'])
" call denite#custom#var('grep', 'default_opts',
" \ ['--vimgrep', '--no-heading'])
" call denite#custom#var('grep', 'recursive_opts', [])
" call denite#custom#var('grep', 'pattern_opt', ['--regexp'])
" call denite#custom#var('grep', 'separator', ['--'])
" call denite#custom#var('grep', 'final_opts', [])
"
" " Pt command on grep source
" call denite#custom#var('grep', 'command', ['pt'])
" call denite#custom#var('grep', 'default_opts',
" \ ['--nogroup', '--nocolor', '--smart-case'])
" call denite#custom#var('grep', 'recursive_opts', [])
" call denite#custom#var('grep', 'pattern_opt', [])
" call denite#custom#var('grep', 'separator', ['--'])
" call denite#custom#var('grep', 'final_opts', [])
"
" call denite#custom#source('file_mru', 'converters',
" \ ['converter_relative_word'])
"
" " Define alias
" call denite#custom#alias('source', 'file_rec/git', 'file_rec')
" call denite#custom#var('file_rec/git', 'command',
" \ ['git', 'ls-files', '-co', '--exclude-standard'])
"
" " Change default prompt
" call denite#custom#option('default', 'prompt', '>')
"
" Change ignore_globs
call denite#custom#filter('matcher_ignore_globs', 'ignore_globs',
\ [ '.git/', '.ropeproject/', '__pycache__/', 'node_modules/',
\ 'venv/', '*.min.*', 'img/', 'fonts/','yarn.lock','vendor/'])
call dein#add('nathanaelkane/vim-indent-guides')
" call dein#add('ryanoasis/vim-devicons')
call dein#add('scrooloose/nerdtree')
call dein#add('Xuyuanp/nerdtree-git-plugin')
" call dein#add('tiagofumo/vim-nerdtree-syntax-highlight')
call dein#add('jistr/vim-nerdtree-tabs')
"
call dein#add('xolox/vim-session')
call dein#add('xolox/vim-misc')
" You can specify revision/branch/tag.
call dein#add('Shougo/vimshell', { 'rev': '3787e5' })
call dein#add('easymotion/vim-easymotion')
call dein#add('vim-scripts/taglist.vim')
call dein#add('szw/vim-tags')
call dein#add('tomtom/tcomment_vim')
call dein#add('vim-airline/vim-airline')
call dein#add('vim-airline/vim-airline-themes')
call dein#add('tpope/vim-fugitive')
" git add % => :Gwrite
" git status => :Gstatus "[-]add [D]Gblame
" git commit => :Gcommit -m 'xxx'
" git push => :Git push
" :Gdiff
" do 取込, dp 書出
" :Gblame
" :Glog
" :Git log
call dein#add('airblade/vim-gitgutter')
" call dein#add('ctrlpvim/ctrlp.vim')
call dein#add('w0rp/ale')
"
call dein#add('posva/vim-vue')
let g:ale_linters = {
\ 'html': [],
\ 'css': ['stylelint'],
\ 'javascript': ['eslint'],
\ 'vue': ['eslint']
\ }
let g:ale_linter_aliases = {'vue': 'css'}
let g:ale_open_list = 0
let g:ale_statusline_format = ['E%d', 'W%d', '']
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$|(node_modules)$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
call dein#add('tpope/vim-surround')
call dein#add('tpope/vim-speeddating')
call dein#add('tpope/vim-repeat')
" call dein#add('simeji/winresizer')
" call dein#add('mbbill/undotree')
call dein#add('editorconfig/editorconfig-vim')
" call dein#add('bronson/vim-trailing-whitespace')
call dein#add('jiangmiao/auto-pairs')
" call dein#add('terryma/vim-multiple-cursors')
call dein#add('othree/html5.vim')
call dein#add('mattn/emmet-vim')
call dein#add('digitaltoad/vim-pug')
call dein#add('slim-template/vim-slim')
call dein#add('hail2u/vim-css3-syntax')
" call dein#add('othree/yajs')
call dein#add('pangloss/vim-javascript')
call dein#add('joshdick/onedark.vim')
call dein#add('cocopon/iceberg.vim')
let javascript = { 'on_ft': 'javascript' }
call dein#add('carlitux/deoplete-ternjs', javascript)
call dein#add('terryma/vim-expand-region')
call dein#add('kana/vim-submode')
" call dein#add('ervandew/supertab')
" Required:
call dein#end()
call dein#save_state()
endif
" Required:
filetype plugin indent on
syntax enable
" If you want to install not installed plugins on startup.
if dein#check_install()
call dein#install()
endif
" NERDTree
let g:nerdtree_tabs_open_on_console_startup=1
let g:nerdtree_tabs_smart_startup_focus=2
let NERDTreeShowHidden = 1
nnoremap <silent><C-e> :NERDTreeFocusToggle<CR>
let g:SuperTabClosePreviewOnPopupClose = 1
" mouse
set mouse=a
if !has('nvim')
set ttymouse=xterm2
endif
" let g:indent_guides_enable_on_vim_startup = 1
" let g:indent_guides_start_level = 2
" autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=red ctermbg=8
" let g:indent_guides_guide_size = 1
" let g:indent_guides_exclude_filetypes = ['help', 'nerdtree', 'tagbar', 'unite']
set encoding=utf-8
set fileformats=unix,dos,mac
setl ff=unix
set synmaxcol=200
set formatoptions=q
" tab
set expandtab
set tabstop=2
set softtabstop=2
set shiftwidth=2
set autoindent
" set smartindent
" set cursorline
" number
set number
" paste
set clipboard=unnamed
au BufRead,BufNewFile,BufReadPre *.jade set filetype=pug
set background=dark
syntax on
" " Theme
" syntax enable
" for vim 7
set t_Co=256
" for vim 8
if (has("termguicolors"))
set termguicolors
endif
let g:airline_powerline_fonts = 1
set laststatus=2
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme = 'dark'
let g:airline#extensions#branch#enabled = 1
colorscheme onedark
let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_auto_colors = 0
" autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=red ctermbg=8
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=#38334C ctermbg=234
let g:indent_guides_exclude_filetypes = ['help', 'nerdtree']
set list
" set listchars=tab:>-,trail:-,nbsp:%,extends:>,precedes:<
set listchars=tab:»-,trail:-,eol:↲,extends:»,precedes:«,nbsp:・,space:・
" colorscheme iceberg
set noswapfile
set backupdir=~/.vim/tmp
set isk+=-
" let g:ctrlp_dont_split = 'NERD_tree'
" let g:user_emmet_install_global = 0
" autocmd FileType html,css,scss,pug,jade,ejs,erb,slim EmmetInstall
" autocmd FileType html,css,scss,pug,jade,ejs,erb,slim imap <buffer><expr><tab>
" \ emmet#isExpandable() ? "\<plug>(emmet-expand-abbr)" :
" \ "\<tab>"
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_smart_case = 1
let g:deoplete#file#enable_buffer_path = 1
let g:deoplete#sources = {}
let g:deoplete#sources_ = ['buffer']
let g:deoplete#sources.cpp = ['buffer', 'tag']
let g:deoplete#sources#syntax#min_keyword_length = 2
"
" Plugin key-mappings.
" Note: It must be "imap" and "smap". It uses <Plug> mappings.
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
smap <TAB> <Plug>(neosnippet_expand_or_jump)
" neosnippet
" SuperTab like snippets behavior.
" Note: It must be "imap" and "smap". It uses <Plug> mappings.
imap <C-k> <Plug>(neosnippet_expand_or_jump)
imap <silent><expr> <TAB>
\ neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" :
\ pumvisible() ? "\<C-n>" :
\ emmet#isExpandable() ? "\<plug>(emmet-expand-abbr)" :
\ <SID>check_back_space() ? "\<TAB>" :
\ deoplete#mappings#manual_complete()
function! s:check_back_space() abort "{{{
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction"}}}
if has('conceal')
set conceallevel=2 concealcursor=niv
endif
let g:neosnippet#snippets_directory=$HOME.'/.config/nvim/neosnippet-snippets/snippets/'
" Use deoplete.
let g:tern_request_timeout = 1
let g:tern_show_signature_in_pum = '0' " This do disable full signature type on autocomplete
"Add extra filetypes
let g:tern#filetypes = [
\ 'jsx',
\ 'javascript.jsx',
\ 'vue'
\ ]
augroup vimrc-checktime
autocmd!
autocmd WinEnter * checktime
augroup END
nnoremap :ut :UndotreeToggle
if has("persistent_undo")
set undodir=~/.undodir/
set undofile
endif
let g:undotree_SetFocusWhenToggle = 1
let g:undotree_WindowLayout = 'topleft'
let g:undotree_SplitWidth = 35
let g:undotree_diffAutoOpen = 1
let g:undotree_diffpanelHeight = 25
let g:undotree_RelativeTimestamp = 1
let g:undotree_TreeNodeShape = '*'
let g:undotree_HighlightChangedText = 1
let g:undotree_HighlightSyntax = "UnderLined"
vnoremap <silent> y y`]
vnoremap <silent> p p`]
nnoremap <silent> p p`]
" nnoremap p p=`]
nnoremap <silent> <space>f :<C-u>Denite file_rec<cr>
nnoremap <Tab> :<C-u>b<space>
" noremap <D-h> ^
" noremap <D-j> }
" noremap <D-k> {
" noremap <D-l> $
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\""
" session保存ファイル名
let g:session_default_name = '.session'
" session保持ファイルの拡張子
let g:session_extension = '.vim'
" session保存ディレクトリを現在のディレクトリにする
let g:session_directory = getcwd()
" vim終了時に自動保存しない
let g:session_autosave = 'yes'
" 引数なしでvimを起動した時にセッションを復元しない
let g:session_autoload = 'yes'
" 1分間に1回自動保存をしない
let g:session_autosave_periodic = 1
let mapleader = "\<Space>"
map <Leader> <Plug>(easymotion-prefix)
let g:EasyMotion_do_mapping = 0 " Disable default mappings
" Jump to anywhere you want with minimal keystrokes, with just one key binding.
" `s{char}{label}`
" nmap s <Plug>(easymotion-overwin-f)
" or
" `s{char}{char}{label}`
" Need one more keystroke, but on average, it may be more comfortable.
nmap s <Plug>(easymotion-overwin-f2)
" Turn on case insensitive feature
let g:EasyMotion_smartcase = 1
" JK motions: Line motions
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
inoremap jj <Esc>
"行頭へ移動
" nnoremap aa <C-o>^
" "行末へ移動
" nnoremap ee <C-o>$
autocmd BufNewFile,BufRead *.vue set filetype=html
"End dein Scripts-------------------------
" nnoremap <silent>bp :bprevious<CR>
" nnoremap <silent>bn :bnext<CR>
" nnoremap <silent>bb :b#<CR>
" " コロンとセミコロンを入れ替え
" noremap : ;
set completeopt+=noinsert
"左右のカーソル移動で行間移動可能にする。
set whichwrap=b,s,<,>,[,]
call submode#enter_with('winsize', 'n', '', '<C-w>>', '<C-w>>')
call submode#enter_with('winsize', 'n', '', '<C-w><', '<C-w><')
call submode#enter_with('winsize', 'n', '', '<C-w>+', '<C-w>+')
call submode#enter_with('winsize', 'n', '', '<C-w>-', '<C-w>-')
call submode#map('winsize', 'n', '', '>', '<C-w>>')
call submode#map('winsize', 'n', '', '<', '<C-w><')
call submode#map('winsize', 'n', '', '+', '<C-w>+')
call submode#map('winsize', 'n', '', '-', '<C-w>-')
vmap v <Plug>(expand_region_expand)
vmap <C-v> <Plug>(expand_region_shrink)
nnoremap <Leader>s :w<CR>
nnoremap <Leader>w <C-w>
autocmd BufWritePost *
\ if exists('b:git_dir') && !empty(glob(b:git_dir.'/hooks/ctags')) |
\ call system('"'.b:git_dir.'/hooks/ctags"') |
\ endif
" 検索結果のハイライトをESC連打で消す
set hlsearch
noremap <Esc><Esc> :nohlsearch<CR><Esc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment