dotfiles/.config/kak/autoload/grep.kak

21 lines
645 B
Text

provide-module ficgrep %~
# https://strongly-typed-thoughts.net/blog/kakoune-philosophy
set-option global grepcmd 'rg --column --smart-case --sort path'
# TODO: Highlight the actual search term, too? would be cool
define-command -hidden grep-jump-current-line %{
evaluate-commands -save-regs clp %{
execute-keys -draft 'ghT:"py2lT:"ly2lT:"cy'
edit -existing %reg{p} %reg{l} %reg{c}
}
}
hook global WinSetOption filetype=grep %{
map window normal <ret> ': grep-jump-current-line<ret>'
try %{
remove-highlighter window/number-lines
remove-highlighter window/show-whitespaces
ui-wrap-disable
}
}
~