From 4010b3ffc1a7cb74b559d2a69f3d20169b155203 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 27 Feb 2020 10:07:09 +0100 Subject: [PATCH] [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. --- nvim/.config/nvim/plugin/fzf.vim | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nvim/.config/nvim/plugin/fzf.vim b/nvim/.config/nvim/plugin/fzf.vim index efa3701..e89fcd0 100644 --- a/nvim/.config/nvim/plugin/fzf.vim +++ b/nvim/.config/nvim/plugin/fzf.vim @@ -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")