replace ctrl-p with fzf.vim

This commit is contained in:
ManjaroOne666 2018-12-12 21:18:10 +00:00
parent d332caa254
commit 0304b5070d
1 changed files with 52 additions and 16 deletions

68
vimrc
View File

@ -26,22 +26,22 @@ if !has('nvim')
Plug '~/.config/vim/vim/bundle/vim-learnxiny' Plug '~/.config/vim/vim/bundle/vim-learnxiny'
" #Ctrlp {{{ " #Ctrlp {{{
Plug 'ctrlpvim/ctrlp.vim' " Plug 'ctrlpvim/ctrlp.vim'
" :h ctrlp-commands " " :h ctrlp-commands
" :h ctrlp-extensions " " :h ctrlp-extensions
"
let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'undo'] " let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'undo']
"
if executable('ag') " if executable('ag')
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore " " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' " let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" ag is fast enough that CtrlP doesn't need to cache " " ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0 " let g:ctrlp_use_caching = 0
endif " endif
" Use ag over grep " " Use ag over grep
if executable('ag') " if executable('ag')
set grepprg=ag\ --nogroup\ --nocolor\ --ignore\ node_modules " set grepprg=ag\ --nogroup\ --nocolor\ --ignore\ node_modules
endif " endif
"}}} "}}}
" #Netrw {{{ " #Netrw {{{
@ -100,6 +100,42 @@ let g:mta_filetypes = {
nmap ga <Plug>(EasyAlign) nmap ga <Plug>(EasyAlign)
"}}} "}}}
" #vim-fzf {{{
" https://github.com/junegunn/fzf.vim
if executable('fzf') && v:version >= 704
Plug 'junegunn/fzf.vim'
nnoremap <space>ff :Files<CR>
nnoremap <space>ft :Tags<CR>
nnoremap <space>fb :Buffers<CR>
nnoremap <space>fh :Helptags<CR>
nnoremap <space>fa :Ag<CR>
nnoremap <space>fg :Ag!<CR>
" Ag! gives fullscreen with preview
command! -bang -nargs=* Ag
\ call fzf#vim#ag(<q-args>,
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
\ <bang>0)
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Label'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'WildMenu'],
\ 'info': ['fg', 'Comment'],
\ 'border': ['fg', 'Ignore'],
\ 'prompt': ['fg', 'Constant'],
\ 'pointer': ['fg', 'Special'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
endif
"}}}
" #vim-qlist {{{ " #vim-qlist {{{
" Original: https://github.com/romainl/vim-qlist " Original: https://github.com/romainl/vim-qlist
Plug 'studio-vx/vim-qlist' Plug 'studio-vx/vim-qlist'