aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2015-07-12 20:02:22 -0400
committerTeddy Wing2015-07-12 20:02:22 -0400
commit5234b58c1339a31a858ff27ea463433f3e9c3ef9 (patch)
tree72afda9705fbbd35dba30e3a2890073ac4ba8eb3
parent137e642714a0e60901ed8cee651b77f0cab8c7a2 (diff)
downloaddotvim-5234b58c1339a31a858ff27ea463433f3e9c3ef9.tar.bz2
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
-rw-r--r--vimrc20
1 files changed, 20 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index 3c3e139..45114d1 100644
--- a/vimrc
+++ b/vimrc
@@ -446,6 +446,26 @@ nnoremap <leader>sf :CommandTFlush<cr>
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 <leader>add :<c-u>Unite -start-insert -immediately file_rec<cr>
+nnoremap <leader>abb :<c-u>Unite -start-insert -immediately buffer<cr>
+nnoremap <leader>ads :<c-u>Unite -start-insert -immediately file_rec split<cr>
+nnoremap <leader>abs :<c-u>Unite -start-insert -immediately buffer split<cr>
+nnoremap <leader>adv :<c-u>Unite -start-insert -immediately file_rec vsplit<cr>
+nnoremap <leader>abv :<c-u>Unite -start-insert -immediately buffer vsplit<cr>
+nnoremap <leader>adt :<c-u>Unite -start-insert -immediately file_rec tabopen<cr>
+nnoremap <leader>abt :<c-u>Unite -start-insert -immediately buffer tabopen<cr>
+
+
" PreserveNoEOL
let g:PreserveNoEOL = 1