[nvim] Fix fzf cmd & coloring

Fix various little fzf annoyances: Implement good coloring of floating
window. Make it use fd by default, search through hidden files but
ignore the git directory itself.

Also, let it split the window on s and vertical split on v.
This commit is contained in:
Marty Oehme 2020-02-27 10:07:09 +01:00
parent a390d14390
commit 4010b3ffc1
No known key found for this signature in database
GPG Key ID: 0CCB0526EFB9611A

View File

@ -8,10 +8,10 @@ let g:fzf_command_prefix = 'Fzf'
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'gutter': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'gutter': ['bg', 'Normal'],
\ 'bg+': ['bg', 'Normal', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'border': ['fg', 'Ignore'],
@ -20,10 +20,10 @@ let g:fzf_colors =
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
" add some additional actions TODO perhaps unify with NerdTree mappings
let g:fzf_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-x': 'split',
\ 'ctrl-s': 'split',
\ 'ctrl-v': 'vsplit' }
" FzfRg but also search through hidden files
@ -34,7 +34,8 @@ command! -bang -nargs=* FzfRgHidden
" make fzf use the nvim floating window globally. (weee, technology!)
"
let $FZF_DEFAULT_OPTS="--layout=reverse "
let $FZF_DEFAULT_OPTS="--layout=reverse --ansi"
let $FZF_DEFAULT_COMMAND="fd --type f --hidden --color=always -E '.git/'"
" to use fzf in a floating window only conditionally, the best approach would
" every command we want to floatize
if has('nvim-0.4.0') || has("patch-8.2.0191")