From 3b0f9763800adbb82e3241baba0d3a1db4f52c6b Mon Sep 17 00:00:00 2001 From: bitraid Date: Thu, 19 Dec 2024 11:14:54 +0200 Subject: [PATCH] [fish] Enable home dir expansion of leading ~/ Enable expanding to user's home directory, when pressing or , and the current command line token starts with `~/`. --- shell/key-bindings.fish | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish index 06955b6..9a0dcc3 100644 --- a/shell/key-bindings.fish +++ b/shell/key-bindings.fish @@ -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.