diff --git a/.config/git/ignore b/.config/git/ignore index 381ee79..db769e2 100644 --- a/.config/git/ignore +++ b/.config/git/ignore @@ -1,3 +1,6 @@ +# Ignore .git directory (mostly for tools like rg and fd) +/.git + # Ignore all compiled zsh-files *.zwc diff --git a/.config/vim/vimrc.d/20-plugins.vim b/.config/vim/vimrc.d/20-plugins.vim index 0f5b06c..d54acd9 100644 --- a/.config/vim/vimrc.d/20-plugins.vim +++ b/.config/vim/vimrc.d/20-plugins.vim @@ -30,26 +30,3 @@ if (exists("g:loaded_tmux_navigator")) " Disable tmux navigator when zooming the Vim pane let g:tmux_navigator_disable_when_zoomed = 1 endif - -if (get(g:, 'loaded_fzf')) - " Redefine :Rg to ignore the .git directory - let s:rg_to_add = " -g ['\"]!.git['\"] " - let s:rg_desc = get(nvim_get_commands({}), 'Rg', {}) - - if get(s:rg_desc, 'definition', s:rg_to_add) !~ s:rg_to_add - " Adjust quotes depending on the definition - let s:rg_quote = s:rg_desc['definition'] =~ '^[^(]*("' ? "'" : '"' - let s:rg_to_add = substitute(s:rg_to_add, "\\V['\"]", s:rg_quote, 'g') - - let s:rg_definition = substitute(s:rg_desc['definition'], ' -- ', - \ s:rg_to_add .. '-- ', '') - " See :h command-attributes - " TODO: what is complete_arg? - let s:opts = filter(copy(s:rg_desc), - \ {key, val -> -1 < index(['nargs', 'complete', 'range', 'count', - \ 'addr', 'bang', 'bar', 'register', - \ 'keepscript'], key) - \ }) - call nvim_create_user_command('Rg', s:rg_definition, s:opts) - endif -endif diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index d2f96df..383d97a 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -106,8 +106,8 @@ FZF_DEFAULT_COMMAND_NO_RG+=" | cut -c3-" export FZF_DEFAULT_COMMAND_NO_RG if (( $+commands[rg] )); then - # Prune `.git/` and everything ignored by gitignore(5) - FZF_DEFAULT_COMMAND="rg -L --files -g '!.git'" + # Ignore gitignore(5)d files, see also $XDG_CONFIG_HOME/git/ignore + FZF_DEFAULT_COMMAND="rg -L --files" else # Fallback to hardcoding the most important paths to prune FZF_DEFAULT_COMMAND="$FZF_DEFAULT_COMMAND_NO_RG"