doc: update vim.cmd() (#14450)

This commit is contained in:
Shadman 2021-05-01 17:09:05 +06:00 committed by GitHub
parent 9d4250d43d
commit ca6107cfbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -841,10 +841,18 @@ vim.call({func}, {...}) *vim.call()*
vim.fn[func]({...}) vim.fn[func]({...})
vim.cmd({cmd}) *vim.cmd()* vim.cmd({cmd}) *vim.cmd()*
Invokes an Ex command (the ":" commands, Vimscript statements). Executes multiple lines of Vimscript at once. It is an alias to
|nvim_exec()|, where `output` is set to false. Thus it works identical
to |:source|.
See also |ex-cmd-index|. See also |ex-cmd-index|.
Example: > Example: >
vim.cmd('echo 42') vim.cmd('echo 42')
vim.cmd([[
augroup My_group
autocmd!
autocmd FileType c setlocal cindent
augroup END
]])
vim.fn.{func}({...}) *vim.fn* vim.fn.{func}({...}) *vim.fn*
Invokes |vim-function| or |user-function| {func} with arguments {...}. Invokes |vim-function| or |user-function| {func} with arguments {...}.