fish: add '...' key binding

This commit is contained in:
Charles Gould 2021-06-17 22:39:32 -04:00
parent 109c5787f1
commit 4146c9200e
2 changed files with 15 additions and 0 deletions

View File

@ -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

View File

@ -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