summaryrefslogtreecommitdiffstats
path: root/navi.plugin.fish
blob: ffae787c2ca46b9e2b62533fa2ea0de06d54cf8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function navi-widget -d 'Call navi'
  set -q NAVI_USE_FZF_ALL_INPUTS; or set -l NAVI_USE_FZF_ALL_INPUTS "true"
  begin
    navi --print | while read -l r; set result $result $r; end

    if [ -n "$result" ]
      echo $result

      # Remove last token from commandline.
      commandline -t ""
    end
  end

  # commandline -f repaint
end

bind \cg navi-widget

if bind -M insert > /dev/null 2>&1
  bind -M insert \cg navi-widget
end