Skip to content

How do named directories '~' work in ble.sh? #299

Answered by akinomyoga
mozirilla213 asked this question in Q&A

You must be logged in to vote

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

Replies: 3 comments 2 replies

You must be logged in to vote
1 reply
@mozirilla213

You must be logged in to vote
0 replies
Answer selected by mozirilla213

You must be logged in to vote
1 reply
@akinomyoga

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants