set-option global grepcmd "rg -S --vimgrep --hidden -g '!**/.git/**'" map global file g ":grep ''" -docstring 'Grep' define-command grep-write %{ execute-keys '%' # Consider selecting manually evaluate-commands %sh{ echo "$kak_selections" | "$kak_config/scripts/apply_vimgrep_updates.fnl" | xargs -i echo "info '{}'" } } hook global -always BufOpenFifo '\*grep\*' %{ map global file ] ': grep-next-match' map global file [ ': grep-previous-match' } hook global -always BufOpenFifo '\*make\*' %{ map global file ] ': make-next-error' map global file [ ': make-previous-error' } # TODO: Prevent exiting command mode from grep # define-command live-grep %{ # prompt -on-change %{ eval %sh{ [ -z "$kak_text" ] || echo "grep $kak_text" } } 'live-grep: ' %{ info done } # }