require-module grep # 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 ': grep-jump-current-line' try %{ remove-highlighter window/number-lines remove-highlighter window/show-whitespaces ui-wrap-disable } }