Compare commits

...

148 Commits

Author SHA1 Message Date
1fa917f9a1 NVIM 0.8.2
Features
- help: Highlighted codeblocks for plugin documentation

Documentation
- lua: Add guide to using Lua in Neovim (#21137)
- Mention how to remove the "How-to disable mouse" menu item
- Fix order of numbers in syntax.txt
- lua: Correct the tags for vim.opt_local and vim.opt_global (#21138)

Bug Fixes
- api: Set correct curbuf when temporarily changing curwin
- api: "emsg_silent" should imply "silent" in nvim_cmd
- decoration: Do not reset must_redraw after calling providers
- diagnostic: Clear stale cache on reset (#21454)
- events: Save v:event for cmdline autocommands separately
- float: Fix ml_get error with bufpos
- float: Fix crash with bufpos and non-existent window
- folds: Use long for number of folded lines
- mappings: Use all buckets in second round of unmap
- memory: Fix memory alignment for dynamic allocation
- options: Fix local 'sidescrolloff' doesn't work for mouse
- options: Restore exists() behavior for options
- terminal: Fix 'mousescroll' not respected in terminal mode
- tui: Set cursor color parameter as string when required
- win_close: Remove float grid after closing buffer

Build System Fixes
- Restrict `git describe` to top level source directory
2022-12-29 17:12:10 +01:00
73298d1cd6 Merge pull request #21582 from neovim/backport-21581-to-release-0.8
[Backport release-0.8] docs: fix order of numbers in syntax.txt
2022-12-29 12:52:52 +08:00
0eb155cd26 docs: fix order of numbers in syntax.txt
(cherry picked from commit 6fc8248af9)
2022-12-29 04:42:08 +00:00
da68023d98 Merge pull request #21564 from neovim/backport-20722-to-release-0.8
[Backport release-0.8] vim-patch:9.0.0788: ModeChanged autocmd not executed when Visual ends with CTRL-C
2022-12-28 13:58:45 +08:00
3892ba2405 vim-patch:9.0.0788: ModeChanged autocmd not executed when Visual ends with CTRL-C
Problem:    ModeChanged autocmd not executed when Visual mode is ended with
            CTRL-C.
Solution:   Do not trigger the autocmd when got_int is set. (closes vim/vim#11394)
61c4b04799

Cherry-pick removal of cmdwin feature check from patch 9.0.0663.

(cherry picked from commit 0b3328d15a)
2022-12-28 05:48:18 +00:00
9c109a46d3 Merge pull request #21554 from neovim/backport-21551-to-release-0.8
[Backport release-0.8] fix(win_close): remove float grid after closing buffer
2022-12-27 18:19:05 +08:00
d5bdcb2bd7 fix(win_close): remove float grid after closing buffer
It is not safe to remove the float grid when autocommands can still be
triggered, as autocommands may use the float grid.

(cherry picked from commit 9a5e80af56)
2022-12-27 09:37:08 +00:00
e951181d84 refactor(win_close): suppress clang "Dereference of NULL pointer" 2022-12-27 17:36:02 +08:00
2542aa0b75 Merge pull request #21535 from neovim/backport-21534-to-release-0.8
[Backport release-0.8] fix(mappings): use all buckets in second round of unmap
2022-12-26 11:44:07 +08:00
172202b49a fix(mappings): use all buckets in second round of unmap
(cherry picked from commit 32b5afd768)
2022-12-26 03:21:19 +00:00
68ef157cc2 Merge pull request #21514 from neovim/backport-vimdoc
[Backport release-0.8] syntax-highlighted codeblocks
2022-12-24 11:24:46 +01:00
460c1b7888 docs(lua): correct the tags for vim.opt_local and vim.opt_global (#21138) 2022-12-23 12:31:37 +01:00
cc02cfee2f docs(lua): add guide to using Lua in Neovim (#21137)
Add introductory guide explaining how to use Lua in Neovim:
where to put Lua files, how to set variables and options, how
to create mappings, autocommands, and user commands.

Adapted with kind permission from
https://github.com/nanotee/nvim-lua-guide
2022-12-23 12:22:51 +01:00
342312b8ad feat(help): highlighted codeblocks
cherry-picked from 5093f38c9f

(omit partial doc change)
2022-12-23 12:15:14 +01:00
b840eb6945 Merge pull request #21511 from neovim/backport-21510-to-release-0.8
[Backport release-0.8] fix(options): restore exists() behavior for options
2022-12-23 14:14:32 +08:00
799e5fb92b fix(options): restore exists() behavior for options
Duplicating get_option_value() logic for an obscure future refactor
isn't really worthwhile, and findoption() isn't used anywhere else
outside the options code.

(cherry picked from commit 09841ccbc3)
2022-12-23 06:02:07 +00:00
9a6a7ad469 refactor(get_option_tv): rename opt_flags to scope 2022-12-23 14:01:02 +08:00
76987e8f04 Merge pull request #21492 from neovim/backport-21459
[Backport release-0.8] fix(decoration): do not reset must_redraw after calling providers
2022-12-21 23:59:36 +08:00
d0f71270cc fix(decoration): do not reset must_redraw after calling providers
Resetting must_redraw caused a strange bug #21278.
Remove the goto as well, as it doesn't make much sense after #20665.
2022-12-21 23:46:28 +08:00
d849640613 Merge pull request #21481 from neovim/backport-21479-to-release-0.8
[Backport release-0.8] test(old): make test_signs.vim closer to upstream
2022-12-20 12:29:31 +08:00
d2582350b2 test(old): make test_signs.vim closer to upstream
(cherry picked from commit 5391e8b002)
2022-12-20 04:16:49 +00:00
bd3634d7a4 Merge pull request #21468 from neovim/backport-21407-to-release-0.8
[Backport release-0.8] fix(tui): set cursor color parameter as string when required
2022-12-19 07:23:33 +08:00
1860792ed6 fix(tui): set cursor color parameter as string when required
(cherry picked from commit d85723b268)
2022-12-18 23:11:23 +00:00
48f0545594 fix(diagnostic): clear stale cache on reset (#21454)
The BufWipeout autocmd is not 100% reliable and may leave stale entries
in the cache. This is sort of a hack/workaround to ensure
`vim.diagnostic.reset` calls don't fail if there are stale cache entries
but instead clears them

Fixes errors like

    Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/diagnostic.lua:1458: Invalid buffer id: 22
    stack traceback:
            [C]: in function 'nvim_exec_autocmds'
            /usr/share/nvim/runtime/lua/vim/diagnostic.lua:1458: in function 'reset'

(cherry picked from commit 1743359235)
2022-12-18 19:25:20 +01:00
9bda3b3e04 Merge pull request #21466 from neovim/backport-21465-to-release-0.8
[Backport release-0.8] vim-patch:9.0.1072: screenpos() column result in fold may be too small
2022-12-18 21:39:52 +08:00
23202944ec vim-patch:9.0.1072: screenpos() column result in fold may be too small
Problem:    screenpos() column result in fold may be too small.
Solution:   Add space of 'number', sign column, etc. (closes vim/vim#11715)

ba2d191932
(cherry picked from commit 56b77dc171)
2022-12-18 13:26:51 +00:00
bc6ff78fad Merge pull request #21449 from neovim/zeertzjq-patch-1
[Backport release-0.8] fix(folds): use long for number of folded lines
2022-12-17 08:38:21 +08:00
3510298930 fix(folds): use long for number of folded lines 2022-12-17 08:14:27 +08:00
5b718e8c12 Merge pull request #21439 from neovim/backport-21438-to-release-0.8
[Backport release-0.8] fix(api): "emsg_silent" should imply "silent" in nvim_cmd
2022-12-16 09:13:56 +08:00
a9e78dd2f6 fix(api): "emsg_silent" should imply "silent" in nvim_cmd
(cherry picked from commit bad66a1e09)
2022-12-16 00:54:49 +00:00
ad82f59f59 Merge pull request #21425 from neovim/backport-21415-to-release-0.8
[Backport release-0.8] fix(terminal): fix 'mousescroll' not respected in terminal mode
2022-12-15 09:43:22 +08:00
da47f6e56a fix(terminal): fix 'mousescroll' not respected in terminal mode
(cherry picked from commit 7c0e5e68a4)
2022-12-15 01:15:26 +00:00
faa5ecce93 Merge pull request #21395 from neovim/backport-21394-to-release-0.8
[Backport release-0.8] docs: mention how to remove the "How-to disable mouse" menu item
2022-12-13 09:53:10 +08:00
ec2d6dc955 docs: mention how to remove the "How-to disable mouse" menu item
(cherry picked from commit da2501c5bd)
2022-12-13 01:44:29 +00:00
ca4a600e43 Merge pull request #21372 from neovim/backport-21371-to-release-0.8
[Backport release-0.8] fix(api): set correct curbuf when temporarily changing curwin
2022-12-10 20:27:49 +08:00
b8b2101540 fix(api): set correct curbuf when temporarily changing curwin
(cherry picked from commit 44f22adb22)
2022-12-10 12:14:23 +00:00
45d593e1c8 Merge pull request #21351 from neovim/backport-21338-to-release-0.8
[Backport release-0.8] vim-patch:9.0.{1030,1032}: using freed memory with the cmdline popup menu
2022-12-09 08:34:30 +08:00
6f386c75c4 vim-patch:9.0.1032: test fails when terminal feature is missing
Problem:    Test fails when terminal feature is missing.
Solution:   Use CheckRunVimInTerminal.

b9603f6498

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 95c655fedc)
2022-12-09 00:18:28 +00:00
21ea794690 vim-patch:9.0.1030: using freed memory with the cmdline popup menu
Problem:    Using freed memory with the cmdline popup menu.
Solution:   Clear the popup menu when clearing the matches. (closes vim/vim#11677)

038e6d20e6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 4d22424d9e)
2022-12-09 00:18:28 +00:00
0bc56cebe7 Merge pull request #21349 from neovim/backport-21348-to-release-0.8
[Backport release-0.8] vim-patch:9.0.1036: undo misbehaves when writing from an insert mode mapping
2022-12-09 07:42:24 +08:00
cf7ae5f2f9 test(undo_spec): add more tests for writing in Insert mode
(cherry picked from commit 95044991e6)
2022-12-08 23:24:46 +00:00
eacc8230ed vim-patch:9.0.1036: undo misbehaves when writing from an insert mode mapping
Problem:    Undo misbehaves when writing from an insert mode mapping.
Solution:   Sync undo when writing. (closes vim/vim#11674)

3f8f827723

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 70d6c335b1)
2022-12-08 23:24:46 +00:00
927074c97a [Backport release-0.8] fix (#18501): chansend sending lines to terminal buffer in reverse order in Windows (#21344)
* fix(chansend): sending lines to terminal in reverse order on Windows #19315

Problem: `chansend()` on Windows sends lines in reverse order.
Cause: Using \n instead of \r\n for newlines on Windows.
Solution: on Windows, use CRLF newline characters.

Fixes #18501

(cherry picked from commit d5004aab27)

* fixup! fix(chansend): sending lines to terminal in reverse order on Windows #19315

(cherry picked from commit d313491a8b)

Co-authored-by: Enan Ajmain <3nan.ajmain@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-12-08 14:00:57 -08:00
e5fda53f5d Merge pull request #21323 from neovim/backport-21162-to-release-0.8
[Backport release-0.8] fix(options): fix local 'sidescrolloff' doesn't work for mouse
2022-12-07 13:09:17 +08:00
a853becfea fix(options): fix local 'sidescrolloff' doesn't work for mouse
Missing part of Vim patch 8.1.0864.

(cherry picked from commit 9caa4c8236)
2022-12-07 04:56:13 +00:00
015d3ddcfe Merge pull request #21320 from neovim/backport-21319-to-release-0.8
[Backport release-0.8] fix(float): fix crash with bufpos and non-existent window
2022-12-07 11:48:30 +08:00
8d41ffcb5b fix(float): fix crash with bufpos and non-existent window
(cherry picked from commit 759b04a2e7)
2022-12-07 03:37:13 +00:00
17f636cf23 Merge pull request #21317 from neovim/backport-21316-to-release-0.8
[Backport release-0.8] fix(events): save v:event for cmdline autocommands separately
2022-12-07 09:08:29 +08:00
ccb718a23d fix(events): save v:event for cmdline autocommands separately
(cherry picked from commit 4ef6efe927)
2022-12-07 00:58:05 +00:00
9bd5ba83ab Merge pull request #21304 from neovim/backport-21302-to-release-0.8
[Backport release-0.8] vim-patch:8.2.{3193,4204,4389},9.0.{1011,1016}: screenpos() fixes
2022-12-06 09:41:39 +08:00
78caeae92f vim-patch:9.0.1016: screenpos() does not count filler lines for diff mode
Problem:    screenpos() does not count filler lines for diff mode.
Solution:   Add filler lines. (closes 11658)

1cb16c3a20

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 52b3e8bdef)
2022-12-06 00:40:31 +00:00
65c8851098 vim-patch:9.0.1011: ml_get error when using screenpos()
Problem:    ml_get error when using screenpos().
Solution:   Give an error for the line number. (closes vim/vim#11661)

99d19438ca

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 0909d987fe)
2022-12-06 00:40:31 +00:00
e2afca9c76 vim-patch:8.2.4389: screenpos() does not handle a position in a closed fold
Problem:    screenpos() does not handle a position in a closed fold.
Solution:   Check if the position is inside a closed fold. (closes vim/vim#9778)

4556a2e868

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 10af0549df)
2022-12-06 00:40:31 +00:00
ebfe54617f vim-patch:8.2.4204: screenpos() has non-zero row for invisible text
Problem:    screenpos() has non-zero row for invisible text.
Solution:   Only add the window row when the text is visible. (closes vim/vim#9618)

7924a17791

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 6f9cda0f0a)
2022-12-06 00:40:31 +00:00
bc4d11cd9d fix(float): fix ml_get error with bufpos
(cherry picked from commit e120a049f0)
2022-12-06 00:40:31 +00:00
9f5c5abd42 vim-patch:8.2.3193: screenpos() is wrong when 'display' is "lastline"
Problem:    screenpos() is wrong when the last line is partially visible and
            'display' is "lastline".
Solution:   Also compute the position for a partially visible line.
            (closes vim/vim#8599)

189663bdac

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 11d2704274)
2022-12-06 00:40:31 +00:00
922a3c33f1 [Backport release-0.8] fix(lsp): ensure open_logfile is safe for fast events (#21290)
fix(lsp): ensure open_logfile is safe for fast events

Closes https://github.com/neovim/neovim/issues/21052

(cherry picked from commit a4100e1072)

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2022-12-04 19:05:27 +01:00
4d0fabfe4b Merge pull request #21263 from neovim/backport-20993-to-release-0.8
[Backport release-0.8] build: restrict `git describe` to top level source directory
2022-12-02 21:48:25 +08:00
4bef100e47 build: restrict git describe to top level source directory
fix version determination when building neovim from release tarball
extracted within another git repository

(cherry picked from commit 53ba7b9a5a)
2022-12-02 12:46:15 +00:00
346f77c5a6 Merge pull request #21219 from neovim/backport-20894-to-release-0.8
[Backport release-0.8] vim-patch:9.0.0821: crash with win_move_statusline() in another tabpage
2022-11-29 00:30:49 +08:00
4152151c94 vim-patch:9.0.0821: crash with win_move_statusline() in another tabpage
vim-patch:86e6717ace4f

Problem:    Crash when using win_move_statusline() in another tab page.
Solution:   Check for valid window pointer. (issue vim/vim#11427)

86e6717ace

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit d2a22242fb)
2022-11-28 16:30:18 +00:00
742bd4c181 Merge pull request #21127 from neovim/backport-20489-to-release-0.8
[Backport release-0.8] memory: fix memory alignment for dynamic allocation
2022-11-19 22:43:54 +01:00
41192dae78 refactor(memory): simplify new alignment logic
In particular, we can assume the xmalloc-ed pointer is at least
double-aligned, otherwise nothing work work.

(cherry picked from commit 8b7247af7d)
2022-11-19 20:07:30 +00:00
9c32331904 fix(memory): fix memory alignment for dynamic allocation
all pointers returned by arena_alloc residing in arena block should be
properly aligned

to meet neovim's alignment requirements but keeping it simple settle on
ARENA_ALIGN = MAX(sizeof(void *), sizeof(double)).

(cherry picked from commit 0240fd6d0f)
2022-11-19 20:07:30 +00:00
b994deb0aa version bump 2022-11-14 10:16:44 +01:00
935615ffed NVIM 0.8.1
This is mainly a bugfix release, but there a few feature additions.

Features
- extmarks: Allow preventing spellchecking with spell = false
- spell: Support nospell in treesitter queries
- man: Add health check
- docs-html: Try to use tags for ToC headings

Bug Fixes
- ui: Setting 'cmdheight' with global statusline
- ui: Fix highlights not being updated with 'winhl'
- Make_filter_cmd for :! powershell
- :! pwsh redirection for `command not found`
- Find multibyte file name in line
- Avoid unsigned overflow in home_replace()
- docs-html: Update parser
- folds: Fix fold marker multibyte comparison
- health: Correct tmux rgb verification
- man.lua: Set modifiable before writing page
- mouse: Ensure no scrolling with "ver:0" in 'mousescroll'
- paste: Feed keys as typed in cmdline mode
- qflist: Avoid read of uninitialized memory
- spell: Fix wrong cast
- stdpath: Default to /tmp if stdpath('run') cannot be created
- tui: Resume main thread if suspending isn't implemented

Documentation
- lsp: Vim.lsp.range_code_action() is not deprecated
2022-11-14 10:12:05 +01:00
3e0783db43 Merge pull request #21042 from neovim/backport-20178-to-release-0.8
[Backport release-0.8] feat(extmarks): allow preventing spellchecking with spell = false
2022-11-13 11:16:36 +01:00
32b0b13cc5 Merge pull request #21041 from neovim/backport-21033-to-release-0.8
[Backport release-0.8] fix(ui): fix some cases of stale highlight definitions
2022-11-13 11:10:12 +01:00
3d0ddd2d1f feat(spell): support nospell in treesitter queries
(cherry picked from commit 07eb4263ca)
2022-11-13 10:05:50 +00:00
7a49cf4da9 feat(extmarks): allow preventing spellchecking with spell = false
(cherry picked from commit 7e6d785d19)
2022-11-13 10:05:50 +00:00
1b359d4034 fix(ui): fix some cases of stale highlight definitions
fixes #20695

(cherry picked from commit d7e7578ada)
2022-11-13 09:54:34 +00:00
81781810e6 [Backport release-0.8] docs(treesitter): fix predicate syntax (#21019)
docs(treesitter): fix predicate syntax

(cherry picked from commit 69b1bc72e0)

Co-authored-by: James Trew <j.trew10@gmail.com>
2022-11-10 09:51:11 +01:00
8e28d8a370 [Backport release-0.8] fix(tutor): fix problem of failing to get buf name (#20985)
fix(tutor): fix problem of failing to get buf name

Closes https://github.com/neovim/neovim/issues/20920

(cherry picked from commit 86f2863e8f)

Co-authored-by: erw7 <erw7.github@gmail.com>
2022-11-06 19:23:34 -08:00
a35efe1e4f Merge pull request #20983 from neovim/backport-20952-to-release-0.8
[Backport release-0.8] fix(stdpath): default to /tmp if stdpath('run') cannot be created
2022-11-07 09:19:42 +08:00
ca9b5687f6 fix(stdpath): default to /tmp if stdpath('run') cannot be created
(cherry picked from commit 8b30d7ab4c)
2022-11-07 01:09:00 +00:00
b0cb9a8ad0 Merge pull request #20960 from neovim/backport-20959-to-release-0.8
[Backport release-0.8] fix(paste): feed keys as typed in cmdline mode
2022-11-06 12:55:30 +08:00
95e1978959 fix(paste): feed keys as typed in cmdline mode
(cherry picked from commit c12add7dfa)
2022-11-06 04:43:38 +00:00
2255d0fb63 Merge pull request #20915 from neovim/backport-20914-to-release-0.8
[Backport release-0.8] fix(man.lua): set modifiable before writing page
2022-11-03 09:18:01 +08:00
eefa7fbbc2 fix(man.lua): set modifiable before writing page
(cherry picked from commit 4282c8b41d)
2022-11-03 01:14:07 +00:00
bd4269c6a6 Merge pull request #20872 from neovim/backport-20868-to-release-0.8
[Backport release-0.8] fix(health): correct tmux rgb verification
2022-10-30 08:06:12 +08:00
2c374e626a fix(health): correct tmux rgb verification
(cherry picked from commit 4dbbeb0749)
2022-10-29 23:38:20 +00:00
6a2dcaf6ab Merge pull request #20871 from neovim/backport-20861-to-release-0.8
[Backport release-0.8] fix(mouse): ensure no scrolling with "ver:0" in 'mousescroll'
2022-10-30 07:24:10 +08:00
747b8dac73 fix(mouse): ensure no scrolling with "ver:0" in 'mousescroll'
(cherry picked from commit b3360f0734)
2022-10-29 23:11:13 +00:00
f70feadb17 Merge pull request #20870 from neovim/backport-20854-to-release-0.8
[Backport release-0.8] fix: avoid unsigned overflow in home_replace()
2022-10-30 07:06:30 +08:00
06144afb71 fix: avoid unsigned overflow in home_replace()
(cherry picked from commit d3ac297554)
2022-10-29 22:50:14 +00:00
5eab16fa24 [Backport release-0.8] docs(api): pattern is not expanded for autocommands (#20838)
docs(api): pattern is not expanded for autocommands

Problem: Unlike `:autocmd`, `nvim_create_autocommand()` does not expand
environment variables in the `pattern`, which is unexpected.

Solution: Add a note to the documentation explaining this and suggesting
using `expand()` explicitly.

(cherry picked from commit eeaf943ca3)

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2022-10-27 18:59:25 -07:00
ddc0b75d53 Merge pull request #20811 from neovim/backport-20810-to-release-0.8
[Backport release-0.8] fix(spell): fix wrong cast
2022-10-26 17:34:50 +08:00
7aaa0f4888 fix(spell): fix wrong cast
Fix #20787

(cherry picked from commit 0b2ef98594)
2022-10-26 09:18:45 +00:00
c34ebe60be Merge pull request #20755 from neovim/backport-20754-to-release-0.8
[Backport release-0.8] vim-patch:9.0.0806: 'langmap' works differently when there are modifiers
2022-10-21 07:12:37 +08:00
06c63f50fc vim-patch:9.0.0806: 'langmap' works differently when there are modifiers
Problem:    'langmap' works differently when there are modifiers.
Solution:   Only apply 'langmap' to a character where modifiers have no
            effect. (closes vim/vim#11395, closes vim/vim#11404)
49660f5139
(cherry picked from commit e8877c4d7b)
2022-10-20 22:32:55 +00:00
32ccb9770b [Backport release-0.8] build: don't append git tag on release versions (#20746)
build: don't append git tag on release versions

This prevents duplicate version strings such as v0.8.0-v0.8.0.

Also change the format for git releases from v0.9.0-dev-67-g625ba79be
to v0.9.0-dev-67+g625ba79be. The neovim versions are now:

release: v0.9.0
prerelease without git info: v0.9.0-dev
prerelease with git info: v0.9.0-dev-67+g625ba79be

(cherry picked from commit 90785aafe1)

Co-authored-by: dundargoc <gocdundar@gmail.com>
2022-10-20 05:25:41 -07:00
f73bc880f4 [Backport release-0.8] feat(docs): update parser, HTML gen (#20737)
Note: although the tolerance in help_spec.lua increased, the actual
error count with the new parser decreased by about 20%. The difference
is that the old ignore_parse_error() ignored many more errors with the
old parser.

fix https://github.com/neovim/tree-sitter-vimdoc/issues/37
fix https://github.com/neovim/tree-sitter-vimdoc/issues/44
fix https://github.com/neovim/tree-sitter-vimdoc/issues/47

(cherry picked from commit 10ae8ccbf2)
2022-10-19 06:02:01 -07:00
f76473898d [Backport release-0.8] build(deps): bump vimdoc (help) parser to v1.2.1 (#20736)
build(deps): bump vimdoc (help) parser to v1.2.1

(cherry picked from commit fdb15c3c3f)

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-10-19 05:14:45 -07:00
5a14c820a9 [Backport release-0.8] docs: fix/remove invalid URLs (#20735)
docs: fix/remove invalid URLs

(cherry picked from commit ec1e71109c)

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-10-19 05:06:20 -07:00
e7ed53286e [Backport release-0.8] fix(highlight): link more treesitter groups by default (#20731)
fix(highlight): link more treesitter groups by default

Problem: Captures used by bundled parsers are not highlighted by default
Solution: Add links to default groups

A link is added for a capture if
* there is a default group of the same name (e.g., `@tag` -> `Tag`)
* it's used in a bundled query and doesn't have a reasonable fallback
  (e.g., `@text.literal`)

Also add all linked groups to the treesitter docs.

(cherry picked from commit 0ee8b88b10)

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2022-10-19 09:35:47 +02:00
7e8662676a Merge pull request #20730 from neovim/backport-20729-to-release-0.8
[Backport release-0.8] vim-patch:9.0.0739: mouse column not correctly used for popup_setpos
2022-10-19 12:20:50 +08:00
cb086f1886 vim-patch:9.0.0739: mouse column not correctly used for popup_setpos
Problem:    Mouse column not correctly used for popup_setpos.
Solution:   Adjust off-by-one error and handle Visual line selection properly.
            (Yee Cheng Chin, closes vim/vim#11356)
17822c507c

The test_termcodes.vim test cannot be used. Use a Lua test instead.

(cherry picked from commit 72d2f5aef4)
2022-10-19 03:33:04 +00:00
9234e5acd6 Merge pull request #20718 from neovim/backport-20716-to-release-0.8
[Backport release-0.8] vim-patch:9.0.0786: user command does not get number from :tab modifier
2022-10-18 21:49:37 +08:00
24769cf1b5 vim-patch:9.0.0786: user command does not get number from :tab modifier
Problem:    User command does not get number from :tab modifier.
Solution:   Include the number. (closes vim/vim#11393, closes vim/vim#6901)
208567e9d7
(cherry picked from commit a43a46f1e6)
2022-10-18 12:47:19 +00:00
6fe00190f0 Merge pull request #20710 from neovim/backport-20709-to-release-0.8
[Backport release-0.8] fix(qflist): avoid read of uninitialized memory
2022-10-18 10:52:26 +08:00
50f756ceb2 fix(qflist): avoid read of uninitialized memory
If the call to `qf_setup_state()` in `qf_init_ext()` fails, control flow jumps
to label `qf_init_end` where a call to `qf_update_buffer()` is made with
`old_last` as a function call argument.

Prior to this patch, `old_last` would not yet have been initialized to its
default value of `NULL`, resulting in `qf_update_buffer()` attempting to compare
against its uninitialized value (quickfix.c:3882) then later forwarding it to
`qf_fill_buffer()` where the address is dereferenced and repeatedly read from/
written to for performing core qflist operations.

Depending on what the default value of `old_last` was, the results may range
from a best case scenario of neovim terminating with SIGSEGV from an attempt to
dereference an invalid pointer (quickfix.c:4056) to memory corruption if it
contained some other value that results in `qfp` being initialized from
`old_last->qf_next` (after which it is subsequently written to and read from in
a fairly arbitrary fashion).

Though extremely unlikely, it's possible for there to be security considerations
as a user can ensure that the next call to `qf_setup_state()` fails.

This patch ensures that `old_last` is NULL-assigned before control flow jumps to
`qf_init_end`.

Closes #20639.

(cherry picked from commit 8a762eba60)
2022-10-18 02:16:00 +00:00
47454d0012 [Backport release-0.8] fix(decoration): call providers in win_update() earlier (#20699)
fix(decoration): call providers in win_update() earlier

Fixes #20651

(cherry picked from commit 2921de6a96)
2022-10-18 00:14:27 +01:00
c52d256e91 [Backport release-0.8] fix(decoration): redraw correctly when re-using ids (#20708)
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2022-10-17 22:07:49 +01:00
59087b615d Merge pull request #20701 from neovim/backport-20662-to-release-0.8
[Backport release-0.8] vim-patch:8.1.0342,9.0.{0614,0616}: SpellFileMissing autocmd may delete buffer
2022-10-17 21:40:32 +08:00
89fbffff13 vim-patch:9.0.0616: spell test fails because error message changed
Problem:    Spell test fails because error message changed.
Solution:   Adjust expected error message.
371951d0c3
(cherry picked from commit a9452cf3d5)
2022-10-17 13:02:22 +00:00
7ba968ef3b vim-patch:9.0.0614: SpellFileMissing autocmd may delete buffer
Problem:    SpellFileMissing autocmd may delete buffer.
Solution:   Disallow deleting the current buffer to avoid using freed memory.
ef976323e7
(cherry picked from commit 6bc2d6b66b)
2022-10-17 13:02:22 +00:00
8595f0298a vim-patch:8.1.0342: crash when a callback deletes a window that is being used
Problem:    Crash when a callback deletes a window that is being used.
Solution:   Do not unload a buffer that is being displayed while redrawing the
            screen. Also avoid invoking callbacks while redrawing.
            (closes vim/vim#2107)
94f01956a5

Omit parse_queued_messages(): N/A.
Cherry-pick a break statement from patch 8.1.0425.

(cherry picked from commit 65cbe0cc35)
2022-10-17 13:02:22 +00:00
7a011cb58d vim-patch:9.0.0750: crash when popup closed in callback (#20660)
vim-patch:9.0.0750: crash when popup closed in callback

Problem:    Crash when popup closed in callback. (Maxim Kim)
Solution:   In syntax_end_parsing() check that syn_block is valid.
0abd6cf62d
(cherry picked from commit 2a2ae32ceb)
2022-10-15 07:31:41 +08:00
rti
5b1bda14ae [Backport release-0.8] build(nix): change the pkgs to final, add new version of libvterm (#20640)
build(nix): change the pkgs to final, add new version of libvterm (#20410)

Co-authored-by: Philipp Herzog <philipp.herzog@protonmail.com>
2022-10-13 16:29:26 -07:00
1cd5361c39 Merge pull request #20617 from neovim/backport-20558-to-release-0.8
[Backport release-0.8] feat(docs-html): fixes; use tags for ToC headings
2022-10-12 09:11:56 -04:00
719afa2988 Merge 'upstream/release-0.8' 2022-10-12 14:23:31 +02:00
60ccada4cb fix duplicate tags
These are deprecated but not removed in 0.8.x.
They are removed in master / 0.9.x.
2022-10-12 14:19:46 +02:00
6b49a20137 docs(lsp): vim.lsp.range_code_action() is not deprecated 2022-10-12 20:16:13 +08:00
5f54cfcc05 Revert [Backport release-0.8] docs(lsp): add formatting APIs to deprecated.txt (#20614) 2022-10-12 20:10:46 +08:00
bca9b1ecdf feat(docs-html): try to use tags for ToC headings
Problem:
The generated ToC (table of contents) uses anchors derived from the
heading title, e.g. the "Global Plugins" heading yields:
https://neovim.io/doc/user/usr_05.html#_global-plugins-
so if the heading title changes, then the old URL (anchor) is broken.

Solution:
:help tags change less often than heading titles, so if a heading
contains a *tag*, use that as its anchor name instead. Example:
https://neovim.io/doc/user/usr_05.html#standard-plugin

(cherry picked from commit 6b01e9bf87)
2022-10-12 12:09:10 +00:00
5e88506508 fix(docs-html): update parser
- Improve generated HTML by updating parser which includes fixes for
  single "'" and single "|":
  https://github.com/neovim/tree-sitter-vimdoc/pull/31
- Updated parser also fixes the conceal issue for "help" highlight
  queries https://github.com/neovim/tree-sitter-vimdoc/issues/23 by
  NOT including whitespace in nodes.
  - But this means we need to restore the getws() function which scrapes
    leading whitespace from the original input (buffer).

(cherry picked from commit a7a83bc4c2)
2022-10-12 12:09:10 +00:00
f294712d8c [Backport release-0.8] doc (#20616)
docs: various

- increase python line-length limit from 88 => 100.
- gen_help_html: fix bug in "tag" case (tbl_count => tbl_contains)

ref #15632
fix #18215
fix #18479
fix #20527
fix #20532

Co-authored-by: Ben Weedon <ben@weedon.email>
(cherry picked from commit f37cd2bb15)

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-10-12 05:08:18 -07:00
acb8033bca [Backport release-0.8] docs: fix incorrect :help tag (#20615)
fix: incorrect :help tag

vim.lsp.format() doesn't exist, which causes functionaltest to fail.
Change to vim.lsp.buf.format().

(cherry picked from commit 29a7f92e2e)

Co-authored-by: dundargoc <gocdundar@gmail.com>
2022-10-12 05:04:18 -07:00
a6b62821de [Backport release-0.8] docs(lsp): add formatting APIs to deprecated.txt (#20614)
docs: add vim APIs to deprecated.txt

Add vim.lsp.buf.formatting() to deprecated.txt.
Add vim.lsp.buf.range_formatting() to deprecated.txt.

(cherry picked from commit a99669df1c)

Co-authored-by: steventhorne <steven.thorne91@gmail.com>
2022-10-12 05:03:09 -07:00
deda165155 Merge pull request #20601 from neovim/backport-20576-to-release-0.8
[Backport release-0.8] feat(man): add health check
2022-10-12 06:24:17 +08:00
2853284434 [Backport release-0.8] fix(runtime): properly rely on t_Co for colorschemes (#20604)
fix(runtime): properly rely on t_Co for colorschemes

Problem: check for available colors failed
Solution: simply trust t_Co, which is always available
(cherry picked from commit 5dbc713de7)

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2022-10-11 23:49:05 +02:00
62e3ca3e2b feat(man): add health check
Fixes #20432

(cherry picked from commit 4ccc57fd7a)
2022-10-11 16:01:53 +00:00
0f669b7b70 [Backport release-0.8] build(deps): bump vimdoc parser to v1.2.0 (#20592)
build(deps): bump vimdoc parser to v1.2.0

(cherry picked from commit 0b95e83e1b)

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2022-10-11 07:49:42 -07:00
29aa6e715b docs: regenerate [skip ci] (#20589)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2022-10-11 05:09:33 -07:00
d92e6acc46 [Backport release-0.8] fix(docs-html): keycodes, taglinks, column_heading (#20590)
fix(docs-html): keycodes, taglinks, column_heading

Problem:
- Docs HTML: "foo ~" headings (column_heading) are not aligned with
  their table columns/contents because the leading whitespace is not
  emitted.
- taglinks starting with hyphen like |-x| were not recognized.
- keycodes like `<foo>` and `CTRL-x` were not recognized.
- ToC is not scrollable.

Solution:
- Add ws() to the column_heading case.
- Update help parser to latest version
  - supports `keycode`
  - fixes for taglink, argument
- Update .toc CSS. https://github.com/neovim/neovim.github.io/issues/297

fix https://github.com/neovim/neovim.github.io/issues/297

(cherry picked from commit 6d74676848)

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-10-11 05:04:51 -07:00
00761ad1e6 [Backport release-0.8] feat(docs): format parameter list as a list (#20588)
feat(docs): format parameter list as a list

Problem:
The {foo} parameters listed in `:help api` and similar generated docs,
are intended to be a "list" but they aren't prefixed with a list symbol.
This prevents parsers from understanding the list, which forces
generators like `gen_help_html.lua` to use hard-wrapped/preformatted
layout instead of a soft-wrapped "flow" layout.

Solution:
Modify gen_vimdoc.py to prefix {foo} parameters with a "•" symbol.

(cherry picked from commit 24e5b5c8c7)

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-10-11 04:46:30 -07:00
47cd3cf852 [Backport release-0.8] feat(docs): remove old AWK scripts, update HTML generator (#20587)
* feat(docs): nested lists in HTML, update :help parser

- Docs HTML: improvements in https://github.com/neovim/tree-sitter-vimdoc
  allow us to many hacks in `gen_help_html.lua`.
- Docs HTML: support nested lists.
- Docs HTML: avoid extra newlines (too much whitespace) in old
  (preformatted) layout.
- Docs HTML: disable golden-grid for narrow viewport.
- Workaround for https://github.com/neovim/neovim/issues/20404

closes https://github.com/neovim/neovim/issues/20404

(cherry picked from commit 088abbeb6e)

* feat(gen_help_html.lua): remove old AWK scripts

These files are no longer needed since gen_help_html.lua is working
fairly well.

ref https://github.com/neovim/neovim/pull/11967

(cherry picked from commit 03bc23de36)

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-10-11 04:19:38 -07:00
00ce3d6e7a Merge pull request #20585 from neovim/backport-20584-to-release-0.8
[Backport release-0.8] refactor: explicitly convert HANDLE to intptr_t for _open_osfhandle()
2022-10-11 12:05:44 +08:00
aaee148392 refactor: explicitly convert HANDLE to intptr_t for _open_osfhandle()
Problem:
The first parameter of "_open_osfhandle()" is an intptr_t; however, a HANDLE is passed.
The official documentation of [_open_osfhandle](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/open-osfhandle) suggests to cast the HANDLE to intptr_t.
MSVC/cl is able to perform an implicit type cast.
However, LLVM/clang-cl will generate an compilation error.

Solution:
Explicitly convert HANDLE to intptr_t for _open_osfhandle().

(cherry picked from commit 63ab3337e0)
2022-10-11 03:30:35 +00:00
9ad6f0da83 Merge pull request #20573 from neovim/backport-20572-to-release-0.8
[Backport release-0.8] vim-patch:9.0.0713: <amatch> of MenuPopup event is expanded like a file name
2022-10-10 22:05:48 +08:00
bca4588e17 vim-patch:9.0.0713: <amatch> of MenuPopup event is expanded like a file name
Problem:    <amatch> of MenuPopup event is expanded like a file name.
Solution:   Do not expand <amatch> for MenuPopup. (closes vim/vim#11328)
c601d988b6
(cherry picked from commit 4b2c5be6e6)
2022-10-10 13:27:01 +00:00
126e434fec [Backport release-0.8] fix(lua): assert failure with vim.regex() error inside :silent! (#20560)
Co-authored-by: Rustum Zia <ziarustum@gmail.com>
Co-authored-by: RZia <36330543+grassdne@users.noreply.github.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-10-10 08:43:57 +08:00
2ad8d36b89 Merge pull request #20553 from mliszcz/build-appimage-in-container-backport-0.8
Build appimage in container (0.8 backport)
2022-10-09 06:44:28 -04:00
e49dcbcc4b ci: use ubuntu docker container to build appimage
Switch back to Ubuntu 18.04 for buliding the appimage. This allows for
using the appimage on older systems that do not provide GLIBC_2.29.

Fixes #19711.
Fixes #20113.
2022-10-09 11:53:28 +02:00
a6f19d39a4 Merge pull request #20540 from neovim/backport-20523-to-release-0.8
[Backport release-0.8] fix(tui): resume main thread if suspending isn't implemented
2022-10-08 20:19:24 +08:00
68eb063416 fix(tui): resume main thread if suspending isn't implemented
Not doing anything is better than hanging.

(cherry picked from commit 356332b4b2)
2022-10-08 12:18:31 +00:00
cafc2ebc91 Merge pull request #20521 from neovim/backport-20519-to-release-0.8
[Backport release-0.8] fix: find multibyte file name in line
2022-10-07 10:16:32 +08:00
8fc775e3a4 fix: find multibyte file name in line
And remove unnecessary unsigned casts in fold marker comparison.

(cherry picked from commit 6113587138)
2022-10-07 01:43:55 +00:00
7773fed570 Merge pull request #20520 from neovim/backport-20515-to-release-0.8
[Backport release-0.8] fix(ui): setting 'cmdheight' with global statusline
2022-10-07 09:41:05 +08:00
d66e7a13c9 fix(ui): setting 'cmdheight' with global statusline
(cherry picked from commit 14d02bb13a)
2022-10-07 00:53:24 +00:00
49dd143abc Merge pull request #20513 from neovim/backport-20512-to-release-0.8
[Backport release-0.8] vim-patch:9.0.0670: no space for command line when there is a tabline
2022-10-07 06:44:10 +08:00
9857cc1dbf vim-patch:9.0.0670: no space for command line when there is a tabline
Problem:    No space for command line when there is a tabline.
Solution:   Correct computation of where the command line should be.
            (closes vim/vim#11295)
c9f5f73206
(cherry picked from commit 31996f7748)
2022-10-06 12:04:36 +00:00
947ec159ae vim-patch:9.0.0665: setting 'cmdheight' has no effect if last window was resized (#20502)
Problem:    Setting 'cmdheight' has no effect if last window was resized.
Solution:   Do apply 'cmdheight' when told to.  Use the frame height instead
            of the cmdline_row.  (closes vim/vim#11286)
0816f473ab
2022-10-06 09:46:46 +08:00
0c3054b033 Merge pull request #20469 from neovim/backport-19438-to-release-0.8
[Backport release-0.8] fix: powershell redirection for filtered bang commands
2022-10-03 19:29:02 -04:00
ce422ba763 fix: :! pwsh redirection for command not found
Problem:
If the shell command passed to the filtered bang command isn't found,
the error isn't redirected to the temp.out file when shell is set to
powershell.

Solution: Use anonymous function with Invoke-Command operator (&).
(cherry picked from commit f2482b3b53)
2022-10-03 20:20:35 +00:00
bb9c5c3f60 fix: make_filter_cmd for :! powershell
Problem:
`Start-Process` requires the command to be split into the shell
command and its arguments. Previously it was done by parsing, which
didn't handle cases such as
  - commands with escaped space in their filepath
  - quoted commands with space in their filepath

Solution:
Use
  - `pwsh -Command` instead of `Start-Process`
  - `Get-Content` instead of `-RedirectStandardInput`
  - `Out-File` instead of `-RedirectStandardOutput`

(cherry picked from commit b4d42bb905)
2022-10-03 20:20:35 +00:00
9e784a53b4 Merge pull request #20440 from neovim/backport-20439-to-release-0.8
[Backport release-0.8] fix(folds): fix fold marker multibyte comparison
2022-10-02 16:57:27 +08:00
4db8c25bda fix(folds): fix fold marker multibyte comparison
(cherry picked from commit 98ef374f10)
2022-10-02 08:33:08 +00:00
193 changed files with 4564 additions and 3253 deletions

View File

@ -51,14 +51,28 @@ jobs:
appimage:
runs-on: ubuntu-20.04
container:
image: ubuntu:18.04
options: --privileged # Privileged mode is needed to load fuse module.
steps:
- name: Prepare container
run: |
apt-get update
apt-get install -y software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test # For gcc-10.
add-apt-repository -y ppa:git-core/ppa # For git>=2.18.
apt-get update
apt-get install -y git gcc-10
apt-get install -y fuse libfuse2 # For linuxdeploy.
# Workaround for https://github.com/actions/checkout/issues/766.
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
apt-get update
apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
run: CC=gcc-10 make appimage-latest
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')

View File

@ -1,6 +1,7 @@
# CMAKE REFERENCE
# intro: https://codingnest.com/basic-cmake/
# best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
# pitfalls: https://izzys.casa/2019/02/everything-you-never-wanted-to-know-about-cmake/
# Version should match the tested CMAKE_URL in .github/workflows/ci.yml.
cmake_minimum_required(VERSION 3.10)
@ -132,7 +133,7 @@ endif()
# version string, else they are combined with the result of `git describe`.
set(NVIM_VERSION_MAJOR 0)
set(NVIM_VERSION_MINOR 8)
set(NVIM_VERSION_PATCH 0)
set(NVIM_VERSION_PATCH 2)
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
# API level
@ -489,6 +490,7 @@ if(FEAT_TUI)
int
main(void)
{
unibi_str_from_var(unibi_var_from_str(\"\"));
return unibi_num_from_var(unibi_var_from_num(0));
}
" UNIBI_HAS_VAR_FROM)
@ -639,7 +641,7 @@ include(InstallHelpers)
add_glob_targets(
TARGET lintpy
COMMAND ${FLAKE8_PRG}
FLAGS --max-line-length 88
FLAGS --max-line-length 100
GLOB_DIRS contrib scripts src test
GLOB_PAT *.py
TOUCH_STRATEGY SINGLE

View File

@ -11,7 +11,10 @@ low-risk/isolated tasks:
- Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or
[Coverity](#coverity).
- [Improve documentation](#documenting)
- [Merge a Vim patch] (familiarity with Vim is *strongly* recommended)
- [Merge a Vim patch] (requires strong familiarity with Vim)
- NOTE: read the above link before sending improvements to "runtime files" (anything in `runtime/`).
- Vimscript and documentation files are (mostly) maintained by [Vim](https://github.com/vim/vim), not Nvim.
- Lua files are maintained by Nvim.
Reporting problems
------------------
@ -30,9 +33,9 @@ Reporting problems
Developer guidelines
--------------------
- Read `:help dev` if you are working on Nvim core.
- Read `:help dev-ui` if you are developing a UI.
- Read `:help dev-api-client` if you are developing an API client.
- Read [:help dev](https://neovim.io/doc/user/develop.html#dev) if you are working on Nvim core.
- Read [:help dev-ui](https://neovim.io/doc/user/develop.html#dev-ui) if you are developing a UI.
- Read [:help dev-api-client](https://neovim.io/doc/user/develop.html#dev-api-client) if you are developing an API client.
- Install `ninja` for faster builds of Nvim.
```
sudo apt-get install ninja-build
@ -47,21 +50,19 @@ Pull requests (PRs)
- Your PR must include [test coverage][run-tests].
- Avoid cosmetic changes to unrelated files in the same commit.
- Use a [feature branch][git-feature-branch] instead of the master branch.
- Use a **rebase workflow** for small PRs.
- After addressing review comments, it's fine to rebase and force-push.
- Use a **merge workflow** for big, high-risk PRs.
- Use a _rebase workflow_ for small PRs.
- After addressing review comments, it's fine to force-push.
- Use a _merge workflow_ (as opposed to "rebase") for big, high-risk PRs.
- Merge `master` into your PR when there are conflicts or when master
introduces breaking changes.
- Use the `ri` git alias:
```
[alias]
ri = "!sh -c 't=\"${1:-master}\"; s=\"${2:-HEAD}\"; mb=\"$(git merge-base \"$t\" \"$s\")\"; if test \"x$mb\" = x ; then o=\"$t\"; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\"; if test \"x$lm\" = x ; then o=\"$mb\"; else o=\"$lm\"; fi; fi; test $# -gt 0 && shift; test $# -gt 0 && shift; git rebase --interactive \"$o\" \"$@\"'"
```
This avoids unnecessary rebases yet still allows you to combine related
commits, separate monolithic commits, etc.
- Do not edit commits that come before the merge commit.
- During a squash/fixup, use `exec make -C build unittest` between each
pick/edit/reword.
### Merging to master
For maintainers: when a PR is ready to merge to master,
- prefer _Squash Merge_ for "single-commit PRs" (when the PR has only one meaningful commit).
- prefer _Merge_ for "multi-commit PRs" (when the PR has multiple meaningful commits).
### Stages: Draft and Ready for review

View File

@ -8,7 +8,7 @@ Neovim's license follows:
====
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
https://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
@ -196,10 +196,11 @@ The externally maintained libraries used by Neovim are:
- libtermkey: MIT license
- libuv. Copyright Joyent, Inc. and other Node contributors. Node.js license.
- libvterm: MIT license
- lua-cjson: MIT license
- lua-compat: MIT license
- tree-sitter: MIT license
- xdiff: LGPL license
- lua-cjson: MIT license
- unibilium: LGPL v3
- xdiff: LGPL v2
====

View File

@ -12,23 +12,23 @@ General guidelines
* Use automation to solve problems
* Never break the API... but sometimes break the UI
Ticket triage
-------------
Issue triage
------------
In practice we haven't found a way to forecast more precisely than "next" and
"after next". So there are usually one or two (at most) planned milestones:
- Next bugfix-release (1.0.x)
- Next feature-release (1.x.0)
* Next bugfix-release (1.0.x)
* Next feature-release (1.x.0)
The forecasting problem might be solved with an explicit priority system (like
Bram's todo.txt). Meanwhile the Neovim priority system is defined by:
- PRs nearing completion.
- Issue labels. E.g. the `+plan` label increases the ticket's priority merely
* PRs nearing completion.
* Issue labels. E.g. the `+plan` label increases the ticket's priority merely
for having a plan written down: it is _closer to completion_ than tickets
without a plan.
- Comment activity or new information.
* Comment activity or new information.
Anything that isn't in the next milestone, and doesn't have a finished PR—is
just not something you care very much about, by construction. Post-release you
@ -50,46 +50,56 @@ has a major bug:
1. Fix the bug on `master`.
2. Cherry-pick the fix to `release-x.y`.
3. Cut a release from `release-x.y`.
- Run `./scripts/release.sh`
- Update (force-push) the remote `stable` tag.
- The [CI job](https://github.com/neovim/neovim/blob/3d45706478cd030c3ee05b4f336164bb96138095/.github/workflows/release.yml#L11-L13)
will update the release assets based on the `stable` tag.
* Run `./scripts/release.sh`
* Update (force-push) the remote `stable` tag.
* The [CI job](https://github.com/neovim/neovim/blob/3d45706478cd030c3ee05b4f336164bb96138095/.github/workflows/release.yml#L11-L13)
will update the release assets and force-push to the `stable` tag.
The neovim repository includes a backport [github action](https://github.com/zeebe-io/backport-action).
In order to trigger the action, a PR must be labeled with a label matching the
form `backport release-0.X`.
### Release automation
Neovim automation includes a [backport bot](https://github.com/zeebe-io/backport-action).
Trigger the action by labeling a PR with `backport release-X.Y`. See `.github/workflows/backport.yml`.
Third-party dependencies
--------------
------------------------
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/CMakeLists.txt`:
- [Lua](https://www.lua.org/download.html)
- [LuaJIT](https://github.com/LuaJIT/LuaJIT)
- [Luv](https://github.com/luvit/luv)
- [libtermkey](https://github.com/neovim/libtermkey)
- [libuv](https://github.com/libuv/libuv)
- [libvterm](http://www.leonerd.org.uk/code/libvterm/)
- [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
- [tree-sitter](https://github.com/tree-sitter/tree-sitter)
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/CMakeLists.txt`.
Some can be auto-bumped by `scripts/bump-deps.sh`.
`scripts/bump-dep.sh` is a script that can automate this process for `LuaJIT`, `Luv`, `libuv` & `tree-sitter`. See usage guide:
- Run `./scripts/bump-deps.sh --dep Luv --version 1.43.0-0` to update a dependency.
See `./scripts/bump-deps.sh -h` for more detailed usage
- Run `./scripts/bump-deps.sh --pr` to create a pr
To generate the default PR title and body, the script uses the most recent commit (not in `master`) with prefix `build(deps): `
* [LuaJIT](https://github.com/LuaJIT/LuaJIT)
* [Lua](https://www.lua.org/download.html)
* [Luv](https://github.com/luvit/luv)
* [gettext](https://ftp.gnu.org/pub/gnu/gettext/)
* [libiconv](https://ftp.gnu.org/pub/gnu/libiconv)
* [libtermkey](https://github.com/neovim/libtermkey)
* [libuv](https://github.com/libuv/libuv)
* [libvterm](http://www.leonerd.org.uk/code/libvterm/)
* [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
* [msys2](https://github.com/msys2/MINGW-packages) (for mingw Windows build)
* Changes to mingw can [break our mingw build](https://github.com/msys2/MINGW-packages/issues/9946).
* [tree-sitter](https://github.com/tree-sitter/tree-sitter)
* [unibilium](https://github.com/neovim/unibilium)
These dependencies are "vendored" (inlined), we need to update the sources manually:
- [libmpack](https://github.com/libmpack/libmpack)
- [xdiff](https://github.com/git/git/tree/master/xdiff)
- [lua-cjson](https://github.com/openresty/lua-cjson)
- [Klib](https://github.com/attractivechaos/klib)
- [inspect.lua](https://github.com/kikito/inspect.lua)
### Vendored dependencies
We also maintain some forks, particularly for Windows, if we are waiting on upstream changes:
https://github.com/neovim/neovim/wiki/Deps
These dependencies are "vendored" (inlined), we must update the sources manually:
* `src/mpack/`: [libmpack](https://github.com/libmpack/libmpack)
* send improvements upstream!
* `src/xdiff/`: [xdiff](https://github.com/git/git/tree/master/xdiff)
* `src/cjson/`: [lua-cjson](https://github.com/openresty/lua-cjson)
* `src/nvim/lib/`: [Klib](https://github.com/attractivechaos/klib)
* `runtime/lua/vim/inspect.lua`: [inspect.lua](https://github.com/kikito/inspect.lua)
* `src/nvim/tui/terminfo_defs.h`: terminfo definitions
* Run `scripts/update_terminfo.sh` to update these definitions.
* [treesitter parsers](https://github.com/neovim/neovim/blob/fcc24e43e0b5f9d801a01ff2b8f78ce8c16dd551/cmake.deps/CMakeLists.txt#L197-L210)
### Forks
We may maintain forks, if we are waiting on upstream changes: https://github.com/neovim/neovim/wiki/Deps
See also
--------
- https://github.com/neovim/neovim/issues/862
- https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
* https://github.com/neovim/neovim/issues/862
* https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt

View File

@ -210,8 +210,8 @@ set(TREESITTER_LUA_SHA256 564594fe0ffd2f2fb3578a15019b723e1bc94ac82cb6a0103a6b3b
set(TREESITTER_VIM_URL https://github.com/vigoux/tree-sitter-viml/archive/v0.2.0.tar.gz)
set(TREESITTER_VIM_SHA256 608dcc31a7948cb66ae7f45494620e2e9face1af75598205541f80d782ec4501)
set(TREESITTER_HELP_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v1.1.0.tar.gz)
set(TREESITTER_HELP_SHA256 4c0ef80c6dc09acab362478950ec6be58a4ab1cbf2d95754b8fbb566e4c647a1)
set(TREESITTER_HELP_URL https://github.com/neovim/tree-sitter-vimdoc/archive/ce20f13c3f12506185754888feaae3f2ad54c287.tar.gz)
set(TREESITTER_HELP_SHA256 2b8b166438cce66064aab56a744430b1f44871f43e47f70b51246d14bb826609)
set(TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.20.7.tar.gz)
set(TREESITTER_SHA256 b355e968ec2d0241bbd96748e00a9038f83968f85d822ecb9940cbe4c42e182e)

View File

@ -1,26 +1,27 @@
if(NVIM_VERSION_MEDIUM)
message(STATUS "USING NVIM_VERSION_MEDIUM: ${NVIM_VERSION_MEDIUM}")
return()
endif()
set(NVIM_VERSION_MEDIUM
set(NVIM_VERSION
"v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}${NVIM_VERSION_PRERELEASE}")
execute_process(
COMMAND git describe --first-parent --dirty --always
COMMAND git --git-dir=${NVIM_SOURCE_DIR}/.git --work-tree=${NVIM_SOURCE_DIR} describe --first-parent --dirty --always
OUTPUT_VARIABLE GIT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE RES)
if(RES AND NOT RES EQUAL 0)
message(STATUS "Using NVIM_VERSION_MEDIUM: ${NVIM_VERSION_MEDIUM}")
file(WRITE "${OUTPUT}" "${NVIM_VERSION_STRING}")
message(STATUS "Using NVIM_VERSION: ${NVIM_VERSION}")
file(WRITE "${OUTPUT}" "")
return()
endif()
string(STRIP "${GIT_TAG}" GIT_TAG)
string(REGEX REPLACE "^v[0-9]+.[0-9]+.[0-9]+-" "" NVIM_VERSION_GIT "${GIT_TAG}")
set(NVIM_VERSION_MEDIUM "${NVIM_VERSION_MEDIUM}-${NVIM_VERSION_GIT}")
set(NVIM_VERSION_STRING "#define NVIM_VERSION_MEDIUM \"${NVIM_VERSION_MEDIUM}\"\n")
# `git describe` annotates the most recent tagged release; for pre-release
# builds we append that to the dev version.
if(NVIM_VERSION_PRERELEASE)
string(REGEX REPLACE "^v[0-9]+.[0-9]+.[0-9]+-" "" NVIM_VERSION_GIT "${GIT_TAG}")
string(REGEX REPLACE "^([0-9]+)-([a-z0-9]+)" "\\1+\\2" NVIM_VERSION_GIT "${NVIM_VERSION_GIT}")
set(NVIM_VERSION "${NVIM_VERSION}-${NVIM_VERSION_GIT}")
endif()
set(NVIM_VERSION_STRING "#define NVIM_VERSION_MEDIUM \"${NVIM_VERSION}\"\n")
string(SHA1 CURRENT_VERSION_HASH "${NVIM_VERSION_STRING}")
if(EXISTS ${OUTPUT})
@ -28,6 +29,6 @@ if(EXISTS ${OUTPUT})
endif()
if(NOT "${NVIM_VERSION_HASH}" STREQUAL "${CURRENT_VERSION_HASH}")
message(STATUS "Using NVIM_VERSION_MEDIUM: ${NVIM_VERSION_MEDIUM}")
message(STATUS "Using NVIM_VERSION: ${NVIM_VERSION}")
file(WRITE "${OUTPUT}" "${NVIM_VERSION_STRING}")
endif()

View File

@ -8,61 +8,63 @@
outputs = { self, nixpkgs, flake-utils }:
{
overlay = final: prev:
let
pkgs = nixpkgs.legacyPackages.${prev.system};
in
rec {
neovim = pkgs.neovim-unwrapped.overrideAttrs (oa: {
version = "master";
src = ../.;
buildInputs = oa.buildInputs ++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
CoreServices
]);
overlay = final: prev: rec {
neovim-unwrapped = prev.neovim-unwrapped.override ({
libvterm-neovim = prev.libvterm-neovim.overrideAttrs (old: {
version = "0.3";
src = builtins.fetchTarball {
url = "https://www.leonerd.org.uk/code/libvterm/libvterm-0.3.tar.gz";
sha256 = "0zg6sn5brwrnqaab883pdj0l2swk5askbbwbdam0zq55ikbrzgar";
};
});
});
# a development binary to help debug issues
neovim-debug =
let
stdenv = if pkgs.stdenv.isLinux then pkgs.llvmPackages_latest.stdenv else pkgs.stdenv;
in
((neovim.override {
lua = pkgs.luajit;
inherit stdenv;
}).overrideAttrs (oa: {
neovim = final.neovim-unwrapped.overrideAttrs (oa: {
version = "master";
src = ../.;
dontStrip = true;
NIX_CFLAGS_COMPILE = " -ggdb -Og";
buildInputs = oa.buildInputs
++ final.lib.optionals final.stdenv.isDarwin
(with final.darwin.apple_sdk.frameworks; [ CoreServices ]);
});
cmakeBuildType = "Debug";
cmakeFlags = oa.cmakeFlags ++ [
"-DMIN_LOG_LEVEL=0"
];
# a development binary to help debug issues
neovim-debug = let
stdenv = if final.stdenv.isLinux then
final.llvmPackages_latest.stdenv
else
final.stdenv;
in ((neovim.override {
lua = final.luajit;
inherit stdenv;
}).overrideAttrs (oa: {
disallowedReferences = [ ];
}));
dontStrip = true;
NIX_CFLAGS_COMPILE = " -ggdb -Og";
# for neovim developers, beware of the slow binary
neovim-developer =
let
lib = nixpkgs.lib;
luacheck = pkgs.luaPackages.luacheck;
in
(neovim-debug.override ({ doCheck = pkgs.stdenv.isLinux; })).overrideAttrs (oa: {
cmakeFlags = oa.cmakeFlags ++ [
"-DLUACHECK_PRG=${luacheck}/bin/luacheck"
"-DMIN_LOG_LEVEL=0"
"-DENABLE_LTO=OFF"
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
# https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports
"-DCLANG_ASAN_UBSAN=ON"
];
});
};
} //
flake-utils.lib.eachDefaultSystem (system:
cmakeBuildType = "Debug";
cmakeFlags = oa.cmakeFlags ++ [ "-DMIN_LOG_LEVEL=0" ];
disallowedReferences = [ ];
}));
# for neovim developers, beware of the slow binary
neovim-developer = let luacheck = final.luaPackages.luacheck;
in (neovim-debug.override ({
doCheck = final.stdenv.isLinux;
})).overrideAttrs (oa: {
cmakeFlags = oa.cmakeFlags ++ [
"-DLUACHECK_PRG=${luacheck}/bin/luacheck"
"-DMIN_LOG_LEVEL=0"
"-DENABLE_LTO=OFF"
] ++ final.lib.optionals final.stdenv.isLinux [
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
# https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports
"-DCLANG_ASAN_UBSAN=ON"
];
});
};
} // flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
overlays = [ self.overlay ];
@ -75,26 +77,22 @@
ps.msgpack
ps.flake8 # for 'make pylint'
]);
in
rec {
in {
packages = with pkgs; {
default = neovim;
inherit neovim neovim-debug neovim-developer;
};
checks = {
pylint = pkgs.runCommandNoCC "pylint"
{
nativeBuildInputs = [ pythonEnv ];
preferLocalBuild = true;
} "make -C ${./..} pylint > $out";
pylint = pkgs.runCommand "pylint" {
nativeBuildInputs = [ pythonEnv ];
preferLocalBuild = true;
} "make -C ${./..} pylint > $out";
shlint = pkgs.runCommandNoCC "shlint"
{
nativeBuildInputs = [ pkgs.shellcheck ];
preferLocalBuild = true;
} "make -C ${./..} shlint > $out";
shlint = pkgs.runCommand "shlint" {
nativeBuildInputs = [ pkgs.shellcheck ];
preferLocalBuild = true;
} "make -C ${./..} shlint > $out";
};
# kept for backwards-compatibility
@ -103,17 +101,18 @@
devShells = {
default = pkgs.neovim-developer.overrideAttrs (oa: {
buildInputs = with pkgs; oa.buildInputs ++ [
cmake
lua.pkgs.luacheck
sumneko-lua-language-server
pythonEnv
include-what-you-use # for scripts/check-includes.py
jq # jq for scripts/vim-patch.sh -r
shellcheck # for `make shlint`
doxygen # for script/gen_vimdoc.py
clang-tools # for clangd to find the correct headers
];
buildInputs = with pkgs;
oa.buildInputs ++ [
cmake
lua.pkgs.luacheck
sumneko-lua-language-server
pythonEnv
include-what-you-use # for scripts/check-includes.py
jq # jq for scripts/vim-patch.sh -r
shellcheck # for `make shlint`
doxygen # for script/gen_vimdoc.py
clang-tools # for clangd to find the correct headers
];
shellHook = oa.shellHook + ''
export NVIM_PYTHON_LOG_LEVEL=DEBUG

View File

@ -75,8 +75,10 @@ add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
)
# TODO: This doesn't work. wait for "nvim -l" to land?
add_custom_target(doc_html
COMMAND make html
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
-V1 -es --clean -c "lua require('scripts.gen_help_html').gen('./build/runtime/doc', './build/doc_html', nil, 'todo_commit_id')" -c "0cq"
DEPENDS
${GENERATED_HELP_TAGS}
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc"

View File

@ -235,7 +235,7 @@ function! s:check_tmux() abort
endif
" check for RGB capabilities
let info = system(['tmux', 'server-info'])
let info = system(['tmux', 'show-messages', '-JT'])
let has_tc = stridx(info, " Tc: (flag) true") != -1
let has_rgb = stridx(info, " RGB: (flag) true") != -1
if !has_tc && !has_rgb

View File

@ -104,7 +104,7 @@ function! tutor#CheckLine(line)
if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect')
let bufn = bufnr('%')
let ctext = getline(a:line)
let signs = sign_getplaced('.', {'lnum': a:line})[0].signs
let signs = sign_getplaced(bufn, {'lnum': a:line})[0].signs
if !empty(signs)
call sign_unplace('', {'id': signs[0].id})
endif

View File

@ -13,7 +13,7 @@ set background=dark
hi clear
let g:colors_name = 'blue'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
if (has('termguicolors') && &termguicolors) || has('gui_running')
let g:terminal_ansi_colors = ['#000000', '#cd0000', '#00cd00', '#cdcd00', '#0000ee', '#cd00cd', '#00cdcd', '#e5e5e5', '#7f7f7f', '#ff0000', '#00ff00', '#ffff00', '#5c5cff', '#ff00ff', '#00ffff', '#ffffff']

View File

@ -13,7 +13,7 @@ set background=dark
hi clear
let g:colors_name = 'darkblue'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
if (has('termguicolors') && &termguicolors) || has('gui_running')
let g:terminal_ansi_colors = ['#000000', '#8b0000', '#90f020', '#ffa500', '#00008b', '#8b008b', '#008b8b', '#c0c0c0', '#808080', '#ffa0a0', '#90f020', '#ffff60', '#0030ff', '#ff00ff', '#90fff0', '#ffffff']

View File

@ -13,7 +13,7 @@ set background=light
hi clear
let g:colors_name = 'delek'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
if (has('termguicolors') && &termguicolors) || has('gui_running')
let g:terminal_ansi_colors = ['#ffffff', '#0000ff', '#00cd00', '#cd00cd', '#008b8b', '#0000ff', '#ff1493', '#bcbcbc', '#ee0000', '#0000ff', '#00cd00', '#cd00cd', '#008b8b', '#0000ff', '#ff1493', '#000000']

View File

@ -13,7 +13,7 @@ set background=dark
hi clear
let g:colors_name = 'desert'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
if (has('termguicolors') && &termguicolors) || has('gui_running')
let g:terminal_ansi_colors = ['#7f7f8c', '#cd5c5c', '#9acd32', '#bdb76b', '#75a0ff', '#eeee00', '#cd853f', '#666666', '#8a7f7f', '#ff0000', '#89fb98', '#f0e68c', '#6dceeb', '#ffde9b', '#ffa0a0', '#c2bfa5']

View File

@ -12,7 +12,7 @@ set background=dark
hi clear
let g:colors_name = 'elflord'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
hi! link Terminal Normal
hi! link Boolean Constant

View File

@ -13,7 +13,7 @@ set background=dark
hi clear
let g:colors_name = 'evening'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
if (has('termguicolors') && &termguicolors) || has('gui_running')
let g:terminal_ansi_colors = ['#000000', '#cd0000', '#00cd00', '#cdcd00', '#0087ff', '#cd00cd', '#00cdcd', '#e5e5e5', '#7f7f7f', '#ff0000', '#00ff00', '#ffff00', '#5c5cff', '#ff00ff', '#00ffff', '#ffffff']

View File

@ -13,7 +13,7 @@ set background=dark
hi clear
let g:colors_name = 'habamax'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
if (has('termguicolors') && &termguicolors) || has('gui_running')
let g:terminal_ansi_colors = ['#1c1c1c', '#d75f5f', '#87af87', '#afaf87', '#5f87af', '#af87af', '#5f8787', '#9e9e9e', '#767676', '#d7875f', '#afd7af', '#d7d787', '#87afd7', '#d7afd7', '#87afaf', '#bcbcbc']

View File

@ -13,7 +13,7 @@ set background=dark
hi clear
let g:colors_name = 'industry'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
if (has('termguicolors') && &termguicolors) || has('gui_running')
let g:terminal_ansi_colors = ['#303030', '#870000', '#5fd75f', '#afaf00', '#87afff', '#af00af', '#00afaf', '#6c6c6c', '#444444', '#ff0000', '#00ff00', '#ffff00', '#005fff', '#ff00ff', '#00ffff', '#ffffff']

View File

@ -12,7 +12,7 @@ set background=dark
hi clear
let g:colors_name = 'koehler'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
hi! link Terminal Normal
hi! link Boolean Constant

View File

@ -11,7 +11,7 @@
hi clear
let g:colors_name = 'lunaperche'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
hi! link helpVim Title
hi! link helpHeader Title

View File

@ -13,7 +13,7 @@ set background=light
hi clear
let g:colors_name = 'morning'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
if (has('termguicolors') && &termguicolors) || has('gui_running')
let g:terminal_ansi_colors = ['#e4e4e4', '#a52a2a', '#ff00ff', '#6a0dad', '#008787', '#2e8b57', '#6a5acd', '#bcbcbc', '#0000ff', '#a52a2a', '#ff00ff', '#6a0dad', '#008787', '#2e8b57', '#6a5acd', '#000000']

View File

@ -13,7 +13,7 @@ set background=dark
hi clear
let g:colors_name = 'murphy'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
if (has('termguicolors') && &termguicolors) || has('gui_running')
let g:terminal_ansi_colors = ['#303030', '#ffa700', '#005f00', '#ffd7af', '#87afff', '#ffafaf', '#00afaf', '#bcbcbc', '#444444', '#ff0000', '#00875f', '#ffff00', '#005fff', '#ff00ff', '#00ffff', '#ffffff']

View File

@ -12,7 +12,7 @@ set background=dark
hi clear
let g:colors_name = 'pablo'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
if (has('termguicolors') && &termguicolors) || has('gui_running')
let g:terminal_ansi_colors = ['#000000', '#cd0000', '#00cd00', '#cdcd00', '#0000ee', '#cd00cd', '#00cdcd', '#e5e5e5', '#7f7f7f', '#ff0000', '#00ff00', '#ffff00', '#5c5cff', '#ff00ff', '#00ffff', '#ffffff']

View File

@ -13,7 +13,7 @@ set background=light
hi clear
let g:colors_name = 'peachpuff'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
if (has('termguicolors') && &termguicolors) || has('gui_running')
let g:terminal_ansi_colors = ['#ffdab9', '#a52a2a', '#c00058', '#cd00cd', '#008b8b', '#2e8b57', '#6a5acd', '#737373', '#406090', '#a52a2a', '#c00058', '#cd00cd', '#008b8b', '#2e8b57', '#6a5acd', '#000000']

View File

@ -11,7 +11,7 @@
hi clear
let g:colors_name = 'quiet'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
hi! link Terminal Normal
hi! link StatusLineTerm StatusLine

View File

@ -12,7 +12,7 @@ set background=dark
hi clear
let g:colors_name = 'ron'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
hi! link Terminal Normal
hi! link Boolean Constant

View File

@ -13,7 +13,7 @@ set background=light
hi clear
let g:colors_name = 'shine'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
if (has('termguicolors') && &termguicolors) || has('gui_running')
let g:terminal_ansi_colors = ['#000000', '#8b0000', '#006400', '#ffff00', '#00008b', '#6a0dad', '#008b8b', '#dadada', '#767676', '#ffafaf', '#90ee90', '#ffff60', '#add8e6', '#ff00ff', '#00ffff', '#ffffff']

View File

@ -13,7 +13,7 @@ set background=dark
hi clear
let g:colors_name = 'slate'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
if (has('termguicolors') && &termguicolors) || has('gui_running')
let g:terminal_ansi_colors = ['#000000', '#cd0000', '#00cd00', '#cdcd00', '#0000ee', '#cd00cd', '#00cdcd', '#e5e5e5', '#7f7f7f', '#ff0000', '#00ff00', '#ffff00', '#5c5cff', '#ff00ff', '#00ffff', '#ffffff']

View File

@ -13,7 +13,7 @@ set background=dark
hi clear
let g:colors_name = 'torte'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
if (has('termguicolors') && &termguicolors) || has('gui_running')
let g:terminal_ansi_colors = ['#000000', '#cd0000', '#00cd00', '#cdcd00', '#0000ee', '#cd00cd', '#00cdcd', '#e5e5e5', '#7f7f7f', '#ff0000', '#00ff00', '#ffff00', '#5c5cff', '#ff00ff', '#00ffff', '#ffffff']

View File

@ -13,7 +13,7 @@ set background=light
hi clear
let g:colors_name = 'zellner'
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
let s:t_Co = &t_Co
if (has('termguicolors') && &termguicolors) || has('gui_running')
let g:terminal_ansi_colors = ['#ffffff', '#a52a2a', '#ff00ff', '#a020f0', '#0000ff', '#0000ff', '#ff00ff', '#a9a9a9', '#ff0000', '#a52a2a', '#ff00ff', '#a020f0', '#0000ff', '#0000ff', '#ff00ff', '#000000']

View File

@ -1,40 +0,0 @@
#
# Makefile for the Vim documentation on Unix
#
# If you get "don't know how to make scratch", first run make in the source
# directory. Or remove the include below.
AWK = awk
DOCS = $(wildcard *.txt)
HTMLS = $(DOCS:.txt=.html)
.SUFFIXES:
.SUFFIXES: .c .o .txt .html
# Awk version of .txt to .html conversion.
html: noerrors vimindex.html $(HTMLS)
@if test -f errors.log; then cat errors.log; fi
noerrors:
-rm -f errors.log
$(HTMLS): tags.ref
.txt.html:
$(AWK) -f makehtml.awk $< >$@
# index.html is the starting point for HTML, but for the help files it is
# help.txt. Therefore use vimindex.html for index.txt.
index.html: help.txt
$(AWK) -f makehtml.awk help.txt >index.html
vimindex.html: index.txt
$(AWK) -f makehtml.awk index.txt >vimindex.html
tags.ref tags.html: tags
$(AWK) -f maketags.awk tags >tags.html
clean:
-rm -f *.html tags.ref $(HTMLS) errors.log tags

File diff suppressed because it is too large Load Diff

View File

@ -14,8 +14,9 @@ It is best to view this file with these settings within VIM's GUI: >
:set arabicshape
------------------------------------------------------------------------------
Introduction
------------
Arabic is a rather demanding language in which a number of special
features are required. Characters are right-to-left oriented and
ought to appear as such on the screen (i.e. from right to left).
@ -34,8 +35,9 @@ The commands, prompts and help files are not in Arabic, therefore
the user interface remains the standard Vi interface.
------------------------------------------------------------------------------
Highlights
----------
o Editing left-to-right files as in the original Vim hasn't changed.
o Viewing and editing files in right-to-left windows. File
@ -64,8 +66,8 @@ o Proper Bidirectional functionality is possible given Vim is
started within a Bidi capable terminal emulator.
------------------------------------------------------------------------------
Arabic Fonts *arabicfonts*
------------
Vim requires monospaced fonts of which there are many out there.
Arabic requires ISO-8859-6 as well as Presentation Form-B fonts
@ -75,8 +77,8 @@ Do an Internet search or check www.arabeyes.org for further
info on where to obtain the necessary Arabic fonts.
------------------------------------------------------------------------------
Font Installation
-----------------
o Installation of fonts for X Window systems (Unix/Linux)
@ -88,8 +90,9 @@ o Installation of fonts for X Window systems (Unix/Linux)
% xset +fp path_name_of_arabic_fonts_directory
------------------------------------------------------------------------------
Usage
-----
Prior to the actual usage of Arabic within Vim, a number of settings
need to be accounted for and invoked.
@ -259,8 +262,8 @@ o Enable Arabic settings [short-cut]
':set arabicshape' to your vimrc file.
------------------------------------------------------------------------------
Keymap/Keyboard *arabickeymap*
---------------
The character/letter encoding used in Vim is the standard UTF-8.
It is widely discouraged that any other encoding be used or even
@ -276,7 +279,7 @@ o Keyboard
+ CTRL-^ in insert/replace mode toggles between Arabic/Latin mode
+ Keyboard mapping is based on the Microsoft's Arabic keymap (the
de facto standard in the Arab world):
de facto standard in the Arab world): >
+---------------------------------------------------------------------+
|! |@ |# |$ |% |^ |& |* |( |) |_ |+ || |~ ّ |
@ -291,17 +294,18 @@ o Keyboard
|Z ~ |X ْ |C { |V } |B لآ |N آ |M ' |< , |> . |? ؟ |
|z ئ |x ء |c ؤ |v ر |b لا |n ى |m ة |, و |. ز |/ ظ |
+-------------------------------------------------+
<
------------------------------------------------------------------------------
Restrictions
------------
o Vim in its GUI form does not currently support Bi-directionality
(i.e. the ability to see both Arabic and Latin intermixed within
the same line).
------------------------------------------------------------------------------
Known Bugs
----------
There is one known minor bug,

View File

@ -590,6 +590,7 @@ FileChangedShell When Vim notices that the modification time of
- executing a shell command
- |:checktime|
- |FocusGained|
Not used when 'autoread' is set and the buffer
was not changed. If a FileChangedShell
autocommand exists the warning message and

View File

@ -3804,15 +3804,15 @@ has({feature}) Returns 1 if {feature} is supported, 0 otherwise. The
{feature} argument is a feature name like "nvim-0.2.1" or
"win32", see below. See also |exists()|.
If the code has a syntax error, then Nvim may skip the rest
of the line and miss |:endif|. >
if has('feature') | let x = this->breaks->without->the->feature | endif
<
Put |:if| and |:endif| on separate lines to avoid the
syntax error. >
if has('feature')
let x = this->breaks->without->the->feature
endif
To get the system name use |vim.loop|.os_uname() in Lua: >
:lua print(vim.loop.os_uname().sysname)
< If the code has a syntax error then Vimscript may skip the
rest of the line. Put |:if| and |:endif| on separate lines to
avoid the syntax error: >
if has('feature')
let x = this->breaks->without->the->feature
endif
<
Vim's compile-time feature-names (prefixed with "+") are not
recognized because Nvim is always compiled with all possible
@ -6829,18 +6829,24 @@ serverstart([{address}]) *serverstart()*
|RPC| messages. Clients can send |API| commands to the
returned address to control Nvim.
Returns the address string (may differ from the requested
{address}).
- If {address} contains a colon ":" it is interpreted as
a TCP/IPv4/IPv6 address where the last ":" separates host
and port (empty or zero assigns a random port).
- Else it is interpreted as a named pipe or Unix domain socket
path. If there are no slashes it is treated as a name and
appended to a generated path.
- If {address} is empty it generates a path.
Returns the address string (which may differ from the
{address} argument, see below).
Example named pipe: >
- If {address} has a colon (":") it is a TCP/IPv4/IPv6 address
where the last ":" separates host and port (empty or zero
assigns a random port).
- Else {address} is the path to a named pipe (except on Windows).
- If {address} has no slashes ("/") it is treated as the
"name" part of a generated path in this format: >
stdpath("run").."/{name}.{pid}.{counter}"
< - If {address} is omitted the name is "nvim". >
:echo serverstart()
=> /tmp/nvim.bram/oknANW/nvim.15430.5
< Example bash command to list all Nvim servers: >
ls ${XDG_RUNTIME_DIR:-${TMPDIR}nvim.${USER}}/*/nvim.*.0
< Example named pipe: >
if has('win32')
echo serverstart('\\.\pipe\nvim-pipe-1234')
else
@ -7718,7 +7724,7 @@ sqrt({expr}) *sqrt()*
:echo sqrt(100)
< 10.0 >
:echo sqrt(-4.01)
< str2float('nan')
< str2float("nan")
NaN may be different, it depends on system libraries.
Can also be used as a |method|: >
@ -7779,7 +7785,7 @@ stdpath({what}) *stdpath()* *E6100*
run String Run directory: temporary, local storage
for sockets, named pipes, etc.
state String Session state directory: storage for file
drafts, undo, |shada|, etc.
drafts, swap, undo, |shada|.
Example: >
:echo stdpath("config")

View File

@ -48,21 +48,22 @@ a job channel using RPC, bytes can still be read over its stderr. Similarly,
only bytes can be written to Nvim's own stderr.
*channel-callback*
on_stdout({chan-id}, {data}, {name}) *on_stdout*
on_stderr({chan-id}, {data}, {name}) *on_stderr*
on_stdin({chan-id}, {data}, {name}) *on_stdin*
on_data({chan-id}, {data}, {name}) *on_data*
- on_stdout({chan-id}, {data}, {name}) *on_stdout*
- on_stderr({chan-id}, {data}, {name}) *on_stderr*
- on_stdin({chan-id}, {data}, {name}) *on_stdin*
- on_data({chan-id}, {data}, {name}) *on_data*
Scripts can react to channel activity (received data) via callback
functions assigned to the `on_stdout`, `on_stderr`, `on_stdin`, or
`on_data` option keys. Callbacks should be fast: avoid potentially
slow/expensive work.
Parameters: ~
{chan-id} Channel handle. |channel-id|
{data} Raw data (|readfile()|-style list of strings) read from
- {chan-id} Channel handle. |channel-id|
- {data} Raw data (|readfile()|-style list of strings) read from
the channel. EOF is a single-item list: `['']`. First and
last items may be partial lines! |channel-lines|
{name} Stream name (string) like "stdout", so the same function
- {name} Stream name (string) like "stdout", so the same function
can handle multiple streams. Event names depend on how the
channel was opened and in what mode/protocol.
@ -83,13 +84,14 @@ on_data({chan-id}, {data}, {name}) *on_data*
the final `['']` emitted at EOF):
- `foobar` may arrive as `['fo'], ['obar']`
- `foo\nbar` may arrive as
`['foo','bar']`
or `['foo',''], ['bar']`
or `['foo'], ['','bar']`
or `['fo'], ['o','bar']`
- `['foo','bar']`
- or `['foo',''], ['bar']`
- or `['foo'], ['','bar']`
- or `['fo'], ['o','bar']`
There are two ways to deal with this:
1. To wait for the entire output, use |channel-buffered| mode.
2. To read line-by-line, use the following code: >
- 1. To wait for the entire output, use |channel-buffered| mode.
- 2. To read line-by-line, use the following code: >
let s:lines = ['']
func! s:on_event(job_id, data, event) dict
let eof = (a:data == [''])

View File

@ -10,155 +10,147 @@ The items listed below are deprecated: they will be removed in the future.
They should not be used in new scripts, and old scripts should be updated.
==============================================================================
Deprecated features
API ~
*nvim_buf_clear_highlight()* Use |nvim_buf_clear_namespace()| instead.
*nvim_buf_set_virtual_text()* Use |nvim_buf_set_extmark()| instead.
*nvim_command_output()* Use |nvim_exec()| instead.
*nvim_execute_lua()* Use |nvim_exec_lua()| instead.
API
- *nvim_buf_clear_highlight()* Use |nvim_buf_clear_namespace()| instead.
- *nvim_buf_set_virtual_text()* Use |nvim_buf_set_extmark()| instead.
- *nvim_command_output()* Use |nvim_exec()| instead.
- *nvim_execute_lua()* Use |nvim_exec_lua()| instead.
Commands ~
*:rv*
*:rviminfo* Deprecated alias to |:rshada| command.
*:wv*
*:wviminfo* Deprecated alias to |:wshada| command.
COMMANDS
- *:rv* *:rviminfo* Deprecated alias to |:rshada| command.
- *:wv* *:wviminfo* Deprecated alias to |:wshada| command.
Environment Variables ~
*$NVIM_LISTEN_ADDRESS* Deprecated way to
* set the server name (use |--listen| instead)
* get the server name (use |v:servername| instead)
* detect a parent Nvim (use |$NVIM| instead)
Unset by |terminal| and |jobstart()| (unless explicitly
given by the "env" option). Ignored if --listen is given.
ENVIRONMENT VARIABLES
- *$NVIM_LISTEN_ADDRESS*
- Deprecated way to:
- set the server name (use |--listen| or |serverstart()| instead)
- get the server name (use |v:servername| instead)
- detect a parent Nvim (use |$NVIM| instead)
- Ignored if --listen is given.
- Unset by |terminal| and |jobstart()| unless explicitly given by the "env"
option. Example: >
call jobstart(['foo'], { 'env': { 'NVIM_LISTEN_ADDRESS': v:servername } })
<
Events ~
*BufCreate* Use |BufAdd| instead.
*EncodingChanged* Never fired; 'encoding' is always "utf-8".
*FileEncoding* Never fired; equivalent to |EncodingChanged|.
*GUIEnter* Never fired; use |UIEnter| instead.
*GUIFailed* Never fired.
EVENTS
- *BufCreate* Use |BufAdd| instead.
- *EncodingChanged* Never fired; 'encoding' is always "utf-8".
- *FileEncoding* Never fired; equivalent to |EncodingChanged|.
- *GUIEnter* Never fired; use |UIEnter| instead.
- *GUIFailed* Never fired.
Keycodes ~
*<MouseDown>* Use <ScrollWheelUp> instead.
*<MouseUp>* Use <ScrollWheelDown> instead.
KEYCODES
- *<MouseDown>* Use <ScrollWheelUp> instead.
- *<MouseUp>* Use <ScrollWheelDown> instead.
Functions ~
*buffer_exists()* Obsolete name for |bufexists()|.
*buffer_name()* Obsolete name for |bufname()|.
*buffer_number()* Obsolete name for |bufnr()|.
*file_readable()* Obsolete name for |filereadable()|.
*health#report_error* Use Lua |vim.health.report_error()| instead.
*health#report_info* Use Lua |vim.health.report_info()| instead.
*health#report_ok* Use Lua |vim.health.report_ok()| instead.
*health#report_start* Use Lua |vim.health.report_start()| instead.
*health#report_warn* Use Lua |vim.health.report_warn()| instead.
*highlight_exists()* Obsolete name for |hlexists()|.
*highlightID()* Obsolete name for |hlID()|.
*inputdialog()* Use |input()| instead.
*jobclose()* Obsolete name for |chanclose()|
*jobsend()* Obsolete name for |chansend()|
*last_buffer_nr()* Obsolete name for bufnr("$").
*rpcstop()* Deprecated. Instead use |jobstop()| to stop any job,
or chanclose(id, "rpc") to close RPC communication
FUNCTIONS
- *buffer_exists()* Obsolete name for |bufexists()|.
- *buffer_name()* Obsolete name for |bufname()|.
- *buffer_number()* Obsolete name for |bufnr()|.
- *file_readable()* Obsolete name for |filereadable()|.
- *health#report_error* Use Lua |vim.health.report_error()| instead.
- *health#report_info* Use Lua |vim.health.report_info()| instead.
- *health#report_ok* Use Lua |vim.health.report_ok()| instead.
- *health#report_start* Use Lua |vim.health.report_start()| instead.
- *health#report_warn* Use Lua |vim.health.report_warn()| instead.
- *highlight_exists()* Obsolete name for |hlexists()|.
- *highlightID()* Obsolete name for |hlID()|.
- *inputdialog()* Use |input()| instead.
- *jobclose()* Obsolete name for |chanclose()|
- *jobsend()* Obsolete name for |chansend()|
- *last_buffer_nr()* Obsolete name for bufnr("$").
- *rpcstop()* Use |jobstop()| instead to stop any job, or
`chanclose(id, "rpc")` to close RPC communication
without stopping the job. Use chanclose(id) to close
any socket.
Highlights ~
*hl-VertSplit* Use |hl-WinSeparator| instead.
LSP Diagnostics ~
HIGHLIGHTS
- *hl-VertSplit* Use |hl-WinSeparator| instead.
LSP DIAGNOSTICS
For each of the functions below, use the corresponding function in
|vim.diagnostic| instead (unless otherwise noted). For example, use
|vim.diagnostic.get()| instead of |vim.lsp.diagnostic.get()|.
*vim.lsp.diagnostic.clear()* Use |vim.diagnostic.hide()| instead.
*vim.lsp.diagnostic.disable()*
*vim.lsp.diagnostic.display()* Use |vim.diagnostic.show()| instead.
*vim.lsp.diagnostic.enable()*
*vim.lsp.diagnostic.get()*
*vim.lsp.diagnostic.get_all()* Use |vim.diagnostic.get()| instead.
*vim.lsp.diagnostic.get_count()* Use |vim.diagnostic.get()| instead.
*vim.lsp.diagnostic.get_line_diagnostics()*
Use |vim.diagnostic.get()| instead.
*vim.lsp.diagnostic.get_next()*
*vim.lsp.diagnostic.get_next_pos()*
*vim.lsp.diagnostic.get_prev()*
*vim.lsp.diagnostic.get_prev_pos()*
*vim.lsp.diagnostic.get_virtual_text_chunks_for_line()*
No replacement. Use options provided by
|vim.diagnostic.config()| to customize
virtual text.
*vim.lsp.diagnostic.goto_next()*
*vim.lsp.diagnostic.goto_prev()*
*vim.lsp.diagnostic.redraw()* Use |vim.diagnostic.show()| instead.
*vim.lsp.diagnostic.reset()*
*vim.lsp.diagnostic.save()* Use |vim.diagnostic.set()| instead.
*vim.lsp.diagnostic.set_loclist()* Use |vim.diagnostic.setloclist()| instead.
*vim.lsp.diagnostic.set_qflist()* Use |vim.diagnostic.setqflist()| instead.
The following have been replaced by |vim.diagnostic.open_float()|.
*vim.lsp.diagnostic.show_line_diagnostics()*
*vim.lsp.diagnostic.show_position_diagnostics()*
- *vim.lsp.diagnostic.clear()* Use |vim.diagnostic.hide()| instead.
- *vim.lsp.diagnostic.disable()*
- *vim.lsp.diagnostic.display()* Use |vim.diagnostic.show()| instead.
- *vim.lsp.diagnostic.enable()*
- *vim.lsp.diagnostic.get()*
- *vim.lsp.diagnostic.get_all()* Use |vim.diagnostic.get()| instead.
- *vim.lsp.diagnostic.get_count()* Use |vim.diagnostic.get()| instead.
- *vim.lsp.diagnostic.get_line_diagnostics()* Use |vim.diagnostic.get()| instead.
- *vim.lsp.diagnostic.get_next()*
- *vim.lsp.diagnostic.get_next_pos()*
- *vim.lsp.diagnostic.get_prev()*
- *vim.lsp.diagnostic.get_prev_pos()*
- *vim.lsp.diagnostic.get_virtual_text_chunks_for_line()* No replacement. Use
options provided by |vim.diagnostic.config()| to customize virtual text.
- *vim.lsp.diagnostic.goto_next()*
- *vim.lsp.diagnostic.goto_prev()*
- *vim.lsp.diagnostic.redraw()* Use |vim.diagnostic.show()| instead.
- *vim.lsp.diagnostic.reset()*
- *vim.lsp.diagnostic.save()* Use |vim.diagnostic.set()| instead.
- *vim.lsp.diagnostic.set_loclist()* Use |vim.diagnostic.setloclist()| instead.
- *vim.lsp.diagnostic.set_qflist()* Use |vim.diagnostic.setqflist()| instead.
- *vim.lsp.diagnostic.show_line_diagnostics()* Use |vim.diagnostic.open_float()| instead.
- *vim.lsp.diagnostic.show_position_diagnostics()* Use |vim.diagnostic.open_float()| instead.
The following are deprecated without replacement. These functions are moved
internally and are no longer exposed as part of the API. Instead, use
|vim.diagnostic.config()| and |vim.diagnostic.show()|.
*vim.lsp.diagnostic.set_signs()*
*vim.lsp.diagnostic.set_underline()*
*vim.lsp.diagnostic.set_virtual_text()*
- *vim.lsp.diagnostic.set_signs()*
- *vim.lsp.diagnostic.set_underline()*
- *vim.lsp.diagnostic.set_virtual_text()*
LSP Functions ~
*vim.lsp.util.diagnostics_to_items()* Use |vim.diagnostic.toqflist()| instead.
*vim.lsp.util.set_qflist()* Use |setqflist()| instead.
*vim.lsp.util.set_loclist()* Use |setloclist()| instead.
*vim.lsp.buf_get_clients()* Use |vim.lsp.get_active_clients()| with
LSP FUNCTIONS
- *vim.lsp.util.diagnostics_to_items()* Use |vim.diagnostic.toqflist()| instead.
- *vim.lsp.util.set_qflist()* Use |setqflist()| instead.
- *vim.lsp.util.set_loclist()* Use |setloclist()| instead.
- *vim.lsp.buf_get_clients()* Use |vim.lsp.get_active_clients()| with
{buffer = bufnr} instead.
- vim.lsp.buf.formatting() Use |vim.lsp.buf.format()| with
{async = true} instead.
- vim.lsp.buf.range_formatting() Use |vim.lsp.formatexpr()|
or |vim.lsp.buf.format()| instead.
Lua ~
*vim.register_keystroke_callback()* Use |vim.on_key()| instead.
LUA
- *vim.register_keystroke_callback()* Use |vim.on_key()| instead.
Modifiers ~
*cpo-<*
*:menu-<special>*
*:menu-special* <> notation is always enabled.
*:map-<special>*
*:map-special* <> notation is always enabled.
NORMAL COMMANDS
- *]f* *[f* Same as "gf".
Normal commands ~
*]f*
*[f* Same as "gf".
Options ~
*'cscopeverbose'* Enabled by default. Use |:silent| instead.
*'exrc'* *'ex'* Security risk: downloaded files could include
OPTIONS
- *cpo-<* *:menu-<special>* *:menu-special* *:map-<special>* *:map-special*
`<>` notation is always enabled.
- *'cscopeverbose'* Enabled by default. Use |:silent| instead.
- *'exrc'* *'ex'* Security risk: downloaded files could include
a malicious .nvimrc or .exrc file. See 'secure'.
Recommended alternative: define an autocommand in your
|vimrc| to set options for a matching directory.
'gd'
'gdefault' Enables the |:substitute| flag 'g' by default.
*'fe'* 'fenc'+'enc' before Vim 6.0; no longer used.
*'highlight'* *'hl'* Names of builtin |highlight-groups| cannot be changed.
*'langnoremap'* Deprecated alias to 'nolangremap'.
'sessionoptions' Flags "unix", "slash" are ignored and always enabled.
*'vi'*
'viewoptions' Flags "unix", "slash" are ignored and always enabled.
*'viminfo'* Deprecated alias to 'shada' option.
*'viminfofile'* Deprecated alias to 'shadafile' option.
- 'gdefault' Enables the |:substitute| flag 'g' by default.
- *'fe'* 'fenc'+'enc' before Vim 6.0; no longer used.
- *'highlight'* *'hl'* Names of builtin |highlight-groups| cannot be changed.
- *'langnoremap'* Deprecated alias to 'nolangremap'.
- 'sessionoptions' Flags "unix", "slash" are ignored and always enabled.
- *'vi'*
- 'viewoptions' Flags "unix", "slash" are ignored and always enabled.
- *'viminfo'* Deprecated alias to 'shada' option.
- *'viminfofile'* Deprecated alias to 'shadafile' option.
UI extensions~
*ui-wildmenu* Use |ui-cmdline| with |ui-popupmenu| instead. Enabled
UI EXTENSIONS
- *ui-wildmenu* Use |ui-cmdline| with |ui-popupmenu| instead. Enabled
by the `ext_wildmenu` |ui-option|. Emits these events:
["wildmenu_show", items]
["wildmenu_select", selected]
["wildmenu_hide"]
- `["wildmenu_show", items]`
- `["wildmenu_select", selected]`
- `["wildmenu_hide"]`
Variables~
*b:terminal_job_pid* PID of the top-level process in a |:terminal|.
VARIABLES
- *b:terminal_job_pid* PID of the top-level process in a |:terminal|.
Use `jobpid(&channel)` instead.
vim:noet:tw=78:ts=8:ft=help:norl:

View File

@ -8,7 +8,7 @@ Nvim style guide *dev-style*
This is style guide for developers working on Nvim's source code.
License: CC-By 3.0 http://creativecommons.org/licenses/by/3.0/
License: CC-By 3.0 https://creativecommons.org/licenses/by/3.0/
Type |gO| to see the table of contents.

View File

@ -131,6 +131,7 @@ DOCUMENTATION *dev-doc*
(docstrings, user manual, website materials, newsletters, …). Don't mince
words. Personality and flavor, used sparingly, are welcome--but in general,
optimize for the reader's time and energy: be "precise yet concise".
- See https://developers.google.com/style/tone
- Prefer the active voice: "Foo does X", not "X is done by Foo".
- Vim differences:
- Do not prefix help tags with "nvim-". Use |vim_diff.txt| to catalog
@ -144,11 +145,11 @@ DOCUMENTATION *dev-doc*
- Use "tui-" to prefix help tags related to the host terminal, and "TUI"
in prose if possible.
- Docstrings: do not start parameter descriptions with "The" or "A" unless it
is critical to avoid ambiguity.
GOOD: >
/// @param dirname Path fragment before `pend`
< BAD: >
/// @param dirname The path fragment before `pend`
is critical to avoid ambiguity. >
GOOD:
/// @param dirname Path fragment before `pend`
BAD:
/// @param dirname The path fragment before `pend`
<
Documentation format ~
@ -163,6 +164,9 @@ Strict "vimdoc" subset:
that you don't want auto-wrapped. Lists are always rendered with "flow"
(soft-wrapped) layout instead of preformatted (hard-wrapped) layout common
in legacy :help docs.
- Limitation: currently the parser https://github.com/neovim/tree-sitter-vimdoc
does not understand numbered listitems, so use a bullet symbol (- or •)
before numbered items, e.g. "- 1." instead of "1.".
- Separate blocks (paragraphs) of content by a blank line(s).
- Do not use indentation in random places—that prevents the page from using
"flow" layout. If you need a preformatted section, put it in
@ -180,7 +184,7 @@ Docstring format:
`@note`, `@param`, `@returns`
- Limited markdown is supported.
- List-items start with `-` (useful to nest or "indent")
- Use `<pre>` for code samples.
- Use `<pre>` for code samples.
Example: the help for |nvim_open_win()| is generated from a docstring defined
in src/nvim/api/win_config.c like this: >
@ -218,7 +222,7 @@ Docstring format:
`---@see`, `---@param`, `---@returns`
- Limited markdown is supported.
- List-items start with `-` (useful to nest or "indent")
- Use `<pre>` for code samples.
- Use `<pre>` for code samples.
Example: the help for |vim.paste()| is generated from a docstring decorating
vim.paste in runtime/lua/vim/_editor.lua like this: >
@ -251,7 +255,8 @@ LUA *dev-lua*
API *dev-api*
Use this template to name new RPC |API| functions:
Use this format to name new RPC |API| functions:
nvim_{thing}_{action}_{arbitrary-qualifiers}
If the function acts on an object then {thing} is the name of that object
@ -260,37 +265,50 @@ If the function acts on an object then {thing} is the name of that object
with a {thing} that groups functions under a common concept).
Use existing common {action} names if possible:
add Append to, or insert into, a collection
create Create a new thing
del Delete a thing (or group of things)
exec Execute code
get Get a thing (or group of things by query)
list Get all things
set Set a thing (or group of things)
- add Append to, or insert into, a collection
- call Call a function
- create Create a new (non-trivial) thing
- del Delete a thing (or group of things)
- eval Evaluate an expression
- exec Execute code
- fmt Format
- get Get things (often by a query)
- open Open
- parse Parse something into a structured form
- set Set a thing (or group of things)
Use existing common {thing} names if possible:
buf Buffer
pos Position
tab Tabpage
win Window
Do NOT use these deprecated verbs:
- list Redundant with "get"
Use consistent names for {thing} in all API functions. E.g. a buffer is called
Use consistent names for {thing} (nouns) in API functions: buffer is called
"buf" everywhere, not "buffer" in some places and "buf" in others.
- buf Buffer
- chan |channel|
- cmd Command
- cmdline Command-line UI or input
- fn Function
- hl Highlight
- pos Position
- proc System process
- tabpage Tabpage
- win Window
Do NOT use these deprecated nouns:
- buffer
- command
- window
Example:
`nvim_get_current_line` acts on the global editor state; the common
{action} "get" is used but {thing} is omitted.
`nvim_get_keymap('v')` operates in a global context (first parameter is not
a Buffer). The "get" {action} indicates that it gets anything matching the
given filter parameter. There is no need for a "list" action because
`nvim_get_keymap('')` (i.e., empty filter) returns all items.
Example:
`nvim_buf_add_highlight` acts on a `Buffer` object (the first parameter)
and uses the common {action} "add".
`nvim_buf_del_mark` acts on a `Buffer` object (the first parameter)
and uses the "del" {action}.
Example:
`nvim_list_bufs` operates in a global context (first parameter is not
a Buffer). The common {action} "list" indicates that it lists all bufs
(plural) in the global context.
Use this template to name new API events:
Use this format to name new API events:
nvim_{thing}_{event}_event
Example:
@ -332,10 +350,10 @@ a good name: it's idiomatic and unambiguous. If the package is named "neovim",
it confuses users, and complicates documentation and discussions.
Examples of API-client package names:
GOOD: nvim-racket
GOOD: pynvim
BAD: python-client
BAD: neovim
- GOOD: nvim-racket
- GOOD: pynvim
- BAD: python-client
- BAD: neovim
API client implementation guidelines ~
@ -401,4 +419,4 @@ Use the "on_" prefix to name event handlers and also the interface for
a confused collection of naming conventions for these related concepts.
vim:tw=78:ts=8:noet:ft=help:norl:
vim:tw=78:ts=8:sw=4:et:ft=help:norl:

View File

@ -342,7 +342,7 @@ config({opts}, {namespace}) *vim.diagnostic.config()*
any of the above.
Parameters: ~
{opts} (table|nil) When omitted or "nil", retrieve the current
{opts} (table|nil) When omitted or "nil", retrieve the current
configuration. Otherwise, a configuration table with the
following keys:
• underline: (default true) Use underline for
@ -397,32 +397,32 @@ config({opts}, {namespace}) *vim.diagnostic.config()*
severities are displayed before lower severities (e.g.
ERROR is displayed before WARN). Options:
• reverse: (boolean) Reverse sort order
{namespace} (number|nil) Update the options for the given namespace.
{namespace} (number|nil) Update the options for the given namespace.
When omitted, update the global diagnostic options.
disable({bufnr}, {namespace}) *vim.diagnostic.disable()*
Disable diagnostics in the given buffer.
Parameters: ~
{bufnr} (number|nil) Buffer number, or 0 for current buffer. When
{bufnr} (number|nil) Buffer number, or 0 for current buffer. When
omitted, disable diagnostics in all buffers.
{namespace} (number|nil) Only disable diagnostics for the given
{namespace} (number|nil) Only disable diagnostics for the given
namespace.
enable({bufnr}, {namespace}) *vim.diagnostic.enable()*
Enable diagnostics in the given buffer.
Parameters: ~
{bufnr} (number|nil) Buffer number, or 0 for current buffer. When
{bufnr} (number|nil) Buffer number, or 0 for current buffer. When
omitted, enable diagnostics in all buffers.
{namespace} (number|nil) Only enable diagnostics for the given
{namespace} (number|nil) Only enable diagnostics for the given
namespace.
fromqflist({list}) *vim.diagnostic.fromqflist()*
Convert a list of quickfix items to a list of diagnostics.
Parameters: ~
{list} (table) A list of quickfix items from |getqflist()| or
{list} (table) A list of quickfix items from |getqflist()| or
|getloclist()|.
Return: ~
@ -432,9 +432,9 @@ get({bufnr}, {opts}) *vim.diagnostic.get()*
Get current diagnostics.
Parameters: ~
{bufnr} (number|nil) Buffer number to get diagnostics from. Use 0 for
{bufnr} (number|nil) Buffer number to get diagnostics from. Use 0 for
current buffer or nil for all buffers.
{opts} (table|nil) A table with the following keys:
{opts} (table|nil) A table with the following keys:
• namespace: (number) Limit diagnostics to the given
namespace.
• lnum: (number) Limit diagnostics to the given line number.
@ -447,7 +447,7 @@ get_namespace({namespace}) *vim.diagnostic.get_namespace()*
Get namespace metadata.
Parameters: ~
{namespace} (number) Diagnostic namespace
{namespace} (number) Diagnostic namespace
Return: ~
(table) Namespace metadata
@ -462,7 +462,7 @@ get_next({opts}) *vim.diagnostic.get_next()*
Get the next diagnostic closest to the cursor position.
Parameters: ~
{opts} (table) See |vim.diagnostic.goto_next()|
{opts} (table) See |vim.diagnostic.goto_next()|
Return: ~
(table) Next diagnostic
@ -471,7 +471,7 @@ get_next_pos({opts}) *vim.diagnostic.get_next_pos()*
Return the position of the next diagnostic in the current buffer.
Parameters: ~
{opts} (table) See |vim.diagnostic.goto_next()|
{opts} (table) See |vim.diagnostic.goto_next()|
Return: ~
(table) Next diagnostic position as a (row, col) tuple.
@ -480,7 +480,7 @@ get_prev({opts}) *vim.diagnostic.get_prev()*
Get the previous diagnostic closest to the cursor position.
Parameters: ~
{opts} (table) See |vim.diagnostic.goto_next()|
{opts} (table) See |vim.diagnostic.goto_next()|
Return: ~
(table) Previous diagnostic
@ -489,7 +489,7 @@ get_prev_pos({opts}) *vim.diagnostic.get_prev_pos()*
Return the position of the previous diagnostic in the current buffer.
Parameters: ~
{opts} (table) See |vim.diagnostic.goto_next()|
{opts} (table) See |vim.diagnostic.goto_next()|
Return: ~
(table) Previous diagnostic position as a (row, col) tuple.
@ -498,7 +498,7 @@ goto_next({opts}) *vim.diagnostic.goto_next()*
Move to the next diagnostic.
Parameters: ~
{opts} (table|nil) Configuration table with the following keys:
{opts} (table|nil) Configuration table with the following keys:
• namespace: (number) Only consider diagnostics from the given
namespace.
• cursor_position: (cursor position) Cursor position as a
@ -519,7 +519,7 @@ goto_prev({opts}) *vim.diagnostic.goto_prev()*
Move to the previous diagnostic in the current buffer.
Parameters: ~
{opts} (table) See |vim.diagnostic.goto_next()|
{opts} (table) See |vim.diagnostic.goto_next()|
hide({namespace}, {bufnr}) *vim.diagnostic.hide()*
Hide currently displayed diagnostics.
@ -532,9 +532,9 @@ hide({namespace}, {bufnr}) *vim.diagnostic.hide()*
|vim.diagnostic.disable()|.
Parameters: ~
{namespace} (number|nil) Diagnostic namespace. When omitted, hide
{namespace} (number|nil) Diagnostic namespace. When omitted, hide
diagnostics from all namespaces.
{bufnr} (number|nil) Buffer number, or 0 for current buffer. When
{bufnr} (number|nil) Buffer number, or 0 for current buffer. When
omitted, hide diagnostics in all buffers.
*vim.diagnostic.match()*
@ -555,13 +555,13 @@ match({str}, {pat}, {groups}, {severity_map}, {defaults})
<
Parameters: ~
{str} (string) String to parse diagnostics from.
{pat} (string) Lua pattern with capture groups.
{groups} (table) List of fields in a |diagnostic-structure| to
{str} (string) String to parse diagnostics from.
{pat} (string) Lua pattern with capture groups.
{groups} (table) List of fields in a |diagnostic-structure| to
associate with captures from {pat}.
{severity_map} (table) A table mapping the severity field from
{severity_map} (table) A table mapping the severity field from
{groups} with an item from |vim.diagnostic.severity|.
{defaults} (table|nil) Table of default values for any fields not
{defaults} (table|nil) Table of default values for any fields not
listed in {groups}. When omitted, numeric values
default to 0 and "severity" defaults to ERROR.
@ -573,7 +573,7 @@ open_float({opts}, {...}) *vim.diagnostic.open_float()*
Show diagnostics in a floating window.
Parameters: ~
{opts} (table|nil) Configuration table with the same keys as
{opts} (table|nil) Configuration table with the same keys as
|vim.lsp.util.open_floating_preview()| in addition to the
following:
• bufnr: (number) Buffer number to show diagnostics from.
@ -631,27 +631,27 @@ reset({namespace}, {bufnr}) *vim.diagnostic.reset()*
re-displayed, use |vim.diagnostic.hide()|.
Parameters: ~
{namespace} (number|nil) Diagnostic namespace. When omitted, remove
{namespace} (number|nil) Diagnostic namespace. When omitted, remove
diagnostics from all namespaces.
{bufnr} (number|nil) Remove diagnostics for the given buffer.
{bufnr} (number|nil) Remove diagnostics for the given buffer.
When omitted, diagnostics are removed for all buffers.
set({namespace}, {bufnr}, {diagnostics}, {opts}) *vim.diagnostic.set()*
Set diagnostics for the given namespace and buffer.
Parameters: ~
{namespace} (number) The diagnostic namespace
{bufnr} (number) Buffer number
{diagnostics} (table) A list of diagnostic items
{namespace} (number) The diagnostic namespace
{bufnr} (number) Buffer number
{diagnostics} (table) A list of diagnostic items
|diagnostic-structure|
{opts} (table|nil) Display options to pass to
{opts} (table|nil) Display options to pass to
|vim.diagnostic.show()|
setloclist({opts}) *vim.diagnostic.setloclist()*
Add buffer diagnostics to the location list.
Parameters: ~
{opts} (table|nil) Configuration table with the following keys:
{opts} (table|nil) Configuration table with the following keys:
• namespace: (number) Only add diagnostics from the given
namespace.
• winnr: (number, default 0) Window number to set location
@ -666,7 +666,7 @@ setqflist({opts}) *vim.diagnostic.setqflist()*
Add all diagnostics to the quickfix list.
Parameters: ~
{opts} (table|nil) Configuration table with the following keys:
{opts} (table|nil) Configuration table with the following keys:
• namespace: (number) Only add diagnostics from the given
namespace.
• open: (boolean, default true) Open quickfix list after
@ -680,17 +680,17 @@ show({namespace}, {bufnr}, {diagnostics}, {opts})
Display diagnostics for the given namespace and buffer.
Parameters: ~
{namespace} (number|nil) Diagnostic namespace. When omitted, show
{namespace} (number|nil) Diagnostic namespace. When omitted, show
diagnostics from all namespaces.
{bufnr} (number|nil) Buffer number, or 0 for current buffer.
{bufnr} (number|nil) Buffer number, or 0 for current buffer.
When omitted, show diagnostics in all buffers.
{diagnostics} (table|nil) The diagnostics to display. When omitted,
{diagnostics} (table|nil) The diagnostics to display. When omitted,
use the saved diagnostics for the given namespace and
buffer. This can be used to display a list of
diagnostics without saving them or to display only a
subset of diagnostics. May not be used when {namespace}
or {bufnr} is nil.
{opts} (table|nil) Display options. See
{opts} (table|nil) Display options. See
|vim.diagnostic.config()|.
toqflist({diagnostics}) *vim.diagnostic.toqflist()*
@ -698,7 +698,7 @@ toqflist({diagnostics}) *vim.diagnostic.toqflist()*
passed to |setqflist()| or |setloclist()|.
Parameters: ~
{diagnostics} (table) List of diagnostics |diagnostic-structure|.
{diagnostics} (table) List of diagnostics |diagnostic-structure|.
Return: ~
array of quickfix list items |setqflist-what|

View File

@ -401,7 +401,7 @@ to see more messages.
The self-installing Vim for MS-Windows includes a diff program. If you don't
have it you might want to download a diff.exe. For example from
http://gnuwin32.sourceforge.net/packages/diffutils.htm.
https://gnuwin32.sourceforge.net/packages/diffutils.htm.
USING PATCHES *diff-patchexpr*

View File

@ -2141,9 +2141,11 @@ v:scrollstart String describing the script or function that caused the
hit-enter prompt.
*v:servername* *servername-variable*
v:servername Primary listen-address of the current Nvim instance, the first
item returned by |serverlist()|. Can be set by |--listen| or
|$NVIM_LISTEN_ADDRESS| (deprecated) at startup.
v:servername Primary listen-address of Nvim, the first item returned by
|serverlist()|. Usually this is the named pipe created by Nvim
at |startup| or given by |--listen| (or the deprecated
|$NVIM_LISTEN_ADDRESS| env var).
See also |serverstart()| |serverstop()|.
Read-only.

View File

@ -51,7 +51,7 @@ for a complete list.
To enable them, assign a value to the option. For example, to turn one on:
>
> let g:ada_standard_types = 1
>
To disable them use ":unlet". Example:
>
> unlet g:ada_standard_types
@ -486,25 +486,25 @@ You can optionally install the following extra plug-ins. They work well with
Ada and enhance the ability of the Ada mode:
backup.vim
http://www.vim.org/scripts/script.php?script_id=1537
https://www.vim.org/scripts/script.php?script_id=1537
Keeps as many backups as you like so you don't have to.
rainbow_parenthesis.vim
http://www.vim.org/scripts/script.php?script_id=1561
https://www.vim.org/scripts/script.php?script_id=1561
Very helpful since Ada uses only '(' and ')'.
nerd_comments.vim
http://www.vim.org/scripts/script.php?script_id=1218
https://www.vim.org/scripts/script.php?script_id=1218
Excellent commenting and uncommenting support for almost any
programming language.
matchit.vim
http://www.vim.org/scripts/script.php?script_id=39
https://www.vim.org/scripts/script.php?script_id=39
'%' jumping for any language. The normal '%' jump only works for '{}'
style languages. The Ada mode will set the needed search patterns.
taglist.vim
http://www.vim.org/scripts/script.php?script_id=273
https://www.vim.org/scripts/script.php?script_id=273
Source code explorer sidebar. There is a patch for Ada available.
The GNU Ada Project distribution (http://gnuada.sourceforge.net) of Vim

View File

@ -39,7 +39,7 @@ navigation.
1.1 Matchit *sql-matchit*
-----------
The matchit plugin (http://www.vim.org/scripts/script.php?script_id=39)
The matchit plugin (https://www.vim.org/scripts/script.php?script_id=39)
provides many additional features and can be customized for different
languages. The matchit plugin is configured by defining a local
buffer variable, b:match_words. Pressing the % key while on various
@ -296,7 +296,7 @@ exist.
3. Adding new SQL Dialects *sql-adding-dialects*
If you begin working with a SQL dialect which does not have any customizations
available with the default Vim distribution you can check http://www.vim.org
available with the default Vim distribution you can check https://www.vim.org
to see if any customization currently exist. If not, you can begin by cloning
an existing script. Read |filetype-plugins| for more details.
@ -403,7 +403,7 @@ Here are some examples of the entries which are pulled from the syntax files: >
----------------
Dynamic mode populates the popups with data directly from a database. In
order for the dynamic feature to be enabled you must have the dbext.vim
plugin installed, (http://vim.sourceforge.net/script.php?script_id=356).
plugin installed, (https://vim.sourceforge.net/script.php?script_id=356).
Dynamic mode is used by several features of the SQL completion plugin.
After installing the dbext plugin see the dbext-tutorial for additional
@ -487,7 +487,7 @@ depending on the syntax file you are using. The SQL Anywhere syntax file
Dynamic features
----------------
To take advantage of the dynamic features you must first install the
dbext.vim plugin (http://vim.sourceforge.net/script.php?script_id=356). It
dbext.vim plugin (https://vim.sourceforge.net/script.php?script_id=356). It
also comes with a tutorial. From the SQL completion plugin's perspective,
the main feature dbext provides is a connection to a database. dbext
connection profiles are the most efficient mechanism to define connection

View File

@ -97,6 +97,7 @@ General subjects ~
|nvim.txt| Transitioning from Vim
|help.txt| overview and quick reference (this file)
|helphelp.txt| about using the help files
|lua-guide| Nvim Lua guide
|index.txt| alphabetical index of all commands
|tips.txt| various tips on using Vim
|message.txt| (error) messages and explanations

View File

@ -251,7 +251,7 @@ At this moment translations are available for:
Japanese - multiple authors
Polish - translated by Mikolaj Machowski
Russian - translated by Vassily Ragosin
See the Vim website to find them: http://www.vim.org/translations.php
See the Vim website to find them: https://www.vim.org/translations.php
A set of translated help files consists of these files:

View File

@ -324,7 +324,7 @@ place your cursor over the function name or C symbol and quickly query cscope
for any matches.
Or you may use the following scheme, inspired by Vim/Cscope tutorial from
Cscope Home Page (http://cscope.sourceforge.net/): >
Cscope Home Page (https://cscope.sourceforge.net/): >
nmap <C-_>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>g :cs find g <C-R>=expand("<cword>")<CR><CR>

View File

@ -7,7 +7,7 @@ The Ruby Interface to Vim *if_ruby* *ruby* *Ruby*
*E266* *E267* *E268* *E269* *E270* *E271* *E272* *E273*
The home page for ruby is http://www.ruby-lang.org/. You can find links for
The home page for ruby is https://www.ruby-lang.org/. You can find links for
downloading Ruby there.
Type |gO| to see the table of contents.

View File

@ -724,7 +724,7 @@ Fortran with (possibly multiple) loops ending on a labelled executable
statement of almost arbitrary type. Correct indentation requires
compiler-quality parsing. Old code with do loops ending on labelled statements
of arbitrary type can be indented with elaborate programs such as Tidy
(http://www.unb.ca/chem/ajit/f_tidy.htm). Structured do/continue loops are
(https://www.unb.ca/chem/ajit/f_tidy.htm). Structured do/continue loops are
also left unindented because continue statements are also used for purposes
other than ending a do loop. Programs such as Tidy can convert structured
do/continue loops to the do/enddo form. Do loops of the do/enddo variety can

View File

@ -21,6 +21,7 @@ For a list of Vim variables see |vim-variable|.
tag char action in Insert mode ~
-----------------------------------------------------------------------
|i_CTRL-@| CTRL-@ insert previously inserted text and stop
insert
|i_CTRL-A| CTRL-A insert previously inserted text
@ -184,6 +185,7 @@ note: 1 = cursor movement command; 2 = can be undone/redone
tag char note action in Normal mode ~
------------------------------------------------------------------------------
CTRL-@ not used
|CTRL-A| CTRL-A 2 add N to number at/after cursor
|CTRL-B| CTRL-B 1 scroll N screens Backwards
@ -469,6 +471,7 @@ These can be used after an operator or in Visual mode to select an object.
tag command action in op-pending and Visual mode ~
------------------------------------------------------------------------------
|v_aquote| a" double quoted string
|v_a'| a' single quoted string
|v_a(| a( same as ab
@ -511,6 +514,7 @@ tag command action in op-pending and Visual mode ~
tag command action in Normal mode ~
------------------------------------------------------------------------------
|CTRL-W_CTRL-B| CTRL-W CTRL-B same as "CTRL-W b"
|CTRL-W_CTRL-C| CTRL-W CTRL-C same as "CTRL-W c"
|CTRL-W_CTRL-D| CTRL-W CTRL-D same as "CTRL-W d"
@ -609,6 +613,7 @@ tag command action in Normal mode ~
tag char note action in Normal mode ~
------------------------------------------------------------------------------
|[_CTRL-D| [ CTRL-D jump to first #define found in current and
included files matching the word under the
cursor, start searching at beginning of
@ -699,6 +704,7 @@ tag char note action in Normal mode ~
tag char note action in Normal mode ~
------------------------------------------------------------------------------
g_CTRL-A g CTRL-A dump a memory profile
|g_CTRL-G| g CTRL-G show information about current cursor
position
@ -802,6 +808,7 @@ g_CTRL-A g CTRL-A dump a memory profile
tag char note action in Normal mode ~
------------------------------------------------------------------------------
|z<CR>| z<CR> redraw, cursor line to top of window,
cursor on first non-blank
|zN<CR>| z{height}<CR> redraw, make window {height} lines high
@ -876,6 +883,7 @@ These can be used after an operator, but before a {motion} has been entered.
tag char action in Operator-pending mode ~
-----------------------------------------------------------------------
|o_v| v force operator to work charwise
|o_V| V force operator to work linewise
|o_CTRL-V| CTRL-V force operator to work blockwise
@ -888,6 +896,7 @@ here are those that are different.
tag command note action in Visual mode ~
------------------------------------------------------------------------------
|v_CTRL-\_CTRL-N| CTRL-\ CTRL-N stop Visual mode
|v_CTRL-\_CTRL-G| CTRL-\ CTRL-G go to Normal mode
|v_CTRL-A| CTRL-A 2 add N to number in highlighted text
@ -1008,6 +1017,7 @@ file names, tags, commands etc. as appropriate.
tag command action in Command-line editing mode ~
------------------------------------------------------------------------------
CTRL-@ not used
|c_CTRL-A| CTRL-A do completion on the pattern in front of the
cursor and insert all matches
@ -1110,7 +1120,7 @@ to terminal mode.
You found it, Arthur! *holy-grail*
==============================================================================
6. EX commands *ex-cmd-index* *:index*
6. EX commands *ex-commands* *ex-cmd-index* *:index*
This is a brief but complete listing of all the ":" commands, without
mentioning any arguments. The optional part of the command name is inside [].
@ -1118,6 +1128,7 @@ The commands are sorted on the non-optional part of their name.
tag command action ~
------------------------------------------------------------------------------
|:| : nothing
|:range| :{range} go to last line in {range}
|:!| :! filter lines or execute an external command

View File

@ -1350,16 +1350,8 @@ Completion of C code requires a tags file. You should use Universal/
Exuberant ctags, because it adds extra information that is needed for
completion. You can find it here:
Universal Ctags: https://ctags.io
Exuberant Ctags: http://ctags.sourceforge.net
Universal Ctags is preferred, Exuberant Ctags is no longer being developed.
For Exuberant ctags, version 5.6 or later is recommended. For version 5.5.4
you should add a patch that adds the "typename:" field:
ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
A compiled .exe for MS-Windows can be found at:
http://ctags.sourceforge.net/
https://github.com/universal-ctags/ctags-win32
Universal Ctags is preferred, Exuberant Ctags is no longer maintained.
If you want to complete system functions you can do something like this. Use
ctags to generate a tags file for all the system header files: >
@ -1459,7 +1451,7 @@ DOM compatibility
At the moment (beginning of 2006) there are two main browsers - MS Internet
Explorer and Mozilla Firefox. These two applications are covering over 90% of
market. Theoretically standards are created by W3C organisation
(http://www.w3c.org) but they are not always followed/implemented.
(https://www.w3.org/) but they are not always followed/implemented.
IE FF W3C Omni completion ~
+/- +/- + + ~
@ -1480,7 +1472,6 @@ external files and for class aware completion. You should use Universal/
Exuberant ctags version 5.5.4 or newer. You can find it here:
Universal Ctags: https://ctags.io
Exuberant Ctags: http://ctags.sourceforge.net
Script completes:
@ -1779,12 +1770,12 @@ DTD -> Vim *dtd2vim*
On |www| is the script |dtd2vim| which parses DTD and creates an XML data file
for Vim XML omni completion.
dtd2vim: http://www.vim.org/scripts/script.php?script_id=1462
dtd2vim: https://www.vim.org/scripts/script.php?script_id=1462
Check the beginning of that file for usage details.
The script requires perl and:
perlSGML: http://savannah.nongnu.org/projects/perlsgml
perlSGML: https://savannah.nongnu.org/projects/perlsgml
Commands

View File

@ -308,7 +308,7 @@ These names for keys are used in the documentation. They can also be used
with the ":map" command.
notation meaning equivalent decimal value(s) ~
-----------------------------------------------------------------------
----------------------------------------------------------------------- ~
<Nul> zero CTRL-@ 0 (stored as 10) *<Nul>*
<BS> backspace CTRL-H 8 *backspace*
<Tab> tab CTRL-I 9 *tab* *Tab*
@ -373,7 +373,7 @@ notation meaning equivalent decimal value(s) ~
<M-…> alt-key or meta-key *META* *ALT* *<M-*
<A-…> same as <M-…> *<A-*
<D-…> command-key or "super" key *<D-*
-----------------------------------------------------------------------
----------------------------------------------------------------------- ~
Note:
@ -530,29 +530,29 @@ Ex :vi -- -- -- -- --
-- not possible
*1 Go from Normal mode to Insert mode by giving the command "i", "I", "a",
"A", "o", "O", "c", "C", "s" or S".
*2 Go from Visual mode to Normal mode by giving a non-movement command, which
causes the command to be executed, or by hitting <Esc> "v", "V" or "CTRL-V"
(see |v_v|), which just stops Visual mode without side effects.
*3 Go from Command-line mode to Normal mode by:
- Hitting <CR> or <NL>, which causes the entered command to be executed.
- Deleting the complete line (e.g., with CTRL-U) and giving a final <BS>.
- Hitting CTRL-C or <Esc>, which quits the command-line without executing
the command.
In the last case <Esc> may be the character defined with the 'wildchar'
option, in which case it will start command-line completion. You can
ignore that and type <Esc> again.
*4 Go from Normal to Select mode by:
- use the mouse to select text while 'selectmode' contains "mouse"
- use a non-printable command to move the cursor while keeping the Shift
key pressed, and the 'selectmode' option contains "key"
- use "v", "V" or "CTRL-V" while 'selectmode' contains "cmd"
- use "gh", "gH" or "g CTRL-H" |g_CTRL-H|
*5 Go from Select mode to Normal mode by using a non-printable command to move
the cursor, without keeping the Shift key pressed.
*6 Go from Select mode to Insert mode by typing a printable character. The
selection is deleted and the character is inserted.
* 1 Go from Normal mode to Insert mode by giving the command "i", "I", "a",
"A", "o", "O", "c", "C", "s" or S".
* 2 Go from Visual mode to Normal mode by giving a non-movement command, which
causes the command to be executed, or by hitting <Esc> "v", "V" or "CTRL-V"
(see |v_v|), which just stops Visual mode without side effects.
* 3 Go from Command-line mode to Normal mode by:
- Hitting <CR> or <NL>, which causes the entered command to be executed.
- Deleting the complete line (e.g., with CTRL-U) and giving a final <BS>.
- Hitting CTRL-C or <Esc>, which quits the command-line without executing
the command.
In the last case <Esc> may be the character defined with the 'wildchar'
option, in which case it will start command-line completion. You can
ignore that and type <Esc> again.
* 4 Go from Normal to Select mode by:
- use the mouse to select text while 'selectmode' contains "mouse"
- use a non-printable command to move the cursor while keeping the Shift
key pressed, and the 'selectmode' option contains "key"
- use "v", "V" or "CTRL-V" while 'selectmode' contains "cmd"
- use "gh", "gH" or "g CTRL-H" |g_CTRL-H|
* 5 Go from Select mode to Normal mode by using a non-printable command to move
the cursor, without keeping the Shift key pressed.
* 6 Go from Select mode to Insert mode by typing a printable character. The
selection is deleted and the character is inserted.
*CTRL-\_CTRL-N* *i_CTRL-\_CTRL-N* *c_CTRL-\_CTRL-N*
*v_CTRL-\_CTRL-N* *t_CTRL-\_CTRL-N*

View File

@ -539,8 +539,8 @@ buf_attach_client({bufnr}, {client_id}) *vim.lsp.buf_attach_client()*
Without calling this, the server won't be notified of changes to a buffer.
Parameters: ~
{bufnr} (number) Buffer handle, or 0 for current
{client_id} (number) Client id
{bufnr} (number) Buffer handle, or 0 for current
{client_id} (number) Client id
buf_detach_client({bufnr}, {client_id}) *vim.lsp.buf_detach_client()*
Detaches client from the specified buffer. Note: While the server is
@ -548,23 +548,23 @@ buf_detach_client({bufnr}, {client_id}) *vim.lsp.buf_detach_client()*
send notifications should it ignore this notification.
Parameters: ~
{bufnr} (number) Buffer handle, or 0 for current
{client_id} (number) Client id
{bufnr} (number) Buffer handle, or 0 for current
{client_id} (number) Client id
buf_is_attached({bufnr}, {client_id}) *vim.lsp.buf_is_attached()*
Checks if a buffer is attached for a particular client.
Parameters: ~
{bufnr} (number) Buffer handle, or 0 for current
{client_id} (number) the client id
{bufnr} (number) Buffer handle, or 0 for current
{client_id} (number) the client id
buf_notify({bufnr}, {method}, {params}) *vim.lsp.buf_notify()*
Send a notification to a server
Parameters: ~
{bufnr} [number] (optional): The number of the buffer
{method} [string]: Name of the request method
{params} [string]: Arguments to send to the server
{bufnr} [number] (optional): The number of the buffer
{method} [string]: Name of the request method
{params} [string]: Arguments to send to the server
Return: ~
true if any client returns true; false otherwise
@ -576,10 +576,10 @@ buf_request_all({bufnr}, {method}, {params}, {callback})
|vim.lsp.buf_request()| but the return result and callback are different.
Parameters: ~
{bufnr} (number) Buffer handle, or 0 for current.
{method} (string) LSP method name
{params} (optional, table) Parameters to send to the server
{callback} (function) The callback to call when all requests are
{bufnr} (number) Buffer handle, or 0 for current.
{method} (string) LSP method name
{params} (optional, table) Parameters to send to the server
{callback} (function) The callback to call when all requests are
finished.
Return: ~
@ -595,10 +595,10 @@ buf_request_sync({bufnr}, {method}, {params}, {timeout_ms})
result is different. Wait maximum of {timeout_ms} (default 1000) ms.
Parameters: ~
{bufnr} (number) Buffer handle, or 0 for current.
{method} (string) LSP method name
{params} (optional, table) Parameters to send to the server
{timeout_ms} (optional, number, default=1000) Maximum time in
{bufnr} (number) Buffer handle, or 0 for current.
{method} (string) LSP method name
{params} (optional, table) Parameters to send to the server
{timeout_ms} (optional, number, default=1000) Maximum time in
milliseconds to wait for a result.
Return: ~
@ -666,7 +666,7 @@ client_is_stopped({client_id}) *vim.lsp.client_is_stopped()*
Checks whether a client is stopped.
Parameters: ~
{client_id} (Number)
{client_id} (Number)
Return: ~
true if client is stopped, false otherwise.
@ -676,8 +676,8 @@ for_each_buffer_client({bufnr}, {fn})
Invokes a function for each LSP client attached to a buffer.
Parameters: ~
{bufnr} (number) Buffer number
{fn} (function) Function to run on each client attached to buffer
{bufnr} (number) Buffer number
{fn} (function) Function to run on each client attached to buffer
{bufnr}. The function takes the client, client ID, and buffer
number as arguments. Example: >
@ -696,7 +696,7 @@ formatexpr({opts}) *vim.lsp.formatexpr()*
'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})')`.
Parameters: ~
{opts} (table) options for customizing the formatting expression
{opts} (table) options for customizing the formatting expression
which takes the following optional keys:
• timeout_ms (default 500ms). The timeout period for the
formatting request.
@ -705,7 +705,7 @@ get_active_clients({filter}) *vim.lsp.get_active_clients()*
Get active clients.
Parameters: ~
{filter} (table|nil) A table with key-value pairs used to filter the
{filter} (table|nil) A table with key-value pairs used to filter the
returned clients. The available keys are:
• id (number): Only return clients with the given id
• bufnr (number): Only return clients attached to this
@ -720,7 +720,7 @@ get_buffers_by_client_id({client_id})
Returns list of buffers attached to client_id.
Parameters: ~
{client_id} (number) client id
{client_id} (number) client id
Return: ~
list of buffer ids
@ -730,7 +730,7 @@ get_client_by_id({client_id}) *vim.lsp.get_client_by_id()*
not yet be fully initialized.
Parameters: ~
{client_id} (number) client id
{client_id} (number) client id
Return: ~
|vim.lsp.client| object, or nil
@ -745,8 +745,8 @@ omnifunc({findstart}, {base}) *vim.lsp.omnifunc()*
Implements 'omnifunc' compatible LSP completion.
Parameters: ~
{findstart} 0 or 1, decides behavior
{base} If findstart=0, text to match against
{findstart} 0 or 1, decides behavior
{base} If findstart=0, text to match against
Return: ~
(number) Decided by {findstart}:
@ -768,7 +768,7 @@ set_log_level({level}) *vim.lsp.set_log_level()*
Use `lsp.log_levels` for reverse lookup.
Parameters: ~
{level} [number|string] the case insensitive level name or number
{level} [number|string] the case insensitive level name or number
See also: ~
|vim.lsp.log_levels|
@ -791,22 +791,19 @@ start({config}, {opts}) *vim.lsp.start()*
See |vim.lsp.start_client()| for all available options. The most important
are:
`name` is an arbitrary name for the LSP client. It should be unique per
language server.
`cmd` the command as list - used to start the language server. The command must
be present in the `$PATH` environment variable or an absolute path to the executable. Shell
constructs like `~` are NOT expanded.
`root_dir` path to the project root. By default this is used to decide if
an existing client should be re-used. The example above uses
|vim.fs.find()| and |vim.fs.dirname()| to detect the root by traversing
the file system upwards starting from the current directory until either a
`pyproject.toml` or `setup.py` file is found.
`workspace_folders` a list of { uri:string, name: string } tables. The
project root folders used by the language server. If `nil` the property is
derived from the `root_dir` for convenience.
`name` arbitrary name for the LSP client. Should be unique per language
server.
• `cmd` command (in list form) used to start the language server. Must be
absolute, or found on `$PATH`. Shell constructs like `~` are not
expanded.
• `root_dir` path to the project root. By default this is used to decide
if an existing client should be re-used. The example above uses
|vim.fs.find()| and |vim.fs.dirname()| to detect the root by traversing
the file system upwards starting from the current directory until either
a `pyproject.toml` or `setup.py` file is found.
• `workspace_folders` list of `{ uri:string, name: string }` tables
specifying the project root folders used by the language server. If
`nil` the property is derived from `root_dir` for convenience.
Language servers use this information to discover metadata like the
dependencies of your project and they tend to index the contents within
@ -818,9 +815,9 @@ start({config}, {opts}) *vim.lsp.start()*
`ftplugin/<filetype_name>.lua` (See |ftplugin-name|)
Parameters: ~
{config} (table) Same configuration as documented in
{config} (table) Same configuration as documented in
|vim.lsp.start_client()|
{opts} nil|table Optional keyword arguments:
{opts} nil|table Optional keyword arguments:
• reuse_client (fun(client: client, config: table): boolean)
Predicate used to decide if a client should be re-used.
Used on all running clients. The default implementation
@ -837,7 +834,7 @@ start_client({config}) *vim.lsp.start_client()*
The following parameters describe fields in the {config} table.
Parameters: ~
{cmd} (table|string|fun(dispatchers: table):table)
{cmd} (table|string|fun(dispatchers: table):table)
command string or list treated like |jobstart()|.
The command must launch the language server
process. `cmd` can also be a function that
@ -848,26 +845,26 @@ start_client({config}) *vim.lsp.start_client()*
|vim.lsp.rpc.notify()| For TCP there is a
built-in rpc client factory:
|vim.lsp.rpc.connect()|
{cmd_cwd} (string, default=|getcwd()|) Directory to launch
{cmd_cwd} (string, default=|getcwd()|) Directory to launch
the `cmd` process. Not related to `root_dir`.
{cmd_env} (table) Environment flags to pass to the LSP on
{cmd_env} (table) Environment flags to pass to the LSP on
spawn. Can be specified using keys like a map or
as a list with `k=v` pairs or both. Non-string values are coerced to
string. Example: >
{ "PRODUCTION=true"; "TEST=123"; PORT = 8080; HOST = "0.0.0.0"; }
<
{detached} (boolean, default true) Daemonize the server
{detached} (boolean, default true) Daemonize the server
process so that it runs in a separate process
group from Nvim. Nvim will shutdown the process
on exit, but if Nvim fails to exit cleanly this
could leave behind orphaned server processes.
{workspace_folders} (table) List of workspace folders passed to the
{workspace_folders} (table) List of workspace folders passed to the
language server. For backwards compatibility
rootUri and rootPath will be derived from the
first workspace folder in this list. See
`workspaceFolders` in the LSP spec.
{capabilities} Map overriding the default capabilities defined
{capabilities} Map overriding the default capabilities defined
by |vim.lsp.protocol.make_client_capabilities()|,
passed to the language server on initialization.
Hint: use make_client_capabilities() and modify
@ -875,44 +872,44 @@ start_client({config}) *vim.lsp.start_client()*
• Note: To send an empty dictionary use
`{[vim.type_idx]=vim.types.dictionary}`, else
it will be encoded as an array.
{handlers} Map of language server method names to
{handlers} Map of language server method names to
|lsp-handler|
{settings} Map with language server specific settings. These
{settings} Map with language server specific settings. These
are returned to the language server if requested
via `workspace/configuration`. Keys are
case-sensitive.
{commands} (table) Table that maps string of clientside
{commands} (table) Table that maps string of clientside
commands to user-defined functions. Commands
passed to start_client take precedence over the
global command registry. Each key must be a
unique command name, and the value is a function
which is called if any LSP action (code action,
code lenses, ...) triggers the command.
{init_options} Values to pass in the initialization request as
{init_options} Values to pass in the initialization request as
`initializationOptions`. See `initialize` in the
LSP spec.
{name} (string, default=client-id) Name in log messages.
{get_language_id} function(bufnr, filetype) -> language ID as
{name} (string, default=client-id) Name in log messages.
{get_language_id} function(bufnr, filetype) -> language ID as
string. Defaults to the filetype.
{offset_encoding} (default="utf-16") One of "utf-8", "utf-16", or
{offset_encoding} (default="utf-16") One of "utf-8", "utf-16", or
"utf-32" which is the encoding that the LSP
server expects. Client does not verify this is
correct.
{on_error} Callback with parameters (code, ...), invoked
{on_error} Callback with parameters (code, ...), invoked
when the client operation throws an error. `code`
is a number describing the error. Other arguments
may be passed depending on the error kind. See
`vim.lsp.rpc.client_errors` for possible errors.
Use `vim.lsp.rpc.client_errors[code]` to get
human-friendly name.
{before_init} Callback with parameters (initialize_params,
{before_init} Callback with parameters (initialize_params,
config) invoked before the LSP "initialize"
phase, where `params` contains the parameters
being sent to the server and `config` is the
config that was passed to
|vim.lsp.start_client()|. You can use this to
modify parameters before they are sent.
{on_init} Callback (client, initialize_result) invoked
{on_init} Callback (client, initialize_result) invoked
after LSP "initialize", where `result` is a table
of `capabilities` and anything else the server
may send. For example, clangd sends
@ -925,19 +922,19 @@ start_client({config}) *vim.lsp.start_client()*
make this assumption. A
`workspace/didChangeConfiguration` notification
should be sent to the server during on_init.
{on_exit} Callback (code, signal, client_id) invoked on
{on_exit} Callback (code, signal, client_id) invoked on
client exit.
• code: exit code of the process
• signal: number describing the signal used to
terminate (if any)
• client_id: client handle
{on_attach} Callback (client, bufnr) invoked when client
{on_attach} Callback (client, bufnr) invoked when client
attaches to a buffer.
{trace} "off" | "messages" | "verbose" | nil passed
{trace} "off" | "messages" | "verbose" | nil passed
directly to the language server in the initialize
request. Invalid/empty values will default to
"off"
{flags} A table with flags for the client. The current
{flags} A table with flags for the client. The current
(experimental) flags are:
• allow_incremental_sync (bool, default true):
Allow using incremental sync for buffer edits
@ -951,7 +948,7 @@ start_client({config}) *vim.lsp.start_client()*
sending kill -15. If set to false, nvim exits
immediately after sending the "shutdown"
request to the server.
{root_dir} (string) Directory where the LSP server will base
{root_dir} (string) Directory where the LSP server will base
its workspaceFolders, rootUri, and rootPath on
initialization.
@ -974,8 +971,8 @@ stop_client({client_id}, {force}) *vim.lsp.stop_client()*
for this client, then force-shutdown is attempted.
Parameters: ~
{client_id} client id or |vim.lsp.client| object, or list thereof
{force} (boolean) (optional) shutdown forcefully
{client_id} client id or |vim.lsp.client| object, or list thereof
{force} (boolean) (optional) shutdown forcefully
tagfunc({...}) *vim.lsp.tagfunc()*
Provides an interface between the built-in client and 'tagfunc'.
@ -986,8 +983,8 @@ tagfunc({...}) *vim.lsp.tagfunc()*
LSP servers, falls back to using built-in tags.
Parameters: ~
{pattern} Pattern used to find a workspace symbol
{flags} See |tag-function|
{pattern} Pattern used to find a workspace symbol
{flags} See |tag-function|
Return: ~
A list of matching tags
@ -996,8 +993,8 @@ with({handler}, {override_config}) *vim.lsp.with()*
Function to manage overriding defaults for LSP handlers.
Parameters: ~
{handler} (function) See |lsp-handler|
{override_config} (table) Table containing the keys to override
{handler} (function) See |lsp-handler|
{override_config} (table) Table containing the keys to override
behavior of the {handler}
@ -1016,7 +1013,7 @@ code_action({options}) *vim.lsp.buf.code_action()*
Selects a code action available at the current cursor position.
Parameters: ~
{options} (table|nil) Optional table which holds the following
{options} (table|nil) Optional table which holds the following
optional fields:
• context: (table|nil) Corresponds to `CodeActionContext` of the LSP specification:
• diagnostics (table|nil): LSP`Diagnostic[]` . Inferred from the current position if not provided.
@ -1043,7 +1040,7 @@ completion({context}) *vim.lsp.buf.completion()*
called in Insert mode.
Parameters: ~
{context} (context support not yet implemented) Additional
{context} (context support not yet implemented) Additional
information about the context in which a completion was
triggered (how it was triggered, and by which trigger
character, if applicable)
@ -1058,7 +1055,7 @@ declaration({options}) *vim.lsp.buf.declaration()*
|vim.lsp.buf.definition()| instead.
Parameters: ~
{options} (table|nil) additional options
{options} (table|nil) additional options
• reuse_win: (boolean) Jump to existing window if buffer is
already open.
• on_list: (function) handler for list results. See
@ -1068,7 +1065,7 @@ definition({options}) *vim.lsp.buf.definition()*
Jumps to the definition of the symbol under the cursor.
Parameters: ~
{options} (table|nil) additional options
{options} (table|nil) additional options
• reuse_win: (boolean) Jump to existing window if buffer is
already open.
• on_list: (function) handler for list results. See
@ -1093,7 +1090,7 @@ document_symbol({options}) *vim.lsp.buf.document_symbol()*
Lists all symbols in the current buffer in the quickfix window.
Parameters: ~
{options} (table|nil) additional options
{options} (table|nil) additional options
• on_list: (function) handler for list results. See
|lsp-on-list-handler|
@ -1101,7 +1098,7 @@ execute_command({command_params}) *vim.lsp.buf.execute_command()*
Executes an LSP server command.
Parameters: ~
{command_params} (table) A valid `ExecuteCommandParams` object
{command_params} (table) A valid `ExecuteCommandParams` object
See also: ~
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_executeCommand
@ -1111,7 +1108,7 @@ format({options}) *vim.lsp.buf.format()*
server clients.
Parameters: ~
{options} table|nil Optional table which holds the following optional
{options} table|nil Optional table which holds the following optional
fields:
• formatting_options (table|nil): Can be used to specify
FormattingOptions. Some unspecified options will be
@ -1149,7 +1146,7 @@ formatting({options}) *vim.lsp.buf.formatting()*
Formats the current buffer.
Parameters: ~
{options} (table|nil) Can be used to specify FormattingOptions. Some
{options} (table|nil) Can be used to specify FormattingOptions. Some
unspecified options will be automatically derived from the
current Neovim options.
@ -1171,9 +1168,9 @@ formatting_seq_sync({options}, {timeout_ms}, {order})
<
Parameters: ~
{options} (table|nil) `FormattingOptions` entries
{timeout_ms} (number|nil) Request timeout
{order} (table|nil) List of client names. Formatting is
{options} (table|nil) `FormattingOptions` entries
{timeout_ms} (number|nil) Request timeout
{order} (table|nil) List of client names. Formatting is
requested from clients in the following order: first all
clients that are not in the `order` list, then the
remaining clients in the order as they occur in the
@ -1192,8 +1189,8 @@ formatting_sync({options}, {timeout_ms})
<
Parameters: ~
{options} (table|nil) with valid `FormattingOptions` entries
{timeout_ms} (number) Request timeout
{options} (table|nil) with valid `FormattingOptions` entries
{timeout_ms} (number) Request timeout
See also: ~
|vim.lsp.buf.format()|
@ -1207,7 +1204,7 @@ implementation({options}) *vim.lsp.buf.implementation()*
quickfix window.
Parameters: ~
{options} (table|nil) additional options
{options} (table|nil) additional options
• on_list: (function) handler for list results. See
|lsp-on-list-handler|
@ -1229,14 +1226,14 @@ range_code_action({context}, {start_pos}, {end_pos})
Performs |vim.lsp.buf.code_action()| for a given range.
Parameters: ~
{context} (table|nil) `CodeActionContext` of the LSP specification:
{context} (table|nil) `CodeActionContext` of the LSP specification:
• diagnostics: (table|nil) LSP`Diagnostic[]` . Inferred from the current position if not provided.
• only: (table|nil) List of LSP `CodeActionKind`s used to
filter the code actions. Most language servers support
values like `refactor` or `quickfix`.
{start_pos} ({number, number}, optional) mark-indexed position.
{start_pos} ({number, number}, optional) mark-indexed position.
Defaults to the start of the last visual selection.
{end_pos} ({number, number}, optional) mark-indexed position.
{end_pos} ({number, number}, optional) mark-indexed position.
Defaults to the end of the last visual selection.
*vim.lsp.buf.range_formatting()*
@ -1244,10 +1241,10 @@ range_formatting({options}, {start_pos}, {end_pos})
Formats a given range.
Parameters: ~
{options} Table with valid `FormattingOptions` entries.
{start_pos} ({number, number}, optional) mark-indexed position.
{options} Table with valid `FormattingOptions` entries.
{start_pos} ({number, number}, optional) mark-indexed position.
Defaults to the start of the last visual selection.
{end_pos} ({number, number}, optional) mark-indexed position.
{end_pos} ({number, number}, optional) mark-indexed position.
Defaults to the end of the last visual selection.
references({context}, {options}) *vim.lsp.buf.references()*
@ -1255,8 +1252,8 @@ references({context}, {options}) *vim.lsp.buf.references()*
window.
Parameters: ~
{context} (table) Context for the request
{options} (table|nil) additional options
{context} (table) Context for the request
{options} (table|nil) additional options
• on_list: (function) handler for list results. See
|lsp-on-list-handler|
@ -1272,9 +1269,9 @@ rename({new_name}, {options}) *vim.lsp.buf.rename()*
Renames all references to the symbol under the cursor.
Parameters: ~
{new_name} (string|nil) If not provided, the user will be prompted
{new_name} (string|nil) If not provided, the user will be prompted
for a new name using |vim.ui.input()|.
{options} (table|nil) additional options
{options} (table|nil) additional options
• filter (function|nil): Predicate used to filter clients.
Receives a client as argument and must return a boolean.
Clients matching the predicate are included.
@ -1296,7 +1293,7 @@ type_definition({options}) *vim.lsp.buf.type_definition()*
Jumps to the definition of the type of the symbol under the cursor.
Parameters: ~
{options} (table|nil) additional options
{options} (table|nil) additional options
• reuse_win: (boolean) Jump to existing window if buffer is
already open.
• on_list: (function) handler for list results. See
@ -1310,8 +1307,8 @@ workspace_symbol({query}, {options}) *vim.lsp.buf.workspace_symbol()*
string means no filtering is done.
Parameters: ~
{query} (string, optional)
{options} (table|nil) additional options
{query} (string, optional)
{options} (table|nil) additional options
• on_list: (function) handler for list results. See
|lsp-on-list-handler|
@ -1324,7 +1321,7 @@ get_namespace({client_id}) *vim.lsp.diagnostic.get_namespace()*
|vim.diagnostic|.
Parameters: ~
{client_id} (number) The id of the LSP client
{client_id} (number) The id of the LSP client
*vim.lsp.diagnostic.on_publish_diagnostics()*
on_publish_diagnostics({_}, {result}, {ctx}, {config})
@ -1353,7 +1350,7 @@ on_publish_diagnostics({_}, {result}, {ctx}, {config})
<
Parameters: ~
{config} (table) Configuration table (see |vim.diagnostic.config()|).
{config} (table) Configuration table (see |vim.diagnostic.config()|).
==============================================================================
@ -1363,15 +1360,15 @@ display({lenses}, {bufnr}, {client_id}) *vim.lsp.codelens.display()*
Display the lenses using virtual text
Parameters: ~
{lenses} (table) of lenses to display (`CodeLens[] | null`)
{bufnr} (number)
{client_id} (number)
{lenses} (table) of lenses to display (`CodeLens[] | null`)
{bufnr} (number)
{client_id} (number)
get({bufnr}) *vim.lsp.codelens.get()*
Return all lenses for the given buffer
Parameters: ~
{bufnr} (number) Buffer number. 0 can be used for the current buffer.
{bufnr} (number) Buffer number. 0 can be used for the current buffer.
Return: ~
(table) (`CodeLens[]`)
@ -1395,9 +1392,9 @@ save({lenses}, {bufnr}, {client_id}) *vim.lsp.codelens.save()*
Store lenses for a specific buffer and client
Parameters: ~
{lenses} (table) of lenses to store (`CodeLens[] | null`)
{bufnr} (number)
{client_id} (number)
{lenses} (table) of lenses to store (`CodeLens[] | null`)
{bufnr} (number)
{client_id} (number)
==============================================================================
@ -1415,7 +1412,7 @@ hover({_}, {result}, {ctx}, {config}) *vim.lsp.handlers.hover()*
<
Parameters: ~
{config} (table) Configuration table.
{config} (table) Configuration table.
• border: (default=nil)
• Add borders to the floating window
• See |nvim_open_win()|
@ -1434,7 +1431,7 @@ signature_help({_}, {result}, {ctx}, {config})
<
Parameters: ~
{config} (table) Configuration table.
{config} (table) Configuration table.
• border: (default=nil)
• Add borders to the floating window
• See |nvim_open_win()|
@ -1449,8 +1446,8 @@ apply_text_document_edit({text_document_edit}, {index}, {offset_encoding})
document.
Parameters: ~
{text_document_edit} table: a `TextDocumentEdit` object
{index} number: Optional index of the edit, if from a
{text_document_edit} table: a `TextDocumentEdit` object
{index} number: Optional index of the edit, if from a
list of edits (or nil, if not from a list)
See also: ~
@ -1461,9 +1458,9 @@ apply_text_edits({text_edits}, {bufnr}, {offset_encoding})
Applies a list of text edits to a buffer.
Parameters: ~
{text_edits} (table) list of `TextEdit` objects
{bufnr} (number) Buffer id
{offset_encoding} (string) utf-8|utf-16|utf-32
{text_edits} (table) list of `TextEdit` objects
{bufnr} (number) Buffer id
{offset_encoding} (string) utf-8|utf-16|utf-32
See also: ~
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textEdit
@ -1473,24 +1470,24 @@ apply_workspace_edit({workspace_edit}, {offset_encoding})
Applies a `WorkspaceEdit`.
Parameters: ~
{workspace_edit} (table) `WorkspaceEdit`
{offset_encoding} (string) utf-8|utf-16|utf-32 (required)
{workspace_edit} (table) `WorkspaceEdit`
{offset_encoding} (string) utf-8|utf-16|utf-32 (required)
buf_clear_references({bufnr}) *vim.lsp.util.buf_clear_references()*
Removes document highlights from a buffer.
Parameters: ~
{bufnr} (number) Buffer id
{bufnr} (number) Buffer id
*vim.lsp.util.buf_highlight_references()*
buf_highlight_references({bufnr}, {references}, {offset_encoding})
Shows a list of document highlights for a certain buffer.
Parameters: ~
{bufnr} (number) Buffer id
{references} (table) List of `DocumentHighlight` objects to
{bufnr} (number) Buffer id
{references} (table) List of `DocumentHighlight` objects to
highlight
{offset_encoding} (string) One of "utf-8", "utf-16", "utf-32".
{offset_encoding} (string) One of "utf-8", "utf-16", "utf-32".
See also: ~
https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#documentHighlight
@ -1500,10 +1497,10 @@ character_offset({buf}, {row}, {col}, {offset_encoding})
Returns the UTF-32 and UTF-16 offsets for a position in a certain buffer.
Parameters: ~
{buf} (number) buffer number (0 for current)
{row} 0-indexed line
{col} 0-indexed byte offset in line
{offset_encoding} (string) utf-8|utf-16|utf-32|nil defaults to
{buf} (number) buffer number (0 for current)
{row} 0-indexed line
{col} 0-indexed byte offset in line
{offset_encoding} (string) utf-8|utf-16|utf-32|nil defaults to
`offset_encoding` of first client of `buf`
Return: ~
@ -1518,8 +1515,8 @@ convert_input_to_markdown_lines({input}, {contents})
`textDocument/signatureHelp`, and potentially others.
Parameters: ~
{input} (`MarkedString` | `MarkedString[]` | `MarkupContent`)
{contents} (table, optional, default `{}`) List of strings to extend
{input} (`MarkedString` | `MarkedString[]` | `MarkupContent`)
{contents} (table, optional, default `{}`) List of strings to extend
with converted lines
Return: ~
@ -1533,10 +1530,10 @@ convert_signature_help_to_markdown_lines({signature_help}, {ft}, {triggers})
Converts `textDocument/SignatureHelp` response to markdown lines.
Parameters: ~
{signature_help} Response of `textDocument/SignatureHelp`
{ft} optional filetype that will be use as the `lang` for
{signature_help} Response of `textDocument/SignatureHelp`
{ft} optional filetype that will be use as the `lang` for
the label markdown code block
{triggers} optional list of trigger characters from the lsp
{triggers} optional list of trigger characters from the lsp
server. used to better determine parameter offsets
Return: ~
@ -1550,7 +1547,7 @@ extract_completion_items({result})
Can be used to extract the completion items from a `textDocument/completion` request, which may return one of `CompletionItem[]` , `CompletionList` or null.
Parameters: ~
{result} (table) The result of a `textDocument/completion` request
{result} (table) The result of a `textDocument/completion` request
Return: ~
(table) List of completion items
@ -1562,7 +1559,7 @@ get_effective_tabstop({bufnr}) *vim.lsp.util.get_effective_tabstop()*
Returns indentation size.
Parameters: ~
{bufnr} (number|nil): Buffer handle, defaults to current
{bufnr} (number|nil): Buffer handle, defaults to current
Return: ~
(number) indentation size
@ -1575,9 +1572,9 @@ jump_to_location({location}, {offset_encoding}, {reuse_win})
Jumps to a location.
Parameters: ~
{location} (table) (`Location`|`LocationLink`)
{offset_encoding} (string) utf-8|utf-16|utf-32 (required)
{reuse_win} (boolean) Jump to existing window if buffer is
{location} (table) (`Location`|`LocationLink`)
{offset_encoding} (string) utf-8|utf-16|utf-32 (required)
{reuse_win} (boolean) Jump to existing window if buffer is
already opened.
Return: ~
@ -1592,8 +1589,8 @@ locations_to_items({locations}, {offset_encoding})
|setloclist()|.
Parameters: ~
{locations} (table) list of `Location`s or `LocationLink`s
{offset_encoding} (string) offset_encoding for locations
{locations} (table) list of `Location`s or `LocationLink`s
{offset_encoding} (string) offset_encoding for locations
utf-8|utf-16|utf-32
Return: ~
@ -1603,8 +1600,8 @@ lookup_section({settings}, {section}) *vim.lsp.util.lookup_section()*
Helper function to return nested values in language server settings
Parameters: ~
{settings} a table of language server settings
{section} a string indicating the field of the settings table
{settings} a table of language server settings
{section} a string indicating the field of the settings table
Return: ~
(table or string) The value of settings accessed via section
@ -1615,9 +1612,9 @@ make_floating_popup_options({width}, {height}, {opts})
table can be passed to |nvim_open_win()|.
Parameters: ~
{width} (number) window width (in character cells)
{height} (number) window height (in character cells)
{opts} (table, optional)
{width} (number) window width (in character cells)
{height} (number) window height (in character cells)
{opts} (table, optional)
• offset_x (number) offset to add to `col`
• offset_y (number) offset to add to `row`
• border (string or table) override `border`
@ -1633,7 +1630,7 @@ make_formatting_params({options})
cursor position.
Parameters: ~
{options} (table|nil) with valid `FormattingOptions` entries
{options} (table|nil) with valid `FormattingOptions` entries
Return: ~
`DocumentFormattingParams` object
@ -1647,13 +1644,13 @@ make_given_range_params({start_pos}, {end_pos}, {bufnr}, {offset_encoding})
similar to |vim.lsp.util.make_range_params()|.
Parameters: ~
{start_pos} number[]|nil {row, col} mark-indexed position.
{start_pos} number[]|nil {row, col} mark-indexed position.
Defaults to the start of the last visual selection.
{end_pos} number[]|nil {row, col} mark-indexed position.
{end_pos} number[]|nil {row, col} mark-indexed position.
Defaults to the end of the last visual selection.
{bufnr} (number|nil) buffer handle or 0 for current,
{bufnr} (number|nil) buffer handle or 0 for current,
defaults to current
{offset_encoding} "utf-8"|"utf-16"|"utf-32"|nil defaults to
{offset_encoding} "utf-8"|"utf-16"|"utf-32"|nil defaults to
`offset_encoding` of first client of `bufnr`
Return: ~
@ -1666,9 +1663,9 @@ make_position_params({window}, {offset_encoding})
cursor position.
Parameters: ~
{window} number|nil: window handle or 0 for current,
{window} number|nil: window handle or 0 for current,
defaults to current
{offset_encoding} (string) utf-8|utf-16|utf-32|nil defaults to
{offset_encoding} (string) utf-8|utf-16|utf-32|nil defaults to
`offset_encoding` of first client of buffer of
`window`
@ -1686,9 +1683,9 @@ make_range_params({window}, {offset_encoding})
`textDocument/rangeFormatting`.
Parameters: ~
{window} number|nil: window handle or 0 for current,
{window} number|nil: window handle or 0 for current,
defaults to current
{offset_encoding} "utf-8"|"utf-16"|"utf-32"|nil defaults to
{offset_encoding} "utf-8"|"utf-16"|"utf-32"|nil defaults to
`offset_encoding` of first client of buffer of
`window`
@ -1701,7 +1698,7 @@ make_text_document_params({bufnr})
Creates a `TextDocumentIdentifier` object for the current buffer.
Parameters: ~
{bufnr} number|nil: Buffer handle, defaults to current
{bufnr} number|nil: Buffer handle, defaults to current
Return: ~
`TextDocumentIdentifier`
@ -1714,17 +1711,17 @@ make_workspace_params({added}, {removed})
Create the workspace params
Parameters: ~
{added}
{removed}
{added}
{removed}
*vim.lsp.util.open_floating_preview()*
open_floating_preview({contents}, {syntax}, {opts})
Shows contents in a floating window.
Parameters: ~
{contents} (table) of lines to show in window
{syntax} (string) of syntax to set for opened buffer
{opts} (table) with optional fields (additional keys are passed
{contents} (table) of lines to show in window
{syntax} (string) of syntax to set for opened buffer
{opts} (table) with optional fields (additional keys are passed
on to |nvim_open_win()|)
• height: (number) height of floating window
• width: (number) width of floating window
@ -1753,7 +1750,7 @@ parse_snippet({input}) *vim.lsp.util.parse_snippet()*
Parses snippets in a completion entry.
Parameters: ~
{input} (string) unparsed snippet
{input} (string) unparsed snippet
Return: ~
(string) parsed snippet
@ -1767,7 +1764,7 @@ preview_location({location}, {opts}) *vim.lsp.util.preview_location()*
definition)
Parameters: ~
{location} a single `Location` or `LocationLink`
{location} a single `Location` or `LocationLink`
Return: ~
(bufnr,winnr) buffer and window number of floating window or nil
@ -1776,7 +1773,7 @@ rename({old_fname}, {new_fname}, {opts}) *vim.lsp.util.rename()*
Rename old_fname to new_fname
Parameters: ~
{opts} (table)
{opts} (table)
set_lines({lines}, {A}, {B}, {new_lines}) *vim.lsp.util.set_lines()*
Replaces text in a range with new text.
@ -1784,10 +1781,10 @@ set_lines({lines}, {A}, {B}, {new_lines}) *vim.lsp.util.set_lines()*
CAUTION: Changes in-place!
Parameters: ~
{lines} (table) Original list of strings
{A} (table) Start position; a 2-tuple of {line, col} numbers
{B} (table) End position; a 2-tuple of {line, col} numbers
{new_lines} A list of strings to replace the original
{lines} (table) Original list of strings
{A} (table) Start position; a 2-tuple of {line, col} numbers
{B} (table) End position; a 2-tuple of {line, col} numbers
{new_lines} A list of strings to replace the original
Return: ~
(table) The modified {lines} object
@ -1805,8 +1802,8 @@ stylize_markdown({bufnr}, {contents}, {opts})
`open_floating_preview` instead
Parameters: ~
{contents} (table) of lines to show in window
{opts} dictionary with optional fields
{contents} (table) of lines to show in window
{opts} dictionary with optional fields
• height of floating window
• width of floating window
• wrap_at character to wrap at for computing height
@ -1823,7 +1820,7 @@ symbols_to_items({symbols}, {bufnr}) *vim.lsp.util.symbols_to_items()*
Converts symbols to quickfix list items.
Parameters: ~
{symbols} DocumentSymbol[] or SymbolInformation[]
{symbols} DocumentSymbol[] or SymbolInformation[]
*vim.lsp.util.text_document_completion_list_to_complete_items()*
text_document_completion_list_to_complete_items({result}, {prefix})
@ -1831,10 +1828,10 @@ text_document_completion_list_to_complete_items({result}, {prefix})
vim-compatible |complete-items|.
Parameters: ~
{result} The result of a `textDocument/completion` call, e.g. from
{result} The result of a `textDocument/completion` call, e.g. from
|vim.lsp.buf.completion()|, which may be one of
`CompletionItem[]`, `CompletionList` or `null`
{prefix} (string) the prefix to filter the completion items
{prefix} (string) the prefix to filter the completion items
Return: ~
{ matches = complete-items table, incomplete = bool }
@ -1846,7 +1843,7 @@ trim_empty_lines({lines}) *vim.lsp.util.trim_empty_lines()*
Removes empty lines from the beginning and end.
Parameters: ~
{lines} (table) list of lines to trim
{lines} (table) list of lines to trim
Return: ~
(table) trimmed list of lines
@ -1859,7 +1856,7 @@ try_trim_markdown_code_blocks({lines})
CAUTION: Modifies the input in-place!
Parameters: ~
{lines} (table) list of lines
{lines} (table) list of lines
Return: ~
(string) filetype or "markdown" if it was unchanged.
@ -1884,20 +1881,20 @@ set_format_func({handle}) *vim.lsp.log.set_format_func()*
Sets formatting function used to format logs
Parameters: ~
{handle} (function) function to apply to logging arguments, pass
{handle} (function) function to apply to logging arguments, pass
vim.inspect for multi-line formatting
set_level({level}) *vim.lsp.log.set_level()*
Sets the current log level.
Parameters: ~
{level} (string or number) One of `vim.lsp.log.levels`
{level} (string or number) One of `vim.lsp.log.levels`
should_log({level}) *vim.lsp.log.should_log()*
Checks whether the level is sufficient for logging.
Parameters: ~
{level} (number) log level
{level} (number) log level
Return: ~
(bool) true if would log, false if not
@ -1911,8 +1908,8 @@ connect({host}, {port}) *vim.lsp.rpc.connect()*
and port
Parameters: ~
{host} (string)
{port} (number)
{host} (string)
{port} (number)
Return: ~
(function)
@ -1921,7 +1918,7 @@ format_rpc_error({err}) *vim.lsp.rpc.format_rpc_error()*
Constructs an error message from an LSP error object.
Parameters: ~
{err} (table) The error object
{err} (table) The error object
Return: ~
(string) The formatted error message
@ -1930,8 +1927,8 @@ notify({method}, {params}) *vim.lsp.rpc.notify()*
Sends a notification to the LSP server.
Parameters: ~
{method} (string) The invoked LSP method
{params} (table|nil): Parameters for the invoked LSP method
{method} (string) The invoked LSP method
{params} (table|nil): Parameters for the invoked LSP method
Return: ~
(bool) `true` if notification could be sent, `false` if not
@ -1941,11 +1938,11 @@ request({method}, {params}, {callback}, {notify_reply_callback})
Sends a request to the LSP server and runs {callback} upon response.
Parameters: ~
{method} (string) The invoked LSP method
{params} (table|nil) Parameters for the invoked LSP
{method} (string) The invoked LSP method
{params} (table|nil) Parameters for the invoked LSP
method
{callback} (function) Callback to invoke
{notify_reply_callback} (function|nil) Callback to invoke as soon as
{callback} (function) Callback to invoke
{notify_reply_callback} (function|nil) Callback to invoke as soon as
a request is no longer pending
Return: ~
@ -1957,10 +1954,10 @@ rpc_response_error({code}, {message}, {data})
Creates an RPC response object/table.
Parameters: ~
{code} (number) RPC error code defined in
{code} (number) RPC error code defined in
`vim.lsp.protocol.ErrorCodes`
{message} (string|nil) arbitrary message to send to server
{data} any|nil arbitrary data to send to server
{message} (string|nil) arbitrary message to send to server
{data} any|nil arbitrary data to send to server
*vim.lsp.rpc.start()*
start({cmd}, {cmd_args}, {dispatchers}, {extra_spawn_params})
@ -1970,16 +1967,16 @@ start({cmd}, {cmd_args}, {dispatchers}, {extra_spawn_params})
|vim.lsp.rpc.connect()|
Parameters: ~
{cmd} (string) Command to start the LSP server.
{cmd_args} (table) List of additional string arguments to
{cmd} (string) Command to start the LSP server.
{cmd_args} (table) List of additional string arguments to
pass to {cmd}.
{dispatchers} (table|nil) Dispatchers for LSP message types.
{dispatchers} (table|nil) Dispatchers for LSP message types.
Valid dispatcher names are:
• `"notification"`
• `"server_request"`
• `"on_error"`
• `"on_exit"`
{extra_spawn_params} (table|nil) Additional context for the LSP
{extra_spawn_params} (table|nil) Additional context for the LSP
server process. May contain:
• {cwd} (string) Working directory for the LSP
server process
@ -2003,14 +2000,14 @@ compute_diff({___MissingCloseParenHere___})
Returns the range table for the difference between prev and curr lines
Parameters: ~
{prev_lines} (table) list of lines
{curr_lines} (table) list of lines
{firstline} (number) line to begin search for first difference
{lastline} (number) line to begin search in old_lines for last
{prev_lines} (table) list of lines
{curr_lines} (table) list of lines
{firstline} (number) line to begin search for first difference
{lastline} (number) line to begin search in old_lines for last
difference
{new_lastline} (number) line to begin search in new_lines for last
{new_lastline} (number) line to begin search in new_lines for last
difference
{offset_encoding} (string) encoding requested by language server
{offset_encoding} (string) encoding requested by language server
Return: ~
(table) TextDocumentContentChangeEvent see https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#textDocumentContentChangeEvent
@ -2029,7 +2026,7 @@ resolve_capabilities({server_capabilities})
Creates a normalized object describing LSP server capabilities.
Parameters: ~
{server_capabilities} (table) Table of capabilities supported by the
{server_capabilities} (table) Table of capabilities supported by the
server
Return: ~

757
runtime/doc/lua-guide.txt Normal file
View File

@ -0,0 +1,757 @@
*lua-guide.txt* Nvim
NVIM REFERENCE MANUAL
Guide to using Lua in Nvim
Type |gO| to see the table of contents.
==============================================================================
Introduction *lua-guide*
This guide will go through the basics of using Lua in Neovim. It is not meant
to be a comprehensive encyclopedia of all available features, nor will it
detail all intricacies. Think of it as a survival kit -- the bare minimum
needed to know to comfortably get started on using Lua in Neovim.
An important thing to note is that this isn't a guide to the Lua language
itself. Rather, this is a guide on how to configure and modify Neovim through
the Lua language and the functions we provide to help with this. Take a look
at |luaref| and |lua-concepts| if you'd like to learn more about Lua itself.
Similarly, this guide assumes some familiarity with the basics of Neovim
(commands, options, mappings, autocommands), which are covered in the
|user-manual|.
------------------------------------------------------------------------------
Some words on the API *lua-guide-api*
The purpose of this guide is to introduce the different ways of interacting
with Neovim through Lua (the "API"). This API consists of three different
layers:
1. The "Vim API" inherited from Vim: |ex-commands| and |builtin-functions| as
well as |user-function|s in Vimscript. These are accessed through |vim.cmd()|
and |vim.fn| respectively, which are discussed under |lua-guide-vimscript|
below.
2. The "Neovim API" written in C for use in remote plugins and GUIs; see |api|.
These functions are accessed through |vim.api|.
3. The "Lua API" written in and specifically for Lua. These are any other
functions accessible through `vim.*` not mentioned already; see |lua-stdlib|.
This distinction is important, as API functions inherit behavior from their
original layer: For example, Neovim API functions always need all arguments to
be specified even if Lua itself allows omitting arguments (which are then
passed as `nil`); and Vim API functions can use 0-based indexing even if Lua
arrays are 1-indexed by default.
Through this, any possible interaction can be done through Lua without writing
a complete new API from scratch. For this reason, functions are usually not
duplicated between layers unless there is a significant benefit in
functionality or performance (e.g., you can map Lua functions directly through
|nvim_create_autocmd()| but not through |:autocmd|). In case there are multiple
ways of achieving the same thing, this guide will only cover what is most
convenient to use from Lua.
==============================================================================
Using Lua *lua-guide-using-Lua*
To run Lua code from the Neovim command line, use the |:lua| command:
>vim
:lua print("Hello!")
<
Note: each |:lua| command has its own scope and variables declared with the
local keyword are not accessible outside of the command. This won't work:
>vim
:lua local foo = 1
:lua print(foo)
" prints "nil" instead of "1"
<
You can also use `:lua=`, which is the same as `:lua vim.pretty_print(...)`,
to conveniently check the value of a variable or a table:
>lua
:lua=package
<
To run a Lua script in an external file, you can use the |:source| command
exactly like for a Vimscript file:
>vim
:source ~/programs/baz/myluafile.lua
<
Finally, you can include Lua code in a Vimscript file by putting it inside a
|lua-heredoc| block:
>vim
lua << EOF
local tbl = {1, 2, 3}
for k, v in ipairs(tbl) do
print(v)
end
EOF
<
------------------------------------------------------------------------------
Using Lua files on startup *lua-guide-config*
Neovim supports using `init.vim` or `init.lua` as the configuration file, but
not both at the same time. This should be placed in your |config| directory,
which is typically `~/.config/nvim` for Linux, BSD, or macOS, and
`~/AppData/Local/nvim/` for Windows. Note that you can use Lua in `init.vim`
and Vimscript in `init.lua`, which will be covered below.
If you'd like to run any other Lua script on |startup| automatically, then you
can simply put it in `plugin/` in your |'runtimepath'|.
------------------------------------------------------------------------------
Lua modules *lua-guide-modules*
If you want to load Lua files on demand, you can place them in the `lua/`
directory in your |'runtimepath'| and load them with `require`. (This is the
Lua equivalent of Vimscript's |autoload| mechanism.)
Let's assume you have the following directory structure:
>
~/.config/nvim
|-- after/
|-- ftplugin/
|-- lua/
| |-- myluamodule.lua
| |-- other_modules/
| |-- anothermodule.lua
| |-- init.lua
|-- plugin/
|-- syntax/
|-- init.vim
<
Then the following Lua code will load `myluamodule.lua`:
>lua
require("myluamodule")
<
Note the absence of a `.lua` extension.
Similarly, loading `other_modules/anothermodule.lua` is done via
>lua
require('other_modules/anothermodule')
-- or
require('other_modules.anothermodule')
<
Note how "submodules" are just subdirectories; the `.` is equivalent to the
path separator `/` (even on Windows).
A folder containing an |init.lua| file can be required directly, without
having to specify the name of the file:
>lua
require('other_modules') -- loads other_modules/init.lua
<
Requiring a nonexistent module or a module which contains syntax errors aborts
the currently executing script. `pcall()` may be used to catch such errors. The
following example tries to load the `module_with_error` and only calls one of
its functions if this succeeds and prints an error message otherwise:
>lua
local ok, mymod = pcall(require, 'module_with_error')
if not ok then
print("Module had an error")
else
mymod.function()
end
<
In contrast to |:source|, |require()| not only searches through all `lua/` directories
under |'runtimepath'|, it also cache the module on first use. Calling
`require()` a second time will therefore _not_ execute the script again and
instead return the cached file. To rerun the file, you need to remove it from
the cache manually first:
>lua
package.loaded['myluamodule'] = nil
require('myluamodule') -- read and execute the module again from disk
<
------------------------------------------------------------------------------
See also:
• |lua-require|
• |luaref-pcall()|
==============================================================================
Using Vim commands and functions from Lua *lua-guide-vimscript*
All Vim commands and functions are accessible from Lua.
------------------------------------------------------------------------------
Vim commands *lua-guide-vim-commands*
To run an arbitrary Vim command from Lua, pass it as a string to |vim.cmd()|:
>lua
vim.cmd("colorscheme habamax")
<
Note that special characters will need to be escaped with backslashes:
>lua
vim.cmd("%s/\\Vfoo/bar/g")
<
An alternative is to use a literal string (see |luaref-literal|) delimited by
double brackets `[[ ]]` as in
>lua
vim.cmd([[%s/\Vfoo/bar/g]])
<
Another benefit of using literal strings is that they can be multiple lines;
this allows you to pass multiple commands to a single call of |vim.cmd()|:
>lua
vim.cmd([[
highlight Error guibg=red
highlight link Warning Error
]])
<
This is the converse of |lua-heredoc| and allows you to include Lua code in
your `init.vim`.
If you want to build your Vim command programmatically, the following form can
be useful (all these are equivalent to the corresponding line above):
>lua
vim.cmd.colorscheme("habamax")
vim.cmd.highlight({ "Error", "guibg=red" })
vim.cmd.highlight({ "link", "Warning", "Error" })
<
------------------------------------------------------------------------------
Vimscript functions *lua-guide-vim-functions*
Use |vim.fn| to call Vimscript functions from Lua. Data types between Lua and
Vimscript are automatically converted:
>lua
print(vim.fn.printf('Hello from %s', 'Lua'))
local reversed_list = vim.fn.reverse({ 'a', 'b', 'c' })
print(vim.inspect(reversed_list)) -- { "c", "b", "a" }
local function print_stdout(chan_id, data, name)
print(data[1])
end
vim.fn.jobstart('ls', { on_stdout = print_stdout })
print(vim.fn.printf('Hello from %s', 'Lua'))
<
This works for both |builtin-functions| and |user-function|s.
Note that hashes (`#`) are not valid characters for identifiers in Lua, so,
e.g., |autoload| functions have to be called with this syntax:
>lua
vim.fn['my#autoload#function']()
<
------------------------------------------------------------------------------
See also:
• |builtin-functions|: alphabetic list of all Vimscript functions
• |function-list|: list of all Vimscript functions grouped by topic
• |:runtime|: run all Lua scripts matching a pattern in |'runtimepath'|
• |package.path|: list of all paths searched by `require()`
==============================================================================
Variables *lua-guide-variables*
Variables can be set and read using the following wrappers, which directly
correspond to their |variable-scope|:
• |vim.g|: global variables (|g:|)
• |vim.b|: variables for the current buffer (|b:|)
• |vim.w|: variables for the current window (|w:|)
• |vim.t|: variables for the current tabpage (|t:|)
• |vim.v|: predefined Vim variables (|v:|)
• |vim.env|: environment variables defined in the editor session
Data types are converted automatically. For example:
>lua
vim.g.some_global_variable = {
key1 = "value",
key2 = 300
}
print(vim.inspect(vim.g.some_global_variable))
--> { key1 = "value", key2 = 300 }
<
You can target specific buffers (via number), windows (via |window-ID|), or
tabpages by indexing the wrappers:
>lua
vim.b[2].myvar = 1 -- set myvar for buffer number 2
vim.w[1005].myothervar = true -- set myothervar for window ID 1005
<
Some variable names may contain characters that cannot be used for identifiers
in Lua. You can still manipulate these variables by using the syntax
>lua
vim.g['my#variable'] = 1
<
Note that you cannot directly change fields of array variables. This won't
work:
>lua
vim.g.some_global_variable.key2 = 400
vim.pretty_print(vim.g.some_global_variable)
--> { key1 = "value", key2 = 300 }
<
Instead, you need to create an intermediate Lua table and change this:
>lua
local temp_table = vim.g.some_global_variable
temp_table = keys = 400
vim.g.some_global_variable = temp_table
vim.pretty_print(vim.g.some_global_variable)
--> { key1 = "value", key2 = 400 }
<
To delete a variable, simply set it to `nil`:
>lua
vim.g.myvar = nil
<
------------------------------------------------------------------------------
See also:
• |lua-vim-variables|
==============================================================================
Options *lua-guide-options*
There are two complementary ways of setting |options| via Lua.
------------------------------------------------------------------------------
vim.opt
The most convenient way for setting global and local options, e.g., in `init.lua`,
is through `vim.opt` and friends:
• |vim.opt|: behaves like |:set|
• |vim.opt_global|: behaves like |:setglobal|
• |vim.opt_local|: behaves like |:setlocal|
For example, the Vimscript commands
>vim
set smarttab
set nosmarttab
<
are equivalent to
>lua
vim.opt.smarttab = true
vim.opt.smarttab = false
<
In particular, they allow an easy way to working with list-like, map-like, and
set-like options through Lua tables: Instead of
>vim
set wildignore=*.o,*.a,__pycache__
set listchars=space:_,tab:>~
set formatoptions=njt
<
you can use
>lua
vim.opt.wildignore = { '*.o', '*.a', '__pycache__' }
vim.opt.listchars = { space = '_', tab = '>~' }
vim.opt.formatoptions = { n = true, j = true, t = true }
<
These wrappers also come with methods that work similarly to their |:set+=|,
|:set^=| and |:set-=| counterparts in Vimscript:
>lua
vim.opt.shortmess:append({ I = true })
vim.opt.wildignore:prepend('*.o')
vim.opt.whichwrap:remove({ 'b', 's' })
<
The price to pay is that you cannot access the option values directly but must
use |vim.opt:get()|:
>lua
print(vim.opt.smarttab)
--> {...} (big table)
print(vim.opt.smarttab:get())
--> false
vim.pretty_print(vim.opt.listchars:get())
--> { space = '_', tab = '>~' }
<
------------------------------------------------------------------------------
vim.o
For this reason, there exists a more direct variable-like access using `vim.o`
and friends, similarly to how you can get and set options via `:echo &number`
and `:let &listchars='space:_,tab:>~'`:
• |vim.o|: behaves like |:set|
• |vim.go|: behaves like |:setglobal|
• |vim.bo|: for buffer-scoped options
• |vim.wo|: for window-scoped options
For example:
>lua
vim.o.smarttab = false -- :set nosmarttab
print(vim.o.smarttab)
--> false
vim.o.listchars = 'space:_,tab:>~' -- :set listchars='space:_,tab:>~'
print(vim.o.listchars)
--> 'space:_,tab:>~'
vim.o.isfname = vim.o.isfname .. ',@-@' -- :set isfname+=@-@
print(vim.o.isfname)
--> '@,48-57,/,.,-,_,+,,,#,$,%,~,=,@-@'
vim.bo.shiftwidth = 4 -- :setlocal shiftwidth=4
print(vim.bo.shiftwidth)
--> 4
<
Just like variables, you can specify a buffer number or |window-ID| for buffer
and window options, respectively. If no number is given, the current buffer or
window is used:
>lua
vim.bo[4].expandtab = true -- sets expandtab to true in buffer 4
vim.wo.number = true -- sets number to true in current window
print(vim.wo[0].number) --> true
<
------------------------------------------------------------------------------
See also:
• |lua-options|
==============================================================================
Mappings *lua-guide-mappings*
You can map either Vim commands or Lua functions to key sequences.
------------------------------------------------------------------------------
Creating mappings *lua-guide-mappings-set*
Mappings can be created using |vim.keymap.set()|. This function takes three
mandatory arguments:
• {mode} is a string or a table of strings containing the mode
prefix for which the mapping will take effect. The prefixes are the ones
listed in |:map-modes|, or "!" for |:map!|, or empty string for |:map|.
• {lhs} is a string with the key sequences that should trigger the mapping.
An empty string is equivalent to |<Nop>|, which disables a key.
• {rhs} is either a string with a Vim command or a Lua function that should
be execucted when the {lhs} is entered.
Examples:
>lua
-- Normal mode mapping for Vim command
vim.keymap.set('n', '<Leader>ex1', '<cmd>echo "Example 1"<cr>')
-- Normal and Command-line mode mapping for Vim command
vim.keymap.set({'n', 'c'}, '<Leader>ex2', '<cmd>echo "Example 2"<cr>')
-- Normal mode mapping for Lua function
vim.keymap.set('n', '<Leader>ex3', vim.treesitter.start)
-- Normal mode mapping for Lua function with arguments
vim.keymap.set('n', '<Leader>ex4', function() print('Example 4') end)
<
You can map functions from Lua modules via
>lua
vim.keymap.set('n', '<Leader>pl1', require('plugin').action)
<
Note that this loads the plugin at the time the mapping is defined. If you
want to defer the loading to the time when the mapping is executed (as for
|autoload| functions), wrap it in `function() end`:
>lua
vim.keymap.set('n', '<Leader>pl2', function() require('plugin').action() end)
<
The fourth, optional, argument is a table with keys that modify the behavior
of the mapping such as those from |:map-arguments|. The following are the most
useful options:
• `buffer`: If given, only set the mapping for the buffer with the specified
number; `0` or `true` means the current buffer. >lua
-- set mapping for the current buffer
vim.keymap.set('n', '<Leader>pl1', require('plugin').action, { buffer = true })
-- set mapping for the buffer number 4
vim.keymap.set('n', '<Leader>pl1', require('plugin').action, { buffer = 4 })
<
• `silent`: If set to `true`, suppress output such as error messages. >lua
vim.keymap.set('n', '<Leader>pl1', require('plugin').action, { silent = true })
<
• `expr`: If set to `true`, do not execute the {rhs} but use the return value
as input. Special |keycodes| are converted automatically. For example, the following
mapping replaces <down> with <c-n> in the popupmenu only: >lua
vim.keymap.set('c', '<down>', function()
if vim.fn.pumvisible() == 1 then return '<c-n>' end
return '<down>'
end, { expr = true })
<
• `desc`: A string that is shown when listing mappings with, e.g., |:map|.
This is useful since Lua functions as {rhs} are otherwise only listed as
`Lua: <number> <source file>:<line>`. Plugins should therefore always use this
for mappings they create. >lua
vim.keymap.set('n', '<Leader>pl1', require('plugin').action,
{ desc = 'Execute action from plugin' })
<
• `remap`: By default, all mappings are nonrecursive by default (i.e.,
|vim.keymap.set()| behaves like |:noremap|). If the {rhs} is itself a mapping
that should be executed, set `remap = true`: >lua
vim.keymap.set('n', '<Leader>ex1', '<cmd>echo "Example 1"<cr>')
-- add a shorter mapping
vim.keymap.set('n', 'e', '<Leader>ex1', { remap = true })
<
Note: |<Plug>| mappings are always expanded even with the default `remap = false`: >lua
vim.keymap.set('n', '[%', '<Plug>(MatchitNormalMultiBackward)')
<
------------------------------------------------------------------------------
Removing mappings *lua-guide-mappings-del*
A specific mapping can be removed with |vim.keymap.del()|:
>lua
vim.keymap.del('n', '<Leader>ex1')
vim.keymap.del({'n', 'c'}, '<Leader>ex2', {buffer = true})
<
------------------------------------------------------------------------------
See also:
• `vim.api.`|nvim_get_keymap()|: return all global mapping
• `vim.api.`|nvim_buf_get_keymap()|: return all mappings for buffer
==============================================================================
Autocommands *lua-guide-autocommands*
An |autocommand| is a Vim command or a Lua function that is automatically
executed whenever one or more |events| are triggered, e.g., when a file is
read or written, or when a window is created. These are accessible from Lua
through the Neovim API.
------------------------------------------------------------------------------
Creating autocommands *lua-guide-autocommand-create*
Autocommands are created using `vim.api.`|nvim_create_autocmd()|, which takes
two mandatory arguments:
• {event}: a string or table of strings containing the event(s) which should
trigger the command or function.
• {opts}: a table with keys that control what should happen when the event(s)
are triggered.
The most important options are:
• `pattern`: A string or table of strings containing the |autocmd-pattern|.
Note: Environment variable like `$HOME` and `~` are not automatically
expanded; you need to explicitly use `vim.fn.`|expand()| for this.
• `command`: A string containing a Vim command.
• `callback`: A Lua function.
You must specify one and only one of `command` and `callback`. If `pattern` is
omitted, it defaults to `pattern = '*'`.
Examples:
>lua
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
pattern = {"*.c", "*.h"},
command = "echo 'Entering a C or C++ file'",
})
-- Same autocommand written with a Lua function instead
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
pattern = {"*.c", "*.h"},
callback = function() print("Entering a C or C++ file") end,
})
-- User event triggered by MyPlugin
vim.api.nvim_create_autocmd("User", {
pattern = "MyPlugin",
callback = function() print("My Plugin Works!") end,
})
<
Neovim will always call a Lua function with a single table containing information
about the triggered autocommand. The most useful keys are
• `match`: a string that matched the `pattern` (see |<amatch>|)
• `buf`: the number of the buffer the event was triggered in (see |<abuf>|)
• `file`: the file name of the buffer the event was triggered in (see |<afile>|)
• `data`: a table with other relevant data that is passed for some events
For example, this allows you to set buffer-local mappings for some filetypes:
>lua
vim.api.nvim.create_autocmd("FileType", {
pattern = "lua",
callback = function(args)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, { buffer = args.buf })
end
})
<
This means that if your callback itself takes an (even optional) argument, you
must wrap it in `function() end` to avoid an error:
>lua
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function() vim.highlight.on_yank() end
})
<
(Since unused arguments can be omitted in Lua function definitions, this is
equivalent to `function(args) ... end`.)
Instead of using a pattern, you can create a buffer-local autocommand (see
|autocmd-buflocal|) with `buffer`; in this case, `pattern` cannot be used:
>lua
-- set autocommand for current buffer
vim.api.nvim_create_autocmd("CursorHold", {
buffer = 0,
callback = function() print("hold") end,
})
-- set autocommand for buffer number 33
vim.api.nvim_create_autocmd("CursorHold", {
buffer = 33,
callback = function() print("hold") end,
})
<
Similarly to mappings, you can (and should) add a description using `desc`:
>lua
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function() vim.highlight.on_yank() end,
desc = "Briefly highlight yanked text"
})
<
Finally, you can group autocommands using the `group` key; this will be
covered in detail in the next section.
------------------------------------------------------------------------------
Grouping autocommands *lua-guide-autocommands-group*
Autocommand groups can be used to group related autocommands together; see
|autocmd-groups|. This is useful for organizing autocommands and especially
for preventing autocommands to be set multiple times.
Groups can be created with `vim.api.`|nvim_create_augroup()|. This function
takes two mandatory arguments: a string with the name of a group and a table
determining whether the group should be cleared (i.e., all grouped
autocommands removed) if it already exists. The function returns a number that
is the internal identifier of the group. Groups can be specified either by
this identifier or by the name (but only if the group has been created first).
For example, a common Vimscript pattern for autocommands defined in files that
may be reloaded is
>vim
augroup vimrc
" Remove all vimrc autocommands
autocmd!
au BufNewFile,BufRead *.html set shiftwidth=4
au BufNewFile,BufRead *.html set expandtab
augroup END
<
This is equivalent to the following Lua code:
>lua
local mygroup = vim.api.nvim_create_augroup('vimrc', { clear = true })
vim.api.nvim_create_autocmd( {'BufNewFile', 'BufRead' }, {
pattern = '*.html',
group = mygroup,
cmd = 'set shiftwidth=4',
})
vim.api.nvim_create_autocmd( {'BufNewFile', 'BufRead' }, {
pattern = '*.html',
group = 'vimrc', -- equivalent to group=mygroup
cmd = 'set expandtab',
})
<
Autocommand groups are unique for a given name, so you can reuse them, e.g.,
in a different file:
>lua
local mygroup = vim.api.nvim_create_augroup('vimrc', { clear = false })
vim.api.nvim_create_autocmd( {'BufNewFile', 'BufRead' }, {
pattern = '*.html',
group = mygroup,
cmd = 'set shiftwidth=4',
})
<
------------------------------------------------------------------------------
Deleting autocommands *lua-guide-autocommands-delete*
You can use `vim.api.`|nvim_clear_autocmds()| to remove autocommands. This
function takes a single mandatory argument that is a table of keys describing
the autocommands that are to be removed:
>lua
-- Delete all BufEnter and InsertLeave autocommands
vim.api.nvim_clear_autocmds({event = {"BufEnter", "InsertLeave"}})
-- Delete all autocommands that uses "*.py" pattern
vim.api.nvim_clear_autocmds({pattern = "*.py"})
-- Delete all autocommands in group "scala"
vim.api.nvim_clear_autocmds({group = "scala"})
-- Delete all ColorScheme autocommands in current buffer
vim.api.nvim_clear_autocmds({event = "ColorScheme", buffer = 0 })
<
Note: Autocommands in groups will only be removed if the `group` key is
specified, even if another option matches it.
------------------------------------------------------------------------------
See also
• |nvim_get_autocmds()|: return all matching autocommands
• |nvim_exec_autocmds()|: execute all matching autocommands
==============================================================================
User commands *lua-guide-usercommands*
|user-commands| are custom Vim commands that call a Vimscript or Lua function.
Just like built-in commands, they can have arguments, act on ranges, or have
custom completion of arguments. As these are most useful for plugins, we will
cover only the basics of this advanced topic.
------------------------------------------------------------------------------
Creating user commands *lua-guide-usercommands-create*
User commands can be created through the Neovim API with
`vim.api.`|nvim_create_user_command()|. This function takes three mandatory
arguments:
• a string that is the name of the command (which must start with an uppercase
letter to distinguish it from builtin commands);
• a string containing Vim commands or a Lua function that is executed when the
command is invoked;
• a table with |command-attributes|; in addition, it can contain the keys
`desc` (a string describing the command); `force` (set to `false` to avoid
replacing an already existing command with the same name), and `preview` (a
Lua function that is used for |:command-preview|).
Example:
>lua
vim.api.nvim_create_user_command('Test', 'echo "It works!"', {})
vim.cmd.Test()
--> It works!
<
(Note that the third argument is mandatory even if no attributes are given.)
Lua functions are called with a single table argument containing arguments and
modifiers. The most important are:
• `name`: a string with the command name
• `fargs`: a table containing the command arguments split by whitespace (see |<f-args>|)
• `bang`: `true` if the command was executed with a `!` modifier (see |<bang>|)
• `line1`: the starting line number of the command range (see |<line1>|)
• `line2`: the final line number of the command range (see |<line2>|)
• `range`: the number of items in the command range: 0, 1, or 2 (see |<range>|)
• `count`: any count supplied (see |<count>|)
• `smods`: a table containing the command modifiers (see |<mods>|)
For example:
>lua
vim.api.nvim_create_user_command('Upper',
function(opts)
print(string.upper(opts.fargs[1]))
end,
{ nargs = 1 })
vim.cmd.Upper('foo')
--> FOO
<
The `complete` attribute can take a Lua function in addition to the
attributes listed in |:command-complete|. >lua
vim.api.nvim_create_user_command('Upper',
function(opts)
print(string.upper(opts.fargs[1]))
end,
{ nargs = 1,
complete = function(ArgLead, CmdLine, CursorPos)
-- return completion candidates as a list-like table
return { "foo", "bar", "baz" }
end,
})
<
Buffer-local user commands are created with `vim.api.`|nvim_buf_create_user_command()|.
Here the first argument is the buffer number (`0` being the current buffer);
the remaining arguments are the same as for |nvim_create_user_command()|:
>lua
vim.api.nvim_buf_create_user_command(0, 'Upper',
function(opts)
print(string.upper(opts.fargs[1]))
end,
{ nargs = 1 })
<
------------------------------------------------------------------------------
Deleting user commands *lua-guide-usercommands-delete*
User commands can be deleted with `vim.api.`|nvim_del_user_command()|. The only
argument is the name of the command:
>lua
vim.api.nvim_del_user_command('Upper')
<
To delete buffer-local user commands use `vim.api.`|nvim_buf_del_user_command()|.
Here the first argument is the buffer number (`0` being the current buffer),
and second is command name:
>lua
vim.api.nvim_buf_del_user_command(4, 'Upper')
<
==============================================================================
Credits *lua-guide-credits*
This guide is in large part taken from nanotee's Lua guide:
https://github.com/nanotee/nvim-lua-guide
Thank you @nanotee!
vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl:

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,6 @@ Type |gO| to see the table of contents.
==============================================================================
1 INTRODUCTION *luaref-intro*
==============================================================================
Lua is an extension programming language designed to support general
procedural programming with data description facilities. It also offers good
@ -61,7 +60,7 @@ other words, this section describes which tokens are valid, how they can be
combined, and what their combinations mean.
The language constructs will be explained using the usual extended BNF
notation, in which { `a` } means 0 or more `a`'s, and [ `a` ] means an optional `a`.
notation, in which `{ a }` means 0 or more `a`'s, and `[ a ]` means an optional `a`.
==============================================================================
2.1 Lexical Conventions *luaref-langLexConv*
@ -1504,7 +1503,6 @@ When you run it, it produces the following output:
==============================================================================
3 THE APPLICATION PROGRAM INTERFACE *luaref-API*
==============================================================================
This section describes the C API for Lua, that is, the set of C functions
available to the host program to communicate with Lua. All API functions and
@ -2979,7 +2977,6 @@ lua_setupvalue *lua_setupvalue()*
==============================================================================
4 THE AUXILIARY LIBRARY *luaref-aux*
==============================================================================
The auxiliary library provides several convenient functions to interface C
with Lua. While the basic API provides the primitive functions for all
@ -3511,7 +3508,6 @@ luaL_where *luaL_where()*
==============================================================================
5 STANDARD LIBRARIES *luaref-Lib*
==============================================================================
The standard libraries provide useful functions that are implemented directly
through the C API. Some of these functions provide essential services to the
@ -4064,7 +4060,7 @@ string.gmatch({s}, {pattern}) *string.gmatch()*
end
<
string.gsub({s}, {pattern}, {repl} [, {n}]) *string.gsu{b}()*
string.gsub({s}, {pattern}, {repl} [, {n}]) *string.gsub()*
Returns a copy of {s} in which all occurrences of the {pattern} have
been replaced by a replacement string specified by {repl}, which may
be a string, a table, or a function. `gsub` also returns, as its
@ -4831,12 +4827,11 @@ debug.traceback([{thread},] [{message}] [,{level}]) *debug.traceback()*
==============================================================================
A BIBLIOGRAPHY *luaref-bibliography*
==============================================================================
This help file is a minor adaptation from this main reference:
- R. Ierusalimschy, L. H. de Figueiredo, and W. Celes.,
"Lua: 5.1 reference manual", http://www.lua.org/manual/5.1/manual.html
"Lua: 5.1 reference manual", https://www.lua.org/manual/5.1/manual.html
Lua is discussed in these references:
@ -4857,8 +4852,7 @@ Lua is discussed in these references:
"Proc. of V Brazilian Symposium on Programming Languages" (2001) B-14-B-28.
==============================================================================
B COPYRIGHT & LICENSES *luaref-copyright*
==============================================================================
B COPYRIGHT AND LICENSES *luaref-copyright*
This help file has the same copyright and license as Lua 5.1 and the Lua 5.1
manual:
@ -4875,17 +4869,16 @@ furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================
C LUAREF DOC *luarefvim* *luarefvimdoc* *luaref-help* *luaref-doc*
==============================================================================
This is a Vim help file containing a reference for Lua 5.1, and it is -- with
a few exceptions and adaptations -- a copy of the Lua 5.1 Reference Manual
@ -4894,10 +4887,10 @@ a few exceptions and adaptations -- a copy of the Lua 5.1 Reference Manual
The main ideas and concepts on how to implement this reference were taken from
Christian Habermann's CRefVim project
(http://www.vim.org/scripts/script.php?script_id=614).
(https://www.vim.org/scripts/script.php?script_id=614).
Adapted for bundled Nvim documentation; the original plugin can be found at
http://www.vim.org/scripts/script.php?script_id=1291
https://www.vim.org/scripts/script.php?script_id=1291
------------------------------------------------------------------------------
vi:tw=78:ts=4:ft=help:norl:et

View File

@ -97,7 +97,7 @@ used here to facilitate documenting consistent behavior:
CONTENTS *luv-contents*
This documentation is mostly a retelling of the libuv API documentation
(http://docs.libuv.org/en/v1.x/api.html) within the context of luv's Lua API.
(https://docs.libuv.org/en/v1.x/api.html) within the context of luv's Lua API.
Low-level implementation details and unexposed C functions and types are not
documented here except for when they are relevant to behavior seen in the Lua
module.
@ -933,7 +933,7 @@ uv.async_send({async}, {...}) *uv.async_send()*
Poll handles are used to watch file descriptors for readability and
writability, similar to the purpose of poll(2)
(http://linux.die.net/man/2/poll).
(https://linux.die.net/man/2/poll).
The purpose of poll handles is to enable integrating external libraries that
rely on the event loop to signal it about the socket status changes, like

View File

@ -1,788 +0,0 @@
BEGIN {
# some initialization variables
asciiart="no";
wasset="no";
lineset=0;
sample="no";
while ( getline ti <"tags.ref" > 0 ) {
nf=split(ti,tag," ");
# as help.txt renders into index.html and index.txt -> vimindex.html,
# this hack is needed to get the links right to those pages.
if ( tag[2] == "index.txt" ) {
tag[2] = "vimindex.txt"
} else if ( tag[2] == "help.txt" ) {
tag[2] = "index.txt"
}
tagkey[tag[1]]="yes";tagref[tag[1]]=tag[2];
}
skip_word["and"]="yes";
skip_word["backspace"]="yes";
skip_word["beep"]="yes";
skip_word["bugs"]="yes";
skip_word["da"]="yes";
skip_word["end"]="yes";
skip_word["ftp"]="yes";
skip_word["go"]="yes";
skip_word["help"]="yes";
skip_word["home"]="yes";
skip_word["news"]="yes";
skip_word["index"]="yes";
skip_word["insert"]="yes";
skip_word["into"]="yes";
skip_word["put"]="yes";
skip_word["reference"]="yes";
skip_word["section"]="yes";
skip_word["space"]="yes";
skip_word["starting"]="yes";
skip_word["toggle"]="yes";
skip_word["various"]="yes";
skip_word["version"]="yes";
skip_word["is"]="yes";
}
#
# protect special chars
#
/[><&<26>]/ {gsub(/&/,"\\&amp;");gsub(/>/,"\\&gt;");gsub(/</,"\\&lt;");gsub("<22>","\\&aacute;");}
#
# end of sample lines by non-blank in first column
#
sample == "yes" && substr($0,1,4) == "&lt;" { sample = "no"; gsub(/^&lt;/, " "); }
sample == "yes" && substr($0,1,1) != " " && substr($0,1,1) != " " && length($0) > 0 { sample = "no" }
#
# sample lines printed bold unless empty...
#
sample == "yes" && $0 =="" { print ""; next; }
sample == "yes" && $0 !="" { print "<B>" $0 "</B>"; next; }
#
# start of sample lines in next line
#
$0 == "&gt;" { sample = "yes"; print ""; next; }
substr($0,length($0)-4,5) == " &gt;" { sample = "yes"; gsub(/ &gt;$/, ""); }
#
# header lines printed bold, colored
#
substr($0,length($0),1) == "~" { print "<B><FONT COLOR=\"PURPLE\">" substr($0,1,length($0)-1) "</FONT></B>"; next; }
#
#ad hoc code
#
/^"\|& / {gsub(/\|/,"\\&#124;"); }
/ = b / {gsub(/ b /," \\&#98; "); }
#
# one letter tag
#
/[ ]\*.\*[ ]/ {gsub(/\*/,"ZWWZ"); }
#
# isolated "*"
#
/[ ]\*[ ]/ {gsub(/ \* /," \\&#42; ");
gsub(/ \* /," \\&#42; ");
gsub(/ \* /," \\&#42; ");
gsub(/ \* /," \\&#42; "); }
#
# tag start
#
/[ ]\*[^ ]/ {gsub(/ \*/," ZWWZ");gsub(/ \*/," ZWWZ");}
/^\*[^ ]/ {gsub(/^\*/,"ZWWZ");}
#
# tag end
#
/[^ ]\*$/ {gsub(/\*$/,"ZWWZ");}
/[^ \/ ]\*[ ]/ {gsub(/\*/,"ZWWZ");}
#
# isolated "|"
#
/[ ]\|[ ]/ {gsub(/ \| /," \\&#124; ");
gsub(/ \| /," \\&#124; ");
gsub(/ \| /," \\&#124; ");
gsub(/ \| /," \\&#124; "); }
/'\|'/ { gsub(/'\|'/,"'\\&#124;'"); }
/\^V\|/ {gsub(/\^V\|/,"^V\\&#124;");}
/ \\\| / {gsub(/\|/,"\\&#124;");}
#
# one letter pipes and "||" false pipe (digraphs)
#
/[ ]\|.\|[ ]/ && asciiart == "no" {gsub(/\|/,"YXXY"); }
/^\|.\|[ ]/ {gsub(/\|/,"YXXY"); }
/\|\|/ {gsub(/\|\|/,"\\&#124;\\&#124;"); }
/^shellpipe/ {gsub(/\|/,"\\&#124;"); }
#
# pipe start
#
/[ ]\|[^ ]/ && asciiart == "no" {gsub(/ \|/," YXXY");
gsub(/ \|/," YXXY");}
/^\|[^ ]/ {gsub(/^\|/,"YXXY");}
#
# pipe end
#
/[^ ]\|$/ && asciiart == "no" {gsub(/\|$/,"YXXY");}
/[^ ]\|[s ,.); ]/ && asciiart == "no" {gsub(/\|/,"YXXY");}
/[^ ]\|]/ && asciiart == "no" {gsub(/\|/,"YXXY");}
#
# various
#
/'"/ {gsub(/'"/,"\\&#39;\\&#34;'");}
/"/ {gsub(/"/,"\\&quot;");}
/%/ {gsub(/%/,"\\&#37;");}
NR == 1 { nf=split(FILENAME,f,".")
print "<HTML>";
print "<HEAD>"
if ( FILENAME == "mbyte.txt" ) {
# needs utf-8 as uses many languages
print "<META HTTP-EQUIV=\"Content-type\" content=\"text/html; charset=UTF-8\">";
} else {
# common case - Latin1
print "<META HTTP-EQUIV=\"Content-type\" content=\"text/html; charset=ISO-8859-1\">";
}
print "<TITLE>Nvim documentation: " f[1] "</TITLE>";
print "</HEAD>";
print "<BODY BGCOLOR=\"#ffffff\">";
print "<H1>Nvim documentation: " f[1] "</H1>";
print "<A NAME=\"top\"></A>";
if ( FILENAME != "help.txt" ) {
print "<A HREF=\"index.html\">main help file</A>\n";
}
print "<HR>";
print "<PRE>";
filename=f[1]".html";
}
# set to a low value to test for few lines of text
# NR == 99999 { exit; }
# ignore underlines and tags
substr($0,1,5) == " vim:" { next; }
substr($0,1,4) == "vim:" { next; }
# keep just whole lines of "-", "="
substr($0,1,3) == "===" && substr($0,75,1) != "=" { next; }
substr($0,1,3) == "---" && substr($0,75,1) != "-" { next; }
{
nstar = split($0,s,"ZWWZ");
for ( i=2 ; i <= nstar ; i=i+2 ) {
nbla=split(s[i],blata,"[ ]");
if ( nbla > 1 ) {
gsub("ZWWZ","*");
nstar = split($0,s,"ZWWZ");
}
}
npipe = split($0,p,"YXXY");
for ( i=2 ; i <= npipe ; i=i+2 ) {
nbla=split(p[i],blata,"[ ]");
if ( nbla > 1 ) {
gsub("YXXY","|");
ntabs = split($0,p,"YXXY");
}
}
}
FILENAME == "gui.txt" && asciiart == "no" \
&& $0 ~ /\+----/ && $0 ~ /----\+/ {
asciiart= "yes";
asciicnt=0;
}
FILENAME == "usr_20.txt" && asciiart == "no" \
&& $0 ~ /an empty line at the end:/ {
asciiart= "yes";
asciicnt=0;
}
asciiart == "yes" && $0=="" { asciicnt++; }
asciiart == "yes" && asciicnt == 2 { asciiart = "no"; }
asciiart == "yes" { npipe = 1; }
# { print NR " <=> " asciiart; }
#
# line contains "*"
#
nstar > 2 && npipe < 3 {
printf("\n");
for ( i=1; i <= nstar ; i=i+2 ) {
this=s[i];
put_this();
ii=i+1;
nbla = split(s[ii],blata," ");
if ( ii <= nstar ) {
if ( nbla == 1 && substr(s[ii],length(s[ii]),1) != " " ) {
printf("*<A NAME=\"%s\"></A>",s[ii]);
printf("<B>%s</B>*",s[ii]);
} else {
printf("*%s*",s[ii]);
}
}
}
printf("\n");
next;
}
#
# line contains "|"
#
npipe > 2 && nstar < 3 {
if ( npipe%2 == 0 ) {
for ( i=1; i < npipe ; i++ ) {
gsub("ZWWZ","*",p[i]);
printf("%s|",p[i]);
}
printf("%s\n",p[npipe]);
next;
}
for ( i=1; i <= npipe ; i++ )
{
if ( i % 2 == 1 ) {
gsub("ZWWZ","*",p[i]);
this=p[i];
put_this();
}
else {
nfn=split(p[i],f,".");
if ( nfn == 1 || f[2] == "" || f[1] == "" || length(f[2]) < 3 ) {
find_tag1();
}
else {
if ( f[1] == "index" ) {
printf "|<A HREF=\"vimindex.html\">" p[i] "</A>|";
} else {
if ( f[1] == "help" ) {
printf "|<A HREF=\"index.html\">" p[i] "</A>|";
} else {
printf "|<A HREF=\"" f[1] ".html\">" p[i] "</A>|";
}
}
}
}
}
printf("\n");
next;
}
#
# line contains both "|" and "*"
#
npipe > 2 && nstar > 2 {
printf("\n");
for ( j=1; j <= nstar ; j=j+2 ) {
npipe = split(s[j],p,"YXXY");
if ( npipe > 1 ) {
for ( np=1; np<=npipe; np=np+2 ) {
this=p[np];
put_this();
i=np+1;find_tag1();
}
} else {
this=s[j];
put_this();
}
jj=j+1;
nbla = split(s[jj],blata," ");
if ( jj <= nstar && nbla == 1 && s[jj] != "" ) {
printf("*<A NAME=\"%s\"></A>",s[jj]);
printf("<B>%s</B>*",s[jj]);
} else {
if ( s[jj] != "" ) {
printf("*%s*",s[jj]);
}
}
}
printf("\n");
next;
}
#
# line contains e-mail address john.doe@some.place.edu
#
$0 ~ /@/ && $0 ~ /[a-zA-Z0-9]@[a-z]/ \
{
nemail=split($0,em," ");
if ( substr($0,1,1) == " " ) { printf(" "); }
for ( i=1; i <= nemail; i++ ) {
if ( em[i] ~ /@/ ) {
if ( substr(em[i],2,3) == "lt;" && substr(em[i],length(em[i])-2,3) == "gt;" ) {
mailaddr=substr(em[i],5,length(em[i])-8);
printf("<A HREF=\"mailto:%s\">&lt;%s&gt;</A> ",mailaddr,mailaddr);
} else {
if ( substr(em[i],2,3) == "lt;" && substr(em[i],length(em[i])-3,3) == "gt;" ) {
mailaddr=substr(em[i],5,length(em[i])-9);
printf("<A HREF=\"mailto:%s\">&lt;%s&gt;</A>%s ",mailaddr,mailaddr,substr(em[i],length(em[i]),1));
} else {
printf("<A HREF=\"mailto:%s\">%s</A> ",em[i],em[i]);
}
}
} else {
printf("%s ",em[i]);
}
}
#print "*** " NR " " FILENAME " - possible mail ref";
printf("\n");
next;
}
#
# line contains http / ftp reference
#
$0 ~ /http:\/\// || $0 ~ /ftp:\/\// {
gsub("URL:","");
gsub("&lt;","");
gsub("&gt;","");
gsub("\\(","");
gsub("\\)","");
nemail=split($0,em," ");
for ( i=1; i <= nemail; i++ ) {
if ( substr(em[i],1,5) == "http:" ||
substr(em[i],1,4) == "ftp:" ) {
if ( substr(em[i],length(em[i]),1) != "." ) {
printf(" <A HREF=\"%s\">%s</A>",em[i],em[i]);
} else {
em[i]=substr(em[i],1,length(em[i])-1);
printf(" <A HREF=\"%s\">%s</A>.",em[i],em[i]);
}
} else {
printf(" %s",em[i]);
}
}
#print "*** " NR " " FILENAME " - possible http ref";
printf("\n");
next;
}
#
# some lines contains just one "almost regular" "*"...
#
nstar == 2 {
this=s[1];
put_this();
printf("*");
this=s[2];
put_this();
printf("\n");
next;
}
#
# regular line
#
{ ntabs = split($0,tb," ");
for ( i=1; i < ntabs ; i++) {
this=tb[i];
put_this();
printf(" ");
}
this=tb[ntabs];
put_this();
printf("\n");
}
asciiart == "yes" && $0 ~ /\+-\+--/ \
&& $0 ~ "scrollbar" { asciiart = "no"; }
END {
topback();
print "</PRE>\n</BODY>\n\n\n</HTML>"; }
#
# as main we keep index.txt (by default)
#
function topback () {
if ( FILENAME != "tags" ) {
if ( FILENAME != "help.txt" ) {
printf("<A HREF=\"#top\">top</A> - ");
printf("<A HREF=\"index.html\">main help file</A>\n");
} else {
printf("<A HREF=\"#top\">top</A>\n");
}
}
}
function find_tag1() {
if ( p[i] == "" ) { return; }
if ( tagkey[p[i]] == "yes" ) {
which=tagref[p[i]];
put_href();
return;
}
# if not found, then we have a problem
print "============================================" >>"errors.log";
print FILENAME ", line " NR ", pointer: >>" p[i] "<<" >>"errors.log";
print $0 >>"errors.log";
which="intro.html";
put_href();
}
function see_tag() {
# ad-hoc code:
if ( atag == "\"--" || atag == "--\"" ) { return; }
if_already();
if ( already == "yes" ) {
printf("%s",aword);
return;
}
allow_one_char="no";
find_tag2();
if ( done == "yes" ) { return; }
rightchar=substr(atag,length(atag),1);
if ( rightchar == "." \
|| rightchar == "," \
|| rightchar == ":" \
|| rightchar == ";" \
|| rightchar == "!" \
|| rightchar == "?" \
|| rightchar == ")" ) {
atag=substr(atag,1,length(atag)-1);
if_already();
if ( already == "yes" ) {
printf("%s",aword);
return;
}
find_tag2();
if ( done == "yes" ) { printf("%s",rightchar);return; }
leftchar=substr(atag,1,1);
lastbut1=substr(atag,length(atag),1);
if ( leftchar == "'" && lastbut1 == "'" ) {
allow_one_char="yes";
atag=substr(atag,2,length(atag)-2);
if_already();
if ( already == "yes" ) {
printf("%s",aword);
return;
}
printf("%s",leftchar);
aword=substr(atag,1,length(atag))""lastbut1""rightchar;
find_tag2();
if ( done == "yes" ) { printf("%s%s",lastbut1,rightchar);return; }
}
}
atag=aword;
leftchar=substr(atag,1,1);
if ( leftchar == "'" && rightchar == "'" ) {
allow_one_char="yes";
atag=substr(atag,2,length(atag)-2);
if ( atag == "<" ) { printf(" |%s|%s| ",atag,p[2]); }
if_already();
if ( already == "yes" ) {
printf("%s",aword);
return;
}
printf("%s",leftchar);
find_tag2();
if ( done == "yes" ) { printf("%s",rightchar);return; }
printf("%s%s",atag,rightchar);
return;
}
last2=substr(atag,length(atag)-1,2);
first2=substr(atag,1,2);
if ( first2 == "('" && last2 == "')" ) {
allow_one_char="yes";
atag=substr(atag,3,length(atag)-4);
if_already();
if ( already == "yes" ) {
printf("%s",aword);
return;
}
printf("%s",first2);
find_tag2();
if ( done == "yes" ) { printf("%s",last2);return; }
printf("%s%s",atag,last2);
return;
}
if ( last2 == ".)" ) {
atag=substr(atag,1,length(atag)-2);
if_already();
if ( already == "yes" ) {
printf("%s",aword);
return;
}
find_tag2();
if ( done == "yes" ) { printf("%s",last2);return; }
printf("%s%s",atag,last2);
return;
}
if ( last2 == ")." ) {
atag=substr(atag,1,length(atag)-2);
find_tag2();
if_already();
if ( already == "yes" ) {
printf("%s",aword);
return;
}
if ( done == "yes" ) { printf("%s",last2);return; }
printf("%s%s",atag,last2);
return;
}
first6=substr(atag,1,6);
last6=substr(atag,length(atag)-5,6);
if ( last6 == atag ) {
printf("%s",aword);
return;
}
last6of7=substr(atag,length(atag)-6,6);
if ( first6 == "&quot;" && last6of7 == "&quot;" && length(atag) > 12 ) {
allow_one_char="yes";
atag=substr(atag,7,length(atag)-13);
if_already();
if ( already == "yes" ) {
printf("%s",aword);
return;
}
printf("%s",first6);
find_tag2();
if ( done == "yes" ) { printf("&quot;%s",rightchar); return; }
printf("%s&quot;%s",atag,rightchar);
return;
}
if ( first6 == "&quot;" && last6 != "&quot;" ) {
allow_one_char="yes";
atag=substr(atag,7,length(atag)-6);
if ( atag == "[" ) { printf("&quot;%s",atag); return; }
if ( atag == "." ) { printf("&quot;%s",atag); return; }
if ( atag == ":" ) { printf("&quot;%s",atag); return; }
if ( atag == "a" ) { printf("&quot;%s",atag); return; }
if ( atag == "A" ) { printf("&quot;%s",atag); return; }
if ( atag == "g" ) { printf("&quot;%s",atag); return; }
if_already();
if ( already == "yes" ) {
printf("&quot;%s",atag);
return;
}
printf("%s",first6);
find_tag2();
if ( done == "yes" ) { return; }
printf("%s",atag);
return;
}
if ( last6 == "&quot;" && first6 == "&quot;" ) {
allow_one_char="yes";
atag=substr(atag,7,length(atag)-12);
if_already();
if ( already == "yes" ) {
printf("%s",aword);
return;
}
printf("%s",first6);
find_tag2();
if ( done == "yes" ) { printf("%s",last6);return; }
printf("%s%s",atag,last6);
return;
}
last6of7=substr(atag,length(atag)-6,6);
if ( last6of7 == "&quot;" && first6 == "&quot;" ) {
allow_one_char="yes";
atag=substr(atag,7,length(atag)-13);
#printf("\natag=%s,aword=%s\n",atag,aword);
if_already();
if ( already == "yes" ) {
printf("%s",aword);
return;
}
printf("%s",first6);
find_tag2();
if ( done == "yes" ) { printf("%s%s",last6of7,rightchar);return; }
printf("%s%s%s",atag,last6of7,rightchar);
return;
}
printf("%s",aword);
}
function find_tag2() {
done="no";
# no blanks present in a tag...
ntags=split(atag,blata,"[ ]");
if ( ntags > 1 ) { return; }
if ( ( allow_one_char == "no" ) && \
( index("!#$%&'()+,-./0:;=?@ACINX\\[\\]^_`at\\{\\}~",atag) !=0 ) ) {
return;
}
if ( skip_word[atag] == "yes" ) { return; }
if ( wasset == "yes" && lineset == NR ) {
wasset="no";
see_opt();
if ( done_opt == "yes" ) {return;}
}
if ( wasset == "yes" && lineset != NR ) {
wasset="no";
}
if ( atag == ":set" ) {
wasset="yes";
lineset=NR;
}
if ( tagkey[atag] == "yes" ) {
which=tagref[atag];
put_href2();
done="yes";
}
}
function find_tag3() {
done="no";
# no blanks present in a tag...
ntags=split(btag,blata,"[ ]");
if ( ntags > 1 ) { return; }
if ( ( allow_one_char == "no" ) && \
( index("!#$%&'()+,-./0:;=?@ACINX\\[\\]^_`at\\{\\}~",btag) !=0 ) ) {
return;
}
if ( skip_word[btag] == "yes" ) { return; }
if ( tagkey[btag] == "yes" ) {
which=tagref[btag];
put_href3();
done="yes";
}
}
function put_href() {
if ( p[i] == "" ) { return; }
if ( which == FILENAME ) {
printf("|<A HREF=\"#%s\">%s</A>|",p[i],p[i]);
}
else {
nz=split(which,zz,".");
if ( zz[2] == "txt" || zz[1] == "tags" ) {
printf("|<A HREF=\"%s.html#%s\">%s</A>|",zz[1],p[i],p[i]);
}
else {
printf("|<A HREF=\"intro.html#%s\">%s</A>|",p[i],p[i]);
}
}
}
function put_href2() {
if ( atag == "" ) { return; }
if ( which == FILENAME ) {
printf("<A HREF=\"#%s\">%s</A>",atag,atag);
}
else {
nz=split(which,zz,".");
if ( zz[2] == "txt" || zz[1] == "tags" ) {
printf("<A HREF=\"%s.html#%s\">%s</A>",zz[1],atag,atag);
}
else {
printf("<A HREF=\"intro.html#%s\">%s</A>",atag,atag);
}
}
}
function put_href3() {
if ( btag == "" ) { return; }
if ( which == FILENAME ) {
printf("<A HREF=\"#%s\">%s</A>",btag,btag2);
}
else {
nz=split(which,zz,".");
if ( zz[2] == "txt" || zz[1] == "tags" ) {
printf("<A HREF=\"%s.html#%s\">%s</A>",zz[1],btag,btag2);
}
else {
printf("<A HREF=\"intro.html#%s\">%s</A>",btag,btag2);
}
}
}
function put_this() {
ntab=split(this,ta," ");
for ( nta=1 ; nta <= ntab ; nta++ ) {
ata=ta[nta];
lata=length(ata);
aword="";
for ( iata=1 ; iata <=lata ; iata++ ) {
achar=substr(ata,iata,1);
if ( achar != " " ) { aword=aword""achar; }
else {
if ( aword != "" ) { atag=aword;
see_tag();
aword="";
printf(" "); }
else {
printf(" ");
}
}
}
if ( aword != "" ) { atag=aword;
see_tag();
}
if ( nta != ntab ) { printf(" "); }
}
}
function if_already() {
already="no";
if ( npipe < 2 ) { return; }
if ( atag == ":au" && p[2] == ":autocmd" ) { already="yes";return; }
for ( npp=2 ; npp <= npipe ; npp=npp+2 ) {
if ( ( (index(p[npp],atag)) != 0 \
&& length(p[npp]) > length(atag) \
&& length(atag) >= 1 \
) \
|| (p[npp] == atag) \
) {
# printf("p=|%s|,tag=|%s| ",p[npp],atag);
already="yes"; return; }
}
}
function see_opt() {
done_opt="no";
stag=atag;
nfields = split(atag,tae,"=");
if ( nfields > 1 ) {
btag="'"tae[1]"'";
btag2=tae[1];
find_tag3();
if (done == "yes") {
for ( ntae=2 ; ntae <= nfields ; ntae++ ) {
printf("=%s",tae[ntae]);
}
atag=stag;
done_opt="yes";
return;
}
btag=tae[1];
btag2=tae[1];
find_tag3();
if ( done=="yes" ) {
for ( ntae=2 ; ntae <= nfields ; ntae++ ) {
printf("=%s",tae[ntae]);
}
atag=stag;
done_opt="yes";
return;
}
}
nfields = split(atag,tae,"&quot;");
if ( nfields > 1 ) {
btag="'"tae[1]"'";
btag2=tae[1];
find_tag3();
if (done == "yes") {
printf("&quot;");
atag=stag;
done_opt="yes";
return;
}
btag=tae[1];
btag2=tae[1];
find_tag3();
if (done == "yes") {
printf("&quot;");
atag=stag;
done_opt="yes";
return;
}
}
btag="'"tae[1]"'";
btag2=tae[1];
find_tag3();
if (done == "yes") {
atag=stag;
done_opt="yes";
return;
}
btag=tae[1];
btag2=tae[1];
find_tag3();
if (done == "yes") {
atag=stag;
done_opt="yes";
return;
}
atag=stag;
}

View File

@ -1,42 +0,0 @@
BEGIN { FS=" "; }
NR == 1 { nf=split(FILENAME,f,".")
print "<HTML>";
print "<HEAD><TITLE>" f[1] "</TITLE></HEAD>";
print "<BODY BGCOLOR=\"#ffffff\">";
print "<H1>Vim Documentation: " f[1] "</H1>";
print "<A NAME=\"top\"></A>";
print "<HR>";
print "<PRE>";
}
{
#
# protect special chars
#
gsub(/&/,"\\&amp;");
gsub(/>/,"\\&gt;");
gsub(/</,"\\&lt;");
gsub(/"/,"\\&quot;");
gsub(/%/,"\\&#37;");
nf=split($0,tag," ");
tagkey[t]=tag[1];tagref[t]=tag[2];tagnum[t]=NR;
print $1 " " $2 " line " NR >"tags.ref"
n=split($2,w,".");
printf ("|<A HREF=\"%s.html#%s\">%s</A>| %s\n",w[1],$1,$1,$2);
}
END {
topback();
print "</PRE>\n</BODY>\n\n\n</HTML>";
}
#
# as main we keep index.txt (by default)
# other candidate, help.txt
#
function topback () {
printf("<A HREF=\"#top\">top</A> - ");
printf("<A HREF=\"help.html\">back to help</A>\n");
}

View File

@ -334,41 +334,14 @@ Vim will automatically convert from one to another encoding in several places:
"utf-8" (requires a gettext version that supports this).
- When reading a Vim script where |:scriptencoding| is different from
"utf-8".
Most of these require the |+iconv| feature. Conversion for reading and
writing files may also be specified with the 'charconvert' option.
Most of these require iconv. Conversion for reading and writing files may
also be specified with the 'charconvert' option.
Useful utilities for converting the charset:
All: iconv
GNU iconv can convert most encodings. Unicode is used as the
intermediate encoding, which allows conversion from and to all other
encodings. See http://www.gnu.org/directory/libiconv.html.
Japanese: nkf
Nkf is "Network Kanji code conversion Filter". One of the most unique
facility of nkf is the guess of the input Kanji code. So, you don't
need to know what the inputting file's |charset| is. When convert to
EUC-JP from ISO-2022-JP or Shift_JIS, simply do the following command
in Vim:
:%!nkf -e
Nkf can be found at:
http://www.sfc.wide.ad.jp/~max/FreeBSD/ports/distfiles/nkf-1.62.tar.gz
Chinese: hc
Hc is "Hanzi Converter". Hc convert a GB file to a Big5 file, or Big5
file to GB file. Hc can be found at:
ftp://ftp.cuhk.hk/pub/chinese/ifcss/software/unix/convert/hc-30.tar.gz
Korean: hmconv
Hmconv is Korean code conversion utility especially for E-mail. It can
convert between EUC-KR and ISO-2022-KR. Hmconv can be found at:
ftp://ftp.kaist.ac.kr/pub/hangul/code/hmconv/
Multilingual: lv
Lv is a Powerful Multilingual File Viewer. And it can be worked as
|charset| converter. Supported |charset|: ISO-2022-CN, ISO-2022-JP,
ISO-2022-KR, EUC-CN, EUC-JP, EUC-KR, EUC-TW, UTF-7, UTF-8, ISO-8859
series, Shift_JIS, Big5 and HZ. Lv can be found at:
http://www.ff.iij4u.or.jp/~nrt/lv/index.html
encodings. See https://directory.fsf.org/wiki/Libiconv.
*mbyte-conversion*
@ -404,17 +377,6 @@ is suitable for complex input, such as CJK.
large overhead in communication, but it provides safe synchronization with
no restrictions on applications.
For example, there are xwnmo and kinput2 Japanese |IM-server|, both are
FrontEnd system. Xwnmo is distributed with Wnn (see below), kinput2 can be
found at: ftp://ftp.sra.co.jp/pub/x11/kinput2/
For Chinese, there's a great XIM server named "xcin", you can input both
Traditional and Simplified Chinese characters. And it can accept other
locale if you make a correct input table. Xcin can be found at:
http://cle.linux.org.tw/xcin/
Others are scim: http://scim.freedesktop.org/ and fcitx:
http://www.fcitx.org/
- Conversion Server
*conversion-server*
Some system needs additional server: conversion server. Most of Japanese

View File

@ -573,9 +573,7 @@ when using ":w"), therefore Vim requires using a ! after the command, e.g.:
VirtualBinding
Messages like this appear when starting up. This is not a Vim problem, your
X11 configuration is wrong. You can find a hint on how to solve this here:
http://groups.yahoo.com/group/solarisonintel/message/12179.
[this URL is no longer valid]
X11 configuration is wrong.
*W10* >
Warning: Changing a readonly file

View File

@ -92,27 +92,10 @@ use of "-" and "_".
:lang mes en
<
MS-WINDOWS MESSAGE TRANSLATIONS *win32-gettext*
If you used the self-installing .exe file, message translations should work
already. Otherwise get the libintl.dll file if you don't have it yet:
http://sourceforge.net/projects/gettext
Or:
https://mlocati.github.io/gettext-iconv-windows/
This also contains tools xgettext, msgformat and others.
libintl.dll should be placed in same directory as (g)vim.exe, or one of the
directories listed in the PATH environment value. Vim also looks for the
alternate names "libintl-8.dll" and "intl.dll".
Message files (vim.mo) have to be placed in "$VIMRUNTIME/lang/xx/LC_MESSAGES",
where "xx" is the abbreviation of the language (mostly two letters).
If you write your own translations you need to generate the .po file and
convert it to a .mo file. You need to get the source distribution and read
the file "src/po/README.txt".
where "xx" is the abbreviation of the language (mostly two letters). If you
write your own translations you need to generate the .po file and convert it
to a .mo file.
To overrule the automatic choice of the language, set the $LANG variable to
the language of your choice. use "en" to disable translations. >

View File

@ -309,7 +309,7 @@ g<Down> [count] display lines downward. |exclusive| motion.
an operator, because it's not linewise.
*-*
- <minus> [count] lines upward, on the first non-blank
`-` <minus> [count] lines upward, on the first non-blank
character |linewise|.
+ or *+*

View File

@ -1,10 +1,10 @@
*nvim.txt* Nvim
NVIM REFERENCE MANUAL
NVIM REFERENCE MANUAL
Nvim *nvim* *nvim-intro*
Nvim *nvim* *nvim-intro*
Nvim is based on Vim by Bram Moolenaar.
@ -14,13 +14,13 @@ If you are new to Vim, try the 30-minute tutorial: >
:Tutor<Enter>
Nvim is emphatically a fork of Vim, not a clone: compatibility with Vim
(especially editor and VimL features) is maintained where possible. See
(especially editor and Vimscript features) is maintained where possible. See
|vim-differences| for the complete reference of differences from Vim.
Type |gO| to see the table of contents.
Type |gO| to see the table of contents.
==============================================================================
Transitioning from Vim *nvim-from-vim*
Transitioning from Vim *nvim-from-vim*
1. To start the transition, create your |init.vim| (user config) file: >
@ -38,32 +38,37 @@ Transitioning from Vim *nvim-from-vim*
See |provider-python| and |provider-clipboard| for additional software you
might need to use some features.
Your Vim configuration might not be entirely Nvim-compatible.
See |vim-differences| for the full list of changes.
The |'ttymouse'| option, for example, was removed from Nvim (mouse support
should work without it). If you use the same |vimrc| for Vim and Nvim,
consider guarding |'ttymouse'| in your configuration like so:
Your Vim configuration might not be entirely Nvim-compatible (see
|vim-differences|). For example the |'ttymouse'| option was removed from Nvim,
because mouse support is always enabled if possible. If you use the same
|vimrc| for Vim and Nvim you could guard |'ttymouse'| in your configuration
like so:
>
if !has('nvim')
set ttymouse=xterm2
endif
<
Conversely, if you have Nvim specific configuration items, you could do
this:
And for Nvim-specific configuration, you can do this:
>
if has('nvim')
tnoremap <Esc> <C-\><C-n>
endif
<
For a more granular approach use |exists()|:
>
if exists(':tnoremap')
tnoremap <Esc> <C-\><C-n>
endif
<
Now you should be able to explore Nvim more comfortably. Check |nvim-features|
for more information.
*portable-config*
Because Nvim follows the XDG |base-directories| standard, configuration on
Windows is stored in ~/AppData instead of ~/.config. But you can still share
the same Nvim configuration on all of your machines, by creating
~/AppData/Local/nvim/init.vim containing just this line: >
source ~/.config/nvim/init.vim
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:
vim:tw=78:ts=8:et:ft=help:norl:

View File

@ -621,7 +621,7 @@ A jump table for the options with a short description can be found at |Q_op|.
by Vim with the width of glyphs in the font. Perhaps it also has
to be set to "double" under CJK MS-Windows when the system locale is
set to one of CJK locales. See Unicode Standard Annex #11
(http://www.unicode.org/reports/tr11).
(https://www.unicode.org/reports/tr11).
*'autochdir'* *'acd'* *'noautochdir'* *'noacd'*
'autochdir' 'acd' boolean (default off)
@ -3918,9 +3918,9 @@ A jump table for the options with a short description can be found at |Q_op|.
`:lgrepadd`, `:cfile`, `:cgetfile`, `:caddfile`, `:lfile`, `:lgetfile`,
and `:laddfile`.
This would be mostly useful when you use MS-Windows. If |+iconv| is
enabled and GNU libiconv is used, setting 'makeencoding' to "char" has
the same effect as setting to the system locale encoding. Example: >
This would be mostly useful when you use MS-Windows. If iconv is
enabled, setting 'makeencoding' to "char" has the same effect as
setting to the system locale encoding. Example: >
:set makeencoding=char " system locale is used
<
*'makeprg'* *'mp'*
@ -4571,7 +4571,7 @@ A jump table for the options with a short description can be found at |Q_op|.
< - A directory name may end in a ':' or '/'.
- Environment variables are expanded |:set_env|.
- When using |netrw.vim| URLs can be used. For example, adding
"http://www.vim.org" will make ":find index.html" work.
"https://www.vim.org" will make ":find index.html" work.
- Search upwards and downwards in a directory tree using "*", "**" and
";". See |file-searching| for info and syntax.
- Careful with '\' characters, type two to get one in the option: >
@ -4946,10 +4946,13 @@ A jump table for the options with a short description can be found at |Q_op|.
indent/ indent scripts |indent-expression|
keymap/ key mapping files |mbyte-keymap|
lang/ menu translations |:menutrans|
lua/ |Lua| plugins
menu.vim GUI menus |menu.vim|
pack/ packages |:packadd|
parser/ |treesitter| syntax parsers
plugin/ plugin scripts |write-plugin|
print/ files for printing |postscript-print-encoding|
query/ |treesitter| queries
rplugin/ |remote-plugin| scripts
spell/ spell checking files |spell|
syntax/ syntax files |mysyntaxfile|
@ -4970,20 +4973,20 @@ A jump table for the options with a short description can be found at |Q_op|.
but are not part of the Nvim distribution. XDG_DATA_DIRS defaults
to /usr/local/share/:/usr/share/, so system administrators are
expected to install site plugins to /usr/share/nvim/site.
5. Applications state home directory, for files that contain your
session state (eg. backupdir, viewdir, undodir, etc).
5. Session state directory, for state data such as swap, backupdir,
viewdir, undodir, etc.
Given by `stdpath("state")`. |$XDG_STATE_HOME|
6. $VIMRUNTIME, for files distributed with Neovim.
6. $VIMRUNTIME, for files distributed with Nvim.
*after-directory*
7, 8, 9, 10. In after/ subdirectories of 1, 2, 3 and 4, with reverse
ordering. This is for preferences to overrule or add to the
ordering. This is for preferences to overrule or add to the
distributed defaults or system-wide settings (rarely needed).
*rtp-packages*
"start" packages will additionally be used to search for runtime files
after these, but package entries are not visible in `:set rtp`.
See |runtime-search-path| for more information. "opt" packages
will be explicitly added to &rtp when |:packadd| is used.
*packages-runtimepath*
"start" packages will also be searched (|runtime-search-path|) for
runtime files after these, though such packages are not explicitly
reported in &runtimepath. But "opt" packages are explicitly added to
&runtimepath by |:packadd|.
Note that, unlike 'path', no wildcards like "**" are allowed. Normal
wildcards are allowed, but can significantly slow down searching for
@ -4993,18 +4996,13 @@ A jump table for the options with a short description can be found at |Q_op|.
Example: >
:set runtimepath=~/vimruntime,/mygroup/vim,$VIMRUNTIME
< This will use the directory "~/vimruntime" first (containing your
personal Vim runtime files), then "/mygroup/vim" (shared between a
group of people) and finally "$VIMRUNTIME" (the distributed runtime
files).
You probably should always include $VIMRUNTIME somewhere, to use the
distributed runtime files. You can put a directory before $VIMRUNTIME
to find files which replace a distributed runtime files. You can put
a directory after $VIMRUNTIME to find files which add to distributed
runtime files.
When Vim is started with |--clean| the home directory entries are not
included.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
personal Nvim runtime files), then "/mygroup/vim", and finally
"$VIMRUNTIME" (the default runtime files).
You can put a directory before $VIMRUNTIME to find files which replace
distributed runtime files. You can put a directory after $VIMRUNTIME
to find files which add to distributed runtime files.
With |--clean| the home directory entries are not included.
*'scroll'* *'scr'*
'scroll' 'scr' number (default: half the window height)
@ -5357,7 +5355,7 @@ A jump table for the options with a short description can be found at |Q_op|.
To use PowerShell: >
let &shell = executable('pwsh') ? 'pwsh' : 'powershell'
let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
let &shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait'
let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
set shellquote= shellxquote=
@ -6777,28 +6775,31 @@ A jump table for the options with a short description can be found at |Q_op|.
*'verbose'* *'vbs'*
'verbose' 'vbs' number (default 0)
global
When bigger than zero, Vim will give messages about what it is doing.
Currently, these messages are given:
>= 1 Lua assignments to options, mappings, etc.
>= 2 When a file is ":source"'ed and when the shada file is read or written..
>= 3 UI info, terminal capabilities
>= 4 Shell commands.
>= 5 Every searched tags file and include file.
>= 8 Files for which a group of autocommands is executed.
>= 9 Every executed autocommand.
>= 11 Finding items in a path
>= 12 Every executed function.
>= 13 When an exception is thrown, caught, finished, or discarded.
>= 14 Anything pending in a ":finally" clause.
>= 15 Every executed Ex command from a script (truncated at 200
characters).
>= 16 Every executed Ex command.
Sets the verbosity level. Also set by |-V| and |:verbose|.
This option can also be set with the "-V" argument. See |-V|.
This option is also set by the |:verbose| command.
Tracing of options in Lua scripts is activated at level 1; Lua scripts
are not traced with verbose=0, for performance.
When the 'verbosefile' option is set then the verbose messages are not
displayed.
If greater than or equal to a given level, Nvim produces the following
messages:
Level Messages ~
----------------------------------------------------------------------
1 Lua assignments to options, mappings, etc.
2 When a file is ":source"'ed, or |shada| file is read or written.
3 UI info, terminal capabilities.
4 Shell commands.
5 Every searched tags file and include file.
8 Files for which a group of autocommands is executed.
9 Executed autocommands.
11 Finding items in a path.
12 Vimscript function calls.
13 When an exception is thrown, caught, finished, or discarded.
14 Anything pending in a ":finally" clause.
15 Ex commands from a script (truncated at 200 characters).
16 Ex commands.
If 'verbosefile' is set then the verbose messages are not displayed.
*'verbosefile'* *'vfile'*
'verbosefile' 'vfile' string (default empty)

View File

@ -63,16 +63,16 @@ msgpack#is_uint({msgpack-value}) *msgpack#is_uint()*
*msgpack#strftime*
msgpack#strftime({format}, {msgpack-integer}) *msgpack#strftime()*
Same as |strftime()|, but second argument may be
|msgpack-special-dict|. Requires |+python| or |+python3| to really
work with |msgpack-special-dict|s.
|msgpack-special-dict|. Requires |Python| to really work with
|msgpack-special-dict|s.
*msgpack#strptime*
msgpack#strptime({format}, {time}) *msgpack#strptime()*
Reverse of |msgpack#strftime()|: for any time and format
|msgpack#equal|( |msgpack#strptime|(format, |msgpack#strftime|(format,
time)), time) be true. Requires |+python| or |+python3|, without it
only supports non-|msgpack-special-dict| nonnegative times and format
equal to `%Y-%m-%dT%H:%M:%S`.
time)), time) be true. Requires ||Python|, without it only supports
non-|msgpack-special-dict| nonnegative times and format equal to
`%Y-%m-%dT%H:%M:%S`.
msgpack#int_dict_to_str({msgpack-special-int}) *msgpack#int_dict_to_str()*
Function which converts |msgpack-special-dict| integer value to

View File

@ -2782,7 +2782,7 @@ your browsing preferences. (see also: |netrw-settings|)
history are saved (as .netrwbook and
.netrwhist).
Netrw uses |expand()| on the string.
default: stdpath('data') (see |stdpath()|)
default: stdpath("data") (see |stdpath()|)
*g:netrw_keepdir* =1 (default) keep current directory immune from
the browsing directory.

View File

@ -413,7 +413,7 @@ you need to define your own PostScript font encoding vector. Details on how
to define a font encoding vector is beyond the scope of this help file, but
you can find details in the PostScript Language Reference Manual, 3rd Edition,
published by Addison-Wesley and available in PDF form at
http://www.adobe.com/. The following describes what you need to do for Vim to
https://www.adobe.com/. The following describes what you need to do for Vim to
locate and use your print character encoding.
i. Decide on a unique name for your encoding vector, one that does not clash
@ -462,15 +462,6 @@ option allows you to specify different fonts to use when printing characters
which are syntax highlighted with the font styles normal, italic, bold and
bold-italic.
No CJK fonts are supplied with Vim. There are some free Korean, Japanese, and
Traditional Chinese fonts available at:
http://examples.oreilly.com/cjkvinfo/adobe/samples/
You can find descriptions of the various fonts in the read me file at
http://examples.oreilly.de/english_examples/cjkvinfo/adobe/00README
Please read your printer documentation on how to install new fonts.
CJK fonts can be large containing several thousand glyphs, and it is not
@ -491,7 +482,7 @@ It is possible to define your own multibyte character set although this
should not be attempted lightly. A discussion on the process if beyond the
scope of these help files. You can find details on CMap (character map) files
in the document 'Adobe CMap and CIDFont Files Specification, Version 1.0',
available from http://www.adobe.com as a PDF file.
available from https://www.adobe.com as a PDF file.
==============================================================================
6. PostScript Printing Troubleshooting *postscript-print-trouble*
@ -548,23 +539,8 @@ Ghostscript is a PostScript and PDF interpreter that can be used to display
and print on non-PostScript printers PostScript and PDF files. It can also
generate PDF files from PostScript.
Ghostscript will run on a wide variety of platforms.
There are three available versions:
- AFPL Ghostscript (formerly Aladdin Ghostscript) which is free for
non-commercial use. It can be obtained from:
http://www.cs.wisc.edu/~ghost/
- GNU Ghostscript which is available under the GNU General Public License. It
can be obtained from:
ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/gnu/
- A commercial version for inclusion in commercial products.
Additional information on Ghostscript can also be found at:
Ghostscript will run on a wide variety of platforms. Information on
Ghostscript can be found at:
http://www.ghostscript.com/
@ -580,79 +556,6 @@ ends have been created. These allow easier PostScript file selection,
previewing at different zoom levels, and printing. Check supplied
documentation for full details.
X11
- Ghostview. Obtainable from:
http://www.cs.wisc.edu/~ghost/gv/
- gv. Derived from Ghostview. Obtainable from:
http://wwwthep.physik.uni-mainz.de/~plass/gv/
Copies (possibly not the most recent) can be found at:
http://www.cs.wisc.edu/~ghost/gv/
MS-Windows
- GSview. Obtainable from:
http://www.cs.wisc.edu/~ghost/gsview/
Linux
- GSview. Linux version of the popular MS-Windows previewer.
Obtainable from:
http://www.cs.wisc.edu/~ghost/gsview/
- BMV. Different from Ghostview and gv in that it doesn't use X but svgalib.
Obtainable from:
ftp://sunsite.unc.edu/pub/Linux/apps/graphics/viewers/svga/bmv-1.2.tgz
7.3 PSUtils
PSUtils is a collection of utility programs for manipulating PostScript
documents. Binary distributions are available for many platforms, as well as
the full source. PSUtils can be found at:
http://knackered.org/angus/psutils
The utilities of interest include:
- psnup. Convert PS files for N-up printing.
- psselect. Select page range and order of printing.
- psresize. Change the page size.
- psbook. Reorder and lay out pages ready for making a book.
The output of one program can be used as the input to the next, allowing for
complex print document creation.
N-UP PRINTING
The psnup utility takes an existing PostScript file generated from Vim and
convert it to an n-up version. The simplest way to create a 2-up printout is
to first create a PostScript file with: >
:hardcopy > test.ps
Then on your command line execute: >
psnup -n 2 test.ps final.ps
Note: You may get warnings from some Ghostscript previewers for files produced
by psnup - these may safely be ignored.
Finally print the file final.ps to your PostScript printer with your
platform's print command. (You will need to delete the two PostScript files
afterwards yourself.) 'printexpr' could be modified to perform this extra
step before printing.
ALTERNATE DUPLEX PRINTING
It is possible to achieve a poor man's version of duplex printing using the PS

View File

@ -191,7 +191,7 @@ registers. Nvim looks for these clipboard tools, in order of priority:
- xclip (if $DISPLAY is set)
- xsel (if $DISPLAY is set)
- lemonade (for SSH) https://github.com/pocke/lemonade
- doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/
- doitclient (for SSH) https://www.chiark.greenend.org.uk/~sgtatham/doit/
- win32yank (Windows)
- termux (via termux-clipboard-set, termux-clipboard-set)
- tmux (if $TMUX is set)
@ -236,6 +236,22 @@ The "copy" function stores a list of lines and the register type. The "paste"
function returns the clipboard as a `[lines, regtype]` list, where `lines` is
a list of lines and `regtype` is a register type conforming to |setreg()|.
*clipboard-wsl*
For Windows WSL, try this g:clipboard definition:
>
let g:clipboard = {
\ 'name': 'WslClipboard',
\ 'copy': {
\ '+': 'clip.exe',
\ '*': 'clip.exe',
\ },
\ 'paste': {
\ '+': 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
\ '*': 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
\ },
\ 'cache_enabled': 0,
\ }
==============================================================================
Paste *provider-paste* *paste*

View File

@ -1287,7 +1287,7 @@ PYUNIT COMPILER *compiler-pyunit*
This is not actually a compiler, but a unit testing framework for the
Python language. It is included into standard Python distribution
starting from version 2.0. For older versions, you can get it from
http://pyunit.sourceforge.net.
https://pyunit.sourceforge.net.
When you run your tests with the help of the framework, possible errors
are parsed by Vim and presented for you in quick-fix mode.
@ -1298,8 +1298,6 @@ Useful values for the 'makeprg' options therefore are:
setlocal makeprg=./alltests.py " Run a testsuite
setlocal makeprg=python\ %:S " Run a single testcase
Also see http://vim.sourceforge.net/tip_view.php?tip_id=280.
TEX COMPILER *compiler-tex*
@ -1823,7 +1821,7 @@ In English, that sed script:
it as a "continuation of a multi-line message."
*errorformat-ant*
For ant (http://jakarta.apache.org/) the above errorformat has to be modified
For ant (https://jakarta.apache.org/) the above errorformat has to be modified
to honour the leading [javac] in front of each javac output line: >
:set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%#

View File

@ -471,7 +471,7 @@ flag when defining the function, it is not relevant when executing it. >
:set cpo-=C
<
*line-continuation-comment*
To add a comment in between the lines start with '"\ '. Notice the space
To add a comment in between the lines start with `'"\ '`. Notice the space
after the backslash. Example: >
let array = [
"\ first entry comment
@ -491,29 +491,40 @@ Rationale:
continuation lines to be part of the comment. Since it was like this
for a long time, when making it possible to add a comment halfway a
sequence of continuation lines, it was not possible to use \", since
that was a valid continuation line. Using '"\ ' comes closest, even
that was a valid continuation line. Using `'"\ '` comes closest, even
though it may look a bit weird. Requiring the space after the
backslash is to make it very unlikely this is a normal comment line.
==============================================================================
Using Vim packages *packages*
A Vim package is a directory that contains one or more plugins. The
advantages over normal plugins:
- A package can be downloaded as an archive and unpacked in its own directory.
Thus the files are not mixed with files of other plugins. That makes it
easy to update and remove.
- A package can be a git, mercurial, etc. repository. That makes it really
easy to update.
- A package can contain multiple plugins that depend on each other.
- A package can contain plugins that are automatically loaded on startup and
ones that are only loaded when needed with `:packadd`.
A Vim "package" is a directory that contains |plugin|s. Compared to normal
plugins, a package can...
- be downloaded as an archive and unpacked in its own directory, so the files
are not mixed with files of other plugins.
- be a git, mercurial, etc. repository, thus easy to update.
- contain multiple plugins that depend on each other.
- contain plugins that are automatically loaded on startup ("start" packages,
located in "pack/*/start/*") and ones that are only loaded when needed with
|:packadd| ("opt" packages, located in "pack/*/opt/*").
*runtime-search-path*
Nvim searches for |:runtime| files in:
1. all paths in 'runtimepath'
2. all "pack/*/start/*" dirs
Note that the "pack/*/start/*" paths are not explicitly included in
'runtimepath', so they will not be reported by ":set rtp" or "echo &rtp".
Scripts can use |nvim_list_runtime_paths()| to list all used directories, and
|nvim_get_runtime_file()| to query for specific files or sub-folders within
the runtime path. Example: >
" List all runtime dirs and packages with Lua paths.
:echo nvim_get_runtime_file("lua/", v:true)
Using a package and loading automatically ~
Let's assume your Vim files are in the "~/.local/share/nvim/site" directory
and you want to add a package from a zip archive "/tmp/foopack.zip":
Let's assume your Nvim files are in "~/.local/share/nvim/site" and you want to
add a package from a zip archive "/tmp/foopack.zip":
% mkdir -p ~/.local/share/nvim/site/pack/foo
% cd ~/.local/share/nvim/site/pack/foo
% unzip /tmp/foopack.zip
@ -526,28 +537,17 @@ You would now have these files under ~/.local/share/nvim/site:
pack/foo/start/foobar/syntax/some.vim
pack/foo/opt/foodebug/plugin/debugger.vim
*runtime-search-path*
When runtime files are searched for, first all paths in 'runtimepath' are
searched, then all "pack/*/start/*" dirs are searched. However, package entries
are not visible in `:set rtp` or `echo &rtp`, as the final concatenated path
would be too long and get truncated. To list all used directories, use
|nvim_list_runtime_paths()|. In addition |nvim_get_runtime_file()| can be used
to query for specific files or sub-folders within the runtime path. For
instance to list all runtime dirs and packages with lua paths, use >
On startup after processing your |config|, Nvim scans all directories in
'packpath' for plugins in "pack/*/start/*", then loads the plugins.
:echo nvim_get_runtime_file("lua/", v:true)
In the example Nvim will find "pack/foo/start/foobar/plugin/foo.vim" and load
it.
<When Vim starts up, after processing your .vimrc, it scans all directories in
'packpath' for plugins under the "pack/*/start" directory, and all the plugins
are loaded.
In the example Vim will find "pack/foo/start/foobar/plugin/foo.vim" and load it.
If the "foobar" plugin kicks in and sets the 'filetype' to "some", Vim will
If the "foobar" plugin kicks in and sets the 'filetype' to "some", Nvim will
find the syntax/some.vim file, because its directory is in the runtime search
path.
Vim will also load ftdetect files, if there are any.
Nvim will also load ftdetect files, if there are any.
Note that the files under "pack/foo/opt" are not loaded automatically, only the
ones under "pack/foo/start". See |pack-add| below for how the "opt" directory
@ -589,12 +589,12 @@ This searches for "pack/*/opt/foodebug" in 'packpath' and will find
it.
This could be done if some conditions are met. For example, depending on
whether Vim supports a feature or a dependency is missing.
whether Nvim supports a feature or a dependency is missing.
You can also load an optional plugin at startup, by putting this command in
your |config|: >
:packadd! foodebug
The extra "!" is so that the plugin isn't loaded if Vim was started with
The extra "!" is so that the plugin isn't loaded if Nvim was started with
|--noplugin|.
It is perfectly normal for a package to only have files in the "opt"
@ -606,7 +606,7 @@ Where to put what ~
Since color schemes, loaded with `:colorscheme`, are found below
"pack/*/start" and "pack/*/opt", you could put them anywhere. We recommend
you put them below "pack/*/opt", for example
".vim/pack/mycolors/opt/dark/colors/very_dark.vim".
"~/.config/nvim/pack/mycolors/opt/dark/colors/very_dark.vim".
Filetype plugins should go under "pack/*/start", so that they are always
found. Unless you have more than one plugin for a file type and want to
@ -684,8 +684,8 @@ found automatically. Your package would have these files:
< pack/foo/start/lib/autoload/foolib.vim >
func foolib#getit()
This works, because start packages will be used to look for autoload files,
when sourcing the plugins.
This works, because start packages will be searchd for autoload files, when
sourcing the plugins.
==============================================================================
Debugging scripts *debug-scripts*

View File

@ -45,7 +45,7 @@ If you wish to use messages, help files, menus and other items translated to
Russian, you will need to install the RuVim Language Pack, available in
different codepages from
http://www.sourceforge.net/projects/ruvim/
https://www.sourceforge.net/projects/ruvim/
After downloading an archive from RuVim project, unpack it into your
$VIMRUNTIME directory. We recommend using UTF-8 archive.

View File

@ -334,8 +334,10 @@ See |sign_getplaced()| for the equivalent Vim script function.
:sign place group=* buffer={nr}
List signs in all the groups placed in buffer {nr}.
:sign place List placed signs in the global group in all files.
:sign place group={group}
List placed signs in all sign groups in all the files.
List placed signs with sign group {group} in all files.
:sign place group=*
List placed signs in all sign groups in all files.
@ -381,15 +383,14 @@ sign_define({list})
icon full path to the bitmap file for the sign.
linehl highlight group used for the whole line the
sign is placed in.
numhl highlight group used for the line number where
the sign is placed.
text text that is displayed when there is no icon
or the GUI is not being used.
texthl highlight group used for the text item
culhl highlight group used for the text item when
the cursor is on the same line as the sign and
'cursorline' is enabled.
numhl highlight group used for 'number' column at the
associated line. Overrides |hl-LineNr|,
|hl-CursorLineNr|.
If the sign named {name} already exists, then the attributes
of the sign are updated.
@ -431,6 +432,8 @@ sign_getdefined([{name}]) *sign_getdefined()*
linehl highlight group used for the whole line the
sign is placed in; not present if not set.
name name of the sign
numhl highlight group used for the line number where
the sign is placed; not present if not set.
text text that is displayed when there is no icon
or the GUI is not being used.
texthl highlight group used for the text item; not
@ -439,9 +442,6 @@ sign_getdefined([{name}]) *sign_getdefined()*
the cursor is on the same line as the sign and
'cursorline' is enabled; not present if not
set.
numhl highlight group used for 'number' column at the
associated line. Overrides |hl-LineNr|,
|hl-CursorLineNr|; not present if not set.
Returns an empty List if there are no signs and when {name} is
not found.

View File

@ -482,7 +482,7 @@ You can create a Vim spell file from the .aff and .dic files that Myspell
uses. Myspell is used by OpenOffice.org and Mozilla. The OpenOffice .oxt
files are zip files which contain the .aff and .dic files. You should be able
to find them here:
http://extensions.services.openoffice.org/dictionary
https://extensions.services.openoffice.org/dictionary
The older, OpenOffice 2 files may be used if this doesn't work:
http://wiki.services.openoffice.org/wiki/Dictionaries
You can also use a plain word list. The results are the same, the choice
@ -764,13 +764,13 @@ them before the Vim word list is made. The tools for this can be found in the
The format for the affix and word list files is based on what Myspell uses
(the spell checker of Mozilla and OpenOffice.org). A description can be found
here:
http://lingucomponent.openoffice.org/affix.readme ~
https://lingucomponent.openoffice.org/affix.readme ~
Note that affixes are case sensitive, this isn't obvious from the description.
Vim supports quite a few extras. They are described below |spell-affix-vim|.
Attempts have been made to keep this compatible with other spell checkers, so
that the same files can often be used. One other project that offers more
than Myspell is Hunspell ( http://hunspell.sf.net ).
than Myspell is Hunspell ( https://hunspell.github.io ).
WORD LIST FORMAT *spell-dic-format*
@ -886,7 +886,7 @@ right encoding.
*spell-AUTHOR* *spell-EMAIL* *spell-COPYRIGHT*
NAME Name of the language
VERSION 1.0.1 with fixes
HOME http://www.myhome.eu
HOME https://www.example.com
AUTHOR John Doe
EMAIL john AT Doe DOT net
COPYRIGHT LGPL

View File

@ -35,7 +35,7 @@ filename One or more file names. The first one will be the current
no other options or "+command" argument can follow.
*--*
- Alias for stdin (standard input).
`-` Alias for stdin (standard input).
Example: >
echo text | nvim - file
< "text" is read into buffer 1, "file" is opened as buffer 2.
@ -143,12 +143,11 @@ argument.
these commands, independently from "-c" commands.
*-S*
-S {file} The {file} will be sourced after the first file has been read.
This is an easy way to do the equivalent of: >
-S {file} Vimscript or Lua (".lua") {file} will be |:source|d after the
first file has been read. Equivalent to: >
-c "source {file}"
< It can be mixed with "-c" arguments and repeated like "-c".
The limit of 10 "-c" arguments applies here as well.
{file} cannot start with a "-".
< Can be repeated like "-c", subject to the same limit of 10
"-c" arguments. {file} cannot start with a "-".
-S Works like "-S Session.vim". Only when used as the last
argument or when another "-" option follows.
@ -203,13 +202,14 @@ argument.
send commands. >
printf "foo\n" | nvim -Es +"%print"
< Output of these commands is displayed (to stdout):
:print
< These commands display on stdout:
:list
:number
:set (to display option values)
When 'verbose' is set messages are printed to stderr. >
echo foo | nvim -V1 -es
:print
:set
With |:verbose| or 'verbose', other commands display on stderr: >
nvim -es +":verbose echo 'foo'"
nvim -V1 -es +foo
< User |config| is skipped (unless given with |-u|).
Swap file is skipped (like |-n|).
@ -401,18 +401,20 @@ accordingly, proceeding as follows:
The |-V| argument can be used to display or log what happens next,
useful for debugging the initializations.
3. Wait for UI to connect.
3. Start a server (unless |--listen| was given) and set |v:servername|.
4. Wait for UI to connect.
Nvim started with |--embed| waits for the UI to connect before
proceeding to load user configuration.
4. Setup |default-mappings| and |default-autocmds|. Create |popup-menu|.
5. Setup |default-mappings| and |default-autocmds|. Create |popup-menu|.
5. Enable filetype and indent plugins.
6. Enable filetype and indent plugins.
This does the same as the command: >
:runtime! ftplugin.vim indent.vim
< Skipped if the "-u NONE" command line argument was given.
6. Load user config (execute Ex commands from files, environment, …).
7. Load user config (execute Ex commands from files, environment, …).
$VIMINIT environment variable is read as one Ex command line (separate
multiple commands with '|' or <NL>).
*config* *init.vim* *init.lua* *vimrc* *exrc*
@ -443,9 +445,9 @@ accordingly, proceeding as follows:
*VIMINIT* *EXINIT* *$MYVIMRC*
b. Locations searched for initializations, in order of preference:
- $VIMINIT environment variable (Ex command line).
- User |config|: $XDG_CONFIG_HOME/nvim/init.vim.
- Other config: {dir}/nvim/init.vim where {dir} is any directory
in $XDG_CONFIG_DIRS.
- User |config|: $XDG_CONFIG_HOME/nvim/init.vim (or init.lua).
- Other config: {dir}/nvim/init.vim (or init.lua) where {dir} is any
directory in $XDG_CONFIG_DIRS.
- $EXINIT environment variable (Ex command line).
|$MYVIMRC| is set to the first valid location unless it was already
set or when using $VIMINIT.
@ -456,19 +458,19 @@ accordingly, proceeding as follows:
- The file ".nvimrc"
- The file ".exrc"
7. Enable filetype detection.
8. Enable filetype detection.
This does the same as the command: >
:runtime! filetype.lua filetype.vim
< Skipped if ":filetype off" was called or if the "-u NONE" command line
argument was given.
8. Enable syntax highlighting.
9. Enable syntax highlighting.
This does the same as the command: >
:runtime! syntax/syntax.vim
< Skipped if ":syntax off" was called or if the "-u NONE" command
line argument was given.
9. Load the plugin scripts. *load-plugins*
10. Load the plugin scripts. *load-plugins*
This does the same as the command: >
:runtime! plugin/**/*.vim
:runtime! plugin/**/*.lua
@ -498,21 +500,21 @@ accordingly, proceeding as follows:
if packages have been found, but that should not add a directory
ending in "after".
10. Set 'shellpipe' and 'shellredir'
11. Set 'shellpipe' and 'shellredir'
The 'shellpipe' and 'shellredir' options are set according to the
value of the 'shell' option, unless they have been set before.
This means that Nvim will figure out the values of 'shellpipe' and
'shellredir' for you, unless you have set them yourself.
11. Set 'updatecount' to zero, if "-n" command argument used
12. Set 'updatecount' to zero, if "-n" command argument used
12. Set binary options if the |-b| flag was given.
13. Set binary options if the |-b| flag was given.
13. Read the |shada-file|.
14. Read the |shada-file|.
14. Read the quickfix file if the |-q| flag was given, or exit on failure.
15. Read the quickfix file if the |-q| flag was given, or exit on failure.
15. Open all windows
16. Open all windows
When the |-o| flag was given, windows will be opened (but not
displayed yet).
When the |-p| flag was given, tab pages will be created (but not
@ -522,7 +524,7 @@ accordingly, proceeding as follows:
Buffers for all windows will be loaded, without triggering |BufAdd|
autocommands.
16. Execute startup commands
17. Execute startup commands
If a |-t| flag was given, the tag is jumped to.
Commands given with |-c| and |+cmd| are executed.
The starting flag is reset, has("vim_starting") will now return zero.
@ -1182,7 +1184,7 @@ exactly four MessagePack objects:
encoding Binary, effective 'encoding' value.
max_kbyte Integer, effective |shada-s| limit value.
pid Integer, instance process ID.
* It is allowed to have any number of
`*` It is allowed to have any number of
additional keys with any data.
2 (SearchPattern) Map containing data describing last used search or
substitute pattern. Normally ShaDa file contains two
@ -1213,7 +1215,7 @@ exactly four MessagePack objects:
sp Binary N/A Actual pattern. Required.
sb Boolean false True if search direction is
backward.
* any none Other keys are allowed for
`*` any none Other keys are allowed for
compatibility reasons, see
|shada-compatibility|.
3 (SubString) Array containing last |:substitute| replacement string.
@ -1284,7 +1286,7 @@ exactly four MessagePack objects:
GlobalMark and LocalMark
entries.
f Binary N/A File name. Required.
* any none Other keys are allowed for
`*` any none Other keys are allowed for
compatibility reasons, see
|shada-compatibility|.
9 (BufferList) Array containing maps. Each map in the array
@ -1294,10 +1296,10 @@ exactly four MessagePack objects:
greater then zero.
c UInteger 0 Position column number.
f Binary N/A File name. Required.
* any none Other keys are allowed for
`*` any none Other keys are allowed for
compatibility reasons, see
|shada-compatibility|.
* (Unknown) Any other entry type is allowed for compatibility
`*` (Unknown) Any other entry type is allowed for compatibility
reasons, see |shada-compatibility|.
*E575* *E576*
@ -1357,7 +1359,7 @@ LOG FILE *$NVIM_LOG_FILE* *E5430*
Besides 'debug' and 'verbose', Nvim keeps a general log file for internal
debugging, plugins and RPC clients. >
:echo $NVIM_LOG_FILE
By default, the file is located at stdpath('log')/log unless that path
By default, the file is located at stdpath("log")/log unless that path
is inaccessible or if $NVIM_LOG_FILE was set before |startup|.

View File

@ -687,13 +687,13 @@ Automatic detection works for the encodings mentioned specifically by name in
|encoding-names|, but TOhtml will only automatically use those encodings with
wide browser support. However, you can override this to support specific
encodings that may not be automatically detected by default (see options
below). See http://www.iana.org/assignments/character-sets for the IANA names.
below). See https://www.iana.org/assignments/character-sets for the IANA names.
Note: By default all Unicode encodings are converted to UTF-8 with no BOM in
the generated HTML, as recommended by W3C:
http://www.w3.org/International/questions/qa-choosing-encodings
http://www.w3.org/International/questions/qa-byte-order-mark
https://www.w3.org/International/questions/qa-choosing-encodings
https://www.w3.org/International/questions/qa-byte-order-mark
*g:html_use_encoding*
Default: none, uses IANA name for current 'fileencoding' as above.
@ -832,7 +832,7 @@ files are included:
asm68k Motorola 680x0 assembly
asmh8300 Hitachi H-8300 version of GNU assembly
ia64 Intel Itanium 64
fasm Flat assembly (http://flatassembler.net)
fasm Flat assembly (https://flatassembler.net)
masm Microsoft assembly (probably works for any 80x86)
nasm Netwide assembly
tasm Turbo Assembly (with opcodes 80x86 up to Pentium, and
@ -1393,9 +1393,9 @@ Two syntax highlighting files exist for Euphoria. One for Euphoria
version 3.1.1, which is the default syntax highlighting file, and one for
Euphoria version 4.0.5 or later.
Euphoria version 3.1.1 (http://www.rapideuphoria.com/) is still necessary
Euphoria version 3.1.1 (https://www.rapideuphoria.com/) is still necessary
for developing applications for the DOS platform, which Euphoria version 4
(http://www.openeuphoria.org/) does not support.
(https://www.openeuphoria.org/) does not support.
The following file extensions are auto-detected as Euphoria file type:
@ -1452,7 +1452,7 @@ Elixir.
FLEXWIKI *flexwiki.vim* *ft-flexwiki-syntax*
FlexWiki is an ASP.NET-based wiki package available at http://www.flexwiki.com
FlexWiki is an ASP.NET-based wiki package available at https://www.flexwiki.com
NOTE: This site currently doesn't work, on Wikipedia is mentioned that
development stopped in 2009.
@ -1808,7 +1808,7 @@ are read during initialization) >
:let html_my_rendering=1
If you'd like to see an example download mysyntax.vim at
http://www.fleiner.com/vim/download.html
https://www.fleiner.com/vim/download.html
You can also disable this rendering by adding the following line to your
vimrc file: >
@ -1936,7 +1936,7 @@ highlight them use: >
:let java_highlight_java_lang_ids=1
You can also highlight identifiers of most standard Java packages if you
download the javaid.vim script at http://www.fleiner.com/vim/download.html.
download the javaid.vim script at https://www.fleiner.com/vim/download.html.
If you prefer to only highlight identifiers of a certain package, say java.io
use the following: >
:let java_highlight_java_io=1
@ -3353,13 +3353,11 @@ of specialized LaTeX commands, syntax, and fonts. If you're using such a
package you'll often wish that the distributed syntax/tex.vim would support
it. However, clearly this is impractical. So please consider using the
techniques in |mysyntaxfile-add| to extend or modify the highlighting provided
by syntax/tex.vim. Please consider uploading any extensions that you write,
which typically would go in $HOME/after/syntax/tex/[pkgname].vim, to
http://vim.sf.net/.
by syntax/tex.vim.
I've included some support for various popular packages on my website: >
http://www.drchip.org/astronaut/vim/index.html#LATEXPKGS
https://www.drchip.org/astronaut/vim/index.html#LATEXPKGS
<
The syntax files there go into your .../after/syntax/tex/ directory.
@ -4806,7 +4804,7 @@ Note that the ":syntax" command can be abbreviated to ":sy", although ":syn"
is mostly used, because it looks better.
==============================================================================
12. Highlight command *:highlight* *:hi* *E28* *E411* *E415*
13. Highlight command *:highlight* *:hi* *E28* *E411* *E415*
There are two types of highlight groups:
- The built-in |highlight-groups|.
@ -5288,7 +5286,7 @@ Tooltip Current font, background and foreground of the tooltips.
Applicable highlight arguments: font, guibg, guifg.
==============================================================================
13. Linking groups *:hi-link* *:highlight-link* *E412* *E413*
14. Linking groups *:hi-link* *:highlight-link* *E412* *E413*
When you want to use the same highlighting for several syntax groups, you
can do this more easily by linking the groups into one common highlight
@ -5397,8 +5395,7 @@ WARNING: The longer the tags file, the slower this will be, and the more
memory Vim will consume.
Only highlighting typedefs, unions and structs can be done too. For this you
must use Universal Ctags (found at https://ctags.io) or Exuberant ctags (found
at http://ctags.sf.net).
must use Universal Ctags (https://ctags.io) or Exuberant ctags.
Put these lines in your Makefile:
@ -5448,7 +5445,7 @@ is loaded into that window or the file is reloaded.
When splitting the window, the new window will use the original syntax.
==============================================================================
17. Color xterms *xterm-color* *color-xterm*
18. Color xterms *xterm-color* *color-xterm*
*colortest.vim*
To test your color setup, a file has been included in the Vim distribution.
@ -5458,7 +5455,7 @@ To use it, execute this command: >
Nvim uses 256-color and |true-color| terminal capabilities wherever possible.
==============================================================================
18. When syntax is slow *:syntime*
19. When syntax is slow *:syntime*
This is aimed at authors of a syntax file.

View File

@ -514,18 +514,13 @@ ctags As found on most Unix systems. Only supports C. Only
universal ctags A maintained version of ctags based on exuberant
ctags. See https://ctags.io.
*Exuberant_ctags*
exuberant ctags This is a very good one. It works for C, C++, Java,
Fortran, Eiffel and others. It can generate tags for
many items. See http://ctags.sourceforge.net.
No new version since 2009.
exuberant ctags Works for C, C++, Java, Fortran, Eiffel and others.
See https://ctags.sourceforge.net. No new version
since 2009.
JTags For Java, in Java. It can be found at
http://www.fleiner.com/jtags/.
https://www.fleiner.com/jtags/.
ptags.py For Python, in Python. Found in your Python source
directory at Tools/scripts/ptags.py.
ptags For Perl, in Perl. It can be found at
http://www.eleves.ens.fr:8080/home/nthiery/Tags/.
gnatxref For Ada. See http://www.gnuada.org/. gnatxref is
part of the gnat package.
The lines in the tags file must have one of these two formats:

View File

@ -29,7 +29,7 @@ whole.
Building your own terminfo is usually as simple as running this as
a non-superuser:
>
curl -LO http://invisible-island.net/datafiles/current/terminfo.src.gz
curl -LO https://invisible-island.net/datafiles/current/terminfo.src.gz
gunzip terminfo.src.gz
tic terminfo.src
<

View File

@ -134,7 +134,7 @@ assert_match({pattern}, {actual} [, {msg}])
When {pattern} does not match {actual} an error message is
added to |v:errors|. Also see |assert-return|.
{pattern} is used as with |=~|: The matching is always done
{pattern} is used as with |expr-=~|: The matching is always done
like 'magic' was set and 'cpoptions' is empty, no matter what
the actual value of 'magic' or 'cpoptions' is.

View File

@ -8,7 +8,7 @@ Tips and ideas for using Vim *tips*
These are just a few that we thought would be helpful for many users.
You can find many more tips on the wiki. The URL can be found on
http://www.vim.org
https://www.vim.org
Don't forget to browse the user manual, it also contains lots of useful tips
|usr_toc.txt|.

View File

@ -239,7 +239,7 @@ The following predicates are built in:
`contains?` *treesitter-predicate-contains?*
Match a string against parts of the text corresponding to a node: >
((identifier) @foo (#contains? @foo "foo"))
((identifier) @foo-bar (#contains @foo-bar "foo" "bar"))
((identifier) @foo-bar (#contains? @foo-bar "foo" "bar"))
<
`any-of?` *treesitter-predicate-any-of?*
Match any of the given strings against the text corresponding to
@ -371,6 +371,59 @@ instance, to highlight comments differently per language: >
hi @comment.c guifg=Blue
hi @comment.lua @guifg=DarkBlue
hi link @comment.doc.java String
<
The following captures are linked by default to standard |group-name|s:
>
@text.literal Comment
@text.reference Identifier
@text.title Title
@text.uri Underlined
@text.underline Underlined
@text.todo Todo
@comment Comment
@punctuation Delimiter
@constant Constant
@constant.builtin Special
@constant.macro Define
@define Define
@macro Macro
@string String
@string.escape SpecialChar
@string.special SpecialChar
@character Character
@character.special SpecialChar
@number Number
@boolean Boolean
@float Float
@function Function
@function.builtin Special
@function.macro Macro
@parameter Identifier
@method Function
@field Identifier
@property Identifier
@constructor Special
@conditional Conditional
@repeat Repeat
@label Label
@operator Operator
@keyword Keyword
@exception Exception
@variable Identifier
@type Type
@type.definition Typedef
@storageclass StorageClass
@structure Structure
@namespace Identifier
@include Include
@preproc PreProc
@debug Debug
@tag Tag
<
*treesitter-highlight-spell*
The special `@spell` capture can be used to indicate that a node should be
@ -379,6 +432,9 @@ capture marks comments as to be checked: >
(comment) @spell
<
There is also `@nospell` which disables spellchecking regions with `@spell`.
*treesitter-highlight-conceal*
Treesitter highlighting supports |conceal| via the `conceal` metadata. By
convention, nodes to be concealed are captured as `@conceal`, but any capture
@ -429,7 +485,7 @@ get_captures_at_cursor({winnr}) *get_captures_at_cursor()*
Returns a list of highlight capture names under the cursor
Parameters: ~
{winnr} (number|nil) Window handle or 0 for current window (default)
{winnr} (number|nil) Window handle or 0 for current window (default)
Return: ~
string[] List of capture names
@ -442,9 +498,9 @@ get_captures_at_pos({bufnr}, {row}, {col}) *get_captures_at_pos()*
if none are defined).
Parameters: ~
{bufnr} (number) Buffer number (0 for current buffer)
{row} (number) Position row
{col} (number) Position column
{bufnr} (number) Buffer number (0 for current buffer)
{row} (number) Position row
{col} (number) Position column
Return: ~
table[] List of captures `{ capture = "capture name", metadata = { ...
@ -454,7 +510,7 @@ get_node_at_cursor({winnr}) *get_node_at_cursor()*
Returns the smallest named node under the cursor
Parameters: ~
{winnr} (number|nil) Window handle or 0 for current window (default)
{winnr} (number|nil) Window handle or 0 for current window (default)
Return: ~
(string) Name of node under the cursor
@ -463,10 +519,10 @@ get_node_at_pos({bufnr}, {row}, {col}, {opts}) *get_node_at_pos()*
Returns the smallest named node at the given position
Parameters: ~
{bufnr} (number) Buffer number (0 for current buffer)
{row} (number) Position row
{col} (number) Position column
{opts} (table) Optional keyword arguments:
{bufnr} (number) Buffer number (0 for current buffer)
{row} (number) Position row
{col} (number) Position column
{opts} (table) Optional keyword arguments:
• ignore_injections boolean Ignore injected languages
(default true)
@ -477,7 +533,7 @@ get_node_range({node_or_range}) *get_node_range()*
Returns the node's range or an unpacked range table
Parameters: ~
{node_or_range} (userdata|table) |tsnode| or table of positions
{node_or_range} (userdata|table) |tsnode| or table of positions
Return: ~
(table) `{ start_row, start_col, end_row, end_col }`
@ -489,11 +545,11 @@ get_parser({bufnr}, {lang}, {opts}) *get_parser()*
If needed, this will create the parser.
Parameters: ~
{bufnr} (number|nil) Buffer the parser should be tied to (default:
{bufnr} (number|nil) Buffer the parser should be tied to (default:
current buffer)
{lang} (string|nil) Filetype of this parser (default: buffer
{lang} (string|nil) Filetype of this parser (default: buffer
filetype)
{opts} (table|nil) Options to pass to the created language tree
{opts} (table|nil) Options to pass to the created language tree
Return: ~
LanguageTree |LanguageTree| object to use for parsing
@ -502,9 +558,9 @@ get_string_parser({str}, {lang}, {opts}) *get_string_parser()*
Returns a string parser
Parameters: ~
{str} (string) Text to parse
{lang} (string) Language of this string
{opts} (table|nil) Options to pass to the created language tree
{str} (string) Text to parse
{lang} (string) Language of this string
{opts} (table|nil) Options to pass to the created language tree
Return: ~
LanguageTree |LanguageTree| object to use for parsing
@ -513,8 +569,8 @@ is_ancestor({dest}, {source}) *is_ancestor()*
Determines whether a node is the ancestor of another
Parameters: ~
{dest} userdata Possible ancestor |tsnode|
{source} userdata Possible descendant |tsnode|
{dest} userdata Possible ancestor |tsnode|
{source} userdata Possible descendant |tsnode|
Return: ~
(boolean) True if {dest} is an ancestor of {source}
@ -523,9 +579,9 @@ is_in_node_range({node}, {line}, {col}) *is_in_node_range()*
Determines whether (line, col) position is in node range
Parameters: ~
{node} userdata |tsnode| defining the range
{line} (number) Line (0-based)
{col} (number) Column (0-based)
{node} userdata |tsnode| defining the range
{line} (number) Line (0-based)
{col} (number) Column (0-based)
Return: ~
(boolean) True if the position is in node range
@ -534,8 +590,8 @@ node_contains({node}, {range}) *node_contains()*
Determines if a node contains a range
Parameters: ~
{node} userdata |tsnode|
{range} (table)
{node} userdata |tsnode|
{range} (table)
Return: ~
(boolean) True if the {node} contains the {range}
@ -560,16 +616,16 @@ start({bufnr}, {lang}) *start()*
<
Parameters: ~
{bufnr} (number|nil) Buffer to be highlighted (default: current
{bufnr} (number|nil) Buffer to be highlighted (default: current
buffer)
{lang} (string|nil) Language of the parser (default: buffer
{lang} (string|nil) Language of the parser (default: buffer
filetype)
stop({bufnr}) *stop()*
Stops treesitter highlighting for a buffer
Parameters: ~
{bufnr} (number|nil) Buffer to stop highlighting (default: current
{bufnr} (number|nil) Buffer to stop highlighting (default: current
buffer)
@ -583,7 +639,7 @@ inspect_language({lang}) *inspect_language()*
names, ...
Parameters: ~
{lang} (string) Language
{lang} (string) Language
Return: ~
(table)
@ -596,11 +652,11 @@ require_language({lang}, {path}, {silent}, {symbol_name})
{path}
Parameters: ~
{lang} (string) Language the parser should parse
{path} (string|nil) Optional path the parser is located at
{silent} (boolean|nil) Don't throw an error if language not
{lang} (string) Language the parser should parse
{path} (string|nil) Optional path the parser is located at
{silent} (boolean|nil) Don't throw an error if language not
found
{symbol_name} (string|nil) Internal symbol name for the language to
{symbol_name} (string|nil) Internal symbol name for the language to
load
Return: ~
@ -619,26 +675,26 @@ add_directive({name}, {handler}, {force}) *add_directive()*
`metadata[capture_id].key = value`
Parameters: ~
{name} (string) Name of the directive, without leading #
{handler} function(match:string, pattern:string, bufnr:number,
{name} (string) Name of the directive, without leading #
{handler} function(match:string, pattern:string, bufnr:number,
predicate:function, metadata:table)
add_predicate({name}, {handler}, {force}) *add_predicate()*
Adds a new predicate to be used in queries
Parameters: ~
{name} (string) Name of the predicate, without leading #
{handler} function(match:string, pattern:string, bufnr:number,
{name} (string) Name of the predicate, without leading #
{handler} function(match:string, pattern:string, bufnr:number,
predicate:function)
get_node_text({node}, {source}, {opts}) *get_node_text()*
Gets the text corresponding to a given node
Parameters: ~
{node} userdata |tsnode|
{source} (number|string) Buffer or string from which the {node} is
{node} userdata |tsnode|
{source} (number|string) Buffer or string from which the {node} is
extracted
{opts} (table|nil) Optional parameters.
{opts} (table|nil) Optional parameters.
• concat: (boolean) Concatenate result in a string (default
true)
@ -649,8 +705,8 @@ get_query({lang}, {query_name}) *get_query()*
Returns the runtime query {query_name} for {lang}.
Parameters: ~
{lang} (string) Language to use for the query
{query_name} (string) Name of the query (e.g. "highlights")
{lang} (string) Language to use for the query
{query_name} (string) Name of the query (e.g. "highlights")
Return: ~
Query Parsed query
@ -660,9 +716,9 @@ get_query_files({lang}, {query_name}, {is_included})
Gets the list of files used to make up a query
Parameters: ~
{lang} (string) Language to get query for
{query_name} (string) Name of the query to load (e.g., "highlights")
{is_included} (boolean|nil) Internal parameter, most of the time left
{lang} (string) Language to get query for
{query_name} (string) Name of the query to load (e.g., "highlights")
{is_included} (boolean|nil) Internal parameter, most of the time left
as `nil`
Return: ~
@ -694,8 +750,8 @@ parse_query({lang}, {query}) *parse_query()*
• `info.patterns` contains information about predicates.
Parameters: ~
{lang} (string) Language to use for the query
{query} (string) Query in s-expr syntax
{lang} (string) Language to use for the query
{query} (string) Query in s-expr syntax
Return: ~
Query Parsed query
@ -726,11 +782,11 @@ Query:iter_captures({self}, {node}, {source}, {start}, {stop})
<
Parameters: ~
{node} userdata |tsnode| under which the search will occur
{source} (number|string) Source buffer or string to extract text from
{start} (number) Starting line for the search
{stop} (number) Stopping line for the search (end-exclusive)
{self}
{node} userdata |tsnode| under which the search will occur
{source} (number|string) Source buffer or string to extract text from
{start} (number) Starting line for the search
{stop} (number) Stopping line for the search (end-exclusive)
{self}
Return: ~
(number) capture Matching capture id
@ -761,11 +817,11 @@ Query:iter_matches({self}, {node}, {source}, {start}, {stop})
<
Parameters: ~
{node} userdata |tsnode| under which the search will occur
{source} (number|string) Source buffer or string to search
{start} (number) Starting line for the search
{stop} (number) Stopping line for the search (end-exclusive)
{self}
{node} userdata |tsnode| under which the search will occur
{source} (number|string) Source buffer or string to search
{start} (number) Starting line for the search
{stop} (number) Stopping line for the search (end-exclusive)
{self}
Return: ~
(number) pattern id
@ -779,9 +835,9 @@ set_query({lang}, {query_name}, {text}) *set_query()*
by plugins.
Parameters: ~
{lang} (string) Language to use for the query
{query_name} (string) Name of the query (e.g., "highlights")
{text} (string) Query text (unparsed).
{lang} (string) Language to use for the query
{query_name} (string) Name of the query (e.g., "highlights")
{text} (string) Query text (unparsed).
==============================================================================
@ -791,8 +847,8 @@ new({tree}, {opts}) *highlighter.new()*
Creates a new highlighter using
Parameters: ~
{tree} LanguageTree |LanguageTree| parser object to use for highlighting
{opts} (table|nil) Configuration of the highlighter:
{tree} LanguageTree |LanguageTree| parser object to use for highlighting
{opts} (table|nil) Configuration of the highlighter:
• queries table overwrite queries used by the highlighter
Return: ~
@ -802,7 +858,7 @@ TSHighlighter:destroy({self}) *TSHighlighter:destroy()*
Removes all internal references to the highlighter
Parameters: ~
{self}
{self}
==============================================================================
@ -812,14 +868,14 @@ LanguageTree:children({self}) *LanguageTree:children()*
Returns a map of language to child tree.
Parameters: ~
{self}
{self}
LanguageTree:contains({self}, {range}) *LanguageTree:contains()*
Determines whether {range} is contained in the |LanguageTree|.
Parameters: ~
{range} (table) `{ start_line, start_col, end_line, end_col }`
{self}
{range} (table) `{ start_line, start_col, end_line, end_col }`
{self}
Return: ~
(boolean)
@ -832,17 +888,17 @@ LanguageTree:destroy({self}) *LanguageTree:destroy()*
Note: This DOES NOT remove this tree from a parent. Instead, `remove_child` must be called on the parent to remove it.
Parameters: ~
{self}
{self}
*LanguageTree:for_each_child()*
LanguageTree:for_each_child({self}, {fn}, {include_self})
Invokes the callback for each |LanguageTree| and its children recursively
Parameters: ~
{fn} function(tree: LanguageTree, lang: string)
{include_self} (boolean) Whether to include the invoking tree in the
{fn} function(tree: LanguageTree, lang: string)
{include_self} (boolean) Whether to include the invoking tree in the
results
{self}
{self}
LanguageTree:for_each_tree({self}, {fn}) *LanguageTree:for_each_tree()*
Invokes the callback for each |LanguageTree| recursively.
@ -850,40 +906,40 @@ LanguageTree:for_each_tree({self}, {fn}) *LanguageTree:for_each_tree()*
Note: This includes the invoking tree's child trees as well.
Parameters: ~
{fn} function(tree: TSTree, languageTree: LanguageTree)
{self}
{fn} function(tree: TSTree, languageTree: LanguageTree)
{self}
LanguageTree:included_regions({self}) *LanguageTree:included_regions()*
Gets the set of included regions
Parameters: ~
{self}
{self}
LanguageTree:invalidate({self}, {reload}) *LanguageTree:invalidate()*
Invalidates this parser and all its children
Parameters: ~
{self}
{self}
LanguageTree:is_valid({self}) *LanguageTree:is_valid()*
Determines whether this tree is valid. If the tree is invalid, call `parse()` . This will return the updated tree.
Parameters: ~
{self}
{self}
LanguageTree:lang({self}) *LanguageTree:lang()*
Gets the language of this tree node.
Parameters: ~
{self}
{self}
*LanguageTree:language_for_range()*
LanguageTree:language_for_range({self}, {range})
Gets the appropriate language that contains {range}.
Parameters: ~
{range} (table) `{ start_line, start_col, end_line, end_col }`
{self}
{range} (table) `{ start_line, start_col, end_line, end_col }`
{self}
Return: ~
LanguageTree Managing {range}
@ -893,11 +949,11 @@ LanguageTree:named_node_for_range({self}, {range}, {opts})
Gets the smallest named node that contains {range}.
Parameters: ~
{range} (table) `{ start_line, start_col, end_line, end_col }`
{opts} (table|nil) Optional keyword arguments:
{range} (table) `{ start_line, start_col, end_line, end_col }`
{opts} (table|nil) Optional keyword arguments:
• ignore_injections boolean Ignore injected languages
(default true)
{self}
{self}
Return: ~
userdata|nil Found |tsnode|
@ -908,7 +964,7 @@ LanguageTree:parse({self}) *LanguageTree:parse()*
determine if any child languages should be created.
Parameters: ~
{self}
{self}
Return: ~
userdata[] Table of parsed |tstree|
@ -918,7 +974,7 @@ LanguageTree:register_cbs({self}, {cbs}) *LanguageTree:register_cbs()*
Registers callbacks for the |LanguageTree|.
Parameters: ~
{cbs} (table) An |nvim_buf_attach()|-like table argument with the
{cbs} (table) An |nvim_buf_attach()|-like table argument with the
following handlers:
• `on_bytes` : see |nvim_buf_attach()|, but this will be called after the parsers callback.
• `on_changedtree` : a callback that will be called every time
@ -929,24 +985,24 @@ LanguageTree:register_cbs({self}, {cbs}) *LanguageTree:register_cbs()*
tree.
• `on_child_removed` : emitted when a child is removed from
the tree.
{self}
{self}
LanguageTree:source({self}) *LanguageTree:source()*
Returns the source content of the language tree (bufnr or string).
Parameters: ~
{self}
{self}
*LanguageTree:tree_for_range()*
LanguageTree:tree_for_range({self}, {range}, {opts})
Gets the tree that contains {range}.
Parameters: ~
{range} (table) `{ start_line, start_col, end_line, end_col }`
{opts} (table|nil) Optional keyword arguments:
{range} (table) `{ start_line, start_col, end_line, end_col }`
{opts} (table|nil) Optional keyword arguments:
• ignore_injections boolean Ignore injected languages
(default true)
{self}
{self}
Return: ~
userdata|nil Contained |tstree|
@ -956,7 +1012,7 @@ LanguageTree:trees({self}) *LanguageTree:trees()*
languages.
Parameters: ~
{self}
{self}
new({source}, {lang}, {opts}) *languagetree.new()*
A |LanguageTree| holds the treesitter parser for a given language {lang}
@ -964,9 +1020,9 @@ new({source}, {lang}, {opts}) *languagetree.new()*
may contain child languages themselves, hence the name).
Parameters: ~
{source} (number|string) Buffer or a string of text to parse
{lang} (string) Root language this tree represents
{opts} (table|nil) Optional keyword arguments:
{source} (number|string) Buffer or a string of text to parse
{lang} (string) Root language this tree represents
{opts} (table|nil) Optional keyword arguments:
• injections table Mapping language to injection query
strings. This is useful for overriding the built-in
runtime file searching for the injection language query

View File

@ -11,9 +11,9 @@ Vim is Charityware. You can use and copy it as much as you like, but you are
encouraged to make a donation for needy children in Uganda. Please see |kcc|
below or visit the ICCF web site, available at these URLs:
http://iccf-holland.org/
http://www.vim.org/iccf/
http://www.iccf.nl/
https://iccf-holland.org/
https://www.vim.org/iccf/
https://www.iccf.nl/
You can also sponsor the development of Vim. Vim sponsors can vote for
features. See |sponsor|. The money goes to Uganda anyway.
@ -239,7 +239,7 @@ Holland: Transfer to the account of "Stichting ICCF Holland" in Lisse.
Germany: It is possible to make donations that allow for a tax return.
Check the ICCF web site for the latest information:
http://iccf-holland.org/germany.html
https://iccf-holland.org/germany.html
World: Use a postal money order. That should be possible from any
country, mostly from the post office. Use this name (which is

View File

@ -28,12 +28,14 @@ with these (optional) keys:
- `rgb` Decides the color format.
- true: (default) 24-bit RGB colors
- false: Terminal colors (8-bit, max 256)
*ui-override*
- `override` Decides how UI capabilities are resolved.
- true: Enable requested UI capabilities, even if not
supported by all connected UIs (including |TUI|).
- false: (default) Disable UI capabilities not
supported by all connected UIs (including TUI).
*ui-ext-options*
- `ext_cmdline` Externalize the cmdline. |ui-cmdline|
- `ext_hlstate` Detailed highlight state. |ui-hlstate|
@ -130,14 +132,18 @@ procedure:
1. Invoke |nvim_get_api_info()|, if needed to setup the client library and/or
to get the list of supported UI extensions.
2. Do any configuration that should be happen before user config is loaded.
Buffers and windows are not available at this point, but this could be used
to set |g:| variables visible to init.vim
3. If the UI wants to do additional setup after user config is loaded,
register a VimEnter autocmd: >
nvim_command("autocmd VimEnter * call rpcrequest(1, 'vimenter')")
<4. Now invoke |nvim_ui_attach()|. The UI must handle user input by now:
4. Now invoke |nvim_ui_attach()|. The UI must handle user input by now:
sourcing init.vim and loading buffers might lead to blocking prompts.
5. If step 3 was used, Nvim will send a blocking "vimenter" request to the UI.
Inside this request handler, the UI can safely do any initialization before
entering normal mode, for example reading variables set by init.vim.

View File

@ -85,7 +85,7 @@ The Vim user manual and reference manual are Copyright (c) 1988-2003 by Bram
Moolenaar. This material may be distributed only subject to the terms and
conditions set forth in the Open Publication License, v1.0 or later. The
latest version is presently available at:
http://www.opencontent.org/openpub/
https://www.opencontent.org/openpub/
People who contribute to the manuals must agree with the above copyright
notice.

View File

@ -320,7 +320,7 @@ Where can you find plugins?
- Some are always loaded, you can see them in the directory $VIMRUNTIME/plugin.
- Some come with Vim. You can find them in the directory $VIMRUNTIME/macros
and its sub-directories and under $VIM/vimfiles/pack/dist/opt/.
- Download from the net. There is a large collection on http://www.vim.org.
- Download from the net. There is a large collection on https://www.vim.org.
- They are sometimes posted in a Vim maillist.
- You could write one yourself, see |write-plugin|.

View File

@ -33,9 +33,8 @@ following command: >
ctags *.c
"ctags" is a separate program. Most Unix systems already have it installed.
If you do not have it yet, you can find Universal/Exuberant ctags at:
http://ctags.io ~
http://ctags.sf.net ~
If you do not have it yet, you can find Universal ctags at:
https://ctags.io ~
Universal ctags is preferred, Exuberant ctags is no longer being developed.

View File

@ -1074,8 +1074,8 @@ Various: *various-functions*
wordcount() get byte/word/char count of buffer
luaeval() evaluate |Lua| expression
py3eval() evaluate Python expression (|+python3|)
pyeval() evaluate Python expression (|+python|)
py3eval() evaluate |Python| expression
pyeval() evaluate |Python| expression
pyxeval() evaluate |python_x| expression
rubyeval() evaluate |Ruby| expression
@ -2624,7 +2624,7 @@ Further reading: |autoload|.
==============================================================================
*41.16* Distributing Vim scripts *distribute-script*
Vim users will look for scripts on the Vim website: http://www.vim.org.
Vim users will look for scripts on the Vim website: https://www.vim.org.
If you made something that is useful for others, share it!
Vim scripts can be used on any system. There might not be a tar or gzip

View File

@ -71,8 +71,8 @@ directory src/po/README.txt.
programmer. You must know both English and the language you are translating
to, of course.
When you are satisfied with the translation, consider making it available
to others. Upload it at vim-online (http://vim.sf.net) or e-mail it to
the Vim maintainer <maintainer@vim.org>. Or both.
to others. Upload it to https://github.com/vim/vim or e-mail it to the Vim
maintainer <maintainer@vim.org>. Or both.
==============================================================================
*45.2* Language for Menus
@ -166,10 +166,7 @@ script files, etc. You can regard 'encoding' as the setting for the internals
of Vim.
This example assumes you have this font on your system. The name in the
example is for the X Window System. This font is in a package that is used to
enhance xterm with Unicode support. If you don't have this font, you might
find it here:
http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz ~
enhance xterm with Unicode support.
For MS-Windows, some fonts have a limited number of Unicode characters. Try
using the "Courier New" font. You can use the Edit/Select Font... menu to
@ -178,10 +175,7 @@ though. Example: >
:set guifont=courier_new:h12
If it doesn't work well, try getting a fontpack. If Microsoft didn't move it,
you can find it here:
http://www.microsoft.com/typography/fonts/default.aspx ~
If it doesn't work well, try getting a fontpack.
Now you have told Vim to use Unicode internally and display text with a
Unicode font.

View File

@ -5,7 +5,7 @@
Table Of Contents *user-manual*
==============================================================================
Overview ~
Overview
Getting Started
|usr_01.txt| About the manuals
@ -52,7 +52,7 @@ The user manual is online:
https://neovim.io/doc/user
==============================================================================
Getting Started ~
Getting Started
Read this from start to end to learn the essential commands.
@ -167,7 +167,7 @@ Read this from start to end to learn the essential commands.
|12.8| Find where a word is used
==============================================================================
Editing Effectively ~
Editing Effectively
Subjects that can be read independently.
@ -275,7 +275,7 @@ Subjects that can be read independently.
|32.4| Time travelling
==============================================================================
Tuning Vim ~
Tuning Vim
Make Vim work as you like it.

View File

@ -79,31 +79,30 @@ centralized reference of the differences.
- |g:vimsyn_embed| defaults to "l" to enable Lua highlighting
Default Mouse ~
*default-mouse* *disable-mouse*
By default the mouse is enabled. The right button click opens |popup-menu|
with standard actions, such as "Cut", "Copy" and "Paste".
By default the mouse is enabled, and <RightMouse> opens a |popup-menu| with
standard actions ("Cut", "Copy", "Paste", …). Mouse is NOT enabled in
|command-mode| or the |more-prompt|, so you can temporarily disable it just by
typing ":".
If you don't like this you can add to your |config| any of the following:
- ignore mouse completely >
If you don't like this you can disable the mouse in your |config| using any of
the following:
- Disable mouse completely by unsetting the 'mouse' option: >
set mouse=
<
- no |popup-menu| but the right button extends selection >
- Pressing <RightMouse> extends selection instead of showing popup-menu: >
set mousemodel=extend
>
- pressing ALT+LeftMouse releases mouse until main cursor moves >
nnoremap <M-LeftMouse> <Cmd>
- Pressing <A-LeftMouse> releases mouse until the cursor moves: >
nnoremap <A-LeftMouse> <Cmd>
\ set mouse=<Bar>
\ echo 'mouse OFF until next cursor-move'<Bar>
\ autocmd CursorMoved * ++once set mouse&<Bar>
\ echo 'mouse ON'<CR>
<
Also, mouse is not in use in |command-mode| or at |more-prompt|. So if you
need to copy/paste with your terminal then just pressing ':' makes Nvim to
release the mouse cursor temporarily.
To remove the "How-to disable mouse" menu item and the separator above it: >vim
aunmenu PopUp.How-to\ disable\ mouse
aunmenu PopUp.-1-
<
Default Mappings ~
*default-mappings*
Nvim creates the following default mappings at |startup|. You can disable any
@ -162,7 +161,7 @@ Working intuitively and consistently is a major goal of Nvim.
- Nvim avoids features that cannot be provided on all platforms; instead that
is delegated to external plugins/extensions. E.g. the `-X` platform-specific
option is "sometimes" available in Vim (with potential surprises:
http://stackoverflow.com/q/14635295).
https://stackoverflow.com/q/14635295).
- Vim's internal test functions (test_autochdir(), test_settime(), etc.) are
not exposed (nor implemented); instead Nvim has a robust API.
@ -642,6 +641,9 @@ Options:
*'ttytype'* *'tty'*
weirdinvert
Performance:
Folds are not updated during insert-mode.
Startup:
--literal (file args are always literal; to expand wildcards on Windows, use
|:n| e.g. `nvim +"n *"`)

View File

@ -447,7 +447,7 @@ local function get_page(path, silent)
end
local function put_page(page)
vim.bo.modified = true
vim.bo.modifiable = true
vim.bo.readonly = false
vim.bo.swapfile = false

View File

@ -0,0 +1,20 @@
local M = {}
local report_ok = vim.fn['health#report_ok']
local report_error = vim.fn['health#report_error']
local function check_runtime_file(name)
local path = vim.env.VIMRUNTIME .. '/' .. name
if vim.loop.fs_stat(path) then
report_error(string.format('%s detected. Please delete %s', name, path))
else
report_ok(string.format('%s not in $VIMRUNTIME', name))
end
end
function M.check()
check_runtime_file('plugin/man.vim')
check_runtime_file('autoload/man.vim')
end
return M

View File

@ -12,21 +12,8 @@
-- Guideline: "If in doubt, put it in the runtime".
--
-- Most functions should live directly in `vim.`, not in submodules.
-- The only "forbidden" names are those claimed by legacy `if_lua`:
-- $ vim
-- :lua for k,v in pairs(vim) do print(k) end
-- buffer
-- open
-- window
-- lastline
-- firstline
-- type
-- line
-- eval
-- dict
-- beep
-- list
-- command
--
-- Compatibility with Vim's `if_lua` is explicitly a non-goal.
--
-- Reference (#6580):
-- - https://github.com/luafun/luafun
@ -122,9 +109,7 @@ function vim._os_proc_children(ppid)
return children
end
-- TODO(ZyX-I): Create compatibility layer.
--- Return a human-readable representation of the given object.
--- Gets a human-readable representation of the given object.
---
---@see https://github.com/kikito/inspect.lua
---@see https://github.com/mpeterv/vinspect
@ -183,7 +168,8 @@ do
local line1 = lines[1]:gsub('(%c)', '\022%1')
-- nvim_input() is affected by mappings,
-- so use nvim_feedkeys() with "n" flag to ignore mappings.
vim.api.nvim_feedkeys(line1, 'n', true)
-- "t" flag is also needed so the pasted text is saved in cmdline history.
vim.api.nvim_feedkeys(line1, 'nt', true)
end
return true
end

View File

@ -916,7 +916,7 @@ M.handlers.signs = {
end,
hide = function(namespace, bufnr)
local ns = M.get_namespace(namespace)
if ns.user_data.sign_group then
if ns.user_data.sign_group and vim.api.nvim_buf_is_valid(bufnr) then
vim.fn.sign_unplace(ns.user_data.sign_group, { buffer = bufnr })
end
end,
@ -971,7 +971,9 @@ M.handlers.underline = {
local ns = M.get_namespace(namespace)
if ns.user_data.underline_ns then
diagnostic_cache_extmarks[bufnr][ns.user_data.underline_ns] = {}
vim.api.nvim_buf_clear_namespace(bufnr, ns.user_data.underline_ns, 0, -1)
if vim.api.nvim_buf_is_valid(bufnr) then
vim.api.nvim_buf_clear_namespace(bufnr, ns.user_data.underline_ns, 0, -1)
end
end
end,
}
@ -1034,7 +1036,9 @@ M.handlers.virtual_text = {
local ns = M.get_namespace(namespace)
if ns.user_data.virt_text_ns then
diagnostic_cache_extmarks[bufnr][ns.user_data.virt_text_ns] = {}
vim.api.nvim_buf_clear_namespace(bufnr, ns.user_data.virt_text_ns, 0, -1)
if vim.api.nvim_buf_is_valid(bufnr) then
vim.api.nvim_buf_clear_namespace(bufnr, ns.user_data.virt_text_ns, 0, -1)
end
end
end,
}
@ -1423,11 +1427,15 @@ function M.reset(namespace, bufnr)
M.hide(iter_namespace, iter_bufnr)
end
vim.api.nvim_exec_autocmds('DiagnosticChanged', {
modeline = false,
buffer = iter_bufnr,
data = { diagnostics = {} },
})
if vim.api.nvim_buf_is_valid(iter_bufnr) then
vim.api.nvim_exec_autocmds('DiagnosticChanged', {
modeline = false,
buffer = iter_bufnr,
data = { diagnostics = {} },
})
else
diagnostic_cache[iter_bufnr] = nil
end
end
end

View File

@ -825,23 +825,16 @@ end
---
--- See |vim.lsp.start_client()| for all available options. The most important are:
---
--- `name` is an arbitrary name for the LSP client. It should be unique per
--- language server.
---
--- `cmd` the command as list - used to start the language server.
--- The command must be present in the `$PATH` environment variable or an
--- absolute path to the executable. Shell constructs like `~` are *NOT* expanded.
---
--- `root_dir` path to the project root.
--- By default this is used to decide if an existing client should be re-used.
--- The example above uses |vim.fs.find()| and |vim.fs.dirname()| to detect the
--- root by traversing the file system upwards starting
--- from the current directory until either a `pyproject.toml` or `setup.py`
--- file is found.
---
--- `workspace_folders` a list of { uri:string, name: string } tables.
--- The project root folders used by the language server.
--- If `nil` the property is derived from the `root_dir` for convenience.
--- - `name` arbitrary name for the LSP client. Should be unique per language server.
--- - `cmd` command (in list form) used to start the language server. Must be absolute, or found on
--- `$PATH`. Shell constructs like `~` are not expanded.
--- - `root_dir` path to the project root. By default this is used to decide if an existing client
--- should be re-used. The example above uses |vim.fs.find()| and |vim.fs.dirname()| to detect the
--- root by traversing the file system upwards starting from the current directory until either
--- a `pyproject.toml` or `setup.py` file is found.
--- - `workspace_folders` list of `{ uri:string, name: string }` tables specifying the project root
--- folders used by the language server. If `nil` the property is derived from `root_dir` for
--- convenience.
---
--- Language servers use this information to discover metadata like the
--- dependencies of your project and they tend to index the contents within the

View File

@ -20,6 +20,17 @@ local format_func = function(arg)
end
do
---@private
local function notify(msg, level)
if vim.in_fast_event() then
vim.schedule(function()
vim.notify(msg, level)
end)
else
vim.notify(msg, level)
end
end
local path_sep = vim.loop.os_uname().version:match('Windows') and '\\' or '/'
---@private
local function path_join(...)
@ -53,7 +64,7 @@ do
logfile, openerr = io.open(logfilename, 'a+')
if not logfile then
local err_msg = string.format('Failed to open LSP client log file: %s', openerr)
vim.notify(err_msg, vim.log.levels.ERROR)
notify(err_msg, vim.log.levels.ERROR)
return false
end
@ -64,7 +75,7 @@ do
log_info.size / (1000 * 1000),
logfilename
)
vim.notify(warn_msg)
notify(warn_msg)
end
-- Start message for logging

View File

@ -99,10 +99,10 @@ end
---
--- Examples:
--- <pre>
--- split(":aa::b:", ":") --> {'','aa','','b',''}
--- split("axaby", "ab?") --> {'','x','y'}
--- split("x*yz*o", "*", {plain=true}) --> {'x','yz','o'}
--- split("|x|y|z|", "|", {trimempty=true}) --> {'x', 'y', 'z'}
--- split(":aa::b:", ":") => {'','aa','','b',''}
--- split("axaby", "ab?") => {'','x','y'}
--- split("x*yz*o", "*", {plain=true}) => {'x','yz','o'}
--- split("|x|y|z|", "|", {trimempty=true}) => {'x', 'y', 'z'}
--- </pre>
---
---@see |vim.gsplit()|

View File

@ -164,7 +164,7 @@ function TSHighlighter:get_query(lang)
end
---@private
local function on_line_impl(self, buf, line, spell)
local function on_line_impl(self, buf, line, is_spell_nav)
self.tree:for_each_tree(function(tstree, tree)
if not tstree then
return
@ -201,17 +201,26 @@ local function on_line_impl(self, buf, line, spell)
local start_row, start_col, end_row, end_col = node:range()
local hl = highlighter_query.hl_cache[capture]
local is_spell = highlighter_query:query().captures[capture] == 'spell'
local capture_name = highlighter_query:query().captures[capture]
local spell = nil
if capture_name == 'spell' then
spell = true
elseif capture_name == 'nospell' then
spell = false
end
if hl and end_row >= line and (not spell or is_spell) then
-- Give nospell a higher priority so it always overrides spell captures.
local spell_pri_offset = capture_name == 'nospell' and 1 or 0
if hl and end_row >= line and (not is_spell_nav or spell ~= nil) then
a.nvim_buf_set_extmark(buf, ns, start_row, start_col, {
end_line = end_row,
end_col = end_col,
hl_group = hl,
ephemeral = true,
priority = tonumber(metadata.priority) or 100, -- Low but leaves room below
priority = (tonumber(metadata.priority) or 100) + spell_pri_offset, -- Low but leaves room below
conceal = metadata.conceal,
spell = is_spell,
spell = spell,
})
end
if start_row > line then

View File

@ -26,6 +26,8 @@
</screenshots>
<releases>
<release date="2022-12-29" version="0.8.2"/>
<release date="2022-11-14" version="0.8.1"/>
<release date="2022-09-30" version="0.8.0"/>
<release date="2022-04-15" version="0.7.0"/>
<release date="2021-12-31" version="0.6.1"/>

Some files were not shown because too many files have changed in this diff Show More