aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/api.txt4
-rw-r--r--runtime/doc/builtin.txt1
-rw-r--r--runtime/doc/deprecated.txt2
-rw-r--r--runtime/doc/eval.txt48
-rw-r--r--runtime/doc/index.txt1
-rw-r--r--runtime/doc/lua.txt64
-rw-r--r--runtime/doc/news.txt21
-rw-r--r--runtime/doc/options.txt21
-rw-r--r--runtime/doc/pi_health.txt2
-rw-r--r--runtime/doc/pi_tar.txt17
-rw-r--r--runtime/doc/usr_05.txt27
-rw-r--r--runtime/doc/usr_09.txt38
-rw-r--r--runtime/doc/vim_diff.txt5
13 files changed, 143 insertions, 108 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 09d260e0cd..d63563cc05 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -3068,8 +3068,8 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
In general, values below 100 are recommended, unless
there is a good reason to overshadow builtin elements.
- • style: Configure the appearance of the window. Currently
- only takes one non-empty value:
+ • style: (optional) Configure the appearance of the window.
+ Currently only supports one value:
• "minimal" Nvim will display the window with many UI
options disabled. This is useful when displaying a
temporary float where the text should not be edited.
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 0e04e9035b..3c940ccfa2 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -3003,7 +3003,6 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
arglist file names in argument list
augroup autocmd groups
buffer buffer names
- behave |:behave| suboptions
breakpoint |:breakadd| and |:breakdel| suboptions
cmdline |cmdline-completion| result
color color schemes
diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt
index 3735073867..171d285950 100644
--- a/runtime/doc/deprecated.txt
+++ b/runtime/doc/deprecated.txt
@@ -120,6 +120,8 @@ LSP FUNCTIONS
{buffer = bufnr} instead.
- *vim.lsp.buf.formatting()* Use |vim.lsp.buf.format()| with
{async = true} instead.
+- *vim.lsp.buf.formatting_sync()* Use |vim.lsp.buf.format()| with
+ {async = false} instead.
- *vim.lsp.buf.range_formatting()* Use |vim.lsp.formatexpr()|
or |vim.lsp.buf.format()| instead.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index fe15ba6115..351690f4df 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -93,7 +93,27 @@ non-zero number it means TRUE: >
:" executed
To test for a non-empty string, use empty(): >
:if !empty("foo")
-<
+
+< *falsy* *truthy*
+An expression can be used as a condition, ignoring the type and only using
+whether the value is "sort of true" or "sort of false". Falsy is:
+ the number zero
+ empty string, blob, list or dictionary
+Other values are truthy. Examples:
+ 0 falsy
+ 1 truthy
+ -1 truthy
+ 0.0 falsy
+ 0.1 truthy
+ '' falsy
+ 'x' truthy
+ [] falsy
+ [0] truthy
+ {} falsy
+ #{x: 1} truthy
+ 0z falsy
+ 0z00 truthy
+
*non-zero-arg*
Function arguments often behave slightly different from |TRUE|: If the
argument is present and it evaluates to a non-zero Number, |v:true| or a
@@ -841,9 +861,12 @@ All expressions within one level are parsed from left to right.
------------------------------------------------------------------------------
-expr1 *expr1* *ternary* *E109*
+expr1 *expr1* *ternary* *falsy-operator* *??* *E109*
+
+The ternary operator: expr2 ? expr1 : expr1
+The falsy operator: expr2 ?? expr1
-expr2 ? expr1 : expr1
+Ternary operator ~
The expression before the '?' is evaluated to a number. If it evaluates to
|TRUE|, the result is the value of the expression between the '?' and ':',
@@ -866,6 +889,23 @@ To keep this readable, using |line-continuation| is suggested: >
You should always put a space before the ':', otherwise it can be mistaken for
use in a variable such as "a:1".
+Falsy operator ~
+
+This is also known as the "null coalescing operator", but that's too
+complicated, thus we just call it the falsy operator.
+
+The expression before the '??' is evaluated. If it evaluates to
+|truthy|, this is used as the result. Otherwise the expression after the '??'
+is evaluated and used as the result. This is most useful to have a default
+value for an expression that may result in zero or empty: >
+ echo theList ?? 'list is empty'
+ echo GetName() ?? 'unknown'
+
+These are similar, but not equal: >
+ expr2 ?? expr1
+ expr2 ? expr2 : expr1
+In the second line "expr2" is evaluated twice.
+
------------------------------------------------------------------------------
expr2 and expr3 *expr2* *expr3*
@@ -2499,7 +2539,7 @@ This does NOT work: >
|List| item.
*:let=<<* *:let-heredoc*
- *E990* *E991* *E172* *E221*
+ *E990* *E991* *E172* *E221* *E1145*
:let {var-name} =<< [trim] {endmarker}
text...
text...
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 174683a8c3..fbd3fccec0 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1159,7 +1159,6 @@ tag command action ~
|:badd| :bad[d] add buffer to the buffer list
|:balt| :balt like ":badd" but also set the alternate file
|:bdelete| :bd[elete] remove a buffer from the buffer list
-|:behave| :be[have] set mouse and selection behavior
|:belowright| :bel[owright] make split window appear right or below
|:bfirst| :bf[irst] go to first buffer in the buffer list
|:blast| :bl[ast] go to last buffer in the buffer list
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 6084a625ba..6fdf3775f6 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -1516,9 +1516,10 @@ region({bufnr}, {pos1}, {pos2}, {regtype}, {inclusive}) *vim.region()*
Parameters: ~
• {bufnr} (integer) number of buffer
- • {pos1} integer[] (line, column) tuple marking beginning of
- region
- • {pos2} integer[] (line, column) tuple marking end of region
+ • {pos1} integer[]|string start of region as a (line, column)
+ tuple or string accepted by |getpos()|
+ • {pos2} integer[]|string end of region as a (line, column) tuple
+ or string accepted by |getpos()|
• {regtype} (string) type of selection, see |setreg()|
• {inclusive} (boolean) indicating whether column of pos2 is inclusive
@@ -1697,6 +1698,19 @@ is_callable({f}) *vim.is_callable()*
Return: ~
(boolean) `true` if `f` is callable, else `false`
+list_contains({t}, {value}) *vim.list_contains()*
+ Checks if a list-like table (integer keys without gaps) contains `value`.
+
+ Parameters: ~
+ • {t} (table) Table to check (must be list-like, not validated)
+ • {value} any Value to compare
+
+ Return: ~
+ (boolean) `true` if `t` contains `value`
+
+ See also: ~
+ • |vim.tbl_contains()| for checking values in general tables
+
list_extend({dst}, {src}, {start}, {finish}) *vim.list_extend()*
Extends a list-like table with the values of another list-like table.
@@ -1796,16 +1810,31 @@ tbl_add_reverse_lookup({o}) *vim.tbl_add_reverse_lookup()*
Return: ~
(table) o
-tbl_contains({t}, {value}) *vim.tbl_contains()*
- Checks if a list-like (vector) table contains `value`.
+tbl_contains({t}, {value}, {opts}) *vim.tbl_contains()*
+ Checks if a table contains a given value, specified either directly or via
+ a predicate that is checked for each value.
+
+ Example: >lua
+
+ vim.tbl_contains({ 'a', { 'b', 'c' } }, function(v)
+ return vim.deep_equal(v, { 'b', 'c' })
+ end, { predicate = true })
+ -- true
+<
Parameters: ~
• {t} (table) Table to check
- • {value} any Value to compare
+ • {value} any Value to compare or predicate function reference
+ • {opts} (table|nil) Keyword arguments |kwargs|:
+ • predicate: (boolean) `value` is a function reference to be
+ checked (default false)
Return: ~
(boolean) `true` if `t` contains `value`
+ See also: ~
+ • |vim.list_contains()| for checking values in list-like tables
+
tbl_count({t}) *vim.tbl_count()*
Counts the number of non-nil values in table `t`.
@@ -1899,6 +1928,20 @@ tbl_get({o}, {...}) *vim.tbl_get()*
Return: ~
any Nested value indexed by key (if it exists), else nil
+tbl_isarray({t}) *vim.tbl_isarray()*
+ Tests if a Lua table can be treated as an array (a table indexed by
+ integers).
+
+ Empty table `{}` is assumed to be an array, unless it was created by
+ |vim.empty_dict()| or returned as a dict-like |API| or Vimscript result,
+ for example from |rpcrequest()| or |vim.fn|.
+
+ Parameters: ~
+ • {t} (table)
+
+ Return: ~
+ (boolean) `true` if array-like table, else `false`.
+
tbl_isempty({t}) *vim.tbl_isempty()*
Checks if a table is empty.
@@ -1912,17 +1955,18 @@ tbl_isempty({t}) *vim.tbl_isempty()*
• https://github.com/premake/premake-core/blob/master/src/base/table.lua
tbl_islist({t}) *vim.tbl_islist()*
- Tests if a Lua table can be treated as an array.
+ Tests if a Lua table can be treated as a list (a table indexed by
+ consecutive integers starting from 1).
- Empty table `{}` is assumed to be an array, unless it was created by
+ Empty table `{}` is assumed to be an list, unless it was created by
|vim.empty_dict()| or returned as a dict-like |API| or Vimscript result,
for example from |rpcrequest()| or |vim.fn|.
Parameters: ~
- • {t} (table) Table
+ • {t} (table)
Return: ~
- (boolean) `true` if array-like table, else `false`
+ (boolean) `true` if list-like table, else `false`.
tbl_keys({t}) *vim.tbl_keys()*
Return a list of all keys used in a table. However, the order of the
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 6e2a1b1d3f..6697b3018a 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -15,9 +15,21 @@ BREAKING CHANGES *news-breaking*
The following changes may require adaptations in user config or plugins.
+• |vim.tbl_islist()| now checks whether a table is actually list-like (i.e.,
+ has integer keys without gaps and starting from 1). For the previous
+ behavior (only check for integer keys, allow gaps or not starting with 1),
+ use |vim.tbl_isarray()|.
+
• "#" followed by a digit no longer stands for a function key at the start of
the lhs of a mapping.
+• `:behave` was removed. if you used `:behave mswin`, the following is equivalent: >vim
+
+ set selection=exclusive
+ set selectmode=mouse,key
+ set mousemodel=popup
+ set keymodel=startsel,stopsel
+
==============================================================================
ADDED FEATURES *news-added*
@@ -30,14 +42,19 @@ CHANGED FEATURES *news-changed*
The following changes to existing APIs or features add new behavior.
-• ...
+• |vim.tbl_contains()| now works for general tables and allows specifying a
+ predicate function that is checked for each value. (Use |vim.list_contains()|
+ for checking list-like tables (integer keys without gaps) for literal values.)
+
+• |vim.region()| can use a string accepted by |getpos()| as position.
==============================================================================
REMOVED FEATURES *news-removed*
The following deprecated functions or APIs were removed.
-• ...
+• Vimball support is removed.
+ - :Vimuntar command removed.
==============================================================================
DEPRECATIONS *news-deprecations*
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index d22a78700f..b4cad51990 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -3589,7 +3589,6 @@ A jump table for the options with a short description can be found at |Q_op|.
stopsel Using a not-shifted special key stops selection.
Special keys in this context are the cursor keys, <End>, <Home>,
<PageUp> and <PageDown>.
- The 'keymodel' option is set by the |:behave| command.
*'keywordprg'* *'kp'*
'keywordprg' 'kp' string (default ":Man", Windows: ":help")
@@ -4168,21 +4167,6 @@ A jump table for the options with a short description can be found at |Q_op|.
'mousehide' hide mouse pointer while typing text
'selectmode' whether to start Select mode or Visual mode
- The :behave command provides some "profiles" for mouse behavior.
- *:behave* *:be*
- :be[have] {model} Set behavior for mouse and selection. Valid
- arguments are:
- mswin MS-Windows behavior
- xterm Xterm behavior
-
- Using ":behave" changes these options:
- option mswin xterm ~
- 'selectmode' "mouse,key" ""
- 'mousemodel' "popup" "extend"
- 'keymodel' "startsel,stopsel" ""
- 'selection' "exclusive" "inclusive"
-
-
*'mousefocus'* *'mousef'* *'nomousefocus'* *'nomousef'*
'mousefocus' 'mousef' boolean (default off)
global
@@ -4250,8 +4234,6 @@ A jump table for the options with a short description can be found at |Q_op|.
"g<LeftMouse>" is "<C-LeftMouse> (jump to tag under mouse click)
"g<RightMouse>" is "<C-RightMouse> ("CTRL-T")
- The 'mousemodel' option is set by the |:behave| command.
-
*'mousemoveevent'* *'mousemev'* *'nomousemoveevent'* *'nomousemev'*
'mousemoveevent' 'mousemev' boolean (default off)
global
@@ -5013,8 +4995,6 @@ A jump table for the options with a short description can be found at |Q_op|.
backwards, you cannot include the last character of a line, when
starting in Normal mode and 'virtualedit' empty.
- The 'selection' option is set by the |:behave| command.
-
*'selectmode'* *'slm'*
'selectmode' 'slm' string (default "")
global
@@ -5025,7 +5005,6 @@ A jump table for the options with a short description can be found at |Q_op|.
key when using shifted special keys
cmd when using "v", "V" or CTRL-V
See |Select-mode|.
- The 'selectmode' option is set by the |:behave| command.
*'sessionoptions'* *'ssop'*
'sessionoptions' 'ssop' string (default: "blank,buffers,curdir,folds,
diff --git a/runtime/doc/pi_health.txt b/runtime/doc/pi_health.txt
index 2ae93b098a..a0e06a7d37 100644
--- a/runtime/doc/pi_health.txt
+++ b/runtime/doc/pi_health.txt
@@ -21,7 +21,7 @@ Plugin authors are encouraged to write new healthchecks. |health-dev|
==============================================================================
Commands *health-commands*
- *:che* *:checkhealth* *:CheckHealth*
+ *:che* *:checkhealth*
:che[ckhealth] Run all healthchecks.
*E5009*
Nvim depends on |$VIMRUNTIME|, 'runtimepath' and 'packpath' to
diff --git a/runtime/doc/pi_tar.txt b/runtime/doc/pi_tar.txt
index 2230b82dec..e664b98086 100644
--- a/runtime/doc/pi_tar.txt
+++ b/runtime/doc/pi_tar.txt
@@ -33,23 +33,6 @@ Copyright 2005-2017: *tar-copyright*
also write to the file. Currently, one may not make a new file in
tar archives via the plugin.
- *:Vimuntar*
- VIMUNTAR~
-
- :Vimuntar [vimhome]
-
- This command copies, if necessary, the tarball to the .vim or vimfiles
- directory using the first writable directory in the |'runtimepath'|
- when no [vimhome] is specified. Otherwise, the [vimhome] argument
- allows the user to specify that directory, instead.
-
- The copy is done using the command in *g:tar_copycmd* , which is >
- cp for cygwin, unix, macunix
- copy for windows (32, 95, 64, 16)
-< The extraction is done with the command specified with
- *g:tar_extractcmd* , which by default is >
- "tar -xf"
-<
*:TarDiff*
DIFFERENCING SUPPORT~
diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt
index 00b4f9eed4..8f7e393c02 100644
--- a/runtime/doc/usr_05.txt
+++ b/runtime/doc/usr_05.txt
@@ -190,26 +190,21 @@ The ":map" command (with no arguments) lists your current mappings. At
least the ones for Normal mode. More about mappings in section |40.1|.
==============================================================================
-*05.4* Adding a package *add-package* *vimball-install*
+*05.4* Adding a package *add-package*
-A package is a set of files that you can add to Vim. There are two kinds of
-packages: optional and automatically loaded on startup.
-
-The Vim distribution comes with a few packages that you can optionally use.
-For example, the vimball plugin. This plugin supports creating and using
-vimballs (self-installing Vim plugin archives).
-
-To start using the vimball plugin, add one line to your vimrc file: >
- packadd vimball
+You may use |:packadd| to enable packages on demand. This is useful for plugins
+you want to enable only sometimes. To enable `example_package`, use the
+following command: >
+ packadd example_package
-That's all! You can also type the command to try it out. Now you can find
-help about this plugin: >
- :help vimball
+That's all! Now you can find help about this plugin: >
+ :help example_package
This works, because when `:packadd` loaded the plugin it also added the
-package directory in 'runtimepath', so that the help file can be found. The
-tags for vimball's help are already created. If you need to generate the help
-tags for a package, see the `:helptags` command.
+package directory in 'runtimepath', so that the help file can be found.
+
+A package is a set of files that you can add to Vim. There are two kinds of
+packages: optional and automatically loaded on startup.
You can find packages on the Internet in various places. It usually comes as
an archive or as a repository. For an archive you can follow these steps:
diff --git a/runtime/doc/usr_09.txt b/runtime/doc/usr_09.txt
index 8084d13b5d..ea16010dc2 100644
--- a/runtime/doc/usr_09.txt
+++ b/runtime/doc/usr_09.txt
@@ -124,41 +124,13 @@ This adds the 'l' flag to 'guioptions'.
Standards are wonderful. In Microsoft Windows, you can use the mouse to
select text in a standard manner. The X Window system also has a standard
system for using the mouse. Unfortunately, these two standards are not the
-same.
- Fortunately, you can customize Vim. You can make the behavior of the mouse
-work like an X Window system mouse or a Microsoft Windows mouse. The following
-command makes the mouse behave like an X Window mouse: >
+same. Fortunately, you can customize Vim.
- :behave xterm
-
-The following command makes the mouse work like a Microsoft Windows mouse: >
-
- :behave mswin
-
-The default behavior of the mouse on Unix systems is xterm. The default
-behavior on Windows systems is selected during the installation process. For
-details about what the two behaviors are, see |:behave|. Here follows a
-summary.
-
-
-XTERM MOUSE BEHAVIOR
-
-Left mouse click position the cursor
-Left mouse drag select text in Visual mode
-Middle mouse click paste text from the clipboard
-Right mouse click extend the selected text until the mouse
- pointer
-
-
-MSWIN MOUSE BEHAVIOR
-
-Left mouse click position the cursor
-Left mouse drag select text in Select mode (see |09.4|)
-Left mouse click, with Shift extend the selected text until the mouse
- pointer
-Middle mouse click paste text from the clipboard
-Right mouse click display a pop-up menu
+The following commands makes the mouse work more like a Microsoft Windows mouse: >
+ set selection=exclusive
+ set selectmode=mouse,key
+ set keymodel=startsel,stopsel
The mouse can be further tuned. Check out these options if you want to change
the way how the mouse works:
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 7228473676..58f6d6f6f9 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -556,6 +556,7 @@ Aliases:
vimdiff (alias for "nvim -d" |diff-mode|)
Commands:
+ :behave
:fixdel
:hardcopy
:helpfind
@@ -573,6 +574,7 @@ Commands:
:cscope
:lcscope
:scscope
+ :Vimuntar
Compile-time features:
Emacs tags support
@@ -764,5 +766,8 @@ Hardcopy:
`:hardcopy` was removed. Instead, use `:TOhtml` and print the resulting HTML
using a web browser or some other HTML viewer.
+Bundled plugins:
+ vimball *vimball*
+
==============================================================================
vim:tw=78:ts=8:sw=2:et:ft=help:norl: