" ##################################### " ### Common Setting " ##################################### " show row number set number hi LineNr ctermbg=0 ctermfg=0 hi CursorLineNr ctermbg=4 ctermfg=0 set cursorline hi clear CursorLine set noswapfile " tab default set tabstop=2 set shiftwidth=2 set expandtab set softtabstop=2 set autoindent set smarttab " change tab setting in case by filetypes filetype plugin indent on " filetype filetype on au BufNewFile,BufRead *.etl.erb setf ruby set fileencoding=utf-8 set ambiwidth=double " Delete Highlight y Esc twice nmap ;nohlsearch " Complete brackets inoremap { {} inoremap ( () inoremap [ [] inoremap < <> " Visualize Tab, Space, Emptyline set list set listchars=tab:>.,trail:・,extends:>,precedes:<,nbsp:% function! ZenkakuSpace() highlight ZenkakuSpace cterm=reverse ctermfg=DarkMagenta gui=reverse guifg=DarkMagenta endfunction " edit set smartindent set showmatch "閉じカッコが入力時対応するカッコを強調 set backspace=indent,eol,start "バックスペースで各種消せるよう set virtualedit=block " Search set ignorecase "検索時大文字小文字を区別しない set smartcase "大文字を含めた検索はその通りに検索する set incsearch "インクリメンタルサーチを行う set nohlsearch "検索結果をハイライト表示しない set wrapscan "循環検索オン set infercase "補完の際大文字小文字を区別しない nnoremap :noh " Other set wildmenu "ナビゲーションバーを有効に set tw=0 "自動改行オフ set whichwrap=b,s,h,l,<,>,[,] "カーソル行を行頭、行末で止まらないように set cursorline "カーソル行をハイライト set clipboard=unnamed,unnamedplus "クリップボードをWindowsと連携する set hidden "変更中のでも保存せずで他のファイルを表示 set number "行番号を表示する set switchbuf=useopen "新しく開く代りイに既に開いているバッファを set vb t_vb= "ビープ音を消す set novisualbell set nostartofline "移動コマンドを使った時行頭に移動しない set matchpairs& matchpairs+=<:> "<>を対応括弧ペアに set matchtime=3 "対応括弧表示を3秒に set wrap "ウィンドウより長い行は折り畳む set textwidth=0 "テキストの最大幅を無効に set shiftround "インデントをshiftwidthの倍数に set history=10000 "コマンド、検索の履歴を1万個まで set mouse=a "マウスモード有効 inoremap jj "入力モード中に素早くjjと入力した時はESC " ##################################### " ### Python provider " ##################################### let g:python_host_prog = $PYENV_ROOT.'/versions/2.7.14/bin/python' let g:python3_host_prog = $PYENV_ROOT.'/versions/3.6.0/bin/python' " ##################################### " ### SETUP dein.vim " ##################################### " reset augroup augroup MyAutoCmd autocmd! augroup END let $CACHE = empty($XDG_CACHE_HOME) ? expand('$HOME/.cache') : $XDG_CACHE_HOME let $CONFIG = empty($XDG_CONFIG_HOME) ? expand('$HOME/.config') : $XDG_CONFIG_HOME let $DATA = empty($XDG_DATA_HOME) ? expand('$HOME/.local/share') : $XDG_DATA_HOME " {{{ dein let s:dein_dir = expand('$CACHE/dein') if &runtimepath !~# '/dein.vim' let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim' " Auto Download if !isdirectory(s:dein_repo_dir) call system('git clone https://github.com/Shougo/dein.vim ' . shellescape(s:dein_repo_dir)) endif execute 'set runtimepath^=' . s:dein_repo_dir endif " dein.vim settings if dein#load_state(s:dein_dir) call dein#begin(s:dein_dir) let s:toml_dir = expand('$CONFIG/dein') call dein#load_toml(s:toml_dir . '/dein.toml', {'lazy': 0}) call dein#load_toml(s:toml_dir . '/lazy.toml', {'lazy': 1}) call dein#load_toml(s:toml_dir . '/ruby.toml', {'lazy': 1}) call dein#load_toml(s:toml_dir . '/other.toml', {'lazy': 1}) call dein#load_toml(s:toml_dir . '/python.toml', {'lazy': 1}) call dein#load_toml(s:toml_dir . '/go.toml', {'lazy': 1}) call dein#load_toml(s:toml_dir . '/html.toml', {'lazy': 1}) call dein#load_toml(s:toml_dir . '/js.toml', {'lazy': 1}) call dein#end() call dein#save_state() endif if has('vim_starting') && dein#check_install() call dein#install() endif " }}} " ##################################### " ### Tab Split settings " ##################################### nnoremap s nnoremap sj j nnoremap sk k nnoremap sl l nnoremap sh h nnoremap sJ J nnoremap sK K nnoremap sL L nnoremap sH H nnoremap sn gt nnoremap sp gT nnoremap sr r nnoremap s= = nnoremap sw w nnoremap so _| nnoremap sO = nnoremap sN :bn nnoremap sP :bp nnoremap st :tabnew nnoremap ss :sp nnoremap sv :vs nnoremap sq :q nnoremap sQ :bd nnoremap ; : " ##################################### " ### Lazy plugin commands " ##################################### " tagbar nnoremap :TagbarToggle " Denite nmap :Denite filetype nmap :Denite file_rec nmap :Denite line nmap :Denite grep nmap :DeniteCursorWord grep nmap :Denite file_mru nmap :Denite neoyank nmap :Denite -resume nmap ; :Denite -resume -immediately -select=+1 nmap - :Denite -resume -immediately -select=-1 nmap :call denite#start([{'name': 'file_rec', 'args': ['~/dotfiles']}]) nnoremap ml :call denite#start([{'name': 'file_rec', 'args': [g:memolist_path]}]) " 補完のプレビューを消す set completeopt-=preview if exists('$TMUX') let &t_SI = "\ePtmux;\e\e[5 q\e\\" let &t_EI = "\ePtmux;\e\e[2 q\e\\" else let &t_SI = "\e[5 q" let &t_EI = "\e[2 q" endif