Bladeren bron

Replace unite with ctrlp

Thomas Dy 9 jaren geleden
bovenliggende
commit
353fb42103
2 gewijzigde bestanden met toevoegingen van 6 en 21 verwijderingen
  1. 0 4
      .vim/ag-unite
  2. 6 17
      .vimrc

+ 0 - 4
.vim/ag-unite

@@ -1,4 +0,0 @@
-#!/bin/sh
-cd $1
-touch /tmp/a
-ag --hidden --nocolor --nogroup -g ''

+ 6 - 17
.vimrc

@@ -5,7 +5,7 @@ Plug 'tpope/vim-sleuth'
 Plug 'tpope/vim-fugitive'
 Plug 'bling/vim-airline'
 Plug 'mhinz/vim-signify'
-Plug 'Shougo/unite.vim'
+Plug 'ctrlpvim/ctrlp.vim'
 
 if executable('lein')
   Plug 'guns/vim-sexp'
@@ -20,21 +20,12 @@ call plug#end()
 " ----- plugin settings ------
 let g:signify_vcs_list = [ 'git' ]
 
-call unite#filters#matcher_default#use(['matcher_fuzzy'])
-
-" use ag if present
 if executable('ag')
-  " we run a wrapper around ag so it respects agignore
-  let g:unite_source_rec_async_command = ['sh', expand('~/.vim/ag-unite')]
+  " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
+  " we cd first into the dir so ag will use .agignore correctly
+  let g:ctrlp_user_command = 'cd %s && ag --nocolor --hidden -g ""'
 endif
 
-autocmd FileType unite call s:unite_settings()
-function! s:unite_settings()
-  " Enable navigation with control-j and control-k in insert mode
-  imap <buffer> <C-j>   <Plug>(unite_select_next_line)
-  imap <buffer> <C-k>   <Plug>(unite_select_previous_line)
-endfunction
-
 " ------ settings ------
 
 " xdg-ish settings
@@ -90,15 +81,13 @@ nnoremap k gk
 vnoremap j gj
 vnoremap k gk
 
-" opening unite
-nnoremap <C-P> :Unite -no-split -buffer-name=files -start-insert file_rec<cr>
-nnoremap <C-O> :Unite -no-split -buffer-name=buffers -start-insert buffer<cr>
+" opening ctrlp
+nnoremap <C-O> :CtrlPBuffer<cr>
 
 " ------ nvim specific ------
 if has('nvim')
   tnoremap jj <C-\><C-N>
   tnoremap <C-W> <C-\><C-N><C-W>
-  nnoremap <C-P> :Unite -no-split -buffer-name=files -start-insert file_rec/neovim<cr>
 endif
 
 augroup formatting