commit f21eefac25ca70850350873a001074d916645e0b parent 8d187931645e4873a5e9ffc2e51efea116e10a78 Author: Ashymad <czilukim@o2.pl> Date: Sun, 14 Jan 2018 14:57:14 +0100 Reverse search in fish Diffstat:
| M | .config/fish/config.fish | | | 8 | +------- |
| A | .config/fish/functions/fish_user_key_bindings.fish | | | 3 | +++ |
| A | .config/fish/functions/reverse_search.fish | | | 5 | +++++ |
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/.config/fish/config.fish b/.config/fish/config.fish @@ -4,13 +4,7 @@ alias ec "emacsclient -a \"\"" alias fcd 'cd (fd -I -L -d 8 -t d . ~ | fzf)' alias bash 'env FISH_RAMP_DISABLE=1 bash' alias psgr 'ps aux | grep' +source /usr/share/autojump/autojump.fish -function reverse_search - commandline -r (grep '^- cmd: ' ~/.local/share/fish/fish_history | cut -c 8- | fzf) -end -function fish_user_keybindings - bind \cr reverse_search -end - diff --git a/.config/fish/functions/fish_user_key_bindings.fish b/.config/fish/functions/fish_user_key_bindings.fish @@ -0,0 +1,3 @@ +function fish_user_key_bindings + bind \cr reverse_search +end diff --git a/.config/fish/functions/reverse_search.fish b/.config/fish/functions/reverse_search.fish @@ -0,0 +1,5 @@ +function reverse_search + set command (tac ~/.local/share/fish/fish_history | grep '^- cmd: ' | cut -c 8- | fzf) + commandline -r "$command" +end +