chore(nvim): add fzf plugin, configuration, and mappings

This commit is contained in:
Stefan Imhoff
2021-12-03 19:03:39 +01:00
parent 315bbe3d51
commit b5cbf2ac5c
2 changed files with 24 additions and 0 deletions

View File

@@ -208,6 +208,7 @@ endif
call plug#begin(data_dir . '/plugins')
source ~/.config/nvim/plugins/base16-vim.vim
source ~/.config/nvim/plugins/fzf.vim
call plug#end()
doautocmd User PlugLoaded

23
nvim/plugins/fzf.vim Normal file
View File

@@ -0,0 +1,23 @@
" A command-line fuzzy finder
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
" Key bindings
let g:fzf_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-x': 'split',
\ 'ctrl-v': 'vsplit' }
" Popup window centered on the screen
let g:fzf_layout = { 'window': { 'width': 0.8, 'height': 0.8 } }
" Enable per-command history
let g:fzf_history_dir = '~/.local/share/fzf-history'
" Mappings
map <C-f> :Files<CR>
map <leader>b :Buffers<CR>
nnoremap <leader>r :Rg<CR>
nnoremap <leader>gs :GFiles?<CR>
nnoremap <leader>t :Tags<CR>
nnoremap <leader>m :Marks<CR>