diff --git a/fish/functions/expand_dots.fish b/fish/functions/expand_dots.fish new file mode 100644 index 0000000..edf014e --- /dev/null +++ b/fish/functions/expand_dots.fish @@ -0,0 +1,12 @@ +# https://github.com/nickeb96/puffer-fish +function expand_dots -d 'Expand ... to ../..' + set -l item (string split ' ' (commandline --cut-at-cursor))[-1] + switch $item + case './*' + commandline --insert '.' + case '*..' + commandline --insert '/..' + case '*' + commandline --insert '.' + end +end diff --git a/fish/functions/fish_user_key_bindings.fish b/fish/functions/fish_user_key_bindings.fish index 583b909..66d8c9a 100644 --- a/fish/functions/fish_user_key_bindings.fish +++ b/fish/functions/fish_user_key_bindings.fish @@ -10,4 +10,7 @@ function fish_user_key_bindings bind \cp __fzf_files bind \cg __fzf_git_log bind \cr __fzf_history + + # Expand '...' to '../..' + bind . expand_dots end