From bc4e4cbd411deeac5feaec0b34074a1bb722b705 Mon Sep 17 00:00:00 2001 From: Sebastian Tramp Date: Tue, 1 May 2012 10:17:48 +0200 Subject: [PATCH] add initial autocmd completion --- functions.d/_autocmd | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 functions.d/_autocmd diff --git a/functions.d/_autocmd b/functions.d/_autocmd new file mode 100644 index 0000000..3c1e952 --- /dev/null +++ b/functions.d/_autocmd @@ -0,0 +1,22 @@ +#compdef -k menu-complete ^@^@ + +# autocmd is a tool to reuse command lines you've written last time +# in the current directory. In addition to that, autocommand can suggest +# commands based on the content of the current directory. +# +# autocommand is initiated with control + space + space. +# +# The name autocmd does not refer to the vim command of the same name +# but to the autojump tool from Joel Schaerer. + +# kudos to Bart Schaefer for the completion script +# http://www.zsh.org/mla/workers/2011/msg01107.html +zmodload -i zsh/complist +_cmdselect() { +local -a commands +commands=(${(f)"$(< ~/.cmdselect)"}) +compadd -Qa commands +MENUSELECT=0 +compstate[insert]=menu +} +_cmdselect "$@"