aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-03-09 12:21:01 +0000
committerLewis Russell <me@lewisr.dev>2024-03-10 23:20:44 +0000
commita09ddd7ce55037edc9747a682810fba6a26bc201 (patch)
tree66f9888cf90c146d7ca366e4c919142d373d73b9 /runtime/doc
parent09a919f313ec8ae691798e45ee459a4467ce5d6a (diff)
downloadrneovim-a09ddd7ce55037edc9747a682810fba6a26bc201.tar.gz
rneovim-a09ddd7ce55037edc9747a682810fba6a26bc201.tar.bz2
rneovim-a09ddd7ce55037edc9747a682810fba6a26bc201.zip
docs(editorconfig): move to source
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/editorconfig.txt106
-rw-r--r--runtime/doc/lua.txt13
2 files changed, 65 insertions, 54 deletions
diff --git a/runtime/doc/editorconfig.txt b/runtime/doc/editorconfig.txt
index a2281a7b7c..c7011cfbba 100644
--- a/runtime/doc/editorconfig.txt
+++ b/runtime/doc/editorconfig.txt
@@ -3,7 +3,7 @@
NVIM REFERENCE MANUAL
-
+==============================================================================
EditorConfig integration *editorconfig*
Nvim supports EditorConfig. When a file is opened, Nvim searches all parent
@@ -13,69 +13,23 @@ entire (recursive) directory. For more information see
https://editorconfig.org/.
*g:editorconfig* *b:editorconfig*
-EditorConfig is enabled by default. To disable it, add to your config: >lua
+EditorConfig is enabled by default. To disable it, add to your config: >lua
vim.g.editorconfig = false
<
+
(Vimscript: `let g:editorconfig = v:false`). It can also be disabled
per-buffer by setting the |b:editorconfig| buffer-local variable to `false`.
Nvim stores the applied properties in |b:editorconfig| if it is not `false`.
- *editorconfig-properties*
-The following properties are supported by default:
-
- *editorconfig_root*
-root If "true", then stop searching for .editorconfig files
- in parent directories. This property must be at the
- top-level of the .editorconfig file (i.e. it must not
- be within a glob section).
-
- *editorconfig_charset*
-charset One of "utf-8", "utf-8-bom", "latin1", "utf-16be", or
- "utf-16le". Sets the 'fileencoding' and 'bomb'
- options.
-
- *editorconfig_end_of_line*
-end_of_line One of "lf", "crlf", or "cr". These correspond to
- setting 'fileformat' to "unix", "dos", or "mac",
- respectively.
-
- *editorconfig_indent_style*
-indent_style One of "tab" or "space". Sets the 'expandtab' option.
-
- *editorconfig_indent_size*
-indent_size A number indicating the size of a single indent.
- Alternatively, use the value "tab" to use the value of
- the tab_width property. Sets the 'shiftwidth' and
- 'softtabstop' options.
- If this value is not "tab" and the tab_width property
- is not set, 'tabstop' is also set to this value.
-
- *editorconfig_insert_final_newline*
-insert_final_newline "true" or "false" to ensure the file always has a
- trailing newline as its last byte. Sets the
- 'fixendofline' and 'endofline' options.
-
- *editorconfig_max_line_length*
-max_line_length A number indicating the maximum length of a single
- line. Sets the 'textwidth' option.
-
- *editorconfig_tab_width*
-tab_width The display size of a single tab character. Sets the
- 'tabstop' option.
-
- *editorconfig_trim_trailing_whitespace*
-trim_trailing_whitespace
- When "true", trailing whitespace is automatically
- removed when the buffer is written.
-
*editorconfig-custom-properties*
+
New properties can be added by adding a new entry to the "properties" table.
The table key is a property name and the value is a callback function which
-accepts the number of the buffer to be modified, the value of the property
-in the .editorconfig file, and (optionally) a table containing all of the
-other properties and their values (useful for properties which depend on other
+accepts the number of the buffer to be modified, the value of the property in
+the `.editorconfig` file, and (optionally) a table containing all of the other
+properties and their values (useful for properties which depend on other
properties). The value is always a string and must be coerced if necessary.
Example: >lua
@@ -86,4 +40,48 @@ Example: >lua
vim.b[bufnr].foo = val
end
<
- vim:tw=78:ts=8:et:sw=4:ft=help:norl:
+
+ *editorconfig-properties*
+
+The following properties are supported by default:
+
+
+charset *editorconfig.charset*
+ One of `"utf-8"`, `"utf-8-bom"`, `"latin1"`, `"utf-16be"`, or
+ `"utf-16le"`. Sets the 'fileencoding' and 'bomb' options.
+
+end_of_line *editorconfig.end_of_line*
+ One of `"lf"`, `"crlf"`, or `"cr"`. These correspond to setting
+ 'fileformat' to "unix", "dos", or "mac", respectively.
+
+indent_size *editorconfig.indent_size*
+ A number indicating the size of a single indent. Alternatively, use the
+ value "tab" to use the value of the tab_width property. Sets the
+ 'shiftwidth' and 'softtabstop' options. If this value is not "tab" and the
+ tab_width property is not set, 'tabstop' is also set to this value.
+
+indent_style *editorconfig.indent_style*
+ One of `"tab"` or `"space"`. Sets the 'expandtab' option.
+
+insert_final_newline *editorconfig.insert_final_newline*
+ `"true"` or `"false"` to ensure the file always has a trailing newline as
+ its last byte. Sets the 'fixendofline' and 'endofline' options.
+
+max_line_length *editorconfig.max_line_length*
+ A number indicating the maximum length of a single line. Sets the
+ 'textwidth' option.
+
+root *editorconfig.root*
+ If "true", then stop searching for `.editorconfig` files in parent
+ directories. This property must be at the top-level of the `.editorconfig`
+ file (i.e. it must not be within a glob section).
+
+tab_width *editorconfig.tab_width*
+ The display size of a single tab character. Sets the 'tabstop' option.
+
+trim_trailing_whitespace *editorconfig.trim_trailing_whitespace*
+ When `"true"`, trailing whitespace is automatically removed when the
+ buffer is written.
+
+
+ vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl:
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 89f62126bb..e1e3f88a1d 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -1161,6 +1161,7 @@ Lua list copies the list object to Vimscript and does NOT modify the Lua list: >
vim.print(list) --> "{ 1, 2, 3 }"
<
+
vim.call({func}, {...}) *vim.call()*
Invokes |vim-function| or |user-function| {func} with arguments {...}.
See also |vim.fn|.
@@ -1239,6 +1240,7 @@ vim.v *vim.v*
|v:| variables.
Invalid or unset key returns `nil`.
+
*lua-options*
*lua-vim-options*
*lua-vim-set*
@@ -1262,6 +1264,7 @@ window-scoped options. Note that this must NOT be confused with
|local-options| and |:setlocal|. There is also |vim.go| that only accesses the
global value of a |global-local| option, see |:setglobal|.
+
*vim.opt_local*
*vim.opt_global*
*vim.opt*
@@ -3897,6 +3900,7 @@ Iter:enumerate() *Iter:enumerate()*
<
Example: >lua
+
local it = vim.iter(vim.gsplit('abc', '')):enumerate()
it:next()
-- 1 'a'
@@ -3931,6 +3935,7 @@ Iter:find({f}) *Iter:find()*
found.
Examples: >lua
+
local it = vim.iter({ 3, 6, 9, 12 })
it:find(12)
-- 12
@@ -4011,6 +4016,7 @@ Iter:last() *Iter:last()*
Drains the iterator and returns the last item.
Example: >lua
+
local it = vim.iter(vim.gsplit('abcdefg', ''))
it:last()
-- 'g'
@@ -4051,6 +4057,7 @@ Iter:next() *Iter:next()*
Gets the next value from the iterator.
Example: >lua
+
local it = vim.iter(string.gmatch('1 2 3', '%d+')):map(tonumber)
it:next()
-- 1
@@ -4082,6 +4089,7 @@ Iter:nth({n}) *Iter:nth()*
Gets the nth value of an iterator (and advances to it).
Example: >lua
+
local it = vim.iter({ 3, 6, 9, 12 })
it:nth(2)
-- 6
@@ -4099,6 +4107,7 @@ Iter:nthback({n}) *Iter:nthback()*
Gets the nth value from the end of a |list-iterator| (and advances to it).
Example: >lua
+
local it = vim.iter({ 3, 6, 9, 12 })
it:nthback(2)
-- 9
@@ -4116,6 +4125,7 @@ Iter:peek() *Iter:peek()*
Gets the next value in a |list-iterator| without consuming it.
Example: >lua
+
local it = vim.iter({ 3, 6, 9, 12 })
it:peek()
-- 3
@@ -4150,6 +4160,7 @@ Iter:rev() *Iter:rev()*
Reverses a |list-iterator| pipeline.
Example: >lua
+
local it = vim.iter({ 3, 6, 9, 12 }):rev()
it:totable()
-- { 12, 9, 6, 3 }
@@ -4166,6 +4177,7 @@ Iter:rfind({f}) *Iter:rfind()*
found.
Examples: >lua
+
local it = vim.iter({ 1, 2, 3, 2, 1 }):enumerate()
it:rfind(1)
-- 5 1
@@ -4186,6 +4198,7 @@ Iter:skip({n}) *Iter:skip()*
Skips `n` values of an iterator pipeline.
Example: >lua
+
local it = vim.iter({ 3, 6, 9, 12 }):skip(2)
it:next()
-- 9