aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/api.txt45
-rw-r--r--runtime/doc/builtin.txt2
-rw-r--r--runtime/doc/filetype.txt2
-rw-r--r--runtime/doc/lua.txt17
-rw-r--r--runtime/doc/news.txt5
-rw-r--r--runtime/doc/repeat.txt8
-rw-r--r--runtime/doc/treesitter.txt14
7 files changed, 64 insertions, 29 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 90c9d0ccbb..89d2860ad2 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -3093,18 +3093,28 @@ nvim_win_text_height({window}, {*opts}) *nvim_win_text_height()*
Win_Config Functions *api-win_config*
nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
- Open a new window.
+ Opens a new split window, or a floating window if `relative` is specified,
+ or an external window (managed by the UI) if `external` is specified.
- Currently this is used to open floating and external windows. Floats are
- windows that are drawn above the split layout, at some anchor position in
- some other window. Floats can be drawn internally or by external GUI with
- the |ui-multigrid| extension. External windows are only supported with
- multigrid GUIs, and are displayed as separate top-level windows.
+ Floats are windows that are drawn above the split layout, at some anchor
+ position in some other window. Floats can be drawn internally or by
+ external GUI with the |ui-multigrid| extension. External windows are only
+ supported with multigrid GUIs, and are displayed as separate top-level
+ windows.
For a general overview of floats, see |api-floatwin|.
- Exactly one of `external` and `relative` must be specified. The `width`
- and `height` of the new window must be specified.
+ The `width` and `height` of the new window must be specified when opening
+ a floating window, but are optional for normal windows.
+
+ If `relative` and `external` are omitted, a normal "split" window is
+ created. The `win` property determines which window will be split. If no
+ `win` is provided or `win == 0`, a window will be created adjacent to the
+ current window. If -1 is provided, a top-level split will be created.
+ `vertical` and `split` are only valid for normal windows, and are used to
+ control split direction. For `vertical`, the exact direction is determined
+ by |'splitright'| and |'splitbelow'|. Split windows cannot have
+ `bufpos`/`row`/`col`/`border`/`title`/`footer` properties.
With relative=editor (row=0,col=0) refers to the top-left corner of the
screen-grid and (row=Lines-1,col=Columns-1) refers to the bottom-right
@@ -3127,6 +3137,13 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
{relative='win', width=12, height=3, bufpos={100,10}})
<
+ Example (Lua): vertical split left of the current window >lua
+ vim.api.nvim_open_win(0, false, {
+ split = 'left',
+ win = 0
+ })
+<
+
Attributes: ~
not allowed when |textlock| is active
@@ -3142,7 +3159,8 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
• "cursor" Cursor position in current window.
• "mouse" Mouse position
- • win: |window-ID| for relative="win".
+ • win: |window-ID| window to split, or relative window when
+ creating a float (relative="win").
• anchor: Decides which corner of the float to place at
(row,col):
• "NW" northwest (default)
@@ -3239,6 +3257,8 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
• fixed: If true when anchor is NW or SW, the float window
would be kept fixed even if the window would be truncated.
• hide: If true the floating window will be hidden.
+ • vertical: Split vertically |:vertical|.
+ • split: Split direction: "left", "right", "above", "below".
Return: ~
Window handle, or 0 on error
@@ -3336,6 +3356,13 @@ nvim_tabpage_set_var({tabpage}, {name}, {value})
• {name} Variable name
• {value} Variable value
+nvim_tabpage_set_win({tabpage}, {win}) *nvim_tabpage_set_win()*
+ Sets the current window in a tabpage
+
+ Parameters: ~
+ • {tabpage} Tabpage handle, or 0 for current tabpage
+ • {win} Window handle, must already belong to {tabpage}
+
==============================================================================
Autocmd Functions *api-autocmd*
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index ce12437c25..fc1c770de7 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -2079,6 +2079,8 @@ getbufinfo([{dict}]) *getbufinfo()*
bufnr Buffer number.
changed TRUE if the buffer is modified.
changedtick Number of changes made to the buffer.
+ command TRUE if the buffer belongs to the
+ command-line window |cmdwin|.
hidden TRUE if the buffer is hidden.
lastused Timestamp in seconds, like
|localtime()|, when the buffer was
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index 29b929b8a5..97ebdf48c1 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -687,7 +687,7 @@ To disable this behavior, set the following variable in your vimrc: >
QUERY *ft-query-plugin*
-Linting of tree-sitter queries for installed parsers using
+Linting of treesitter queries for installed parsers using
|vim.treesitter.query.lint()| is enabled by default on `BufEnter` and
`BufWrite`. To change the events that trigger linting, use >lua
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index fecdfd9bd0..c2f5941a5c 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -255,10 +255,13 @@ arguments separated by " " (space) instead of "\t" (tab).
:lua =jit.version
<
:{range}lua
- Executes the |[range]| in the current buffer as Lua code. Unlike |:source|,
- this will execute the specified lines regardless of the extension or
- |'filetype'| of the buffer.
+ Executes buffer lines in {range} as Lua code. Unlike |:source|, this
+ always treats the lines as Lua code.
+ Example: select the following code and type ":lua<Enter>" to execute it: >lua
+ print(string.format(
+ 'unix time: %s', os.time()))
+<
*:lua-heredoc*
:lua << [trim] [{endmarker}]
{script}
@@ -271,10 +274,8 @@ arguments separated by " " (space) instead of "\t" (tab).
function! CurrentLineInfo()
lua << EOF
local linenr = vim.api.nvim_win_get_cursor(0)[1]
- local curline = vim.api.nvim_buf_get_lines(
- 0, linenr - 1, linenr, false)[1]
- print(string.format("Current line [%d] has %d bytes",
- linenr, #curline))
+ local curline = vim.api.nvim_buf_get_lines(0, linenr - 1, linenr, false)[1]
+ print(string.format('Line [%d] has %d bytes', linenr, #curline))
EOF
endfunction
<
@@ -618,7 +619,7 @@ vim.highlight.on_yank({opts}) *vim.highlight.on_yank()*
vim.highlight.priorities *vim.highlight.priorities*
Table with default priorities used for highlighting:
• `syntax`: `50`, used for standard syntax highlighting
- • `treesitter`: `100`, used for tree-sitter-based highlighting
+ • `treesitter`: `100`, used for treesitter-based highlighting
• `semantic_tokens`: `125`, used for LSP semantic token highlighting
• `diagnostics`: `150`, used for code analysis such as diagnostics
• `user`: `200`, used for user-triggered highlights such as LSP document
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 40717f8ecf..36b42e28e3 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -304,6 +304,8 @@ The following new APIs and features were added.
highlight attribute. The TUI will display URLs using the OSC 8 control
sequence, enabling clickable text in supporting terminals.
+• Added |nvim_tabpage_set_win()| to set the current window of a tabpage.
+
==============================================================================
CHANGED FEATURES *news-changed*
@@ -404,6 +406,9 @@ The following changes to existing APIs or features add new behavior.
• |:checkhealth| buffer can now be opened in a split window using modifiers like
|:vertical|, |:horizontal| and |:botright|.
+• |nvim_open_win()| and |nvim_win_set_config()| now support opening normal (split)
+ windows, and moving floating windows into split windows.
+
==============================================================================
REMOVED FEATURES *news-removed*
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index 726d7a9591..ae827fa06f 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -192,11 +192,11 @@ Using Vim scripts *using-scripts*
For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
*:so* *:source* *load-vim-script*
-:[range]so[urce] [file] Runs |Ex| commands or Lua code (".lua" files) from
+:[range]so[urce] [file] Runs |Ex-commands| or Lua code (".lua" files) from
[file].
- If no [file], the current buffer is used, and it is
- treated as Lua code if its 'filetype' is "lua" or its
- file name ends with ".lua".
+ If no [file], the current buffer is used and treated
+ as Lua code if 'filetype' is "lua" or its filename
+ ends with ".lua".
Triggers the |SourcePre| autocommand.
*:source!*
:[range]so[urce]! {file}
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 0f4462b109..2755cd421b 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -17,7 +17,7 @@ changes. This documentation may also not fully reflect the latest changes.
==============================================================================
PARSER FILES *treesitter-parsers*
-Parsers are the heart of tree-sitter. They are libraries that tree-sitter will
+Parsers are the heart of treesitter. They are libraries that treesitter will
search for in the `parser` runtime directory. By default, Nvim bundles parsers
for C, Lua, Vimscript, Vimdoc and Treesitter query files, but parsers can be
installed via a plugin like https://github.com/nvim-treesitter/nvim-treesitter
@@ -43,7 +43,7 @@ TREESITTER TREES *treesitter-tree*
A "treesitter tree" represents the parsed contents of a buffer, which can be
used to perform further analysis. It is a |userdata| reference to an object
-held by the tree-sitter library.
+held by the treesitter library.
An instance `TSTree` of a treesitter tree supports the following methods.
@@ -59,7 +59,7 @@ TREESITTER NODES *treesitter-node*
A "treesitter node" represents one specific element of the parsed contents of
a buffer, which can be captured by a |Query| for, e.g., highlighting. It is
-a |userdata| reference to an object held by the tree-sitter library.
+a |userdata| reference to an object held by the treesitter library.
An instance `TSNode` of a treesitter node supports the following methods.
@@ -563,7 +563,7 @@ Conceals specified in this way respect 'conceallevel'.
*treesitter-highlight-priority*
Treesitter uses |nvim_buf_set_extmark()| to set highlights with a default
priority of 100. This enables plugins to set a highlighting priority lower or
-higher than tree-sitter. It is also possible to change the priority of an
+higher than treesitter. It is also possible to change the priority of an
individual query pattern manually by setting its `"priority"` metadata
attribute: >query
@@ -624,17 +624,17 @@ associated with patterns:
VIM.TREESITTER *lua-treesitter*
The remainder of this document is a reference manual for the `vim.treesitter`
-Lua module, which is the main interface for Nvim's tree-sitter integration.
+Lua module, which is the main interface for Nvim's treesitter integration.
Most of the following content is automatically generated from the function
documentation.
*vim.treesitter.language_version*
-The latest parser ABI version that is supported by the bundled tree-sitter
+The latest parser ABI version that is supported by the bundled treesitter
library.
*vim.treesitter.minimum_language_version*
-The earliest parser ABI version that is supported by the bundled tree-sitter
+The earliest parser ABI version that is supported by the bundled treesitter
library.
==============================================================================