Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. " Unite
  2. let g:unite_source_history_yank_enable=1
  3. let g:unite_source_file_rec_max_cache_files=0
  4. call unite#custom#source('file_mru,file_rec,file_rec/async,grepocate',
  5. \ 'max_candidates', 0)
  6. call unite#custom#source('file_mru,file_rec,file_rec/async,grepocate',
  7. \ 'ignore_pattern',
  8. \ '\%(^\|/\)\.$\|\~$\|\.\%(o\|exe\|dll\|bak\|DS_Store\|zwc\|pyc\|sw[po]\|class\)$'.
  9. \ '\|\%(^\|/\)\%(\.hg\|\.git\|\.bzr\|\.svn\|\.sass-cache\|bower_components\|node_modules\|.tmp\|tags\%(-.*\)\?\)\%($\|/\)')
  10.  
  11. let g:unite_source_rec_async_command='ag --nocolor --nogroup --ignore ".hg" --ignore ".svn" --ignore ".git" --ignore ".bzr" --ignore-dir "bower_components" --hidden -g ""'
  12.  
  13. "use ag for search
  14. if executable('ag')
  15. let g:unite_source_grep_command = 'ag'
  16. let g:unite_source_grep_default_opts = '--nogroup --nocolor --column --ignore-dir "bower_components" --ignore-dir ".tmp" --ignore-dir "dist"'
  17. let g:unite_source_grep_recursive_opt = ''
  18. endif
  19.  
  20. call unite#filters#matcher_default#use(['matcher_fuzzy'])
  21. nnoremap <leader>t :Unite -no-split -buffer-name=files -start-insert file_rec/async:!<cr>
  22. nnoremap <leader>f :Unite -no-split -buffer-name=files -start-insert file<cr>
  23. nnoremap <leader>r :Unite -no-split -buffer-name=mru -start-insert file_mru<cr>
  24. nnoremap <leader>o :Unite -no-split -buffer-name=outline -start-insert outline<cr>
  25. nnoremap <leader>y :Unite -no-split -buffer-name=yank history/yank<cr>
  26. nnoremap <leader>b :Unite -no-split -buffer-name=buffer -start-insert buffer<cr>
  27. nnoremap <leader>/ :Unite -no-quit -keep-focus grep:.<cr>
  28. "nnoremap <leader>s :Unite -quick-match buffer<cr>
  29.  
  30. " Custom mappings for the unite buffer
  31. autocmd FileType unite call s:unite_settings()
  32. function! s:unite_settings()
  33. " Play nice with supertab
  34. let b:SuperTabDisabled=1
  35. " Enable navigation with control-j and control-k in insert mode
  36. imap <buffer> <C-j> <Plug>(unite_select_next_line)
  37. imap <buffer> <C-k> <Plug>(unite_select_previous_line)
  38. endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement