aboutsummaryrefslogtreecommitdiff
path: root/autoload/grep.kak
blob: 13a44bd719f1c27442c9b464d5541c429b629748 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
set-option global grepcmd "rg -S --vimgrep --hidden -g '!**/.git/**'"

map global file g ":grep ''<left>" -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 '{}'"
  }
}

# TODO: Proper mappings for next/prev on results
hook global -always BufOpenFifo '\*grep\*' %{ map global normal <minus> ': grep-next-match<ret>' }
hook global -always BufOpenFifo '\*make\*' %{ map global normal <minus> ': make-next-error<ret>' }