Complete only directory #618
-
When going through complicated tree of directories, I get sometime to a subdirectory, which has hundreds of files in it, but just few subdirectories. I would need to limit ble.sh to complete only sudirectories, so I don't have to list through all those files when I know it is useless. Is there a way? |
Beta Was this translation helpful? Give feedback.
Answered by
akinomyoga
Aug 21, 2025
Replies: 1 comment 1 reply
-
You may define a custom completion context for the directory names and bind it to a specific key. This is an example: # blerc
function ble/complete/context:dirname/generate-sources {
ble/complete/context:syntax/generate-sources || return "$?"
ble/complete/context/overwrite-sources file:directory
}
# For emacs editing mode
ble-bind -m emacs -f 'C-x d' 'complete show_menu:context=dirname'
ble-bind -m emacs -f 'M-d' 'complete context=dirname'
# For vi editing mode
ble-bind -m vi_imap -f 'C-x d' 'vi_imap/menu-complete context=dirname'
ble-bind -m vi_imap -f 'M-d' 'complete context=dirname' |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mcepl
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You may define a custom completion context for the directory names and bind it to a specific key. This is an example: