aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/api.txt28
-rw-r--r--runtime/doc/lua.txt45
2 files changed, 32 insertions, 41 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index c67187d857..9758959f4e 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -536,12 +536,6 @@ created for extmark changes.
==============================================================================
Global Functions *api-global*
-nvim__get_hl_defs({ns_id}) *nvim__get_hl_defs()*
- TODO: Documentation
-
-nvim__get_lib_dir() *nvim__get_lib_dir()*
- TODO: Documentation
-
nvim__get_runtime({pat}, {all}, {*opts}) *nvim__get_runtime()*
Find files in runtime directories
@@ -608,15 +602,6 @@ nvim__inspect_cell({grid}, {row}, {col}) *nvim__inspect_cell()*
NB: if your UI doesn't use hlstate, this will not return
hlstate first time.
-nvim__runtime_inspect() *nvim__runtime_inspect()*
- TODO: Documentation
-
-nvim__screenshot({path}) *nvim__screenshot()*
- TODO: Documentation
-
- Attributes: ~
- |api-fast|
-
nvim__set_hl_ns({ns_id}) *nvim__set_hl_ns()*
Set active namespace for highlights.
@@ -638,12 +623,6 @@ nvim__stats() *nvim__stats()*
Return: ~
Map of various internal stats.
-nvim__unpack({str}) *nvim__unpack()*
- TODO: Documentation
-
- Attributes: ~
- |api-fast|
-
nvim_call_atomic({calls}) *nvim_call_atomic()*
Calls many API methods atomically.
@@ -2124,13 +2103,6 @@ affected.
You can use |nvim_buf_is_loaded()| or |nvim_buf_line_count()|
to check whether a buffer is loaded.
- *nvim__buf_redraw_range()*
-nvim__buf_redraw_range({buffer}, {first}, {last})
- TODO: Documentation
-
-nvim__buf_stats({buffer}) *nvim__buf_stats()*
- TODO: Documentation
-
nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()*
Activates buffer-update events on a channel, or as Lua
callbacks.
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 089cf0ce9d..0e58d1b1fe 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -1291,6 +1291,9 @@ Lua module: vim *lua-vim*
cmd({command}) *vim.cmd()*
Execute Vim script commands.
+ Note that `vim.cmd` can be indexed with a command name to
+ return a callable function to the command.
+
Example: >
vim.cmd('echo 42')
@@ -1300,7 +1303,23 @@ cmd({command}) *vim.cmd()*
autocmd FileType c setlocal cindent
augroup END
]])
- vim.cmd({ cmd = 'echo', args = { '"foo"' } })
+
+ -- Ex command :echo "foo"
+ -- Note string literals need to be double quoted.
+ vim.cmd('echo "foo"')
+ vim.cmd { cmd = 'echo', args = { '"foo"' } }
+ vim.cmd.echo({ args = { '"foo"' } })
+ vim.cmd.echo('"foo"')
+
+ -- Ex command :write! myfile.txt
+ vim.cmd('write! myfile.txt')
+ vim.cmd { cmd = 'write', args = { "myfile.txt" }, bang = true }
+ vim.cmd.write { args = { "myfile.txt" }, bang = true }
+ vim.cmd.write {"myfile.txt", bang = true })
+
+ -- Ex command :colorscheme blue
+ vim.cmd('colorscheme blue')
+ vim.cmd.colorscheme('blue')
<
Parameters: ~
@@ -2029,30 +2048,30 @@ add({filetypes}) *vim.filetype.add()*
vim.filetype.add({
extension = {
- foo = "fooscript",
+ foo = 'fooscript',
bar = function(path, bufnr)
if some_condition() then
- return "barscript", function(bufnr)
+ return 'barscript', function(bufnr)
-- Set a buffer variable
vim.b[bufnr].barscript_version = 2
end
end
- return "bar"
+ return 'bar'
end,
},
filename = {
- [".foorc"] = "toml",
- ["/etc/foo/config"] = "toml",
+ ['.foorc'] = 'toml',
+ ['/etc/foo/config'] = 'toml',
},
pattern = {
- [".*&zwj;/etc/foo/.*"] = "fooscript",
+ ['.*/etc/foo/.*'] = 'fooscript',
-- Using an optional priority
- [".*&zwj;/etc/foo/.*%.conf"] = { "dosini", { priority = 10 } },
- ["README.(%a+)$"] = function(path, bufnr, ext)
- if ext == "md" then
- return "markdown"
- elseif ext == "rst" then
- return "rst"
+ ['.*/etc/foo/.*%.conf'] = { 'dosini', { priority = 10 } },
+ ['README.(a+)$'] = function(path, bufnr, ext)
+ if ext == 'md' then
+ return 'markdown'
+ elseif ext == 'rst' then
+ return 'rst'
end
end,
},