Compare commits

...

83 Commits

Author SHA1 Message Date
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
159 changed files with 2959 additions and 3059 deletions

View File

@ -51,14 +51,28 @@ jobs:
appimage: appimage:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container:
image: ubuntu:18.04
options: --privileged # Privileged mode is needed to load fuse module.
steps: 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 - uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update apt-get update
sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip 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') - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
run: CC=gcc-10 make appimage-latest run: CC=gcc-10 make appimage-latest
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') - if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')

View File

@ -1,6 +1,7 @@
# CMAKE REFERENCE # CMAKE REFERENCE
# intro: https://codingnest.com/basic-cmake/ # intro: https://codingnest.com/basic-cmake/
# best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1 # 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. # Version should match the tested CMAKE_URL in .github/workflows/ci.yml.
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.10)
@ -132,7 +133,7 @@ endif()
# version string, else they are combined with the result of `git describe`. # version string, else they are combined with the result of `git describe`.
set(NVIM_VERSION_MAJOR 0) set(NVIM_VERSION_MAJOR 0)
set(NVIM_VERSION_MINOR 8) set(NVIM_VERSION_MINOR 8)
set(NVIM_VERSION_PATCH 0) set(NVIM_VERSION_PATCH 1)
set(NVIM_VERSION_PRERELEASE "") # for package maintainers set(NVIM_VERSION_PRERELEASE "") # for package maintainers
# API level # API level
@ -639,7 +640,7 @@ include(InstallHelpers)
add_glob_targets( add_glob_targets(
TARGET lintpy TARGET lintpy
COMMAND ${FLAKE8_PRG} COMMAND ${FLAKE8_PRG}
FLAGS --max-line-length 88 FLAGS --max-line-length 100
GLOB_DIRS contrib scripts src test GLOB_DIRS contrib scripts src test
GLOB_PAT *.py GLOB_PAT *.py
TOUCH_STRATEGY SINGLE 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 - Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or
[Coverity](#coverity). [Coverity](#coverity).
- [Improve documentation](#documenting) - [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 Reporting problems
------------------ ------------------
@ -30,9 +33,9 @@ Reporting problems
Developer guidelines Developer guidelines
-------------------- --------------------
- Read `:help dev` if you are working on Nvim core. - Read [:help dev](https://neovim.io/doc/user/develop.html#dev) if you are working on Nvim core.
- Read `:help dev-ui` if you are developing a UI. - Read [:help dev-ui](https://neovim.io/doc/user/develop.html#dev-ui) if you are developing a UI.
- Read `:help dev-api-client` if you are developing an API client. - 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. - Install `ninja` for faster builds of Nvim.
``` ```
sudo apt-get install ninja-build sudo apt-get install ninja-build
@ -47,21 +50,19 @@ Pull requests (PRs)
- Your PR must include [test coverage][run-tests]. - Your PR must include [test coverage][run-tests].
- Avoid cosmetic changes to unrelated files in the same commit. - Avoid cosmetic changes to unrelated files in the same commit.
- Use a [feature branch][git-feature-branch] instead of the master branch. - Use a [feature branch][git-feature-branch] instead of the master branch.
- Use a **rebase workflow** for small PRs. - Use a _rebase workflow_ for small PRs.
- After addressing review comments, it's fine to rebase and force-push. - After addressing review comments, it's fine to force-push.
- Use a **merge workflow** for big, high-risk PRs. - 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 - Merge `master` into your PR when there are conflicts or when master
introduces breaking changes. 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. - 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 ### Stages: Draft and Ready for review

View File

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

View File

@ -12,23 +12,23 @@ General guidelines
* Use automation to solve problems * Use automation to solve problems
* Never break the API... but sometimes break the UI * 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 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: "after next". So there are usually one or two (at most) planned milestones:
- Next bugfix-release (1.0.x) * Next bugfix-release (1.0.x)
- Next feature-release (1.x.0) * Next feature-release (1.x.0)
The forecasting problem might be solved with an explicit priority system (like The forecasting problem might be solved with an explicit priority system (like
Bram's todo.txt). Meanwhile the Neovim priority system is defined by: Bram's todo.txt). Meanwhile the Neovim priority system is defined by:
- PRs nearing completion. * PRs nearing completion.
- Issue labels. E.g. the `+plan` label increases the ticket's priority merely * 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 for having a plan written down: it is _closer to completion_ than tickets
without a plan. 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 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 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`. 1. Fix the bug on `master`.
2. Cherry-pick the fix to `release-x.y`. 2. Cherry-pick the fix to `release-x.y`.
3. Cut a release from `release-x.y`. 3. Cut a release from `release-x.y`.
- Run `./scripts/release.sh` * Run `./scripts/release.sh`
- Update (force-push) the remote `stable` tag. * Update (force-push) the remote `stable` tag.
- The [CI job](https://github.com/neovim/neovim/blob/3d45706478cd030c3ee05b4f336164bb96138095/.github/workflows/release.yml#L11-L13) * 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. 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). ### Release automation
In order to trigger the action, a PR must be labeled with a label matching the
form `backport release-0.X`. 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 Third-party dependencies
-------------- ------------------------
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/CMakeLists.txt`: These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/CMakeLists.txt`.
- [Lua](https://www.lua.org/download.html) Some can be auto-bumped by `scripts/bump-deps.sh`.
- [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)
`scripts/bump-dep.sh` is a script that can automate this process for `LuaJIT`, `Luv`, `libuv` & `tree-sitter`. See usage guide: * [LuaJIT](https://github.com/LuaJIT/LuaJIT)
- Run `./scripts/bump-deps.sh --dep Luv --version 1.43.0-0` to update a dependency. * [Lua](https://www.lua.org/download.html)
See `./scripts/bump-deps.sh -h` for more detailed usage * [Luv](https://github.com/luvit/luv)
- Run `./scripts/bump-deps.sh --pr` to create a pr * [gettext](https://ftp.gnu.org/pub/gnu/gettext/)
To generate the default PR title and body, the script uses the most recent commit (not in `master`) with prefix `build(deps): ` * [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: ### Vendored dependencies
- [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)
We also maintain some forks, particularly for Windows, if we are waiting on upstream changes: These dependencies are "vendored" (inlined), we must update the sources manually:
https://github.com/neovim/neovim/wiki/Deps
* `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 See also
-------- --------
- https://github.com/neovim/neovim/issues/862 * https://github.com/neovim/neovim/issues/862
- https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt * 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_URL https://github.com/vigoux/tree-sitter-viml/archive/v0.2.0.tar.gz)
set(TREESITTER_VIM_SHA256 608dcc31a7948cb66ae7f45494620e2e9face1af75598205541f80d782ec4501) 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_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v1.2.2.tar.gz)
set(TREESITTER_HELP_SHA256 4c0ef80c6dc09acab362478950ec6be58a4ab1cbf2d95754b8fbb566e4c647a1) set(TREESITTER_HELP_SHA256 d33b9447dae04f19e1ac50c94b78e305574c07f942791f70aea96fe266447c18)
set(TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.20.7.tar.gz) set(TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.20.7.tar.gz)
set(TREESITTER_SHA256 b355e968ec2d0241bbd96748e00a9038f83968f85d822ecb9940cbe4c42e182e) set(TREESITTER_SHA256 b355e968ec2d0241bbd96748e00a9038f83968f85d822ecb9940cbe4c42e182e)

View File

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

View File

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

View File

@ -235,7 +235,7 @@ function! s:check_tmux() abort
endif endif
" check for RGB capabilities " 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_tc = stridx(info, " Tc: (flag) true") != -1
let has_rgb = stridx(info, " RGB: (flag) true") != -1 let has_rgb = stridx(info, " RGB: (flag) true") != -1
if !has_tc && !has_rgb 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') if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect')
let bufn = bufnr('%') let bufn = bufnr('%')
let ctext = getline(a:line) 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) if !empty(signs)
call sign_unplace('', {'id': signs[0].id}) call sign_unplace('', {'id': signs[0].id})
endif endif

View File

@ -13,7 +13,7 @@ set background=dark
hi clear hi clear
let g:colors_name = 'blue' 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') 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'] 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 hi clear
let g:colors_name = 'darkblue' 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') 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'] 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 hi clear
let g:colors_name = 'delek' 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') 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'] 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 hi clear
let g:colors_name = 'desert' 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') 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'] 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 hi clear
let g:colors_name = 'elflord' 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 Terminal Normal
hi! link Boolean Constant hi! link Boolean Constant

View File

@ -13,7 +13,7 @@ set background=dark
hi clear hi clear
let g:colors_name = 'evening' 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') 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'] 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 hi clear
let g:colors_name = 'habamax' 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') 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'] 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 hi clear
let g:colors_name = 'industry' 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') 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'] 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 hi clear
let g:colors_name = 'koehler' 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 Terminal Normal
hi! link Boolean Constant hi! link Boolean Constant

View File

@ -11,7 +11,7 @@
hi clear hi clear
let g:colors_name = 'lunaperche' 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 helpVim Title
hi! link helpHeader Title hi! link helpHeader Title

View File

@ -13,7 +13,7 @@ set background=light
hi clear hi clear
let g:colors_name = 'morning' 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') 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'] 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 hi clear
let g:colors_name = 'murphy' 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') 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'] 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 hi clear
let g:colors_name = 'pablo' 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') 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'] 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 hi clear
let g:colors_name = 'peachpuff' 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') 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'] 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 hi clear
let g:colors_name = 'quiet' 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 Terminal Normal
hi! link StatusLineTerm StatusLine hi! link StatusLineTerm StatusLine

View File

@ -12,7 +12,7 @@ set background=dark
hi clear hi clear
let g:colors_name = 'ron' 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 Terminal Normal
hi! link Boolean Constant hi! link Boolean Constant

View File

@ -13,7 +13,7 @@ set background=light
hi clear hi clear
let g:colors_name = 'shine' 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') 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'] 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 hi clear
let g:colors_name = 'slate' 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') 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'] 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 hi clear
let g:colors_name = 'torte' 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') 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'] 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 hi clear
let g:colors_name = 'zellner' 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') 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'] 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 :set arabicshape
------------------------------------------------------------------------------
Introduction Introduction
------------
Arabic is a rather demanding language in which a number of special Arabic is a rather demanding language in which a number of special
features are required. Characters are right-to-left oriented and features are required. Characters are right-to-left oriented and
ought to appear as such on the screen (i.e. from right to left). 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. the user interface remains the standard Vi interface.
------------------------------------------------------------------------------
Highlights Highlights
----------
o Editing left-to-right files as in the original Vim hasn't changed. 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 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. started within a Bidi capable terminal emulator.
------------------------------------------------------------------------------
Arabic Fonts *arabicfonts* Arabic Fonts *arabicfonts*
------------
Vim requires monospaced fonts of which there are many out there. Vim requires monospaced fonts of which there are many out there.
Arabic requires ISO-8859-6 as well as Presentation Form-B fonts 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. info on where to obtain the necessary Arabic fonts.
------------------------------------------------------------------------------
Font Installation Font Installation
-----------------
o Installation of fonts for X Window systems (Unix/Linux) 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 % xset +fp path_name_of_arabic_fonts_directory
------------------------------------------------------------------------------
Usage Usage
-----
Prior to the actual usage of Arabic within Vim, a number of settings Prior to the actual usage of Arabic within Vim, a number of settings
need to be accounted for and invoked. need to be accounted for and invoked.
@ -259,8 +262,8 @@ o Enable Arabic settings [short-cut]
':set arabicshape' to your vimrc file. ':set arabicshape' to your vimrc file.
------------------------------------------------------------------------------
Keymap/Keyboard *arabickeymap* Keymap/Keyboard *arabickeymap*
---------------
The character/letter encoding used in Vim is the standard UTF-8. The character/letter encoding used in Vim is the standard UTF-8.
It is widely discouraged that any other encoding be used or even 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 + CTRL-^ in insert/replace mode toggles between Arabic/Latin mode
+ Keyboard mapping is based on the Microsoft's Arabic keymap (the + 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 ' |< , |> . |? ؟ |
|z ئ |x ء |c ؤ |v ر |b لا |n ى |m ة |, و |. ز |/ ظ | |z ئ |x ء |c ؤ |v ر |b لا |n ى |m ة |, و |. ز |/ ظ |
+-------------------------------------------------+ +-------------------------------------------------+
<
------------------------------------------------------------------------------
Restrictions Restrictions
------------
o Vim in its GUI form does not currently support Bi-directionality o Vim in its GUI form does not currently support Bi-directionality
(i.e. the ability to see both Arabic and Latin intermixed within (i.e. the ability to see both Arabic and Latin intermixed within
the same line). the same line).
------------------------------------------------------------------------------
Known Bugs Known Bugs
----------
There is one known minor bug, 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 - executing a shell command
- |:checktime| - |:checktime|
- |FocusGained| - |FocusGained|
Not used when 'autoread' is set and the buffer Not used when 'autoread' is set and the buffer
was not changed. If a FileChangedShell was not changed. If a FileChangedShell
autocommand exists the warning message and 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 {feature} argument is a feature name like "nvim-0.2.1" or
"win32", see below. See also |exists()|. "win32", see below. See also |exists()|.
If the code has a syntax error, then Nvim may skip the rest To get the system name use |vim.loop|.os_uname() in Lua: >
of the line and miss |:endif|. > :lua print(vim.loop.os_uname().sysname)
if has('feature') | let x = this->breaks->without->the->feature | endif
< < If the code has a syntax error then Vimscript may skip the
Put |:if| and |:endif| on separate lines to avoid the rest of the line. Put |:if| and |:endif| on separate lines to
syntax error. > avoid the syntax error: >
if has('feature') if has('feature')
let x = this->breaks->without->the->feature let x = this->breaks->without->the->feature
endif endif
< <
Vim's compile-time feature-names (prefixed with "+") are not Vim's compile-time feature-names (prefixed with "+") are not
recognized because Nvim is always compiled with all possible 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 |RPC| messages. Clients can send |API| commands to the
returned address to control Nvim. returned address to control Nvim.
Returns the address string (may differ from the requested Returns the address string (which may differ from the
{address}). {address} argument, see below).
- 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.
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') if has('win32')
echo serverstart('\\.\pipe\nvim-pipe-1234') echo serverstart('\\.\pipe\nvim-pipe-1234')
else else
@ -7718,7 +7724,7 @@ sqrt({expr}) *sqrt()*
:echo sqrt(100) :echo sqrt(100)
< 10.0 > < 10.0 >
:echo sqrt(-4.01) :echo sqrt(-4.01)
< str2float('nan') < str2float("nan")
NaN may be different, it depends on system libraries. NaN may be different, it depends on system libraries.
Can also be used as a |method|: > Can also be used as a |method|: >
@ -7779,7 +7785,7 @@ stdpath({what}) *stdpath()* *E6100*
run String Run directory: temporary, local storage run String Run directory: temporary, local storage
for sockets, named pipes, etc. for sockets, named pipes, etc.
state String Session state directory: storage for file state String Session state directory: storage for file
drafts, undo, |shada|, etc. drafts, swap, undo, |shada|.
Example: > Example: >
:echo stdpath("config") :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. only bytes can be written to Nvim's own stderr.
*channel-callback* *channel-callback*
on_stdout({chan-id}, {data}, {name}) *on_stdout* - on_stdout({chan-id}, {data}, {name}) *on_stdout*
on_stderr({chan-id}, {data}, {name}) *on_stderr* - on_stderr({chan-id}, {data}, {name}) *on_stderr*
on_stdin({chan-id}, {data}, {name}) *on_stdin* - on_stdin({chan-id}, {data}, {name}) *on_stdin*
on_data({chan-id}, {data}, {name}) *on_data* - on_data({chan-id}, {data}, {name}) *on_data*
Scripts can react to channel activity (received data) via callback Scripts can react to channel activity (received data) via callback
functions assigned to the `on_stdout`, `on_stderr`, `on_stdin`, or functions assigned to the `on_stdout`, `on_stderr`, `on_stdin`, or
`on_data` option keys. Callbacks should be fast: avoid potentially `on_data` option keys. Callbacks should be fast: avoid potentially
slow/expensive work. slow/expensive work.
Parameters: ~ Parameters: ~
{chan-id} Channel handle. |channel-id| - {chan-id} Channel handle. |channel-id|
{data} Raw data (|readfile()|-style list of strings) read from - {data} Raw data (|readfile()|-style list of strings) read from
the channel. EOF is a single-item list: `['']`. First and the channel. EOF is a single-item list: `['']`. First and
last items may be partial lines! |channel-lines| 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 can handle multiple streams. Event names depend on how the
channel was opened and in what mode/protocol. 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): the final `['']` emitted at EOF):
- `foobar` may arrive as `['fo'], ['obar']` - `foobar` may arrive as `['fo'], ['obar']`
- `foo\nbar` may arrive as - `foo\nbar` may arrive as
`['foo','bar']` - `['foo','bar']`
or `['foo',''], ['bar']` - or `['foo',''], ['bar']`
or `['foo'], ['','bar']` - or `['foo'], ['','bar']`
or `['fo'], ['o','bar']` - or `['fo'], ['o','bar']`
There are two ways to deal with this: There are two ways to deal with this:
1. To wait for the entire output, use |channel-buffered| mode. - 1. To wait for the entire output, use |channel-buffered| mode.
2. To read line-by-line, use the following code: > - 2. To read line-by-line, use the following code: >
let s:lines = [''] let s:lines = ['']
func! s:on_event(job_id, data, event) dict func! s:on_event(job_id, data, event) dict
let eof = (a:data == ['']) 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. They should not be used in new scripts, and old scripts should be updated.
============================================================================== ==============================================================================
Deprecated features
API ~ API
*nvim_buf_clear_highlight()* Use |nvim_buf_clear_namespace()| instead. - *nvim_buf_clear_highlight()* Use |nvim_buf_clear_namespace()| instead.
*nvim_buf_set_virtual_text()* Use |nvim_buf_set_extmark()| instead. - *nvim_buf_set_virtual_text()* Use |nvim_buf_set_extmark()| instead.
*nvim_command_output()* Use |nvim_exec()| instead. - *nvim_command_output()* Use |nvim_exec()| instead.
*nvim_execute_lua()* Use |nvim_exec_lua()| instead. - *nvim_execute_lua()* Use |nvim_exec_lua()| instead.
Commands ~ COMMANDS
*:rv* - *:rv* *:rviminfo* Deprecated alias to |:rshada| command.
*:rviminfo* Deprecated alias to |:rshada| command. - *:wv* *:wviminfo* Deprecated alias to |:wshada| command.
*:wv*
*:wviminfo* Deprecated alias to |:wshada| command.
Environment Variables ~ ENVIRONMENT VARIABLES
*$NVIM_LISTEN_ADDRESS* Deprecated way to - *$NVIM_LISTEN_ADDRESS*
* set the server name (use |--listen| instead) - Deprecated way to:
* get the server name (use |v:servername| instead) - set the server name (use |--listen| or |serverstart()| instead)
* detect a parent Nvim (use |$NVIM| instead) - get the server name (use |v:servername| instead)
Unset by |terminal| and |jobstart()| (unless explicitly - detect a parent Nvim (use |$NVIM| instead)
given by the "env" option). Ignored if --listen is given. - 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 ~ EVENTS
*BufCreate* Use |BufAdd| instead. - *BufCreate* Use |BufAdd| instead.
*EncodingChanged* Never fired; 'encoding' is always "utf-8". - *EncodingChanged* Never fired; 'encoding' is always "utf-8".
*FileEncoding* Never fired; equivalent to |EncodingChanged|. - *FileEncoding* Never fired; equivalent to |EncodingChanged|.
*GUIEnter* Never fired; use |UIEnter| instead. - *GUIEnter* Never fired; use |UIEnter| instead.
*GUIFailed* Never fired. - *GUIFailed* Never fired.
Keycodes ~ KEYCODES
*<MouseDown>* Use <ScrollWheelUp> instead. - *<MouseDown>* Use <ScrollWheelUp> instead.
*<MouseUp>* Use <ScrollWheelDown> instead. - *<MouseUp>* Use <ScrollWheelDown> instead.
Functions ~ FUNCTIONS
*buffer_exists()* Obsolete name for |bufexists()|. - *buffer_exists()* Obsolete name for |bufexists()|.
*buffer_name()* Obsolete name for |bufname()|. - *buffer_name()* Obsolete name for |bufname()|.
*buffer_number()* Obsolete name for |bufnr()|. - *buffer_number()* Obsolete name for |bufnr()|.
*file_readable()* Obsolete name for |filereadable()|. - *file_readable()* Obsolete name for |filereadable()|.
*health#report_error* Use Lua |vim.health.report_error()| instead. - *health#report_error* Use Lua |vim.health.report_error()| instead.
*health#report_info* Use Lua |vim.health.report_info()| instead. - *health#report_info* Use Lua |vim.health.report_info()| instead.
*health#report_ok* Use Lua |vim.health.report_ok()| instead. - *health#report_ok* Use Lua |vim.health.report_ok()| instead.
*health#report_start* Use Lua |vim.health.report_start()| instead. - *health#report_start* Use Lua |vim.health.report_start()| instead.
*health#report_warn* Use Lua |vim.health.report_warn()| instead. - *health#report_warn* Use Lua |vim.health.report_warn()| instead.
*highlight_exists()* Obsolete name for |hlexists()|. - *highlight_exists()* Obsolete name for |hlexists()|.
*highlightID()* Obsolete name for |hlID()|. - *highlightID()* Obsolete name for |hlID()|.
*inputdialog()* Use |input()| instead. - *inputdialog()* Use |input()| instead.
*jobclose()* Obsolete name for |chanclose()| - *jobclose()* Obsolete name for |chanclose()|
*jobsend()* Obsolete name for |chansend()| - *jobsend()* Obsolete name for |chansend()|
*last_buffer_nr()* Obsolete name for bufnr("$"). - *last_buffer_nr()* Obsolete name for bufnr("$").
*rpcstop()* Deprecated. Instead use |jobstop()| to stop any job, - *rpcstop()* Use |jobstop()| instead to stop any job, or
or chanclose(id, "rpc") to close RPC communication `chanclose(id, "rpc")` to close RPC communication
without stopping the job. Use chanclose(id) to close without stopping the job. Use chanclose(id) to close
any socket. any socket.
Highlights ~ HIGHLIGHTS
- *hl-VertSplit* Use |hl-WinSeparator| instead.
*hl-VertSplit* Use |hl-WinSeparator| instead.
LSP Diagnostics ~
LSP DIAGNOSTICS
For each of the functions below, use the corresponding function in For each of the functions below, use the corresponding function in
|vim.diagnostic| instead (unless otherwise noted). For example, use |vim.diagnostic| instead (unless otherwise noted). For example, use
|vim.diagnostic.get()| instead of |vim.lsp.diagnostic.get()|. |vim.diagnostic.get()| instead of |vim.lsp.diagnostic.get()|.
*vim.lsp.diagnostic.clear()* Use |vim.diagnostic.hide()| instead. - *vim.lsp.diagnostic.clear()* Use |vim.diagnostic.hide()| instead.
*vim.lsp.diagnostic.disable()* - *vim.lsp.diagnostic.disable()*
*vim.lsp.diagnostic.display()* Use |vim.diagnostic.show()| instead. - *vim.lsp.diagnostic.display()* Use |vim.diagnostic.show()| instead.
*vim.lsp.diagnostic.enable()* - *vim.lsp.diagnostic.enable()*
*vim.lsp.diagnostic.get()* - *vim.lsp.diagnostic.get()*
*vim.lsp.diagnostic.get_all()* Use |vim.diagnostic.get()| instead. - *vim.lsp.diagnostic.get_all()* Use |vim.diagnostic.get()| instead.
*vim.lsp.diagnostic.get_count()* Use |vim.diagnostic.get()| instead. - *vim.lsp.diagnostic.get_count()* Use |vim.diagnostic.get()| instead.
*vim.lsp.diagnostic.get_line_diagnostics()* - *vim.lsp.diagnostic.get_line_diagnostics()* Use |vim.diagnostic.get()| instead.
Use |vim.diagnostic.get()| instead. - *vim.lsp.diagnostic.get_next()*
*vim.lsp.diagnostic.get_next()* - *vim.lsp.diagnostic.get_next_pos()*
*vim.lsp.diagnostic.get_next_pos()* - *vim.lsp.diagnostic.get_prev()*
*vim.lsp.diagnostic.get_prev()* - *vim.lsp.diagnostic.get_prev_pos()*
*vim.lsp.diagnostic.get_prev_pos()* - *vim.lsp.diagnostic.get_virtual_text_chunks_for_line()* No replacement. Use
*vim.lsp.diagnostic.get_virtual_text_chunks_for_line()* options provided by |vim.diagnostic.config()| to customize virtual text.
No replacement. Use options provided by - *vim.lsp.diagnostic.goto_next()*
|vim.diagnostic.config()| to customize - *vim.lsp.diagnostic.goto_prev()*
virtual text. - *vim.lsp.diagnostic.redraw()* Use |vim.diagnostic.show()| instead.
*vim.lsp.diagnostic.goto_next()* - *vim.lsp.diagnostic.reset()*
*vim.lsp.diagnostic.goto_prev()* - *vim.lsp.diagnostic.save()* Use |vim.diagnostic.set()| instead.
*vim.lsp.diagnostic.redraw()* Use |vim.diagnostic.show()| instead. - *vim.lsp.diagnostic.set_loclist()* Use |vim.diagnostic.setloclist()| instead.
*vim.lsp.diagnostic.reset()* - *vim.lsp.diagnostic.set_qflist()* Use |vim.diagnostic.setqflist()| instead.
*vim.lsp.diagnostic.save()* Use |vim.diagnostic.set()| instead. - *vim.lsp.diagnostic.show_line_diagnostics()* Use |vim.diagnostic.open_float()| instead.
*vim.lsp.diagnostic.set_loclist()* Use |vim.diagnostic.setloclist()| instead. - *vim.lsp.diagnostic.show_position_diagnostics()* Use |vim.diagnostic.open_float()| 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()*
The following are deprecated without replacement. These functions are moved The following are deprecated without replacement. These functions are moved
internally and are no longer exposed as part of the API. Instead, use internally and are no longer exposed as part of the API. Instead, use
|vim.diagnostic.config()| and |vim.diagnostic.show()|. |vim.diagnostic.config()| and |vim.diagnostic.show()|.
*vim.lsp.diagnostic.set_signs()* - *vim.lsp.diagnostic.set_signs()*
*vim.lsp.diagnostic.set_underline()* - *vim.lsp.diagnostic.set_underline()*
*vim.lsp.diagnostic.set_virtual_text()* - *vim.lsp.diagnostic.set_virtual_text()*
LSP Functions ~ LSP FUNCTIONS
- *vim.lsp.util.diagnostics_to_items()* Use |vim.diagnostic.toqflist()| instead.
*vim.lsp.util.diagnostics_to_items()* Use |vim.diagnostic.toqflist()| instead. - *vim.lsp.util.set_qflist()* Use |setqflist()| instead.
*vim.lsp.util.set_qflist()* Use |setqflist()| instead. - *vim.lsp.util.set_loclist()* Use |setloclist()| instead.
*vim.lsp.util.set_loclist()* Use |setloclist()| instead. - *vim.lsp.buf_get_clients()* Use |vim.lsp.get_active_clients()| with
*vim.lsp.buf_get_clients()* Use |vim.lsp.get_active_clients()| with
{buffer = bufnr} instead. {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 ~ LUA
*vim.register_keystroke_callback()* Use |vim.on_key()| instead. - *vim.register_keystroke_callback()* Use |vim.on_key()| instead.
Modifiers ~ NORMAL COMMANDS
*cpo-<* - *]f* *[f* Same as "gf".
*:menu-<special>*
*:menu-special* <> notation is always enabled.
*:map-<special>*
*:map-special* <> notation is always enabled.
Normal commands ~ OPTIONS
*]f* - *cpo-<* *:menu-<special>* *:menu-special* *:map-<special>* *:map-special*
*[f* Same as "gf". `<>` notation is always enabled.
- *'cscopeverbose'* Enabled by default. Use |:silent| instead.
Options ~ - *'exrc'* *'ex'* Security risk: downloaded files could include
*'cscopeverbose'* Enabled by default. Use |:silent| instead.
*'exrc'* *'ex'* Security risk: downloaded files could include
a malicious .nvimrc or .exrc file. See 'secure'. a malicious .nvimrc or .exrc file. See 'secure'.
Recommended alternative: define an autocommand in your Recommended alternative: define an autocommand in your
|vimrc| to set options for a matching directory. |vimrc| to set options for a matching directory.
'gd' - 'gdefault' Enables the |:substitute| flag 'g' by default.
'gdefault' Enables the |:substitute| flag 'g' by default. - *'fe'* 'fenc'+'enc' before Vim 6.0; no longer used.
*'fe'* 'fenc'+'enc' before Vim 6.0; no longer used. - *'highlight'* *'hl'* Names of builtin |highlight-groups| cannot be changed.
*'highlight'* *'hl'* Names of builtin |highlight-groups| cannot be changed. - *'langnoremap'* Deprecated alias to 'nolangremap'.
*'langnoremap'* Deprecated alias to 'nolangremap'. - 'sessionoptions' Flags "unix", "slash" are ignored and always enabled.
'sessionoptions' Flags "unix", "slash" are ignored and always enabled. - *'vi'*
*'vi'* - 'viewoptions' Flags "unix", "slash" are ignored and always enabled.
'viewoptions' Flags "unix", "slash" are ignored and always enabled. - *'viminfo'* Deprecated alias to 'shada' option.
*'viminfo'* Deprecated alias to 'shada' option. - *'viminfofile'* Deprecated alias to 'shadafile' option.
*'viminfofile'* Deprecated alias to 'shadafile' option.
UI extensions~ UI EXTENSIONS
*ui-wildmenu* Use |ui-cmdline| with |ui-popupmenu| instead. Enabled - *ui-wildmenu* Use |ui-cmdline| with |ui-popupmenu| instead. Enabled
by the `ext_wildmenu` |ui-option|. Emits these events: by the `ext_wildmenu` |ui-option|. Emits these events:
["wildmenu_show", items] - `["wildmenu_show", items]`
["wildmenu_select", selected] - `["wildmenu_select", selected]`
["wildmenu_hide"] - `["wildmenu_hide"]`
Variables~ VARIABLES
*b:terminal_job_pid* PID of the top-level process in a |:terminal|. - *b:terminal_job_pid* PID of the top-level process in a |:terminal|.
Use `jobpid(&channel)` instead. Use `jobpid(&channel)` instead.
vim:noet:tw=78:ts=8:ft=help:norl: 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. 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. 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 (docstrings, user manual, website materials, newsletters, …). Don't mince
words. Personality and flavor, used sparingly, are welcome--but in general, words. Personality and flavor, used sparingly, are welcome--but in general,
optimize for the reader's time and energy: be "precise yet concise". 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". - Prefer the active voice: "Foo does X", not "X is done by Foo".
- Vim differences: - Vim differences:
- Do not prefix help tags with "nvim-". Use |vim_diff.txt| to catalog - 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" - Use "tui-" to prefix help tags related to the host terminal, and "TUI"
in prose if possible. in prose if possible.
- Docstrings: do not start parameter descriptions with "The" or "A" unless it - Docstrings: do not start parameter descriptions with "The" or "A" unless it
is critical to avoid ambiguity. is critical to avoid ambiguity. >
GOOD: > GOOD:
/// @param dirname Path fragment before `pend` /// @param dirname Path fragment before `pend`
< BAD: > BAD:
/// @param dirname The path fragment before `pend` /// @param dirname The path fragment before `pend`
< <
Documentation format ~ Documentation format ~
@ -163,6 +164,9 @@ Strict "vimdoc" subset:
that you don't want auto-wrapped. Lists are always rendered with "flow" that you don't want auto-wrapped. Lists are always rendered with "flow"
(soft-wrapped) layout instead of preformatted (hard-wrapped) layout common (soft-wrapped) layout instead of preformatted (hard-wrapped) layout common
in legacy :help docs. 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). - Separate blocks (paragraphs) of content by a blank line(s).
- Do not use indentation in random places—that prevents the page from using - Do not use indentation in random places—that prevents the page from using
"flow" layout. If you need a preformatted section, put it in "flow" layout. If you need a preformatted section, put it in
@ -180,7 +184,7 @@ Docstring format:
`@note`, `@param`, `@returns` `@note`, `@param`, `@returns`
- Limited markdown is supported. - Limited markdown is supported.
- List-items start with `-` (useful to nest or "indent") - 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 Example: the help for |nvim_open_win()| is generated from a docstring defined
in src/nvim/api/win_config.c like this: > in src/nvim/api/win_config.c like this: >
@ -218,7 +222,7 @@ Docstring format:
`---@see`, `---@param`, `---@returns` `---@see`, `---@param`, `---@returns`
- Limited markdown is supported. - Limited markdown is supported.
- List-items start with `-` (useful to nest or "indent") - 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 Example: the help for |vim.paste()| is generated from a docstring decorating
vim.paste in runtime/lua/vim/_editor.lua like this: > vim.paste in runtime/lua/vim/_editor.lua like this: >
@ -251,7 +255,8 @@ LUA *dev-lua*
API *dev-api* 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} nvim_{thing}_{action}_{arbitrary-qualifiers}
If the function acts on an object then {thing} is the name of that object 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). with a {thing} that groups functions under a common concept).
Use existing common {action} names if possible: Use existing common {action} names if possible:
add Append to, or insert into, a collection - add Append to, or insert into, a collection
create Create a new thing - call Call a function
del Delete a thing (or group of things) - create Create a new (non-trivial) thing
exec Execute code - del Delete a thing (or group of things)
get Get a thing (or group of things by query) - eval Evaluate an expression
list Get all things - exec Execute code
set Set a thing (or group of things) - 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: Do NOT use these deprecated verbs:
buf Buffer - list Redundant with "get"
pos Position
tab Tabpage
win Window
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" 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: Example:
`nvim_get_current_line` acts on the global editor state; the common `nvim_get_keymap('v')` operates in a global context (first parameter is not
{action} "get" is used but {thing} is omitted. 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: Example:
`nvim_buf_add_highlight` acts on a `Buffer` object (the first parameter) `nvim_buf_del_mark` acts on a `Buffer` object (the first parameter)
and uses the common {action} "add". and uses the "del" {action}.
Example: Use this format to name new API events:
`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:
nvim_{thing}_{event}_event nvim_{thing}_{event}_event
Example: 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. it confuses users, and complicates documentation and discussions.
Examples of API-client package names: Examples of API-client package names:
GOOD: nvim-racket - GOOD: nvim-racket
GOOD: pynvim - GOOD: pynvim
BAD: python-client - BAD: python-client
BAD: neovim - BAD: neovim
API client implementation guidelines ~ 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. 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. any of the above.
Parameters: ~ 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 configuration. Otherwise, a configuration table with the
following keys: following keys:
• underline: (default true) Use underline for • underline: (default true) Use underline for
@ -397,32 +397,32 @@ config({opts}, {namespace}) *vim.diagnostic.config()*
severities are displayed before lower severities (e.g. severities are displayed before lower severities (e.g.
ERROR is displayed before WARN). Options: ERROR is displayed before WARN). Options:
• reverse: (boolean) Reverse sort order • 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. When omitted, update the global diagnostic options.
disable({bufnr}, {namespace}) *vim.diagnostic.disable()* disable({bufnr}, {namespace}) *vim.diagnostic.disable()*
Disable diagnostics in the given buffer. Disable diagnostics in the given buffer.
Parameters: ~ 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. 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. namespace.
enable({bufnr}, {namespace}) *vim.diagnostic.enable()* enable({bufnr}, {namespace}) *vim.diagnostic.enable()*
Enable diagnostics in the given buffer. Enable diagnostics in the given buffer.
Parameters: ~ 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. 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. namespace.
fromqflist({list}) *vim.diagnostic.fromqflist()* fromqflist({list}) *vim.diagnostic.fromqflist()*
Convert a list of quickfix items to a list of diagnostics. Convert a list of quickfix items to a list of diagnostics.
Parameters: ~ Parameters: ~
{list} (table) A list of quickfix items from |getqflist()| or {list} (table) A list of quickfix items from |getqflist()| or
|getloclist()|. |getloclist()|.
Return: ~ Return: ~
@ -432,9 +432,9 @@ get({bufnr}, {opts}) *vim.diagnostic.get()*
Get current diagnostics. Get current diagnostics.
Parameters: ~ 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. 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: (number) Limit diagnostics to the given
namespace. namespace.
• lnum: (number) Limit diagnostics to the given line number. • lnum: (number) Limit diagnostics to the given line number.
@ -447,7 +447,7 @@ get_namespace({namespace}) *vim.diagnostic.get_namespace()*
Get namespace metadata. Get namespace metadata.
Parameters: ~ Parameters: ~
{namespace} (number) Diagnostic namespace {namespace} (number) Diagnostic namespace
Return: ~ Return: ~
(table) Namespace metadata (table) Namespace metadata
@ -462,7 +462,7 @@ get_next({opts}) *vim.diagnostic.get_next()*
Get the next diagnostic closest to the cursor position. Get the next diagnostic closest to the cursor position.
Parameters: ~ Parameters: ~
{opts} (table) See |vim.diagnostic.goto_next()| {opts} (table) See |vim.diagnostic.goto_next()|
Return: ~ Return: ~
(table) Next diagnostic (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. Return the position of the next diagnostic in the current buffer.
Parameters: ~ Parameters: ~
{opts} (table) See |vim.diagnostic.goto_next()| {opts} (table) See |vim.diagnostic.goto_next()|
Return: ~ Return: ~
(table) Next diagnostic position as a (row, col) tuple. (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. Get the previous diagnostic closest to the cursor position.
Parameters: ~ Parameters: ~
{opts} (table) See |vim.diagnostic.goto_next()| {opts} (table) See |vim.diagnostic.goto_next()|
Return: ~ Return: ~
(table) Previous diagnostic (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. Return the position of the previous diagnostic in the current buffer.
Parameters: ~ Parameters: ~
{opts} (table) See |vim.diagnostic.goto_next()| {opts} (table) See |vim.diagnostic.goto_next()|
Return: ~ Return: ~
(table) Previous diagnostic position as a (row, col) tuple. (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. Move to the next diagnostic.
Parameters: ~ 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: (number) Only consider diagnostics from the given
namespace. namespace.
• cursor_position: (cursor position) Cursor position as a • 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. Move to the previous diagnostic in the current buffer.
Parameters: ~ Parameters: ~
{opts} (table) See |vim.diagnostic.goto_next()| {opts} (table) See |vim.diagnostic.goto_next()|
hide({namespace}, {bufnr}) *vim.diagnostic.hide()* hide({namespace}, {bufnr}) *vim.diagnostic.hide()*
Hide currently displayed diagnostics. Hide currently displayed diagnostics.
@ -532,9 +532,9 @@ hide({namespace}, {bufnr}) *vim.diagnostic.hide()*
|vim.diagnostic.disable()|. |vim.diagnostic.disable()|.
Parameters: ~ Parameters: ~
{namespace} (number|nil) Diagnostic namespace. When omitted, hide {namespace} (number|nil) Diagnostic namespace. When omitted, hide
diagnostics from all namespaces. 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. omitted, hide diagnostics in all buffers.
*vim.diagnostic.match()* *vim.diagnostic.match()*
@ -555,13 +555,13 @@ match({str}, {pat}, {groups}, {severity_map}, {defaults})
< <
Parameters: ~ Parameters: ~
{str} (string) String to parse diagnostics from. {str} (string) String to parse diagnostics from.
{pat} (string) Lua pattern with capture groups. {pat} (string) Lua pattern with capture groups.
{groups} (table) List of fields in a |diagnostic-structure| to {groups} (table) List of fields in a |diagnostic-structure| to
associate with captures from {pat}. 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|. {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 listed in {groups}. When omitted, numeric values
default to 0 and "severity" defaults to ERROR. 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. Show diagnostics in a floating window.
Parameters: ~ 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 |vim.lsp.util.open_floating_preview()| in addition to the
following: following:
• bufnr: (number) Buffer number to show diagnostics from. • bufnr: (number) Buffer number to show diagnostics from.
@ -631,27 +631,27 @@ reset({namespace}, {bufnr}) *vim.diagnostic.reset()*
re-displayed, use |vim.diagnostic.hide()|. re-displayed, use |vim.diagnostic.hide()|.
Parameters: ~ Parameters: ~
{namespace} (number|nil) Diagnostic namespace. When omitted, remove {namespace} (number|nil) Diagnostic namespace. When omitted, remove
diagnostics from all namespaces. 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. When omitted, diagnostics are removed for all buffers.
set({namespace}, {bufnr}, {diagnostics}, {opts}) *vim.diagnostic.set()* set({namespace}, {bufnr}, {diagnostics}, {opts}) *vim.diagnostic.set()*
Set diagnostics for the given namespace and buffer. Set diagnostics for the given namespace and buffer.
Parameters: ~ Parameters: ~
{namespace} (number) The diagnostic namespace {namespace} (number) The diagnostic namespace
{bufnr} (number) Buffer number {bufnr} (number) Buffer number
{diagnostics} (table) A list of diagnostic items {diagnostics} (table) A list of diagnostic items
|diagnostic-structure| |diagnostic-structure|
{opts} (table|nil) Display options to pass to {opts} (table|nil) Display options to pass to
|vim.diagnostic.show()| |vim.diagnostic.show()|
setloclist({opts}) *vim.diagnostic.setloclist()* setloclist({opts}) *vim.diagnostic.setloclist()*
Add buffer diagnostics to the location list. Add buffer diagnostics to the location list.
Parameters: ~ 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: (number) Only add diagnostics from the given
namespace. namespace.
• winnr: (number, default 0) Window number to set location • 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. Add all diagnostics to the quickfix list.
Parameters: ~ 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: (number) Only add diagnostics from the given
namespace. namespace.
• open: (boolean, default true) Open quickfix list after • 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. Display diagnostics for the given namespace and buffer.
Parameters: ~ Parameters: ~
{namespace} (number|nil) Diagnostic namespace. When omitted, show {namespace} (number|nil) Diagnostic namespace. When omitted, show
diagnostics from all namespaces. 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. 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 use the saved diagnostics for the given namespace and
buffer. This can be used to display a list of buffer. This can be used to display a list of
diagnostics without saving them or to display only a diagnostics without saving them or to display only a
subset of diagnostics. May not be used when {namespace} subset of diagnostics. May not be used when {namespace}
or {bufnr} is nil. or {bufnr} is nil.
{opts} (table|nil) Display options. See {opts} (table|nil) Display options. See
|vim.diagnostic.config()|. |vim.diagnostic.config()|.
toqflist({diagnostics}) *vim.diagnostic.toqflist()* toqflist({diagnostics}) *vim.diagnostic.toqflist()*
@ -698,7 +698,7 @@ toqflist({diagnostics}) *vim.diagnostic.toqflist()*
passed to |setqflist()| or |setloclist()|. passed to |setqflist()| or |setloclist()|.
Parameters: ~ Parameters: ~
{diagnostics} (table) List of diagnostics |diagnostic-structure|. {diagnostics} (table) List of diagnostics |diagnostic-structure|.
Return: ~ Return: ~
array of quickfix list items |setqflist-what| 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 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 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* USING PATCHES *diff-patchexpr*

View File

@ -2141,9 +2141,11 @@ v:scrollstart String describing the script or function that caused the
hit-enter prompt. hit-enter prompt.
*v:servername* *servername-variable* *v:servername* *servername-variable*
v:servername Primary listen-address of the current Nvim instance, the first v:servername Primary listen-address of Nvim, the first item returned by
item returned by |serverlist()|. Can be set by |--listen| or |serverlist()|. Usually this is the named pipe created by Nvim
|$NVIM_LISTEN_ADDRESS| (deprecated) at startup. at |startup| or given by |--listen| (or the deprecated
|$NVIM_LISTEN_ADDRESS| env var).
See also |serverstart()| |serverstop()|. See also |serverstart()| |serverstop()|.
Read-only. 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: To enable them, assign a value to the option. For example, to turn one on:
> >
> let g:ada_standard_types = 1 > let g:ada_standard_types = 1
>
To disable them use ":unlet". Example: To disable them use ":unlet". Example:
> >
> unlet g:ada_standard_types > 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: Ada and enhance the ability of the Ada mode:
backup.vim 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. Keeps as many backups as you like so you don't have to.
rainbow_parenthesis.vim 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 ')'. Very helpful since Ada uses only '(' and ')'.
nerd_comments.vim 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 Excellent commenting and uncommenting support for almost any
programming language. programming language.
matchit.vim 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 '{}' '%' jumping for any language. The normal '%' jump only works for '{}'
style languages. The Ada mode will set the needed search patterns. style languages. The Ada mode will set the needed search patterns.
taglist.vim 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. Source code explorer sidebar. There is a patch for Ada available.
The GNU Ada Project distribution (http://gnuada.sourceforge.net) of Vim The GNU Ada Project distribution (http://gnuada.sourceforge.net) of Vim

View File

@ -39,7 +39,7 @@ navigation.
1.1 Matchit *sql-matchit* 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 provides many additional features and can be customized for different
languages. The matchit plugin is configured by defining a local languages. The matchit plugin is configured by defining a local
buffer variable, b:match_words. Pressing the % key while on various buffer variable, b:match_words. Pressing the % key while on various
@ -296,7 +296,7 @@ exist.
3. Adding new SQL Dialects *sql-adding-dialects* 3. Adding new SQL Dialects *sql-adding-dialects*
If you begin working with a SQL dialect which does not have any customizations 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 to see if any customization currently exist. If not, you can begin by cloning
an existing script. Read |filetype-plugins| for more details. 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 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 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. Dynamic mode is used by several features of the SQL completion plugin.
After installing the dbext plugin see the dbext-tutorial for additional 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 Dynamic features
---------------- ----------------
To take advantage of the dynamic features you must first install the 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, also comes with a tutorial. From the SQL completion plugin's perspective,
the main feature dbext provides is a connection to a database. dbext the main feature dbext provides is a connection to a database. dbext
connection profiles are the most efficient mechanism to define connection connection profiles are the most efficient mechanism to define connection

View File

@ -251,7 +251,7 @@ At this moment translations are available for:
Japanese - multiple authors Japanese - multiple authors
Polish - translated by Mikolaj Machowski Polish - translated by Mikolaj Machowski
Russian - translated by Vassily Ragosin 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: 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. for any matches.
Or you may use the following scheme, inspired by Vim/Cscope tutorial from 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-_>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>g :cs find g <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* *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. downloading Ruby there.
Type |gO| to see the table of contents. 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 statement of almost arbitrary type. Correct indentation requires
compiler-quality parsing. Old code with do loops ending on labelled statements compiler-quality parsing. Old code with do loops ending on labelled statements
of arbitrary type can be indented with elaborate programs such as Tidy 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 also left unindented because continue statements are also used for purposes
other than ending a do loop. Programs such as Tidy can convert structured 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 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 ~ tag char action in Insert mode ~
----------------------------------------------------------------------- -----------------------------------------------------------------------
|i_CTRL-@| CTRL-@ insert previously inserted text and stop |i_CTRL-@| CTRL-@ insert previously inserted text and stop
insert insert
|i_CTRL-A| CTRL-A insert previously inserted text |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 ~ tag char note action in Normal mode ~
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
CTRL-@ not used CTRL-@ not used
|CTRL-A| CTRL-A 2 add N to number at/after cursor |CTRL-A| CTRL-A 2 add N to number at/after cursor
|CTRL-B| CTRL-B 1 scroll N screens Backwards |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 ~ tag command action in op-pending and Visual mode ~
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
|v_aquote| a" double quoted string |v_aquote| a" double quoted string
|v_a'| a' single quoted string |v_a'| a' single quoted string
|v_a(| a( same as ab |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 ~ tag command action in Normal mode ~
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
|CTRL-W_CTRL-B| CTRL-W CTRL-B same as "CTRL-W b" |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-C| CTRL-W CTRL-C same as "CTRL-W c"
|CTRL-W_CTRL-D| CTRL-W CTRL-D same as "CTRL-W d" |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 ~ tag char note action in Normal mode ~
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
|[_CTRL-D| [ CTRL-D jump to first #define found in current and |[_CTRL-D| [ CTRL-D jump to first #define found in current and
included files matching the word under the included files matching the word under the
cursor, start searching at beginning of cursor, start searching at beginning of
@ -699,6 +704,7 @@ tag char note action in Normal mode ~
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-A g CTRL-A dump a memory profile
|g_CTRL-G| g CTRL-G show information about current cursor |g_CTRL-G| g CTRL-G show information about current cursor
position position
@ -802,6 +808,7 @@ g_CTRL-A g CTRL-A dump a memory profile
tag char note action in Normal mode ~ tag char note action in Normal mode ~
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
|z<CR>| z<CR> redraw, cursor line to top of window, |z<CR>| z<CR> redraw, cursor line to top of window,
cursor on first non-blank cursor on first non-blank
|zN<CR>| z{height}<CR> redraw, make window {height} lines high |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 ~ tag char action in Operator-pending mode ~
----------------------------------------------------------------------- -----------------------------------------------------------------------
|o_v| v force operator to work charwise |o_v| v force operator to work charwise
|o_V| V force operator to work linewise |o_V| V force operator to work linewise
|o_CTRL-V| CTRL-V force operator to work blockwise |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 ~ tag command note action in Visual mode ~
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
|v_CTRL-\_CTRL-N| CTRL-\ CTRL-N stop 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-\_CTRL-G| CTRL-\ CTRL-G go to Normal mode
|v_CTRL-A| CTRL-A 2 add N to number in highlighted text |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 ~ tag command action in Command-line editing mode ~
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
CTRL-@ not used CTRL-@ not used
|c_CTRL-A| CTRL-A do completion on the pattern in front of the |c_CTRL-A| CTRL-A do completion on the pattern in front of the
cursor and insert all matches cursor and insert all matches
@ -1110,7 +1120,7 @@ to terminal mode.
You found it, Arthur! *holy-grail* 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 This is a brief but complete listing of all the ":" commands, without
mentioning any arguments. The optional part of the command name is inside []. 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 ~ tag command action ~
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
|:| : nothing |:| : nothing
|:range| :{range} go to last line in {range} |:range| :{range} go to last line in {range}
|:!| :! filter lines or execute an external command |:!| :! 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 Exuberant ctags, because it adds extra information that is needed for
completion. You can find it here: completion. You can find it here:
Universal Ctags: https://ctags.io Universal Ctags: https://ctags.io
Exuberant Ctags: http://ctags.sourceforge.net
Universal Ctags is preferred, Exuberant Ctags is no longer being developed. Universal Ctags is preferred, Exuberant Ctags is no longer maintained.
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
If you want to complete system functions you can do something like this. Use 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: > 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 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 Explorer and Mozilla Firefox. These two applications are covering over 90% of
market. Theoretically standards are created by W3C organisation 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 ~ 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: Exuberant ctags version 5.5.4 or newer. You can find it here:
Universal Ctags: https://ctags.io Universal Ctags: https://ctags.io
Exuberant Ctags: http://ctags.sourceforge.net
Script completes: Script completes:
@ -1779,12 +1770,12 @@ DTD -> Vim *dtd2vim*
On |www| is the script |dtd2vim| which parses DTD and creates an XML data file On |www| is the script |dtd2vim| which parses DTD and creates an XML data file
for Vim XML omni completion. 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. Check the beginning of that file for usage details.
The script requires perl and: The script requires perl and:
perlSGML: http://savannah.nongnu.org/projects/perlsgml perlSGML: https://savannah.nongnu.org/projects/perlsgml
Commands 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. with the ":map" command.
notation meaning equivalent decimal value(s) ~ notation meaning equivalent decimal value(s) ~
----------------------------------------------------------------------- ----------------------------------------------------------------------- ~
<Nul> zero CTRL-@ 0 (stored as 10) *<Nul>* <Nul> zero CTRL-@ 0 (stored as 10) *<Nul>*
<BS> backspace CTRL-H 8 *backspace* <BS> backspace CTRL-H 8 *backspace*
<Tab> tab CTRL-I 9 *tab* *Tab* <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-* <M-…> alt-key or meta-key *META* *ALT* *<M-*
<A-…> same as <M-…> *<A-* <A-…> same as <M-…> *<A-*
<D-…> command-key or "super" key *<D-* <D-…> command-key or "super" key *<D-*
----------------------------------------------------------------------- ----------------------------------------------------------------------- ~
Note: Note:
@ -530,29 +530,29 @@ Ex :vi -- -- -- -- --
-- not possible -- not possible
*1 Go from Normal mode to Insert mode by giving the command "i", "I", "a", * 1 Go from Normal mode to Insert mode by giving the command "i", "I", "a",
"A", "o", "O", "c", "C", "s" or S". "A", "o", "O", "c", "C", "s" or S".
*2 Go from Visual mode to Normal mode by giving a non-movement command, which * 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" 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. (see |v_v|), which just stops Visual mode without side effects.
*3 Go from Command-line mode to Normal mode by: * 3 Go from Command-line mode to Normal mode by:
- Hitting <CR> or <NL>, which causes the entered command to be executed. - 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>. - 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 - Hitting CTRL-C or <Esc>, which quits the command-line without executing
the command. the command.
In the last case <Esc> may be the character defined with the 'wildchar' 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 option, in which case it will start command-line completion. You can
ignore that and type <Esc> again. ignore that and type <Esc> again.
*4 Go from Normal to Select mode by: * 4 Go from Normal to Select mode by:
- use the mouse to select text while 'selectmode' contains "mouse" - use the mouse to select text while 'selectmode' contains "mouse"
- use a non-printable command to move the cursor while keeping the Shift - use a non-printable command to move the cursor while keeping the Shift
key pressed, and the 'selectmode' option contains "key" key pressed, and the 'selectmode' option contains "key"
- use "v", "V" or "CTRL-V" while 'selectmode' contains "cmd" - use "v", "V" or "CTRL-V" while 'selectmode' contains "cmd"
- use "gh", "gH" or "g CTRL-H" |g_CTRL-H| - 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 * 5 Go from Select mode to Normal mode by using a non-printable command to move
the cursor, without keeping the Shift key pressed. the cursor, without keeping the Shift key pressed.
*6 Go from Select mode to Insert mode by typing a printable character. The * 6 Go from Select mode to Insert mode by typing a printable character. The
selection is deleted and the character is inserted. selection is deleted and the character is inserted.
*CTRL-\_CTRL-N* *i_CTRL-\_CTRL-N* *c_CTRL-\_CTRL-N* *CTRL-\_CTRL-N* *i_CTRL-\_CTRL-N* *c_CTRL-\_CTRL-N*
*v_CTRL-\_CTRL-N* *t_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. Without calling this, the server won't be notified of changes to a buffer.
Parameters: ~ Parameters: ~
{bufnr} (number) Buffer handle, or 0 for current {bufnr} (number) Buffer handle, or 0 for current
{client_id} (number) Client id {client_id} (number) Client id
buf_detach_client({bufnr}, {client_id}) *vim.lsp.buf_detach_client()* buf_detach_client({bufnr}, {client_id}) *vim.lsp.buf_detach_client()*
Detaches client from the specified buffer. Note: While the server is 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. send notifications should it ignore this notification.
Parameters: ~ Parameters: ~
{bufnr} (number) Buffer handle, or 0 for current {bufnr} (number) Buffer handle, or 0 for current
{client_id} (number) Client id {client_id} (number) Client id
buf_is_attached({bufnr}, {client_id}) *vim.lsp.buf_is_attached()* buf_is_attached({bufnr}, {client_id}) *vim.lsp.buf_is_attached()*
Checks if a buffer is attached for a particular client. Checks if a buffer is attached for a particular client.
Parameters: ~ Parameters: ~
{bufnr} (number) Buffer handle, or 0 for current {bufnr} (number) Buffer handle, or 0 for current
{client_id} (number) the client id {client_id} (number) the client id
buf_notify({bufnr}, {method}, {params}) *vim.lsp.buf_notify()* buf_notify({bufnr}, {method}, {params}) *vim.lsp.buf_notify()*
Send a notification to a server Send a notification to a server
Parameters: ~ Parameters: ~
{bufnr} [number] (optional): The number of the buffer {bufnr} [number] (optional): The number of the buffer
{method} [string]: Name of the request method {method} [string]: Name of the request method
{params} [string]: Arguments to send to the server {params} [string]: Arguments to send to the server
Return: ~ Return: ~
true if any client returns true; false otherwise 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. |vim.lsp.buf_request()| but the return result and callback are different.
Parameters: ~ Parameters: ~
{bufnr} (number) Buffer handle, or 0 for current. {bufnr} (number) Buffer handle, or 0 for current.
{method} (string) LSP method name {method} (string) LSP method name
{params} (optional, table) Parameters to send to the server {params} (optional, table) Parameters to send to the server
{callback} (function) The callback to call when all requests are {callback} (function) The callback to call when all requests are
finished. finished.
Return: ~ Return: ~
@ -595,10 +595,10 @@ buf_request_sync({bufnr}, {method}, {params}, {timeout_ms})
result is different. Wait maximum of {timeout_ms} (default 1000) ms. result is different. Wait maximum of {timeout_ms} (default 1000) ms.
Parameters: ~ Parameters: ~
{bufnr} (number) Buffer handle, or 0 for current. {bufnr} (number) Buffer handle, or 0 for current.
{method} (string) LSP method name {method} (string) LSP method name
{params} (optional, table) Parameters to send to the server {params} (optional, table) Parameters to send to the server
{timeout_ms} (optional, number, default=1000) Maximum time in {timeout_ms} (optional, number, default=1000) Maximum time in
milliseconds to wait for a result. milliseconds to wait for a result.
Return: ~ Return: ~
@ -666,7 +666,7 @@ client_is_stopped({client_id}) *vim.lsp.client_is_stopped()*
Checks whether a client is stopped. Checks whether a client is stopped.
Parameters: ~ Parameters: ~
{client_id} (Number) {client_id} (Number)
Return: ~ Return: ~
true if client is stopped, false otherwise. 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. Invokes a function for each LSP client attached to a buffer.
Parameters: ~ Parameters: ~
{bufnr} (number) Buffer number {bufnr} (number) Buffer number
{fn} (function) Function to run on each client attached to buffer {fn} (function) Function to run on each client attached to buffer
{bufnr}. The function takes the client, client ID, and buffer {bufnr}. The function takes the client, client ID, and buffer
number as arguments. Example: > number as arguments. Example: >
@ -696,7 +696,7 @@ formatexpr({opts}) *vim.lsp.formatexpr()*
'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})')`. 'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})')`.
Parameters: ~ Parameters: ~
{opts} (table) options for customizing the formatting expression {opts} (table) options for customizing the formatting expression
which takes the following optional keys: which takes the following optional keys:
• timeout_ms (default 500ms). The timeout period for the • timeout_ms (default 500ms). The timeout period for the
formatting request. formatting request.
@ -705,7 +705,7 @@ get_active_clients({filter}) *vim.lsp.get_active_clients()*
Get active clients. Get active clients.
Parameters: ~ 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: returned clients. The available keys are:
• id (number): Only return clients with the given id • id (number): Only return clients with the given id
• bufnr (number): Only return clients attached to this • 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. Returns list of buffers attached to client_id.
Parameters: ~ Parameters: ~
{client_id} (number) client id {client_id} (number) client id
Return: ~ Return: ~
list of buffer ids 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. not yet be fully initialized.
Parameters: ~ Parameters: ~
{client_id} (number) client id {client_id} (number) client id
Return: ~ Return: ~
|vim.lsp.client| object, or nil |vim.lsp.client| object, or nil
@ -745,8 +745,8 @@ omnifunc({findstart}, {base}) *vim.lsp.omnifunc()*
Implements 'omnifunc' compatible LSP completion. Implements 'omnifunc' compatible LSP completion.
Parameters: ~ Parameters: ~
{findstart} 0 or 1, decides behavior {findstart} 0 or 1, decides behavior
{base} If findstart=0, text to match against {base} If findstart=0, text to match against
Return: ~ Return: ~
(number) Decided by {findstart}: (number) Decided by {findstart}:
@ -768,7 +768,7 @@ set_log_level({level}) *vim.lsp.set_log_level()*
Use `lsp.log_levels` for reverse lookup. Use `lsp.log_levels` for reverse lookup.
Parameters: ~ Parameters: ~
{level} [number|string] the case insensitive level name or number {level} [number|string] the case insensitive level name or number
See also: ~ See also: ~
|vim.lsp.log_levels| |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 See |vim.lsp.start_client()| for all available options. The most important
are: are:
`name` is an arbitrary name for the LSP client. It should be unique per `name` arbitrary name for the LSP client. Should be unique per language
language server. server.
• `cmd` command (in list form) used to start the language server. Must be
`cmd` the command as list - used to start the language server. The command must absolute, or found on `$PATH`. Shell constructs like `~` are not
be present in the `$PATH` environment variable or an absolute path to the executable. Shell expanded.
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
`root_dir` path to the project root. By default this is used to decide if |vim.fs.find()| and |vim.fs.dirname()| to detect the root by traversing
an existing client should be re-used. The example above uses the file system upwards starting from the current directory until either
|vim.fs.find()| and |vim.fs.dirname()| to detect the root by traversing a `pyproject.toml` or `setup.py` file is found.
the file system upwards starting from the current directory until either a • `workspace_folders` list of `{ uri:string, name: string }` tables
`pyproject.toml` or `setup.py` file is found. specifying the project root folders used by the language server. If
`nil` the property is derived from `root_dir` for convenience.
`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.
Language servers use this information to discover metadata like the Language servers use this information to discover metadata like the
dependencies of your project and they tend to index the contents within 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|) `ftplugin/<filetype_name>.lua` (See |ftplugin-name|)
Parameters: ~ Parameters: ~
{config} (table) Same configuration as documented in {config} (table) Same configuration as documented in
|vim.lsp.start_client()| |vim.lsp.start_client()|
{opts} nil|table Optional keyword arguments: {opts} nil|table Optional keyword arguments:
• reuse_client (fun(client: client, config: table): boolean) • reuse_client (fun(client: client, config: table): boolean)
Predicate used to decide if a client should be re-used. Predicate used to decide if a client should be re-used.
Used on all running clients. The default implementation 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. The following parameters describe fields in the {config} table.
Parameters: ~ Parameters: ~
{cmd} (table|string|fun(dispatchers: table):table) {cmd} (table|string|fun(dispatchers: table):table)
command string or list treated like |jobstart()|. command string or list treated like |jobstart()|.
The command must launch the language server The command must launch the language server
process. `cmd` can also be a function that 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 |vim.lsp.rpc.notify()| For TCP there is a
built-in rpc client factory: built-in rpc client factory:
|vim.lsp.rpc.connect()| |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`. 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 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 as a list with `k=v` pairs or both. Non-string values are coerced to
string. Example: > string. Example: >
{ "PRODUCTION=true"; "TEST=123"; PORT = 8080; HOST = "0.0.0.0"; } { "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 process so that it runs in a separate process
group from Nvim. Nvim will shutdown the process group from Nvim. Nvim will shutdown the process
on exit, but if Nvim fails to exit cleanly this on exit, but if Nvim fails to exit cleanly this
could leave behind orphaned server processes. 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 language server. For backwards compatibility
rootUri and rootPath will be derived from the rootUri and rootPath will be derived from the
first workspace folder in this list. See first workspace folder in this list. See
`workspaceFolders` in the LSP spec. `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()|, by |vim.lsp.protocol.make_client_capabilities()|,
passed to the language server on initialization. passed to the language server on initialization.
Hint: use make_client_capabilities() and modify 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 • Note: To send an empty dictionary use
`{[vim.type_idx]=vim.types.dictionary}`, else `{[vim.type_idx]=vim.types.dictionary}`, else
it will be encoded as an array. 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| |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 are returned to the language server if requested
via `workspace/configuration`. Keys are via `workspace/configuration`. Keys are
case-sensitive. case-sensitive.
{commands} (table) Table that maps string of clientside {commands} (table) Table that maps string of clientside
commands to user-defined functions. Commands commands to user-defined functions. Commands
passed to start_client take precedence over the passed to start_client take precedence over the
global command registry. Each key must be a global command registry. Each key must be a
unique command name, and the value is a function unique command name, and the value is a function
which is called if any LSP action (code action, which is called if any LSP action (code action,
code lenses, ...) triggers the command. 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 `initializationOptions`. See `initialize` in the
LSP spec. LSP spec.
{name} (string, default=client-id) Name in log messages. {name} (string, default=client-id) Name in log messages.
{get_language_id} function(bufnr, filetype) -> language ID as {get_language_id} function(bufnr, filetype) -> language ID as
string. Defaults to the filetype. 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 "utf-32" which is the encoding that the LSP
server expects. Client does not verify this is server expects. Client does not verify this is
correct. correct.
{on_error} Callback with parameters (code, ...), invoked {on_error} Callback with parameters (code, ...), invoked
when the client operation throws an error. `code` when the client operation throws an error. `code`
is a number describing the error. Other arguments is a number describing the error. Other arguments
may be passed depending on the error kind. See may be passed depending on the error kind. See
`vim.lsp.rpc.client_errors` for possible errors. `vim.lsp.rpc.client_errors` for possible errors.
Use `vim.lsp.rpc.client_errors[code]` to get Use `vim.lsp.rpc.client_errors[code]` to get
human-friendly name. human-friendly name.
{before_init} Callback with parameters (initialize_params, {before_init} Callback with parameters (initialize_params,
config) invoked before the LSP "initialize" config) invoked before the LSP "initialize"
phase, where `params` contains the parameters phase, where `params` contains the parameters
being sent to the server and `config` is the being sent to the server and `config` is the
config that was passed to config that was passed to
|vim.lsp.start_client()|. You can use this to |vim.lsp.start_client()|. You can use this to
modify parameters before they are sent. 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 after LSP "initialize", where `result` is a table
of `capabilities` and anything else the server of `capabilities` and anything else the server
may send. For example, clangd sends may send. For example, clangd sends
@ -925,19 +922,19 @@ start_client({config}) *vim.lsp.start_client()*
make this assumption. A make this assumption. A
`workspace/didChangeConfiguration` notification `workspace/didChangeConfiguration` notification
should be sent to the server during on_init. 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. client exit.
• code: exit code of the process • code: exit code of the process
• signal: number describing the signal used to • signal: number describing the signal used to
terminate (if any) terminate (if any)
• client_id: client handle • client_id: client handle
{on_attach} Callback (client, bufnr) invoked when client {on_attach} Callback (client, bufnr) invoked when client
attaches to a buffer. attaches to a buffer.
{trace} "off" | "messages" | "verbose" | nil passed {trace} "off" | "messages" | "verbose" | nil passed
directly to the language server in the initialize directly to the language server in the initialize
request. Invalid/empty values will default to request. Invalid/empty values will default to
"off" "off"
{flags} A table with flags for the client. The current {flags} A table with flags for the client. The current
(experimental) flags are: (experimental) flags are:
• allow_incremental_sync (bool, default true): • allow_incremental_sync (bool, default true):
Allow using incremental sync for buffer edits 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 sending kill -15. If set to false, nvim exits
immediately after sending the "shutdown" immediately after sending the "shutdown"
request to the server. 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 its workspaceFolders, rootUri, and rootPath on
initialization. initialization.
@ -974,8 +971,8 @@ stop_client({client_id}, {force}) *vim.lsp.stop_client()*
for this client, then force-shutdown is attempted. for this client, then force-shutdown is attempted.
Parameters: ~ Parameters: ~
{client_id} client id or |vim.lsp.client| object, or list thereof {client_id} client id or |vim.lsp.client| object, or list thereof
{force} (boolean) (optional) shutdown forcefully {force} (boolean) (optional) shutdown forcefully
tagfunc({...}) *vim.lsp.tagfunc()* tagfunc({...}) *vim.lsp.tagfunc()*
Provides an interface between the built-in client and '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. LSP servers, falls back to using built-in tags.
Parameters: ~ Parameters: ~
{pattern} Pattern used to find a workspace symbol {pattern} Pattern used to find a workspace symbol
{flags} See |tag-function| {flags} See |tag-function|
Return: ~ Return: ~
A list of matching tags A list of matching tags
@ -996,8 +993,8 @@ with({handler}, {override_config}) *vim.lsp.with()*
Function to manage overriding defaults for LSP handlers. Function to manage overriding defaults for LSP handlers.
Parameters: ~ Parameters: ~
{handler} (function) See |lsp-handler| {handler} (function) See |lsp-handler|
{override_config} (table) Table containing the keys to override {override_config} (table) Table containing the keys to override
behavior of the {handler} 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. Selects a code action available at the current cursor position.
Parameters: ~ Parameters: ~
{options} (table|nil) Optional table which holds the following {options} (table|nil) Optional table which holds the following
optional fields: optional fields:
• context: (table|nil) Corresponds to `CodeActionContext` of the LSP specification: • context: (table|nil) Corresponds to `CodeActionContext` of the LSP specification:
• diagnostics (table|nil): LSP`Diagnostic[]` . Inferred from the current position if not provided. • 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. called in Insert mode.
Parameters: ~ Parameters: ~
{context} (context support not yet implemented) Additional {context} (context support not yet implemented) Additional
information about the context in which a completion was information about the context in which a completion was
triggered (how it was triggered, and by which trigger triggered (how it was triggered, and by which trigger
character, if applicable) character, if applicable)
@ -1058,7 +1055,7 @@ declaration({options}) *vim.lsp.buf.declaration()*
|vim.lsp.buf.definition()| instead. |vim.lsp.buf.definition()| instead.
Parameters: ~ Parameters: ~
{options} (table|nil) additional options {options} (table|nil) additional options
• reuse_win: (boolean) Jump to existing window if buffer is • reuse_win: (boolean) Jump to existing window if buffer is
already open. already open.
• on_list: (function) handler for list results. See • 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. Jumps to the definition of the symbol under the cursor.
Parameters: ~ Parameters: ~
{options} (table|nil) additional options {options} (table|nil) additional options
• reuse_win: (boolean) Jump to existing window if buffer is • reuse_win: (boolean) Jump to existing window if buffer is
already open. already open.
• on_list: (function) handler for list results. See • 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. Lists all symbols in the current buffer in the quickfix window.
Parameters: ~ Parameters: ~
{options} (table|nil) additional options {options} (table|nil) additional options
• on_list: (function) handler for list results. See • on_list: (function) handler for list results. See
|lsp-on-list-handler| |lsp-on-list-handler|
@ -1101,7 +1098,7 @@ execute_command({command_params}) *vim.lsp.buf.execute_command()*
Executes an LSP server command. Executes an LSP server command.
Parameters: ~ Parameters: ~
{command_params} (table) A valid `ExecuteCommandParams` object {command_params} (table) A valid `ExecuteCommandParams` object
See also: ~ See also: ~
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_executeCommand https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_executeCommand
@ -1111,7 +1108,7 @@ format({options}) *vim.lsp.buf.format()*
server clients. server clients.
Parameters: ~ Parameters: ~
{options} table|nil Optional table which holds the following optional {options} table|nil Optional table which holds the following optional
fields: fields:
• formatting_options (table|nil): Can be used to specify • formatting_options (table|nil): Can be used to specify
FormattingOptions. Some unspecified options will be FormattingOptions. Some unspecified options will be
@ -1149,7 +1146,7 @@ formatting({options}) *vim.lsp.buf.formatting()*
Formats the current buffer. Formats the current buffer.
Parameters: ~ 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 unspecified options will be automatically derived from the
current Neovim options. current Neovim options.
@ -1171,9 +1168,9 @@ formatting_seq_sync({options}, {timeout_ms}, {order})
< <
Parameters: ~ Parameters: ~
{options} (table|nil) `FormattingOptions` entries {options} (table|nil) `FormattingOptions` entries
{timeout_ms} (number|nil) Request timeout {timeout_ms} (number|nil) Request timeout
{order} (table|nil) List of client names. Formatting is {order} (table|nil) List of client names. Formatting is
requested from clients in the following order: first all requested from clients in the following order: first all
clients that are not in the `order` list, then the clients that are not in the `order` list, then the
remaining clients in the order as they occur in the remaining clients in the order as they occur in the
@ -1192,8 +1189,8 @@ formatting_sync({options}, {timeout_ms})
< <
Parameters: ~ Parameters: ~
{options} (table|nil) with valid `FormattingOptions` entries {options} (table|nil) with valid `FormattingOptions` entries
{timeout_ms} (number) Request timeout {timeout_ms} (number) Request timeout
See also: ~ See also: ~
|vim.lsp.buf.format()| |vim.lsp.buf.format()|
@ -1207,7 +1204,7 @@ implementation({options}) *vim.lsp.buf.implementation()*
quickfix window. quickfix window.
Parameters: ~ Parameters: ~
{options} (table|nil) additional options {options} (table|nil) additional options
• on_list: (function) handler for list results. See • on_list: (function) handler for list results. See
|lsp-on-list-handler| |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. Performs |vim.lsp.buf.code_action()| for a given range.
Parameters: ~ 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. • diagnostics: (table|nil) LSP`Diagnostic[]` . Inferred from the current position if not provided.
• only: (table|nil) List of LSP `CodeActionKind`s used to • only: (table|nil) List of LSP `CodeActionKind`s used to
filter the code actions. Most language servers support filter the code actions. Most language servers support
values like `refactor` or `quickfix`. 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. 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. Defaults to the end of the last visual selection.
*vim.lsp.buf.range_formatting()* *vim.lsp.buf.range_formatting()*
@ -1244,10 +1241,10 @@ range_formatting({options}, {start_pos}, {end_pos})
Formats a given range. Formats a given range.
Parameters: ~ Parameters: ~
{options} Table with valid `FormattingOptions` entries. {options} Table with valid `FormattingOptions` entries.
{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. 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. Defaults to the end of the last visual selection.
references({context}, {options}) *vim.lsp.buf.references()* references({context}, {options}) *vim.lsp.buf.references()*
@ -1255,8 +1252,8 @@ references({context}, {options}) *vim.lsp.buf.references()*
window. window.
Parameters: ~ Parameters: ~
{context} (table) Context for the request {context} (table) Context for the request
{options} (table|nil) additional options {options} (table|nil) additional options
• on_list: (function) handler for list results. See • on_list: (function) handler for list results. See
|lsp-on-list-handler| |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. Renames all references to the symbol under the cursor.
Parameters: ~ 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()|. 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. • filter (function|nil): Predicate used to filter clients.
Receives a client as argument and must return a boolean. Receives a client as argument and must return a boolean.
Clients matching the predicate are included. 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. Jumps to the definition of the type of the symbol under the cursor.
Parameters: ~ Parameters: ~
{options} (table|nil) additional options {options} (table|nil) additional options
• reuse_win: (boolean) Jump to existing window if buffer is • reuse_win: (boolean) Jump to existing window if buffer is
already open. already open.
• on_list: (function) handler for list results. See • 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. string means no filtering is done.
Parameters: ~ Parameters: ~
{query} (string, optional) {query} (string, optional)
{options} (table|nil) additional options {options} (table|nil) additional options
• on_list: (function) handler for list results. See • on_list: (function) handler for list results. See
|lsp-on-list-handler| |lsp-on-list-handler|
@ -1324,7 +1321,7 @@ get_namespace({client_id}) *vim.lsp.diagnostic.get_namespace()*
|vim.diagnostic|. |vim.diagnostic|.
Parameters: ~ 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()* *vim.lsp.diagnostic.on_publish_diagnostics()*
on_publish_diagnostics({_}, {result}, {ctx}, {config}) on_publish_diagnostics({_}, {result}, {ctx}, {config})
@ -1353,7 +1350,7 @@ on_publish_diagnostics({_}, {result}, {ctx}, {config})
< <
Parameters: ~ 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 Display the lenses using virtual text
Parameters: ~ Parameters: ~
{lenses} (table) of lenses to display (`CodeLens[] | null`) {lenses} (table) of lenses to display (`CodeLens[] | null`)
{bufnr} (number) {bufnr} (number)
{client_id} (number) {client_id} (number)
get({bufnr}) *vim.lsp.codelens.get()* get({bufnr}) *vim.lsp.codelens.get()*
Return all lenses for the given buffer Return all lenses for the given buffer
Parameters: ~ 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: ~ Return: ~
(table) (`CodeLens[]`) (table) (`CodeLens[]`)
@ -1395,9 +1392,9 @@ save({lenses}, {bufnr}, {client_id}) *vim.lsp.codelens.save()*
Store lenses for a specific buffer and client Store lenses for a specific buffer and client
Parameters: ~ Parameters: ~
{lenses} (table) of lenses to store (`CodeLens[] | null`) {lenses} (table) of lenses to store (`CodeLens[] | null`)
{bufnr} (number) {bufnr} (number)
{client_id} (number) {client_id} (number)
============================================================================== ==============================================================================
@ -1415,7 +1412,7 @@ hover({_}, {result}, {ctx}, {config}) *vim.lsp.handlers.hover()*
< <
Parameters: ~ Parameters: ~
{config} (table) Configuration table. {config} (table) Configuration table.
• border: (default=nil) • border: (default=nil)
• Add borders to the floating window • Add borders to the floating window
• See |nvim_open_win()| • See |nvim_open_win()|
@ -1434,7 +1431,7 @@ signature_help({_}, {result}, {ctx}, {config})
< <
Parameters: ~ Parameters: ~
{config} (table) Configuration table. {config} (table) Configuration table.
• border: (default=nil) • border: (default=nil)
• Add borders to the floating window • Add borders to the floating window
• See |nvim_open_win()| • See |nvim_open_win()|
@ -1449,8 +1446,8 @@ apply_text_document_edit({text_document_edit}, {index}, {offset_encoding})
document. document.
Parameters: ~ Parameters: ~
{text_document_edit} table: a `TextDocumentEdit` object {text_document_edit} table: a `TextDocumentEdit` object
{index} number: Optional index of the edit, if from a {index} number: Optional index of the edit, if from a
list of edits (or nil, if not from a list) list of edits (or nil, if not from a list)
See also: ~ See also: ~
@ -1461,9 +1458,9 @@ apply_text_edits({text_edits}, {bufnr}, {offset_encoding})
Applies a list of text edits to a buffer. Applies a list of text edits to a buffer.
Parameters: ~ Parameters: ~
{text_edits} (table) list of `TextEdit` objects {text_edits} (table) list of `TextEdit` objects
{bufnr} (number) Buffer id {bufnr} (number) Buffer id
{offset_encoding} (string) utf-8|utf-16|utf-32 {offset_encoding} (string) utf-8|utf-16|utf-32
See also: ~ See also: ~
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textEdit 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`. Applies a `WorkspaceEdit`.
Parameters: ~ Parameters: ~
{workspace_edit} (table) `WorkspaceEdit` {workspace_edit} (table) `WorkspaceEdit`
{offset_encoding} (string) utf-8|utf-16|utf-32 (required) {offset_encoding} (string) utf-8|utf-16|utf-32 (required)
buf_clear_references({bufnr}) *vim.lsp.util.buf_clear_references()* buf_clear_references({bufnr}) *vim.lsp.util.buf_clear_references()*
Removes document highlights from a buffer. Removes document highlights from a buffer.
Parameters: ~ Parameters: ~
{bufnr} (number) Buffer id {bufnr} (number) Buffer id
*vim.lsp.util.buf_highlight_references()* *vim.lsp.util.buf_highlight_references()*
buf_highlight_references({bufnr}, {references}, {offset_encoding}) buf_highlight_references({bufnr}, {references}, {offset_encoding})
Shows a list of document highlights for a certain buffer. Shows a list of document highlights for a certain buffer.
Parameters: ~ Parameters: ~
{bufnr} (number) Buffer id {bufnr} (number) Buffer id
{references} (table) List of `DocumentHighlight` objects to {references} (table) List of `DocumentHighlight` objects to
highlight 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: ~ See also: ~
https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#documentHighlight 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. Returns the UTF-32 and UTF-16 offsets for a position in a certain buffer.
Parameters: ~ Parameters: ~
{buf} (number) buffer number (0 for current) {buf} (number) buffer number (0 for current)
{row} 0-indexed line {row} 0-indexed line
{col} 0-indexed byte offset in line {col} 0-indexed byte offset in line
{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 `buf` `offset_encoding` of first client of `buf`
Return: ~ Return: ~
@ -1518,8 +1515,8 @@ convert_input_to_markdown_lines({input}, {contents})
`textDocument/signatureHelp`, and potentially others. `textDocument/signatureHelp`, and potentially others.
Parameters: ~ Parameters: ~
{input} (`MarkedString` | `MarkedString[]` | `MarkupContent`) {input} (`MarkedString` | `MarkedString[]` | `MarkupContent`)
{contents} (table, optional, default `{}`) List of strings to extend {contents} (table, optional, default `{}`) List of strings to extend
with converted lines with converted lines
Return: ~ Return: ~
@ -1533,10 +1530,10 @@ convert_signature_help_to_markdown_lines({signature_help}, {ft}, {triggers})
Converts `textDocument/SignatureHelp` response to markdown lines. Converts `textDocument/SignatureHelp` response to markdown lines.
Parameters: ~ Parameters: ~
{signature_help} Response of `textDocument/SignatureHelp` {signature_help} Response of `textDocument/SignatureHelp`
{ft} optional filetype that will be use as the `lang` for {ft} optional filetype that will be use as the `lang` for
the label markdown code block 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 server. used to better determine parameter offsets
Return: ~ 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. Can be used to extract the completion items from a `textDocument/completion` request, which may return one of `CompletionItem[]` , `CompletionList` or null.
Parameters: ~ Parameters: ~
{result} (table) The result of a `textDocument/completion` request {result} (table) The result of a `textDocument/completion` request
Return: ~ Return: ~
(table) List of completion items (table) List of completion items
@ -1562,7 +1559,7 @@ get_effective_tabstop({bufnr}) *vim.lsp.util.get_effective_tabstop()*
Returns indentation size. Returns indentation size.
Parameters: ~ Parameters: ~
{bufnr} (number|nil): Buffer handle, defaults to current {bufnr} (number|nil): Buffer handle, defaults to current
Return: ~ Return: ~
(number) indentation size (number) indentation size
@ -1575,9 +1572,9 @@ jump_to_location({location}, {offset_encoding}, {reuse_win})
Jumps to a location. Jumps to a location.
Parameters: ~ Parameters: ~
{location} (table) (`Location`|`LocationLink`) {location} (table) (`Location`|`LocationLink`)
{offset_encoding} (string) utf-8|utf-16|utf-32 (required) {offset_encoding} (string) utf-8|utf-16|utf-32 (required)
{reuse_win} (boolean) Jump to existing window if buffer is {reuse_win} (boolean) Jump to existing window if buffer is
already opened. already opened.
Return: ~ Return: ~
@ -1592,8 +1589,8 @@ locations_to_items({locations}, {offset_encoding})
|setloclist()|. |setloclist()|.
Parameters: ~ Parameters: ~
{locations} (table) list of `Location`s or `LocationLink`s {locations} (table) list of `Location`s or `LocationLink`s
{offset_encoding} (string) offset_encoding for locations {offset_encoding} (string) offset_encoding for locations
utf-8|utf-16|utf-32 utf-8|utf-16|utf-32
Return: ~ Return: ~
@ -1603,8 +1600,8 @@ lookup_section({settings}, {section}) *vim.lsp.util.lookup_section()*
Helper function to return nested values in language server settings Helper function to return nested values in language server settings
Parameters: ~ Parameters: ~
{settings} a table of language server settings {settings} a table of language server settings
{section} a string indicating the field of the settings table {section} a string indicating the field of the settings table
Return: ~ Return: ~
(table or string) The value of settings accessed via section (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()|. table can be passed to |nvim_open_win()|.
Parameters: ~ Parameters: ~
{width} (number) window width (in character cells) {width} (number) window width (in character cells)
{height} (number) window height (in character cells) {height} (number) window height (in character cells)
{opts} (table, optional) {opts} (table, optional)
• offset_x (number) offset to add to `col` • offset_x (number) offset to add to `col`
• offset_y (number) offset to add to `row` • offset_y (number) offset to add to `row`
• border (string or table) override `border` • border (string or table) override `border`
@ -1633,7 +1630,7 @@ make_formatting_params({options})
cursor position. cursor position.
Parameters: ~ Parameters: ~
{options} (table|nil) with valid `FormattingOptions` entries {options} (table|nil) with valid `FormattingOptions` entries
Return: ~ Return: ~
`DocumentFormattingParams` object `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()|. similar to |vim.lsp.util.make_range_params()|.
Parameters: ~ 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. 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. 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 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` `offset_encoding` of first client of `bufnr`
Return: ~ Return: ~
@ -1666,9 +1663,9 @@ make_position_params({window}, {offset_encoding})
cursor position. cursor position.
Parameters: ~ Parameters: ~
{window} number|nil: window handle or 0 for current, {window} number|nil: window handle or 0 for current,
defaults to 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 `offset_encoding` of first client of buffer of
`window` `window`
@ -1686,9 +1683,9 @@ make_range_params({window}, {offset_encoding})
`textDocument/rangeFormatting`. `textDocument/rangeFormatting`.
Parameters: ~ Parameters: ~
{window} number|nil: window handle or 0 for current, {window} number|nil: window handle or 0 for current,
defaults to 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 `offset_encoding` of first client of buffer of
`window` `window`
@ -1701,7 +1698,7 @@ make_text_document_params({bufnr})
Creates a `TextDocumentIdentifier` object for the current buffer. Creates a `TextDocumentIdentifier` object for the current buffer.
Parameters: ~ Parameters: ~
{bufnr} number|nil: Buffer handle, defaults to current {bufnr} number|nil: Buffer handle, defaults to current
Return: ~ Return: ~
`TextDocumentIdentifier` `TextDocumentIdentifier`
@ -1714,17 +1711,17 @@ make_workspace_params({added}, {removed})
Create the workspace params Create the workspace params
Parameters: ~ Parameters: ~
{added} {added}
{removed} {removed}
*vim.lsp.util.open_floating_preview()* *vim.lsp.util.open_floating_preview()*
open_floating_preview({contents}, {syntax}, {opts}) open_floating_preview({contents}, {syntax}, {opts})
Shows contents in a floating window. Shows contents in a floating window.
Parameters: ~ Parameters: ~
{contents} (table) of lines to show in window {contents} (table) of lines to show in window
{syntax} (string) of syntax to set for opened buffer {syntax} (string) of syntax to set for opened buffer
{opts} (table) with optional fields (additional keys are passed {opts} (table) with optional fields (additional keys are passed
on to |nvim_open_win()|) on to |nvim_open_win()|)
• height: (number) height of floating window • height: (number) height of floating window
• width: (number) width 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. Parses snippets in a completion entry.
Parameters: ~ Parameters: ~
{input} (string) unparsed snippet {input} (string) unparsed snippet
Return: ~ Return: ~
(string) parsed snippet (string) parsed snippet
@ -1767,7 +1764,7 @@ preview_location({location}, {opts}) *vim.lsp.util.preview_location()*
definition) definition)
Parameters: ~ Parameters: ~
{location} a single `Location` or `LocationLink` {location} a single `Location` or `LocationLink`
Return: ~ Return: ~
(bufnr,winnr) buffer and window number of floating window or nil (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 Rename old_fname to new_fname
Parameters: ~ Parameters: ~
{opts} (table) {opts} (table)
set_lines({lines}, {A}, {B}, {new_lines}) *vim.lsp.util.set_lines()* set_lines({lines}, {A}, {B}, {new_lines}) *vim.lsp.util.set_lines()*
Replaces text in a range with new text. 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! CAUTION: Changes in-place!
Parameters: ~ Parameters: ~
{lines} (table) Original list of strings {lines} (table) Original list of strings
{A} (table) Start position; a 2-tuple of {line, col} numbers {A} (table) Start position; a 2-tuple of {line, col} numbers
{B} (table) End 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 {new_lines} A list of strings to replace the original
Return: ~ Return: ~
(table) The modified {lines} object (table) The modified {lines} object
@ -1805,8 +1802,8 @@ stylize_markdown({bufnr}, {contents}, {opts})
`open_floating_preview` instead `open_floating_preview` instead
Parameters: ~ Parameters: ~
{contents} (table) of lines to show in window {contents} (table) of lines to show in window
{opts} dictionary with optional fields {opts} dictionary with optional fields
• height of floating window • height of floating window
• width of floating window • width of floating window
• wrap_at character to wrap at for computing height • 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. Converts symbols to quickfix list items.
Parameters: ~ Parameters: ~
{symbols} DocumentSymbol[] or SymbolInformation[] {symbols} DocumentSymbol[] or SymbolInformation[]
*vim.lsp.util.text_document_completion_list_to_complete_items()* *vim.lsp.util.text_document_completion_list_to_complete_items()*
text_document_completion_list_to_complete_items({result}, {prefix}) 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|. vim-compatible |complete-items|.
Parameters: ~ 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 |vim.lsp.buf.completion()|, which may be one of
`CompletionItem[]`, `CompletionList` or `null` `CompletionItem[]`, `CompletionList` or `null`
{prefix} (string) the prefix to filter the completion items {prefix} (string) the prefix to filter the completion items
Return: ~ Return: ~
{ matches = complete-items table, incomplete = bool } { 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. Removes empty lines from the beginning and end.
Parameters: ~ Parameters: ~
{lines} (table) list of lines to trim {lines} (table) list of lines to trim
Return: ~ Return: ~
(table) trimmed list of lines (table) trimmed list of lines
@ -1859,7 +1856,7 @@ try_trim_markdown_code_blocks({lines})
CAUTION: Modifies the input in-place! CAUTION: Modifies the input in-place!
Parameters: ~ Parameters: ~
{lines} (table) list of lines {lines} (table) list of lines
Return: ~ Return: ~
(string) filetype or "markdown" if it was unchanged. (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 Sets formatting function used to format logs
Parameters: ~ 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 vim.inspect for multi-line formatting
set_level({level}) *vim.lsp.log.set_level()* set_level({level}) *vim.lsp.log.set_level()*
Sets the current log level. Sets the current log level.
Parameters: ~ 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()* should_log({level}) *vim.lsp.log.should_log()*
Checks whether the level is sufficient for logging. Checks whether the level is sufficient for logging.
Parameters: ~ Parameters: ~
{level} (number) log level {level} (number) log level
Return: ~ Return: ~
(bool) true if would log, false if not (bool) true if would log, false if not
@ -1911,8 +1908,8 @@ connect({host}, {port}) *vim.lsp.rpc.connect()*
and port and port
Parameters: ~ Parameters: ~
{host} (string) {host} (string)
{port} (number) {port} (number)
Return: ~ Return: ~
(function) (function)
@ -1921,7 +1918,7 @@ format_rpc_error({err}) *vim.lsp.rpc.format_rpc_error()*
Constructs an error message from an LSP error object. Constructs an error message from an LSP error object.
Parameters: ~ Parameters: ~
{err} (table) The error object {err} (table) The error object
Return: ~ Return: ~
(string) The formatted error message (string) The formatted error message
@ -1930,8 +1927,8 @@ notify({method}, {params}) *vim.lsp.rpc.notify()*
Sends a notification to the LSP server. Sends a notification to the LSP server.
Parameters: ~ Parameters: ~
{method} (string) The invoked LSP method {method} (string) The invoked LSP method
{params} (table|nil): Parameters for the invoked LSP method {params} (table|nil): Parameters for the invoked LSP method
Return: ~ Return: ~
(bool) `true` if notification could be sent, `false` if not (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. Sends a request to the LSP server and runs {callback} upon response.
Parameters: ~ Parameters: ~
{method} (string) The invoked LSP method {method} (string) The invoked LSP method
{params} (table|nil) Parameters for the invoked LSP {params} (table|nil) Parameters for the invoked LSP
method method
{callback} (function) Callback to invoke {callback} (function) Callback to invoke
{notify_reply_callback} (function|nil) Callback to invoke as soon as {notify_reply_callback} (function|nil) Callback to invoke as soon as
a request is no longer pending a request is no longer pending
Return: ~ Return: ~
@ -1957,10 +1954,10 @@ rpc_response_error({code}, {message}, {data})
Creates an RPC response object/table. Creates an RPC response object/table.
Parameters: ~ Parameters: ~
{code} (number) RPC error code defined in {code} (number) RPC error code defined in
`vim.lsp.protocol.ErrorCodes` `vim.lsp.protocol.ErrorCodes`
{message} (string|nil) arbitrary message to send to server {message} (string|nil) arbitrary message to send to server
{data} any|nil arbitrary data to send to server {data} any|nil arbitrary data to send to server
*vim.lsp.rpc.start()* *vim.lsp.rpc.start()*
start({cmd}, {cmd_args}, {dispatchers}, {extra_spawn_params}) start({cmd}, {cmd_args}, {dispatchers}, {extra_spawn_params})
@ -1970,16 +1967,16 @@ start({cmd}, {cmd_args}, {dispatchers}, {extra_spawn_params})
|vim.lsp.rpc.connect()| |vim.lsp.rpc.connect()|
Parameters: ~ Parameters: ~
{cmd} (string) Command to start the LSP server. {cmd} (string) Command to start the LSP server.
{cmd_args} (table) List of additional string arguments to {cmd_args} (table) List of additional string arguments to
pass to {cmd}. pass to {cmd}.
{dispatchers} (table|nil) Dispatchers for LSP message types. {dispatchers} (table|nil) Dispatchers for LSP message types.
Valid dispatcher names are: Valid dispatcher names are:
• `"notification"` • `"notification"`
• `"server_request"` • `"server_request"`
• `"on_error"` • `"on_error"`
• `"on_exit"` • `"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: server process. May contain:
• {cwd} (string) Working directory for the LSP • {cwd} (string) Working directory for the LSP
server process server process
@ -2003,14 +2000,14 @@ compute_diff({___MissingCloseParenHere___})
Returns the range table for the difference between prev and curr lines Returns the range table for the difference between prev and curr lines
Parameters: ~ Parameters: ~
{prev_lines} (table) list of lines {prev_lines} (table) list of lines
{curr_lines} (table) list of lines {curr_lines} (table) list of lines
{firstline} (number) line to begin search for first difference {firstline} (number) line to begin search for first difference
{lastline} (number) line to begin search in old_lines for last {lastline} (number) line to begin search in old_lines for last
difference 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 difference
{offset_encoding} (string) encoding requested by language server {offset_encoding} (string) encoding requested by language server
Return: ~ Return: ~
(table) TextDocumentContentChangeEvent see https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#textDocumentContentChangeEvent (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. Creates a normalized object describing LSP server capabilities.
Parameters: ~ Parameters: ~
{server_capabilities} (table) Table of capabilities supported by the {server_capabilities} (table) Table of capabilities supported by the
server server
Return: ~ Return: ~

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* 1 INTRODUCTION *luaref-intro*
==============================================================================
Lua is an extension programming language designed to support general Lua is an extension programming language designed to support general
procedural programming with data description facilities. It also offers good 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. combined, and what their combinations mean.
The language constructs will be explained using the usual extended BNF 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* 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* 3 THE APPLICATION PROGRAM INTERFACE *luaref-API*
==============================================================================
This section describes the C API for Lua, that is, the set of C functions 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 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* 4 THE AUXILIARY LIBRARY *luaref-aux*
==============================================================================
The auxiliary library provides several convenient functions to interface C The auxiliary library provides several convenient functions to interface C
with Lua. While the basic API provides the primitive functions for all 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* 5 STANDARD LIBRARIES *luaref-Lib*
==============================================================================
The standard libraries provide useful functions that are implemented directly The standard libraries provide useful functions that are implemented directly
through the C API. Some of these functions provide essential services to the through the C API. Some of these functions provide essential services to the
@ -4064,7 +4060,7 @@ string.gmatch({s}, {pattern}) *string.gmatch()*
end 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 Returns a copy of {s} in which all occurrences of the {pattern} have
been replaced by a replacement string specified by {repl}, which may been replaced by a replacement string specified by {repl}, which may
be a string, a table, or a function. `gsub` also returns, as its 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* A BIBLIOGRAPHY *luaref-bibliography*
==============================================================================
This help file is a minor adaptation from this main reference: This help file is a minor adaptation from this main reference:
- R. Ierusalimschy, L. H. de Figueiredo, and W. Celes., - 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: 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. "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 This help file has the same copyright and license as Lua 5.1 and the Lua 5.1
manual: 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 The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
============================================================================== ==============================================================================
C LUAREF DOC *luarefvim* *luarefvimdoc* *luaref-help* *luaref-doc* 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 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 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 The main ideas and concepts on how to implement this reference were taken from
Christian Habermann's CRefVim project 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 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 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* CONTENTS *luv-contents*
This documentation is mostly a retelling of the libuv API documentation 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 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 documented here except for when they are relevant to behavior seen in the Lua
module. module.
@ -933,7 +933,7 @@ uv.async_send({async}, {...}) *uv.async_send()*
Poll handles are used to watch file descriptors for readability and Poll handles are used to watch file descriptors for readability and
writability, similar to the purpose of poll(2) 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 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 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). "utf-8" (requires a gettext version that supports this).
- When reading a Vim script where |:scriptencoding| is different from - When reading a Vim script where |:scriptencoding| is different from
"utf-8". "utf-8".
Most of these require the |+iconv| feature. Conversion for reading and Most of these require iconv. Conversion for reading and writing files may
writing files may also be specified with the 'charconvert' option. also be specified with the 'charconvert' option.
Useful utilities for converting the charset: Useful utilities for converting the charset:
All: iconv All: iconv
GNU iconv can convert most encodings. Unicode is used as the GNU iconv can convert most encodings. Unicode is used as the
intermediate encoding, which allows conversion from and to all other intermediate encoding, which allows conversion from and to all other
encodings. See http://www.gnu.org/directory/libiconv.html. encodings. See https://directory.fsf.org/wiki/Libiconv.
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
*mbyte-conversion* *mbyte-conversion*
@ -404,17 +377,6 @@ is suitable for complex input, such as CJK.
large overhead in communication, but it provides safe synchronization with large overhead in communication, but it provides safe synchronization with
no restrictions on applications. 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
*conversion-server* *conversion-server*
Some system needs additional server: conversion server. Most of Japanese 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 VirtualBinding
Messages like this appear when starting up. This is not a Vim problem, your 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: X11 configuration is wrong.
http://groups.yahoo.com/group/solarisonintel/message/12179.
[this URL is no longer valid]
*W10* > *W10* >
Warning: Changing a readonly file Warning: Changing a readonly file

View File

@ -92,27 +92,10 @@ use of "-" and "_".
:lang mes en :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", 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). 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
If you write your own translations you need to generate the .po file and to a .mo file.
convert it to a .mo file. You need to get the source distribution and read
the file "src/po/README.txt".
To overrule the automatic choice of the language, set the $LANG variable to To overrule the automatic choice of the language, set the $LANG variable to
the language of your choice. use "en" to disable translations. > 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. 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|. character |linewise|.
+ or *+* + or *+*

View File

@ -1,10 +1,10 @@
*nvim.txt* Nvim *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. 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> :Tutor<Enter>
Nvim is emphatically a fork of Vim, not a clone: compatibility with Vim 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. |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: > 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 See |provider-python| and |provider-clipboard| for additional software you
might need to use some features. might need to use some features.
Your Vim configuration might not be entirely Nvim-compatible. Your Vim configuration might not be entirely Nvim-compatible (see
See |vim-differences| for the full list of changes. |vim-differences|). For example the |'ttymouse'| option was removed from Nvim,
because mouse support is always enabled if possible. If you use the same
The |'ttymouse'| option, for example, was removed from Nvim (mouse support |vimrc| for Vim and Nvim you could guard |'ttymouse'| in your configuration
should work without it). If you use the same |vimrc| for Vim and Nvim, like so:
consider guarding |'ttymouse'| in your configuration like so:
> >
if !has('nvim') if !has('nvim')
set ttymouse=xterm2 set ttymouse=xterm2
endif endif
<
Conversely, if you have Nvim specific configuration items, you could do And for Nvim-specific configuration, you can do this:
this:
> >
if has('nvim') if has('nvim')
tnoremap <Esc> <C-\><C-n> tnoremap <Esc> <C-\><C-n>
endif endif
<
For a more granular approach use |exists()|: For a more granular approach use |exists()|:
> >
if exists(':tnoremap') if exists(':tnoremap')
tnoremap <Esc> <C-\><C-n> tnoremap <Esc> <C-\><C-n>
endif endif
<
Now you should be able to explore Nvim more comfortably. Check |nvim-features| Now you should be able to explore Nvim more comfortably. Check |nvim-features|
for more information. 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 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 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 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'* *'noautochdir'* *'noacd'*
'autochdir' 'acd' boolean (default off) '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`, `:lgrepadd`, `:cfile`, `:cgetfile`, `:caddfile`, `:lfile`, `:lgetfile`,
and `:laddfile`. and `:laddfile`.
This would be mostly useful when you use MS-Windows. If |+iconv| is This would be mostly useful when you use MS-Windows. If iconv is
enabled and GNU libiconv is used, setting 'makeencoding' to "char" has enabled, setting 'makeencoding' to "char" has the same effect as
the same effect as setting to the system locale encoding. Example: > setting to the system locale encoding. Example: >
:set makeencoding=char " system locale is used :set makeencoding=char " system locale is used
< <
*'makeprg'* *'mp'* *'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 '/'. < - A directory name may end in a ':' or '/'.
- Environment variables are expanded |:set_env|. - Environment variables are expanded |:set_env|.
- When using |netrw.vim| URLs can be used. For example, adding - 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 - Search upwards and downwards in a directory tree using "*", "**" and
";". See |file-searching| for info and syntax. ";". See |file-searching| for info and syntax.
- Careful with '\' characters, type two to get one in the option: > - 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| indent/ indent scripts |indent-expression|
keymap/ key mapping files |mbyte-keymap| keymap/ key mapping files |mbyte-keymap|
lang/ menu translations |:menutrans| lang/ menu translations |:menutrans|
lua/ |Lua| plugins
menu.vim GUI menus |menu.vim| menu.vim GUI menus |menu.vim|
pack/ packages |:packadd| pack/ packages |:packadd|
parser/ |treesitter| syntax parsers
plugin/ plugin scripts |write-plugin| plugin/ plugin scripts |write-plugin|
print/ files for printing |postscript-print-encoding| print/ files for printing |postscript-print-encoding|
query/ |treesitter| queries
rplugin/ |remote-plugin| scripts rplugin/ |remote-plugin| scripts
spell/ spell checking files |spell| spell/ spell checking files |spell|
syntax/ syntax files |mysyntaxfile| 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 but are not part of the Nvim distribution. XDG_DATA_DIRS defaults
to /usr/local/share/:/usr/share/, so system administrators are to /usr/local/share/:/usr/share/, so system administrators are
expected to install site plugins to /usr/share/nvim/site. expected to install site plugins to /usr/share/nvim/site.
5. Applications state home directory, for files that contain your 5. Session state directory, for state data such as swap, backupdir,
session state (eg. backupdir, viewdir, undodir, etc). viewdir, undodir, etc.
Given by `stdpath("state")`. |$XDG_STATE_HOME| Given by `stdpath("state")`. |$XDG_STATE_HOME|
6. $VIMRUNTIME, for files distributed with Neovim. 6. $VIMRUNTIME, for files distributed with Nvim.
*after-directory* *after-directory*
7, 8, 9, 10. In after/ subdirectories of 1, 2, 3 and 4, with reverse 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). distributed defaults or system-wide settings (rarely needed).
*rtp-packages* *packages-runtimepath*
"start" packages will additionally be used to search for runtime files "start" packages will also be searched (|runtime-search-path|) for
after these, but package entries are not visible in `:set rtp`. runtime files after these, though such packages are not explicitly
See |runtime-search-path| for more information. "opt" packages reported in &runtimepath. But "opt" packages are explicitly added to
will be explicitly added to &rtp when |:packadd| is used. &runtimepath by |:packadd|.
Note that, unlike 'path', no wildcards like "**" are allowed. Normal Note that, unlike 'path', no wildcards like "**" are allowed. Normal
wildcards are allowed, but can significantly slow down searching for 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: > Example: >
:set runtimepath=~/vimruntime,/mygroup/vim,$VIMRUNTIME :set runtimepath=~/vimruntime,/mygroup/vim,$VIMRUNTIME
< This will use the directory "~/vimruntime" first (containing your < This will use the directory "~/vimruntime" first (containing your
personal Vim runtime files), then "/mygroup/vim" (shared between a personal Nvim runtime files), then "/mygroup/vim", and finally
group of people) and finally "$VIMRUNTIME" (the distributed runtime "$VIMRUNTIME" (the default runtime files).
files). You can put a directory before $VIMRUNTIME to find files which replace
You probably should always include $VIMRUNTIME somewhere, to use the distributed runtime files. You can put a directory after $VIMRUNTIME
distributed runtime files. You can put a directory before $VIMRUNTIME to find files which add to distributed runtime files.
to find files which replace a distributed runtime files. You can put
a directory after $VIMRUNTIME to find files which add to distributed With |--clean| the home directory entries are not included.
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.
*'scroll'* *'scr'* *'scroll'* *'scr'*
'scroll' 'scr' number (default: half the window height) '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: > To use PowerShell: >
let &shell = executable('pwsh') ? 'pwsh' : 'powershell' let &shell = executable('pwsh') ? 'pwsh' : 'powershell'
let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;' 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' let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
set shellquote= shellxquote= 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'*
'verbose' 'vbs' number (default 0) 'verbose' 'vbs' number (default 0)
global global
When bigger than zero, Vim will give messages about what it is doing. Sets the verbosity level. Also set by |-V| and |:verbose|.
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.
This option can also be set with the "-V" argument. See |-V|. Tracing of options in Lua scripts is activated at level 1; Lua scripts
This option is also set by the |:verbose| command. are not traced with verbose=0, for performance.
When the 'verbosefile' option is set then the verbose messages are not If greater than or equal to a given level, Nvim produces the following
displayed. 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'*
'verbosefile' 'vfile' string (default empty) 'verbosefile' 'vfile' string (default empty)

View File

@ -63,16 +63,16 @@ msgpack#is_uint({msgpack-value}) *msgpack#is_uint()*
*msgpack#strftime* *msgpack#strftime*
msgpack#strftime({format}, {msgpack-integer}) *msgpack#strftime()* msgpack#strftime({format}, {msgpack-integer}) *msgpack#strftime()*
Same as |strftime()|, but second argument may be Same as |strftime()|, but second argument may be
|msgpack-special-dict|. Requires |+python| or |+python3| to really |msgpack-special-dict|. Requires |Python| to really work with
work with |msgpack-special-dict|s. |msgpack-special-dict|s.
*msgpack#strptime* *msgpack#strptime*
msgpack#strptime({format}, {time}) *msgpack#strptime()* msgpack#strptime({format}, {time}) *msgpack#strptime()*
Reverse of |msgpack#strftime()|: for any time and format Reverse of |msgpack#strftime()|: for any time and format
|msgpack#equal|( |msgpack#strptime|(format, |msgpack#strftime|(format, |msgpack#equal|( |msgpack#strptime|(format, |msgpack#strftime|(format,
time)), time) be true. Requires |+python| or |+python3|, without it time)), time) be true. Requires ||Python|, without it only supports
only supports non-|msgpack-special-dict| nonnegative times and format non-|msgpack-special-dict| nonnegative times and format equal to
equal to `%Y-%m-%dT%H:%M:%S`. `%Y-%m-%dT%H:%M:%S`.
msgpack#int_dict_to_str({msgpack-special-int}) *msgpack#int_dict_to_str()* msgpack#int_dict_to_str({msgpack-special-int}) *msgpack#int_dict_to_str()*
Function which converts |msgpack-special-dict| integer value to 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 history are saved (as .netrwbook and
.netrwhist). .netrwhist).
Netrw uses |expand()| on the string. 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 *g:netrw_keepdir* =1 (default) keep current directory immune from
the browsing directory. 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 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, you can find details in the PostScript Language Reference Manual, 3rd Edition,
published by Addison-Wesley and available in PDF form at 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. locate and use your print character encoding.
i. Decide on a unique name for your encoding vector, one that does not clash 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 which are syntax highlighted with the font styles normal, italic, bold and
bold-italic. 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. Please read your printer documentation on how to install new fonts.
CJK fonts can be large containing several thousand glyphs, and it is not 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 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 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', 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* 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 and print on non-PostScript printers PostScript and PDF files. It can also
generate PDF files from PostScript. generate PDF files from PostScript.
Ghostscript will run on a wide variety of platforms. Ghostscript will run on a wide variety of platforms. Information on
Ghostscript can be found at:
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:
http://www.ghostscript.com/ 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 previewing at different zoom levels, and printing. Check supplied
documentation for full details. 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 ALTERNATE DUPLEX PRINTING
It is possible to achieve a poor man's version of duplex printing using the PS 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) - xclip (if $DISPLAY is set)
- xsel (if $DISPLAY is set) - xsel (if $DISPLAY is set)
- lemonade (for SSH) https://github.com/pocke/lemonade - 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) - win32yank (Windows)
- termux (via termux-clipboard-set, termux-clipboard-set) - termux (via termux-clipboard-set, termux-clipboard-set)
- tmux (if $TMUX is 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 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()|. 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* 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 This is not actually a compiler, but a unit testing framework for the
Python language. It is included into standard Python distribution Python language. It is included into standard Python distribution
starting from version 2.0. For older versions, you can get it from 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 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. 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=./alltests.py " Run a testsuite
setlocal makeprg=python\ %:S " Run a single testcase setlocal makeprg=python\ %:S " Run a single testcase
Also see http://vim.sourceforge.net/tip_view.php?tip_id=280.
TEX COMPILER *compiler-tex* TEX COMPILER *compiler-tex*
@ -1823,7 +1821,7 @@ In English, that sed script:
it as a "continuation of a multi-line message." it as a "continuation of a multi-line message."
*errorformat-ant* *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: > to honour the leading [javac] in front of each javac output line: >
:set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%# :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 :set cpo-=C
< <
*line-continuation-comment* *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: > after the backslash. Example: >
let array = [ let array = [
"\ first entry comment "\ first entry comment
@ -491,29 +491,40 @@ Rationale:
continuation lines to be part of the comment. Since it was like this 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 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 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 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. backslash is to make it very unlikely this is a normal comment line.
============================================================================== ==============================================================================
Using Vim packages *packages* Using Vim packages *packages*
A Vim package is a directory that contains one or more plugins. The A Vim "package" is a directory that contains |plugin|s. Compared to normal
advantages over normal plugins: plugins, a package can...
- A package can be downloaded as an archive and unpacked in its own directory. - be downloaded as an archive and unpacked in its own directory, so the files
Thus the files are not mixed with files of other plugins. That makes it are not mixed with files of other plugins.
easy to update and remove. - be a git, mercurial, etc. repository, thus easy to update.
- A package can be a git, mercurial, etc. repository. That makes it really - contain multiple plugins that depend on each other.
easy to update. - contain plugins that are automatically loaded on startup ("start" packages,
- A package can contain multiple plugins that depend on each other. located in "pack/*/start/*") and ones that are only loaded when needed with
- A package can contain plugins that are automatically loaded on startup and |:packadd| ("opt" packages, located in "pack/*/opt/*").
ones that are only loaded when needed with `:packadd`.
*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 ~ Using a package and loading automatically ~
Let's assume your Vim files are in the "~/.local/share/nvim/site" directory Let's assume your Nvim files are in "~/.local/share/nvim/site" and you want to
and you want to add a package from a zip archive "/tmp/foopack.zip": add a package from a zip archive "/tmp/foopack.zip":
% mkdir -p ~/.local/share/nvim/site/pack/foo % mkdir -p ~/.local/share/nvim/site/pack/foo
% cd ~/.local/share/nvim/site/pack/foo % cd ~/.local/share/nvim/site/pack/foo
% unzip /tmp/foopack.zip % 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/start/foobar/syntax/some.vim
pack/foo/opt/foodebug/plugin/debugger.vim pack/foo/opt/foodebug/plugin/debugger.vim
*runtime-search-path* On startup after processing your |config|, Nvim scans all directories in
When runtime files are searched for, first all paths in 'runtimepath' are 'packpath' for plugins in "pack/*/start/*", then loads the plugins.
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 >
: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 If the "foobar" plugin kicks in and sets the 'filetype' to "some", Nvim will
'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
find the syntax/some.vim file, because its directory is in the runtime search find the syntax/some.vim file, because its directory is in the runtime search
path. 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 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 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. it.
This could be done if some conditions are met. For example, depending on 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 You can also load an optional plugin at startup, by putting this command in
your |config|: > your |config|: >
:packadd! foodebug :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|. |--noplugin|.
It is perfectly normal for a package to only have files in the "opt" 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 Since color schemes, loaded with `:colorscheme`, are found below
"pack/*/start" and "pack/*/opt", you could put them anywhere. We recommend "pack/*/start" and "pack/*/opt", you could put them anywhere. We recommend
you put them below "pack/*/opt", for example 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 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 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 > < pack/foo/start/lib/autoload/foolib.vim >
func foolib#getit() func foolib#getit()
This works, because start packages will be used to look for autoload files, This works, because start packages will be searchd for autoload files, when
when sourcing the plugins. sourcing the plugins.
============================================================================== ==============================================================================
Debugging scripts *debug-scripts* 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 Russian, you will need to install the RuVim Language Pack, available in
different codepages from 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 After downloading an archive from RuVim project, unpack it into your
$VIMRUNTIME directory. We recommend using UTF-8 archive. $VIMRUNTIME directory. We recommend using UTF-8 archive.

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 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 files are zip files which contain the .aff and .dic files. You should be able
to find them here: 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: The older, OpenOffice 2 files may be used if this doesn't work:
http://wiki.services.openoffice.org/wiki/Dictionaries http://wiki.services.openoffice.org/wiki/Dictionaries
You can also use a plain word list. The results are the same, the choice 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 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 (the spell checker of Mozilla and OpenOffice.org). A description can be found
here: 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. 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|. 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 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 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* WORD LIST FORMAT *spell-dic-format*
@ -886,7 +886,7 @@ right encoding.
*spell-AUTHOR* *spell-EMAIL* *spell-COPYRIGHT* *spell-AUTHOR* *spell-EMAIL* *spell-COPYRIGHT*
NAME Name of the language NAME Name of the language
VERSION 1.0.1 with fixes VERSION 1.0.1 with fixes
HOME http://www.myhome.eu HOME https://www.example.com
AUTHOR John Doe AUTHOR John Doe
EMAIL john AT Doe DOT net EMAIL john AT Doe DOT net
COPYRIGHT LGPL 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. no other options or "+command" argument can follow.
*--* *--*
- Alias for stdin (standard input). `-` Alias for stdin (standard input).
Example: > Example: >
echo text | nvim - file echo text | nvim - file
< "text" is read into buffer 1, "file" is opened as buffer 2. < "text" is read into buffer 1, "file" is opened as buffer 2.
@ -143,12 +143,11 @@ argument.
these commands, independently from "-c" commands. these commands, independently from "-c" commands.
*-S* *-S*
-S {file} The {file} will be sourced after the first file has been read. -S {file} Vimscript or Lua (".lua") {file} will be |:source|d after the
This is an easy way to do the equivalent of: > first file has been read. Equivalent to: >
-c "source {file}" -c "source {file}"
< It can be mixed with "-c" arguments and repeated like "-c". < Can be repeated like "-c", subject to the same limit of 10
The limit of 10 "-c" arguments applies here as well. "-c" arguments. {file} cannot start with a "-".
{file} cannot start with a "-".
-S Works like "-S Session.vim". Only when used as the last -S Works like "-S Session.vim". Only when used as the last
argument or when another "-" option follows. argument or when another "-" option follows.
@ -203,13 +202,14 @@ argument.
send commands. > send commands. >
printf "foo\n" | nvim -Es +"%print" printf "foo\n" | nvim -Es +"%print"
< Output of these commands is displayed (to stdout): < These commands display on stdout:
:print
:list :list
:number :number
:set (to display option values) :print
When 'verbose' is set messages are printed to stderr. > :set
echo foo | nvim -V1 -es 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|). < User |config| is skipped (unless given with |-u|).
Swap file is skipped (like |-n|). 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, The |-V| argument can be used to display or log what happens next,
useful for debugging the initializations. 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 Nvim started with |--embed| waits for the UI to connect before
proceeding to load user configuration. 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: > This does the same as the command: >
:runtime! ftplugin.vim indent.vim :runtime! ftplugin.vim indent.vim
< Skipped if the "-u NONE" command line argument was given. < 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 $VIMINIT environment variable is read as one Ex command line (separate
multiple commands with '|' or <NL>). multiple commands with '|' or <NL>).
*config* *init.vim* *init.lua* *vimrc* *exrc* *config* *init.vim* *init.lua* *vimrc* *exrc*
@ -443,9 +445,9 @@ accordingly, proceeding as follows:
*VIMINIT* *EXINIT* *$MYVIMRC* *VIMINIT* *EXINIT* *$MYVIMRC*
b. Locations searched for initializations, in order of preference: b. Locations searched for initializations, in order of preference:
- $VIMINIT environment variable (Ex command line). - $VIMINIT environment variable (Ex command line).
- User |config|: $XDG_CONFIG_HOME/nvim/init.vim. - User |config|: $XDG_CONFIG_HOME/nvim/init.vim (or init.lua).
- Other config: {dir}/nvim/init.vim where {dir} is any directory - Other config: {dir}/nvim/init.vim (or init.lua) where {dir} is any
in $XDG_CONFIG_DIRS. directory in $XDG_CONFIG_DIRS.
- $EXINIT environment variable (Ex command line). - $EXINIT environment variable (Ex command line).
|$MYVIMRC| is set to the first valid location unless it was already |$MYVIMRC| is set to the first valid location unless it was already
set or when using $VIMINIT. set or when using $VIMINIT.
@ -456,19 +458,19 @@ accordingly, proceeding as follows:
- The file ".nvimrc" - The file ".nvimrc"
- The file ".exrc" - The file ".exrc"
7. Enable filetype detection. 8. Enable filetype detection.
This does the same as the command: > This does the same as the command: >
:runtime! filetype.lua filetype.vim :runtime! filetype.lua filetype.vim
< Skipped if ":filetype off" was called or if the "-u NONE" command line < Skipped if ":filetype off" was called or if the "-u NONE" command line
argument was given. argument was given.
8. Enable syntax highlighting. 9. Enable syntax highlighting.
This does the same as the command: > This does the same as the command: >
:runtime! syntax/syntax.vim :runtime! syntax/syntax.vim
< Skipped if ":syntax off" was called or if the "-u NONE" command < Skipped if ":syntax off" was called or if the "-u NONE" command
line argument was given. 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: > This does the same as the command: >
:runtime! plugin/**/*.vim :runtime! plugin/**/*.vim
:runtime! plugin/**/*.lua :runtime! plugin/**/*.lua
@ -498,21 +500,21 @@ accordingly, proceeding as follows:
if packages have been found, but that should not add a directory if packages have been found, but that should not add a directory
ending in "after". ending in "after".
10. Set 'shellpipe' and 'shellredir' 11. Set 'shellpipe' and 'shellredir'
The 'shellpipe' and 'shellredir' options are set according to the The 'shellpipe' and 'shellredir' options are set according to the
value of the 'shell' option, unless they have been set before. value of the 'shell' option, unless they have been set before.
This means that Nvim will figure out the values of 'shellpipe' and This means that Nvim will figure out the values of 'shellpipe' and
'shellredir' for you, unless you have set them yourself. '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 When the |-o| flag was given, windows will be opened (but not
displayed yet). displayed yet).
When the |-p| flag was given, tab pages will be created (but not 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| Buffers for all windows will be loaded, without triggering |BufAdd|
autocommands. autocommands.
16. Execute startup commands 17. Execute startup commands
If a |-t| flag was given, the tag is jumped to. If a |-t| flag was given, the tag is jumped to.
Commands given with |-c| and |+cmd| are executed. Commands given with |-c| and |+cmd| are executed.
The starting flag is reset, has("vim_starting") will now return zero. 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. encoding Binary, effective 'encoding' value.
max_kbyte Integer, effective |shada-s| limit value. max_kbyte Integer, effective |shada-s| limit value.
pid Integer, instance process ID. 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. additional keys with any data.
2 (SearchPattern) Map containing data describing last used search or 2 (SearchPattern) Map containing data describing last used search or
substitute pattern. Normally ShaDa file contains two substitute pattern. Normally ShaDa file contains two
@ -1213,7 +1215,7 @@ exactly four MessagePack objects:
sp Binary N/A Actual pattern. Required. sp Binary N/A Actual pattern. Required.
sb Boolean false True if search direction is sb Boolean false True if search direction is
backward. backward.
* any none Other keys are allowed for `*` any none Other keys are allowed for
compatibility reasons, see compatibility reasons, see
|shada-compatibility|. |shada-compatibility|.
3 (SubString) Array containing last |:substitute| replacement string. 3 (SubString) Array containing last |:substitute| replacement string.
@ -1284,7 +1286,7 @@ exactly four MessagePack objects:
GlobalMark and LocalMark GlobalMark and LocalMark
entries. entries.
f Binary N/A File name. Required. f Binary N/A File name. Required.
* any none Other keys are allowed for `*` any none Other keys are allowed for
compatibility reasons, see compatibility reasons, see
|shada-compatibility|. |shada-compatibility|.
9 (BufferList) Array containing maps. Each map in the array 9 (BufferList) Array containing maps. Each map in the array
@ -1294,10 +1296,10 @@ exactly four MessagePack objects:
greater then zero. greater then zero.
c UInteger 0 Position column number. c UInteger 0 Position column number.
f Binary N/A File name. Required. f Binary N/A File name. Required.
* any none Other keys are allowed for `*` any none Other keys are allowed for
compatibility reasons, see compatibility reasons, see
|shada-compatibility|. |shada-compatibility|.
* (Unknown) Any other entry type is allowed for compatibility `*` (Unknown) Any other entry type is allowed for compatibility
reasons, see |shada-compatibility|. reasons, see |shada-compatibility|.
*E575* *E576* *E575* *E576*
@ -1357,7 +1359,7 @@ LOG FILE *$NVIM_LOG_FILE* *E5430*
Besides 'debug' and 'verbose', Nvim keeps a general log file for internal Besides 'debug' and 'verbose', Nvim keeps a general log file for internal
debugging, plugins and RPC clients. > debugging, plugins and RPC clients. >
:echo $NVIM_LOG_FILE :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|. 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 |encoding-names|, but TOhtml will only automatically use those encodings with
wide browser support. However, you can override this to support specific wide browser support. However, you can override this to support specific
encodings that may not be automatically detected by default (see options 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 Note: By default all Unicode encodings are converted to UTF-8 with no BOM in
the generated HTML, as recommended by W3C: the generated HTML, as recommended by W3C:
http://www.w3.org/International/questions/qa-choosing-encodings https://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-byte-order-mark
*g:html_use_encoding* *g:html_use_encoding*
Default: none, uses IANA name for current 'fileencoding' as above. Default: none, uses IANA name for current 'fileencoding' as above.
@ -832,7 +832,7 @@ files are included:
asm68k Motorola 680x0 assembly asm68k Motorola 680x0 assembly
asmh8300 Hitachi H-8300 version of GNU assembly asmh8300 Hitachi H-8300 version of GNU assembly
ia64 Intel Itanium 64 ia64 Intel Itanium 64
fasm Flat assembly (http://flatassembler.net) fasm Flat assembly (https://flatassembler.net)
masm Microsoft assembly (probably works for any 80x86) masm Microsoft assembly (probably works for any 80x86)
nasm Netwide assembly nasm Netwide assembly
tasm Turbo Assembly (with opcodes 80x86 up to Pentium, and 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 version 3.1.1, which is the default syntax highlighting file, and one for
Euphoria version 4.0.5 or later. 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 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: The following file extensions are auto-detected as Euphoria file type:
@ -1452,7 +1452,7 @@ Elixir.
FLEXWIKI *flexwiki.vim* *ft-flexwiki-syntax* 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 NOTE: This site currently doesn't work, on Wikipedia is mentioned that
development stopped in 2009. development stopped in 2009.
@ -1808,7 +1808,7 @@ are read during initialization) >
:let html_my_rendering=1 :let html_my_rendering=1
If you'd like to see an example download mysyntax.vim at 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 You can also disable this rendering by adding the following line to your
vimrc file: > vimrc file: >
@ -1936,7 +1936,7 @@ highlight them use: >
:let java_highlight_java_lang_ids=1 :let java_highlight_java_lang_ids=1
You can also highlight identifiers of most standard Java packages if you 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 If you prefer to only highlight identifiers of a certain package, say java.io
use the following: > use the following: >
:let java_highlight_java_io=1 :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 package you'll often wish that the distributed syntax/tex.vim would support
it. However, clearly this is impractical. So please consider using the it. However, clearly this is impractical. So please consider using the
techniques in |mysyntaxfile-add| to extend or modify the highlighting provided techniques in |mysyntaxfile-add| to extend or modify the highlighting provided
by syntax/tex.vim. Please consider uploading any extensions that you write, by syntax/tex.vim.
which typically would go in $HOME/after/syntax/tex/[pkgname].vim, to
http://vim.sf.net/.
I've included some support for various popular packages on my website: > 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. The syntax files there go into your .../after/syntax/tex/ directory.
@ -5397,8 +5395,7 @@ WARNING: The longer the tags file, the slower this will be, and the more
memory Vim will consume. memory Vim will consume.
Only highlighting typedefs, unions and structs can be done too. For this you 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 must use Universal Ctags (https://ctags.io) or Exuberant ctags.
at http://ctags.sf.net).
Put these lines in your Makefile: Put these lines in your Makefile:

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 universal ctags A maintained version of ctags based on exuberant
ctags. See https://ctags.io. ctags. See https://ctags.io.
*Exuberant_ctags* *Exuberant_ctags*
exuberant ctags This is a very good one. It works for C, C++, Java, exuberant ctags Works for C, C++, Java, Fortran, Eiffel and others.
Fortran, Eiffel and others. It can generate tags for See https://ctags.sourceforge.net. No new version
many items. See http://ctags.sourceforge.net. since 2009.
No new version since 2009.
JTags For Java, in Java. It can be found at 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 ptags.py For Python, in Python. Found in your Python source
directory at Tools/scripts/ptags.py. 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: 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 Building your own terminfo is usually as simple as running this as
a non-superuser: 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 gunzip terminfo.src.gz
tic terminfo.src tic terminfo.src
< <

View File

@ -134,7 +134,7 @@ assert_match({pattern}, {actual} [, {msg}])
When {pattern} does not match {actual} an error message is When {pattern} does not match {actual} an error message is
added to |v:errors|. Also see |assert-return|. 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 like 'magic' was set and 'cpoptions' is empty, no matter what
the actual value of 'magic' or 'cpoptions' is. 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. 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 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 Don't forget to browse the user manual, it also contains lots of useful tips
|usr_toc.txt|. |usr_toc.txt|.

View File

@ -239,7 +239,7 @@ The following predicates are built in:
`contains?` *treesitter-predicate-contains?* `contains?` *treesitter-predicate-contains?*
Match a string against parts of the text corresponding to a node: > Match a string against parts of the text corresponding to a node: >
((identifier) @foo (#contains? @foo "foo")) ((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?* `any-of?` *treesitter-predicate-any-of?*
Match any of the given strings against the text corresponding to 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.c guifg=Blue
hi @comment.lua @guifg=DarkBlue hi @comment.lua @guifg=DarkBlue
hi link @comment.doc.java String 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* *treesitter-highlight-spell*
The special `@spell` capture can be used to indicate that a node should be 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 (comment) @spell
< <
There is also `@nospell` which disables spellchecking regions with `@spell`.
*treesitter-highlight-conceal* *treesitter-highlight-conceal*
Treesitter highlighting supports |conceal| via the `conceal` metadata. By Treesitter highlighting supports |conceal| via the `conceal` metadata. By
convention, nodes to be concealed are captured as `@conceal`, but any capture 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 Returns a list of highlight capture names under the cursor
Parameters: ~ Parameters: ~
{winnr} (number|nil) Window handle or 0 for current window (default) {winnr} (number|nil) Window handle or 0 for current window (default)
Return: ~ Return: ~
string[] List of capture names string[] List of capture names
@ -442,9 +498,9 @@ get_captures_at_pos({bufnr}, {row}, {col}) *get_captures_at_pos()*
if none are defined). if none are defined).
Parameters: ~ Parameters: ~
{bufnr} (number) Buffer number (0 for current buffer) {bufnr} (number) Buffer number (0 for current buffer)
{row} (number) Position row {row} (number) Position row
{col} (number) Position column {col} (number) Position column
Return: ~ Return: ~
table[] List of captures `{ capture = "capture name", metadata = { ... 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 Returns the smallest named node under the cursor
Parameters: ~ Parameters: ~
{winnr} (number|nil) Window handle or 0 for current window (default) {winnr} (number|nil) Window handle or 0 for current window (default)
Return: ~ Return: ~
(string) Name of node under the cursor (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 Returns the smallest named node at the given position
Parameters: ~ Parameters: ~
{bufnr} (number) Buffer number (0 for current buffer) {bufnr} (number) Buffer number (0 for current buffer)
{row} (number) Position row {row} (number) Position row
{col} (number) Position column {col} (number) Position column
{opts} (table) Optional keyword arguments: {opts} (table) Optional keyword arguments:
• ignore_injections boolean Ignore injected languages • ignore_injections boolean Ignore injected languages
(default true) (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 Returns the node's range or an unpacked range table
Parameters: ~ Parameters: ~
{node_or_range} (userdata|table) |tsnode| or table of positions {node_or_range} (userdata|table) |tsnode| or table of positions
Return: ~ Return: ~
(table) `{ start_row, start_col, end_row, end_col }` (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. If needed, this will create the parser.
Parameters: ~ 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) current buffer)
{lang} (string|nil) Filetype of this parser (default: buffer {lang} (string|nil) Filetype of this parser (default: buffer
filetype) filetype)
{opts} (table|nil) Options to pass to the created language tree {opts} (table|nil) Options to pass to the created language tree
Return: ~ Return: ~
LanguageTree |LanguageTree| object to use for parsing LanguageTree |LanguageTree| object to use for parsing
@ -502,9 +558,9 @@ get_string_parser({str}, {lang}, {opts}) *get_string_parser()*
Returns a string parser Returns a string parser
Parameters: ~ Parameters: ~
{str} (string) Text to parse {str} (string) Text to parse
{lang} (string) Language of this string {lang} (string) Language of this string
{opts} (table|nil) Options to pass to the created language tree {opts} (table|nil) Options to pass to the created language tree
Return: ~ Return: ~
LanguageTree |LanguageTree| object to use for parsing 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 Determines whether a node is the ancestor of another
Parameters: ~ Parameters: ~
{dest} userdata Possible ancestor |tsnode| {dest} userdata Possible ancestor |tsnode|
{source} userdata Possible descendant |tsnode| {source} userdata Possible descendant |tsnode|
Return: ~ Return: ~
(boolean) True if {dest} is an ancestor of {source} (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 Determines whether (line, col) position is in node range
Parameters: ~ Parameters: ~
{node} userdata |tsnode| defining the range {node} userdata |tsnode| defining the range
{line} (number) Line (0-based) {line} (number) Line (0-based)
{col} (number) Column (0-based) {col} (number) Column (0-based)
Return: ~ Return: ~
(boolean) True if the position is in node range (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 Determines if a node contains a range
Parameters: ~ Parameters: ~
{node} userdata |tsnode| {node} userdata |tsnode|
{range} (table) {range} (table)
Return: ~ Return: ~
(boolean) True if the {node} contains the {range} (boolean) True if the {node} contains the {range}
@ -560,16 +616,16 @@ start({bufnr}, {lang}) *start()*
< <
Parameters: ~ Parameters: ~
{bufnr} (number|nil) Buffer to be highlighted (default: current {bufnr} (number|nil) Buffer to be highlighted (default: current
buffer) buffer)
{lang} (string|nil) Language of the parser (default: buffer {lang} (string|nil) Language of the parser (default: buffer
filetype) filetype)
stop({bufnr}) *stop()* stop({bufnr}) *stop()*
Stops treesitter highlighting for a buffer Stops treesitter highlighting for a buffer
Parameters: ~ Parameters: ~
{bufnr} (number|nil) Buffer to stop highlighting (default: current {bufnr} (number|nil) Buffer to stop highlighting (default: current
buffer) buffer)
@ -583,7 +639,7 @@ inspect_language({lang}) *inspect_language()*
names, ... names, ...
Parameters: ~ Parameters: ~
{lang} (string) Language {lang} (string) Language
Return: ~ Return: ~
(table) (table)
@ -596,11 +652,11 @@ require_language({lang}, {path}, {silent}, {symbol_name})
{path} {path}
Parameters: ~ Parameters: ~
{lang} (string) Language the parser should parse {lang} (string) Language the parser should parse
{path} (string|nil) Optional path the parser is located at {path} (string|nil) Optional path the parser is located at
{silent} (boolean|nil) Don't throw an error if language not {silent} (boolean|nil) Don't throw an error if language not
found found
{symbol_name} (string|nil) Internal symbol name for the language to {symbol_name} (string|nil) Internal symbol name for the language to
load load
Return: ~ Return: ~
@ -619,26 +675,26 @@ add_directive({name}, {handler}, {force}) *add_directive()*
`metadata[capture_id].key = value` `metadata[capture_id].key = value`
Parameters: ~ Parameters: ~
{name} (string) Name of the directive, without leading # {name} (string) Name of the directive, without leading #
{handler} function(match:string, pattern:string, bufnr:number, {handler} function(match:string, pattern:string, bufnr:number,
predicate:function, metadata:table) predicate:function, metadata:table)
add_predicate({name}, {handler}, {force}) *add_predicate()* add_predicate({name}, {handler}, {force}) *add_predicate()*
Adds a new predicate to be used in queries Adds a new predicate to be used in queries
Parameters: ~ Parameters: ~
{name} (string) Name of the predicate, without leading # {name} (string) Name of the predicate, without leading #
{handler} function(match:string, pattern:string, bufnr:number, {handler} function(match:string, pattern:string, bufnr:number,
predicate:function) predicate:function)
get_node_text({node}, {source}, {opts}) *get_node_text()* get_node_text({node}, {source}, {opts}) *get_node_text()*
Gets the text corresponding to a given node Gets the text corresponding to a given node
Parameters: ~ Parameters: ~
{node} userdata |tsnode| {node} userdata |tsnode|
{source} (number|string) Buffer or string from which the {node} is {source} (number|string) Buffer or string from which the {node} is
extracted extracted
{opts} (table|nil) Optional parameters. {opts} (table|nil) Optional parameters.
• concat: (boolean) Concatenate result in a string (default • concat: (boolean) Concatenate result in a string (default
true) true)
@ -649,8 +705,8 @@ get_query({lang}, {query_name}) *get_query()*
Returns the runtime query {query_name} for {lang}. Returns the runtime query {query_name} for {lang}.
Parameters: ~ Parameters: ~
{lang} (string) Language to use for the query {lang} (string) Language to use for the query
{query_name} (string) Name of the query (e.g. "highlights") {query_name} (string) Name of the query (e.g. "highlights")
Return: ~ Return: ~
Query Parsed query 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 Gets the list of files used to make up a query
Parameters: ~ Parameters: ~
{lang} (string) Language to get query for {lang} (string) Language to get query for
{query_name} (string) Name of the query to load (e.g., "highlights") {query_name} (string) Name of the query to load (e.g., "highlights")
{is_included} (boolean|nil) Internal parameter, most of the time left {is_included} (boolean|nil) Internal parameter, most of the time left
as `nil` as `nil`
Return: ~ Return: ~
@ -694,8 +750,8 @@ parse_query({lang}, {query}) *parse_query()*
• `info.patterns` contains information about predicates. • `info.patterns` contains information about predicates.
Parameters: ~ Parameters: ~
{lang} (string) Language to use for the query {lang} (string) Language to use for the query
{query} (string) Query in s-expr syntax {query} (string) Query in s-expr syntax
Return: ~ Return: ~
Query Parsed query Query Parsed query
@ -726,11 +782,11 @@ Query:iter_captures({self}, {node}, {source}, {start}, {stop})
< <
Parameters: ~ Parameters: ~
{node} userdata |tsnode| under which the search will occur {node} userdata |tsnode| under which the search will occur
{source} (number|string) Source buffer or string to extract text from {source} (number|string) Source buffer or string to extract text from
{start} (number) Starting line for the search {start} (number) Starting line for the search
{stop} (number) Stopping line for the search (end-exclusive) {stop} (number) Stopping line for the search (end-exclusive)
{self} {self}
Return: ~ Return: ~
(number) capture Matching capture id (number) capture Matching capture id
@ -761,11 +817,11 @@ Query:iter_matches({self}, {node}, {source}, {start}, {stop})
< <
Parameters: ~ Parameters: ~
{node} userdata |tsnode| under which the search will occur {node} userdata |tsnode| under which the search will occur
{source} (number|string) Source buffer or string to search {source} (number|string) Source buffer or string to search
{start} (number) Starting line for the search {start} (number) Starting line for the search
{stop} (number) Stopping line for the search (end-exclusive) {stop} (number) Stopping line for the search (end-exclusive)
{self} {self}
Return: ~ Return: ~
(number) pattern id (number) pattern id
@ -779,9 +835,9 @@ set_query({lang}, {query_name}, {text}) *set_query()*
by plugins. by plugins.
Parameters: ~ Parameters: ~
{lang} (string) Language to use for the query {lang} (string) Language to use for the query
{query_name} (string) Name of the query (e.g., "highlights") {query_name} (string) Name of the query (e.g., "highlights")
{text} (string) Query text (unparsed). {text} (string) Query text (unparsed).
============================================================================== ==============================================================================
@ -791,8 +847,8 @@ new({tree}, {opts}) *highlighter.new()*
Creates a new highlighter using Creates a new highlighter using
Parameters: ~ Parameters: ~
{tree} LanguageTree |LanguageTree| parser object to use for highlighting {tree} LanguageTree |LanguageTree| parser object to use for highlighting
{opts} (table|nil) Configuration of the highlighter: {opts} (table|nil) Configuration of the highlighter:
• queries table overwrite queries used by the highlighter • queries table overwrite queries used by the highlighter
Return: ~ Return: ~
@ -802,7 +858,7 @@ TSHighlighter:destroy({self}) *TSHighlighter:destroy()*
Removes all internal references to the highlighter Removes all internal references to the highlighter
Parameters: ~ Parameters: ~
{self} {self}
============================================================================== ==============================================================================
@ -812,14 +868,14 @@ LanguageTree:children({self}) *LanguageTree:children()*
Returns a map of language to child tree. Returns a map of language to child tree.
Parameters: ~ Parameters: ~
{self} {self}
LanguageTree:contains({self}, {range}) *LanguageTree:contains()* LanguageTree:contains({self}, {range}) *LanguageTree:contains()*
Determines whether {range} is contained in the |LanguageTree|. Determines whether {range} is contained in the |LanguageTree|.
Parameters: ~ Parameters: ~
{range} (table) `{ start_line, start_col, end_line, end_col }` {range} (table) `{ start_line, start_col, end_line, end_col }`
{self} {self}
Return: ~ Return: ~
(boolean) (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. Note: This DOES NOT remove this tree from a parent. Instead, `remove_child` must be called on the parent to remove it.
Parameters: ~ Parameters: ~
{self} {self}
*LanguageTree:for_each_child()* *LanguageTree:for_each_child()*
LanguageTree:for_each_child({self}, {fn}, {include_self}) LanguageTree:for_each_child({self}, {fn}, {include_self})
Invokes the callback for each |LanguageTree| and its children recursively Invokes the callback for each |LanguageTree| and its children recursively
Parameters: ~ Parameters: ~
{fn} function(tree: LanguageTree, lang: string) {fn} function(tree: LanguageTree, lang: string)
{include_self} (boolean) Whether to include the invoking tree in the {include_self} (boolean) Whether to include the invoking tree in the
results results
{self} {self}
LanguageTree:for_each_tree({self}, {fn}) *LanguageTree:for_each_tree()* LanguageTree:for_each_tree({self}, {fn}) *LanguageTree:for_each_tree()*
Invokes the callback for each |LanguageTree| recursively. 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. Note: This includes the invoking tree's child trees as well.
Parameters: ~ Parameters: ~
{fn} function(tree: TSTree, languageTree: LanguageTree) {fn} function(tree: TSTree, languageTree: LanguageTree)
{self} {self}
LanguageTree:included_regions({self}) *LanguageTree:included_regions()* LanguageTree:included_regions({self}) *LanguageTree:included_regions()*
Gets the set of included regions Gets the set of included regions
Parameters: ~ Parameters: ~
{self} {self}
LanguageTree:invalidate({self}, {reload}) *LanguageTree:invalidate()* LanguageTree:invalidate({self}, {reload}) *LanguageTree:invalidate()*
Invalidates this parser and all its children Invalidates this parser and all its children
Parameters: ~ Parameters: ~
{self} {self}
LanguageTree:is_valid({self}) *LanguageTree:is_valid()* 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. Determines whether this tree is valid. If the tree is invalid, call `parse()` . This will return the updated tree.
Parameters: ~ Parameters: ~
{self} {self}
LanguageTree:lang({self}) *LanguageTree:lang()* LanguageTree:lang({self}) *LanguageTree:lang()*
Gets the language of this tree node. Gets the language of this tree node.
Parameters: ~ Parameters: ~
{self} {self}
*LanguageTree:language_for_range()* *LanguageTree:language_for_range()*
LanguageTree:language_for_range({self}, {range}) LanguageTree:language_for_range({self}, {range})
Gets the appropriate language that contains {range}. Gets the appropriate language that contains {range}.
Parameters: ~ Parameters: ~
{range} (table) `{ start_line, start_col, end_line, end_col }` {range} (table) `{ start_line, start_col, end_line, end_col }`
{self} {self}
Return: ~ Return: ~
LanguageTree Managing {range} LanguageTree Managing {range}
@ -893,11 +949,11 @@ LanguageTree:named_node_for_range({self}, {range}, {opts})
Gets the smallest named node that contains {range}. Gets the smallest named node that contains {range}.
Parameters: ~ Parameters: ~
{range} (table) `{ start_line, start_col, end_line, end_col }` {range} (table) `{ start_line, start_col, end_line, end_col }`
{opts} (table|nil) Optional keyword arguments: {opts} (table|nil) Optional keyword arguments:
• ignore_injections boolean Ignore injected languages • ignore_injections boolean Ignore injected languages
(default true) (default true)
{self} {self}
Return: ~ Return: ~
userdata|nil Found |tsnode| userdata|nil Found |tsnode|
@ -908,7 +964,7 @@ LanguageTree:parse({self}) *LanguageTree:parse()*
determine if any child languages should be created. determine if any child languages should be created.
Parameters: ~ Parameters: ~
{self} {self}
Return: ~ Return: ~
userdata[] Table of parsed |tstree| userdata[] Table of parsed |tstree|
@ -918,7 +974,7 @@ LanguageTree:register_cbs({self}, {cbs}) *LanguageTree:register_cbs()*
Registers callbacks for the |LanguageTree|. Registers callbacks for the |LanguageTree|.
Parameters: ~ 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: following handlers:
• `on_bytes` : see |nvim_buf_attach()|, but this will be called after the parsers callback. • `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 • `on_changedtree` : a callback that will be called every time
@ -929,24 +985,24 @@ LanguageTree:register_cbs({self}, {cbs}) *LanguageTree:register_cbs()*
tree. tree.
• `on_child_removed` : emitted when a child is removed from • `on_child_removed` : emitted when a child is removed from
the tree. the tree.
{self} {self}
LanguageTree:source({self}) *LanguageTree:source()* LanguageTree:source({self}) *LanguageTree:source()*
Returns the source content of the language tree (bufnr or string). Returns the source content of the language tree (bufnr or string).
Parameters: ~ Parameters: ~
{self} {self}
*LanguageTree:tree_for_range()* *LanguageTree:tree_for_range()*
LanguageTree:tree_for_range({self}, {range}, {opts}) LanguageTree:tree_for_range({self}, {range}, {opts})
Gets the tree that contains {range}. Gets the tree that contains {range}.
Parameters: ~ Parameters: ~
{range} (table) `{ start_line, start_col, end_line, end_col }` {range} (table) `{ start_line, start_col, end_line, end_col }`
{opts} (table|nil) Optional keyword arguments: {opts} (table|nil) Optional keyword arguments:
• ignore_injections boolean Ignore injected languages • ignore_injections boolean Ignore injected languages
(default true) (default true)
{self} {self}
Return: ~ Return: ~
userdata|nil Contained |tstree| userdata|nil Contained |tstree|
@ -956,7 +1012,7 @@ LanguageTree:trees({self}) *LanguageTree:trees()*
languages. languages.
Parameters: ~ Parameters: ~
{self} {self}
new({source}, {lang}, {opts}) *languagetree.new()* new({source}, {lang}, {opts}) *languagetree.new()*
A |LanguageTree| holds the treesitter parser for a given language {lang} 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). may contain child languages themselves, hence the name).
Parameters: ~ Parameters: ~
{source} (number|string) Buffer or a string of text to parse {source} (number|string) Buffer or a string of text to parse
{lang} (string) Root language this tree represents {lang} (string) Root language this tree represents
{opts} (table|nil) Optional keyword arguments: {opts} (table|nil) Optional keyword arguments:
• injections table Mapping language to injection query • injections table Mapping language to injection query
strings. This is useful for overriding the built-in strings. This is useful for overriding the built-in
runtime file searching for the injection language query 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| encouraged to make a donation for needy children in Uganda. Please see |kcc|
below or visit the ICCF web site, available at these URLs: below or visit the ICCF web site, available at these URLs:
http://iccf-holland.org/ https://iccf-holland.org/
http://www.vim.org/iccf/ https://www.vim.org/iccf/
http://www.iccf.nl/ https://www.iccf.nl/
You can also sponsor the development of Vim. Vim sponsors can vote for You can also sponsor the development of Vim. Vim sponsors can vote for
features. See |sponsor|. The money goes to Uganda anyway. 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. Germany: It is possible to make donations that allow for a tax return.
Check the ICCF web site for the latest information: 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 World: Use a postal money order. That should be possible from any
country, mostly from the post office. Use this name (which is 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. - `rgb` Decides the color format.
- true: (default) 24-bit RGB colors - true: (default) 24-bit RGB colors
- false: Terminal colors (8-bit, max 256) - false: Terminal colors (8-bit, max 256)
*ui-override* *ui-override*
- `override` Decides how UI capabilities are resolved. - `override` Decides how UI capabilities are resolved.
- true: Enable requested UI capabilities, even if not - true: Enable requested UI capabilities, even if not
supported by all connected UIs (including |TUI|). supported by all connected UIs (including |TUI|).
- false: (default) Disable UI capabilities not - false: (default) Disable UI capabilities not
supported by all connected UIs (including TUI). supported by all connected UIs (including TUI).
*ui-ext-options* *ui-ext-options*
- `ext_cmdline` Externalize the cmdline. |ui-cmdline| - `ext_cmdline` Externalize the cmdline. |ui-cmdline|
- `ext_hlstate` Detailed highlight state. |ui-hlstate| - `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 1. Invoke |nvim_get_api_info()|, if needed to setup the client library and/or
to get the list of supported UI extensions. to get the list of supported UI extensions.
2. Do any configuration that should be happen before user config is loaded. 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 Buffers and windows are not available at this point, but this could be used
to set |g:| variables visible to init.vim to set |g:| variables visible to init.vim
3. If the UI wants to do additional setup after user config is loaded, 3. If the UI wants to do additional setup after user config is loaded,
register a VimEnter autocmd: > register a VimEnter autocmd: >
nvim_command("autocmd VimEnter * call rpcrequest(1, 'vimenter')") 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. 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. 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 Inside this request handler, the UI can safely do any initialization before
entering normal mode, for example reading variables set by init.vim. 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 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 conditions set forth in the Open Publication License, v1.0 or later. The
latest version is presently available at: 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 People who contribute to the manuals must agree with the above copyright
notice. 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 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 - Some come with Vim. You can find them in the directory $VIMRUNTIME/macros
and its sub-directories and under $VIM/vimfiles/pack/dist/opt/. 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. - They are sometimes posted in a Vim maillist.
- You could write one yourself, see |write-plugin|. - You could write one yourself, see |write-plugin|.

View File

@ -33,9 +33,8 @@ following command: >
ctags *.c ctags *.c
"ctags" is a separate program. Most Unix systems already have it installed. "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: If you do not have it yet, you can find Universal ctags at:
http://ctags.io ~ https://ctags.io ~
http://ctags.sf.net ~
Universal ctags is preferred, Exuberant ctags is no longer being developed. 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 wordcount() get byte/word/char count of buffer
luaeval() evaluate |Lua| expression luaeval() evaluate |Lua| expression
py3eval() evaluate Python expression (|+python3|) py3eval() evaluate |Python| expression
pyeval() evaluate Python expression (|+python|) pyeval() evaluate |Python| expression
pyxeval() evaluate |python_x| expression pyxeval() evaluate |python_x| expression
rubyeval() evaluate |Ruby| expression rubyeval() evaluate |Ruby| expression
@ -2624,7 +2624,7 @@ Further reading: |autoload|.
============================================================================== ==============================================================================
*41.16* Distributing Vim scripts *distribute-script* *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! 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 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 programmer. You must know both English and the language you are translating
to, of course. to, of course.
When you are satisfied with the translation, consider making it available 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 to others. Upload it to https://github.com/vim/vim or e-mail it to the Vim
the Vim maintainer <maintainer@vim.org>. Or both. maintainer <maintainer@vim.org>. Or both.
============================================================================== ==============================================================================
*45.2* Language for Menus *45.2* Language for Menus
@ -166,10 +166,7 @@ script files, etc. You can regard 'encoding' as the setting for the internals
of Vim. of Vim.
This example assumes you have this font on your system. The name in the 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 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 enhance xterm with Unicode support.
find it here:
http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz ~
For MS-Windows, some fonts have a limited number of Unicode characters. Try 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 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 :set guifont=courier_new:h12
If it doesn't work well, try getting a fontpack. If Microsoft didn't move it, If it doesn't work well, try getting a fontpack.
you can find it here:
http://www.microsoft.com/typography/fonts/default.aspx ~
Now you have told Vim to use Unicode internally and display text with a Now you have told Vim to use Unicode internally and display text with a
Unicode font. Unicode font.

View File

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

View File

@ -82,27 +82,24 @@ centralized reference of the differences.
Default Mouse ~ Default Mouse ~
*default-mouse* *disable-mouse* *default-mouse* *disable-mouse*
By default the mouse is enabled. The right button click opens |popup-menu| By default the mouse is enabled, and <RightMouse> opens a |popup-menu| with
with standard actions, such as "Cut", "Copy" and "Paste". 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: If you don't like this you can disable the mouse in your |config| using any of
the following:
- ignore mouse completely > - Disable mouse completely by unsetting the 'mouse' option: >
set mouse= set mouse=
< - Pressing <RightMouse> extends selection instead of showing popup-menu: >
- no |popup-menu| but the right button extends selection >
set mousemodel=extend set mousemodel=extend
> - Pressing <A-LeftMouse> releases mouse until the cursor moves: >
- pressing ALT+LeftMouse releases mouse until main cursor moves > nnoremap <A-LeftMouse> <Cmd>
nnoremap <M-LeftMouse> <Cmd>
\ set mouse=<Bar> \ set mouse=<Bar>
\ echo 'mouse OFF until next cursor-move'<Bar> \ echo 'mouse OFF until next cursor-move'<Bar>
\ autocmd CursorMoved * ++once set mouse&<Bar> \ autocmd CursorMoved * ++once set mouse&<Bar>
\ echo 'mouse ON'<CR> \ 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.
Default Mappings ~ Default Mappings ~
*default-mappings* *default-mappings*
@ -162,7 +159,7 @@ Working intuitively and consistently is a major goal of Nvim.
- Nvim avoids features that cannot be provided on all platforms; instead that - Nvim avoids features that cannot be provided on all platforms; instead that
is delegated to external plugins/extensions. E.g. the `-X` platform-specific is delegated to external plugins/extensions. E.g. the `-X` platform-specific
option is "sometimes" available in Vim (with potential surprises: 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 - Vim's internal test functions (test_autochdir(), test_settime(), etc.) are
not exposed (nor implemented); instead Nvim has a robust API. not exposed (nor implemented); instead Nvim has a robust API.
@ -642,6 +639,9 @@ Options:
*'ttytype'* *'tty'* *'ttytype'* *'tty'*
weirdinvert weirdinvert
Performance:
Folds are not updated during insert-mode.
Startup: Startup:
--literal (file args are always literal; to expand wildcards on Windows, use --literal (file args are always literal; to expand wildcards on Windows, use
|:n| e.g. `nvim +"n *"`) |:n| e.g. `nvim +"n *"`)

View File

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

View File

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

View File

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

View File

@ -164,7 +164,7 @@ function TSHighlighter:get_query(lang)
end end
---@private ---@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) self.tree:for_each_tree(function(tstree, tree)
if not tstree then if not tstree then
return 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 start_row, start_col, end_row, end_col = node:range()
local hl = highlighter_query.hl_cache[capture] 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, { a.nvim_buf_set_extmark(buf, ns, start_row, start_col, {
end_line = end_row, end_line = end_row,
end_col = end_col, end_col = end_col,
hl_group = hl, hl_group = hl,
ephemeral = true, 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, conceal = metadata.conceal,
spell = is_spell, spell = spell,
}) })
end end
if start_row > line then if start_row > line then

View File

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

View File

@ -88,7 +88,7 @@ MAKING A VIMBALL *:MkVimball*
If you wish to force slashes into the filename, that can also be done If you wish to force slashes into the filename, that can also be done
by using the exclamation mark (ie. :MkVimball! path/filename). by using the exclamation mark (ie. :MkVimball! path/filename).
The tip at http://vim.wikia.com/wiki/Using_VimBall_with_%27Make%27 The tip at https://vim.wikia.com/wiki/Using_VimBall_with_%27Make%27
has a good idea on how to automate the production of vimballs using has a good idea on how to automate the production of vimballs using
make. make.
@ -171,12 +171,12 @@ WINDOWS *vimball-windows*
> >
Item Tool/Suite Free Website Item Tool/Suite Free Website
---- ---------- ---- ------- ---- ---------- ---- -------
7zip tool y http://www.7-zip.org/ 7zip tool y https://www.7-zip.org/
Winzip tool n http://www.winzip.com/downwz.htm Winzip tool n https://www.winzip.com/downwz.htm
unxutils suite y http://unxutils.sourceforge.net/ unxutils suite y https://unxutils.sourceforge.net/
cygwin suite y http://www.cygwin.com/ cygwin suite y https://www.cygwin.com/
GnuWin32 suite y http://gnuwin32.sourceforge.net/ GnuWin32 suite y https://gnuwin32.sourceforge.net/
MinGW suite y http://www.mingw.org/ MinGW suite y https://www.mingw.org/
< <
============================================================================== ==============================================================================

View File

@ -9,8 +9,11 @@
"|" @conceal (#set! conceal "") "|" @conceal (#set! conceal "")
text: (_) @text.reference) text: (_) @text.reference)
(optionlink (optionlink
text: (_) @text.literal) text: (_) @text.reference)
(codespan (codespan
"`" @conceal (#set! conceal "") "`" @conceal (#set! conceal "")
text: (_) @string) text: (_) @text.literal)
(codeblock) @text.literal
(argument) @parameter (argument) @parameter
(keycode) @string.special
(url) @text.uri

View File

@ -17,9 +17,13 @@ BASENAME="$(basename "${0}")"
readonly BASENAME readonly BASENAME
usage() { usage() {
echo "Bump Neovim dependencies" echo "Bump Nvim dependencies"
echo echo
echo "Usage: ${BASENAME} [ -h | --pr | --branch=<dep> | --dep=<dependency> ]" echo "Usage: ${BASENAME} [ -h | --pr | --branch=<dep> | --dep=<dependency> ]"
echo " Update a dependency:"
echo " ./scripts/bump-deps.sh --dep Luv --version 1.43.0-0"
echo " Create a PR:"
echo " ./scripts/bump-deps.sh --pr"
echo echo
echo "Options:" echo "Options:"
echo " -h show this message and exit." echo " -h show this message and exit."

View File

@ -33,6 +33,7 @@ local spell_dict = {
NeoVim = 'Nvim', NeoVim = 'Nvim',
neovim = 'Nvim', neovim = 'Nvim',
lua = 'Lua', lua = 'Lua',
VimL = 'Vimscript',
} }
local M = {} local M = {}
@ -42,7 +43,9 @@ local M = {}
local new_layout = { local new_layout = {
['api.txt'] = true, ['api.txt'] = true,
['channel.txt'] = true, ['channel.txt'] = true,
['deprecated.txt'] = true,
['develop.txt'] = true, ['develop.txt'] = true,
['lua.txt'] = true,
['luaref.txt'] = true, ['luaref.txt'] = true,
['nvim.txt'] = true, ['nvim.txt'] = true,
['pi_health.txt'] = true, ['pi_health.txt'] = true,
@ -67,7 +70,24 @@ local exclude_invalid = {
["v:_null_string"] = "builtin.txt", ["v:_null_string"] = "builtin.txt",
["vim.lsp.buf_request()"] = "lsp.txt", ["vim.lsp.buf_request()"] = "lsp.txt",
["vim.lsp.util.get_progress_messages()"] = "lsp.txt", ["vim.lsp.util.get_progress_messages()"] = "lsp.txt",
["vim.treesitter.start()"] = "treesitter.txt" ["vim.treesitter.start()"] = "treesitter.txt",
}
-- False-positive "invalid URLs".
local exclude_invalid_urls = {
["http://"] = "usr_23.txt",
["http://."] = "usr_23.txt",
["http://aspell.net/man-html/Affix-Compression.html"] = "spell.txt",
["http://aspell.net/man-html/Phonetic-Code.html"] = "spell.txt",
["http://canna.sourceforge.jp/"] = "mbyte.txt",
["http://gnuada.sourceforge.net"] = "ft_ada.txt",
["http://lua-users.org/wiki/StringLibraryTutorial"] = "lua.txt",
["http://michael.toren.net/code/"] = "pi_tar.txt",
["http://papp.plan9.de"] = "syntax.txt",
["http://wiki.services.openoffice.org/wiki/Dictionaries"] = "spell.txt",
["http://www.adapower.com"] = "ft_ada.txt",
["http://www.ghostscript.com/"] = "print.txt",
["http://www.jclark.com/"] = "quickfix.txt",
} }
local function tofile(fname, text) local function tofile(fname, text)
@ -96,11 +116,6 @@ local function url_encode(s)
'g') 'g')
end end
-- Removes the ">" and "<" chars that delineate a codeblock in Vim :help files.
local function trim_gt_lt(s)
return s:gsub('^%s*>%s*\n', ''):gsub('\n<', '')
end
local function expandtabs(s) local function expandtabs(s)
return s:gsub('\t', (' '):rep(8)) return s:gsub('\t', (' '):rep(8))
end end
@ -123,15 +138,29 @@ local function basename_noext(f)
end end
local function is_blank(s) local function is_blank(s)
return not not s:find('^%s*$') return not not s:find([[^[\t ]*$]])
end end
local function trim(s) local function trim(s, dir)
return vim.trim(s) return vim.fn.trim(s, '\r\t\n ', dir or 0)
end end
local function trim_bullet(s) -- Remove common punctuation from URLs.
return s:gsub('^%s*[-*•]%s', '') --
-- TODO: fix this in the parser instead... https://github.com/neovim/tree-sitter-vimdoc
--
-- @returns (fixed_url, removed_chars) where `removed_chars` is in the order found in the input.
local function fix_url(url)
local removed_chars = ''
local fixed_url = url
-- Remove up to one of each char from end of the URL, in this order.
for _, c in ipairs({ '.', ')', }) do
if fixed_url:sub(-1) == c then
removed_chars = c .. removed_chars
fixed_url = fixed_url:sub(1, -2)
end
end
return fixed_url, removed_chars
end end
-- Checks if a given line is a "noise" line that doesn't look good in HTML form. -- Checks if a given line is a "noise" line that doesn't look good in HTML form.
@ -148,8 +177,8 @@ local function is_noise(line, noise_lines)
or line:find('%s*%*?[a-zA-Z]+%.txt%*?%s+N?[vV]im%s*$') or line:find('%s*%*?[a-zA-Z]+%.txt%*?%s+N?[vV]im%s*$')
-- modeline -- modeline
-- Example: "vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl:" -- Example: "vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl:"
or line:find('^%s*vi[m]%:.*ft=help') or line:find('^%s*vim?%:.*ft=help')
or line:find('^%s*vi[m]%:.*filetype=help') or line:find('^%s*vim?%:.*filetype=help')
or line:find('[*>]local%-additions[*<]') or line:find('[*>]local%-additions[*<]')
) then ) then
-- table.insert(stats.noise_lines, getbuflinestr(root, opt.buf, 0)) -- table.insert(stats.noise_lines, getbuflinestr(root, opt.buf, 0))
@ -199,7 +228,7 @@ local function get_helppage(f)
return 'index.html' return 'index.html'
end end
return f:gsub('%.txt$', '.html') return (f:gsub('%.txt$', '.html'))
end end
-- Counts leading spaces (tab=8) to decide the indent size of multiline text. -- Counts leading spaces (tab=8) to decide the indent size of multiline text.
@ -236,6 +265,16 @@ local function getbuflinestr(node, bufnr, offset)
return table.concat(lines, '\n') return table.concat(lines, '\n')
end end
-- Gets the whitespace just before `node` from the raw buffer text.
-- Needed for preformatted `old` lines.
local function getws(node, bufnr)
local line1, c1, line2, _ = node:range()
local raw = vim.fn.getbufline(bufnr, line1 + 1, line2 + 1)[1]
local text_before = raw:sub(1, c1)
local leading_ws = text_before:match('%s+$') or ''
return leading_ws
end
local function get_tagname(node, bufnr) local function get_tagname(node, bufnr)
local text = vim.treesitter.get_node_text(node, bufnr) local text = vim.treesitter.get_node_text(node, bufnr)
local tag = (node:type() == 'optionlink' or node:parent():type() == 'optionlink') and ("'%s'"):format(text) or text local tag = (node:type() == 'optionlink' or node:parent():type() == 'optionlink') and ("'%s'"):format(text) or text
@ -246,15 +285,22 @@ end
-- Returns true if the given invalid tagname is a false positive. -- Returns true if the given invalid tagname is a false positive.
local function ignore_invalid(s) local function ignore_invalid(s)
-- Strings like |~/====| appear in various places and the parser thinks they are links, but they return not not (
-- are just table borders. exclude_invalid[s]
return not not (s:find('===') or exclude_invalid[s]) -- Strings like |~/====| appear in various places and the parser thinks they are links, but they
-- are just table borders.
or s:find('===')
or s:find('---')
)
end end
local function ignore_parse_error(s) local function ignore_parse_error(s, fname)
-- Ignore parse errors for unclosed codespan/optionlink/tag. local helpfile = vim.fs.basename(fname)
-- This is common in vimdocs and is treated as plaintext by :help. return (helpfile == 'pi_netrw.txt'
return s:find("^[`'|*]") -- Ignore parse errors for unclosed tag.
-- This is common in vimdocs and is treated as plaintext by :help.
or s:find("^[`'|*]")
)
end end
local function has_ancestor(node, ancestor_name) local function has_ancestor(node, ancestor_name)
@ -270,12 +316,36 @@ local function has_ancestor(node, ancestor_name)
return false return false
end end
-- Gets the first matching child node matching `name`.
local function first(node, name)
for c, _ in node:iter_children() do
if c:named() and c:type() == name then
return c
end
end
return nil
end
local function validate_link(node, bufnr, fname) local function validate_link(node, bufnr, fname)
local helppage, tagname = get_tagname(node:child(1), bufnr) local helppage, tagname = get_tagname(node:child(1), bufnr)
if not has_ancestor(node, 'column_heading') and not node:has_error() and not tagmap[tagname] and not ignore_invalid(tagname) then local ignored = false
invalid_links[tagname] = vim.fs.basename(fname) if not tagmap[tagname] then
ignored = has_ancestor(node, 'column_heading') or node:has_error() or ignore_invalid(tagname)
if not ignored then
invalid_links[tagname] = vim.fs.basename(fname)
end
end end
return helppage, tagname return helppage, tagname, ignored
end
local function validate_url(text, fname)
local ignored = false
if vim.fs.basename(fname) == 'pi_netrw.txt' then
ignored = true
elseif text:find('http%:') and not exclude_invalid_urls[text] then
invalid_urls[text] = vim.fs.basename(fname)
end
return ignored
end end
-- Traverses the tree at `root` and checks that |tag| links point to valid helptags. -- Traverses the tree at `root` and checks that |tag| links point to valid helptags.
@ -297,7 +367,7 @@ local function visit_validate(root, level, lang_tree, opt, stats)
end end
if node_name == 'ERROR' then if node_name == 'ERROR' then
if ignore_parse_error(text) then if ignore_parse_error(text, opt.fname) then
return return
end end
-- Store the raw text to give context to the error report. -- Store the raw text to give context to the error report.
@ -312,11 +382,10 @@ local function visit_validate(root, level, lang_tree, opt, stats)
end end
end end
elseif node_name == 'url' then elseif node_name == 'url' then
if text:find('http%:') then local fixed_url, _ = fix_url(trim(text))
invalid_urls[text] = vim.fs.basename(opt.fname) validate_url(fixed_url, opt.fname)
end
elseif node_name == 'taglink' or node_name == 'optionlink' then elseif node_name == 'taglink' or node_name == 'optionlink' then
local _, _ = validate_link(root, opt.buf, opt.fname) local _, _, _ = validate_link(root, opt.buf, opt.fname)
end end
end end
@ -332,17 +401,28 @@ local function visit_node(root, level, lang_tree, headings, opt, stats)
-- Parent kind (string). -- Parent kind (string).
local parent = root:parent() and root:parent():type() or nil local parent = root:parent() and root:parent():type() or nil
local text = '' local text = ''
local toplevel = level < 1 local trimmed
local function node_text(node) -- Gets leading whitespace of `node`.
return vim.treesitter.get_node_text(node or root, opt.buf) local function ws(node)
node = node or root
local ws_ = getws(node, opt.buf)
-- XXX: first node of a (line) includes whitespace, even after
-- https://github.com/neovim/tree-sitter-vimdoc/pull/31 ?
if ws_ == '' then
ws_ = vim.treesitter.get_node_text(node, opt.buf):match('^%s+') or ''
end
return ws_
end end
-- Gets leading whitespace of the current node. local function node_text(node, ws_)
local function ws() node = node or root
return node_text():match('^%s+') or '' ws_ = (ws_ == nil or ws_ == true) and getws(node, opt.buf) or ''
return string.format('%s%s', ws_, vim.treesitter.get_node_text(node, opt.buf))
end end
if root:child_count() == 0 or node_name == 'ERROR' then if root:child_count() == 0 or node_name == 'ERROR' then
text = node_text() text = node_text()
trimmed = html_esc(trim(text))
text = html_esc(text)
else else
-- Process children and join them with whitespace. -- Process children and join them with whitespace.
for node, _ in root:iter_children() do for node, _ in root:iter_children() do
@ -351,98 +431,107 @@ local function visit_node(root, level, lang_tree, headings, opt, stats)
text = string.format('%s%s', text, r) text = string.format('%s%s', text, r)
end end
end end
trimmed = trim(text)
end end
local trimmed = trim(text)
if node_name == 'help_file' then -- root node if node_name == 'help_file' then -- root node
return text return text
elseif node_name == 'url' then elseif node_name == 'url' then
return ('%s<a href="%s">%s</a>'):format(ws(), trimmed, trimmed) local fixed_url, removed_chars = fix_url(trimmed)
return ('%s<a href="%s">%s</a>%s'):format(ws(), fixed_url, fixed_url, removed_chars)
elseif node_name == 'word' or node_name == 'uppercase_name' then elseif node_name == 'word' or node_name == 'uppercase_name' then
return html_esc(text) return text
elseif node_name == 'h1' or node_name == 'h2' or node_name == 'h3' then elseif node_name == 'h1' or node_name == 'h2' or node_name == 'h3' then
if is_noise(text, stats.noise_lines) then if is_noise(text, stats.noise_lines) then
return '' -- Discard common "noise" lines. return '' -- Discard common "noise" lines.
end end
-- Remove "===" and tags from ToC text. -- Remove "===" and tags from ToC text.
local hname = (node_text():gsub('%-%-%-%-+', ''):gsub('%=%=%=%=+', ''):gsub('%*.*%*', '')) local hname = (node_text():gsub('%-%-%-%-+', ''):gsub('%=%=%=%=+', ''):gsub('%*.*%*', ''))
-- Use the first *tag* node as the heading anchor, if any.
local tagnode = first(root, 'tag')
local tagname = tagnode and url_encode(node_text(tagnode:child(1), false)) or to_heading_tag(hname)
if node_name == 'h1' or #headings == 0 then if node_name == 'h1' or #headings == 0 then
table.insert(headings, { name = hname, subheadings = {}, }) table.insert(headings, { name = hname, subheadings = {}, tag = tagname })
else else
table.insert(headings[#headings].subheadings, { name = hname, subheadings = {}, }) table.insert(headings[#headings].subheadings, { name = hname, subheadings = {}, tag = tagname })
end end
local el = node_name == 'h1' and 'h2' or 'h3' local el = node_name == 'h1' and 'h2' or 'h3'
return ('<a name="%s"></a><%s class="help-heading">%s</%s>\n'):format(to_heading_tag(hname), el, text, el) -- If we are re-using the *tag*, this heading anchor is redundant.
local a = tagnode and '' or ('<a name="%s"></a>'):format(tagname)
return ('%s<%s class="help-heading">%s</%s>\n'):format(a, el, text, el)
elseif node_name == 'column_heading' or node_name == 'column_name' then elseif node_name == 'column_heading' or node_name == 'column_name' then
if root:has_error() then if root:has_error() then
return text return text
end end
return ('<div class="help-column_heading">%s</div>'):format(trimmed) return ('<div class="help-column_heading">%s</div>'):format(text)
elseif node_name == 'block' then elseif node_name == 'block' then
if is_blank(text) then if is_blank(text) then
return '' return ''
end end
if opt.old then if opt.old then
-- XXX: Treat old docs as preformatted; random indentation is used for layout there. -- XXX: Treat "old" docs as preformatted: they use indentation for layout.
return ('<div class="old-help-para">%s</div>\n'):format(text) -- Trim trailing newlines to avoid too much whitespace between divs.
return ('<div class="old-help-para">%s</div>\n'):format(trim(text, 2))
end end
return string.format('<div class="help-para">\n%s\n</div>\n', text) return string.format('<div class="help-para">\n%s\n</div>\n', text)
elseif node_name == 'line' then elseif node_name == 'line' then
local sib = root:prev_sibling() if parent ~= 'codeblock' and (is_blank(text) or is_noise(text, stats.noise_lines)) then
local sib_last = sib and sib:named_child(sib:named_child_count() - 1) return '' -- Discard common "noise" lines.
local in_li = false
-- XXX: parser bug: (codeblock) without terminating "<" consumes first char of the next (line). Recover it here.
local recovered = (sib_last and sib_last:type() == 'codeblock') and node_text(root:prev_sibling()):sub(-1) or ''
recovered = recovered == '<' and '' or html_esc(recovered)
-- XXX: see if we are currently "in" a listitem.
while sib ~= nil and not in_li do
in_li = (sib:type() == 'line_li')
sib = sib:prev_sibling()
end end
-- XXX: Avoid newlines (too much whitespace) after block elements in old (preformatted) layout.
-- Close the current listitem. local div = opt.old and root:child(0) and vim.tbl_contains({'column_heading', 'h1', 'h2', 'h3'}, root:child(0):type())
local close = (in_li and next_ ~= 'line') and '</div>' or '' return string.format('%s%s', div and trim(text) or text, div and '' or '\n')
if is_blank(text) or is_noise(text, stats.noise_lines) then
return close -- Discard common "noise" lines.
end
local div = (root:child(0) and root:child(0):type() == 'column_heading') or close ~= ''
return string.format('%s%s%s%s', recovered, div and trim(text) or text, div and '' or '\n', close)
elseif node_name == 'line_li' then elseif node_name == 'line_li' then
-- Close the listitem immediately if the next sibling is not a line. local sib = root:prev_sibling()
local close = (next_ ~= 'line') and '</div>' or '' local prev_li = sib and sib:type() == 'line_li'
return string.format('<div class="help-li">%s %s', trim_bullet(text), close)
if not prev_li then
opt.indent = 1
else
-- The previous listitem _sibling_ is _logically_ the _parent_ if it is indented less.
local parent_indent = get_indent(node_text(sib))
local this_indent = get_indent(node_text())
if this_indent > parent_indent then
opt.indent = opt.indent + 1
elseif this_indent < parent_indent then
opt.indent = math.max(1, opt.indent - 1)
end
end
local margin = opt.indent == 1 and '' or ('margin-left: %drem;'):format((1.5 * opt.indent))
return string.format('<div class="help-li" style="%s">%s</div>', margin, text)
elseif node_name == 'taglink' or node_name == 'optionlink' then elseif node_name == 'taglink' or node_name == 'optionlink' then
if root:has_error() then local helppage, tagname, ignored = validate_link(root, opt.buf, opt.fname)
if ignored then
return text return text
end end
local helppage, tagname = validate_link(root, opt.buf, opt.fname)
return ('%s<a href="%s#%s">%s</a>'):format(ws(), helppage, url_encode(tagname), html_esc(tagname)) return ('%s<a href="%s#%s">%s</a>'):format(ws(), helppage, url_encode(tagname), html_esc(tagname))
elseif node_name == 'codespan' then elseif vim.tbl_contains({'codespan', 'keycode'}, node_name) then
if root:has_error() then if root:has_error() then
return text return text
end end
return ('%s<code>%s</code>'):format(ws(), text) return ('%s<code>%s</code>'):format(ws(), trimmed)
elseif node_name == 'argument' then elseif node_name == 'argument' then
return ('%s<code>{%s}</code>'):format(ws(), text) return ('%s<code>{%s}</code>'):format(ws(), text)
elseif node_name == 'codeblock' then elseif node_name == 'codeblock' then
return ('<pre>%s</pre>'):format(html_esc(trim_indent(trim_gt_lt(text)))) if is_blank(text) then
return ''
end
return ('<pre>%s</pre>'):format(trim(trim_indent(text), 2))
elseif node_name == 'tag' then -- anchor elseif node_name == 'tag' then -- anchor
if root:has_error() then if root:has_error() then
return text return text
end end
local in_heading = (parent == 'h1' or parent == 'h2') local in_heading = vim.tbl_contains({'h1', 'h2', 'h3'}, parent)
local cssclass = (not in_heading and get_indent(node_text()) > 8) and 'help-tag-right' or 'help-tag' local cssclass = (not in_heading and get_indent(node_text()) > 8) and 'help-tag-right' or 'help-tag'
local tagname = node_text(root:child(1)) local tagname = node_text(root:child(1), false)
if vim.tbl_count(stats.first_tags) < 2 then if vim.tbl_count(stats.first_tags) < 2 then
-- First 2 tags in the doc will be anchored at the main heading. -- Force the first 2 tags in the doc to be anchored at the main heading.
table.insert(stats.first_tags, tagname) table.insert(stats.first_tags, tagname)
return '' return ''
end end
local s = ('%s<a name="%s"></a><span class="%s">%s</span>'):format(ws(), url_encode(tagname), cssclass, trimmed) local el = in_heading and 'span' or 'code'
local s = ('%s<a name="%s"></a><%s class="%s">%s</%s>'):format(ws(), url_encode(tagname), el, cssclass, trimmed, el)
if in_heading and prev ~= 'tag' then if in_heading and prev ~= 'tag' then
-- Start the <span> container for tags in a heading. -- Start the <span> container for tags in a heading.
-- This makes "justify-content:space-between" right-align the tags. -- This makes "justify-content:space-between" right-align the tags.
@ -454,17 +543,17 @@ local function visit_node(root, level, lang_tree, headings, opt, stats)
end end
return s return s
elseif node_name == 'ERROR' then elseif node_name == 'ERROR' then
if ignore_parse_error(trimmed) then if ignore_parse_error(trimmed, opt.fname) then
return text return text
end end
-- Store the raw text to give context to the bug report. -- Store the raw text to give context to the bug report.
local sample_text = not toplevel and getbuflinestr(root, opt.buf, 3) or '[top level!]' local sample_text = level > 0 and getbuflinestr(root, opt.buf, 3) or '[top level!]'
table.insert(stats.parse_errors, sample_text) table.insert(stats.parse_errors, sample_text)
return ('<a class="parse-error" target="_blank" title="Report bug... (parse error)" href="%s">%s</a>'):format( return ('<a class="parse-error" target="_blank" title="Report bug... (parse error)" href="%s">%s</a>'):format(
get_bug_url_vimdoc(opt.fname, opt.to_fname, sample_text), trimmed) get_bug_url_vimdoc(opt.fname, opt.to_fname, sample_text), trimmed)
else -- Unknown token. else -- Unknown token.
local sample_text = not toplevel and getbuflinestr(root, opt.buf, 3) or '[top level!]' local sample_text = level > 0 and getbuflinestr(root, opt.buf, 3) or '[top level!]'
return ('<a class="unknown-token" target="_blank" title="Report bug... (unhandled token "%s")" href="%s">%s</a>'):format( return ('<a class="unknown-token" target="_blank" title="Report bug... (unhandled token "%s")" href="%s">%s</a>'):format(
node_name, get_bug_url_nvim(opt.fname, opt.to_fname, sample_text, node_name), trimmed), ('unknown-token:"%s"'):format(node_name) node_name, get_bug_url_nvim(opt.fname, opt.to_fname, sample_text, node_name), trimmed), ('unknown-token:"%s"'):format(node_name)
end end
@ -630,7 +719,9 @@ local function gen_one(fname, to_fname, old, commit)
local main = '' local main = ''
for _, tree in ipairs(lang_tree:trees()) do for _, tree in ipairs(lang_tree:trees()) do
main = main .. (visit_node(tree:root(), 0, tree, headings, { buf = buf, old = old, fname = fname, to_fname = to_fname }, stats)) main = main .. (visit_node(tree:root(), 0, tree, headings,
{ buf = buf, old = old, fname = fname, to_fname = to_fname, indent = 1, },
stats))
end end
main = ([[ main = ([[
@ -672,10 +763,10 @@ local function gen_one(fname, to_fname, old, commit)
local n = 0 -- Count of all headings + subheadings. local n = 0 -- Count of all headings + subheadings.
for _, h1 in ipairs(headings) do n = n + 1 + #h1.subheadings end for _, h1 in ipairs(headings) do n = n + 1 + #h1.subheadings end
for _, h1 in ipairs(headings) do for _, h1 in ipairs(headings) do
toc = toc .. ('<div class="help-toc-h1"><a href="#%s">%s</a>\n'):format(to_heading_tag(h1.name), h1.name) toc = toc .. ('<div class="help-toc-h1"><a href="#%s">%s</a>\n'):format(h1.tag, h1.name)
if n < 30 or #headings < 10 then -- Show subheadings only if there aren't too many. if n < 30 or #headings < 10 then -- Show subheadings only if there aren't too many.
for _, h2 in ipairs(h1.subheadings) do for _, h2 in ipairs(h1.subheadings) do
toc = toc .. ('<div class="help-toc-h2"><a href="#%s">%s</a></div>\n'):format(to_heading_tag(h2.name), h2.name) toc = toc .. ('<div class="help-toc-h2"><a href="#%s">%s</a></div>\n'):format(h2.tag, h2.name)
end end
end end
toc = toc .. '</div>' toc = toc .. '</div>'
@ -718,6 +809,17 @@ local function gen_css(fname)
position: fixed; position: fixed;
left: 67%; left: 67%;
} }
.golden-grid {
display: grid;
grid-template-columns: 65% auto;
grid-gap: 1em;
}
}
@media (max-width: 40em) {
.golden-grid {
/* Disable grid for narrow viewport (mobile phone). */
display: block;
}
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root { :root {
@ -726,6 +828,8 @@ local function gen_css(fname)
} }
.toc { .toc {
/* max-width: 12rem; */ /* max-width: 12rem; */
height: 85%; /* Scroll if there are too many items. https://github.com/neovim/neovim.github.io/issues/297 */
overflow: auto; /* Scroll if there are too many items. https://github.com/neovim/neovim.github.io/issues/297 */
} }
.toc > div { .toc > div {
text-overflow: ellipsis; text-overflow: ellipsis;
@ -784,7 +888,7 @@ local function gen_css(fname)
.help-tag-right { .help-tag-right {
color: var(--tag-color); color: var(--tag-color);
} }
h1 .help-tag, h2 .help-tag { h1 .help-tag, h2 .help-tag, h3 .help-tag {
font-size: smaller; font-size: smaller;
} }
.help-heading { .help-heading {
@ -831,11 +935,6 @@ local function gen_css(fname)
color: gray; color: gray;
font-size: smaller; font-size: smaller;
} }
.golden-grid {
display: grid;
grid-template-columns: 65% auto;
grid-gap: 1em;
}
]] ]]
tofile(fname, css) tofile(fname, css)
end end
@ -869,6 +968,22 @@ function M._test()
eq(5, get_indent(' a\n \n b\n c\n d\n e\n')) eq(5, get_indent(' a\n \n b\n c\n d\n e\n'))
eq('a\n \n b\n c\n d\n e\n', trim_indent(' a\n \n b\n c\n d\n e\n')) eq('a\n \n b\n c\n d\n e\n', trim_indent(' a\n \n b\n c\n d\n e\n'))
local fixed_url, removed_chars = fix_url('https://example.com).')
eq('https://example.com', fixed_url)
eq(').', removed_chars)
fixed_url, removed_chars = fix_url('https://example.com.)')
eq('https://example.com.', fixed_url)
eq(')', removed_chars)
fixed_url, removed_chars = fix_url('https://example.com.')
eq('https://example.com', fixed_url)
eq('.', removed_chars)
fixed_url, removed_chars = fix_url('https://example.com)')
eq('https://example.com', fixed_url)
eq(')', removed_chars)
fixed_url, removed_chars = fix_url('https://example.com')
eq('https://example.com', fixed_url)
eq('', removed_chars)
print('all tests passed') print('all tests passed')
end end

View File

@ -2,9 +2,7 @@
"""Generates Nvim :help docs from C/Lua docstrings, using Doxygen. """Generates Nvim :help docs from C/Lua docstrings, using Doxygen.
Also generates *.mpack files. To inspect the *.mpack structure: Also generates *.mpack files. To inspect the *.mpack structure:
:new | put=v:lua.vim.inspect(v:lua.vim.mpack.unpack(readfile('runtime/doc/api.mpack','B')))
:new | put=v:lua.vim.inspect(msgpackparse(readfile('runtime/doc/api.mpack')))
Flow: Flow:
main main
@ -14,15 +12,10 @@ Flow:
update_params_map / update_params_map /
render_node render_node
This would be easier using lxml and XSLT, but: TODO: eliminate this script and use Lua+treesitter (requires parsers for C and
Lua markdown-style docstrings).
1. This should avoid needing Python dependencies, especially ones that are The generated :help text for each function is formatted as follows:
C modules that have library dependencies (lxml requires libxml and
libxslt).
2. I wouldn't know how to deal with nested indentation in <para> tags using
XSLT.
Each function :help block is formatted as follows:
- Max width of 78 columns (`text_width`). - Max width of 78 columns (`text_width`).
- Indent with spaces (not tabs). - Indent with spaces (not tabs).
@ -287,7 +280,7 @@ annotation_map = {
'FUNC_API_FAST': '|api-fast|', 'FUNC_API_FAST': '|api-fast|',
'FUNC_API_CHECK_TEXTLOCK': 'not allowed when |textlock| is active', 'FUNC_API_CHECK_TEXTLOCK': 'not allowed when |textlock| is active',
'FUNC_API_REMOTE_ONLY': '|RPC| only', 'FUNC_API_REMOTE_ONLY': '|RPC| only',
'FUNC_API_LUA_ONLY': '|vim.api| only', 'FUNC_API_LUA_ONLY': 'Lua |vim.api| only',
} }
@ -673,7 +666,7 @@ def fmt_node_as_vimhelp(parent, width=text_width - indentation, indent='',
max_name_len = max_name(m.keys()) + 4 max_name_len = max_name(m.keys()) + 4
out = '' out = ''
for name, desc in m.items(): for name, desc in m.items():
name = ' {}'.format('{{{}}}'.format(name).ljust(max_name_len)) name = ' {}'.format('{{{}}}'.format(name).ljust(max_name_len))
out += '{}{}\n'.format(name, desc) out += '{}{}\n'.format(name, desc)
return out.rstrip() return out.rstrip()

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