zsh-workers
 help / color / mirror / code / Atom feed
* [Patch] _vim update
@ 2008-12-27 20:31 Richard Hartmann
  2008-12-29  0:54 ` Clint Adams
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Hartmann @ 2008-12-27 20:31 UTC (permalink / raw)
  To: Zsh Workers

[-- Attachment #1: Type: text/plain, Size: 354 bytes --]

Hi all,

attached patch should be pretty obvious. The only caveat is
that --socketid and --echo-wid depend on the GUI version.
Making them depend on the -g option is trivial, but that's
not enough as the g* aliases of Vim will enable the GUI,
as well. Thus, I decided to not make them depend on
anything. If anyone has a better suggestion.. :)


Richard

[-- Attachment #2: _vim --]
[-- Type: application/octet-stream, Size: 4296 bytes --]

#compdef vim exim gvim gex gview rvim rview rgvim rgview evim eview vimdiff gvimdiff

(( $+functions[_vim_files] )) ||
_vim_files () {
  case $PREFIX in
    (+*) _files -P './' $* && return 0 ;;
    (*) _files $* ;;
  esac
  case $PREFIX in
    (+) _message -e 'start at a given line (default: end of file)' ;;
    (+<1->) _message -e 'line number' ;;
  esac
}

local arguments

arguments=(
  '(   -e -E -s -d -y)-v[vi mode]'
  '(-v    -E    -d -y)-e[ex mode]'
  '(-v -e       -d -y)-E[improved ex mode]'
  '(-v -e -E -s    -y)-d[diff mode]'
  '(-v -e -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]'
  '-g[start with GUI]'
  '-l[lisp mode]'
  '-C[start in compatible mode]'
  '-N[start in incompatibile mode]'
  '(--nofork -f)'{--nofork,-f}'[do not detach the GUI version from the shell]'
  '-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)]'
  '-nb[start as NetBean server]'
  {-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 vimrc file instead of default .vimrc]::rc file:_files'
  '-U[use given gvimrc file instead of default .gvimrc]::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: '
  '-p-[number of tabs to open (default: one for each file)]::tab count: '
  '-q-[quickfix file]:*:file:_vim_files'
  '*--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, overwriting existing 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-tab[as --remote but open tab page for each file]:*:file:_vim_files'
  '--remote-expr[evaluate given expression in a vim server and print result]:expression: '
  '--echo-wid[echo window ID on STDOUT, GUI version only]'
  '--literal[do not expand wildcards in arguments (this is useless with ZSH)]'
  '(- *)--serverlist[list available vim servers and exit]'
  '--servername[name of vim server to send to or name of server to become]:server name: '
  '--socketid[run GVIM in another window]'
  '-i[use given viminfo file instead of default .viminfo]:viminfo file:_files'
  '(- *)'{-h,--help}'[print help and exit]'
  '(- *)--version[print version information and exit]'
  '(*)-t[edit file where tag is defined]:tag:_complete_tag'
  '(-t)*:file:_vim_files'
)

_arguments -S $arguments

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Patch] _vim update
  2008-12-27 20:31 [Patch] _vim update Richard Hartmann
@ 2008-12-29  0:54 ` Clint Adams
  0 siblings, 0 replies; 2+ messages in thread
From: Clint Adams @ 2008-12-29  0:54 UTC (permalink / raw)
  To: Richard Hartmann; +Cc: Zsh Workers

On Sat, Dec 27, 2008 at 09:31:03PM +0100, Richard Hartmann wrote:
> attached patch should be pretty obvious. The only caveat is
> that --socketid and --echo-wid depend on the GUI version.
> Making them depend on the -g option is trivial, but that's
> not enough as the g* aliases of Vim will enable the GUI,
> as well. Thus, I decided to not make them depend on
> anything. If anyone has a better suggestion.. :)

You can compare $service with gvim/gview/whatever.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-29  0:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-27 20:31 [Patch] _vim update Richard Hartmann
2008-12-29  0:54 ` Clint Adams

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).