summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-07-07 11:15:46 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-07-07 11:15:46 +0000
commita032b627894660c9f1076019e29c1243ff72497a (patch)
tree82576e8f00821ccbfbdd8df4e74a7282fe6e40ea
parent75f853f2e309bd2ed98209eb64b47ca2bdcf46fb (diff)
downloadzsh-a032b627894660c9f1076019e29c1243ff72497a.tar.gz
zsh-a032b627894660c9f1076019e29c1243ff72497a.zip
Nikolai Weibull: new _vim completion
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Unix/Command/.distfiles57
-rw-r--r--Completion/Unix/Command/_vim74
3 files changed, 109 insertions, 28 deletions
diff --git a/ChangeLog b/ChangeLog
index 4df3d3403..f4aea74b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-07-07 Peter Stephenson <pws@csr.com>
+
+ * users/9045: Nikolai Weibull
+ <mailing-lists.zsh-users@rawuncut.elitemail.org>:
+ Completion/Unix/Command/_vim: new completion function.
+
2005-07-06 Peter Stephenson <pws@csr.com>
* 21402: Src/Zle/compmatch.c: Fix crash completing the set
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles
index 498ffdcaa..e61834a8a 100644
--- a/Completion/Unix/Command/.distfiles
+++ b/Completion/Unix/Command/.distfiles
@@ -1,39 +1,40 @@
DISTFILES_SRC='
.distfiles
-_a2ps _aap _ant _antiword _apachectl
-_apm _arp _arping _attr
+_a2ps _aap _ant _antiword _apachectl
+_apm _arp _arping _attr
_baz _bison _bittorrent _bogofilter _bzip2
_cal _ccal _cdcd _cdrecord _chkconfig
_chmod _chown _compress _configure _cpio
_cvs
-_darcs _dd _dict _diff _du
-_dvi _ecasound _elinks _elm _enscript
-_fakeroot _fetchmail _figlet _find _finger
+_darcs _dd _dict _diff _du
+_dvi _ecasound _elinks _elm _enscript
+_fakeroot _fetchmail _figlet _find _finger
_flex _fortune _fsh _fuser
-_gcc _gdb _getconf _getent _global
-_gnu_generic _gpg _gphoto2 _gprof _grep
-_groff _gs _gzip
-_iconv _ifconfig _imagemagick _init_d _irssi
-_ispell _java _joe _killall _knock
-_last _less _links _loadkeys _look
-_lp _ls _lsof _lynx _lzop
-_mail _make _man _mencal _mh
+_gcc _gdb _getconf _getent _global
+_gnu_generic _gpg _gphoto2 _gprof _grep
+_groff _gs _gzip
+_iconv _ifconfig _imagemagick _init_d _irssi
+_ispell _java _joe _killall _knock
+_last _less _links _loadkeys _look
+_lp _ls _lsof _lynx _lzop
+_mail _make _man _mencal _mh
_mount _mpc _mt _mtools _mtr
-_mutt _mysql_utils _mysqldiff
-_ncftp _netcat _nice _nmap _nslookup
-_pack _patch _pbm _perforce _perl
-_perldoc _php _pine _postfix _prcs
-_printenv _psutils _python
-_raggle _rar _rcs _renice _rlogin
-_rsync _ruby
-_sablotron _samba _sccs _screen _sed
+_mutt _mysql_utils _mysqldiff
+_ncftp _netcat _nice _nmap _nslookup
+_pack _patch _pbm _perforce _perl
+_perldoc _php _pine _postfix _prcs
+_printenv _psutils _python
+_raggle _rar _rcs _renice _rlogin
+_rsync _ruby
+_sablotron _samba _sccs _screen _sed
_sh _showmount _slrn _socket _spamassassin
_ssh _strip _stty _su _subversion
-_sudo _surfraw _sysctl
-_tar _telnet _texinfo _tidy _tiff
-_tin _tla
-_unace _uniq _user_admin _vorbis _vux
-_w3m _webbrowser _wget _whereis _whois
-_wiggle _xargs _xmlsoft
-_yodl _yp _zcat _zdump _zip
+_sudo _surfraw _sysctl
+_tar _telnet _texinfo _tidy _tiff
+_tin _tla
+_unace _uniq _user_admin
+_vim _vorbis _vux
+_w3m _webbrowser _wget _whereis _whois
+_wiggle _xargs _xmlsoft
+_yodl _yp _zcat _zdump _zip
'
diff --git a/Completion/Unix/Command/_vim b/Completion/Unix/Command/_vim
new file mode 100644
index 000000000..81af64546
--- /dev/null
+++ b/Completion/Unix/Command/_vim
@@ -0,0 +1,74 @@
+#compdef vim
+
+_vim_files () {
+ if [[ $(echo $PREFIX*(N)) == '' ]]; then
+ case $PREFIX in
+ (+) _message -e 'start at a given line (default: end of file)' ;;
+ (+<1->) _message -e 'line number' ;;
+ esac
+ fi
+ case $PREFIX in
+ (+*) _files -P './' $* ;;
+ (*) _files $* ;;
+ esac
+}
+
+local arguments
+
+arguments=(
+ '( -e -s -d -y)-v[vi mode]'
+ '(-v -d -y)-e[ex mode]'
+ '(-v -e -s -y)-d[diff mode]'
+ '(-v -e -s -d )-y[easy mode]'
+ '-R[readonly mode]'
+ '-Z[restricted mode]'
+ '-m[modifications (writing files) not allowed]'
+ '-M[modifications in text not allowed]'
+ '-b[binary mode]'
+ '-l[lisp mode]'
+ '-C[make vim compatible with vi]'
+ '-N[do not force compatibility with vi]'
+ '-V-[verbosity level]::verbosity:((0\:"do not display any messages"
+ 1\:"display when viminfo file is read or written"
+ 2\:"display sourced files"
+ 5\:"display every searched tag-file"
+ 8\:"display files that trigger autocommands"
+ 9\:"display every triggered autocommand (default)"
+ 12\:"display every executed function"
+ 13\:"report every thrown, caught, finished, or discarded exception"
+ 14\:"display anything pending in a \:finally clause"
+ 15\:"display every executed ex-command"))'
+ '-D[debugging mode]'
+ '-n[no swap file (memory only)]'
+ {-r,-L}'[list swap files and exit or recover from a swap file]::swap file:_vim_files -g \*.sw\?'
+ '( -H -F)-A[start in Arabic mode]'
+ '(-A -F)-H[start in Hebrew mode]'
+ '(-A -H )-H[start in Farsi mode]'
+ '-T[set terminal type]:::_terminals'
+ '-u[use given RC file instead of default .vimrc]::rc file:_files'
+ '--noplugin[do not load plugin scripts]'
+ '-o-[number of windows to open (default: one for each file)]::window count: '
+ '-O-[number of windows to vertically split open (default is one for each file)]::window count: '
+ '*--cmd[execute given command before loading any RC files]:command: '
+ '-c[executed given command after loading the first file]:command: '
+ '-S[source a session file after loading the first file]:session file:_files'
+ '-s[read normal-mode commands from script file]:script file:_files'
+ '-w[append all typed commands to given file]:output file:_files'
+ '-W[write all typed commands to given file]:output file:_files'
+ '-x[edit encrypted files]'
+ '-X[do not connect to X server]'
+ '--remote[edit given files in a vim server if possible]:*:file:_vim_files'
+ '--remote-silent[as --remote but without complaining if not possible]:*:file:_vim_files'
+ '--remote-wait[as --remote but wait for files to have been edited]:*:file:_vim_files'
+ '--remote-wait-silent[as --remote-wait but without complaining if not possible]:*:file:_vim_files'
+ '--remote-send[send given keys to vim server if possible]:keys: '
+ '--remote-expr[evaluate given expression in a vim server and print result]:expression: '
+ '(- *)--serverlist[list available vim servers and exit]'
+ '--servername[name of vim server to send to or name of server to become]:server name: '
+ '-i[use given viminfo file instead of default .viminfo]:viminfo file:_files'
+ '(- *)'{-h,--help}'[print help and exit]'
+ '(- *)--version[print version information and exit]'
+ '*:file:_vim_files'
+)
+
+_arguments -S $arguments