From 5234b58c1339a31a858ff27ea463433f3e9c3ef9 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 12 Jul 2015 20:02:22 -0400 Subject: vimrc: Add unite.vim mappings * Mappings to open files and buffers with Unite.vim in split buffers and tabs * Use fuzzy matching * Use `ag` as the backing grep program to make things faster --- vimrc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'vimrc') diff --git a/vimrc b/vimrc index 3c3e139..45114d1 100644 --- a/vimrc +++ b/vimrc @@ -446,6 +446,26 @@ nnoremap sf :CommandTFlush let g:CommandTWildIgnore=&wildignore . ",*/vendor/*,*/node_modules/*" +" Unite +" http://stackoverflow.com/a/17387785 +if executable('ag') + let g:unite_source_grep_command = 'ag' + let g:unite_source_grep_default_opts = '--nogroup --nocolor --column' + let g:unite_source_grep_recursive_opt = '' +endif + +call unite#filters#matcher_default#use(['matcher_fuzzy']) + +nnoremap add :Unite -start-insert -immediately file_rec +nnoremap abb :Unite -start-insert -immediately buffer +nnoremap ads :Unite -start-insert -immediately file_rec split +nnoremap abs :Unite -start-insert -immediately buffer split +nnoremap adv :Unite -start-insert -immediately file_rec vsplit +nnoremap abv :Unite -start-insert -immediately buffer vsplit +nnoremap adt :Unite -start-insert -immediately file_rec tabopen +nnoremap abt :Unite -start-insert -immediately buffer tabopen + + " PreserveNoEOL let g:PreserveNoEOL = 1 -- cgit v1.2.3