Browse Source

nvim: import config from master

Thomas Dy 5 years ago
parent
commit
63a6c2e1d1
1 changed files with 18 additions and 20 deletions
  1. 18 20
      .vim/init.vim

+ 18 - 20
.vim/init.vim

@@ -5,21 +5,19 @@ Plug 'tpope/vim-sleuth'
 Plug 'tpope/vim-fugitive'
 Plug 'tpope/vim-surround'
 Plug 'tpope/vim-abolish'
-
-Plug 'itchyny/lightline.vim'
 Plug 'mhinz/vim-signify'
 Plug 'sjl/gundo.vim'
 Plug 'EinfachToll/DidYouMean'
 Plug 'idanarye/vim-merginal'
 Plug 'junegunn/fzf'
 Plug 'junegunn/fzf.vim'
+Plug 'itchyny/lightline.vim'
+Plug 'trusktr/seti.vim'
 
 if filereadable(expand('~/.vim/local-plugins.vim'))
   source ~/.vim/local-plugins.vim
 endif
 
-Plug 'trusktr/seti.vim'
-
 call plug#end()
 
 " ----- plugin settings ------
@@ -91,22 +89,24 @@ vnoremap ; :
 " allow <ESC> via jj in insert mode
 inoremap jj <ESC>
 
+" tab switching
+nnoremap <C-T>h :tabprev<cr>
+nnoremap <C-T>l :tabnext<cr>
+
 " fix j/k with wraps
 nnoremap j gj
 nnoremap k gk
 vnoremap j gj
 vnoremap k gk
 
-" opening unite
-nnoremap <C-P> :GFiles<cr>
-nnoremap <C-O> :Buffers<cr>
-
-imap <C-W> <ESC><C-W>
-nnoremap <C-T>h :tabprev<cr>
-nnoremap <C-T>l :tabnext<cr>
-
-" grepper
-nnoremap <Leader>f :Rg
+" fzf
+nnoremap <C-P> :GitFiles -o -c --exclude-standard<CR>
+nnoremap <C-O> :Buffers<CR>
+if executable('rg')
+  nnoremap <Leader>f :Rg<SPACE>
+elseif executable('ag')
+  nnoremap <Leader>f :Ag<SPACE>
+endif
 
 " git
 nnoremap <Leader>gs :Gstatus<CR>
@@ -122,16 +122,14 @@ nnoremap <Leader>vs :source $MYVIMRC<CR>
 " ------ nvim specific ------
 if has('nvim')
   set inccommand=split
-
   tnoremap <C-[><C-[> <C-\><C-N>
-
-  autocmd TermOpen term://* startinsert
+  autocmd TermOpen * setlocal scrollback=10000 nonumber norelativenumber
+  autocmd TermOpen * startinsert
+  autocmd FileType fzf tnoremap <buffer> jj <ESC>
   autocmd BufWinEnter,WinEnter term://* startinsert
   autocmd BufLeave term://* stopinsert
-  autocmd FileType fzf tnoremap <buffer> jj <Esc>
-  autocmd TermOpen * setlocal nonumber norelativenumber
 
-  nnoremap <Leader>tv :vsp term://zsh<CR>
+  nnoremap <Leader>tv :vsp term://$SHELL<CR>
   nnoremap <Leader>to :term<CR>
 endif