mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-01 21:51:40 +02:00
github #128: Updated completion for neovim
This commit is contained in:
parent
a61b105795
commit
45b79fa2cb
2 changed files with 19 additions and 10 deletions
|
@ -1,5 +1,8 @@
|
|||
2025-01-27 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* github #128: GI <gi1242+zsh@gmail.com>:
|
||||
Completion/Unix/Command/_vim: Updated completion for neovim
|
||||
|
||||
* github #126: Wu, Zhenyu: Completion/Base/Completer/_expand_alias,
|
||||
Src/exec.c, Src/init.c, Src/parse.c, Src/utils.c, Src/zsh.h,
|
||||
configure.ac: Fix some typos
|
||||
|
|
|
@ -41,11 +41,18 @@ arguments=(
|
|||
'-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'
|
||||
'--startuptime[write startup timing messages to given file]:log file:_files'
|
||||
'(- *)'{-h,--help}'[print help and exit]'
|
||||
'(- *)--version[print version information and exit]'
|
||||
'(* -q)-t+[edit file where tag is defined]:tag:_complete_tag'
|
||||
'(-t -q)*:file:_vim_files'
|
||||
'--clean[start with defaults in non-compatible mode]'
|
||||
'--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-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-tab-silent[as --remote-silent but open tab page for each file]:*:file:_vim_files'
|
||||
'--remote-expr[evaluate given expression in a vim server and print result]:expression: '
|
||||
'--startuptime[write startup timing messages to given file]:log file:_files'
|
||||
)
|
||||
if [[ $service = nvim ]]; then
|
||||
arguments+=(
|
||||
|
@ -56,9 +63,11 @@ if [[ $service = nvim ]]; then
|
|||
'-i[use the specified shada file]:shada file:_files'
|
||||
'(- *)-v[print version information and exit]'
|
||||
'(- *)--api-info[print msgpack-encoded api-metadata and exit]'
|
||||
'--headless[do not start user interface]'
|
||||
'--embed[use standard input and output as a msgpack-rpc channel]'
|
||||
'--headless[do not start user interface]'
|
||||
'--listen[start RPC server on the specified socket or named pipe]:address'
|
||||
'--remote-ui[display the UI of the server in the terminal]'
|
||||
'--server[specify RPC server to send commands to]:server name:->server'
|
||||
)
|
||||
else
|
||||
arguments+=(
|
||||
|
@ -74,22 +83,15 @@ else
|
|||
'--ttyfail[exit if input or output is not a terminal]'
|
||||
'-X[do not connect to X server]'
|
||||
'-x[edit encrypted files]'
|
||||
'--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-tab-silent[as --remote-silent but open tab page for each file]:*:file:_vim_files'
|
||||
'--remote-tab-wait[as --remote-wait but open tab page for each file]:*:file:_vim_files'
|
||||
'--remote-tab-wait-silent[as --remote-wait-silent but open tab page for each file]:*:file:_vim_files'
|
||||
'--remote-expr[evaluate given expression in a vim server and print result]:expression: '
|
||||
'--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:->server'
|
||||
'--socketid[run GVIM in another window]'
|
||||
'-i[use specified viminfo file]:viminfo file [~/.viminfo]:_files'
|
||||
'--clean[start with defaults in non-compatible mode]'
|
||||
)
|
||||
fi
|
||||
[[ $service != *g* && $service != nvim ]] && arguments+='-g[start with GUI]'
|
||||
|
@ -115,7 +117,11 @@ _arguments -C -S $arguments && ret=0
|
|||
|
||||
if [[ "$state" = server ]]; then
|
||||
local -a servers
|
||||
servers=( ${(f)"$(_call_program servers $words[1] --serverlist 2>/dev/null)"} )
|
||||
if [[ $service == nvim ]]; then
|
||||
servers=( /run/user/$UID/nvim.*(N=) )
|
||||
else
|
||||
servers=( ${(f)"$(_call_program servers $words[1] --serverlist 2>/dev/null)"} )
|
||||
fi
|
||||
_wanted servers expl server compadd -M 'm:{a-z}={A-Z}' -a servers && ret=0
|
||||
elif [[ $state = verbosity ]]; then
|
||||
_tags numbers files
|
||||
|
|
Loading…
Reference in a new issue