mirror of
https://github.com/neovim/neovim.git
synced 2026-08-31 03:13:48 +00:00
docs: misc #40847
Co-authored-by: Barrett Ruth <br@barrettruth.com> Co-authored-by: Nathan Zeng <nathan.j.zeng@gmail.com>
This commit is contained in:
@@ -789,12 +789,9 @@ nvim_feedkeys({keys}, {mode}, {escape_ks}) *nvim_feedkeys()*
|
||||
|
||||
On execution error: does not fail, but updates v:errmsg.
|
||||
|
||||
To input sequences like <C-o> use |nvim_replace_termcodes()| (typically
|
||||
with escape_ks=false) to replace |keycodes|, then pass the result to
|
||||
nvim_feedkeys().
|
||||
|
||||
Example: >vim
|
||||
:let key = nvim_replace_termcodes("<C-o>", v:true, v:false, v:true)
|
||||
To input keycodes like <C-o>, pass the result of
|
||||
|nvim_replace_termcodes()|: >vim
|
||||
:let key = nvim_replace_termcodes('<C-o>', v:true, v:false, v:true)
|
||||
:call nvim_feedkeys(key, 'n', v:false)
|
||||
<
|
||||
|
||||
@@ -802,11 +799,11 @@ nvim_feedkeys({keys}, {mode}, {escape_ks}) *nvim_feedkeys()*
|
||||
Since: 0.1.0
|
||||
|
||||
Parameters: ~
|
||||
• {keys} (`string`) to be typed
|
||||
• {mode} (`string`) behavior flags, see |feedkeys()|
|
||||
• {keys} (`string`) Keys to send as input.
|
||||
• {mode} (`string`) Behavior flags, see |feedkeys()|.
|
||||
• {escape_ks} (`boolean`) If true, escape K_SPECIAL bytes in `keys`.
|
||||
This should be false if you already used
|
||||
|nvim_replace_termcodes()|, and true otherwise.
|
||||
Should be false if you used |nvim_replace_termcodes()|,
|
||||
else true.
|
||||
|
||||
See also: ~
|
||||
• feedkeys()
|
||||
@@ -1372,11 +1369,8 @@ nvim_put({lines}, {type}, {after}, {follow}) *nvim_put()*
|
||||
|
||||
*nvim_replace_termcodes()*
|
||||
nvim_replace_termcodes({str}, {from_part}, {do_lt}, {special})
|
||||
Replaces terminal codes and |keycodes| (<CR>, <Esc>, ...) in a string with
|
||||
the internal representation.
|
||||
|
||||
Note: ~
|
||||
• Lua can use |vim.keycode()| instead.
|
||||
Converts terminal codes and |keycodes| (<CR>, <Esc>, …) in a key
|
||||
sequence, to the internal representation. See also Lua |vim.keycode()|.
|
||||
|
||||
Attributes: ~
|
||||
|api-fast|
|
||||
|
||||
@@ -172,7 +172,7 @@ loaded. Since Vim doesn't allow having two buffers for the same file, you
|
||||
need another buffer. This command is useful: >
|
||||
command DiffOrig vert new | set buftype=nofile | read ++edit # | 0d_
|
||||
\ | diffthis | wincmd p | diffthis
|
||||
Use ":DiffOrig" to see the differences
|
||||
Then use ":DiffOrig" to see the differences
|
||||
between the current buffer and the file it was loaded from.
|
||||
|
||||
A buffer that is unloaded cannot be used for the diff. But it does work for
|
||||
|
||||
@@ -1291,17 +1291,19 @@ Examples: >
|
||||
If you want to always use ":confirm", set the 'confirm' option.
|
||||
|
||||
*:browse* *:bro*
|
||||
:bro[wse] {command} For |:edit|, |:split|, |:vsplit|, |:tabedit|, and
|
||||
|:tabnew| without a file argument, open the current
|
||||
directory with the |dir| browser. A third-party directory
|
||||
browser may handle it instead; see |dir-disable|.
|
||||
:bro[wse] {command} [file]
|
||||
Without [file]: opens the |current-directory| (with
|
||||
the |dir| browser by default; see |dir-disable|).
|
||||
|
||||
With a file argument, or when {command} does not support
|
||||
browsing, execute {command} unmodified.
|
||||
{command} must be one of: |:edit|, |:split|,
|
||||
|:vsplit|, |:tabedit|, |:tabnew|.
|
||||
|
||||
With a [file] argument, or if {command} does not
|
||||
support browsing: executes {command}.
|
||||
|
||||
Examples: >
|
||||
:browse edit
|
||||
< Open the current directory in the current window. >
|
||||
< Open the current directory. >
|
||||
:browse vsplit
|
||||
< Open the current directory in a vertical split.
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ Follow these steps to get LSP features:
|
||||
}
|
||||
}
|
||||
}
|
||||
3. Use |vim.lsp.enable()| to enable the config.
|
||||
3. Use |vim.lsp.enable()| to enable the config. See |lsp-activate|.
|
||||
Example: >lua
|
||||
vim.lsp.enable('emmylua_ls')
|
||||
4. Open a code file matching one of the `filetypes` specified in the config.
|
||||
@@ -182,16 +182,20 @@ Use |vim.lsp.config()| to define or modify LSP configurations, and
|
||||
|vim.lsp.start()| which allows you to share and merge configs (provided by
|
||||
Nvim, plugins, and your local config).
|
||||
|
||||
|
||||
NEW CONFIG *lsp-new-config*
|
||||
|
||||
To create a new config you can either use `vim.lsp.config()` or create
|
||||
a `lsp/<config-name>.lua` file.
|
||||
|
||||
|
||||
EXAMPLE: DEFINE A CONFIG AS CODE ~
|
||||
|
||||
1. Run `:lua vim.lsp.config('foo', {cmd={'true'}})`
|
||||
2. Run `:lua vim.lsp.enable('foo')`
|
||||
3. Run `:checkhealth vim.lsp`, check "Enabled Configurations". 😎
|
||||
|
||||
|
||||
EXAMPLE: DEFINE A CONFIG AS A FILE ~
|
||||
|
||||
1. Create a file `lsp/foo.lua` somewhere on your 'runtimepath'. >
|
||||
@@ -207,7 +211,23 @@ EXAMPLE: DEFINE A CONFIG AS A FILE ~
|
||||
:lua vim.lsp.enable('foo')
|
||||
5. Run `:checkhealth vim.lsp`, check "Enabled Configurations". 🌈
|
||||
|
||||
|
||||
HOW CONFIGS ACTIVATE *lsp-activate*
|
||||
|
||||
Call |vim.lsp.enable()| to ENABLE a config: it will automatically ACTIVATE
|
||||
(attach a client) whenever you open a buffer, if:
|
||||
|
||||
- 'filetype' matches one of the config `filetypes`
|
||||
- 'buftype' is empty or "help"
|
||||
- `root_markers` or `root_dir()` resolved a workspace roort, or the config has
|
||||
`workspace_required=false`
|
||||
|
||||
Note: The initial call to |vim.lsp.enable()| (or |:lsp-enable|) also actively
|
||||
checks and activates EXISTING buffers, if any.
|
||||
|
||||
|
||||
HOW CONFIGS ARE MERGED *lsp-config-merge*
|
||||
|
||||
When an LSP client starts, it resolves its configuration by merging the
|
||||
following sources (merge semantics defined by |vim.tbl_deep_extend()| with
|
||||
"force" behavior), in order of increasing priority:
|
||||
@@ -270,7 +290,9 @@ Example: given the following configs... >lua
|
||||
}
|
||||
}
|
||||
<
|
||||
|
||||
CONFIGURE ON ATTACH *lsp-attach*
|
||||
|
||||
To use LSP features beyond those provided by Nvim (see |lsp-buf|), you can set
|
||||
keymaps and options on |Client:on_attach()| or |LspAttach|. Not all language
|
||||
servers provide the same capabilities; check `supports_method()` in your
|
||||
@@ -362,20 +384,20 @@ FAQ *lsp-faq*
|
||||
but it is fast, lightweight and useful for navigating polyglot projects.
|
||||
|
||||
================================================================================
|
||||
LSP API *lsp-api*
|
||||
CONCEPTS
|
||||
|
||||
API *lsp-api*
|
||||
|
||||
The |lsp-core| API provides core functions for creating and managing clients,
|
||||
You can even create creating custom (in-process) |lsp-server|s.
|
||||
The |lsp-buf| functions operate LSP clients attached to the current buffer.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
CONCEPTS
|
||||
|
||||
*lsp-method*
|
||||
METHOD *lsp-method*
|
||||
Requests and notifications defined by the LSP specification are referred to as
|
||||
"LSP methods". These are handled by |lsp-handler| functions.
|
||||
|
||||
*lsp-handler*
|
||||
HANDLER *lsp-handler*
|
||||
LSP handlers are functions that handle |lsp-response|s to requests made by Nvim
|
||||
to the server. (Notifications, as opposed to requests, are fire-and-forget:
|
||||
there is no response, so they can't be handled. |lsp-notification|)
|
||||
@@ -1118,8 +1140,9 @@ config({name}, {cfg}) *vim.lsp.config()*
|
||||
• {cfg} (`vim.lsp.Config`) See |vim.lsp.Config|.
|
||||
|
||||
enable({name}, {enable}) *vim.lsp.enable()*
|
||||
Auto-activates LSP in each buffer based on the |lsp-config| `filetypes`,
|
||||
`root_markers`, and `root_dir`.
|
||||
Enables a |lsp-config|: automatically attaches the client to any buffer
|
||||
based on the config `filetypes`, `root_markers`, and `root_dir`. See
|
||||
|lsp-activate| for details.
|
||||
|
||||
To disable, pass `enable=false`: Stops related clients and servers
|
||||
(force-stops servers after a timeout, unless `exit_timeout=false`).
|
||||
|
||||
@@ -1295,17 +1295,17 @@ vim.keycode({keys}, {info}) *vim.keycode()*
|
||||
• {info} (`boolean?`) Also return key-chord info.
|
||||
|
||||
Return (multiple): ~
|
||||
(`string`) Internal bytes representation of the given `keys`.
|
||||
(`string`) Internal representation of the given `keys`.
|
||||
(`table?`) List of parsed key-chords, each with fields:
|
||||
• {key} (`string`) Key without modifiers. Example: `<C-A>` has `key`
|
||||
`a`.
|
||||
• {key} (`string`) Key without modifiers. Example: `<C-A>` has
|
||||
`key="a"`.
|
||||
• {key_alt} (`string?`) Alternative spelling of `key`, or nil if There
|
||||
Is No Alternative (TINA). Example: `key="<"` has `key_alt="lt"`.
|
||||
Is No Alternative (TINA). Example: `"<"` has `key_alt="lt"`.
|
||||
• {keys} (`string`) Full key-chord in canonical key-notation (as
|
||||
produced by |keytrans()|), including modifiers. Example: `<A-f>` has
|
||||
`keys="<M-f>"`.
|
||||
• {mod} (`('M'|'T'|'C'|'S'|'2'|'3'|'4'|'D')[]`) A list of single
|
||||
character modifiers of the key.
|
||||
• {mod} (`('M'|'T'|'C'|'S'|'2'|'3'|'4'|'D')[]`) List of key-chord
|
||||
modifiers. Example: `<C-S-f>` has `mod={ 'C', 'S' }`.
|
||||
|
||||
See also: ~
|
||||
• |nvim_replace_termcodes()|
|
||||
|
||||
@@ -371,6 +371,7 @@ TREESITTER
|
||||
capture.
|
||||
• |vim.treesitter.select()| starts or adjusts a visual selection at cursor,
|
||||
based on tree nodes.
|
||||
• The `diff` treesitter parser is bundled.
|
||||
|
||||
TUI
|
||||
|
||||
@@ -382,6 +383,9 @@ TUI
|
||||
UI
|
||||
|
||||
• |:checkhealth| shows filewatcher info in the Performance section.
|
||||
• Floating window border highlights (|hl-FloatBorder|, |hl-FloatTitle|,
|
||||
|hl-FloatFooter|) combine with the window-local |hl-Normal| background
|
||||
instead of falling back to the global background.
|
||||
• These builtin "picker" menus delegate to |vim.ui.select()|:
|
||||
• :browse oldfiles
|
||||
• |:recover|
|
||||
|
||||
@@ -24,19 +24,20 @@ Table of contents: |usr_toc.txt|
|
||||
==============================================================================
|
||||
*31.1* The file browser
|
||||
|
||||
Nvim can open the current directory in its |dir| browser with: >
|
||||
You can open the current directory with: >
|
||||
|
||||
:browse edit
|
||||
|
||||
The same works when opening a split or tab page: >
|
||||
The same works when opening a split or tabpage: >
|
||||
|
||||
:browse split
|
||||
:browse vsplit
|
||||
:browse tabedit
|
||||
:browse tabnew
|
||||
|
||||
A third-party directory browser may handle the directory instead; see
|
||||
|dir-disable|. Use the browser's mappings to open a file.
|
||||
By default this is handled by the builtin |dir| plugin. To use a third-party
|
||||
directory browser instead, see |dir-disable|. Use the dir browser's mappings
|
||||
to open a file.
|
||||
|
||||
When a file or directory argument is given, the command is executed normally.
|
||||
For example: >
|
||||
|
||||
@@ -953,7 +953,7 @@ windows.
|
||||
*preview-popup*
|
||||
Alternatively, a floating window can be used by setting the 'previewpopup'
|
||||
option. When set, it overrules the 'previewwindow' and 'previewheight'
|
||||
settings. See 'previewpopup' for the accepted items.
|
||||
settings.
|
||||
|
||||
*:pt* *:ptag*
|
||||
:pt[ag][!] [tagname]
|
||||
|
||||
@@ -1266,18 +1266,20 @@ end
|
||||
--- @class vim.keycode.chord
|
||||
--- @inlinedoc
|
||||
---
|
||||
--- Key without modifiers. Example: `<C-A>` has `key` `a`.
|
||||
--- Key without modifiers.
|
||||
--- Example: `<C-A>` has `key="a"`.
|
||||
--- @field key string
|
||||
---
|
||||
--- Alternative spelling of `key`, or nil if There Is No Alternative (TINA).
|
||||
--- Example: `key="<"` has `key_alt="lt"`.
|
||||
--- Example: `"<"` has `key_alt="lt"`.
|
||||
--- @field key_alt string?
|
||||
---
|
||||
--- Full key-chord in canonical key-notation (as produced by |keytrans()|), including modifiers.
|
||||
--- Example: `<A-f>` has `keys="<M-f>"`.
|
||||
--- @field keys string
|
||||
---
|
||||
--- A list of single character modifiers of the key.
|
||||
--- List of key-chord modifiers.
|
||||
--- Example: `<C-S-f>` has `mod={ 'C', 'S' }`.
|
||||
--- @field mod ('M'|'T'|'C'|'S'|'2'|'3'|'4'|'D')[]
|
||||
|
||||
--- Converts keys from [key-notation] to the internal encoding. Optionally returns structured
|
||||
@@ -1302,7 +1304,7 @@ end
|
||||
---
|
||||
--- @param keys string Keys in [key-notation].
|
||||
--- @param info boolean? Also return key-chord info.
|
||||
--- @return string # Internal bytes representation of the given `keys`.
|
||||
--- @return string # Internal representation of the given `keys`.
|
||||
--- @return vim.keycode.chord[]? # List of parsed key-chords, each with fields:
|
||||
--- @see |nvim_replace_termcodes()|
|
||||
--- @see |keytrans()|
|
||||
|
||||
@@ -11,53 +11,53 @@ vim.uv = ...
|
||||
--- EmmyLua reads the precise generics from `runtime/lua/vim/iter.lua`; LuaLS uses
|
||||
--- these broader shapes for downstream type-checking.
|
||||
--- @class vim.Iter
|
||||
--- @field filter fun(self: vim.Iter, f: fun(...): boolean): vim.Iter
|
||||
--- @field unique fun(self: vim.Iter, key?: fun(...): any): vim.Iter
|
||||
--- @field flatten fun(self: vim.Iter, depth?: integer): vim.IterArray
|
||||
--- @field map fun(self: vim.Iter, f: fun(...): ...): vim.Iter
|
||||
--- @field each fun(self: vim.Iter, f: fun(...)): nil
|
||||
--- @field totable fun(self: vim.Iter): table
|
||||
--- @field join fun(self: vim.Iter, delim: string): string
|
||||
--- @field fold fun(self: vim.Iter, init: any, f: fun(acc: any, ...): any): any
|
||||
--- @field next fun(self: vim.Iter): any
|
||||
--- @field rev fun(self: vim.Iter): vim.IterArray
|
||||
--- @field peek fun(self: vim.Iter): any
|
||||
--- @field find fun(self: vim.Iter, f: any): any
|
||||
--- @field rfind fun(self: vim.Iter, f: any): any
|
||||
--- @field take fun(self: vim.Iter, n: integer|fun(...): boolean): vim.Iter
|
||||
--- @field pop fun(self: vim.Iter): any
|
||||
--- @field rpeek fun(self: vim.Iter): any
|
||||
--- @field skip fun(self: vim.Iter, n: integer|fun(...): boolean): vim.Iter
|
||||
--- @field rskip fun(self: vim.Iter, n: integer): vim.IterArray
|
||||
--- @field nth fun(self: vim.Iter, n: integer): any
|
||||
--- @field slice fun(self: vim.Iter, first: integer, last: integer): vim.IterArray
|
||||
--- @field any fun(self: vim.Iter, pred: fun(...): boolean): boolean
|
||||
--- @field all fun(self: vim.Iter, pred: fun(...): boolean): boolean
|
||||
--- @field last fun(self: vim.Iter): any
|
||||
--- @field enumerate fun(self: vim.Iter): vim.Iter
|
||||
--- @field any fun(self: vim.Iter, pred: fun(...): boolean): boolean
|
||||
--- @field count fun(self: vim.Iter): integer
|
||||
--- @field each fun(self: vim.Iter, f: fun(...)): nil
|
||||
--- @field enumerate fun(self: vim.Iter): vim.Iter
|
||||
--- @field filter fun(self: vim.Iter, f: fun(...): boolean): vim.Iter
|
||||
--- @field find fun(self: vim.Iter, f: any): any
|
||||
--- @field flatten fun(self: vim.Iter, depth?: integer): vim.IterArray
|
||||
--- @field fold fun(self: vim.Iter, init: any, f: fun(acc: any, ...): any): any
|
||||
--- @field join fun(self: vim.Iter, delim: string): string
|
||||
--- @field last fun(self: vim.Iter): any
|
||||
--- @field map fun(self: vim.Iter, f: fun(...): ...): vim.Iter
|
||||
--- @field next fun(self: vim.Iter): any
|
||||
--- @field nth fun(self: vim.Iter, n: integer): any
|
||||
--- @field peek fun(self: vim.Iter): any
|
||||
--- @field pop fun(self: vim.Iter): any
|
||||
--- @field rev fun(self: vim.Iter): vim.IterArray
|
||||
--- @field rfind fun(self: vim.Iter, f: any): any
|
||||
--- @field rpeek fun(self: vim.Iter): any
|
||||
--- @field rskip fun(self: vim.Iter, n: integer): vim.IterArray
|
||||
--- @field skip fun(self: vim.Iter, n: integer|fun(...): boolean): vim.Iter
|
||||
--- @field slice fun(self: vim.Iter, first: integer, last: integer): vim.IterArray
|
||||
--- @field take fun(self: vim.Iter, n: integer|fun(...): boolean): vim.Iter
|
||||
--- @field totable fun(self: vim.Iter): table
|
||||
--- @field unique fun(self: vim.Iter, key?: fun(...): any): vim.Iter
|
||||
|
||||
--- @class vim.IterArray : vim.Iter
|
||||
--- @field filter fun(self: vim.IterArray, f: fun(...): boolean): vim.IterArray
|
||||
--- @field unique fun(self: vim.IterArray, key?: fun(...): any): vim.IterArray
|
||||
--- @field flatten fun(self: vim.IterArray, depth?: integer): vim.IterArray
|
||||
--- @field map fun(self: vim.IterArray, f: fun(...): ...): vim.IterArray
|
||||
--- @field totable fun(self: vim.IterArray): table
|
||||
--- @field fold fun(self: vim.IterArray, init: any, f: fun(acc: any, ...): any): any
|
||||
--- @field next fun(self: vim.IterArray): any
|
||||
--- @field rev fun(self: vim.IterArray): vim.IterArray
|
||||
--- @field peek fun(self: vim.IterArray): any
|
||||
--- @field find fun(self: vim.IterArray, f: any): any
|
||||
--- @field rfind fun(self: vim.IterArray, f: any): any
|
||||
--- @field take fun(self: vim.IterArray, n: integer|fun(...): boolean): vim.IterArray
|
||||
--- @field pop fun(self: vim.IterArray): any
|
||||
--- @field rpeek fun(self: vim.IterArray): any
|
||||
--- @field skip fun(self: vim.IterArray, n: integer|fun(...): boolean): vim.IterArray
|
||||
--- @field rskip fun(self: vim.IterArray, n: integer): vim.IterArray
|
||||
--- @field slice fun(self: vim.IterArray, first: integer, last: integer): vim.IterArray
|
||||
--- @field last fun(self: vim.IterArray): any
|
||||
--- @field enumerate fun(self: vim.IterArray): vim.IterArray
|
||||
--- @field count fun(self: vim.IterArray): integer
|
||||
--- @field enumerate fun(self: vim.IterArray): vim.IterArray
|
||||
--- @field filter fun(self: vim.IterArray, f: fun(...): boolean): vim.IterArray
|
||||
--- @field find fun(self: vim.IterArray, f: any): any
|
||||
--- @field flatten fun(self: vim.IterArray, depth?: integer): vim.IterArray
|
||||
--- @field fold fun(self: vim.IterArray, init: any, f: fun(acc: any, ...): any): any
|
||||
--- @field last fun(self: vim.IterArray): any
|
||||
--- @field map fun(self: vim.IterArray, f: fun(...): ...): vim.IterArray
|
||||
--- @field next fun(self: vim.IterArray): any
|
||||
--- @field peek fun(self: vim.IterArray): any
|
||||
--- @field pop fun(self: vim.IterArray): any
|
||||
--- @field rev fun(self: vim.IterArray): vim.IterArray
|
||||
--- @field rfind fun(self: vim.IterArray, f: any): any
|
||||
--- @field rpeek fun(self: vim.IterArray): any
|
||||
--- @field rskip fun(self: vim.IterArray, n: integer): vim.IterArray
|
||||
--- @field skip fun(self: vim.IterArray, n: integer|fun(...): boolean): vim.IterArray
|
||||
--- @field slice fun(self: vim.IterArray, first: integer, last: integer): vim.IterArray
|
||||
--- @field take fun(self: vim.IterArray, n: integer|fun(...): boolean): vim.IterArray
|
||||
--- @field totable fun(self: vim.IterArray): table
|
||||
--- @field unique fun(self: vim.IterArray, key?: fun(...): any): vim.IterArray
|
||||
|
||||
--- @class vim.IterModule
|
||||
--- @operator call: fun(src: any, ...): vim.Iter
|
||||
|
||||
28
runtime/lua/vim/_meta/api.gen.lua
generated
28
runtime/lua/vim/_meta/api.gen.lua
generated
@@ -1212,29 +1212,24 @@ function vim.api.nvim_exec2(src, opts) end
|
||||
--- - pattern (`string|array?`, default: current file name) `autocmd-pattern`. Not allowed with {buf}.
|
||||
function vim.api.nvim_exec_autocmds(event, opts) end
|
||||
|
||||
--- Sends input-keys to Nvim, subject to various quirks controlled by `mode`
|
||||
--- flags. This is a blocking call, unlike `nvim_input()`.
|
||||
--- Sends input-keys to Nvim, subject to various quirks controlled by `mode` flags. This is
|
||||
--- a blocking call, unlike `nvim_input()`.
|
||||
---
|
||||
--- On execution error: does not fail, but updates v:errmsg.
|
||||
---
|
||||
--- To input sequences like [<C-o>] use `nvim_replace_termcodes()` (typically
|
||||
--- with escape_ks=false) to replace `keycodes`, then pass the result to
|
||||
--- nvim_feedkeys().
|
||||
---
|
||||
--- Example:
|
||||
--- To input keycodes like [<C-o>], pass the result of `nvim_replace_termcodes()`:
|
||||
---
|
||||
--- ```vim
|
||||
--- :let key = nvim_replace_termcodes("<C-o>", v:true, v:false, v:true)
|
||||
--- :let key = nvim_replace_termcodes('<C-o>', v:true, v:false, v:true)
|
||||
--- :call nvim_feedkeys(key, 'n', v:false)
|
||||
--- ```
|
||||
---
|
||||
--- @see feedkeys()
|
||||
--- @see vim_strsave_escape_ks
|
||||
--- @param keys string to be typed
|
||||
--- @param mode string behavior flags, see `feedkeys()`
|
||||
--- @param escape_ks boolean If true, escape K_SPECIAL bytes in `keys`.
|
||||
--- This should be false if you already used
|
||||
--- `nvim_replace_termcodes()`, and true otherwise.
|
||||
--- @param keys string Keys to send as input.
|
||||
--- @param mode string Behavior flags, see `feedkeys()`.
|
||||
--- @param escape_ks boolean If true, escape K_SPECIAL bytes in `keys`. Should be false if you used
|
||||
--- `nvim_replace_termcodes()`, else true.
|
||||
function vim.api.nvim_feedkeys(keys, mode, escape_ks) end
|
||||
|
||||
--- Gets the option information for all options.
|
||||
@@ -2051,13 +2046,10 @@ function vim.api.nvim_paste(data, crlf, phase) end
|
||||
--- @param follow boolean If true place cursor at end of inserted text.
|
||||
function vim.api.nvim_put(lines, type, after, follow) end
|
||||
|
||||
--- Replaces terminal codes and `keycodes` ([<CR>], [<Esc>], ...) in a string with
|
||||
--- the internal representation.
|
||||
--- Converts terminal codes and `keycodes` ([<CR>], [<Esc>], …) in a key sequence, to the internal
|
||||
--- representation. See also Lua `vim.keycode()`.
|
||||
---
|
||||
---
|
||||
--- Note:
|
||||
--- Lua can use |vim.keycode()| instead.
|
||||
---
|
||||
--- @see replace_termcodes
|
||||
--- @see cpoptions
|
||||
--- @param str string String to be converted.
|
||||
|
||||
@@ -572,8 +572,8 @@ local function lsp_enable_callback(bufnr)
|
||||
end
|
||||
end
|
||||
|
||||
--- Auto-activates LSP in each buffer based on the |lsp-config| `filetypes`, `root_markers`, and
|
||||
--- `root_dir`.
|
||||
--- Enables a [lsp-config]: automatically attaches the client to any buffer based on the config
|
||||
--- `filetypes`, `root_markers`, and `root_dir`. See [lsp-activate] for details.
|
||||
---
|
||||
--- To disable, pass `enable=false`: Stops related clients and servers (force-stops servers after
|
||||
--- a timeout, unless `exit_timeout=false`).
|
||||
|
||||
@@ -265,27 +265,22 @@ void nvim_set_hl_ns_fast(Integer ns_id, Error *err)
|
||||
hl_check_ns();
|
||||
}
|
||||
|
||||
/// Sends input-keys to Nvim, subject to various quirks controlled by `mode`
|
||||
/// flags. This is a blocking call, unlike |nvim_input()|.
|
||||
/// Sends input-keys to Nvim, subject to various quirks controlled by `mode` flags. This is
|
||||
/// a blocking call, unlike |nvim_input()|.
|
||||
///
|
||||
/// On execution error: does not fail, but updates v:errmsg.
|
||||
///
|
||||
/// To input sequences like [<C-o>] use |nvim_replace_termcodes()| (typically
|
||||
/// with escape_ks=false) to replace |keycodes|, then pass the result to
|
||||
/// nvim_feedkeys().
|
||||
///
|
||||
/// Example:
|
||||
/// To input keycodes like [<C-o>], pass the result of |nvim_replace_termcodes()|:
|
||||
///
|
||||
/// ```vim
|
||||
/// :let key = nvim_replace_termcodes("<C-o>", v:true, v:false, v:true)
|
||||
/// :let key = nvim_replace_termcodes('<C-o>', v:true, v:false, v:true)
|
||||
/// :call nvim_feedkeys(key, 'n', v:false)
|
||||
/// ```
|
||||
///
|
||||
/// @param keys to be typed
|
||||
/// @param mode behavior flags, see |feedkeys()|
|
||||
/// @param escape_ks If true, escape K_SPECIAL bytes in `keys`.
|
||||
/// This should be false if you already used
|
||||
/// |nvim_replace_termcodes()|, and true otherwise.
|
||||
/// @param keys Keys to send as input.
|
||||
/// @param mode Behavior flags, see |feedkeys()|.
|
||||
/// @param escape_ks If true, escape K_SPECIAL bytes in `keys`. Should be false if you used
|
||||
/// |nvim_replace_termcodes()|, else true.
|
||||
/// @see feedkeys()
|
||||
/// @see vim_strsave_escape_ks
|
||||
void nvim_feedkeys(String keys, String mode, Boolean escape_ks)
|
||||
@@ -481,10 +476,9 @@ error:
|
||||
"invalid button or action");
|
||||
}
|
||||
|
||||
/// Replaces terminal codes and |keycodes| ([<CR>], [<Esc>], ...) in a string with
|
||||
/// the internal representation.
|
||||
/// Converts terminal codes and |keycodes| ([<CR>], [<Esc>], …) in a key sequence, to the internal
|
||||
/// representation. See also Lua |vim.keycode()|.
|
||||
///
|
||||
/// @note Lua can use |vim.keycode()| instead.
|
||||
/// @see replace_termcodes
|
||||
/// @see cpoptions
|
||||
///
|
||||
|
||||
@@ -972,9 +972,9 @@ typedef enum {
|
||||
} FloatRelative;
|
||||
|
||||
typedef enum {
|
||||
kWinNormal = 0,
|
||||
kWinInfo,
|
||||
kWinPreview,
|
||||
kWinNormal = 0, ///< Non-special window (split or float).
|
||||
kWinInfo, ///< Completion-menu "info" popup.
|
||||
kWinPreview, ///< 'previewpopup' window.
|
||||
} WinKind;
|
||||
|
||||
/// Keep in sync with win_split_str[] in nvim_win_get_config() (api/win_config.c)
|
||||
@@ -1295,8 +1295,8 @@ struct window_S {
|
||||
int w_nrwidth; // width of 'number' and 'relativenumber'
|
||||
// column being used
|
||||
int w_scwidth; // width of 'signcolumn'
|
||||
int w_minscwidth; // minimum width or SCL_NO/SCL_NUM
|
||||
int w_maxscwidth; // maximum width or SCL_NO/SCL_NUM
|
||||
int w_minscwidth; // minimum 'signcolumn' width, or SCL_NO/SCL_NUM
|
||||
int w_maxscwidth; // maximum 'signcolumn' width, or SCL_NO/SCL_NUM
|
||||
|
||||
// === end of cached values ===
|
||||
|
||||
|
||||
@@ -4,21 +4,20 @@ local n = require('test.functional.testnvim')()
|
||||
local describe, it, before_each, after_each = t.describe, t.it, t.before_each, t.after_each
|
||||
local clear, command, eval, eq = n.clear, n.command, n.eval, t.eq
|
||||
local mkdir = t.mkdir
|
||||
local fn = n.fn
|
||||
|
||||
before_each(function()
|
||||
clear()
|
||||
mkdir('test-glob')
|
||||
|
||||
-- Long path might cause "Press ENTER" prompt; use :silent to avoid it.
|
||||
command('silent cd test-glob')
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
vim.uv.fs_rmdir('test-glob')
|
||||
end)
|
||||
|
||||
describe('glob()', function()
|
||||
before_each(function()
|
||||
clear()
|
||||
mkdir('test-glob')
|
||||
|
||||
-- Long path might cause "Press ENTER" prompt; use :silent to avoid it.
|
||||
command('silent cd test-glob')
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
vim.uv.fs_rmdir('test-glob')
|
||||
end)
|
||||
|
||||
it("glob('.*') returns . and .. ", function()
|
||||
eq({ '.', '..' }, eval("glob('.*', 0, 1)"))
|
||||
-- Do it again to verify scandir_next_with_dots() internal state.
|
||||
|
||||
Reference in New Issue
Block a user