[ADD] Fuzzy file finder for Vim, Bash, Zsh

Mappings for vcs files, all files, buffers, buffer history, and tags
have been added to the Vim configuration.

The installation process automatically adds the fzf sourcing commands to
both Bash and Zsh configuration files.
This commit is contained in:
Bruno BELANYI 2019-07-13 23:04:44 +02:00
parent f11c45e987
commit 36b3757e67
3 changed files with 28 additions and 0 deletions

View file

@ -66,3 +66,5 @@ if [[ $TERM == xterm-termite ]]; then
. /etc/profile.d/vte.sh . /etc/profile.d/vte.sh
__vte_prompt_command __vte_prompt_command
fi fi
[ -f ~/.fzf.bash ] && source ~/.fzf.bash

View file

@ -84,6 +84,10 @@ Plug 'tpope/vim-fugitive'
Plug 'ludovicchabant/vim-gutentags' Plug 'ludovicchabant/vim-gutentags'
" Handling multiple cscopes for gutentags " Handling multiple cscopes for gutentags
Plug 'skywind3000/gutentags_plus' Plug 'skywind3000/gutentags_plus'
" Fuzzy file finder (installs zfz system-wide)
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
" Pre-written functions for fzf mappings
Plug 'junegunn/fzf.vim'
" Vim facilities enhancement " Vim facilities enhancement
"""""""""""""""""""""""""""" """"""""""""""""""""""""""""
@ -103,6 +107,8 @@ Plug 'tpope/vim-repeat'
" Some ex command mappings " Some ex command mappings
Plug 'tpope/vim-unimpaired' Plug 'tpope/vim-unimpaired'
" Snippets
""""""""""
" Snippet manager " Snippet manager
Plug 'SirVer/ultisnips' Plug 'SirVer/ultisnips'
" Snippet files for Ulti Snips " Snippet files for Ulti Snips
@ -195,13 +201,31 @@ map <Leader>es :source $MYVIMRC<CR>
noremap <Leader>m :silent! :make! \| :redraw!<CR> noremap <Leader>m :silent! :make! \| :redraw!<CR>
" Mapping for quickfix bindings " Mapping for quickfix bindings
" Next and previous in quick-fix list
nmap <Leader>fn <Plug>(qf_qf_next) nmap <Leader>fn <Plug>(qf_qf_next)
nmap <Leader>fp <Plug>(qf_qf_previous) nmap <Leader>fp <Plug>(qf_qf_previous)
" Next and previous in location list
nmap <Leader>ln <Plug>(qf_loc_next) nmap <Leader>ln <Plug>(qf_loc_next)
nmap <Leader>lp <Plug>(qf_loc_previous) nmap <Leader>lp <Plug>(qf_loc_previous)
" Toggle quick-fix and location lists
nmap <Leader>tf <Plug>(qf_qf_toggle) nmap <Leader>tf <Plug>(qf_qf_toggle)
nmap <Leader>tl <Plug>(qf_loc_toggle) nmap <Leader>tl <Plug>(qf_loc_toggle)
" Fuzzy file finder bindings
" Only git-tracked files, Vim needs to be in a Git repository
nmap <Leader>fg :GFiles<CR>
" All files
nmap <Leader>ff :Files<CR>
" Currently open buffers
nmap <Leader>fb :Buffers<CR>
" Buffer history
nmap <Leader>fh :History<CR>
" Tags in buffer
nmap <Leader>ft :BTags<CR>
" Tags in all project files
nmap <Leader>fT :Tags<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Status line " Status line
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

View file

@ -104,3 +104,5 @@ if [[ $TERM == xterm-termite ]]; then
. /etc/profile.d/vte.sh . /etc/profile.d/vte.sh
__vte_osc7 __vte_osc7
fi fi
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh