How do named directories '~' work in ble.sh? #299
-
I noticed that apparently ble.sh supports static named directories like zsh. In zsh:
And there's tab completion.
the default named directories show and I can navigate to them like in zsh, but how do I add and delete them? I don't find documentation for them. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
This isn't the feature of |
Beta Was this translation helpful? Give feedback.
-
It is not possible to change the behavior of Bash's tilde expansion, but I'm currently thinking about the approximation by sabbrev expansion with the following setup: # blerc
# Edit (2023-03-09): Now the following two lines are already contained in ble.sh
# ble/widget/magic-insert() { ble/complete/sabbrev/expand; ble/widget/self-insert; }
# ble-bind -f / magic-insert
# The list of "named directories"
ble-sabbrev \~mydir1=/home/murase/mydir1
ble-sabbrev \~mydir2=/home/murase/mydir1/mydir2 Then $ cd ~mydir1 # <-- press SP or / will expand ~mydir1 to the registered sabbrev contents
$ cd /home/murase/mydir1/ # Example |
Beta Was this translation helpful? Give feedback.
-
Oh awesome, I immediately thought this behaviour could be replicated pretty easily somehow and yeah it can. Great thank you. |
Beta Was this translation helpful? Give feedback.
It is not possible to change the behavior of Bash's tilde expansion, but I'm currently thinking about the approximation by sabbrev expansion with the following setup:
Then