Skip to content

Commit

Permalink
[fish] Enable home dir expansion of leading ~/
Browse files Browse the repository at this point in the history
Enable expanding to user's home directory, when pressing <Ctrl-T> or
<Alt-C>, and the current command line token starts with `~/`.
  • Loading branch information
bitraid authored and junegunn committed Dec 19, 2024
1 parent 7bd298b commit 3b0f976
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions shell/key-bindings.fish
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ function fzf_key_bindings
set -l prefix (string match -r -- '^-[^\s=]+=' $commandline)
set commandline (string replace -- "$prefix" '' $commandline)

# Enable home directory expansion of leading ~/
set commandline (string replace -r -- '^~/' '\$HOME/' $commandline)

# escape special characters, except for the $ sign of valid variable names,
# so that after eval, the original string is returned, but with the
# variable names replaced by their values.
Expand Down

0 comments on commit 3b0f976

Please sign in to comment.