~yerinalexey/dotfiles

ref: 3bb7991839c26fe59674184fc6822f7477751f93 dotfiles/nvim/fzf.vim -rw-r--r-- 756 bytes
3bb79918Alexey Yerin river: decrease wob height 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
" Configuration for FZF (fuzzy finder)

" Find a file in Zig standard library
command! Zig Files /usr/lib/zig/std

" Default GFiles to Files if not in git repository
function! s:fzf_files()
  let git_root = split(system('git rev-parse --show-toplevel'), '\n')[0]
  if v:shell_error
    Files
  else
    GFiles
  end
endfunction

" Bindings
nmap <silent> <C-p> <Cmd>call <SID>fzf_files()<cr>

let g:fzf_preview_window = 'right:55%'

" Window placement
let g:fzf_layout = { 'down': '40%' }

" Open file in new tab by default
let g:fzf_action = {
\  'enter': 'tabedit',
\  'alt-enter': 'edit',
\  'alt-s': 'split',
\  'alt-v': 'vsplit'
\}

augroup fzf
  au!

  " Disable line numbers in fzf window
  au FileType fzf setl nonumber norelativenumber
augroup END