3 ms·
To have completion with bash you can use this: function _jump { local cur=${COMP_WORDS[COMP_CWORD]} local marks=$(find $MARKPATH -type l -printf
by nkuttler 13y ago
To have completion with bash you can use this:
function _jump {
local cur=${COMP_WORDS[COMP_CWORD]}
local marks=$(find $MARKPATH -type l -printf "%f\n")
COMPREPLY=($(compgen -W '${marks[@]}' -- "$cur"))
return 0
}
complete -o default -o nospace -F _jump jump
Bash completion really needs better docs :-|
- Lifescape 13y agoI was in the process of doing this myself and though "I wonder if it's already been posted in the comments". Thank you!
- aaren 13y agoI just signed in to post almost exactly this function!
- christiangenco 13y agoHmmm, this doesn't seem to work in `zsh`. Typing `jump <tab>` suggests everything in the current directory (folders and files). Does anyone here know offhand how autocompletion in `zsh` works?