diff options
Diffstat (limited to 'navi.plugin.fish')
-rw-r--r-- | navi.plugin.fish | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/navi.plugin.fish b/navi.plugin.fish index ffae787..ddb6079 100644 --- a/navi.plugin.fish +++ b/navi.plugin.fish @@ -1,21 +1,13 @@ -function navi-widget -d 'Call navi' - set -q NAVI_USE_FZF_ALL_INPUTS; or set -l NAVI_USE_FZF_ALL_INPUTS "true" +function navi-widget -d "Show cheat sheets" 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 + stty sane + env NAVI_USE_FZF_ALL_INPUTS=true navi --print query (commandline) | perl -pe 'chomp if eof' | read -lz result + and commandline -- $result end - - # commandline -f repaint + commandline -f repaint end bind \cg navi-widget - if bind -M insert > /dev/null 2>&1 bind -M insert \cg navi-widget end |