mirror of
https://github.com/neovim/neovim.git
synced 2026-03-27 19:02:02 +00:00
docs: misc, terminal
Close #38319 Close #38348 Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Barrett Ruth <br.barrettruth@gmail.com>
This commit is contained in:
@@ -1174,8 +1174,8 @@ omnifunc({findstart}, {base}) *vim.lsp.omnifunc()*
|
||||
|
||||
Return: ~
|
||||
(`integer|table`) Decided by {findstart}:
|
||||
• findstart=0: column where the completion starts, or -2 or -3
|
||||
• findstart=1: list of matches (actually just calls |complete()|)
|
||||
• findstart=1: column where the completion starts, or -2 or -3
|
||||
• findstart=0: list of matches (actually just calls |complete()|)
|
||||
|
||||
See also: ~
|
||||
• |complete-functions|
|
||||
|
||||
@@ -425,6 +425,7 @@ TERMINAL
|
||||
bottom-left of the buffer and can be resumed by pressing a key.
|
||||
• On terminal exit, "[Process exited]" is shown as virtual text (instead of
|
||||
modifying buffer contents), and exit code is shown in statusline.
|
||||
• You can disable "[Process exited]" entirely, see |terminal-config|.
|
||||
|
||||
TREESITTER
|
||||
|
||||
@@ -494,7 +495,7 @@ These existing features changed their behavior.
|
||||
absolute paths (to the current drive) and no longer relative.
|
||||
• When 'shelltemp' is off, shell commands now use `pipe()` and not `socketpair()`
|
||||
for input and output. This matters mostly for Linux where some command lines
|
||||
using "/dev/stdin" and similiar would break as these special files can be
|
||||
using "/dev/stdin" and similar would break as these special files can be
|
||||
reopened when backed by pipes but not when backed by socket pairs.
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -54,10 +54,10 @@ mode. *t_CTRL-\_CTRL-O*
|
||||
|
||||
Terminal-mode forces these local options:
|
||||
|
||||
'cursorlineopt' = number
|
||||
'nocursorcolumn'
|
||||
'scrolloff' = 0
|
||||
'sidescrolloff' = 0
|
||||
- 'cursorlineopt' = number
|
||||
- 'nocursorcolumn'
|
||||
- 'scrolloff' = 0
|
||||
- 'sidescrolloff' = 0
|
||||
|
||||
Terminal-mode has its own |:tnoremap| namespace for mappings, this can be used
|
||||
to automate any terminal interaction.
|
||||
@@ -101,6 +101,7 @@ Configuration *terminal-config*
|
||||
|
||||
- Options: 'modified', 'scrollback'
|
||||
- Events: |TermOpen|, |TermEnter|, |TermLeave|, |TermClose|
|
||||
- Event groups: "nvim.terminal" |default-autocmds|
|
||||
- Highlight groups: |hl-TermCursor|
|
||||
|
||||
Terminal sets local defaults for some options, which may differ from your
|
||||
@@ -114,7 +115,13 @@ global configuration.
|
||||
- 'foldcolumn' is set to "0"
|
||||
|
||||
You can change the defaults with a TermOpen autocommand: >vim
|
||||
au TermOpen * setlocal list
|
||||
:autocmd TermOpen * setlocal list
|
||||
|
||||
By default, "[Process exited]" is displayed when the terminal process ends. To
|
||||
disable that, you can delete the "nvim.terminal" TermClose handler (this also
|
||||
deletes other |default-autocmds| TermClose functionality): >vim
|
||||
:autocmd! nvim.terminal TermClose
|
||||
<
|
||||
|
||||
TERMINAL COLORS ~
|
||||
|
||||
|
||||
@@ -605,14 +605,13 @@ do
|
||||
vim.api.nvim_buf_get_extmarks(ev.buf, nvim_terminal_exitmsg_ns, 0, -1, {})
|
||||
) > 0
|
||||
|
||||
-- `nvim_open_term` buffers do not have any attached chan
|
||||
-- `nvim_open_term` buffers do not have an attached 'channel'.
|
||||
local msg = buf.channel == 0 and '[Terminal closed]'
|
||||
or ('[Process exited %d]'):format(vim.v.event.status)
|
||||
|
||||
-- TermClose may be queued before TermOpen if the process
|
||||
-- exits before `terminal_open` is called. Don't display
|
||||
-- the msg now, let TermOpen display it.
|
||||
if buf.buftype ~= 'terminal' or buf_has_exitmsg then
|
||||
-- TermClose may be queued before TermOpen if process exits before `terminal_open` is called.
|
||||
-- Don't display the msg now, let TermOpen display it.
|
||||
vim.api.nvim_create_autocmd('TermOpen', {
|
||||
buffer = ev.buf,
|
||||
once = true,
|
||||
|
||||
@@ -1332,8 +1332,8 @@ end
|
||||
---@param base integer findstart=0, text to match against
|
||||
---
|
||||
---@return integer|table Decided by {findstart}:
|
||||
--- - findstart=0: column where the completion starts, or -2 or -3
|
||||
--- - findstart=1: list of matches (actually just calls |complete()|)
|
||||
--- - findstart=1: column where the completion starts, or -2 or -3
|
||||
--- - findstart=0: list of matches (actually just calls |complete()|)
|
||||
function lsp.omnifunc(findstart, base)
|
||||
return vim.lsp.completion._omnifunc(findstart, base)
|
||||
end
|
||||
|
||||
@@ -1262,8 +1262,8 @@ end
|
||||
--- @param base integer findstart=0, text to match against
|
||||
---
|
||||
--- @return integer|table Decided by {findstart}:
|
||||
--- - findstart=0: column where the completion starts, or -2 or -3
|
||||
--- - findstart=1: list of matches (actually just calls |complete()|)
|
||||
--- - findstart=1: column where the completion starts, or -2 or -3
|
||||
--- - findstart=0: list of matches (actually just calls |complete()|)
|
||||
function M._omnifunc(findstart, base)
|
||||
lsp.log.debug('omnifunc.findstart', { findstart = findstart, base = base })
|
||||
local bufnr = api.nvim_get_current_buf()
|
||||
|
||||
@@ -1556,7 +1556,7 @@ static void deferred_event(void **argv)
|
||||
/// @param event event that occurred
|
||||
/// @param fname filename, NULL or empty means use actual file name
|
||||
/// @param fname_io filename to use for <afile> on cmdline
|
||||
/// @param force When true, ignore autocmd_busy
|
||||
/// @param force Ignore autocmd_busy (force "++nested" behavior)
|
||||
/// @param buf Buffer for <abuf>
|
||||
///
|
||||
/// @return true if some commands were executed.
|
||||
@@ -1571,7 +1571,7 @@ bool apply_autocmds(event_T event, char *fname, char *fname_io, bool force, buf_
|
||||
/// @param event event that occurred
|
||||
/// @param fname NULL or empty means use actual file name
|
||||
/// @param fname_io fname to use for <afile> on cmdline
|
||||
/// @param force When true, ignore autocmd_busy
|
||||
/// @param force Ignore autocmd_busy (force "++nested" behavior)
|
||||
/// @param buf Buffer for <abuf>
|
||||
/// @param exarg Ex command arguments
|
||||
///
|
||||
@@ -1590,7 +1590,7 @@ bool apply_autocmds_exarg(event_T event, char *fname, char *fname_io, bool force
|
||||
/// @param event event that occurred
|
||||
/// @param fname NULL or empty means use actual file name
|
||||
/// @param fname_io fname to use for <afile> on cmdline
|
||||
/// @param force When true, ignore autocmd_busy
|
||||
/// @param force Ignore autocmd_busy (force "++nested" behavior)
|
||||
/// @param buf Buffer for <abuf>
|
||||
/// @param[in,out] retval caller's retval
|
||||
///
|
||||
@@ -1643,7 +1643,7 @@ bool trigger_cursorhold(void) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
|
||||
/// @param fname filename, NULL or empty means use actual file name
|
||||
/// @param fname_io filename to use for <afile> on cmdline,
|
||||
/// NULL means use `fname`.
|
||||
/// @param force When true, ignore autocmd_busy
|
||||
/// @param force Ignore autocmd_busy (force "++nested" behavior)
|
||||
/// @param group autocmd group ID or AUGROUP_ALL
|
||||
/// @param buf Buffer for <abuf>
|
||||
/// @param eap Ex command arguments
|
||||
|
||||
Reference in New Issue
Block a user