aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-05-17 23:29:34 -0400
committerGitHub <noreply@github.com>2020-05-17 23:29:34 -0400
commita6be7a91809488adea23bf52bd77f0ed790bcbd3 (patch)
tree22268f8d3e867457ea8fb76d1ad4865a02e907b3
parenta91ce497b4f4d6c68e3009e5219d6b2ae0f63f7f (diff)
downloadrneovim-a6be7a91809488adea23bf52bd77f0ed790bcbd3.tar.gz
rneovim-a6be7a91809488adea23bf52bd77f0ed790bcbd3.tar.bz2
rneovim-a6be7a91809488adea23bf52bd77f0ed790bcbd3.zip
doc: Vim internal variables & options in lua (#12302)
* doc: Add info about vim dicts in lua * doc: preamble and info * doc: remove weird spacing * fixup
-rw-r--r--runtime/doc/lua.txt60
1 files changed, 60 insertions, 0 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 7f376cbbf0..09034353a3 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -850,6 +850,66 @@ vim.types *vim.types*
only contain values for these three types.
==============================================================================
+Vim Internal Variables *lua-vim-internal-variables*
+
+Built-in Vim dictionaries can be accessed and set idiomatically in Lua by each
+of the following tables.
+
+To set a value: >
+
+ vim.g.my_global_variable = 5
+<
+
+To read a value: >
+
+ print(vim.g.my_global_variable)
+<
+
+To delete a value: >
+
+ vim.g.my_global_variable = nil
+<
+
+vim.g *vim.g*
+ Table with values from |g:|
+ Keys with no values set will result in `nil`.
+
+vim.b *vim.b*
+ Gets a buffer-scoped (b:) variable for the current buffer.
+ Keys with no values set will result in `nil`.
+
+vim.w *vim.w*
+ Gets a window-scoped (w:) variable for the current window.
+ Keys with no values set will result in `nil`.
+
+vim.t *vim.t*
+ Gets a tabpage-scoped (t:) variable for the current table.
+ Keys with no values set will result in `nil`.
+
+vim.v *vim.v*
+ Gets a v: variable.
+ Keys with no values set will result in `nil`.
+
+
+Vim Internal Options *lua-vim-internal-options*
+
+Read, set and clear vim |options| in Lua by each of the following tables.
+
+
+vim.o *vim.o*
+ Table with values from |options|
+ Invalid keys will result in an error.
+
+vim.bo *vim.bo*
+ Gets a buffer-scoped option for the current buffer.
+ Invalid keys will result in an error.
+
+vim.wo *vim.wo*
+ Gets a window-scoped option for the current window.
+ Invalid keys will result in an error.
+
+
+==============================================================================
Lua module: vim *lua-vim*
inspect({object}, {options}) *vim.inspect()*