CtrlP all the way

This commit is contained in:
ViViDboarder 2014-11-04 10:15:54 -08:00
parent 1e51cf2ade
commit fa5cf71b03

86
vimrc
View File

@ -18,16 +18,7 @@ Plugin 'file-line' " Allow opening to a line from file name using :
Plugin 'tpope/vim-fugitive' " Git integration Plugin 'tpope/vim-fugitive' " Git integration
" -- Fuzzy Finders -- " -- Fuzzy Finders --
if ! exists('use_command_t') Plugin 'ctrlpvim/ctrlp.vim' " Quick find files in project
let use_command_t = 1
end
" Needs Vim compiled with Ruby
" Quick find files in project
if use_command_t == 1 && has('ruby')
Plugin 'wincent/Command-T'
else
Plugin 'ctrlpvim/ctrlp.vim'
end
" -- Buffer Nav -- " -- Buffer Nav --
Plugin 'sandeepcr529/Buffet.vim' " Quick buffer switching Plugin 'sandeepcr529/Buffet.vim' " Quick buffer switching
@ -319,60 +310,29 @@ nnoremap <silent> <F8> :TagbarToggle<CR>
" Autofocus tagbar " Autofocus tagbar
let g:tagbar_autofocus = 1 let g:tagbar_autofocus = 1
" --------------- " CtrlP settings
" Command T and ctrlp.vim " Ensure max height isn't too large. (for performance)
" Snagged from mutewinter @ https://github.com/mutewinter/dot_vim let g:ctrlp_max_height = 10
" --------------- " Conditional Mappings
let g:ctrlp_map = '<C-t>'
" Dynamically use Command T or ctrlp.vim based on availability of Ruby. " Allow ctrl p to open over the initial nerdtree window
" We do this because Command T is much faster than ctrlp.vim. let g:ctrlp_dont_split = 'netrw'
if use_command_t == 1 && has('ruby') " Support tag jumping
" Use Command T since we've got Ruby let g:ctrlp_extensions = ['tag', 'buffertag']
" Support Apex language
" Set the default escape keybinding to, you guessed it, escape. let g:ctrlp_buftag_types = {
let g:CommandTCancelMap = '<esc>'
" Ensure Ctrl-P isn't bound by default
let g:ctrlp_map = ''
" Ensure max height isn't too large. (for performance)
let g:CommandTMaxHeight = 10
" Mappings
nnoremap <silent><C-t> :CommandT<CR>
nnoremap <silent><C-b> :CommandTBuffer<CR>
" Leader Commands
nnoremap <leader>t :CommandT<CR>
nnoremap <leader>b :CommandTBuffer<CR>
nnoremap <leader>tt :CommandTTag<CR>
else
" Use ctrlp.vim since we don't have Ruby
" Ensure max height isn't too large. (for performance)
let g:ctrlp_max_height = 10
" Conditional Mappings
let g:ctrlp_map = '<C-t>'
" Allow ctrl p to open over the initial nerdtree window
"let g:ctrlp_dont_split = 'NERD_tree_2'
"let g:ctrlp_dont_split = 'NERD'
let g:ctrlp_dont_split = 'netrw'
" Support tag jumping
let g:ctrlp_extensions = ['tag', 'buffertag']
" Support Apex language
let g:ctrlp_buftag_types = {
\ 'apex' : '--language-force=c#', \ 'apex' : '--language-force=c#',
\ } \ 'go' : {
\ 'bin' : 'gotags',
" Leader Commands \ 'args' : '-sort -silent',
nnoremap <leader>b :CtrlPBuffer<CR> \}
nnoremap <leader>t :CtrlPBufTag<CR> \}
nnoremap <leader>r :CtrlPTag<CR> " Leader Commands
nnoremap <leader>u :CtrlPCurFile<CR> nnoremap <leader>b :CtrlPBuffer<CR>
nnoremap <leader>m :CtrlPMRUFiles<CR> nnoremap <leader>t :CtrlPBufTag<CR>
nnoremap <leader>r :CtrlPTag<CR>
nnoremap <leader>u :CtrlPCurFile<CR>
nnoremap <leader>m :CtrlPMRUFiles<CR>
endif endif
" fugitive " fugitive