On Apr 18, 4:23 am, Ted <[email protected]> wrote:
> I've also looked into hooking into bash to have it handle completion;
> there does not seem to be a straightforward way to do this, either.
> Here, the complications are due to what seems to be a lack of features
> in bash itself, so any advice is likely somewhat off-topic, but
> nonetheless welcome :)
>
Hi Ted,
Here is a bash script that prints the completions for apt-get. Maybe
you could generate such a script in Vim and call it to get the
completions. You can find the mappings from commands (apt-get) to bash
completion functions (_apt_get) in /etc/bash_completions.d/*. The
script was tested with bash 4.1.5.
Marko
#!/bin/bash
. /etc/bash_completion
COMP_LINE="apt-get "
echo "Completing: $COMP_LINE"
COMP_POINT=8
COMP_WORDS=( apt-get )
COMP_CWORD=1
_apt_get
echo "${COMPREPLY[@]}"
COMP_LINE="apt-get in"
echo "Completing: $COMP_LINE"
COMP_POINT=10
COMP_WORDS=( apt-get in )
COMP_CWORD=1
_apt_get
echo "${COMPREPLY[@]}"
> Is there an addon or a wiki page which provides such feature or a
> recipe to implement it?
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php