From cf090d546c51713880e558b802aee3ab11aaa9cc Mon Sep 17 00:00:00 2001 From: Denis Isidoro Date: Mon, 14 Oct 2019 13:44:52 -0300 Subject: [PATCH] Add instructions for fish widget --- README.md | 3 +++ navi.plugin.fish | 26 +++++++++++--------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index a7027a8..d33b2c5 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,9 @@ source "$(navi widget bash)" # zsh source "$(navi widget zsh)" + +# fish +source (navi widget fish) ``` By default, `Ctrl+G` is assigned to launching **navi**. If you want to change the keybinding, replace the argument of `bind` or `bindkey` in [the widget file](https://github.com/denisidoro/navi/search?q=filename%3Anavi.plugin.*&unscoped_q=filename%3Anavi.plugin.*). diff --git a/navi.plugin.fish b/navi.plugin.fish index ce2ad8b..ddb6079 100644 --- a/navi.plugin.fish +++ b/navi.plugin.fish @@ -1,17 +1,13 @@ -function navi_key_bindings - function navi-widget -d "Show cheat sheet" - set -q FZF_TMUX_HEIGHT; or set FZF_TMUX_HEIGHT 40% - begin - set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT $FZF_DEFAULT_OPTS --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS +m" - 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 - end - - bind \cg navi-widget - if bind -M insert > /dev/null 2>&1 - bind -M insert \cg navi-widget +function navi-widget -d "Show cheat sheets" + begin + 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 +end + +bind \cg navi-widget +if bind -M insert > /dev/null 2>&1 + bind -M insert \cg navi-widget end