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

12 lines
428 B
Text

# https://strongly-typed-thoughts.net/blog/kakoune-philosophy
set-option global grepcmd 'rg --column --smart-case --sort path'
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>'
}