diff options
Diffstat (limited to 'app-editors/vim/files/vim-completion')
-rw-r--r-- | app-editors/vim/files/vim-completion | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/app-editors/vim/files/vim-completion b/app-editors/vim/files/vim-completion new file mode 100644 index 0000000..157b546 --- /dev/null +++ b/app-editors/vim/files/vim-completion @@ -0,0 +1,36 @@ +# Author: Ciaran McCreesh <ciaranm@gentoo.org> +# +# completion for vim + +_vim() +{ + local cur prev cmd args + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + cmd=${COMP_WORDS[0]} + + if [[ "${prev}" == "--servername" ]] ; then + local servers + servers=$(gvim --serverlist ) + COMPREPLY=( $( compgen -W "${servers}" -- $cur ) ) + + elif [[ "${prev}" == -[uUi] ]] ; then + COMPREPLY=( $( compgen -W "NONE" ) \ + $( compgen -f -X "!*vim*" -- "$cur" ) ) + + elif [[ "${cur}" == -* ]] ; then + args='-t -q -c -S --cmd -A -b -C -d -D -e -E -f --nofork \ + -F -g -h -H -i -L -l -m -M -N -n -nb -o -R -r -s \ + -T -u -U -V -v -w -W -x -X -y -Y -Z --echo-wid \ + --help --literal --noplugin --version' + COMPREPLY=( $( compgen -W "${args}" -- $cur ) ) + else + _filedir + fi +} + +complete -o filenames -F _vim vim ex view evim rvim rview + +# vim: set ft=sh sw=4 et sts=4 : |