mirror of
https://github.com/neovim/neovim
synced 2025-07-22 06:12:21 +00:00
Compare commits
83 Commits
Author | SHA1 | Date | |
---|---|---|---|
935615ffed | |||
3e0783db43 | |||
32b0b13cc5 | |||
3d0ddd2d1f | |||
7a49cf4da9 | |||
1b359d4034 | |||
81781810e6 | |||
8e28d8a370 | |||
a35efe1e4f | |||
ca9b5687f6 | |||
b0cb9a8ad0 | |||
95e1978959 | |||
2255d0fb63 | |||
eefa7fbbc2 | |||
bd4269c6a6 | |||
2c374e626a | |||
6a2dcaf6ab | |||
747b8dac73 | |||
f70feadb17 | |||
06144afb71 | |||
5eab16fa24 | |||
ddc0b75d53 | |||
7aaa0f4888 | |||
c34ebe60be | |||
06c63f50fc | |||
32ccb9770b | |||
f73bc880f4 | |||
f76473898d | |||
5a14c820a9 | |||
e7ed53286e | |||
7e8662676a | |||
cb086f1886 | |||
9234e5acd6 | |||
24769cf1b5 | |||
6fe00190f0 | |||
50f756ceb2 | |||
47454d0012 | |||
c52d256e91 | |||
59087b615d | |||
89fbffff13 | |||
7ba968ef3b | |||
8595f0298a | |||
7a011cb58d | |||
5b1bda14ae | |||
1cd5361c39 | |||
719afa2988 | |||
60ccada4cb | |||
6b49a20137 | |||
5f54cfcc05 | |||
bca9b1ecdf | |||
5e88506508 | |||
f294712d8c | |||
acb8033bca | |||
a6b62821de | |||
deda165155 | |||
2853284434 | |||
62e3ca3e2b | |||
0f669b7b70 | |||
29aa6e715b | |||
d92e6acc46 | |||
00761ad1e6 | |||
47cd3cf852 | |||
00ce3d6e7a | |||
aaee148392 | |||
9ad6f0da83 | |||
bca4588e17 | |||
126e434fec | |||
2ad8d36b89 | |||
e49dcbcc4b | |||
a6f19d39a4 | |||
68eb063416 | |||
cafc2ebc91 | |||
8fc775e3a4 | |||
7773fed570 | |||
d66e7a13c9 | |||
49dd143abc | |||
9857cc1dbf | |||
947ec159ae | |||
0c3054b033 | |||
ce422ba763 | |||
bb9c5c3f60 | |||
9e784a53b4 | |||
4db8c25bda |
18
.github/workflows/release.yml
vendored
18
.github/workflows/release.yml
vendored
@ -51,14 +51,28 @@ jobs:
|
||||
|
||||
appimage:
|
||||
runs-on: ubuntu-20.04
|
||||
container:
|
||||
image: ubuntu:18.04
|
||||
options: --privileged # Privileged mode is needed to load fuse module.
|
||||
steps:
|
||||
- name: Prepare container
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y software-properties-common
|
||||
add-apt-repository -y ppa:ubuntu-toolchain-r/test # For gcc-10.
|
||||
add-apt-repository -y ppa:git-core/ppa # For git>=2.18.
|
||||
apt-get update
|
||||
apt-get install -y git gcc-10
|
||||
apt-get install -y fuse libfuse2 # For linuxdeploy.
|
||||
# Workaround for https://github.com/actions/checkout/issues/766.
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
|
||||
apt-get update
|
||||
apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
|
||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
||||
run: CC=gcc-10 make appimage-latest
|
||||
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
||||
|
@ -1,6 +1,7 @@
|
||||
# CMAKE REFERENCE
|
||||
# intro: https://codingnest.com/basic-cmake/
|
||||
# best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
|
||||
# pitfalls: https://izzys.casa/2019/02/everything-you-never-wanted-to-know-about-cmake/
|
||||
|
||||
# Version should match the tested CMAKE_URL in .github/workflows/ci.yml.
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
@ -132,7 +133,7 @@ endif()
|
||||
# version string, else they are combined with the result of `git describe`.
|
||||
set(NVIM_VERSION_MAJOR 0)
|
||||
set(NVIM_VERSION_MINOR 8)
|
||||
set(NVIM_VERSION_PATCH 0)
|
||||
set(NVIM_VERSION_PATCH 1)
|
||||
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||
|
||||
# API level
|
||||
@ -639,7 +640,7 @@ include(InstallHelpers)
|
||||
add_glob_targets(
|
||||
TARGET lintpy
|
||||
COMMAND ${FLAKE8_PRG}
|
||||
FLAGS --max-line-length 88
|
||||
FLAGS --max-line-length 100
|
||||
GLOB_DIRS contrib scripts src test
|
||||
GLOB_PAT *.py
|
||||
TOUCH_STRATEGY SINGLE
|
||||
|
@ -11,7 +11,10 @@ low-risk/isolated tasks:
|
||||
- Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or
|
||||
[Coverity](#coverity).
|
||||
- [Improve documentation](#documenting)
|
||||
- [Merge a Vim patch] (familiarity with Vim is *strongly* recommended)
|
||||
- [Merge a Vim patch] (requires strong familiarity with Vim)
|
||||
- NOTE: read the above link before sending improvements to "runtime files" (anything in `runtime/`).
|
||||
- Vimscript and documentation files are (mostly) maintained by [Vim](https://github.com/vim/vim), not Nvim.
|
||||
- Lua files are maintained by Nvim.
|
||||
|
||||
Reporting problems
|
||||
------------------
|
||||
@ -30,9 +33,9 @@ Reporting problems
|
||||
Developer guidelines
|
||||
--------------------
|
||||
|
||||
- Read `:help dev` if you are working on Nvim core.
|
||||
- Read `:help dev-ui` if you are developing a UI.
|
||||
- Read `:help dev-api-client` if you are developing an API client.
|
||||
- Read [:help dev](https://neovim.io/doc/user/develop.html#dev) if you are working on Nvim core.
|
||||
- Read [:help dev-ui](https://neovim.io/doc/user/develop.html#dev-ui) if you are developing a UI.
|
||||
- Read [:help dev-api-client](https://neovim.io/doc/user/develop.html#dev-api-client) if you are developing an API client.
|
||||
- Install `ninja` for faster builds of Nvim.
|
||||
```
|
||||
sudo apt-get install ninja-build
|
||||
@ -47,21 +50,19 @@ Pull requests (PRs)
|
||||
- Your PR must include [test coverage][run-tests].
|
||||
- Avoid cosmetic changes to unrelated files in the same commit.
|
||||
- Use a [feature branch][git-feature-branch] instead of the master branch.
|
||||
- Use a **rebase workflow** for small PRs.
|
||||
- After addressing review comments, it's fine to rebase and force-push.
|
||||
- Use a **merge workflow** for big, high-risk PRs.
|
||||
- Use a _rebase workflow_ for small PRs.
|
||||
- After addressing review comments, it's fine to force-push.
|
||||
- Use a _merge workflow_ (as opposed to "rebase") for big, high-risk PRs.
|
||||
- Merge `master` into your PR when there are conflicts or when master
|
||||
introduces breaking changes.
|
||||
- Use the `ri` git alias:
|
||||
```
|
||||
[alias]
|
||||
ri = "!sh -c 't=\"${1:-master}\"; s=\"${2:-HEAD}\"; mb=\"$(git merge-base \"$t\" \"$s\")\"; if test \"x$mb\" = x ; then o=\"$t\"; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\"; if test \"x$lm\" = x ; then o=\"$mb\"; else o=\"$lm\"; fi; fi; test $# -gt 0 && shift; test $# -gt 0 && shift; git rebase --interactive \"$o\" \"$@\"'"
|
||||
```
|
||||
This avoids unnecessary rebases yet still allows you to combine related
|
||||
commits, separate monolithic commits, etc.
|
||||
- Do not edit commits that come before the merge commit.
|
||||
- During a squash/fixup, use `exec make -C build unittest` between each
|
||||
pick/edit/reword.
|
||||
|
||||
### Merging to master
|
||||
|
||||
For maintainers: when a PR is ready to merge to master,
|
||||
|
||||
- prefer _Squash Merge_ for "single-commit PRs" (when the PR has only one meaningful commit).
|
||||
- prefer _Merge_ for "multi-commit PRs" (when the PR has multiple meaningful commits).
|
||||
|
||||
### Stages: Draft and Ready for review
|
||||
|
||||
|
@ -8,7 +8,7 @@ Neovim's license follows:
|
||||
====
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
https://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
@ -196,10 +196,11 @@ The externally maintained libraries used by Neovim are:
|
||||
- libtermkey: MIT license
|
||||
- libuv. Copyright Joyent, Inc. and other Node contributors. Node.js license.
|
||||
- libvterm: MIT license
|
||||
- lua-cjson: MIT license
|
||||
- lua-compat: MIT license
|
||||
- tree-sitter: MIT license
|
||||
- xdiff: LGPL license
|
||||
- lua-cjson: MIT license
|
||||
- unibilium: LGPL v3
|
||||
- xdiff: LGPL v2
|
||||
|
||||
====
|
||||
|
||||
|
88
MAINTAIN.md
88
MAINTAIN.md
@ -12,23 +12,23 @@ General guidelines
|
||||
* Use automation to solve problems
|
||||
* Never break the API... but sometimes break the UI
|
||||
|
||||
Ticket triage
|
||||
-------------
|
||||
Issue triage
|
||||
------------
|
||||
|
||||
In practice we haven't found a way to forecast more precisely than "next" and
|
||||
"after next". So there are usually one or two (at most) planned milestones:
|
||||
|
||||
- Next bugfix-release (1.0.x)
|
||||
- Next feature-release (1.x.0)
|
||||
* Next bugfix-release (1.0.x)
|
||||
* Next feature-release (1.x.0)
|
||||
|
||||
The forecasting problem might be solved with an explicit priority system (like
|
||||
Bram's todo.txt). Meanwhile the Neovim priority system is defined by:
|
||||
|
||||
- PRs nearing completion.
|
||||
- Issue labels. E.g. the `+plan` label increases the ticket's priority merely
|
||||
* PRs nearing completion.
|
||||
* Issue labels. E.g. the `+plan` label increases the ticket's priority merely
|
||||
for having a plan written down: it is _closer to completion_ than tickets
|
||||
without a plan.
|
||||
- Comment activity or new information.
|
||||
* Comment activity or new information.
|
||||
|
||||
Anything that isn't in the next milestone, and doesn't have a finished PR—is
|
||||
just not something you care very much about, by construction. Post-release you
|
||||
@ -50,46 +50,56 @@ has a major bug:
|
||||
1. Fix the bug on `master`.
|
||||
2. Cherry-pick the fix to `release-x.y`.
|
||||
3. Cut a release from `release-x.y`.
|
||||
- Run `./scripts/release.sh`
|
||||
- Update (force-push) the remote `stable` tag.
|
||||
- The [CI job](https://github.com/neovim/neovim/blob/3d45706478cd030c3ee05b4f336164bb96138095/.github/workflows/release.yml#L11-L13)
|
||||
will update the release assets based on the `stable` tag.
|
||||
* Run `./scripts/release.sh`
|
||||
* Update (force-push) the remote `stable` tag.
|
||||
* The [CI job](https://github.com/neovim/neovim/blob/3d45706478cd030c3ee05b4f336164bb96138095/.github/workflows/release.yml#L11-L13)
|
||||
will update the release assets and force-push to the `stable` tag.
|
||||
|
||||
The neovim repository includes a backport [github action](https://github.com/zeebe-io/backport-action).
|
||||
In order to trigger the action, a PR must be labeled with a label matching the
|
||||
form `backport release-0.X`.
|
||||
### Release automation
|
||||
|
||||
Neovim automation includes a [backport bot](https://github.com/zeebe-io/backport-action).
|
||||
Trigger the action by labeling a PR with `backport release-X.Y`. See `.github/workflows/backport.yml`.
|
||||
|
||||
Third-party dependencies
|
||||
--------------
|
||||
------------------------
|
||||
|
||||
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/CMakeLists.txt`:
|
||||
- [Lua](https://www.lua.org/download.html)
|
||||
- [LuaJIT](https://github.com/LuaJIT/LuaJIT)
|
||||
- [Luv](https://github.com/luvit/luv)
|
||||
- [libtermkey](https://github.com/neovim/libtermkey)
|
||||
- [libuv](https://github.com/libuv/libuv)
|
||||
- [libvterm](http://www.leonerd.org.uk/code/libvterm/)
|
||||
- [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
|
||||
- [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
||||
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/CMakeLists.txt`.
|
||||
Some can be auto-bumped by `scripts/bump-deps.sh`.
|
||||
|
||||
`scripts/bump-dep.sh` is a script that can automate this process for `LuaJIT`, `Luv`, `libuv` & `tree-sitter`. See usage guide:
|
||||
- Run `./scripts/bump-deps.sh --dep Luv --version 1.43.0-0` to update a dependency.
|
||||
See `./scripts/bump-deps.sh -h` for more detailed usage
|
||||
- Run `./scripts/bump-deps.sh --pr` to create a pr
|
||||
To generate the default PR title and body, the script uses the most recent commit (not in `master`) with prefix `build(deps): `
|
||||
* [LuaJIT](https://github.com/LuaJIT/LuaJIT)
|
||||
* [Lua](https://www.lua.org/download.html)
|
||||
* [Luv](https://github.com/luvit/luv)
|
||||
* [gettext](https://ftp.gnu.org/pub/gnu/gettext/)
|
||||
* [libiconv](https://ftp.gnu.org/pub/gnu/libiconv)
|
||||
* [libtermkey](https://github.com/neovim/libtermkey)
|
||||
* [libuv](https://github.com/libuv/libuv)
|
||||
* [libvterm](http://www.leonerd.org.uk/code/libvterm/)
|
||||
* [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
|
||||
* [msys2](https://github.com/msys2/MINGW-packages) (for mingw Windows build)
|
||||
* Changes to mingw can [break our mingw build](https://github.com/msys2/MINGW-packages/issues/9946).
|
||||
* [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
||||
* [unibilium](https://github.com/neovim/unibilium)
|
||||
|
||||
These dependencies are "vendored" (inlined), we need to update the sources manually:
|
||||
- [libmpack](https://github.com/libmpack/libmpack)
|
||||
- [xdiff](https://github.com/git/git/tree/master/xdiff)
|
||||
- [lua-cjson](https://github.com/openresty/lua-cjson)
|
||||
- [Klib](https://github.com/attractivechaos/klib)
|
||||
- [inspect.lua](https://github.com/kikito/inspect.lua)
|
||||
### Vendored dependencies
|
||||
|
||||
We also maintain some forks, particularly for Windows, if we are waiting on upstream changes:
|
||||
https://github.com/neovim/neovim/wiki/Deps
|
||||
These dependencies are "vendored" (inlined), we must update the sources manually:
|
||||
|
||||
* `src/mpack/`: [libmpack](https://github.com/libmpack/libmpack)
|
||||
* send improvements upstream!
|
||||
* `src/xdiff/`: [xdiff](https://github.com/git/git/tree/master/xdiff)
|
||||
* `src/cjson/`: [lua-cjson](https://github.com/openresty/lua-cjson)
|
||||
* `src/nvim/lib/`: [Klib](https://github.com/attractivechaos/klib)
|
||||
* `runtime/lua/vim/inspect.lua`: [inspect.lua](https://github.com/kikito/inspect.lua)
|
||||
* `src/nvim/tui/terminfo_defs.h`: terminfo definitions
|
||||
* Run `scripts/update_terminfo.sh` to update these definitions.
|
||||
* [treesitter parsers](https://github.com/neovim/neovim/blob/fcc24e43e0b5f9d801a01ff2b8f78ce8c16dd551/cmake.deps/CMakeLists.txt#L197-L210)
|
||||
|
||||
### Forks
|
||||
|
||||
We may maintain forks, if we are waiting on upstream changes: https://github.com/neovim/neovim/wiki/Deps
|
||||
|
||||
See also
|
||||
--------
|
||||
|
||||
- https://github.com/neovim/neovim/issues/862
|
||||
- https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
|
||||
* https://github.com/neovim/neovim/issues/862
|
||||
* https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
|
||||
|
@ -210,8 +210,8 @@ set(TREESITTER_LUA_SHA256 564594fe0ffd2f2fb3578a15019b723e1bc94ac82cb6a0103a6b3b
|
||||
set(TREESITTER_VIM_URL https://github.com/vigoux/tree-sitter-viml/archive/v0.2.0.tar.gz)
|
||||
set(TREESITTER_VIM_SHA256 608dcc31a7948cb66ae7f45494620e2e9face1af75598205541f80d782ec4501)
|
||||
|
||||
set(TREESITTER_HELP_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v1.1.0.tar.gz)
|
||||
set(TREESITTER_HELP_SHA256 4c0ef80c6dc09acab362478950ec6be58a4ab1cbf2d95754b8fbb566e4c647a1)
|
||||
set(TREESITTER_HELP_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v1.2.2.tar.gz)
|
||||
set(TREESITTER_HELP_SHA256 d33b9447dae04f19e1ac50c94b78e305574c07f942791f70aea96fe266447c18)
|
||||
|
||||
set(TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.20.7.tar.gz)
|
||||
set(TREESITTER_SHA256 b355e968ec2d0241bbd96748e00a9038f83968f85d822ecb9940cbe4c42e182e)
|
||||
|
@ -1,26 +1,27 @@
|
||||
if(NVIM_VERSION_MEDIUM)
|
||||
message(STATUS "USING NVIM_VERSION_MEDIUM: ${NVIM_VERSION_MEDIUM}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(NVIM_VERSION_MEDIUM
|
||||
set(NVIM_VERSION
|
||||
"v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}${NVIM_VERSION_PRERELEASE}")
|
||||
|
||||
execute_process(
|
||||
COMMAND git describe --first-parent --dirty --always
|
||||
OUTPUT_VARIABLE GIT_TAG
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE RES)
|
||||
|
||||
if(RES AND NOT RES EQUAL 0)
|
||||
message(STATUS "Using NVIM_VERSION_MEDIUM: ${NVIM_VERSION_MEDIUM}")
|
||||
file(WRITE "${OUTPUT}" "${NVIM_VERSION_STRING}")
|
||||
message(STATUS "Using NVIM_VERSION: ${NVIM_VERSION}")
|
||||
file(WRITE "${OUTPUT}" "")
|
||||
return()
|
||||
endif()
|
||||
|
||||
string(STRIP "${GIT_TAG}" GIT_TAG)
|
||||
string(REGEX REPLACE "^v[0-9]+.[0-9]+.[0-9]+-" "" NVIM_VERSION_GIT "${GIT_TAG}")
|
||||
set(NVIM_VERSION_MEDIUM "${NVIM_VERSION_MEDIUM}-${NVIM_VERSION_GIT}")
|
||||
set(NVIM_VERSION_STRING "#define NVIM_VERSION_MEDIUM \"${NVIM_VERSION_MEDIUM}\"\n")
|
||||
# `git describe` annotates the most recent tagged release; for pre-release
|
||||
# builds we append that to the dev version.
|
||||
if(NVIM_VERSION_PRERELEASE)
|
||||
string(REGEX REPLACE "^v[0-9]+.[0-9]+.[0-9]+-" "" NVIM_VERSION_GIT "${GIT_TAG}")
|
||||
string(REGEX REPLACE "^([0-9]+)-([a-z0-9]+)" "\\1+\\2" NVIM_VERSION_GIT "${NVIM_VERSION_GIT}")
|
||||
set(NVIM_VERSION "${NVIM_VERSION}-${NVIM_VERSION_GIT}")
|
||||
endif()
|
||||
|
||||
set(NVIM_VERSION_STRING "#define NVIM_VERSION_MEDIUM \"${NVIM_VERSION}\"\n")
|
||||
|
||||
string(SHA1 CURRENT_VERSION_HASH "${NVIM_VERSION_STRING}")
|
||||
if(EXISTS ${OUTPUT})
|
||||
@ -28,6 +29,6 @@ if(EXISTS ${OUTPUT})
|
||||
endif()
|
||||
|
||||
if(NOT "${NVIM_VERSION_HASH}" STREQUAL "${CURRENT_VERSION_HASH}")
|
||||
message(STATUS "Using NVIM_VERSION_MEDIUM: ${NVIM_VERSION_MEDIUM}")
|
||||
message(STATUS "Using NVIM_VERSION: ${NVIM_VERSION}")
|
||||
file(WRITE "${OUTPUT}" "${NVIM_VERSION_STRING}")
|
||||
endif()
|
||||
|
@ -8,61 +8,63 @@
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
{
|
||||
overlay = final: prev:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${prev.system};
|
||||
in
|
||||
rec {
|
||||
neovim = pkgs.neovim-unwrapped.overrideAttrs (oa: {
|
||||
version = "master";
|
||||
src = ../.;
|
||||
|
||||
buildInputs = oa.buildInputs ++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
|
||||
CoreServices
|
||||
]);
|
||||
overlay = final: prev: rec {
|
||||
neovim-unwrapped = prev.neovim-unwrapped.override ({
|
||||
libvterm-neovim = prev.libvterm-neovim.overrideAttrs (old: {
|
||||
version = "0.3";
|
||||
src = builtins.fetchTarball {
|
||||
url = "https://www.leonerd.org.uk/code/libvterm/libvterm-0.3.tar.gz";
|
||||
sha256 = "0zg6sn5brwrnqaab883pdj0l2swk5askbbwbdam0zq55ikbrzgar";
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
# a development binary to help debug issues
|
||||
neovim-debug =
|
||||
let
|
||||
stdenv = if pkgs.stdenv.isLinux then pkgs.llvmPackages_latest.stdenv else pkgs.stdenv;
|
||||
in
|
||||
((neovim.override {
|
||||
lua = pkgs.luajit;
|
||||
inherit stdenv;
|
||||
}).overrideAttrs (oa: {
|
||||
neovim = final.neovim-unwrapped.overrideAttrs (oa: {
|
||||
version = "master";
|
||||
src = ../.;
|
||||
|
||||
dontStrip = true;
|
||||
NIX_CFLAGS_COMPILE = " -ggdb -Og";
|
||||
buildInputs = oa.buildInputs
|
||||
++ final.lib.optionals final.stdenv.isDarwin
|
||||
(with final.darwin.apple_sdk.frameworks; [ CoreServices ]);
|
||||
});
|
||||
|
||||
cmakeBuildType = "Debug";
|
||||
cmakeFlags = oa.cmakeFlags ++ [
|
||||
"-DMIN_LOG_LEVEL=0"
|
||||
];
|
||||
# a development binary to help debug issues
|
||||
neovim-debug = let
|
||||
stdenv = if final.stdenv.isLinux then
|
||||
final.llvmPackages_latest.stdenv
|
||||
else
|
||||
final.stdenv;
|
||||
in ((neovim.override {
|
||||
lua = final.luajit;
|
||||
inherit stdenv;
|
||||
}).overrideAttrs (oa: {
|
||||
|
||||
disallowedReferences = [ ];
|
||||
}));
|
||||
dontStrip = true;
|
||||
NIX_CFLAGS_COMPILE = " -ggdb -Og";
|
||||
|
||||
# for neovim developers, beware of the slow binary
|
||||
neovim-developer =
|
||||
let
|
||||
lib = nixpkgs.lib;
|
||||
luacheck = pkgs.luaPackages.luacheck;
|
||||
in
|
||||
(neovim-debug.override ({ doCheck = pkgs.stdenv.isLinux; })).overrideAttrs (oa: {
|
||||
cmakeFlags = oa.cmakeFlags ++ [
|
||||
"-DLUACHECK_PRG=${luacheck}/bin/luacheck"
|
||||
"-DMIN_LOG_LEVEL=0"
|
||||
"-DENABLE_LTO=OFF"
|
||||
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
|
||||
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
|
||||
# https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports
|
||||
"-DCLANG_ASAN_UBSAN=ON"
|
||||
];
|
||||
});
|
||||
};
|
||||
} //
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
cmakeBuildType = "Debug";
|
||||
cmakeFlags = oa.cmakeFlags ++ [ "-DMIN_LOG_LEVEL=0" ];
|
||||
|
||||
disallowedReferences = [ ];
|
||||
}));
|
||||
|
||||
# for neovim developers, beware of the slow binary
|
||||
neovim-developer = let luacheck = final.luaPackages.luacheck;
|
||||
in (neovim-debug.override ({
|
||||
doCheck = final.stdenv.isLinux;
|
||||
})).overrideAttrs (oa: {
|
||||
cmakeFlags = oa.cmakeFlags ++ [
|
||||
"-DLUACHECK_PRG=${luacheck}/bin/luacheck"
|
||||
"-DMIN_LOG_LEVEL=0"
|
||||
"-DENABLE_LTO=OFF"
|
||||
] ++ final.lib.optionals final.stdenv.isLinux [
|
||||
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
|
||||
# https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports
|
||||
"-DCLANG_ASAN_UBSAN=ON"
|
||||
];
|
||||
});
|
||||
};
|
||||
} // flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
overlays = [ self.overlay ];
|
||||
@ -75,26 +77,22 @@
|
||||
ps.msgpack
|
||||
ps.flake8 # for 'make pylint'
|
||||
]);
|
||||
in
|
||||
rec {
|
||||
|
||||
in {
|
||||
packages = with pkgs; {
|
||||
default = neovim;
|
||||
inherit neovim neovim-debug neovim-developer;
|
||||
};
|
||||
|
||||
checks = {
|
||||
pylint = pkgs.runCommandNoCC "pylint"
|
||||
{
|
||||
nativeBuildInputs = [ pythonEnv ];
|
||||
preferLocalBuild = true;
|
||||
} "make -C ${./..} pylint > $out";
|
||||
pylint = pkgs.runCommand "pylint" {
|
||||
nativeBuildInputs = [ pythonEnv ];
|
||||
preferLocalBuild = true;
|
||||
} "make -C ${./..} pylint > $out";
|
||||
|
||||
shlint = pkgs.runCommandNoCC "shlint"
|
||||
{
|
||||
nativeBuildInputs = [ pkgs.shellcheck ];
|
||||
preferLocalBuild = true;
|
||||
} "make -C ${./..} shlint > $out";
|
||||
shlint = pkgs.runCommand "shlint" {
|
||||
nativeBuildInputs = [ pkgs.shellcheck ];
|
||||
preferLocalBuild = true;
|
||||
} "make -C ${./..} shlint > $out";
|
||||
};
|
||||
|
||||
# kept for backwards-compatibility
|
||||
@ -103,17 +101,18 @@
|
||||
devShells = {
|
||||
default = pkgs.neovim-developer.overrideAttrs (oa: {
|
||||
|
||||
buildInputs = with pkgs; oa.buildInputs ++ [
|
||||
cmake
|
||||
lua.pkgs.luacheck
|
||||
sumneko-lua-language-server
|
||||
pythonEnv
|
||||
include-what-you-use # for scripts/check-includes.py
|
||||
jq # jq for scripts/vim-patch.sh -r
|
||||
shellcheck # for `make shlint`
|
||||
doxygen # for script/gen_vimdoc.py
|
||||
clang-tools # for clangd to find the correct headers
|
||||
];
|
||||
buildInputs = with pkgs;
|
||||
oa.buildInputs ++ [
|
||||
cmake
|
||||
lua.pkgs.luacheck
|
||||
sumneko-lua-language-server
|
||||
pythonEnv
|
||||
include-what-you-use # for scripts/check-includes.py
|
||||
jq # jq for scripts/vim-patch.sh -r
|
||||
shellcheck # for `make shlint`
|
||||
doxygen # for script/gen_vimdoc.py
|
||||
clang-tools # for clangd to find the correct headers
|
||||
];
|
||||
|
||||
shellHook = oa.shellHook + ''
|
||||
export NVIM_PYTHON_LOG_LEVEL=DEBUG
|
||||
|
@ -75,8 +75,10 @@ add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
|
||||
)
|
||||
|
||||
|
||||
# TODO: This doesn't work. wait for "nvim -l" to land?
|
||||
add_custom_target(doc_html
|
||||
COMMAND make html
|
||||
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
|
||||
-V1 -es --clean -c "lua require('scripts.gen_help_html').gen('./build/runtime/doc', './build/doc_html', nil, 'todo_commit_id')" -c "0cq"
|
||||
DEPENDS
|
||||
${GENERATED_HELP_TAGS}
|
||||
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc"
|
||||
|
@ -235,7 +235,7 @@ function! s:check_tmux() abort
|
||||
endif
|
||||
|
||||
" check for RGB capabilities
|
||||
let info = system(['tmux', 'server-info'])
|
||||
let info = system(['tmux', 'show-messages', '-JT'])
|
||||
let has_tc = stridx(info, " Tc: (flag) true") != -1
|
||||
let has_rgb = stridx(info, " RGB: (flag) true") != -1
|
||||
if !has_tc && !has_rgb
|
||||
|
@ -104,7 +104,7 @@ function! tutor#CheckLine(line)
|
||||
if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect')
|
||||
let bufn = bufnr('%')
|
||||
let ctext = getline(a:line)
|
||||
let signs = sign_getplaced('.', {'lnum': a:line})[0].signs
|
||||
let signs = sign_getplaced(bufn, {'lnum': a:line})[0].signs
|
||||
if !empty(signs)
|
||||
call sign_unplace('', {'id': signs[0].id})
|
||||
endif
|
||||
|
@ -13,7 +13,7 @@ set background=dark
|
||||
hi clear
|
||||
let g:colors_name = 'blue'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#000000', '#cd0000', '#00cd00', '#cdcd00', '#0000ee', '#cd00cd', '#00cdcd', '#e5e5e5', '#7f7f7f', '#ff0000', '#00ff00', '#ffff00', '#5c5cff', '#ff00ff', '#00ffff', '#ffffff']
|
||||
|
@ -13,7 +13,7 @@ set background=dark
|
||||
hi clear
|
||||
let g:colors_name = 'darkblue'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#000000', '#8b0000', '#90f020', '#ffa500', '#00008b', '#8b008b', '#008b8b', '#c0c0c0', '#808080', '#ffa0a0', '#90f020', '#ffff60', '#0030ff', '#ff00ff', '#90fff0', '#ffffff']
|
||||
|
@ -13,7 +13,7 @@ set background=light
|
||||
hi clear
|
||||
let g:colors_name = 'delek'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#ffffff', '#0000ff', '#00cd00', '#cd00cd', '#008b8b', '#0000ff', '#ff1493', '#bcbcbc', '#ee0000', '#0000ff', '#00cd00', '#cd00cd', '#008b8b', '#0000ff', '#ff1493', '#000000']
|
||||
|
@ -13,7 +13,7 @@ set background=dark
|
||||
hi clear
|
||||
let g:colors_name = 'desert'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#7f7f8c', '#cd5c5c', '#9acd32', '#bdb76b', '#75a0ff', '#eeee00', '#cd853f', '#666666', '#8a7f7f', '#ff0000', '#89fb98', '#f0e68c', '#6dceeb', '#ffde9b', '#ffa0a0', '#c2bfa5']
|
||||
|
@ -12,7 +12,7 @@ set background=dark
|
||||
hi clear
|
||||
let g:colors_name = 'elflord'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
hi! link Terminal Normal
|
||||
hi! link Boolean Constant
|
||||
|
@ -13,7 +13,7 @@ set background=dark
|
||||
hi clear
|
||||
let g:colors_name = 'evening'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#000000', '#cd0000', '#00cd00', '#cdcd00', '#0087ff', '#cd00cd', '#00cdcd', '#e5e5e5', '#7f7f7f', '#ff0000', '#00ff00', '#ffff00', '#5c5cff', '#ff00ff', '#00ffff', '#ffffff']
|
||||
|
@ -13,7 +13,7 @@ set background=dark
|
||||
hi clear
|
||||
let g:colors_name = 'habamax'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#1c1c1c', '#d75f5f', '#87af87', '#afaf87', '#5f87af', '#af87af', '#5f8787', '#9e9e9e', '#767676', '#d7875f', '#afd7af', '#d7d787', '#87afd7', '#d7afd7', '#87afaf', '#bcbcbc']
|
||||
|
@ -13,7 +13,7 @@ set background=dark
|
||||
hi clear
|
||||
let g:colors_name = 'industry'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#303030', '#870000', '#5fd75f', '#afaf00', '#87afff', '#af00af', '#00afaf', '#6c6c6c', '#444444', '#ff0000', '#00ff00', '#ffff00', '#005fff', '#ff00ff', '#00ffff', '#ffffff']
|
||||
|
@ -12,7 +12,7 @@ set background=dark
|
||||
hi clear
|
||||
let g:colors_name = 'koehler'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
hi! link Terminal Normal
|
||||
hi! link Boolean Constant
|
||||
|
@ -11,7 +11,7 @@
|
||||
hi clear
|
||||
let g:colors_name = 'lunaperche'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
hi! link helpVim Title
|
||||
hi! link helpHeader Title
|
||||
|
@ -13,7 +13,7 @@ set background=light
|
||||
hi clear
|
||||
let g:colors_name = 'morning'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#e4e4e4', '#a52a2a', '#ff00ff', '#6a0dad', '#008787', '#2e8b57', '#6a5acd', '#bcbcbc', '#0000ff', '#a52a2a', '#ff00ff', '#6a0dad', '#008787', '#2e8b57', '#6a5acd', '#000000']
|
||||
|
@ -13,7 +13,7 @@ set background=dark
|
||||
hi clear
|
||||
let g:colors_name = 'murphy'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#303030', '#ffa700', '#005f00', '#ffd7af', '#87afff', '#ffafaf', '#00afaf', '#bcbcbc', '#444444', '#ff0000', '#00875f', '#ffff00', '#005fff', '#ff00ff', '#00ffff', '#ffffff']
|
||||
|
@ -12,7 +12,7 @@ set background=dark
|
||||
hi clear
|
||||
let g:colors_name = 'pablo'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#000000', '#cd0000', '#00cd00', '#cdcd00', '#0000ee', '#cd00cd', '#00cdcd', '#e5e5e5', '#7f7f7f', '#ff0000', '#00ff00', '#ffff00', '#5c5cff', '#ff00ff', '#00ffff', '#ffffff']
|
||||
|
@ -13,7 +13,7 @@ set background=light
|
||||
hi clear
|
||||
let g:colors_name = 'peachpuff'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#ffdab9', '#a52a2a', '#c00058', '#cd00cd', '#008b8b', '#2e8b57', '#6a5acd', '#737373', '#406090', '#a52a2a', '#c00058', '#cd00cd', '#008b8b', '#2e8b57', '#6a5acd', '#000000']
|
||||
|
@ -11,7 +11,7 @@
|
||||
hi clear
|
||||
let g:colors_name = 'quiet'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
hi! link Terminal Normal
|
||||
hi! link StatusLineTerm StatusLine
|
||||
|
@ -12,7 +12,7 @@ set background=dark
|
||||
hi clear
|
||||
let g:colors_name = 'ron'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
hi! link Terminal Normal
|
||||
hi! link Boolean Constant
|
||||
|
@ -13,7 +13,7 @@ set background=light
|
||||
hi clear
|
||||
let g:colors_name = 'shine'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#000000', '#8b0000', '#006400', '#ffff00', '#00008b', '#6a0dad', '#008b8b', '#dadada', '#767676', '#ffafaf', '#90ee90', '#ffff60', '#add8e6', '#ff00ff', '#00ffff', '#ffffff']
|
||||
|
@ -13,7 +13,7 @@ set background=dark
|
||||
hi clear
|
||||
let g:colors_name = 'slate'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#000000', '#cd0000', '#00cd00', '#cdcd00', '#0000ee', '#cd00cd', '#00cdcd', '#e5e5e5', '#7f7f7f', '#ff0000', '#00ff00', '#ffff00', '#5c5cff', '#ff00ff', '#00ffff', '#ffffff']
|
||||
|
@ -13,7 +13,7 @@ set background=dark
|
||||
hi clear
|
||||
let g:colors_name = 'torte'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#000000', '#cd0000', '#00cd00', '#cdcd00', '#0000ee', '#cd00cd', '#00cdcd', '#e5e5e5', '#7f7f7f', '#ff0000', '#00ff00', '#ffff00', '#5c5cff', '#ff00ff', '#00ffff', '#ffffff']
|
||||
|
@ -13,7 +13,7 @@ set background=light
|
||||
hi clear
|
||||
let g:colors_name = 'zellner'
|
||||
|
||||
let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ? &t_Co : 0) : -1
|
||||
let s:t_Co = &t_Co
|
||||
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#ffffff', '#a52a2a', '#ff00ff', '#a020f0', '#0000ff', '#0000ff', '#ff00ff', '#a9a9a9', '#ff0000', '#a52a2a', '#ff00ff', '#a020f0', '#0000ff', '#0000ff', '#ff00ff', '#000000']
|
||||
|
@ -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
@ -14,8 +14,9 @@ It is best to view this file with these settings within VIM's GUI: >
|
||||
:set arabicshape
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Arabic is a rather demanding language in which a number of special
|
||||
features are required. Characters are right-to-left oriented and
|
||||
ought to appear as such on the screen (i.e. from right to left).
|
||||
@ -34,8 +35,9 @@ The commands, prompts and help files are not in Arabic, therefore
|
||||
the user interface remains the standard Vi interface.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Highlights
|
||||
----------
|
||||
|
||||
o Editing left-to-right files as in the original Vim hasn't changed.
|
||||
|
||||
o Viewing and editing files in right-to-left windows. File
|
||||
@ -64,8 +66,8 @@ o Proper Bidirectional functionality is possible given Vim is
|
||||
started within a Bidi capable terminal emulator.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Arabic Fonts *arabicfonts*
|
||||
------------
|
||||
|
||||
Vim requires monospaced fonts of which there are many out there.
|
||||
Arabic requires ISO-8859-6 as well as Presentation Form-B fonts
|
||||
@ -75,8 +77,8 @@ Do an Internet search or check www.arabeyes.org for further
|
||||
info on where to obtain the necessary Arabic fonts.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Font Installation
|
||||
-----------------
|
||||
|
||||
o Installation of fonts for X Window systems (Unix/Linux)
|
||||
|
||||
@ -88,8 +90,9 @@ o Installation of fonts for X Window systems (Unix/Linux)
|
||||
% xset +fp path_name_of_arabic_fonts_directory
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Usage
|
||||
-----
|
||||
|
||||
Prior to the actual usage of Arabic within Vim, a number of settings
|
||||
need to be accounted for and invoked.
|
||||
|
||||
@ -259,8 +262,8 @@ o Enable Arabic settings [short-cut]
|
||||
':set arabicshape' to your vimrc file.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Keymap/Keyboard *arabickeymap*
|
||||
---------------
|
||||
|
||||
The character/letter encoding used in Vim is the standard UTF-8.
|
||||
It is widely discouraged that any other encoding be used or even
|
||||
@ -276,7 +279,7 @@ o Keyboard
|
||||
+ CTRL-^ in insert/replace mode toggles between Arabic/Latin mode
|
||||
|
||||
+ Keyboard mapping is based on the Microsoft's Arabic keymap (the
|
||||
de facto standard in the Arab world):
|
||||
de facto standard in the Arab world): >
|
||||
|
||||
+---------------------------------------------------------------------+
|
||||
|! |@ |# |$ |% |^ |& |* |( |) |_ |+ || |~ ّ |
|
||||
@ -291,17 +294,18 @@ o Keyboard
|
||||
|Z ~ |X ْ |C { |V } |B لآ |N آ |M ' |< , |> . |? ؟ |
|
||||
|z ئ |x ء |c ؤ |v ر |b لا |n ى |m ة |, و |. ز |/ ظ |
|
||||
+-------------------------------------------------+
|
||||
<
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Restrictions
|
||||
------------
|
||||
|
||||
o Vim in its GUI form does not currently support Bi-directionality
|
||||
(i.e. the ability to see both Arabic and Latin intermixed within
|
||||
the same line).
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Known Bugs
|
||||
----------
|
||||
|
||||
There is one known minor bug,
|
||||
|
||||
|
@ -590,6 +590,7 @@ FileChangedShell When Vim notices that the modification time of
|
||||
- executing a shell command
|
||||
- |:checktime|
|
||||
- |FocusGained|
|
||||
|
||||
Not used when 'autoread' is set and the buffer
|
||||
was not changed. If a FileChangedShell
|
||||
autocommand exists the warning message and
|
||||
|
@ -3804,15 +3804,15 @@ has({feature}) Returns 1 if {feature} is supported, 0 otherwise. The
|
||||
{feature} argument is a feature name like "nvim-0.2.1" or
|
||||
"win32", see below. See also |exists()|.
|
||||
|
||||
If the code has a syntax error, then Nvim may skip the rest
|
||||
of the line and miss |:endif|. >
|
||||
if has('feature') | let x = this->breaks->without->the->feature | endif
|
||||
<
|
||||
Put |:if| and |:endif| on separate lines to avoid the
|
||||
syntax error. >
|
||||
if has('feature')
|
||||
let x = this->breaks->without->the->feature
|
||||
endif
|
||||
To get the system name use |vim.loop|.os_uname() in Lua: >
|
||||
:lua print(vim.loop.os_uname().sysname)
|
||||
|
||||
< If the code has a syntax error then Vimscript may skip the
|
||||
rest of the line. Put |:if| and |:endif| on separate lines to
|
||||
avoid the syntax error: >
|
||||
if has('feature')
|
||||
let x = this->breaks->without->the->feature
|
||||
endif
|
||||
<
|
||||
Vim's compile-time feature-names (prefixed with "+") are not
|
||||
recognized because Nvim is always compiled with all possible
|
||||
@ -6829,18 +6829,24 @@ serverstart([{address}]) *serverstart()*
|
||||
|RPC| messages. Clients can send |API| commands to the
|
||||
returned address to control Nvim.
|
||||
|
||||
Returns the address string (may differ from the requested
|
||||
{address}).
|
||||
|
||||
- If {address} contains a colon ":" it is interpreted as
|
||||
a TCP/IPv4/IPv6 address where the last ":" separates host
|
||||
and port (empty or zero assigns a random port).
|
||||
- Else it is interpreted as a named pipe or Unix domain socket
|
||||
path. If there are no slashes it is treated as a name and
|
||||
appended to a generated path.
|
||||
- If {address} is empty it generates a path.
|
||||
Returns the address string (which may differ from the
|
||||
{address} argument, see below).
|
||||
|
||||
Example named pipe: >
|
||||
- If {address} has a colon (":") it is a TCP/IPv4/IPv6 address
|
||||
where the last ":" separates host and port (empty or zero
|
||||
assigns a random port).
|
||||
- Else {address} is the path to a named pipe (except on Windows).
|
||||
- If {address} has no slashes ("/") it is treated as the
|
||||
"name" part of a generated path in this format: >
|
||||
stdpath("run").."/{name}.{pid}.{counter}"
|
||||
< - If {address} is omitted the name is "nvim". >
|
||||
:echo serverstart()
|
||||
=> /tmp/nvim.bram/oknANW/nvim.15430.5
|
||||
|
||||
< Example bash command to list all Nvim servers: >
|
||||
ls ${XDG_RUNTIME_DIR:-${TMPDIR}nvim.${USER}}/*/nvim.*.0
|
||||
|
||||
< Example named pipe: >
|
||||
if has('win32')
|
||||
echo serverstart('\\.\pipe\nvim-pipe-1234')
|
||||
else
|
||||
@ -7718,7 +7724,7 @@ sqrt({expr}) *sqrt()*
|
||||
:echo sqrt(100)
|
||||
< 10.0 >
|
||||
:echo sqrt(-4.01)
|
||||
< str2float('nan')
|
||||
< str2float("nan")
|
||||
NaN may be different, it depends on system libraries.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
@ -7779,7 +7785,7 @@ stdpath({what}) *stdpath()* *E6100*
|
||||
run String Run directory: temporary, local storage
|
||||
for sockets, named pipes, etc.
|
||||
state String Session state directory: storage for file
|
||||
drafts, undo, |shada|, etc.
|
||||
drafts, swap, undo, |shada|.
|
||||
|
||||
Example: >
|
||||
:echo stdpath("config")
|
||||
|
@ -48,21 +48,22 @@ a job channel using RPC, bytes can still be read over its stderr. Similarly,
|
||||
only bytes can be written to Nvim's own stderr.
|
||||
|
||||
*channel-callback*
|
||||
on_stdout({chan-id}, {data}, {name}) *on_stdout*
|
||||
on_stderr({chan-id}, {data}, {name}) *on_stderr*
|
||||
on_stdin({chan-id}, {data}, {name}) *on_stdin*
|
||||
on_data({chan-id}, {data}, {name}) *on_data*
|
||||
- on_stdout({chan-id}, {data}, {name}) *on_stdout*
|
||||
- on_stderr({chan-id}, {data}, {name}) *on_stderr*
|
||||
- on_stdin({chan-id}, {data}, {name}) *on_stdin*
|
||||
- on_data({chan-id}, {data}, {name}) *on_data*
|
||||
|
||||
Scripts can react to channel activity (received data) via callback
|
||||
functions assigned to the `on_stdout`, `on_stderr`, `on_stdin`, or
|
||||
`on_data` option keys. Callbacks should be fast: avoid potentially
|
||||
slow/expensive work.
|
||||
|
||||
Parameters: ~
|
||||
{chan-id} Channel handle. |channel-id|
|
||||
{data} Raw data (|readfile()|-style list of strings) read from
|
||||
- {chan-id} Channel handle. |channel-id|
|
||||
- {data} Raw data (|readfile()|-style list of strings) read from
|
||||
the channel. EOF is a single-item list: `['']`. First and
|
||||
last items may be partial lines! |channel-lines|
|
||||
{name} Stream name (string) like "stdout", so the same function
|
||||
- {name} Stream name (string) like "stdout", so the same function
|
||||
can handle multiple streams. Event names depend on how the
|
||||
channel was opened and in what mode/protocol.
|
||||
|
||||
@ -83,13 +84,14 @@ on_data({chan-id}, {data}, {name}) *on_data*
|
||||
the final `['']` emitted at EOF):
|
||||
- `foobar` may arrive as `['fo'], ['obar']`
|
||||
- `foo\nbar` may arrive as
|
||||
`['foo','bar']`
|
||||
or `['foo',''], ['bar']`
|
||||
or `['foo'], ['','bar']`
|
||||
or `['fo'], ['o','bar']`
|
||||
- `['foo','bar']`
|
||||
- or `['foo',''], ['bar']`
|
||||
- or `['foo'], ['','bar']`
|
||||
- or `['fo'], ['o','bar']`
|
||||
|
||||
There are two ways to deal with this:
|
||||
1. To wait for the entire output, use |channel-buffered| mode.
|
||||
2. To read line-by-line, use the following code: >
|
||||
- 1. To wait for the entire output, use |channel-buffered| mode.
|
||||
- 2. To read line-by-line, use the following code: >
|
||||
let s:lines = ['']
|
||||
func! s:on_event(job_id, data, event) dict
|
||||
let eof = (a:data == [''])
|
||||
|
@ -10,155 +10,147 @@ The items listed below are deprecated: they will be removed in the future.
|
||||
They should not be used in new scripts, and old scripts should be updated.
|
||||
|
||||
==============================================================================
|
||||
Deprecated features
|
||||
|
||||
API ~
|
||||
*nvim_buf_clear_highlight()* Use |nvim_buf_clear_namespace()| instead.
|
||||
*nvim_buf_set_virtual_text()* Use |nvim_buf_set_extmark()| instead.
|
||||
*nvim_command_output()* Use |nvim_exec()| instead.
|
||||
*nvim_execute_lua()* Use |nvim_exec_lua()| instead.
|
||||
API
|
||||
- *nvim_buf_clear_highlight()* Use |nvim_buf_clear_namespace()| instead.
|
||||
- *nvim_buf_set_virtual_text()* Use |nvim_buf_set_extmark()| instead.
|
||||
- *nvim_command_output()* Use |nvim_exec()| instead.
|
||||
- *nvim_execute_lua()* Use |nvim_exec_lua()| instead.
|
||||
|
||||
Commands ~
|
||||
*:rv*
|
||||
*:rviminfo* Deprecated alias to |:rshada| command.
|
||||
*:wv*
|
||||
*:wviminfo* Deprecated alias to |:wshada| command.
|
||||
COMMANDS
|
||||
- *:rv* *:rviminfo* Deprecated alias to |:rshada| command.
|
||||
- *:wv* *:wviminfo* Deprecated alias to |:wshada| command.
|
||||
|
||||
Environment Variables ~
|
||||
*$NVIM_LISTEN_ADDRESS* Deprecated way to
|
||||
* set the server name (use |--listen| instead)
|
||||
* get the server name (use |v:servername| instead)
|
||||
* detect a parent Nvim (use |$NVIM| instead)
|
||||
Unset by |terminal| and |jobstart()| (unless explicitly
|
||||
given by the "env" option). Ignored if --listen is given.
|
||||
ENVIRONMENT VARIABLES
|
||||
- *$NVIM_LISTEN_ADDRESS*
|
||||
- Deprecated way to:
|
||||
- set the server name (use |--listen| or |serverstart()| instead)
|
||||
- get the server name (use |v:servername| instead)
|
||||
- detect a parent Nvim (use |$NVIM| instead)
|
||||
- Ignored if --listen is given.
|
||||
- Unset by |terminal| and |jobstart()| unless explicitly given by the "env"
|
||||
option. Example: >
|
||||
call jobstart(['foo'], { 'env': { 'NVIM_LISTEN_ADDRESS': v:servername } })
|
||||
<
|
||||
|
||||
Events ~
|
||||
*BufCreate* Use |BufAdd| instead.
|
||||
*EncodingChanged* Never fired; 'encoding' is always "utf-8".
|
||||
*FileEncoding* Never fired; equivalent to |EncodingChanged|.
|
||||
*GUIEnter* Never fired; use |UIEnter| instead.
|
||||
*GUIFailed* Never fired.
|
||||
EVENTS
|
||||
- *BufCreate* Use |BufAdd| instead.
|
||||
- *EncodingChanged* Never fired; 'encoding' is always "utf-8".
|
||||
- *FileEncoding* Never fired; equivalent to |EncodingChanged|.
|
||||
- *GUIEnter* Never fired; use |UIEnter| instead.
|
||||
- *GUIFailed* Never fired.
|
||||
|
||||
Keycodes ~
|
||||
*<MouseDown>* Use <ScrollWheelUp> instead.
|
||||
*<MouseUp>* Use <ScrollWheelDown> instead.
|
||||
KEYCODES
|
||||
- *<MouseDown>* Use <ScrollWheelUp> instead.
|
||||
- *<MouseUp>* Use <ScrollWheelDown> instead.
|
||||
|
||||
Functions ~
|
||||
*buffer_exists()* Obsolete name for |bufexists()|.
|
||||
*buffer_name()* Obsolete name for |bufname()|.
|
||||
*buffer_number()* Obsolete name for |bufnr()|.
|
||||
*file_readable()* Obsolete name for |filereadable()|.
|
||||
*health#report_error* Use Lua |vim.health.report_error()| instead.
|
||||
*health#report_info* Use Lua |vim.health.report_info()| instead.
|
||||
*health#report_ok* Use Lua |vim.health.report_ok()| instead.
|
||||
*health#report_start* Use Lua |vim.health.report_start()| instead.
|
||||
*health#report_warn* Use Lua |vim.health.report_warn()| instead.
|
||||
*highlight_exists()* Obsolete name for |hlexists()|.
|
||||
*highlightID()* Obsolete name for |hlID()|.
|
||||
*inputdialog()* Use |input()| instead.
|
||||
*jobclose()* Obsolete name for |chanclose()|
|
||||
*jobsend()* Obsolete name for |chansend()|
|
||||
*last_buffer_nr()* Obsolete name for bufnr("$").
|
||||
*rpcstop()* Deprecated. Instead use |jobstop()| to stop any job,
|
||||
or chanclose(id, "rpc") to close RPC communication
|
||||
FUNCTIONS
|
||||
- *buffer_exists()* Obsolete name for |bufexists()|.
|
||||
- *buffer_name()* Obsolete name for |bufname()|.
|
||||
- *buffer_number()* Obsolete name for |bufnr()|.
|
||||
- *file_readable()* Obsolete name for |filereadable()|.
|
||||
- *health#report_error* Use Lua |vim.health.report_error()| instead.
|
||||
- *health#report_info* Use Lua |vim.health.report_info()| instead.
|
||||
- *health#report_ok* Use Lua |vim.health.report_ok()| instead.
|
||||
- *health#report_start* Use Lua |vim.health.report_start()| instead.
|
||||
- *health#report_warn* Use Lua |vim.health.report_warn()| instead.
|
||||
- *highlight_exists()* Obsolete name for |hlexists()|.
|
||||
- *highlightID()* Obsolete name for |hlID()|.
|
||||
- *inputdialog()* Use |input()| instead.
|
||||
- *jobclose()* Obsolete name for |chanclose()|
|
||||
- *jobsend()* Obsolete name for |chansend()|
|
||||
- *last_buffer_nr()* Obsolete name for bufnr("$").
|
||||
- *rpcstop()* Use |jobstop()| instead to stop any job, or
|
||||
`chanclose(id, "rpc")` to close RPC communication
|
||||
without stopping the job. Use chanclose(id) to close
|
||||
any socket.
|
||||
|
||||
Highlights ~
|
||||
|
||||
*hl-VertSplit* Use |hl-WinSeparator| instead.
|
||||
|
||||
LSP Diagnostics ~
|
||||
HIGHLIGHTS
|
||||
- *hl-VertSplit* Use |hl-WinSeparator| instead.
|
||||
|
||||
LSP DIAGNOSTICS
|
||||
For each of the functions below, use the corresponding function in
|
||||
|vim.diagnostic| instead (unless otherwise noted). For example, use
|
||||
|vim.diagnostic.get()| instead of |vim.lsp.diagnostic.get()|.
|
||||
|
||||
*vim.lsp.diagnostic.clear()* Use |vim.diagnostic.hide()| instead.
|
||||
*vim.lsp.diagnostic.disable()*
|
||||
*vim.lsp.diagnostic.display()* Use |vim.diagnostic.show()| instead.
|
||||
*vim.lsp.diagnostic.enable()*
|
||||
*vim.lsp.diagnostic.get()*
|
||||
*vim.lsp.diagnostic.get_all()* Use |vim.diagnostic.get()| instead.
|
||||
*vim.lsp.diagnostic.get_count()* Use |vim.diagnostic.get()| instead.
|
||||
*vim.lsp.diagnostic.get_line_diagnostics()*
|
||||
Use |vim.diagnostic.get()| instead.
|
||||
*vim.lsp.diagnostic.get_next()*
|
||||
*vim.lsp.diagnostic.get_next_pos()*
|
||||
*vim.lsp.diagnostic.get_prev()*
|
||||
*vim.lsp.diagnostic.get_prev_pos()*
|
||||
*vim.lsp.diagnostic.get_virtual_text_chunks_for_line()*
|
||||
No replacement. Use options provided by
|
||||
|vim.diagnostic.config()| to customize
|
||||
virtual text.
|
||||
*vim.lsp.diagnostic.goto_next()*
|
||||
*vim.lsp.diagnostic.goto_prev()*
|
||||
*vim.lsp.diagnostic.redraw()* Use |vim.diagnostic.show()| instead.
|
||||
*vim.lsp.diagnostic.reset()*
|
||||
*vim.lsp.diagnostic.save()* Use |vim.diagnostic.set()| instead.
|
||||
*vim.lsp.diagnostic.set_loclist()* Use |vim.diagnostic.setloclist()| instead.
|
||||
*vim.lsp.diagnostic.set_qflist()* Use |vim.diagnostic.setqflist()| instead.
|
||||
|
||||
The following have been replaced by |vim.diagnostic.open_float()|.
|
||||
|
||||
*vim.lsp.diagnostic.show_line_diagnostics()*
|
||||
*vim.lsp.diagnostic.show_position_diagnostics()*
|
||||
- *vim.lsp.diagnostic.clear()* Use |vim.diagnostic.hide()| instead.
|
||||
- *vim.lsp.diagnostic.disable()*
|
||||
- *vim.lsp.diagnostic.display()* Use |vim.diagnostic.show()| instead.
|
||||
- *vim.lsp.diagnostic.enable()*
|
||||
- *vim.lsp.diagnostic.get()*
|
||||
- *vim.lsp.diagnostic.get_all()* Use |vim.diagnostic.get()| instead.
|
||||
- *vim.lsp.diagnostic.get_count()* Use |vim.diagnostic.get()| instead.
|
||||
- *vim.lsp.diagnostic.get_line_diagnostics()* Use |vim.diagnostic.get()| instead.
|
||||
- *vim.lsp.diagnostic.get_next()*
|
||||
- *vim.lsp.diagnostic.get_next_pos()*
|
||||
- *vim.lsp.diagnostic.get_prev()*
|
||||
- *vim.lsp.diagnostic.get_prev_pos()*
|
||||
- *vim.lsp.diagnostic.get_virtual_text_chunks_for_line()* No replacement. Use
|
||||
options provided by |vim.diagnostic.config()| to customize virtual text.
|
||||
- *vim.lsp.diagnostic.goto_next()*
|
||||
- *vim.lsp.diagnostic.goto_prev()*
|
||||
- *vim.lsp.diagnostic.redraw()* Use |vim.diagnostic.show()| instead.
|
||||
- *vim.lsp.diagnostic.reset()*
|
||||
- *vim.lsp.diagnostic.save()* Use |vim.diagnostic.set()| instead.
|
||||
- *vim.lsp.diagnostic.set_loclist()* Use |vim.diagnostic.setloclist()| instead.
|
||||
- *vim.lsp.diagnostic.set_qflist()* Use |vim.diagnostic.setqflist()| instead.
|
||||
- *vim.lsp.diagnostic.show_line_diagnostics()* Use |vim.diagnostic.open_float()| instead.
|
||||
- *vim.lsp.diagnostic.show_position_diagnostics()* Use |vim.diagnostic.open_float()| instead.
|
||||
|
||||
The following are deprecated without replacement. These functions are moved
|
||||
internally and are no longer exposed as part of the API. Instead, use
|
||||
|vim.diagnostic.config()| and |vim.diagnostic.show()|.
|
||||
|
||||
*vim.lsp.diagnostic.set_signs()*
|
||||
*vim.lsp.diagnostic.set_underline()*
|
||||
*vim.lsp.diagnostic.set_virtual_text()*
|
||||
- *vim.lsp.diagnostic.set_signs()*
|
||||
- *vim.lsp.diagnostic.set_underline()*
|
||||
- *vim.lsp.diagnostic.set_virtual_text()*
|
||||
|
||||
LSP Functions ~
|
||||
|
||||
*vim.lsp.util.diagnostics_to_items()* Use |vim.diagnostic.toqflist()| instead.
|
||||
*vim.lsp.util.set_qflist()* Use |setqflist()| instead.
|
||||
*vim.lsp.util.set_loclist()* Use |setloclist()| instead.
|
||||
*vim.lsp.buf_get_clients()* Use |vim.lsp.get_active_clients()| with
|
||||
LSP FUNCTIONS
|
||||
- *vim.lsp.util.diagnostics_to_items()* Use |vim.diagnostic.toqflist()| instead.
|
||||
- *vim.lsp.util.set_qflist()* Use |setqflist()| instead.
|
||||
- *vim.lsp.util.set_loclist()* Use |setloclist()| instead.
|
||||
- *vim.lsp.buf_get_clients()* Use |vim.lsp.get_active_clients()| with
|
||||
{buffer = bufnr} instead.
|
||||
- vim.lsp.buf.formatting() Use |vim.lsp.buf.format()| with
|
||||
{async = true} instead.
|
||||
- vim.lsp.buf.range_formatting() Use |vim.lsp.formatexpr()|
|
||||
or |vim.lsp.buf.format()| instead.
|
||||
|
||||
Lua ~
|
||||
*vim.register_keystroke_callback()* Use |vim.on_key()| instead.
|
||||
LUA
|
||||
- *vim.register_keystroke_callback()* Use |vim.on_key()| instead.
|
||||
|
||||
Modifiers ~
|
||||
*cpo-<*
|
||||
*:menu-<special>*
|
||||
*:menu-special* <> notation is always enabled.
|
||||
*:map-<special>*
|
||||
*:map-special* <> notation is always enabled.
|
||||
NORMAL COMMANDS
|
||||
- *]f* *[f* Same as "gf".
|
||||
|
||||
Normal commands ~
|
||||
*]f*
|
||||
*[f* Same as "gf".
|
||||
|
||||
Options ~
|
||||
*'cscopeverbose'* Enabled by default. Use |:silent| instead.
|
||||
*'exrc'* *'ex'* Security risk: downloaded files could include
|
||||
OPTIONS
|
||||
- *cpo-<* *:menu-<special>* *:menu-special* *:map-<special>* *:map-special*
|
||||
`<>` notation is always enabled.
|
||||
- *'cscopeverbose'* Enabled by default. Use |:silent| instead.
|
||||
- *'exrc'* *'ex'* Security risk: downloaded files could include
|
||||
a malicious .nvimrc or .exrc file. See 'secure'.
|
||||
Recommended alternative: define an autocommand in your
|
||||
|vimrc| to set options for a matching directory.
|
||||
'gd'
|
||||
'gdefault' Enables the |:substitute| flag 'g' by default.
|
||||
*'fe'* 'fenc'+'enc' before Vim 6.0; no longer used.
|
||||
*'highlight'* *'hl'* Names of builtin |highlight-groups| cannot be changed.
|
||||
*'langnoremap'* Deprecated alias to 'nolangremap'.
|
||||
'sessionoptions' Flags "unix", "slash" are ignored and always enabled.
|
||||
*'vi'*
|
||||
'viewoptions' Flags "unix", "slash" are ignored and always enabled.
|
||||
*'viminfo'* Deprecated alias to 'shada' option.
|
||||
*'viminfofile'* Deprecated alias to 'shadafile' option.
|
||||
- 'gdefault' Enables the |:substitute| flag 'g' by default.
|
||||
- *'fe'* 'fenc'+'enc' before Vim 6.0; no longer used.
|
||||
- *'highlight'* *'hl'* Names of builtin |highlight-groups| cannot be changed.
|
||||
- *'langnoremap'* Deprecated alias to 'nolangremap'.
|
||||
- 'sessionoptions' Flags "unix", "slash" are ignored and always enabled.
|
||||
- *'vi'*
|
||||
- 'viewoptions' Flags "unix", "slash" are ignored and always enabled.
|
||||
- *'viminfo'* Deprecated alias to 'shada' option.
|
||||
- *'viminfofile'* Deprecated alias to 'shadafile' option.
|
||||
|
||||
UI extensions~
|
||||
*ui-wildmenu* Use |ui-cmdline| with |ui-popupmenu| instead. Enabled
|
||||
UI EXTENSIONS
|
||||
- *ui-wildmenu* Use |ui-cmdline| with |ui-popupmenu| instead. Enabled
|
||||
by the `ext_wildmenu` |ui-option|. Emits these events:
|
||||
["wildmenu_show", items]
|
||||
["wildmenu_select", selected]
|
||||
["wildmenu_hide"]
|
||||
- `["wildmenu_show", items]`
|
||||
- `["wildmenu_select", selected]`
|
||||
- `["wildmenu_hide"]`
|
||||
|
||||
Variables~
|
||||
*b:terminal_job_pid* PID of the top-level process in a |:terminal|.
|
||||
VARIABLES
|
||||
- *b:terminal_job_pid* PID of the top-level process in a |:terminal|.
|
||||
Use `jobpid(&channel)` instead.
|
||||
|
||||
|
||||
vim:noet:tw=78:ts=8:ft=help:norl:
|
||||
|
@ -8,7 +8,7 @@ Nvim style guide *dev-style*
|
||||
|
||||
This is style guide for developers working on Nvim's source code.
|
||||
|
||||
License: CC-By 3.0 http://creativecommons.org/licenses/by/3.0/
|
||||
License: CC-By 3.0 https://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
Type |gO| to see the table of contents.
|
||||
|
||||
|
@ -131,6 +131,7 @@ DOCUMENTATION *dev-doc*
|
||||
(docstrings, user manual, website materials, newsletters, …). Don't mince
|
||||
words. Personality and flavor, used sparingly, are welcome--but in general,
|
||||
optimize for the reader's time and energy: be "precise yet concise".
|
||||
- See https://developers.google.com/style/tone
|
||||
- Prefer the active voice: "Foo does X", not "X is done by Foo".
|
||||
- Vim differences:
|
||||
- Do not prefix help tags with "nvim-". Use |vim_diff.txt| to catalog
|
||||
@ -144,11 +145,11 @@ DOCUMENTATION *dev-doc*
|
||||
- Use "tui-" to prefix help tags related to the host terminal, and "TUI"
|
||||
in prose if possible.
|
||||
- Docstrings: do not start parameter descriptions with "The" or "A" unless it
|
||||
is critical to avoid ambiguity.
|
||||
GOOD: >
|
||||
/// @param dirname Path fragment before `pend`
|
||||
< BAD: >
|
||||
/// @param dirname The path fragment before `pend`
|
||||
is critical to avoid ambiguity. >
|
||||
GOOD:
|
||||
/// @param dirname Path fragment before `pend`
|
||||
BAD:
|
||||
/// @param dirname The path fragment before `pend`
|
||||
<
|
||||
|
||||
Documentation format ~
|
||||
@ -163,6 +164,9 @@ Strict "vimdoc" subset:
|
||||
that you don't want auto-wrapped. Lists are always rendered with "flow"
|
||||
(soft-wrapped) layout instead of preformatted (hard-wrapped) layout common
|
||||
in legacy :help docs.
|
||||
- Limitation: currently the parser https://github.com/neovim/tree-sitter-vimdoc
|
||||
does not understand numbered listitems, so use a bullet symbol (- or •)
|
||||
before numbered items, e.g. "- 1." instead of "1.".
|
||||
- Separate blocks (paragraphs) of content by a blank line(s).
|
||||
- Do not use indentation in random places—that prevents the page from using
|
||||
"flow" layout. If you need a preformatted section, put it in
|
||||
@ -180,7 +184,7 @@ Docstring format:
|
||||
`@note`, `@param`, `@returns`
|
||||
- Limited markdown is supported.
|
||||
- List-items start with `-` (useful to nest or "indent")
|
||||
- Use `<pre>` for code samples.
|
||||
- Use `<pre>` for code samples.
|
||||
|
||||
Example: the help for |nvim_open_win()| is generated from a docstring defined
|
||||
in src/nvim/api/win_config.c like this: >
|
||||
@ -218,7 +222,7 @@ Docstring format:
|
||||
`---@see`, `---@param`, `---@returns`
|
||||
- Limited markdown is supported.
|
||||
- List-items start with `-` (useful to nest or "indent")
|
||||
- Use `<pre>` for code samples.
|
||||
- Use `<pre>` for code samples.
|
||||
|
||||
Example: the help for |vim.paste()| is generated from a docstring decorating
|
||||
vim.paste in runtime/lua/vim/_editor.lua like this: >
|
||||
@ -251,7 +255,8 @@ LUA *dev-lua*
|
||||
|
||||
API *dev-api*
|
||||
|
||||
Use this template to name new RPC |API| functions:
|
||||
Use this format to name new RPC |API| functions:
|
||||
|
||||
nvim_{thing}_{action}_{arbitrary-qualifiers}
|
||||
|
||||
If the function acts on an object then {thing} is the name of that object
|
||||
@ -260,37 +265,50 @@ If the function acts on an object then {thing} is the name of that object
|
||||
with a {thing} that groups functions under a common concept).
|
||||
|
||||
Use existing common {action} names if possible:
|
||||
add Append to, or insert into, a collection
|
||||
create Create a new thing
|
||||
del Delete a thing (or group of things)
|
||||
exec Execute code
|
||||
get Get a thing (or group of things by query)
|
||||
list Get all things
|
||||
set Set a thing (or group of things)
|
||||
- add Append to, or insert into, a collection
|
||||
- call Call a function
|
||||
- create Create a new (non-trivial) thing
|
||||
- del Delete a thing (or group of things)
|
||||
- eval Evaluate an expression
|
||||
- exec Execute code
|
||||
- fmt Format
|
||||
- get Get things (often by a query)
|
||||
- open Open
|
||||
- parse Parse something into a structured form
|
||||
- set Set a thing (or group of things)
|
||||
|
||||
Use existing common {thing} names if possible:
|
||||
buf Buffer
|
||||
pos Position
|
||||
tab Tabpage
|
||||
win Window
|
||||
Do NOT use these deprecated verbs:
|
||||
- list Redundant with "get"
|
||||
|
||||
Use consistent names for {thing} in all API functions. E.g. a buffer is called
|
||||
Use consistent names for {thing} (nouns) in API functions: buffer is called
|
||||
"buf" everywhere, not "buffer" in some places and "buf" in others.
|
||||
- buf Buffer
|
||||
- chan |channel|
|
||||
- cmd Command
|
||||
- cmdline Command-line UI or input
|
||||
- fn Function
|
||||
- hl Highlight
|
||||
- pos Position
|
||||
- proc System process
|
||||
- tabpage Tabpage
|
||||
- win Window
|
||||
|
||||
Do NOT use these deprecated nouns:
|
||||
- buffer
|
||||
- command
|
||||
- window
|
||||
|
||||
Example:
|
||||
`nvim_get_current_line` acts on the global editor state; the common
|
||||
{action} "get" is used but {thing} is omitted.
|
||||
`nvim_get_keymap('v')` operates in a global context (first parameter is not
|
||||
a Buffer). The "get" {action} indicates that it gets anything matching the
|
||||
given filter parameter. There is no need for a "list" action because
|
||||
`nvim_get_keymap('')` (i.e., empty filter) returns all items.
|
||||
|
||||
Example:
|
||||
`nvim_buf_add_highlight` acts on a `Buffer` object (the first parameter)
|
||||
and uses the common {action} "add".
|
||||
`nvim_buf_del_mark` acts on a `Buffer` object (the first parameter)
|
||||
and uses the "del" {action}.
|
||||
|
||||
Example:
|
||||
`nvim_list_bufs` operates in a global context (first parameter is not
|
||||
a Buffer). The common {action} "list" indicates that it lists all bufs
|
||||
(plural) in the global context.
|
||||
|
||||
Use this template to name new API events:
|
||||
Use this format to name new API events:
|
||||
nvim_{thing}_{event}_event
|
||||
|
||||
Example:
|
||||
@ -332,10 +350,10 @@ a good name: it's idiomatic and unambiguous. If the package is named "neovim",
|
||||
it confuses users, and complicates documentation and discussions.
|
||||
|
||||
Examples of API-client package names:
|
||||
GOOD: nvim-racket
|
||||
GOOD: pynvim
|
||||
BAD: python-client
|
||||
BAD: neovim
|
||||
- GOOD: nvim-racket
|
||||
- GOOD: pynvim
|
||||
- BAD: python-client
|
||||
- BAD: neovim
|
||||
|
||||
API client implementation guidelines ~
|
||||
|
||||
@ -401,4 +419,4 @@ Use the "on_" prefix to name event handlers and also the interface for
|
||||
a confused collection of naming conventions for these related concepts.
|
||||
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
vim:tw=78:ts=8:sw=4:et:ft=help:norl:
|
||||
|
@ -342,7 +342,7 @@ config({opts}, {namespace}) *vim.diagnostic.config()*
|
||||
any of the above.
|
||||
|
||||
Parameters: ~
|
||||
{opts} (table|nil) When omitted or "nil", retrieve the current
|
||||
• {opts} (table|nil) When omitted or "nil", retrieve the current
|
||||
configuration. Otherwise, a configuration table with the
|
||||
following keys:
|
||||
• underline: (default true) Use underline for
|
||||
@ -397,32 +397,32 @@ config({opts}, {namespace}) *vim.diagnostic.config()*
|
||||
severities are displayed before lower severities (e.g.
|
||||
ERROR is displayed before WARN). Options:
|
||||
• reverse: (boolean) Reverse sort order
|
||||
{namespace} (number|nil) Update the options for the given namespace.
|
||||
• {namespace} (number|nil) Update the options for the given namespace.
|
||||
When omitted, update the global diagnostic options.
|
||||
|
||||
disable({bufnr}, {namespace}) *vim.diagnostic.disable()*
|
||||
Disable diagnostics in the given buffer.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number|nil) Buffer number, or 0 for current buffer. When
|
||||
• {bufnr} (number|nil) Buffer number, or 0 for current buffer. When
|
||||
omitted, disable diagnostics in all buffers.
|
||||
{namespace} (number|nil) Only disable diagnostics for the given
|
||||
• {namespace} (number|nil) Only disable diagnostics for the given
|
||||
namespace.
|
||||
|
||||
enable({bufnr}, {namespace}) *vim.diagnostic.enable()*
|
||||
Enable diagnostics in the given buffer.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number|nil) Buffer number, or 0 for current buffer. When
|
||||
• {bufnr} (number|nil) Buffer number, or 0 for current buffer. When
|
||||
omitted, enable diagnostics in all buffers.
|
||||
{namespace} (number|nil) Only enable diagnostics for the given
|
||||
• {namespace} (number|nil) Only enable diagnostics for the given
|
||||
namespace.
|
||||
|
||||
fromqflist({list}) *vim.diagnostic.fromqflist()*
|
||||
Convert a list of quickfix items to a list of diagnostics.
|
||||
|
||||
Parameters: ~
|
||||
{list} (table) A list of quickfix items from |getqflist()| or
|
||||
• {list} (table) A list of quickfix items from |getqflist()| or
|
||||
|getloclist()|.
|
||||
|
||||
Return: ~
|
||||
@ -432,9 +432,9 @@ get({bufnr}, {opts}) *vim.diagnostic.get()*
|
||||
Get current diagnostics.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number|nil) Buffer number to get diagnostics from. Use 0 for
|
||||
• {bufnr} (number|nil) Buffer number to get diagnostics from. Use 0 for
|
||||
current buffer or nil for all buffers.
|
||||
{opts} (table|nil) A table with the following keys:
|
||||
• {opts} (table|nil) A table with the following keys:
|
||||
• namespace: (number) Limit diagnostics to the given
|
||||
namespace.
|
||||
• lnum: (number) Limit diagnostics to the given line number.
|
||||
@ -447,7 +447,7 @@ get_namespace({namespace}) *vim.diagnostic.get_namespace()*
|
||||
Get namespace metadata.
|
||||
|
||||
Parameters: ~
|
||||
{namespace} (number) Diagnostic namespace
|
||||
• {namespace} (number) Diagnostic namespace
|
||||
|
||||
Return: ~
|
||||
(table) Namespace metadata
|
||||
@ -462,7 +462,7 @@ get_next({opts}) *vim.diagnostic.get_next()*
|
||||
Get the next diagnostic closest to the cursor position.
|
||||
|
||||
Parameters: ~
|
||||
{opts} (table) See |vim.diagnostic.goto_next()|
|
||||
• {opts} (table) See |vim.diagnostic.goto_next()|
|
||||
|
||||
Return: ~
|
||||
(table) Next diagnostic
|
||||
@ -471,7 +471,7 @@ get_next_pos({opts}) *vim.diagnostic.get_next_pos()*
|
||||
Return the position of the next diagnostic in the current buffer.
|
||||
|
||||
Parameters: ~
|
||||
{opts} (table) See |vim.diagnostic.goto_next()|
|
||||
• {opts} (table) See |vim.diagnostic.goto_next()|
|
||||
|
||||
Return: ~
|
||||
(table) Next diagnostic position as a (row, col) tuple.
|
||||
@ -480,7 +480,7 @@ get_prev({opts}) *vim.diagnostic.get_prev()*
|
||||
Get the previous diagnostic closest to the cursor position.
|
||||
|
||||
Parameters: ~
|
||||
{opts} (table) See |vim.diagnostic.goto_next()|
|
||||
• {opts} (table) See |vim.diagnostic.goto_next()|
|
||||
|
||||
Return: ~
|
||||
(table) Previous diagnostic
|
||||
@ -489,7 +489,7 @@ get_prev_pos({opts}) *vim.diagnostic.get_prev_pos()*
|
||||
Return the position of the previous diagnostic in the current buffer.
|
||||
|
||||
Parameters: ~
|
||||
{opts} (table) See |vim.diagnostic.goto_next()|
|
||||
• {opts} (table) See |vim.diagnostic.goto_next()|
|
||||
|
||||
Return: ~
|
||||
(table) Previous diagnostic position as a (row, col) tuple.
|
||||
@ -498,7 +498,7 @@ goto_next({opts}) *vim.diagnostic.goto_next()*
|
||||
Move to the next diagnostic.
|
||||
|
||||
Parameters: ~
|
||||
{opts} (table|nil) Configuration table with the following keys:
|
||||
• {opts} (table|nil) Configuration table with the following keys:
|
||||
• namespace: (number) Only consider diagnostics from the given
|
||||
namespace.
|
||||
• cursor_position: (cursor position) Cursor position as a
|
||||
@ -519,7 +519,7 @@ goto_prev({opts}) *vim.diagnostic.goto_prev()*
|
||||
Move to the previous diagnostic in the current buffer.
|
||||
|
||||
Parameters: ~
|
||||
{opts} (table) See |vim.diagnostic.goto_next()|
|
||||
• {opts} (table) See |vim.diagnostic.goto_next()|
|
||||
|
||||
hide({namespace}, {bufnr}) *vim.diagnostic.hide()*
|
||||
Hide currently displayed diagnostics.
|
||||
@ -532,9 +532,9 @@ hide({namespace}, {bufnr}) *vim.diagnostic.hide()*
|
||||
|vim.diagnostic.disable()|.
|
||||
|
||||
Parameters: ~
|
||||
{namespace} (number|nil) Diagnostic namespace. When omitted, hide
|
||||
• {namespace} (number|nil) Diagnostic namespace. When omitted, hide
|
||||
diagnostics from all namespaces.
|
||||
{bufnr} (number|nil) Buffer number, or 0 for current buffer. When
|
||||
• {bufnr} (number|nil) Buffer number, or 0 for current buffer. When
|
||||
omitted, hide diagnostics in all buffers.
|
||||
|
||||
*vim.diagnostic.match()*
|
||||
@ -555,13 +555,13 @@ match({str}, {pat}, {groups}, {severity_map}, {defaults})
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
{str} (string) String to parse diagnostics from.
|
||||
{pat} (string) Lua pattern with capture groups.
|
||||
{groups} (table) List of fields in a |diagnostic-structure| to
|
||||
• {str} (string) String to parse diagnostics from.
|
||||
• {pat} (string) Lua pattern with capture groups.
|
||||
• {groups} (table) List of fields in a |diagnostic-structure| to
|
||||
associate with captures from {pat}.
|
||||
{severity_map} (table) A table mapping the severity field from
|
||||
• {severity_map} (table) A table mapping the severity field from
|
||||
{groups} with an item from |vim.diagnostic.severity|.
|
||||
{defaults} (table|nil) Table of default values for any fields not
|
||||
• {defaults} (table|nil) Table of default values for any fields not
|
||||
listed in {groups}. When omitted, numeric values
|
||||
default to 0 and "severity" defaults to ERROR.
|
||||
|
||||
@ -573,7 +573,7 @@ open_float({opts}, {...}) *vim.diagnostic.open_float()*
|
||||
Show diagnostics in a floating window.
|
||||
|
||||
Parameters: ~
|
||||
{opts} (table|nil) Configuration table with the same keys as
|
||||
• {opts} (table|nil) Configuration table with the same keys as
|
||||
|vim.lsp.util.open_floating_preview()| in addition to the
|
||||
following:
|
||||
• bufnr: (number) Buffer number to show diagnostics from.
|
||||
@ -631,27 +631,27 @@ reset({namespace}, {bufnr}) *vim.diagnostic.reset()*
|
||||
re-displayed, use |vim.diagnostic.hide()|.
|
||||
|
||||
Parameters: ~
|
||||
{namespace} (number|nil) Diagnostic namespace. When omitted, remove
|
||||
• {namespace} (number|nil) Diagnostic namespace. When omitted, remove
|
||||
diagnostics from all namespaces.
|
||||
{bufnr} (number|nil) Remove diagnostics for the given buffer.
|
||||
• {bufnr} (number|nil) Remove diagnostics for the given buffer.
|
||||
When omitted, diagnostics are removed for all buffers.
|
||||
|
||||
set({namespace}, {bufnr}, {diagnostics}, {opts}) *vim.diagnostic.set()*
|
||||
Set diagnostics for the given namespace and buffer.
|
||||
|
||||
Parameters: ~
|
||||
{namespace} (number) The diagnostic namespace
|
||||
{bufnr} (number) Buffer number
|
||||
{diagnostics} (table) A list of diagnostic items
|
||||
• {namespace} (number) The diagnostic namespace
|
||||
• {bufnr} (number) Buffer number
|
||||
• {diagnostics} (table) A list of diagnostic items
|
||||
|diagnostic-structure|
|
||||
{opts} (table|nil) Display options to pass to
|
||||
• {opts} (table|nil) Display options to pass to
|
||||
|vim.diagnostic.show()|
|
||||
|
||||
setloclist({opts}) *vim.diagnostic.setloclist()*
|
||||
Add buffer diagnostics to the location list.
|
||||
|
||||
Parameters: ~
|
||||
{opts} (table|nil) Configuration table with the following keys:
|
||||
• {opts} (table|nil) Configuration table with the following keys:
|
||||
• namespace: (number) Only add diagnostics from the given
|
||||
namespace.
|
||||
• winnr: (number, default 0) Window number to set location
|
||||
@ -666,7 +666,7 @@ setqflist({opts}) *vim.diagnostic.setqflist()*
|
||||
Add all diagnostics to the quickfix list.
|
||||
|
||||
Parameters: ~
|
||||
{opts} (table|nil) Configuration table with the following keys:
|
||||
• {opts} (table|nil) Configuration table with the following keys:
|
||||
• namespace: (number) Only add diagnostics from the given
|
||||
namespace.
|
||||
• open: (boolean, default true) Open quickfix list after
|
||||
@ -680,17 +680,17 @@ show({namespace}, {bufnr}, {diagnostics}, {opts})
|
||||
Display diagnostics for the given namespace and buffer.
|
||||
|
||||
Parameters: ~
|
||||
{namespace} (number|nil) Diagnostic namespace. When omitted, show
|
||||
• {namespace} (number|nil) Diagnostic namespace. When omitted, show
|
||||
diagnostics from all namespaces.
|
||||
{bufnr} (number|nil) Buffer number, or 0 for current buffer.
|
||||
• {bufnr} (number|nil) Buffer number, or 0 for current buffer.
|
||||
When omitted, show diagnostics in all buffers.
|
||||
{diagnostics} (table|nil) The diagnostics to display. When omitted,
|
||||
• {diagnostics} (table|nil) The diagnostics to display. When omitted,
|
||||
use the saved diagnostics for the given namespace and
|
||||
buffer. This can be used to display a list of
|
||||
diagnostics without saving them or to display only a
|
||||
subset of diagnostics. May not be used when {namespace}
|
||||
or {bufnr} is nil.
|
||||
{opts} (table|nil) Display options. See
|
||||
• {opts} (table|nil) Display options. See
|
||||
|vim.diagnostic.config()|.
|
||||
|
||||
toqflist({diagnostics}) *vim.diagnostic.toqflist()*
|
||||
@ -698,7 +698,7 @@ toqflist({diagnostics}) *vim.diagnostic.toqflist()*
|
||||
passed to |setqflist()| or |setloclist()|.
|
||||
|
||||
Parameters: ~
|
||||
{diagnostics} (table) List of diagnostics |diagnostic-structure|.
|
||||
• {diagnostics} (table) List of diagnostics |diagnostic-structure|.
|
||||
|
||||
Return: ~
|
||||
array of quickfix list items |setqflist-what|
|
||||
|
@ -401,7 +401,7 @@ to see more messages.
|
||||
|
||||
The self-installing Vim for MS-Windows includes a diff program. If you don't
|
||||
have it you might want to download a diff.exe. For example from
|
||||
http://gnuwin32.sourceforge.net/packages/diffutils.htm.
|
||||
https://gnuwin32.sourceforge.net/packages/diffutils.htm.
|
||||
|
||||
|
||||
USING PATCHES *diff-patchexpr*
|
||||
|
@ -2141,9 +2141,11 @@ v:scrollstart String describing the script or function that caused the
|
||||
hit-enter prompt.
|
||||
|
||||
*v:servername* *servername-variable*
|
||||
v:servername Primary listen-address of the current Nvim instance, the first
|
||||
item returned by |serverlist()|. Can be set by |--listen| or
|
||||
|$NVIM_LISTEN_ADDRESS| (deprecated) at startup.
|
||||
v:servername Primary listen-address of Nvim, the first item returned by
|
||||
|serverlist()|. Usually this is the named pipe created by Nvim
|
||||
at |startup| or given by |--listen| (or the deprecated
|
||||
|$NVIM_LISTEN_ADDRESS| env var).
|
||||
|
||||
See also |serverstart()| |serverstop()|.
|
||||
Read-only.
|
||||
|
||||
|
@ -51,7 +51,7 @@ for a complete list.
|
||||
To enable them, assign a value to the option. For example, to turn one on:
|
||||
>
|
||||
> let g:ada_standard_types = 1
|
||||
>
|
||||
|
||||
To disable them use ":unlet". Example:
|
||||
>
|
||||
> unlet g:ada_standard_types
|
||||
@ -486,25 +486,25 @@ You can optionally install the following extra plug-ins. They work well with
|
||||
Ada and enhance the ability of the Ada mode:
|
||||
|
||||
backup.vim
|
||||
http://www.vim.org/scripts/script.php?script_id=1537
|
||||
https://www.vim.org/scripts/script.php?script_id=1537
|
||||
Keeps as many backups as you like so you don't have to.
|
||||
|
||||
rainbow_parenthesis.vim
|
||||
http://www.vim.org/scripts/script.php?script_id=1561
|
||||
https://www.vim.org/scripts/script.php?script_id=1561
|
||||
Very helpful since Ada uses only '(' and ')'.
|
||||
|
||||
nerd_comments.vim
|
||||
http://www.vim.org/scripts/script.php?script_id=1218
|
||||
https://www.vim.org/scripts/script.php?script_id=1218
|
||||
Excellent commenting and uncommenting support for almost any
|
||||
programming language.
|
||||
|
||||
matchit.vim
|
||||
http://www.vim.org/scripts/script.php?script_id=39
|
||||
https://www.vim.org/scripts/script.php?script_id=39
|
||||
'%' jumping for any language. The normal '%' jump only works for '{}'
|
||||
style languages. The Ada mode will set the needed search patterns.
|
||||
|
||||
taglist.vim
|
||||
http://www.vim.org/scripts/script.php?script_id=273
|
||||
https://www.vim.org/scripts/script.php?script_id=273
|
||||
Source code explorer sidebar. There is a patch for Ada available.
|
||||
|
||||
The GNU Ada Project distribution (http://gnuada.sourceforge.net) of Vim
|
||||
|
@ -39,7 +39,7 @@ navigation.
|
||||
|
||||
1.1 Matchit *sql-matchit*
|
||||
-----------
|
||||
The matchit plugin (http://www.vim.org/scripts/script.php?script_id=39)
|
||||
The matchit plugin (https://www.vim.org/scripts/script.php?script_id=39)
|
||||
provides many additional features and can be customized for different
|
||||
languages. The matchit plugin is configured by defining a local
|
||||
buffer variable, b:match_words. Pressing the % key while on various
|
||||
@ -296,7 +296,7 @@ exist.
|
||||
3. Adding new SQL Dialects *sql-adding-dialects*
|
||||
|
||||
If you begin working with a SQL dialect which does not have any customizations
|
||||
available with the default Vim distribution you can check http://www.vim.org
|
||||
available with the default Vim distribution you can check https://www.vim.org
|
||||
to see if any customization currently exist. If not, you can begin by cloning
|
||||
an existing script. Read |filetype-plugins| for more details.
|
||||
|
||||
@ -403,7 +403,7 @@ Here are some examples of the entries which are pulled from the syntax files: >
|
||||
----------------
|
||||
Dynamic mode populates the popups with data directly from a database. In
|
||||
order for the dynamic feature to be enabled you must have the dbext.vim
|
||||
plugin installed, (http://vim.sourceforge.net/script.php?script_id=356).
|
||||
plugin installed, (https://vim.sourceforge.net/script.php?script_id=356).
|
||||
|
||||
Dynamic mode is used by several features of the SQL completion plugin.
|
||||
After installing the dbext plugin see the dbext-tutorial for additional
|
||||
@ -487,7 +487,7 @@ depending on the syntax file you are using. The SQL Anywhere syntax file
|
||||
Dynamic features
|
||||
----------------
|
||||
To take advantage of the dynamic features you must first install the
|
||||
dbext.vim plugin (http://vim.sourceforge.net/script.php?script_id=356). It
|
||||
dbext.vim plugin (https://vim.sourceforge.net/script.php?script_id=356). It
|
||||
also comes with a tutorial. From the SQL completion plugin's perspective,
|
||||
the main feature dbext provides is a connection to a database. dbext
|
||||
connection profiles are the most efficient mechanism to define connection
|
||||
|
@ -251,7 +251,7 @@ At this moment translations are available for:
|
||||
Japanese - multiple authors
|
||||
Polish - translated by Mikolaj Machowski
|
||||
Russian - translated by Vassily Ragosin
|
||||
See the Vim website to find them: http://www.vim.org/translations.php
|
||||
See the Vim website to find them: https://www.vim.org/translations.php
|
||||
|
||||
A set of translated help files consists of these files:
|
||||
|
||||
|
@ -324,7 +324,7 @@ place your cursor over the function name or C symbol and quickly query cscope
|
||||
for any matches.
|
||||
|
||||
Or you may use the following scheme, inspired by Vim/Cscope tutorial from
|
||||
Cscope Home Page (http://cscope.sourceforge.net/): >
|
||||
Cscope Home Page (https://cscope.sourceforge.net/): >
|
||||
|
||||
nmap <C-_>s :cs find s <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-_>g :cs find g <C-R>=expand("<cword>")<CR><CR>
|
||||
|
@ -7,7 +7,7 @@ The Ruby Interface to Vim *if_ruby* *ruby* *Ruby*
|
||||
|
||||
*E266* *E267* *E268* *E269* *E270* *E271* *E272* *E273*
|
||||
|
||||
The home page for ruby is http://www.ruby-lang.org/. You can find links for
|
||||
The home page for ruby is https://www.ruby-lang.org/. You can find links for
|
||||
downloading Ruby there.
|
||||
|
||||
Type |gO| to see the table of contents.
|
||||
|
@ -724,7 +724,7 @@ Fortran with (possibly multiple) loops ending on a labelled executable
|
||||
statement of almost arbitrary type. Correct indentation requires
|
||||
compiler-quality parsing. Old code with do loops ending on labelled statements
|
||||
of arbitrary type can be indented with elaborate programs such as Tidy
|
||||
(http://www.unb.ca/chem/ajit/f_tidy.htm). Structured do/continue loops are
|
||||
(https://www.unb.ca/chem/ajit/f_tidy.htm). Structured do/continue loops are
|
||||
also left unindented because continue statements are also used for purposes
|
||||
other than ending a do loop. Programs such as Tidy can convert structured
|
||||
do/continue loops to the do/enddo form. Do loops of the do/enddo variety can
|
||||
|
@ -21,6 +21,7 @@ For a list of Vim variables see |vim-variable|.
|
||||
|
||||
tag char action in Insert mode ~
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
|i_CTRL-@| CTRL-@ insert previously inserted text and stop
|
||||
insert
|
||||
|i_CTRL-A| CTRL-A insert previously inserted text
|
||||
@ -184,6 +185,7 @@ note: 1 = cursor movement command; 2 = can be undone/redone
|
||||
|
||||
tag char note action in Normal mode ~
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
CTRL-@ not used
|
||||
|CTRL-A| CTRL-A 2 add N to number at/after cursor
|
||||
|CTRL-B| CTRL-B 1 scroll N screens Backwards
|
||||
@ -469,6 +471,7 @@ These can be used after an operator or in Visual mode to select an object.
|
||||
|
||||
tag command action in op-pending and Visual mode ~
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|v_aquote| a" double quoted string
|
||||
|v_a'| a' single quoted string
|
||||
|v_a(| a( same as ab
|
||||
@ -511,6 +514,7 @@ tag command action in op-pending and Visual mode ~
|
||||
|
||||
tag command action in Normal mode ~
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|CTRL-W_CTRL-B| CTRL-W CTRL-B same as "CTRL-W b"
|
||||
|CTRL-W_CTRL-C| CTRL-W CTRL-C same as "CTRL-W c"
|
||||
|CTRL-W_CTRL-D| CTRL-W CTRL-D same as "CTRL-W d"
|
||||
@ -609,6 +613,7 @@ tag command action in Normal mode ~
|
||||
|
||||
tag char note action in Normal mode ~
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|[_CTRL-D| [ CTRL-D jump to first #define found in current and
|
||||
included files matching the word under the
|
||||
cursor, start searching at beginning of
|
||||
@ -699,6 +704,7 @@ tag char note action in Normal mode ~
|
||||
|
||||
tag char note action in Normal mode ~
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
g_CTRL-A g CTRL-A dump a memory profile
|
||||
|g_CTRL-G| g CTRL-G show information about current cursor
|
||||
position
|
||||
@ -802,6 +808,7 @@ g_CTRL-A g CTRL-A dump a memory profile
|
||||
|
||||
tag char note action in Normal mode ~
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|z<CR>| z<CR> redraw, cursor line to top of window,
|
||||
cursor on first non-blank
|
||||
|zN<CR>| z{height}<CR> redraw, make window {height} lines high
|
||||
@ -876,6 +883,7 @@ These can be used after an operator, but before a {motion} has been entered.
|
||||
|
||||
tag char action in Operator-pending mode ~
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
|o_v| v force operator to work charwise
|
||||
|o_V| V force operator to work linewise
|
||||
|o_CTRL-V| CTRL-V force operator to work blockwise
|
||||
@ -888,6 +896,7 @@ here are those that are different.
|
||||
|
||||
tag command note action in Visual mode ~
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|v_CTRL-\_CTRL-N| CTRL-\ CTRL-N stop Visual mode
|
||||
|v_CTRL-\_CTRL-G| CTRL-\ CTRL-G go to Normal mode
|
||||
|v_CTRL-A| CTRL-A 2 add N to number in highlighted text
|
||||
@ -1008,6 +1017,7 @@ file names, tags, commands etc. as appropriate.
|
||||
|
||||
tag command action in Command-line editing mode ~
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
CTRL-@ not used
|
||||
|c_CTRL-A| CTRL-A do completion on the pattern in front of the
|
||||
cursor and insert all matches
|
||||
@ -1110,7 +1120,7 @@ to terminal mode.
|
||||
You found it, Arthur! *holy-grail*
|
||||
|
||||
==============================================================================
|
||||
6. EX commands *ex-cmd-index* *:index*
|
||||
6. EX commands *ex-commands* *ex-cmd-index* *:index*
|
||||
|
||||
This is a brief but complete listing of all the ":" commands, without
|
||||
mentioning any arguments. The optional part of the command name is inside [].
|
||||
@ -1118,6 +1128,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|
||||
tag command action ~
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|:| : nothing
|
||||
|:range| :{range} go to last line in {range}
|
||||
|:!| :! filter lines or execute an external command
|
||||
|
@ -1350,16 +1350,8 @@ Completion of C code requires a tags file. You should use Universal/
|
||||
Exuberant ctags, because it adds extra information that is needed for
|
||||
completion. You can find it here:
|
||||
Universal Ctags: https://ctags.io
|
||||
Exuberant Ctags: http://ctags.sourceforge.net
|
||||
|
||||
Universal Ctags is preferred, Exuberant Ctags is no longer being developed.
|
||||
|
||||
For Exuberant ctags, version 5.6 or later is recommended. For version 5.5.4
|
||||
you should add a patch that adds the "typename:" field:
|
||||
ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
|
||||
A compiled .exe for MS-Windows can be found at:
|
||||
http://ctags.sourceforge.net/
|
||||
https://github.com/universal-ctags/ctags-win32
|
||||
Universal Ctags is preferred, Exuberant Ctags is no longer maintained.
|
||||
|
||||
If you want to complete system functions you can do something like this. Use
|
||||
ctags to generate a tags file for all the system header files: >
|
||||
@ -1459,7 +1451,7 @@ DOM compatibility
|
||||
At the moment (beginning of 2006) there are two main browsers - MS Internet
|
||||
Explorer and Mozilla Firefox. These two applications are covering over 90% of
|
||||
market. Theoretically standards are created by W3C organisation
|
||||
(http://www.w3c.org) but they are not always followed/implemented.
|
||||
(https://www.w3.org/) but they are not always followed/implemented.
|
||||
|
||||
IE FF W3C Omni completion ~
|
||||
+/- +/- + + ~
|
||||
@ -1480,7 +1472,6 @@ external files and for class aware completion. You should use Universal/
|
||||
Exuberant ctags version 5.5.4 or newer. You can find it here:
|
||||
|
||||
Universal Ctags: https://ctags.io
|
||||
Exuberant Ctags: http://ctags.sourceforge.net
|
||||
|
||||
Script completes:
|
||||
|
||||
@ -1779,12 +1770,12 @@ DTD -> Vim *dtd2vim*
|
||||
On |www| is the script |dtd2vim| which parses DTD and creates an XML data file
|
||||
for Vim XML omni completion.
|
||||
|
||||
dtd2vim: http://www.vim.org/scripts/script.php?script_id=1462
|
||||
dtd2vim: https://www.vim.org/scripts/script.php?script_id=1462
|
||||
|
||||
Check the beginning of that file for usage details.
|
||||
The script requires perl and:
|
||||
|
||||
perlSGML: http://savannah.nongnu.org/projects/perlsgml
|
||||
perlSGML: https://savannah.nongnu.org/projects/perlsgml
|
||||
|
||||
|
||||
Commands
|
||||
|
@ -308,7 +308,7 @@ These names for keys are used in the documentation. They can also be used
|
||||
with the ":map" command.
|
||||
|
||||
notation meaning equivalent decimal value(s) ~
|
||||
-----------------------------------------------------------------------
|
||||
----------------------------------------------------------------------- ~
|
||||
<Nul> zero CTRL-@ 0 (stored as 10) *<Nul>*
|
||||
<BS> backspace CTRL-H 8 *backspace*
|
||||
<Tab> tab CTRL-I 9 *tab* *Tab*
|
||||
@ -373,7 +373,7 @@ notation meaning equivalent decimal value(s) ~
|
||||
<M-…> alt-key or meta-key *META* *ALT* *<M-*
|
||||
<A-…> same as <M-…> *<A-*
|
||||
<D-…> command-key or "super" key *<D-*
|
||||
-----------------------------------------------------------------------
|
||||
----------------------------------------------------------------------- ~
|
||||
|
||||
Note:
|
||||
|
||||
@ -530,29 +530,29 @@ Ex :vi -- -- -- -- --
|
||||
|
||||
-- not possible
|
||||
|
||||
*1 Go from Normal mode to Insert mode by giving the command "i", "I", "a",
|
||||
"A", "o", "O", "c", "C", "s" or S".
|
||||
*2 Go from Visual mode to Normal mode by giving a non-movement command, which
|
||||
causes the command to be executed, or by hitting <Esc> "v", "V" or "CTRL-V"
|
||||
(see |v_v|), which just stops Visual mode without side effects.
|
||||
*3 Go from Command-line mode to Normal mode by:
|
||||
- Hitting <CR> or <NL>, which causes the entered command to be executed.
|
||||
- Deleting the complete line (e.g., with CTRL-U) and giving a final <BS>.
|
||||
- Hitting CTRL-C or <Esc>, which quits the command-line without executing
|
||||
the command.
|
||||
In the last case <Esc> may be the character defined with the 'wildchar'
|
||||
option, in which case it will start command-line completion. You can
|
||||
ignore that and type <Esc> again.
|
||||
*4 Go from Normal to Select mode by:
|
||||
- use the mouse to select text while 'selectmode' contains "mouse"
|
||||
- use a non-printable command to move the cursor while keeping the Shift
|
||||
key pressed, and the 'selectmode' option contains "key"
|
||||
- use "v", "V" or "CTRL-V" while 'selectmode' contains "cmd"
|
||||
- use "gh", "gH" or "g CTRL-H" |g_CTRL-H|
|
||||
*5 Go from Select mode to Normal mode by using a non-printable command to move
|
||||
the cursor, without keeping the Shift key pressed.
|
||||
*6 Go from Select mode to Insert mode by typing a printable character. The
|
||||
selection is deleted and the character is inserted.
|
||||
* 1 Go from Normal mode to Insert mode by giving the command "i", "I", "a",
|
||||
"A", "o", "O", "c", "C", "s" or S".
|
||||
* 2 Go from Visual mode to Normal mode by giving a non-movement command, which
|
||||
causes the command to be executed, or by hitting <Esc> "v", "V" or "CTRL-V"
|
||||
(see |v_v|), which just stops Visual mode without side effects.
|
||||
* 3 Go from Command-line mode to Normal mode by:
|
||||
- Hitting <CR> or <NL>, which causes the entered command to be executed.
|
||||
- Deleting the complete line (e.g., with CTRL-U) and giving a final <BS>.
|
||||
- Hitting CTRL-C or <Esc>, which quits the command-line without executing
|
||||
the command.
|
||||
In the last case <Esc> may be the character defined with the 'wildchar'
|
||||
option, in which case it will start command-line completion. You can
|
||||
ignore that and type <Esc> again.
|
||||
* 4 Go from Normal to Select mode by:
|
||||
- use the mouse to select text while 'selectmode' contains "mouse"
|
||||
- use a non-printable command to move the cursor while keeping the Shift
|
||||
key pressed, and the 'selectmode' option contains "key"
|
||||
- use "v", "V" or "CTRL-V" while 'selectmode' contains "cmd"
|
||||
- use "gh", "gH" or "g CTRL-H" |g_CTRL-H|
|
||||
* 5 Go from Select mode to Normal mode by using a non-printable command to move
|
||||
the cursor, without keeping the Shift key pressed.
|
||||
* 6 Go from Select mode to Insert mode by typing a printable character. The
|
||||
selection is deleted and the character is inserted.
|
||||
|
||||
*CTRL-\_CTRL-N* *i_CTRL-\_CTRL-N* *c_CTRL-\_CTRL-N*
|
||||
*v_CTRL-\_CTRL-N* *t_CTRL-\_CTRL-N*
|
||||
|
@ -539,8 +539,8 @@ buf_attach_client({bufnr}, {client_id}) *vim.lsp.buf_attach_client()*
|
||||
Without calling this, the server won't be notified of changes to a buffer.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number) Buffer handle, or 0 for current
|
||||
{client_id} (number) Client id
|
||||
• {bufnr} (number) Buffer handle, or 0 for current
|
||||
• {client_id} (number) Client id
|
||||
|
||||
buf_detach_client({bufnr}, {client_id}) *vim.lsp.buf_detach_client()*
|
||||
Detaches client from the specified buffer. Note: While the server is
|
||||
@ -548,23 +548,23 @@ buf_detach_client({bufnr}, {client_id}) *vim.lsp.buf_detach_client()*
|
||||
send notifications should it ignore this notification.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number) Buffer handle, or 0 for current
|
||||
{client_id} (number) Client id
|
||||
• {bufnr} (number) Buffer handle, or 0 for current
|
||||
• {client_id} (number) Client id
|
||||
|
||||
buf_is_attached({bufnr}, {client_id}) *vim.lsp.buf_is_attached()*
|
||||
Checks if a buffer is attached for a particular client.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number) Buffer handle, or 0 for current
|
||||
{client_id} (number) the client id
|
||||
• {bufnr} (number) Buffer handle, or 0 for current
|
||||
• {client_id} (number) the client id
|
||||
|
||||
buf_notify({bufnr}, {method}, {params}) *vim.lsp.buf_notify()*
|
||||
Send a notification to a server
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} [number] (optional): The number of the buffer
|
||||
{method} [string]: Name of the request method
|
||||
{params} [string]: Arguments to send to the server
|
||||
• {bufnr} [number] (optional): The number of the buffer
|
||||
• {method} [string]: Name of the request method
|
||||
• {params} [string]: Arguments to send to the server
|
||||
|
||||
Return: ~
|
||||
true if any client returns true; false otherwise
|
||||
@ -576,10 +576,10 @@ buf_request_all({bufnr}, {method}, {params}, {callback})
|
||||
|vim.lsp.buf_request()| but the return result and callback are different.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number) Buffer handle, or 0 for current.
|
||||
{method} (string) LSP method name
|
||||
{params} (optional, table) Parameters to send to the server
|
||||
{callback} (function) The callback to call when all requests are
|
||||
• {bufnr} (number) Buffer handle, or 0 for current.
|
||||
• {method} (string) LSP method name
|
||||
• {params} (optional, table) Parameters to send to the server
|
||||
• {callback} (function) The callback to call when all requests are
|
||||
finished.
|
||||
|
||||
Return: ~
|
||||
@ -595,10 +595,10 @@ buf_request_sync({bufnr}, {method}, {params}, {timeout_ms})
|
||||
result is different. Wait maximum of {timeout_ms} (default 1000) ms.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number) Buffer handle, or 0 for current.
|
||||
{method} (string) LSP method name
|
||||
{params} (optional, table) Parameters to send to the server
|
||||
{timeout_ms} (optional, number, default=1000) Maximum time in
|
||||
• {bufnr} (number) Buffer handle, or 0 for current.
|
||||
• {method} (string) LSP method name
|
||||
• {params} (optional, table) Parameters to send to the server
|
||||
• {timeout_ms} (optional, number, default=1000) Maximum time in
|
||||
milliseconds to wait for a result.
|
||||
|
||||
Return: ~
|
||||
@ -666,7 +666,7 @@ client_is_stopped({client_id}) *vim.lsp.client_is_stopped()*
|
||||
Checks whether a client is stopped.
|
||||
|
||||
Parameters: ~
|
||||
{client_id} (Number)
|
||||
• {client_id} (Number)
|
||||
|
||||
Return: ~
|
||||
true if client is stopped, false otherwise.
|
||||
@ -676,8 +676,8 @@ for_each_buffer_client({bufnr}, {fn})
|
||||
Invokes a function for each LSP client attached to a buffer.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number) Buffer number
|
||||
{fn} (function) Function to run on each client attached to buffer
|
||||
• {bufnr} (number) Buffer number
|
||||
• {fn} (function) Function to run on each client attached to buffer
|
||||
{bufnr}. The function takes the client, client ID, and buffer
|
||||
number as arguments. Example: >
|
||||
|
||||
@ -696,7 +696,7 @@ formatexpr({opts}) *vim.lsp.formatexpr()*
|
||||
'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})')`.
|
||||
|
||||
Parameters: ~
|
||||
{opts} (table) options for customizing the formatting expression
|
||||
• {opts} (table) options for customizing the formatting expression
|
||||
which takes the following optional keys:
|
||||
• timeout_ms (default 500ms). The timeout period for the
|
||||
formatting request.
|
||||
@ -705,7 +705,7 @@ get_active_clients({filter}) *vim.lsp.get_active_clients()*
|
||||
Get active clients.
|
||||
|
||||
Parameters: ~
|
||||
{filter} (table|nil) A table with key-value pairs used to filter the
|
||||
• {filter} (table|nil) A table with key-value pairs used to filter the
|
||||
returned clients. The available keys are:
|
||||
• id (number): Only return clients with the given id
|
||||
• bufnr (number): Only return clients attached to this
|
||||
@ -720,7 +720,7 @@ get_buffers_by_client_id({client_id})
|
||||
Returns list of buffers attached to client_id.
|
||||
|
||||
Parameters: ~
|
||||
{client_id} (number) client id
|
||||
• {client_id} (number) client id
|
||||
|
||||
Return: ~
|
||||
list of buffer ids
|
||||
@ -730,7 +730,7 @@ get_client_by_id({client_id}) *vim.lsp.get_client_by_id()*
|
||||
not yet be fully initialized.
|
||||
|
||||
Parameters: ~
|
||||
{client_id} (number) client id
|
||||
• {client_id} (number) client id
|
||||
|
||||
Return: ~
|
||||
|vim.lsp.client| object, or nil
|
||||
@ -745,8 +745,8 @@ omnifunc({findstart}, {base}) *vim.lsp.omnifunc()*
|
||||
Implements 'omnifunc' compatible LSP completion.
|
||||
|
||||
Parameters: ~
|
||||
{findstart} 0 or 1, decides behavior
|
||||
{base} If findstart=0, text to match against
|
||||
• {findstart} 0 or 1, decides behavior
|
||||
• {base} If findstart=0, text to match against
|
||||
|
||||
Return: ~
|
||||
(number) Decided by {findstart}:
|
||||
@ -768,7 +768,7 @@ set_log_level({level}) *vim.lsp.set_log_level()*
|
||||
Use `lsp.log_levels` for reverse lookup.
|
||||
|
||||
Parameters: ~
|
||||
{level} [number|string] the case insensitive level name or number
|
||||
• {level} [number|string] the case insensitive level name or number
|
||||
|
||||
See also: ~
|
||||
|vim.lsp.log_levels|
|
||||
@ -791,22 +791,19 @@ start({config}, {opts}) *vim.lsp.start()*
|
||||
See |vim.lsp.start_client()| for all available options. The most important
|
||||
are:
|
||||
|
||||
`name` is an arbitrary name for the LSP client. It should be unique per
|
||||
language server.
|
||||
|
||||
`cmd` the command as list - used to start the language server. The command must
|
||||
be present in the `$PATH` environment variable or an absolute path to the executable. Shell
|
||||
constructs like `~` are NOT expanded.
|
||||
|
||||
`root_dir` path to the project root. By default this is used to decide if
|
||||
an existing client should be re-used. The example above uses
|
||||
|vim.fs.find()| and |vim.fs.dirname()| to detect the root by traversing
|
||||
the file system upwards starting from the current directory until either a
|
||||
`pyproject.toml` or `setup.py` file is found.
|
||||
|
||||
`workspace_folders` a list of { uri:string, name: string } tables. The
|
||||
project root folders used by the language server. If `nil` the property is
|
||||
derived from the `root_dir` for convenience.
|
||||
• `name` arbitrary name for the LSP client. Should be unique per language
|
||||
server.
|
||||
• `cmd` command (in list form) used to start the language server. Must be
|
||||
absolute, or found on `$PATH`. Shell constructs like `~` are not
|
||||
expanded.
|
||||
• `root_dir` path to the project root. By default this is used to decide
|
||||
if an existing client should be re-used. The example above uses
|
||||
|vim.fs.find()| and |vim.fs.dirname()| to detect the root by traversing
|
||||
the file system upwards starting from the current directory until either
|
||||
a `pyproject.toml` or `setup.py` file is found.
|
||||
• `workspace_folders` list of `{ uri:string, name: string }` tables
|
||||
specifying the project root folders used by the language server. If
|
||||
`nil` the property is derived from `root_dir` for convenience.
|
||||
|
||||
Language servers use this information to discover metadata like the
|
||||
dependencies of your project and they tend to index the contents within
|
||||
@ -818,9 +815,9 @@ start({config}, {opts}) *vim.lsp.start()*
|
||||
`ftplugin/<filetype_name>.lua` (See |ftplugin-name|)
|
||||
|
||||
Parameters: ~
|
||||
{config} (table) Same configuration as documented in
|
||||
• {config} (table) Same configuration as documented in
|
||||
|vim.lsp.start_client()|
|
||||
{opts} nil|table Optional keyword arguments:
|
||||
• {opts} nil|table Optional keyword arguments:
|
||||
• reuse_client (fun(client: client, config: table): boolean)
|
||||
Predicate used to decide if a client should be re-used.
|
||||
Used on all running clients. The default implementation
|
||||
@ -837,7 +834,7 @@ start_client({config}) *vim.lsp.start_client()*
|
||||
The following parameters describe fields in the {config} table.
|
||||
|
||||
Parameters: ~
|
||||
{cmd} (table|string|fun(dispatchers: table):table)
|
||||
• {cmd} (table|string|fun(dispatchers: table):table)
|
||||
command string or list treated like |jobstart()|.
|
||||
The command must launch the language server
|
||||
process. `cmd` can also be a function that
|
||||
@ -848,26 +845,26 @@ start_client({config}) *vim.lsp.start_client()*
|
||||
|vim.lsp.rpc.notify()| For TCP there is a
|
||||
built-in rpc client factory:
|
||||
|vim.lsp.rpc.connect()|
|
||||
{cmd_cwd} (string, default=|getcwd()|) Directory to launch
|
||||
• {cmd_cwd} (string, default=|getcwd()|) Directory to launch
|
||||
the `cmd` process. Not related to `root_dir`.
|
||||
{cmd_env} (table) Environment flags to pass to the LSP on
|
||||
• {cmd_env} (table) Environment flags to pass to the LSP on
|
||||
spawn. Can be specified using keys like a map or
|
||||
as a list with `k=v` pairs or both. Non-string values are coerced to
|
||||
string. Example: >
|
||||
|
||||
{ "PRODUCTION=true"; "TEST=123"; PORT = 8080; HOST = "0.0.0.0"; }
|
||||
<
|
||||
{detached} (boolean, default true) Daemonize the server
|
||||
• {detached} (boolean, default true) Daemonize the server
|
||||
process so that it runs in a separate process
|
||||
group from Nvim. Nvim will shutdown the process
|
||||
on exit, but if Nvim fails to exit cleanly this
|
||||
could leave behind orphaned server processes.
|
||||
{workspace_folders} (table) List of workspace folders passed to the
|
||||
• {workspace_folders} (table) List of workspace folders passed to the
|
||||
language server. For backwards compatibility
|
||||
rootUri and rootPath will be derived from the
|
||||
first workspace folder in this list. See
|
||||
`workspaceFolders` in the LSP spec.
|
||||
{capabilities} Map overriding the default capabilities defined
|
||||
• {capabilities} Map overriding the default capabilities defined
|
||||
by |vim.lsp.protocol.make_client_capabilities()|,
|
||||
passed to the language server on initialization.
|
||||
Hint: use make_client_capabilities() and modify
|
||||
@ -875,44 +872,44 @@ start_client({config}) *vim.lsp.start_client()*
|
||||
• Note: To send an empty dictionary use
|
||||
`{[vim.type_idx]=vim.types.dictionary}`, else
|
||||
it will be encoded as an array.
|
||||
{handlers} Map of language server method names to
|
||||
• {handlers} Map of language server method names to
|
||||
|lsp-handler|
|
||||
{settings} Map with language server specific settings. These
|
||||
• {settings} Map with language server specific settings. These
|
||||
are returned to the language server if requested
|
||||
via `workspace/configuration`. Keys are
|
||||
case-sensitive.
|
||||
{commands} (table) Table that maps string of clientside
|
||||
• {commands} (table) Table that maps string of clientside
|
||||
commands to user-defined functions. Commands
|
||||
passed to start_client take precedence over the
|
||||
global command registry. Each key must be a
|
||||
unique command name, and the value is a function
|
||||
which is called if any LSP action (code action,
|
||||
code lenses, ...) triggers the command.
|
||||
{init_options} Values to pass in the initialization request as
|
||||
• {init_options} Values to pass in the initialization request as
|
||||
`initializationOptions`. See `initialize` in the
|
||||
LSP spec.
|
||||
{name} (string, default=client-id) Name in log messages.
|
||||
{get_language_id} function(bufnr, filetype) -> language ID as
|
||||
• {name} (string, default=client-id) Name in log messages.
|
||||
• {get_language_id} function(bufnr, filetype) -> language ID as
|
||||
string. Defaults to the filetype.
|
||||
{offset_encoding} (default="utf-16") One of "utf-8", "utf-16", or
|
||||
• {offset_encoding} (default="utf-16") One of "utf-8", "utf-16", or
|
||||
"utf-32" which is the encoding that the LSP
|
||||
server expects. Client does not verify this is
|
||||
correct.
|
||||
{on_error} Callback with parameters (code, ...), invoked
|
||||
• {on_error} Callback with parameters (code, ...), invoked
|
||||
when the client operation throws an error. `code`
|
||||
is a number describing the error. Other arguments
|
||||
may be passed depending on the error kind. See
|
||||
`vim.lsp.rpc.client_errors` for possible errors.
|
||||
Use `vim.lsp.rpc.client_errors[code]` to get
|
||||
human-friendly name.
|
||||
{before_init} Callback with parameters (initialize_params,
|
||||
• {before_init} Callback with parameters (initialize_params,
|
||||
config) invoked before the LSP "initialize"
|
||||
phase, where `params` contains the parameters
|
||||
being sent to the server and `config` is the
|
||||
config that was passed to
|
||||
|vim.lsp.start_client()|. You can use this to
|
||||
modify parameters before they are sent.
|
||||
{on_init} Callback (client, initialize_result) invoked
|
||||
• {on_init} Callback (client, initialize_result) invoked
|
||||
after LSP "initialize", where `result` is a table
|
||||
of `capabilities` and anything else the server
|
||||
may send. For example, clangd sends
|
||||
@ -925,19 +922,19 @@ start_client({config}) *vim.lsp.start_client()*
|
||||
make this assumption. A
|
||||
`workspace/didChangeConfiguration` notification
|
||||
should be sent to the server during on_init.
|
||||
{on_exit} Callback (code, signal, client_id) invoked on
|
||||
• {on_exit} Callback (code, signal, client_id) invoked on
|
||||
client exit.
|
||||
• code: exit code of the process
|
||||
• signal: number describing the signal used to
|
||||
terminate (if any)
|
||||
• client_id: client handle
|
||||
{on_attach} Callback (client, bufnr) invoked when client
|
||||
• {on_attach} Callback (client, bufnr) invoked when client
|
||||
attaches to a buffer.
|
||||
{trace} "off" | "messages" | "verbose" | nil passed
|
||||
• {trace} "off" | "messages" | "verbose" | nil passed
|
||||
directly to the language server in the initialize
|
||||
request. Invalid/empty values will default to
|
||||
"off"
|
||||
{flags} A table with flags for the client. The current
|
||||
• {flags} A table with flags for the client. The current
|
||||
(experimental) flags are:
|
||||
• allow_incremental_sync (bool, default true):
|
||||
Allow using incremental sync for buffer edits
|
||||
@ -951,7 +948,7 @@ start_client({config}) *vim.lsp.start_client()*
|
||||
sending kill -15. If set to false, nvim exits
|
||||
immediately after sending the "shutdown"
|
||||
request to the server.
|
||||
{root_dir} (string) Directory where the LSP server will base
|
||||
• {root_dir} (string) Directory where the LSP server will base
|
||||
its workspaceFolders, rootUri, and rootPath on
|
||||
initialization.
|
||||
|
||||
@ -974,8 +971,8 @@ stop_client({client_id}, {force}) *vim.lsp.stop_client()*
|
||||
for this client, then force-shutdown is attempted.
|
||||
|
||||
Parameters: ~
|
||||
{client_id} client id or |vim.lsp.client| object, or list thereof
|
||||
{force} (boolean) (optional) shutdown forcefully
|
||||
• {client_id} client id or |vim.lsp.client| object, or list thereof
|
||||
• {force} (boolean) (optional) shutdown forcefully
|
||||
|
||||
tagfunc({...}) *vim.lsp.tagfunc()*
|
||||
Provides an interface between the built-in client and 'tagfunc'.
|
||||
@ -986,8 +983,8 @@ tagfunc({...}) *vim.lsp.tagfunc()*
|
||||
LSP servers, falls back to using built-in tags.
|
||||
|
||||
Parameters: ~
|
||||
{pattern} Pattern used to find a workspace symbol
|
||||
{flags} See |tag-function|
|
||||
• {pattern} Pattern used to find a workspace symbol
|
||||
• {flags} See |tag-function|
|
||||
|
||||
Return: ~
|
||||
A list of matching tags
|
||||
@ -996,8 +993,8 @@ with({handler}, {override_config}) *vim.lsp.with()*
|
||||
Function to manage overriding defaults for LSP handlers.
|
||||
|
||||
Parameters: ~
|
||||
{handler} (function) See |lsp-handler|
|
||||
{override_config} (table) Table containing the keys to override
|
||||
• {handler} (function) See |lsp-handler|
|
||||
• {override_config} (table) Table containing the keys to override
|
||||
behavior of the {handler}
|
||||
|
||||
|
||||
@ -1016,7 +1013,7 @@ code_action({options}) *vim.lsp.buf.code_action()*
|
||||
Selects a code action available at the current cursor position.
|
||||
|
||||
Parameters: ~
|
||||
{options} (table|nil) Optional table which holds the following
|
||||
• {options} (table|nil) Optional table which holds the following
|
||||
optional fields:
|
||||
• context: (table|nil) Corresponds to `CodeActionContext` of the LSP specification:
|
||||
• diagnostics (table|nil): LSP`Diagnostic[]` . Inferred from the current position if not provided.
|
||||
@ -1043,7 +1040,7 @@ completion({context}) *vim.lsp.buf.completion()*
|
||||
called in Insert mode.
|
||||
|
||||
Parameters: ~
|
||||
{context} (context support not yet implemented) Additional
|
||||
• {context} (context support not yet implemented) Additional
|
||||
information about the context in which a completion was
|
||||
triggered (how it was triggered, and by which trigger
|
||||
character, if applicable)
|
||||
@ -1058,7 +1055,7 @@ declaration({options}) *vim.lsp.buf.declaration()*
|
||||
|vim.lsp.buf.definition()| instead.
|
||||
|
||||
Parameters: ~
|
||||
{options} (table|nil) additional options
|
||||
• {options} (table|nil) additional options
|
||||
• reuse_win: (boolean) Jump to existing window if buffer is
|
||||
already open.
|
||||
• on_list: (function) handler for list results. See
|
||||
@ -1068,7 +1065,7 @@ definition({options}) *vim.lsp.buf.definition()*
|
||||
Jumps to the definition of the symbol under the cursor.
|
||||
|
||||
Parameters: ~
|
||||
{options} (table|nil) additional options
|
||||
• {options} (table|nil) additional options
|
||||
• reuse_win: (boolean) Jump to existing window if buffer is
|
||||
already open.
|
||||
• on_list: (function) handler for list results. See
|
||||
@ -1093,7 +1090,7 @@ document_symbol({options}) *vim.lsp.buf.document_symbol()*
|
||||
Lists all symbols in the current buffer in the quickfix window.
|
||||
|
||||
Parameters: ~
|
||||
{options} (table|nil) additional options
|
||||
• {options} (table|nil) additional options
|
||||
• on_list: (function) handler for list results. See
|
||||
|lsp-on-list-handler|
|
||||
|
||||
@ -1101,7 +1098,7 @@ execute_command({command_params}) *vim.lsp.buf.execute_command()*
|
||||
Executes an LSP server command.
|
||||
|
||||
Parameters: ~
|
||||
{command_params} (table) A valid `ExecuteCommandParams` object
|
||||
• {command_params} (table) A valid `ExecuteCommandParams` object
|
||||
|
||||
See also: ~
|
||||
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_executeCommand
|
||||
@ -1111,7 +1108,7 @@ format({options}) *vim.lsp.buf.format()*
|
||||
server clients.
|
||||
|
||||
Parameters: ~
|
||||
{options} table|nil Optional table which holds the following optional
|
||||
• {options} table|nil Optional table which holds the following optional
|
||||
fields:
|
||||
• formatting_options (table|nil): Can be used to specify
|
||||
FormattingOptions. Some unspecified options will be
|
||||
@ -1149,7 +1146,7 @@ formatting({options}) *vim.lsp.buf.formatting()*
|
||||
Formats the current buffer.
|
||||
|
||||
Parameters: ~
|
||||
{options} (table|nil) Can be used to specify FormattingOptions. Some
|
||||
• {options} (table|nil) Can be used to specify FormattingOptions. Some
|
||||
unspecified options will be automatically derived from the
|
||||
current Neovim options.
|
||||
|
||||
@ -1171,9 +1168,9 @@ formatting_seq_sync({options}, {timeout_ms}, {order})
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
{options} (table|nil) `FormattingOptions` entries
|
||||
{timeout_ms} (number|nil) Request timeout
|
||||
{order} (table|nil) List of client names. Formatting is
|
||||
• {options} (table|nil) `FormattingOptions` entries
|
||||
• {timeout_ms} (number|nil) Request timeout
|
||||
• {order} (table|nil) List of client names. Formatting is
|
||||
requested from clients in the following order: first all
|
||||
clients that are not in the `order` list, then the
|
||||
remaining clients in the order as they occur in the
|
||||
@ -1192,8 +1189,8 @@ formatting_sync({options}, {timeout_ms})
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
{options} (table|nil) with valid `FormattingOptions` entries
|
||||
{timeout_ms} (number) Request timeout
|
||||
• {options} (table|nil) with valid `FormattingOptions` entries
|
||||
• {timeout_ms} (number) Request timeout
|
||||
|
||||
See also: ~
|
||||
|vim.lsp.buf.format()|
|
||||
@ -1207,7 +1204,7 @@ implementation({options}) *vim.lsp.buf.implementation()*
|
||||
quickfix window.
|
||||
|
||||
Parameters: ~
|
||||
{options} (table|nil) additional options
|
||||
• {options} (table|nil) additional options
|
||||
• on_list: (function) handler for list results. See
|
||||
|lsp-on-list-handler|
|
||||
|
||||
@ -1229,14 +1226,14 @@ range_code_action({context}, {start_pos}, {end_pos})
|
||||
Performs |vim.lsp.buf.code_action()| for a given range.
|
||||
|
||||
Parameters: ~
|
||||
{context} (table|nil) `CodeActionContext` of the LSP specification:
|
||||
• {context} (table|nil) `CodeActionContext` of the LSP specification:
|
||||
• diagnostics: (table|nil) LSP`Diagnostic[]` . Inferred from the current position if not provided.
|
||||
• only: (table|nil) List of LSP `CodeActionKind`s used to
|
||||
filter the code actions. Most language servers support
|
||||
values like `refactor` or `quickfix`.
|
||||
{start_pos} ({number, number}, optional) mark-indexed position.
|
||||
• {start_pos} ({number, number}, optional) mark-indexed position.
|
||||
Defaults to the start of the last visual selection.
|
||||
{end_pos} ({number, number}, optional) mark-indexed position.
|
||||
• {end_pos} ({number, number}, optional) mark-indexed position.
|
||||
Defaults to the end of the last visual selection.
|
||||
|
||||
*vim.lsp.buf.range_formatting()*
|
||||
@ -1244,10 +1241,10 @@ range_formatting({options}, {start_pos}, {end_pos})
|
||||
Formats a given range.
|
||||
|
||||
Parameters: ~
|
||||
{options} Table with valid `FormattingOptions` entries.
|
||||
{start_pos} ({number, number}, optional) mark-indexed position.
|
||||
• {options} Table with valid `FormattingOptions` entries.
|
||||
• {start_pos} ({number, number}, optional) mark-indexed position.
|
||||
Defaults to the start of the last visual selection.
|
||||
{end_pos} ({number, number}, optional) mark-indexed position.
|
||||
• {end_pos} ({number, number}, optional) mark-indexed position.
|
||||
Defaults to the end of the last visual selection.
|
||||
|
||||
references({context}, {options}) *vim.lsp.buf.references()*
|
||||
@ -1255,8 +1252,8 @@ references({context}, {options}) *vim.lsp.buf.references()*
|
||||
window.
|
||||
|
||||
Parameters: ~
|
||||
{context} (table) Context for the request
|
||||
{options} (table|nil) additional options
|
||||
• {context} (table) Context for the request
|
||||
• {options} (table|nil) additional options
|
||||
• on_list: (function) handler for list results. See
|
||||
|lsp-on-list-handler|
|
||||
|
||||
@ -1272,9 +1269,9 @@ rename({new_name}, {options}) *vim.lsp.buf.rename()*
|
||||
Renames all references to the symbol under the cursor.
|
||||
|
||||
Parameters: ~
|
||||
{new_name} (string|nil) If not provided, the user will be prompted
|
||||
• {new_name} (string|nil) If not provided, the user will be prompted
|
||||
for a new name using |vim.ui.input()|.
|
||||
{options} (table|nil) additional options
|
||||
• {options} (table|nil) additional options
|
||||
• filter (function|nil): Predicate used to filter clients.
|
||||
Receives a client as argument and must return a boolean.
|
||||
Clients matching the predicate are included.
|
||||
@ -1296,7 +1293,7 @@ type_definition({options}) *vim.lsp.buf.type_definition()*
|
||||
Jumps to the definition of the type of the symbol under the cursor.
|
||||
|
||||
Parameters: ~
|
||||
{options} (table|nil) additional options
|
||||
• {options} (table|nil) additional options
|
||||
• reuse_win: (boolean) Jump to existing window if buffer is
|
||||
already open.
|
||||
• on_list: (function) handler for list results. See
|
||||
@ -1310,8 +1307,8 @@ workspace_symbol({query}, {options}) *vim.lsp.buf.workspace_symbol()*
|
||||
string means no filtering is done.
|
||||
|
||||
Parameters: ~
|
||||
{query} (string, optional)
|
||||
{options} (table|nil) additional options
|
||||
• {query} (string, optional)
|
||||
• {options} (table|nil) additional options
|
||||
• on_list: (function) handler for list results. See
|
||||
|lsp-on-list-handler|
|
||||
|
||||
@ -1324,7 +1321,7 @@ get_namespace({client_id}) *vim.lsp.diagnostic.get_namespace()*
|
||||
|vim.diagnostic|.
|
||||
|
||||
Parameters: ~
|
||||
{client_id} (number) The id of the LSP client
|
||||
• {client_id} (number) The id of the LSP client
|
||||
|
||||
*vim.lsp.diagnostic.on_publish_diagnostics()*
|
||||
on_publish_diagnostics({_}, {result}, {ctx}, {config})
|
||||
@ -1353,7 +1350,7 @@ on_publish_diagnostics({_}, {result}, {ctx}, {config})
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
{config} (table) Configuration table (see |vim.diagnostic.config()|).
|
||||
• {config} (table) Configuration table (see |vim.diagnostic.config()|).
|
||||
|
||||
|
||||
==============================================================================
|
||||
@ -1363,15 +1360,15 @@ display({lenses}, {bufnr}, {client_id}) *vim.lsp.codelens.display()*
|
||||
Display the lenses using virtual text
|
||||
|
||||
Parameters: ~
|
||||
{lenses} (table) of lenses to display (`CodeLens[] | null`)
|
||||
{bufnr} (number)
|
||||
{client_id} (number)
|
||||
• {lenses} (table) of lenses to display (`CodeLens[] | null`)
|
||||
• {bufnr} (number)
|
||||
• {client_id} (number)
|
||||
|
||||
get({bufnr}) *vim.lsp.codelens.get()*
|
||||
Return all lenses for the given buffer
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number) Buffer number. 0 can be used for the current buffer.
|
||||
• {bufnr} (number) Buffer number. 0 can be used for the current buffer.
|
||||
|
||||
Return: ~
|
||||
(table) (`CodeLens[]`)
|
||||
@ -1395,9 +1392,9 @@ save({lenses}, {bufnr}, {client_id}) *vim.lsp.codelens.save()*
|
||||
Store lenses for a specific buffer and client
|
||||
|
||||
Parameters: ~
|
||||
{lenses} (table) of lenses to store (`CodeLens[] | null`)
|
||||
{bufnr} (number)
|
||||
{client_id} (number)
|
||||
• {lenses} (table) of lenses to store (`CodeLens[] | null`)
|
||||
• {bufnr} (number)
|
||||
• {client_id} (number)
|
||||
|
||||
|
||||
==============================================================================
|
||||
@ -1415,7 +1412,7 @@ hover({_}, {result}, {ctx}, {config}) *vim.lsp.handlers.hover()*
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
{config} (table) Configuration table.
|
||||
• {config} (table) Configuration table.
|
||||
• border: (default=nil)
|
||||
• Add borders to the floating window
|
||||
• See |nvim_open_win()|
|
||||
@ -1434,7 +1431,7 @@ signature_help({_}, {result}, {ctx}, {config})
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
{config} (table) Configuration table.
|
||||
• {config} (table) Configuration table.
|
||||
• border: (default=nil)
|
||||
• Add borders to the floating window
|
||||
• See |nvim_open_win()|
|
||||
@ -1449,8 +1446,8 @@ apply_text_document_edit({text_document_edit}, {index}, {offset_encoding})
|
||||
document.
|
||||
|
||||
Parameters: ~
|
||||
{text_document_edit} table: a `TextDocumentEdit` object
|
||||
{index} number: Optional index of the edit, if from a
|
||||
• {text_document_edit} table: a `TextDocumentEdit` object
|
||||
• {index} number: Optional index of the edit, if from a
|
||||
list of edits (or nil, if not from a list)
|
||||
|
||||
See also: ~
|
||||
@ -1461,9 +1458,9 @@ apply_text_edits({text_edits}, {bufnr}, {offset_encoding})
|
||||
Applies a list of text edits to a buffer.
|
||||
|
||||
Parameters: ~
|
||||
{text_edits} (table) list of `TextEdit` objects
|
||||
{bufnr} (number) Buffer id
|
||||
{offset_encoding} (string) utf-8|utf-16|utf-32
|
||||
• {text_edits} (table) list of `TextEdit` objects
|
||||
• {bufnr} (number) Buffer id
|
||||
• {offset_encoding} (string) utf-8|utf-16|utf-32
|
||||
|
||||
See also: ~
|
||||
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textEdit
|
||||
@ -1473,24 +1470,24 @@ apply_workspace_edit({workspace_edit}, {offset_encoding})
|
||||
Applies a `WorkspaceEdit`.
|
||||
|
||||
Parameters: ~
|
||||
{workspace_edit} (table) `WorkspaceEdit`
|
||||
{offset_encoding} (string) utf-8|utf-16|utf-32 (required)
|
||||
• {workspace_edit} (table) `WorkspaceEdit`
|
||||
• {offset_encoding} (string) utf-8|utf-16|utf-32 (required)
|
||||
|
||||
buf_clear_references({bufnr}) *vim.lsp.util.buf_clear_references()*
|
||||
Removes document highlights from a buffer.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number) Buffer id
|
||||
• {bufnr} (number) Buffer id
|
||||
|
||||
*vim.lsp.util.buf_highlight_references()*
|
||||
buf_highlight_references({bufnr}, {references}, {offset_encoding})
|
||||
Shows a list of document highlights for a certain buffer.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number) Buffer id
|
||||
{references} (table) List of `DocumentHighlight` objects to
|
||||
• {bufnr} (number) Buffer id
|
||||
• {references} (table) List of `DocumentHighlight` objects to
|
||||
highlight
|
||||
{offset_encoding} (string) One of "utf-8", "utf-16", "utf-32".
|
||||
• {offset_encoding} (string) One of "utf-8", "utf-16", "utf-32".
|
||||
|
||||
See also: ~
|
||||
https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#documentHighlight
|
||||
@ -1500,10 +1497,10 @@ character_offset({buf}, {row}, {col}, {offset_encoding})
|
||||
Returns the UTF-32 and UTF-16 offsets for a position in a certain buffer.
|
||||
|
||||
Parameters: ~
|
||||
{buf} (number) buffer number (0 for current)
|
||||
{row} 0-indexed line
|
||||
{col} 0-indexed byte offset in line
|
||||
{offset_encoding} (string) utf-8|utf-16|utf-32|nil defaults to
|
||||
• {buf} (number) buffer number (0 for current)
|
||||
• {row} 0-indexed line
|
||||
• {col} 0-indexed byte offset in line
|
||||
• {offset_encoding} (string) utf-8|utf-16|utf-32|nil defaults to
|
||||
`offset_encoding` of first client of `buf`
|
||||
|
||||
Return: ~
|
||||
@ -1518,8 +1515,8 @@ convert_input_to_markdown_lines({input}, {contents})
|
||||
`textDocument/signatureHelp`, and potentially others.
|
||||
|
||||
Parameters: ~
|
||||
{input} (`MarkedString` | `MarkedString[]` | `MarkupContent`)
|
||||
{contents} (table, optional, default `{}`) List of strings to extend
|
||||
• {input} (`MarkedString` | `MarkedString[]` | `MarkupContent`)
|
||||
• {contents} (table, optional, default `{}`) List of strings to extend
|
||||
with converted lines
|
||||
|
||||
Return: ~
|
||||
@ -1533,10 +1530,10 @@ convert_signature_help_to_markdown_lines({signature_help}, {ft}, {triggers})
|
||||
Converts `textDocument/SignatureHelp` response to markdown lines.
|
||||
|
||||
Parameters: ~
|
||||
{signature_help} Response of `textDocument/SignatureHelp`
|
||||
{ft} optional filetype that will be use as the `lang` for
|
||||
• {signature_help} Response of `textDocument/SignatureHelp`
|
||||
• {ft} optional filetype that will be use as the `lang` for
|
||||
the label markdown code block
|
||||
{triggers} optional list of trigger characters from the lsp
|
||||
• {triggers} optional list of trigger characters from the lsp
|
||||
server. used to better determine parameter offsets
|
||||
|
||||
Return: ~
|
||||
@ -1550,7 +1547,7 @@ extract_completion_items({result})
|
||||
Can be used to extract the completion items from a `textDocument/completion` request, which may return one of `CompletionItem[]` , `CompletionList` or null.
|
||||
|
||||
Parameters: ~
|
||||
{result} (table) The result of a `textDocument/completion` request
|
||||
• {result} (table) The result of a `textDocument/completion` request
|
||||
|
||||
Return: ~
|
||||
(table) List of completion items
|
||||
@ -1562,7 +1559,7 @@ get_effective_tabstop({bufnr}) *vim.lsp.util.get_effective_tabstop()*
|
||||
Returns indentation size.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number|nil): Buffer handle, defaults to current
|
||||
• {bufnr} (number|nil): Buffer handle, defaults to current
|
||||
|
||||
Return: ~
|
||||
(number) indentation size
|
||||
@ -1575,9 +1572,9 @@ jump_to_location({location}, {offset_encoding}, {reuse_win})
|
||||
Jumps to a location.
|
||||
|
||||
Parameters: ~
|
||||
{location} (table) (`Location`|`LocationLink`)
|
||||
{offset_encoding} (string) utf-8|utf-16|utf-32 (required)
|
||||
{reuse_win} (boolean) Jump to existing window if buffer is
|
||||
• {location} (table) (`Location`|`LocationLink`)
|
||||
• {offset_encoding} (string) utf-8|utf-16|utf-32 (required)
|
||||
• {reuse_win} (boolean) Jump to existing window if buffer is
|
||||
already opened.
|
||||
|
||||
Return: ~
|
||||
@ -1592,8 +1589,8 @@ locations_to_items({locations}, {offset_encoding})
|
||||
|setloclist()|.
|
||||
|
||||
Parameters: ~
|
||||
{locations} (table) list of `Location`s or `LocationLink`s
|
||||
{offset_encoding} (string) offset_encoding for locations
|
||||
• {locations} (table) list of `Location`s or `LocationLink`s
|
||||
• {offset_encoding} (string) offset_encoding for locations
|
||||
utf-8|utf-16|utf-32
|
||||
|
||||
Return: ~
|
||||
@ -1603,8 +1600,8 @@ lookup_section({settings}, {section}) *vim.lsp.util.lookup_section()*
|
||||
Helper function to return nested values in language server settings
|
||||
|
||||
Parameters: ~
|
||||
{settings} a table of language server settings
|
||||
{section} a string indicating the field of the settings table
|
||||
• {settings} a table of language server settings
|
||||
• {section} a string indicating the field of the settings table
|
||||
|
||||
Return: ~
|
||||
(table or string) The value of settings accessed via section
|
||||
@ -1615,9 +1612,9 @@ make_floating_popup_options({width}, {height}, {opts})
|
||||
table can be passed to |nvim_open_win()|.
|
||||
|
||||
Parameters: ~
|
||||
{width} (number) window width (in character cells)
|
||||
{height} (number) window height (in character cells)
|
||||
{opts} (table, optional)
|
||||
• {width} (number) window width (in character cells)
|
||||
• {height} (number) window height (in character cells)
|
||||
• {opts} (table, optional)
|
||||
• offset_x (number) offset to add to `col`
|
||||
• offset_y (number) offset to add to `row`
|
||||
• border (string or table) override `border`
|
||||
@ -1633,7 +1630,7 @@ make_formatting_params({options})
|
||||
cursor position.
|
||||
|
||||
Parameters: ~
|
||||
{options} (table|nil) with valid `FormattingOptions` entries
|
||||
• {options} (table|nil) with valid `FormattingOptions` entries
|
||||
|
||||
Return: ~
|
||||
`DocumentFormattingParams` object
|
||||
@ -1647,13 +1644,13 @@ make_given_range_params({start_pos}, {end_pos}, {bufnr}, {offset_encoding})
|
||||
similar to |vim.lsp.util.make_range_params()|.
|
||||
|
||||
Parameters: ~
|
||||
{start_pos} number[]|nil {row, col} mark-indexed position.
|
||||
• {start_pos} number[]|nil {row, col} mark-indexed position.
|
||||
Defaults to the start of the last visual selection.
|
||||
{end_pos} number[]|nil {row, col} mark-indexed position.
|
||||
• {end_pos} number[]|nil {row, col} mark-indexed position.
|
||||
Defaults to the end of the last visual selection.
|
||||
{bufnr} (number|nil) buffer handle or 0 for current,
|
||||
• {bufnr} (number|nil) buffer handle or 0 for current,
|
||||
defaults to current
|
||||
{offset_encoding} "utf-8"|"utf-16"|"utf-32"|nil defaults to
|
||||
• {offset_encoding} "utf-8"|"utf-16"|"utf-32"|nil defaults to
|
||||
`offset_encoding` of first client of `bufnr`
|
||||
|
||||
Return: ~
|
||||
@ -1666,9 +1663,9 @@ make_position_params({window}, {offset_encoding})
|
||||
cursor position.
|
||||
|
||||
Parameters: ~
|
||||
{window} number|nil: window handle or 0 for current,
|
||||
• {window} number|nil: window handle or 0 for current,
|
||||
defaults to current
|
||||
{offset_encoding} (string) utf-8|utf-16|utf-32|nil defaults to
|
||||
• {offset_encoding} (string) utf-8|utf-16|utf-32|nil defaults to
|
||||
`offset_encoding` of first client of buffer of
|
||||
`window`
|
||||
|
||||
@ -1686,9 +1683,9 @@ make_range_params({window}, {offset_encoding})
|
||||
`textDocument/rangeFormatting`.
|
||||
|
||||
Parameters: ~
|
||||
{window} number|nil: window handle or 0 for current,
|
||||
• {window} number|nil: window handle or 0 for current,
|
||||
defaults to current
|
||||
{offset_encoding} "utf-8"|"utf-16"|"utf-32"|nil defaults to
|
||||
• {offset_encoding} "utf-8"|"utf-16"|"utf-32"|nil defaults to
|
||||
`offset_encoding` of first client of buffer of
|
||||
`window`
|
||||
|
||||
@ -1701,7 +1698,7 @@ make_text_document_params({bufnr})
|
||||
Creates a `TextDocumentIdentifier` object for the current buffer.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} number|nil: Buffer handle, defaults to current
|
||||
• {bufnr} number|nil: Buffer handle, defaults to current
|
||||
|
||||
Return: ~
|
||||
`TextDocumentIdentifier`
|
||||
@ -1714,17 +1711,17 @@ make_workspace_params({added}, {removed})
|
||||
Create the workspace params
|
||||
|
||||
Parameters: ~
|
||||
{added}
|
||||
{removed}
|
||||
• {added}
|
||||
• {removed}
|
||||
|
||||
*vim.lsp.util.open_floating_preview()*
|
||||
open_floating_preview({contents}, {syntax}, {opts})
|
||||
Shows contents in a floating window.
|
||||
|
||||
Parameters: ~
|
||||
{contents} (table) of lines to show in window
|
||||
{syntax} (string) of syntax to set for opened buffer
|
||||
{opts} (table) with optional fields (additional keys are passed
|
||||
• {contents} (table) of lines to show in window
|
||||
• {syntax} (string) of syntax to set for opened buffer
|
||||
• {opts} (table) with optional fields (additional keys are passed
|
||||
on to |nvim_open_win()|)
|
||||
• height: (number) height of floating window
|
||||
• width: (number) width of floating window
|
||||
@ -1753,7 +1750,7 @@ parse_snippet({input}) *vim.lsp.util.parse_snippet()*
|
||||
Parses snippets in a completion entry.
|
||||
|
||||
Parameters: ~
|
||||
{input} (string) unparsed snippet
|
||||
• {input} (string) unparsed snippet
|
||||
|
||||
Return: ~
|
||||
(string) parsed snippet
|
||||
@ -1767,7 +1764,7 @@ preview_location({location}, {opts}) *vim.lsp.util.preview_location()*
|
||||
definition)
|
||||
|
||||
Parameters: ~
|
||||
{location} a single `Location` or `LocationLink`
|
||||
• {location} a single `Location` or `LocationLink`
|
||||
|
||||
Return: ~
|
||||
(bufnr,winnr) buffer and window number of floating window or nil
|
||||
@ -1776,7 +1773,7 @@ rename({old_fname}, {new_fname}, {opts}) *vim.lsp.util.rename()*
|
||||
Rename old_fname to new_fname
|
||||
|
||||
Parameters: ~
|
||||
{opts} (table)
|
||||
• {opts} (table)
|
||||
|
||||
set_lines({lines}, {A}, {B}, {new_lines}) *vim.lsp.util.set_lines()*
|
||||
Replaces text in a range with new text.
|
||||
@ -1784,10 +1781,10 @@ set_lines({lines}, {A}, {B}, {new_lines}) *vim.lsp.util.set_lines()*
|
||||
CAUTION: Changes in-place!
|
||||
|
||||
Parameters: ~
|
||||
{lines} (table) Original list of strings
|
||||
{A} (table) Start position; a 2-tuple of {line, col} numbers
|
||||
{B} (table) End position; a 2-tuple of {line, col} numbers
|
||||
{new_lines} A list of strings to replace the original
|
||||
• {lines} (table) Original list of strings
|
||||
• {A} (table) Start position; a 2-tuple of {line, col} numbers
|
||||
• {B} (table) End position; a 2-tuple of {line, col} numbers
|
||||
• {new_lines} A list of strings to replace the original
|
||||
|
||||
Return: ~
|
||||
(table) The modified {lines} object
|
||||
@ -1805,8 +1802,8 @@ stylize_markdown({bufnr}, {contents}, {opts})
|
||||
`open_floating_preview` instead
|
||||
|
||||
Parameters: ~
|
||||
{contents} (table) of lines to show in window
|
||||
{opts} dictionary with optional fields
|
||||
• {contents} (table) of lines to show in window
|
||||
• {opts} dictionary with optional fields
|
||||
• height of floating window
|
||||
• width of floating window
|
||||
• wrap_at character to wrap at for computing height
|
||||
@ -1823,7 +1820,7 @@ symbols_to_items({symbols}, {bufnr}) *vim.lsp.util.symbols_to_items()*
|
||||
Converts symbols to quickfix list items.
|
||||
|
||||
Parameters: ~
|
||||
{symbols} DocumentSymbol[] or SymbolInformation[]
|
||||
• {symbols} DocumentSymbol[] or SymbolInformation[]
|
||||
|
||||
*vim.lsp.util.text_document_completion_list_to_complete_items()*
|
||||
text_document_completion_list_to_complete_items({result}, {prefix})
|
||||
@ -1831,10 +1828,10 @@ text_document_completion_list_to_complete_items({result}, {prefix})
|
||||
vim-compatible |complete-items|.
|
||||
|
||||
Parameters: ~
|
||||
{result} The result of a `textDocument/completion` call, e.g. from
|
||||
• {result} The result of a `textDocument/completion` call, e.g. from
|
||||
|vim.lsp.buf.completion()|, which may be one of
|
||||
`CompletionItem[]`, `CompletionList` or `null`
|
||||
{prefix} (string) the prefix to filter the completion items
|
||||
• {prefix} (string) the prefix to filter the completion items
|
||||
|
||||
Return: ~
|
||||
{ matches = complete-items table, incomplete = bool }
|
||||
@ -1846,7 +1843,7 @@ trim_empty_lines({lines}) *vim.lsp.util.trim_empty_lines()*
|
||||
Removes empty lines from the beginning and end.
|
||||
|
||||
Parameters: ~
|
||||
{lines} (table) list of lines to trim
|
||||
• {lines} (table) list of lines to trim
|
||||
|
||||
Return: ~
|
||||
(table) trimmed list of lines
|
||||
@ -1859,7 +1856,7 @@ try_trim_markdown_code_blocks({lines})
|
||||
CAUTION: Modifies the input in-place!
|
||||
|
||||
Parameters: ~
|
||||
{lines} (table) list of lines
|
||||
• {lines} (table) list of lines
|
||||
|
||||
Return: ~
|
||||
(string) filetype or "markdown" if it was unchanged.
|
||||
@ -1884,20 +1881,20 @@ set_format_func({handle}) *vim.lsp.log.set_format_func()*
|
||||
Sets formatting function used to format logs
|
||||
|
||||
Parameters: ~
|
||||
{handle} (function) function to apply to logging arguments, pass
|
||||
• {handle} (function) function to apply to logging arguments, pass
|
||||
vim.inspect for multi-line formatting
|
||||
|
||||
set_level({level}) *vim.lsp.log.set_level()*
|
||||
Sets the current log level.
|
||||
|
||||
Parameters: ~
|
||||
{level} (string or number) One of `vim.lsp.log.levels`
|
||||
• {level} (string or number) One of `vim.lsp.log.levels`
|
||||
|
||||
should_log({level}) *vim.lsp.log.should_log()*
|
||||
Checks whether the level is sufficient for logging.
|
||||
|
||||
Parameters: ~
|
||||
{level} (number) log level
|
||||
• {level} (number) log level
|
||||
|
||||
Return: ~
|
||||
(bool) true if would log, false if not
|
||||
@ -1911,8 +1908,8 @@ connect({host}, {port}) *vim.lsp.rpc.connect()*
|
||||
and port
|
||||
|
||||
Parameters: ~
|
||||
{host} (string)
|
||||
{port} (number)
|
||||
• {host} (string)
|
||||
• {port} (number)
|
||||
|
||||
Return: ~
|
||||
(function)
|
||||
@ -1921,7 +1918,7 @@ format_rpc_error({err}) *vim.lsp.rpc.format_rpc_error()*
|
||||
Constructs an error message from an LSP error object.
|
||||
|
||||
Parameters: ~
|
||||
{err} (table) The error object
|
||||
• {err} (table) The error object
|
||||
|
||||
Return: ~
|
||||
(string) The formatted error message
|
||||
@ -1930,8 +1927,8 @@ notify({method}, {params}) *vim.lsp.rpc.notify()*
|
||||
Sends a notification to the LSP server.
|
||||
|
||||
Parameters: ~
|
||||
{method} (string) The invoked LSP method
|
||||
{params} (table|nil): Parameters for the invoked LSP method
|
||||
• {method} (string) The invoked LSP method
|
||||
• {params} (table|nil): Parameters for the invoked LSP method
|
||||
|
||||
Return: ~
|
||||
(bool) `true` if notification could be sent, `false` if not
|
||||
@ -1941,11 +1938,11 @@ request({method}, {params}, {callback}, {notify_reply_callback})
|
||||
Sends a request to the LSP server and runs {callback} upon response.
|
||||
|
||||
Parameters: ~
|
||||
{method} (string) The invoked LSP method
|
||||
{params} (table|nil) Parameters for the invoked LSP
|
||||
• {method} (string) The invoked LSP method
|
||||
• {params} (table|nil) Parameters for the invoked LSP
|
||||
method
|
||||
{callback} (function) Callback to invoke
|
||||
{notify_reply_callback} (function|nil) Callback to invoke as soon as
|
||||
• {callback} (function) Callback to invoke
|
||||
• {notify_reply_callback} (function|nil) Callback to invoke as soon as
|
||||
a request is no longer pending
|
||||
|
||||
Return: ~
|
||||
@ -1957,10 +1954,10 @@ rpc_response_error({code}, {message}, {data})
|
||||
Creates an RPC response object/table.
|
||||
|
||||
Parameters: ~
|
||||
{code} (number) RPC error code defined in
|
||||
• {code} (number) RPC error code defined in
|
||||
`vim.lsp.protocol.ErrorCodes`
|
||||
{message} (string|nil) arbitrary message to send to server
|
||||
{data} any|nil arbitrary data to send to server
|
||||
• {message} (string|nil) arbitrary message to send to server
|
||||
• {data} any|nil arbitrary data to send to server
|
||||
|
||||
*vim.lsp.rpc.start()*
|
||||
start({cmd}, {cmd_args}, {dispatchers}, {extra_spawn_params})
|
||||
@ -1970,16 +1967,16 @@ start({cmd}, {cmd_args}, {dispatchers}, {extra_spawn_params})
|
||||
|vim.lsp.rpc.connect()|
|
||||
|
||||
Parameters: ~
|
||||
{cmd} (string) Command to start the LSP server.
|
||||
{cmd_args} (table) List of additional string arguments to
|
||||
• {cmd} (string) Command to start the LSP server.
|
||||
• {cmd_args} (table) List of additional string arguments to
|
||||
pass to {cmd}.
|
||||
{dispatchers} (table|nil) Dispatchers for LSP message types.
|
||||
• {dispatchers} (table|nil) Dispatchers for LSP message types.
|
||||
Valid dispatcher names are:
|
||||
• `"notification"`
|
||||
• `"server_request"`
|
||||
• `"on_error"`
|
||||
• `"on_exit"`
|
||||
{extra_spawn_params} (table|nil) Additional context for the LSP
|
||||
• {extra_spawn_params} (table|nil) Additional context for the LSP
|
||||
server process. May contain:
|
||||
• {cwd} (string) Working directory for the LSP
|
||||
server process
|
||||
@ -2003,14 +2000,14 @@ compute_diff({___MissingCloseParenHere___})
|
||||
Returns the range table for the difference between prev and curr lines
|
||||
|
||||
Parameters: ~
|
||||
{prev_lines} (table) list of lines
|
||||
{curr_lines} (table) list of lines
|
||||
{firstline} (number) line to begin search for first difference
|
||||
{lastline} (number) line to begin search in old_lines for last
|
||||
• {prev_lines} (table) list of lines
|
||||
• {curr_lines} (table) list of lines
|
||||
• {firstline} (number) line to begin search for first difference
|
||||
• {lastline} (number) line to begin search in old_lines for last
|
||||
difference
|
||||
{new_lastline} (number) line to begin search in new_lines for last
|
||||
• {new_lastline} (number) line to begin search in new_lines for last
|
||||
difference
|
||||
{offset_encoding} (string) encoding requested by language server
|
||||
• {offset_encoding} (string) encoding requested by language server
|
||||
|
||||
Return: ~
|
||||
(table) TextDocumentContentChangeEvent see https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#textDocumentContentChangeEvent
|
||||
@ -2029,7 +2026,7 @@ resolve_capabilities({server_capabilities})
|
||||
Creates a normalized object describing LSP server capabilities.
|
||||
|
||||
Parameters: ~
|
||||
{server_capabilities} (table) Table of capabilities supported by the
|
||||
• {server_capabilities} (table) Table of capabilities supported by the
|
||||
server
|
||||
|
||||
Return: ~
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -24,7 +24,6 @@ Type |gO| to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1 INTRODUCTION *luaref-intro*
|
||||
==============================================================================
|
||||
|
||||
Lua is an extension programming language designed to support general
|
||||
procedural programming with data description facilities. It also offers good
|
||||
@ -61,7 +60,7 @@ other words, this section describes which tokens are valid, how they can be
|
||||
combined, and what their combinations mean.
|
||||
|
||||
The language constructs will be explained using the usual extended BNF
|
||||
notation, in which { `a` } means 0 or more `a`'s, and [ `a` ] means an optional `a`.
|
||||
notation, in which `{ a }` means 0 or more `a`'s, and `[ a ]` means an optional `a`.
|
||||
|
||||
==============================================================================
|
||||
2.1 Lexical Conventions *luaref-langLexConv*
|
||||
@ -1504,7 +1503,6 @@ When you run it, it produces the following output:
|
||||
|
||||
==============================================================================
|
||||
3 THE APPLICATION PROGRAM INTERFACE *luaref-API*
|
||||
==============================================================================
|
||||
|
||||
This section describes the C API for Lua, that is, the set of C functions
|
||||
available to the host program to communicate with Lua. All API functions and
|
||||
@ -2979,7 +2977,6 @@ lua_setupvalue *lua_setupvalue()*
|
||||
|
||||
==============================================================================
|
||||
4 THE AUXILIARY LIBRARY *luaref-aux*
|
||||
==============================================================================
|
||||
|
||||
The auxiliary library provides several convenient functions to interface C
|
||||
with Lua. While the basic API provides the primitive functions for all
|
||||
@ -3511,7 +3508,6 @@ luaL_where *luaL_where()*
|
||||
|
||||
==============================================================================
|
||||
5 STANDARD LIBRARIES *luaref-Lib*
|
||||
==============================================================================
|
||||
|
||||
The standard libraries provide useful functions that are implemented directly
|
||||
through the C API. Some of these functions provide essential services to the
|
||||
@ -4064,7 +4060,7 @@ string.gmatch({s}, {pattern}) *string.gmatch()*
|
||||
end
|
||||
<
|
||||
|
||||
string.gsub({s}, {pattern}, {repl} [, {n}]) *string.gsu{b}()*
|
||||
string.gsub({s}, {pattern}, {repl} [, {n}]) *string.gsub()*
|
||||
Returns a copy of {s} in which all occurrences of the {pattern} have
|
||||
been replaced by a replacement string specified by {repl}, which may
|
||||
be a string, a table, or a function. `gsub` also returns, as its
|
||||
@ -4831,12 +4827,11 @@ debug.traceback([{thread},] [{message}] [,{level}]) *debug.traceback()*
|
||||
|
||||
==============================================================================
|
||||
A BIBLIOGRAPHY *luaref-bibliography*
|
||||
==============================================================================
|
||||
|
||||
This help file is a minor adaptation from this main reference:
|
||||
|
||||
- R. Ierusalimschy, L. H. de Figueiredo, and W. Celes.,
|
||||
"Lua: 5.1 reference manual", http://www.lua.org/manual/5.1/manual.html
|
||||
"Lua: 5.1 reference manual", https://www.lua.org/manual/5.1/manual.html
|
||||
|
||||
Lua is discussed in these references:
|
||||
|
||||
@ -4857,8 +4852,7 @@ Lua is discussed in these references:
|
||||
"Proc. of V Brazilian Symposium on Programming Languages" (2001) B-14-B-28.
|
||||
|
||||
==============================================================================
|
||||
B COPYRIGHT & LICENSES *luaref-copyright*
|
||||
==============================================================================
|
||||
B COPYRIGHT AND LICENSES *luaref-copyright*
|
||||
|
||||
This help file has the same copyright and license as Lua 5.1 and the Lua 5.1
|
||||
manual:
|
||||
@ -4875,17 +4869,16 @@ furnished to do so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
==============================================================================
|
||||
C LUAREF DOC *luarefvim* *luarefvimdoc* *luaref-help* *luaref-doc*
|
||||
==============================================================================
|
||||
|
||||
This is a Vim help file containing a reference for Lua 5.1, and it is -- with
|
||||
a few exceptions and adaptations -- a copy of the Lua 5.1 Reference Manual
|
||||
@ -4894,10 +4887,10 @@ a few exceptions and adaptations -- a copy of the Lua 5.1 Reference Manual
|
||||
|
||||
The main ideas and concepts on how to implement this reference were taken from
|
||||
Christian Habermann's CRefVim project
|
||||
(http://www.vim.org/scripts/script.php?script_id=614).
|
||||
(https://www.vim.org/scripts/script.php?script_id=614).
|
||||
|
||||
Adapted for bundled Nvim documentation; the original plugin can be found at
|
||||
http://www.vim.org/scripts/script.php?script_id=1291
|
||||
https://www.vim.org/scripts/script.php?script_id=1291
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
vi:tw=78:ts=4:ft=help:norl:et
|
||||
|
@ -97,7 +97,7 @@ used here to facilitate documenting consistent behavior:
|
||||
CONTENTS *luv-contents*
|
||||
|
||||
This documentation is mostly a retelling of the libuv API documentation
|
||||
(http://docs.libuv.org/en/v1.x/api.html) within the context of luv's Lua API.
|
||||
(https://docs.libuv.org/en/v1.x/api.html) within the context of luv's Lua API.
|
||||
Low-level implementation details and unexposed C functions and types are not
|
||||
documented here except for when they are relevant to behavior seen in the Lua
|
||||
module.
|
||||
@ -933,7 +933,7 @@ uv.async_send({async}, {...}) *uv.async_send()*
|
||||
|
||||
Poll handles are used to watch file descriptors for readability and
|
||||
writability, similar to the purpose of poll(2)
|
||||
(http://linux.die.net/man/2/poll).
|
||||
(https://linux.die.net/man/2/poll).
|
||||
|
||||
The purpose of poll handles is to enable integrating external libraries that
|
||||
rely on the event loop to signal it about the socket status changes, like
|
||||
|
@ -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(/&/,"\\&");gsub(/>/,"\\>");gsub(/</,"\\<");gsub("<22>","\\á");}
|
||||
#
|
||||
# end of sample lines by non-blank in first column
|
||||
#
|
||||
sample == "yes" && substr($0,1,4) == "<" { sample = "no"; gsub(/^</, " "); }
|
||||
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 == ">" { sample = "yes"; print ""; next; }
|
||||
substr($0,length($0)-4,5) == " >" { sample = "yes"; gsub(/ >$/, ""); }
|
||||
#
|
||||
# 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(/\|/,"\\|"); }
|
||||
/ = b / {gsub(/ b /," \\b "); }
|
||||
#
|
||||
# one letter tag
|
||||
#
|
||||
/[ ]\*.\*[ ]/ {gsub(/\*/,"ZWWZ"); }
|
||||
#
|
||||
# isolated "*"
|
||||
#
|
||||
/[ ]\*[ ]/ {gsub(/ \* /," \\* ");
|
||||
gsub(/ \* /," \\* ");
|
||||
gsub(/ \* /," \\* ");
|
||||
gsub(/ \* /," \\* "); }
|
||||
#
|
||||
# tag start
|
||||
#
|
||||
/[ ]\*[^ ]/ {gsub(/ \*/," ZWWZ");gsub(/ \*/," ZWWZ");}
|
||||
/^\*[^ ]/ {gsub(/^\*/,"ZWWZ");}
|
||||
#
|
||||
# tag end
|
||||
#
|
||||
/[^ ]\*$/ {gsub(/\*$/,"ZWWZ");}
|
||||
/[^ \/ ]\*[ ]/ {gsub(/\*/,"ZWWZ");}
|
||||
#
|
||||
# isolated "|"
|
||||
#
|
||||
/[ ]\|[ ]/ {gsub(/ \| /," \\| ");
|
||||
gsub(/ \| /," \\| ");
|
||||
gsub(/ \| /," \\| ");
|
||||
gsub(/ \| /," \\| "); }
|
||||
/'\|'/ { gsub(/'\|'/,"'\\|'"); }
|
||||
/\^V\|/ {gsub(/\^V\|/,"^V\\|");}
|
||||
/ \\\| / {gsub(/\|/,"\\|");}
|
||||
#
|
||||
# one letter pipes and "||" false pipe (digraphs)
|
||||
#
|
||||
/[ ]\|.\|[ ]/ && asciiart == "no" {gsub(/\|/,"YXXY"); }
|
||||
/^\|.\|[ ]/ {gsub(/\|/,"YXXY"); }
|
||||
/\|\|/ {gsub(/\|\|/,"\\|\\|"); }
|
||||
/^shellpipe/ {gsub(/\|/,"\\|"); }
|
||||
#
|
||||
# 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(/'"/,"\\'\\"'");}
|
||||
/"/ {gsub(/"/,"\\"");}
|
||||
/%/ {gsub(/%/,"\\%");}
|
||||
|
||||
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\"><%s></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\"><%s></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("<","");
|
||||
gsub(">","");
|
||||
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 == """ && last6of7 == """ && 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(""%s",rightchar); return; }
|
||||
printf("%s"%s",atag,rightchar);
|
||||
return;
|
||||
}
|
||||
if ( first6 == """ && last6 != """ ) {
|
||||
allow_one_char="yes";
|
||||
atag=substr(atag,7,length(atag)-6);
|
||||
if ( atag == "[" ) { printf(""%s",atag); return; }
|
||||
if ( atag == "." ) { printf(""%s",atag); return; }
|
||||
if ( atag == ":" ) { printf(""%s",atag); return; }
|
||||
if ( atag == "a" ) { printf(""%s",atag); return; }
|
||||
if ( atag == "A" ) { printf(""%s",atag); return; }
|
||||
if ( atag == "g" ) { printf(""%s",atag); return; }
|
||||
if_already();
|
||||
if ( already == "yes" ) {
|
||||
printf(""%s",atag);
|
||||
return;
|
||||
}
|
||||
printf("%s",first6);
|
||||
find_tag2();
|
||||
if ( done == "yes" ) { return; }
|
||||
printf("%s",atag);
|
||||
return;
|
||||
}
|
||||
if ( last6 == """ && first6 == """ ) {
|
||||
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 == """ && first6 == """ ) {
|
||||
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,""");
|
||||
if ( nfields > 1 ) {
|
||||
btag="'"tae[1]"'";
|
||||
btag2=tae[1];
|
||||
find_tag3();
|
||||
if (done == "yes") {
|
||||
printf(""");
|
||||
atag=stag;
|
||||
done_opt="yes";
|
||||
return;
|
||||
}
|
||||
btag=tae[1];
|
||||
btag2=tae[1];
|
||||
find_tag3();
|
||||
if (done == "yes") {
|
||||
printf(""");
|
||||
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;
|
||||
}
|
@ -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(/&/,"\\&");
|
||||
gsub(/>/,"\\>");
|
||||
gsub(/</,"\\<");
|
||||
gsub(/"/,"\\"");
|
||||
gsub(/%/,"\\%");
|
||||
|
||||
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");
|
||||
}
|
@ -334,41 +334,14 @@ Vim will automatically convert from one to another encoding in several places:
|
||||
"utf-8" (requires a gettext version that supports this).
|
||||
- When reading a Vim script where |:scriptencoding| is different from
|
||||
"utf-8".
|
||||
Most of these require the |+iconv| feature. Conversion for reading and
|
||||
writing files may also be specified with the 'charconvert' option.
|
||||
Most of these require iconv. Conversion for reading and writing files may
|
||||
also be specified with the 'charconvert' option.
|
||||
|
||||
Useful utilities for converting the charset:
|
||||
All: iconv
|
||||
GNU iconv can convert most encodings. Unicode is used as the
|
||||
intermediate encoding, which allows conversion from and to all other
|
||||
encodings. See http://www.gnu.org/directory/libiconv.html.
|
||||
|
||||
Japanese: nkf
|
||||
Nkf is "Network Kanji code conversion Filter". One of the most unique
|
||||
facility of nkf is the guess of the input Kanji code. So, you don't
|
||||
need to know what the inputting file's |charset| is. When convert to
|
||||
EUC-JP from ISO-2022-JP or Shift_JIS, simply do the following command
|
||||
in Vim:
|
||||
:%!nkf -e
|
||||
Nkf can be found at:
|
||||
http://www.sfc.wide.ad.jp/~max/FreeBSD/ports/distfiles/nkf-1.62.tar.gz
|
||||
|
||||
Chinese: hc
|
||||
Hc is "Hanzi Converter". Hc convert a GB file to a Big5 file, or Big5
|
||||
file to GB file. Hc can be found at:
|
||||
ftp://ftp.cuhk.hk/pub/chinese/ifcss/software/unix/convert/hc-30.tar.gz
|
||||
|
||||
Korean: hmconv
|
||||
Hmconv is Korean code conversion utility especially for E-mail. It can
|
||||
convert between EUC-KR and ISO-2022-KR. Hmconv can be found at:
|
||||
ftp://ftp.kaist.ac.kr/pub/hangul/code/hmconv/
|
||||
|
||||
Multilingual: lv
|
||||
Lv is a Powerful Multilingual File Viewer. And it can be worked as
|
||||
|charset| converter. Supported |charset|: ISO-2022-CN, ISO-2022-JP,
|
||||
ISO-2022-KR, EUC-CN, EUC-JP, EUC-KR, EUC-TW, UTF-7, UTF-8, ISO-8859
|
||||
series, Shift_JIS, Big5 and HZ. Lv can be found at:
|
||||
http://www.ff.iij4u.or.jp/~nrt/lv/index.html
|
||||
encodings. See https://directory.fsf.org/wiki/Libiconv.
|
||||
|
||||
|
||||
*mbyte-conversion*
|
||||
@ -404,17 +377,6 @@ is suitable for complex input, such as CJK.
|
||||
large overhead in communication, but it provides safe synchronization with
|
||||
no restrictions on applications.
|
||||
|
||||
For example, there are xwnmo and kinput2 Japanese |IM-server|, both are
|
||||
FrontEnd system. Xwnmo is distributed with Wnn (see below), kinput2 can be
|
||||
found at: ftp://ftp.sra.co.jp/pub/x11/kinput2/
|
||||
|
||||
For Chinese, there's a great XIM server named "xcin", you can input both
|
||||
Traditional and Simplified Chinese characters. And it can accept other
|
||||
locale if you make a correct input table. Xcin can be found at:
|
||||
http://cle.linux.org.tw/xcin/
|
||||
Others are scim: http://scim.freedesktop.org/ and fcitx:
|
||||
http://www.fcitx.org/
|
||||
|
||||
- Conversion Server
|
||||
*conversion-server*
|
||||
Some system needs additional server: conversion server. Most of Japanese
|
||||
|
@ -573,9 +573,7 @@ when using ":w"), therefore Vim requires using a ! after the command, e.g.:
|
||||
VirtualBinding
|
||||
|
||||
Messages like this appear when starting up. This is not a Vim problem, your
|
||||
X11 configuration is wrong. You can find a hint on how to solve this here:
|
||||
http://groups.yahoo.com/group/solarisonintel/message/12179.
|
||||
[this URL is no longer valid]
|
||||
X11 configuration is wrong.
|
||||
|
||||
*W10* >
|
||||
Warning: Changing a readonly file
|
||||
|
@ -92,27 +92,10 @@ use of "-" and "_".
|
||||
:lang mes en
|
||||
<
|
||||
|
||||
MS-WINDOWS MESSAGE TRANSLATIONS *win32-gettext*
|
||||
|
||||
If you used the self-installing .exe file, message translations should work
|
||||
already. Otherwise get the libintl.dll file if you don't have it yet:
|
||||
|
||||
http://sourceforge.net/projects/gettext
|
||||
Or:
|
||||
https://mlocati.github.io/gettext-iconv-windows/
|
||||
|
||||
This also contains tools xgettext, msgformat and others.
|
||||
|
||||
libintl.dll should be placed in same directory as (g)vim.exe, or one of the
|
||||
directories listed in the PATH environment value. Vim also looks for the
|
||||
alternate names "libintl-8.dll" and "intl.dll".
|
||||
|
||||
Message files (vim.mo) have to be placed in "$VIMRUNTIME/lang/xx/LC_MESSAGES",
|
||||
where "xx" is the abbreviation of the language (mostly two letters).
|
||||
|
||||
If you write your own translations you need to generate the .po file and
|
||||
convert it to a .mo file. You need to get the source distribution and read
|
||||
the file "src/po/README.txt".
|
||||
where "xx" is the abbreviation of the language (mostly two letters). If you
|
||||
write your own translations you need to generate the .po file and convert it
|
||||
to a .mo file.
|
||||
|
||||
To overrule the automatic choice of the language, set the $LANG variable to
|
||||
the language of your choice. use "en" to disable translations. >
|
||||
|
@ -309,7 +309,7 @@ g<Down> [count] display lines downward. |exclusive| motion.
|
||||
an operator, because it's not linewise.
|
||||
|
||||
*-*
|
||||
- <minus> [count] lines upward, on the first non-blank
|
||||
`-` <minus> [count] lines upward, on the first non-blank
|
||||
character |linewise|.
|
||||
|
||||
+ or *+*
|
||||
|
@ -1,10 +1,10 @@
|
||||
*nvim.txt* Nvim
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL
|
||||
NVIM REFERENCE MANUAL
|
||||
|
||||
|
||||
Nvim *nvim* *nvim-intro*
|
||||
Nvim *nvim* *nvim-intro*
|
||||
|
||||
Nvim is based on Vim by Bram Moolenaar.
|
||||
|
||||
@ -14,13 +14,13 @@ If you are new to Vim, try the 30-minute tutorial: >
|
||||
:Tutor<Enter>
|
||||
|
||||
Nvim is emphatically a fork of Vim, not a clone: compatibility with Vim
|
||||
(especially editor and VimL features) is maintained where possible. See
|
||||
(especially editor and Vimscript features) is maintained where possible. See
|
||||
|vim-differences| for the complete reference of differences from Vim.
|
||||
|
||||
Type |gO| to see the table of contents.
|
||||
Type |gO| to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
Transitioning from Vim *nvim-from-vim*
|
||||
Transitioning from Vim *nvim-from-vim*
|
||||
|
||||
1. To start the transition, create your |init.vim| (user config) file: >
|
||||
|
||||
@ -38,32 +38,37 @@ Transitioning from Vim *nvim-from-vim*
|
||||
See |provider-python| and |provider-clipboard| for additional software you
|
||||
might need to use some features.
|
||||
|
||||
Your Vim configuration might not be entirely Nvim-compatible.
|
||||
See |vim-differences| for the full list of changes.
|
||||
|
||||
The |'ttymouse'| option, for example, was removed from Nvim (mouse support
|
||||
should work without it). If you use the same |vimrc| for Vim and Nvim,
|
||||
consider guarding |'ttymouse'| in your configuration like so:
|
||||
Your Vim configuration might not be entirely Nvim-compatible (see
|
||||
|vim-differences|). For example the |'ttymouse'| option was removed from Nvim,
|
||||
because mouse support is always enabled if possible. If you use the same
|
||||
|vimrc| for Vim and Nvim you could guard |'ttymouse'| in your configuration
|
||||
like so:
|
||||
>
|
||||
if !has('nvim')
|
||||
set ttymouse=xterm2
|
||||
endif
|
||||
<
|
||||
Conversely, if you have Nvim specific configuration items, you could do
|
||||
this:
|
||||
|
||||
And for Nvim-specific configuration, you can do this:
|
||||
>
|
||||
if has('nvim')
|
||||
tnoremap <Esc> <C-\><C-n>
|
||||
endif
|
||||
<
|
||||
|
||||
For a more granular approach use |exists()|:
|
||||
>
|
||||
if exists(':tnoremap')
|
||||
tnoremap <Esc> <C-\><C-n>
|
||||
endif
|
||||
<
|
||||
|
||||
Now you should be able to explore Nvim more comfortably. Check |nvim-features|
|
||||
for more information.
|
||||
|
||||
*portable-config*
|
||||
Because Nvim follows the XDG |base-directories| standard, configuration on
|
||||
Windows is stored in ~/AppData instead of ~/.config. But you can still share
|
||||
the same Nvim configuration on all of your machines, by creating
|
||||
~/AppData/Local/nvim/init.vim containing just this line: >
|
||||
source ~/.config/nvim/init.vim
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
vim:tw=78:ts=8:et:ft=help:norl:
|
||||
|
@ -621,7 +621,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
by Vim with the width of glyphs in the font. Perhaps it also has
|
||||
to be set to "double" under CJK MS-Windows when the system locale is
|
||||
set to one of CJK locales. See Unicode Standard Annex #11
|
||||
(http://www.unicode.org/reports/tr11).
|
||||
(https://www.unicode.org/reports/tr11).
|
||||
|
||||
*'autochdir'* *'acd'* *'noautochdir'* *'noacd'*
|
||||
'autochdir' 'acd' boolean (default off)
|
||||
@ -3918,9 +3918,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
`:lgrepadd`, `:cfile`, `:cgetfile`, `:caddfile`, `:lfile`, `:lgetfile`,
|
||||
and `:laddfile`.
|
||||
|
||||
This would be mostly useful when you use MS-Windows. If |+iconv| is
|
||||
enabled and GNU libiconv is used, setting 'makeencoding' to "char" has
|
||||
the same effect as setting to the system locale encoding. Example: >
|
||||
This would be mostly useful when you use MS-Windows. If iconv is
|
||||
enabled, setting 'makeencoding' to "char" has the same effect as
|
||||
setting to the system locale encoding. Example: >
|
||||
:set makeencoding=char " system locale is used
|
||||
<
|
||||
*'makeprg'* *'mp'*
|
||||
@ -4571,7 +4571,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
< - A directory name may end in a ':' or '/'.
|
||||
- Environment variables are expanded |:set_env|.
|
||||
- When using |netrw.vim| URLs can be used. For example, adding
|
||||
"http://www.vim.org" will make ":find index.html" work.
|
||||
"https://www.vim.org" will make ":find index.html" work.
|
||||
- Search upwards and downwards in a directory tree using "*", "**" and
|
||||
";". See |file-searching| for info and syntax.
|
||||
- Careful with '\' characters, type two to get one in the option: >
|
||||
@ -4946,10 +4946,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
indent/ indent scripts |indent-expression|
|
||||
keymap/ key mapping files |mbyte-keymap|
|
||||
lang/ menu translations |:menutrans|
|
||||
lua/ |Lua| plugins
|
||||
menu.vim GUI menus |menu.vim|
|
||||
pack/ packages |:packadd|
|
||||
parser/ |treesitter| syntax parsers
|
||||
plugin/ plugin scripts |write-plugin|
|
||||
print/ files for printing |postscript-print-encoding|
|
||||
query/ |treesitter| queries
|
||||
rplugin/ |remote-plugin| scripts
|
||||
spell/ spell checking files |spell|
|
||||
syntax/ syntax files |mysyntaxfile|
|
||||
@ -4970,20 +4973,20 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
but are not part of the Nvim distribution. XDG_DATA_DIRS defaults
|
||||
to /usr/local/share/:/usr/share/, so system administrators are
|
||||
expected to install site plugins to /usr/share/nvim/site.
|
||||
5. Applications state home directory, for files that contain your
|
||||
session state (eg. backupdir, viewdir, undodir, etc).
|
||||
5. Session state directory, for state data such as swap, backupdir,
|
||||
viewdir, undodir, etc.
|
||||
Given by `stdpath("state")`. |$XDG_STATE_HOME|
|
||||
6. $VIMRUNTIME, for files distributed with Neovim.
|
||||
6. $VIMRUNTIME, for files distributed with Nvim.
|
||||
*after-directory*
|
||||
7, 8, 9, 10. In after/ subdirectories of 1, 2, 3 and 4, with reverse
|
||||
ordering. This is for preferences to overrule or add to the
|
||||
ordering. This is for preferences to overrule or add to the
|
||||
distributed defaults or system-wide settings (rarely needed).
|
||||
|
||||
*rtp-packages*
|
||||
"start" packages will additionally be used to search for runtime files
|
||||
after these, but package entries are not visible in `:set rtp`.
|
||||
See |runtime-search-path| for more information. "opt" packages
|
||||
will be explicitly added to &rtp when |:packadd| is used.
|
||||
*packages-runtimepath*
|
||||
"start" packages will also be searched (|runtime-search-path|) for
|
||||
runtime files after these, though such packages are not explicitly
|
||||
reported in &runtimepath. But "opt" packages are explicitly added to
|
||||
&runtimepath by |:packadd|.
|
||||
|
||||
Note that, unlike 'path', no wildcards like "**" are allowed. Normal
|
||||
wildcards are allowed, but can significantly slow down searching for
|
||||
@ -4993,18 +4996,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Example: >
|
||||
:set runtimepath=~/vimruntime,/mygroup/vim,$VIMRUNTIME
|
||||
< This will use the directory "~/vimruntime" first (containing your
|
||||
personal Vim runtime files), then "/mygroup/vim" (shared between a
|
||||
group of people) and finally "$VIMRUNTIME" (the distributed runtime
|
||||
files).
|
||||
You probably should always include $VIMRUNTIME somewhere, to use the
|
||||
distributed runtime files. You can put a directory before $VIMRUNTIME
|
||||
to find files which replace a distributed runtime files. You can put
|
||||
a directory after $VIMRUNTIME to find files which add to distributed
|
||||
runtime files.
|
||||
When Vim is started with |--clean| the home directory entries are not
|
||||
included.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
personal Nvim runtime files), then "/mygroup/vim", and finally
|
||||
"$VIMRUNTIME" (the default runtime files).
|
||||
You can put a directory before $VIMRUNTIME to find files which replace
|
||||
distributed runtime files. You can put a directory after $VIMRUNTIME
|
||||
to find files which add to distributed runtime files.
|
||||
|
||||
With |--clean| the home directory entries are not included.
|
||||
|
||||
*'scroll'* *'scr'*
|
||||
'scroll' 'scr' number (default: half the window height)
|
||||
@ -5357,7 +5355,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
To use PowerShell: >
|
||||
let &shell = executable('pwsh') ? 'pwsh' : 'powershell'
|
||||
let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
|
||||
let &shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait'
|
||||
let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
|
||||
let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
|
||||
set shellquote= shellxquote=
|
||||
|
||||
@ -6777,28 +6775,31 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'verbose'* *'vbs'*
|
||||
'verbose' 'vbs' number (default 0)
|
||||
global
|
||||
When bigger than zero, Vim will give messages about what it is doing.
|
||||
Currently, these messages are given:
|
||||
>= 1 Lua assignments to options, mappings, etc.
|
||||
>= 2 When a file is ":source"'ed and when the shada file is read or written..
|
||||
>= 3 UI info, terminal capabilities
|
||||
>= 4 Shell commands.
|
||||
>= 5 Every searched tags file and include file.
|
||||
>= 8 Files for which a group of autocommands is executed.
|
||||
>= 9 Every executed autocommand.
|
||||
>= 11 Finding items in a path
|
||||
>= 12 Every executed function.
|
||||
>= 13 When an exception is thrown, caught, finished, or discarded.
|
||||
>= 14 Anything pending in a ":finally" clause.
|
||||
>= 15 Every executed Ex command from a script (truncated at 200
|
||||
characters).
|
||||
>= 16 Every executed Ex command.
|
||||
Sets the verbosity level. Also set by |-V| and |:verbose|.
|
||||
|
||||
This option can also be set with the "-V" argument. See |-V|.
|
||||
This option is also set by the |:verbose| command.
|
||||
Tracing of options in Lua scripts is activated at level 1; Lua scripts
|
||||
are not traced with verbose=0, for performance.
|
||||
|
||||
When the 'verbosefile' option is set then the verbose messages are not
|
||||
displayed.
|
||||
If greater than or equal to a given level, Nvim produces the following
|
||||
messages:
|
||||
|
||||
Level Messages ~
|
||||
----------------------------------------------------------------------
|
||||
1 Lua assignments to options, mappings, etc.
|
||||
2 When a file is ":source"'ed, or |shada| file is read or written.
|
||||
3 UI info, terminal capabilities.
|
||||
4 Shell commands.
|
||||
5 Every searched tags file and include file.
|
||||
8 Files for which a group of autocommands is executed.
|
||||
9 Executed autocommands.
|
||||
11 Finding items in a path.
|
||||
12 Vimscript function calls.
|
||||
13 When an exception is thrown, caught, finished, or discarded.
|
||||
14 Anything pending in a ":finally" clause.
|
||||
15 Ex commands from a script (truncated at 200 characters).
|
||||
16 Ex commands.
|
||||
|
||||
If 'verbosefile' is set then the verbose messages are not displayed.
|
||||
|
||||
*'verbosefile'* *'vfile'*
|
||||
'verbosefile' 'vfile' string (default empty)
|
||||
|
@ -63,16 +63,16 @@ msgpack#is_uint({msgpack-value}) *msgpack#is_uint()*
|
||||
*msgpack#strftime*
|
||||
msgpack#strftime({format}, {msgpack-integer}) *msgpack#strftime()*
|
||||
Same as |strftime()|, but second argument may be
|
||||
|msgpack-special-dict|. Requires |+python| or |+python3| to really
|
||||
work with |msgpack-special-dict|s.
|
||||
|msgpack-special-dict|. Requires |Python| to really work with
|
||||
|msgpack-special-dict|s.
|
||||
|
||||
*msgpack#strptime*
|
||||
msgpack#strptime({format}, {time}) *msgpack#strptime()*
|
||||
Reverse of |msgpack#strftime()|: for any time and format
|
||||
|msgpack#equal|( |msgpack#strptime|(format, |msgpack#strftime|(format,
|
||||
time)), time) be true. Requires |+python| or |+python3|, without it
|
||||
only supports non-|msgpack-special-dict| nonnegative times and format
|
||||
equal to `%Y-%m-%dT%H:%M:%S`.
|
||||
time)), time) be true. Requires ||Python|, without it only supports
|
||||
non-|msgpack-special-dict| nonnegative times and format equal to
|
||||
`%Y-%m-%dT%H:%M:%S`.
|
||||
|
||||
msgpack#int_dict_to_str({msgpack-special-int}) *msgpack#int_dict_to_str()*
|
||||
Function which converts |msgpack-special-dict| integer value to
|
||||
|
@ -2782,7 +2782,7 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
history are saved (as .netrwbook and
|
||||
.netrwhist).
|
||||
Netrw uses |expand()| on the string.
|
||||
default: stdpath('data') (see |stdpath()|)
|
||||
default: stdpath("data") (see |stdpath()|)
|
||||
|
||||
*g:netrw_keepdir* =1 (default) keep current directory immune from
|
||||
the browsing directory.
|
||||
|
@ -413,7 +413,7 @@ you need to define your own PostScript font encoding vector. Details on how
|
||||
to define a font encoding vector is beyond the scope of this help file, but
|
||||
you can find details in the PostScript Language Reference Manual, 3rd Edition,
|
||||
published by Addison-Wesley and available in PDF form at
|
||||
http://www.adobe.com/. The following describes what you need to do for Vim to
|
||||
https://www.adobe.com/. The following describes what you need to do for Vim to
|
||||
locate and use your print character encoding.
|
||||
|
||||
i. Decide on a unique name for your encoding vector, one that does not clash
|
||||
@ -462,15 +462,6 @@ option allows you to specify different fonts to use when printing characters
|
||||
which are syntax highlighted with the font styles normal, italic, bold and
|
||||
bold-italic.
|
||||
|
||||
No CJK fonts are supplied with Vim. There are some free Korean, Japanese, and
|
||||
Traditional Chinese fonts available at:
|
||||
|
||||
http://examples.oreilly.com/cjkvinfo/adobe/samples/
|
||||
|
||||
You can find descriptions of the various fonts in the read me file at
|
||||
|
||||
http://examples.oreilly.de/english_examples/cjkvinfo/adobe/00README
|
||||
|
||||
Please read your printer documentation on how to install new fonts.
|
||||
|
||||
CJK fonts can be large containing several thousand glyphs, and it is not
|
||||
@ -491,7 +482,7 @@ It is possible to define your own multibyte character set although this
|
||||
should not be attempted lightly. A discussion on the process if beyond the
|
||||
scope of these help files. You can find details on CMap (character map) files
|
||||
in the document 'Adobe CMap and CIDFont Files Specification, Version 1.0',
|
||||
available from http://www.adobe.com as a PDF file.
|
||||
available from https://www.adobe.com as a PDF file.
|
||||
|
||||
==============================================================================
|
||||
6. PostScript Printing Troubleshooting *postscript-print-trouble*
|
||||
@ -548,23 +539,8 @@ Ghostscript is a PostScript and PDF interpreter that can be used to display
|
||||
and print on non-PostScript printers PostScript and PDF files. It can also
|
||||
generate PDF files from PostScript.
|
||||
|
||||
Ghostscript will run on a wide variety of platforms.
|
||||
|
||||
There are three available versions:
|
||||
|
||||
- AFPL Ghostscript (formerly Aladdin Ghostscript) which is free for
|
||||
non-commercial use. It can be obtained from:
|
||||
|
||||
http://www.cs.wisc.edu/~ghost/
|
||||
|
||||
- GNU Ghostscript which is available under the GNU General Public License. It
|
||||
can be obtained from:
|
||||
|
||||
ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/gnu/
|
||||
|
||||
- A commercial version for inclusion in commercial products.
|
||||
|
||||
Additional information on Ghostscript can also be found at:
|
||||
Ghostscript will run on a wide variety of platforms. Information on
|
||||
Ghostscript can be found at:
|
||||
|
||||
http://www.ghostscript.com/
|
||||
|
||||
@ -580,79 +556,6 @@ ends have been created. These allow easier PostScript file selection,
|
||||
previewing at different zoom levels, and printing. Check supplied
|
||||
documentation for full details.
|
||||
|
||||
X11
|
||||
|
||||
- Ghostview. Obtainable from:
|
||||
|
||||
http://www.cs.wisc.edu/~ghost/gv/
|
||||
|
||||
- gv. Derived from Ghostview. Obtainable from:
|
||||
|
||||
http://wwwthep.physik.uni-mainz.de/~plass/gv/
|
||||
|
||||
Copies (possibly not the most recent) can be found at:
|
||||
|
||||
http://www.cs.wisc.edu/~ghost/gv/
|
||||
|
||||
MS-Windows
|
||||
|
||||
- GSview. Obtainable from:
|
||||
|
||||
http://www.cs.wisc.edu/~ghost/gsview/
|
||||
|
||||
Linux
|
||||
|
||||
- GSview. Linux version of the popular MS-Windows previewer.
|
||||
Obtainable from:
|
||||
|
||||
http://www.cs.wisc.edu/~ghost/gsview/
|
||||
|
||||
- BMV. Different from Ghostview and gv in that it doesn't use X but svgalib.
|
||||
Obtainable from:
|
||||
|
||||
ftp://sunsite.unc.edu/pub/Linux/apps/graphics/viewers/svga/bmv-1.2.tgz
|
||||
|
||||
|
||||
7.3 PSUtils
|
||||
|
||||
PSUtils is a collection of utility programs for manipulating PostScript
|
||||
documents. Binary distributions are available for many platforms, as well as
|
||||
the full source. PSUtils can be found at:
|
||||
|
||||
http://knackered.org/angus/psutils
|
||||
|
||||
The utilities of interest include:
|
||||
|
||||
- psnup. Convert PS files for N-up printing.
|
||||
- psselect. Select page range and order of printing.
|
||||
- psresize. Change the page size.
|
||||
- psbook. Reorder and lay out pages ready for making a book.
|
||||
|
||||
The output of one program can be used as the input to the next, allowing for
|
||||
complex print document creation.
|
||||
|
||||
|
||||
N-UP PRINTING
|
||||
|
||||
The psnup utility takes an existing PostScript file generated from Vim and
|
||||
convert it to an n-up version. The simplest way to create a 2-up printout is
|
||||
to first create a PostScript file with: >
|
||||
|
||||
:hardcopy > test.ps
|
||||
|
||||
Then on your command line execute: >
|
||||
|
||||
psnup -n 2 test.ps final.ps
|
||||
|
||||
Note: You may get warnings from some Ghostscript previewers for files produced
|
||||
by psnup - these may safely be ignored.
|
||||
|
||||
Finally print the file final.ps to your PostScript printer with your
|
||||
platform's print command. (You will need to delete the two PostScript files
|
||||
afterwards yourself.) 'printexpr' could be modified to perform this extra
|
||||
step before printing.
|
||||
|
||||
|
||||
ALTERNATE DUPLEX PRINTING
|
||||
|
||||
It is possible to achieve a poor man's version of duplex printing using the PS
|
||||
|
@ -191,7 +191,7 @@ registers. Nvim looks for these clipboard tools, in order of priority:
|
||||
- xclip (if $DISPLAY is set)
|
||||
- xsel (if $DISPLAY is set)
|
||||
- lemonade (for SSH) https://github.com/pocke/lemonade
|
||||
- doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/
|
||||
- doitclient (for SSH) https://www.chiark.greenend.org.uk/~sgtatham/doit/
|
||||
- win32yank (Windows)
|
||||
- termux (via termux-clipboard-set, termux-clipboard-set)
|
||||
- tmux (if $TMUX is set)
|
||||
@ -236,6 +236,22 @@ The "copy" function stores a list of lines and the register type. The "paste"
|
||||
function returns the clipboard as a `[lines, regtype]` list, where `lines` is
|
||||
a list of lines and `regtype` is a register type conforming to |setreg()|.
|
||||
|
||||
*clipboard-wsl*
|
||||
For Windows WSL, try this g:clipboard definition:
|
||||
>
|
||||
let g:clipboard = {
|
||||
\ 'name': 'WslClipboard',
|
||||
\ 'copy': {
|
||||
\ '+': 'clip.exe',
|
||||
\ '*': 'clip.exe',
|
||||
\ },
|
||||
\ 'paste': {
|
||||
\ '+': 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
|
||||
\ '*': 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
|
||||
\ },
|
||||
\ 'cache_enabled': 0,
|
||||
\ }
|
||||
|
||||
==============================================================================
|
||||
Paste *provider-paste* *paste*
|
||||
|
||||
|
@ -1287,7 +1287,7 @@ PYUNIT COMPILER *compiler-pyunit*
|
||||
This is not actually a compiler, but a unit testing framework for the
|
||||
Python language. It is included into standard Python distribution
|
||||
starting from version 2.0. For older versions, you can get it from
|
||||
http://pyunit.sourceforge.net.
|
||||
https://pyunit.sourceforge.net.
|
||||
|
||||
When you run your tests with the help of the framework, possible errors
|
||||
are parsed by Vim and presented for you in quick-fix mode.
|
||||
@ -1298,8 +1298,6 @@ Useful values for the 'makeprg' options therefore are:
|
||||
setlocal makeprg=./alltests.py " Run a testsuite
|
||||
setlocal makeprg=python\ %:S " Run a single testcase
|
||||
|
||||
Also see http://vim.sourceforge.net/tip_view.php?tip_id=280.
|
||||
|
||||
|
||||
TEX COMPILER *compiler-tex*
|
||||
|
||||
@ -1823,7 +1821,7 @@ In English, that sed script:
|
||||
it as a "continuation of a multi-line message."
|
||||
|
||||
*errorformat-ant*
|
||||
For ant (http://jakarta.apache.org/) the above errorformat has to be modified
|
||||
For ant (https://jakarta.apache.org/) the above errorformat has to be modified
|
||||
to honour the leading [javac] in front of each javac output line: >
|
||||
:set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%#
|
||||
|
||||
|
@ -471,7 +471,7 @@ flag when defining the function, it is not relevant when executing it. >
|
||||
:set cpo-=C
|
||||
<
|
||||
*line-continuation-comment*
|
||||
To add a comment in between the lines start with '"\ '. Notice the space
|
||||
To add a comment in between the lines start with `'"\ '`. Notice the space
|
||||
after the backslash. Example: >
|
||||
let array = [
|
||||
"\ first entry comment
|
||||
@ -491,29 +491,40 @@ Rationale:
|
||||
continuation lines to be part of the comment. Since it was like this
|
||||
for a long time, when making it possible to add a comment halfway a
|
||||
sequence of continuation lines, it was not possible to use \", since
|
||||
that was a valid continuation line. Using '"\ ' comes closest, even
|
||||
that was a valid continuation line. Using `'"\ '` comes closest, even
|
||||
though it may look a bit weird. Requiring the space after the
|
||||
backslash is to make it very unlikely this is a normal comment line.
|
||||
|
||||
==============================================================================
|
||||
Using Vim packages *packages*
|
||||
|
||||
A Vim package is a directory that contains one or more plugins. The
|
||||
advantages over normal plugins:
|
||||
- A package can be downloaded as an archive and unpacked in its own directory.
|
||||
Thus the files are not mixed with files of other plugins. That makes it
|
||||
easy to update and remove.
|
||||
- A package can be a git, mercurial, etc. repository. That makes it really
|
||||
easy to update.
|
||||
- A package can contain multiple plugins that depend on each other.
|
||||
- A package can contain plugins that are automatically loaded on startup and
|
||||
ones that are only loaded when needed with `:packadd`.
|
||||
A Vim "package" is a directory that contains |plugin|s. Compared to normal
|
||||
plugins, a package can...
|
||||
- be downloaded as an archive and unpacked in its own directory, so the files
|
||||
are not mixed with files of other plugins.
|
||||
- be a git, mercurial, etc. repository, thus easy to update.
|
||||
- contain multiple plugins that depend on each other.
|
||||
- contain plugins that are automatically loaded on startup ("start" packages,
|
||||
located in "pack/*/start/*") and ones that are only loaded when needed with
|
||||
|:packadd| ("opt" packages, located in "pack/*/opt/*").
|
||||
|
||||
*runtime-search-path*
|
||||
Nvim searches for |:runtime| files in:
|
||||
1. all paths in 'runtimepath'
|
||||
2. all "pack/*/start/*" dirs
|
||||
|
||||
Note that the "pack/*/start/*" paths are not explicitly included in
|
||||
'runtimepath', so they will not be reported by ":set rtp" or "echo &rtp".
|
||||
Scripts can use |nvim_list_runtime_paths()| to list all used directories, and
|
||||
|nvim_get_runtime_file()| to query for specific files or sub-folders within
|
||||
the runtime path. Example: >
|
||||
" List all runtime dirs and packages with Lua paths.
|
||||
:echo nvim_get_runtime_file("lua/", v:true)
|
||||
|
||||
Using a package and loading automatically ~
|
||||
|
||||
Let's assume your Vim files are in the "~/.local/share/nvim/site" directory
|
||||
and you want to add a package from a zip archive "/tmp/foopack.zip":
|
||||
Let's assume your Nvim files are in "~/.local/share/nvim/site" and you want to
|
||||
add a package from a zip archive "/tmp/foopack.zip":
|
||||
% mkdir -p ~/.local/share/nvim/site/pack/foo
|
||||
% cd ~/.local/share/nvim/site/pack/foo
|
||||
% unzip /tmp/foopack.zip
|
||||
@ -526,28 +537,17 @@ You would now have these files under ~/.local/share/nvim/site:
|
||||
pack/foo/start/foobar/syntax/some.vim
|
||||
pack/foo/opt/foodebug/plugin/debugger.vim
|
||||
|
||||
*runtime-search-path*
|
||||
When runtime files are searched for, first all paths in 'runtimepath' are
|
||||
searched, then all "pack/*/start/*" dirs are searched. However, package entries
|
||||
are not visible in `:set rtp` or `echo &rtp`, as the final concatenated path
|
||||
would be too long and get truncated. To list all used directories, use
|
||||
|nvim_list_runtime_paths()|. In addition |nvim_get_runtime_file()| can be used
|
||||
to query for specific files or sub-folders within the runtime path. For
|
||||
instance to list all runtime dirs and packages with lua paths, use >
|
||||
On startup after processing your |config|, Nvim scans all directories in
|
||||
'packpath' for plugins in "pack/*/start/*", then loads the plugins.
|
||||
|
||||
:echo nvim_get_runtime_file("lua/", v:true)
|
||||
In the example Nvim will find "pack/foo/start/foobar/plugin/foo.vim" and load
|
||||
it.
|
||||
|
||||
<When Vim starts up, after processing your .vimrc, it scans all directories in
|
||||
'packpath' for plugins under the "pack/*/start" directory, and all the plugins
|
||||
are loaded.
|
||||
|
||||
In the example Vim will find "pack/foo/start/foobar/plugin/foo.vim" and load it.
|
||||
|
||||
If the "foobar" plugin kicks in and sets the 'filetype' to "some", Vim will
|
||||
If the "foobar" plugin kicks in and sets the 'filetype' to "some", Nvim will
|
||||
find the syntax/some.vim file, because its directory is in the runtime search
|
||||
path.
|
||||
|
||||
Vim will also load ftdetect files, if there are any.
|
||||
Nvim will also load ftdetect files, if there are any.
|
||||
|
||||
Note that the files under "pack/foo/opt" are not loaded automatically, only the
|
||||
ones under "pack/foo/start". See |pack-add| below for how the "opt" directory
|
||||
@ -589,12 +589,12 @@ This searches for "pack/*/opt/foodebug" in 'packpath' and will find
|
||||
it.
|
||||
|
||||
This could be done if some conditions are met. For example, depending on
|
||||
whether Vim supports a feature or a dependency is missing.
|
||||
whether Nvim supports a feature or a dependency is missing.
|
||||
|
||||
You can also load an optional plugin at startup, by putting this command in
|
||||
your |config|: >
|
||||
:packadd! foodebug
|
||||
The extra "!" is so that the plugin isn't loaded if Vim was started with
|
||||
The extra "!" is so that the plugin isn't loaded if Nvim was started with
|
||||
|--noplugin|.
|
||||
|
||||
It is perfectly normal for a package to only have files in the "opt"
|
||||
@ -606,7 +606,7 @@ Where to put what ~
|
||||
Since color schemes, loaded with `:colorscheme`, are found below
|
||||
"pack/*/start" and "pack/*/opt", you could put them anywhere. We recommend
|
||||
you put them below "pack/*/opt", for example
|
||||
".vim/pack/mycolors/opt/dark/colors/very_dark.vim".
|
||||
"~/.config/nvim/pack/mycolors/opt/dark/colors/very_dark.vim".
|
||||
|
||||
Filetype plugins should go under "pack/*/start", so that they are always
|
||||
found. Unless you have more than one plugin for a file type and want to
|
||||
@ -684,8 +684,8 @@ found automatically. Your package would have these files:
|
||||
< pack/foo/start/lib/autoload/foolib.vim >
|
||||
func foolib#getit()
|
||||
|
||||
This works, because start packages will be used to look for autoload files,
|
||||
when sourcing the plugins.
|
||||
This works, because start packages will be searchd for autoload files, when
|
||||
sourcing the plugins.
|
||||
|
||||
==============================================================================
|
||||
Debugging scripts *debug-scripts*
|
||||
|
@ -45,7 +45,7 @@ If you wish to use messages, help files, menus and other items translated to
|
||||
Russian, you will need to install the RuVim Language Pack, available in
|
||||
different codepages from
|
||||
|
||||
http://www.sourceforge.net/projects/ruvim/
|
||||
https://www.sourceforge.net/projects/ruvim/
|
||||
|
||||
After downloading an archive from RuVim project, unpack it into your
|
||||
$VIMRUNTIME directory. We recommend using UTF-8 archive.
|
||||
|
@ -482,7 +482,7 @@ You can create a Vim spell file from the .aff and .dic files that Myspell
|
||||
uses. Myspell is used by OpenOffice.org and Mozilla. The OpenOffice .oxt
|
||||
files are zip files which contain the .aff and .dic files. You should be able
|
||||
to find them here:
|
||||
http://extensions.services.openoffice.org/dictionary
|
||||
https://extensions.services.openoffice.org/dictionary
|
||||
The older, OpenOffice 2 files may be used if this doesn't work:
|
||||
http://wiki.services.openoffice.org/wiki/Dictionaries
|
||||
You can also use a plain word list. The results are the same, the choice
|
||||
@ -764,13 +764,13 @@ them before the Vim word list is made. The tools for this can be found in the
|
||||
The format for the affix and word list files is based on what Myspell uses
|
||||
(the spell checker of Mozilla and OpenOffice.org). A description can be found
|
||||
here:
|
||||
http://lingucomponent.openoffice.org/affix.readme ~
|
||||
https://lingucomponent.openoffice.org/affix.readme ~
|
||||
Note that affixes are case sensitive, this isn't obvious from the description.
|
||||
|
||||
Vim supports quite a few extras. They are described below |spell-affix-vim|.
|
||||
Attempts have been made to keep this compatible with other spell checkers, so
|
||||
that the same files can often be used. One other project that offers more
|
||||
than Myspell is Hunspell ( http://hunspell.sf.net ).
|
||||
than Myspell is Hunspell ( https://hunspell.github.io ).
|
||||
|
||||
|
||||
WORD LIST FORMAT *spell-dic-format*
|
||||
@ -886,7 +886,7 @@ right encoding.
|
||||
*spell-AUTHOR* *spell-EMAIL* *spell-COPYRIGHT*
|
||||
NAME Name of the language
|
||||
VERSION 1.0.1 with fixes
|
||||
HOME http://www.myhome.eu
|
||||
HOME https://www.example.com
|
||||
AUTHOR John Doe
|
||||
EMAIL john AT Doe DOT net
|
||||
COPYRIGHT LGPL
|
||||
|
@ -35,7 +35,7 @@ filename One or more file names. The first one will be the current
|
||||
no other options or "+command" argument can follow.
|
||||
|
||||
*--*
|
||||
- Alias for stdin (standard input).
|
||||
`-` Alias for stdin (standard input).
|
||||
Example: >
|
||||
echo text | nvim - file
|
||||
< "text" is read into buffer 1, "file" is opened as buffer 2.
|
||||
@ -143,12 +143,11 @@ argument.
|
||||
these commands, independently from "-c" commands.
|
||||
|
||||
*-S*
|
||||
-S {file} The {file} will be sourced after the first file has been read.
|
||||
This is an easy way to do the equivalent of: >
|
||||
-S {file} Vimscript or Lua (".lua") {file} will be |:source|d after the
|
||||
first file has been read. Equivalent to: >
|
||||
-c "source {file}"
|
||||
< It can be mixed with "-c" arguments and repeated like "-c".
|
||||
The limit of 10 "-c" arguments applies here as well.
|
||||
{file} cannot start with a "-".
|
||||
< Can be repeated like "-c", subject to the same limit of 10
|
||||
"-c" arguments. {file} cannot start with a "-".
|
||||
|
||||
-S Works like "-S Session.vim". Only when used as the last
|
||||
argument or when another "-" option follows.
|
||||
@ -203,13 +202,14 @@ argument.
|
||||
send commands. >
|
||||
printf "foo\n" | nvim -Es +"%print"
|
||||
|
||||
< Output of these commands is displayed (to stdout):
|
||||
:print
|
||||
< These commands display on stdout:
|
||||
:list
|
||||
:number
|
||||
:set (to display option values)
|
||||
When 'verbose' is set messages are printed to stderr. >
|
||||
echo foo | nvim -V1 -es
|
||||
:print
|
||||
:set
|
||||
With |:verbose| or 'verbose', other commands display on stderr: >
|
||||
nvim -es +":verbose echo 'foo'"
|
||||
nvim -V1 -es +foo
|
||||
|
||||
< User |config| is skipped (unless given with |-u|).
|
||||
Swap file is skipped (like |-n|).
|
||||
@ -401,18 +401,20 @@ accordingly, proceeding as follows:
|
||||
The |-V| argument can be used to display or log what happens next,
|
||||
useful for debugging the initializations.
|
||||
|
||||
3. Wait for UI to connect.
|
||||
3. Start a server (unless |--listen| was given) and set |v:servername|.
|
||||
|
||||
4. Wait for UI to connect.
|
||||
Nvim started with |--embed| waits for the UI to connect before
|
||||
proceeding to load user configuration.
|
||||
|
||||
4. Setup |default-mappings| and |default-autocmds|. Create |popup-menu|.
|
||||
5. Setup |default-mappings| and |default-autocmds|. Create |popup-menu|.
|
||||
|
||||
5. Enable filetype and indent plugins.
|
||||
6. Enable filetype and indent plugins.
|
||||
This does the same as the command: >
|
||||
:runtime! ftplugin.vim indent.vim
|
||||
< Skipped if the "-u NONE" command line argument was given.
|
||||
|
||||
6. Load user config (execute Ex commands from files, environment, …).
|
||||
7. Load user config (execute Ex commands from files, environment, …).
|
||||
$VIMINIT environment variable is read as one Ex command line (separate
|
||||
multiple commands with '|' or <NL>).
|
||||
*config* *init.vim* *init.lua* *vimrc* *exrc*
|
||||
@ -443,9 +445,9 @@ accordingly, proceeding as follows:
|
||||
*VIMINIT* *EXINIT* *$MYVIMRC*
|
||||
b. Locations searched for initializations, in order of preference:
|
||||
- $VIMINIT environment variable (Ex command line).
|
||||
- User |config|: $XDG_CONFIG_HOME/nvim/init.vim.
|
||||
- Other config: {dir}/nvim/init.vim where {dir} is any directory
|
||||
in $XDG_CONFIG_DIRS.
|
||||
- User |config|: $XDG_CONFIG_HOME/nvim/init.vim (or init.lua).
|
||||
- Other config: {dir}/nvim/init.vim (or init.lua) where {dir} is any
|
||||
directory in $XDG_CONFIG_DIRS.
|
||||
- $EXINIT environment variable (Ex command line).
|
||||
|$MYVIMRC| is set to the first valid location unless it was already
|
||||
set or when using $VIMINIT.
|
||||
@ -456,19 +458,19 @@ accordingly, proceeding as follows:
|
||||
- The file ".nvimrc"
|
||||
- The file ".exrc"
|
||||
|
||||
7. Enable filetype detection.
|
||||
8. Enable filetype detection.
|
||||
This does the same as the command: >
|
||||
:runtime! filetype.lua filetype.vim
|
||||
< Skipped if ":filetype off" was called or if the "-u NONE" command line
|
||||
argument was given.
|
||||
|
||||
8. Enable syntax highlighting.
|
||||
9. Enable syntax highlighting.
|
||||
This does the same as the command: >
|
||||
:runtime! syntax/syntax.vim
|
||||
< Skipped if ":syntax off" was called or if the "-u NONE" command
|
||||
line argument was given.
|
||||
|
||||
9. Load the plugin scripts. *load-plugins*
|
||||
10. Load the plugin scripts. *load-plugins*
|
||||
This does the same as the command: >
|
||||
:runtime! plugin/**/*.vim
|
||||
:runtime! plugin/**/*.lua
|
||||
@ -498,21 +500,21 @@ accordingly, proceeding as follows:
|
||||
if packages have been found, but that should not add a directory
|
||||
ending in "after".
|
||||
|
||||
10. Set 'shellpipe' and 'shellredir'
|
||||
11. Set 'shellpipe' and 'shellredir'
|
||||
The 'shellpipe' and 'shellredir' options are set according to the
|
||||
value of the 'shell' option, unless they have been set before.
|
||||
This means that Nvim will figure out the values of 'shellpipe' and
|
||||
'shellredir' for you, unless you have set them yourself.
|
||||
|
||||
11. Set 'updatecount' to zero, if "-n" command argument used
|
||||
12. Set 'updatecount' to zero, if "-n" command argument used
|
||||
|
||||
12. Set binary options if the |-b| flag was given.
|
||||
13. Set binary options if the |-b| flag was given.
|
||||
|
||||
13. Read the |shada-file|.
|
||||
14. Read the |shada-file|.
|
||||
|
||||
14. Read the quickfix file if the |-q| flag was given, or exit on failure.
|
||||
15. Read the quickfix file if the |-q| flag was given, or exit on failure.
|
||||
|
||||
15. Open all windows
|
||||
16. Open all windows
|
||||
When the |-o| flag was given, windows will be opened (but not
|
||||
displayed yet).
|
||||
When the |-p| flag was given, tab pages will be created (but not
|
||||
@ -522,7 +524,7 @@ accordingly, proceeding as follows:
|
||||
Buffers for all windows will be loaded, without triggering |BufAdd|
|
||||
autocommands.
|
||||
|
||||
16. Execute startup commands
|
||||
17. Execute startup commands
|
||||
If a |-t| flag was given, the tag is jumped to.
|
||||
Commands given with |-c| and |+cmd| are executed.
|
||||
The starting flag is reset, has("vim_starting") will now return zero.
|
||||
@ -1182,7 +1184,7 @@ exactly four MessagePack objects:
|
||||
encoding Binary, effective 'encoding' value.
|
||||
max_kbyte Integer, effective |shada-s| limit value.
|
||||
pid Integer, instance process ID.
|
||||
* It is allowed to have any number of
|
||||
`*` It is allowed to have any number of
|
||||
additional keys with any data.
|
||||
2 (SearchPattern) Map containing data describing last used search or
|
||||
substitute pattern. Normally ShaDa file contains two
|
||||
@ -1213,7 +1215,7 @@ exactly four MessagePack objects:
|
||||
sp Binary N/A Actual pattern. Required.
|
||||
sb Boolean false True if search direction is
|
||||
backward.
|
||||
* any none Other keys are allowed for
|
||||
`*` any none Other keys are allowed for
|
||||
compatibility reasons, see
|
||||
|shada-compatibility|.
|
||||
3 (SubString) Array containing last |:substitute| replacement string.
|
||||
@ -1284,7 +1286,7 @@ exactly four MessagePack objects:
|
||||
GlobalMark and LocalMark
|
||||
entries.
|
||||
f Binary N/A File name. Required.
|
||||
* any none Other keys are allowed for
|
||||
`*` any none Other keys are allowed for
|
||||
compatibility reasons, see
|
||||
|shada-compatibility|.
|
||||
9 (BufferList) Array containing maps. Each map in the array
|
||||
@ -1294,10 +1296,10 @@ exactly four MessagePack objects:
|
||||
greater then zero.
|
||||
c UInteger 0 Position column number.
|
||||
f Binary N/A File name. Required.
|
||||
* any none Other keys are allowed for
|
||||
`*` any none Other keys are allowed for
|
||||
compatibility reasons, see
|
||||
|shada-compatibility|.
|
||||
* (Unknown) Any other entry type is allowed for compatibility
|
||||
`*` (Unknown) Any other entry type is allowed for compatibility
|
||||
reasons, see |shada-compatibility|.
|
||||
|
||||
*E575* *E576*
|
||||
@ -1357,7 +1359,7 @@ LOG FILE *$NVIM_LOG_FILE* *E5430*
|
||||
Besides 'debug' and 'verbose', Nvim keeps a general log file for internal
|
||||
debugging, plugins and RPC clients. >
|
||||
:echo $NVIM_LOG_FILE
|
||||
By default, the file is located at stdpath('log')/log unless that path
|
||||
By default, the file is located at stdpath("log")/log unless that path
|
||||
is inaccessible or if $NVIM_LOG_FILE was set before |startup|.
|
||||
|
||||
|
||||
|
@ -687,13 +687,13 @@ Automatic detection works for the encodings mentioned specifically by name in
|
||||
|encoding-names|, but TOhtml will only automatically use those encodings with
|
||||
wide browser support. However, you can override this to support specific
|
||||
encodings that may not be automatically detected by default (see options
|
||||
below). See http://www.iana.org/assignments/character-sets for the IANA names.
|
||||
below). See https://www.iana.org/assignments/character-sets for the IANA names.
|
||||
|
||||
Note: By default all Unicode encodings are converted to UTF-8 with no BOM in
|
||||
the generated HTML, as recommended by W3C:
|
||||
|
||||
http://www.w3.org/International/questions/qa-choosing-encodings
|
||||
http://www.w3.org/International/questions/qa-byte-order-mark
|
||||
https://www.w3.org/International/questions/qa-choosing-encodings
|
||||
https://www.w3.org/International/questions/qa-byte-order-mark
|
||||
|
||||
*g:html_use_encoding*
|
||||
Default: none, uses IANA name for current 'fileencoding' as above.
|
||||
@ -832,7 +832,7 @@ files are included:
|
||||
asm68k Motorola 680x0 assembly
|
||||
asmh8300 Hitachi H-8300 version of GNU assembly
|
||||
ia64 Intel Itanium 64
|
||||
fasm Flat assembly (http://flatassembler.net)
|
||||
fasm Flat assembly (https://flatassembler.net)
|
||||
masm Microsoft assembly (probably works for any 80x86)
|
||||
nasm Netwide assembly
|
||||
tasm Turbo Assembly (with opcodes 80x86 up to Pentium, and
|
||||
@ -1393,9 +1393,9 @@ Two syntax highlighting files exist for Euphoria. One for Euphoria
|
||||
version 3.1.1, which is the default syntax highlighting file, and one for
|
||||
Euphoria version 4.0.5 or later.
|
||||
|
||||
Euphoria version 3.1.1 (http://www.rapideuphoria.com/) is still necessary
|
||||
Euphoria version 3.1.1 (https://www.rapideuphoria.com/) is still necessary
|
||||
for developing applications for the DOS platform, which Euphoria version 4
|
||||
(http://www.openeuphoria.org/) does not support.
|
||||
(https://www.openeuphoria.org/) does not support.
|
||||
|
||||
The following file extensions are auto-detected as Euphoria file type:
|
||||
|
||||
@ -1452,7 +1452,7 @@ Elixir.
|
||||
|
||||
FLEXWIKI *flexwiki.vim* *ft-flexwiki-syntax*
|
||||
|
||||
FlexWiki is an ASP.NET-based wiki package available at http://www.flexwiki.com
|
||||
FlexWiki is an ASP.NET-based wiki package available at https://www.flexwiki.com
|
||||
NOTE: This site currently doesn't work, on Wikipedia is mentioned that
|
||||
development stopped in 2009.
|
||||
|
||||
@ -1808,7 +1808,7 @@ are read during initialization) >
|
||||
:let html_my_rendering=1
|
||||
|
||||
If you'd like to see an example download mysyntax.vim at
|
||||
http://www.fleiner.com/vim/download.html
|
||||
https://www.fleiner.com/vim/download.html
|
||||
|
||||
You can also disable this rendering by adding the following line to your
|
||||
vimrc file: >
|
||||
@ -1936,7 +1936,7 @@ highlight them use: >
|
||||
:let java_highlight_java_lang_ids=1
|
||||
|
||||
You can also highlight identifiers of most standard Java packages if you
|
||||
download the javaid.vim script at http://www.fleiner.com/vim/download.html.
|
||||
download the javaid.vim script at https://www.fleiner.com/vim/download.html.
|
||||
If you prefer to only highlight identifiers of a certain package, say java.io
|
||||
use the following: >
|
||||
:let java_highlight_java_io=1
|
||||
@ -3353,13 +3353,11 @@ of specialized LaTeX commands, syntax, and fonts. If you're using such a
|
||||
package you'll often wish that the distributed syntax/tex.vim would support
|
||||
it. However, clearly this is impractical. So please consider using the
|
||||
techniques in |mysyntaxfile-add| to extend or modify the highlighting provided
|
||||
by syntax/tex.vim. Please consider uploading any extensions that you write,
|
||||
which typically would go in $HOME/after/syntax/tex/[pkgname].vim, to
|
||||
http://vim.sf.net/.
|
||||
by syntax/tex.vim.
|
||||
|
||||
I've included some support for various popular packages on my website: >
|
||||
|
||||
http://www.drchip.org/astronaut/vim/index.html#LATEXPKGS
|
||||
https://www.drchip.org/astronaut/vim/index.html#LATEXPKGS
|
||||
<
|
||||
The syntax files there go into your .../after/syntax/tex/ directory.
|
||||
|
||||
@ -5397,8 +5395,7 @@ WARNING: The longer the tags file, the slower this will be, and the more
|
||||
memory Vim will consume.
|
||||
|
||||
Only highlighting typedefs, unions and structs can be done too. For this you
|
||||
must use Universal Ctags (found at https://ctags.io) or Exuberant ctags (found
|
||||
at http://ctags.sf.net).
|
||||
must use Universal Ctags (https://ctags.io) or Exuberant ctags.
|
||||
|
||||
Put these lines in your Makefile:
|
||||
|
||||
|
@ -514,18 +514,13 @@ ctags As found on most Unix systems. Only supports C. Only
|
||||
universal ctags A maintained version of ctags based on exuberant
|
||||
ctags. See https://ctags.io.
|
||||
*Exuberant_ctags*
|
||||
exuberant ctags This is a very good one. It works for C, C++, Java,
|
||||
Fortran, Eiffel and others. It can generate tags for
|
||||
many items. See http://ctags.sourceforge.net.
|
||||
No new version since 2009.
|
||||
exuberant ctags Works for C, C++, Java, Fortran, Eiffel and others.
|
||||
See https://ctags.sourceforge.net. No new version
|
||||
since 2009.
|
||||
JTags For Java, in Java. It can be found at
|
||||
http://www.fleiner.com/jtags/.
|
||||
https://www.fleiner.com/jtags/.
|
||||
ptags.py For Python, in Python. Found in your Python source
|
||||
directory at Tools/scripts/ptags.py.
|
||||
ptags For Perl, in Perl. It can be found at
|
||||
http://www.eleves.ens.fr:8080/home/nthiery/Tags/.
|
||||
gnatxref For Ada. See http://www.gnuada.org/. gnatxref is
|
||||
part of the gnat package.
|
||||
|
||||
|
||||
The lines in the tags file must have one of these two formats:
|
||||
|
@ -29,7 +29,7 @@ whole.
|
||||
Building your own terminfo is usually as simple as running this as
|
||||
a non-superuser:
|
||||
>
|
||||
curl -LO http://invisible-island.net/datafiles/current/terminfo.src.gz
|
||||
curl -LO https://invisible-island.net/datafiles/current/terminfo.src.gz
|
||||
gunzip terminfo.src.gz
|
||||
tic terminfo.src
|
||||
<
|
||||
|
@ -134,7 +134,7 @@ assert_match({pattern}, {actual} [, {msg}])
|
||||
When {pattern} does not match {actual} an error message is
|
||||
added to |v:errors|. Also see |assert-return|.
|
||||
|
||||
{pattern} is used as with |=~|: The matching is always done
|
||||
{pattern} is used as with |expr-=~|: The matching is always done
|
||||
like 'magic' was set and 'cpoptions' is empty, no matter what
|
||||
the actual value of 'magic' or 'cpoptions' is.
|
||||
|
||||
|
@ -8,7 +8,7 @@ Tips and ideas for using Vim *tips*
|
||||
|
||||
These are just a few that we thought would be helpful for many users.
|
||||
You can find many more tips on the wiki. The URL can be found on
|
||||
http://www.vim.org
|
||||
https://www.vim.org
|
||||
|
||||
Don't forget to browse the user manual, it also contains lots of useful tips
|
||||
|usr_toc.txt|.
|
||||
|
@ -239,7 +239,7 @@ The following predicates are built in:
|
||||
`contains?` *treesitter-predicate-contains?*
|
||||
Match a string against parts of the text corresponding to a node: >
|
||||
((identifier) @foo (#contains? @foo "foo"))
|
||||
((identifier) @foo-bar (#contains @foo-bar "foo" "bar"))
|
||||
((identifier) @foo-bar (#contains? @foo-bar "foo" "bar"))
|
||||
<
|
||||
`any-of?` *treesitter-predicate-any-of?*
|
||||
Match any of the given strings against the text corresponding to
|
||||
@ -371,6 +371,59 @@ instance, to highlight comments differently per language: >
|
||||
hi @comment.c guifg=Blue
|
||||
hi @comment.lua @guifg=DarkBlue
|
||||
hi link @comment.doc.java String
|
||||
<
|
||||
The following captures are linked by default to standard |group-name|s:
|
||||
>
|
||||
@text.literal Comment
|
||||
@text.reference Identifier
|
||||
@text.title Title
|
||||
@text.uri Underlined
|
||||
@text.underline Underlined
|
||||
@text.todo Todo
|
||||
|
||||
@comment Comment
|
||||
@punctuation Delimiter
|
||||
|
||||
@constant Constant
|
||||
@constant.builtin Special
|
||||
@constant.macro Define
|
||||
@define Define
|
||||
@macro Macro
|
||||
@string String
|
||||
@string.escape SpecialChar
|
||||
@string.special SpecialChar
|
||||
@character Character
|
||||
@character.special SpecialChar
|
||||
@number Number
|
||||
@boolean Boolean
|
||||
@float Float
|
||||
|
||||
@function Function
|
||||
@function.builtin Special
|
||||
@function.macro Macro
|
||||
@parameter Identifier
|
||||
@method Function
|
||||
@field Identifier
|
||||
@property Identifier
|
||||
@constructor Special
|
||||
|
||||
@conditional Conditional
|
||||
@repeat Repeat
|
||||
@label Label
|
||||
@operator Operator
|
||||
@keyword Keyword
|
||||
@exception Exception
|
||||
|
||||
@variable Identifier
|
||||
@type Type
|
||||
@type.definition Typedef
|
||||
@storageclass StorageClass
|
||||
@structure Structure
|
||||
@namespace Identifier
|
||||
@include Include
|
||||
@preproc PreProc
|
||||
@debug Debug
|
||||
@tag Tag
|
||||
<
|
||||
*treesitter-highlight-spell*
|
||||
The special `@spell` capture can be used to indicate that a node should be
|
||||
@ -379,6 +432,9 @@ capture marks comments as to be checked: >
|
||||
|
||||
(comment) @spell
|
||||
<
|
||||
|
||||
There is also `@nospell` which disables spellchecking regions with `@spell`.
|
||||
|
||||
*treesitter-highlight-conceal*
|
||||
Treesitter highlighting supports |conceal| via the `conceal` metadata. By
|
||||
convention, nodes to be concealed are captured as `@conceal`, but any capture
|
||||
@ -429,7 +485,7 @@ get_captures_at_cursor({winnr}) *get_captures_at_cursor()*
|
||||
Returns a list of highlight capture names under the cursor
|
||||
|
||||
Parameters: ~
|
||||
{winnr} (number|nil) Window handle or 0 for current window (default)
|
||||
• {winnr} (number|nil) Window handle or 0 for current window (default)
|
||||
|
||||
Return: ~
|
||||
string[] List of capture names
|
||||
@ -442,9 +498,9 @@ get_captures_at_pos({bufnr}, {row}, {col}) *get_captures_at_pos()*
|
||||
if none are defined).
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number) Buffer number (0 for current buffer)
|
||||
{row} (number) Position row
|
||||
{col} (number) Position column
|
||||
• {bufnr} (number) Buffer number (0 for current buffer)
|
||||
• {row} (number) Position row
|
||||
• {col} (number) Position column
|
||||
|
||||
Return: ~
|
||||
table[] List of captures `{ capture = "capture name", metadata = { ...
|
||||
@ -454,7 +510,7 @@ get_node_at_cursor({winnr}) *get_node_at_cursor()*
|
||||
Returns the smallest named node under the cursor
|
||||
|
||||
Parameters: ~
|
||||
{winnr} (number|nil) Window handle or 0 for current window (default)
|
||||
• {winnr} (number|nil) Window handle or 0 for current window (default)
|
||||
|
||||
Return: ~
|
||||
(string) Name of node under the cursor
|
||||
@ -463,10 +519,10 @@ get_node_at_pos({bufnr}, {row}, {col}, {opts}) *get_node_at_pos()*
|
||||
Returns the smallest named node at the given position
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number) Buffer number (0 for current buffer)
|
||||
{row} (number) Position row
|
||||
{col} (number) Position column
|
||||
{opts} (table) Optional keyword arguments:
|
||||
• {bufnr} (number) Buffer number (0 for current buffer)
|
||||
• {row} (number) Position row
|
||||
• {col} (number) Position column
|
||||
• {opts} (table) Optional keyword arguments:
|
||||
• ignore_injections boolean Ignore injected languages
|
||||
(default true)
|
||||
|
||||
@ -477,7 +533,7 @@ get_node_range({node_or_range}) *get_node_range()*
|
||||
Returns the node's range or an unpacked range table
|
||||
|
||||
Parameters: ~
|
||||
{node_or_range} (userdata|table) |tsnode| or table of positions
|
||||
• {node_or_range} (userdata|table) |tsnode| or table of positions
|
||||
|
||||
Return: ~
|
||||
(table) `{ start_row, start_col, end_row, end_col }`
|
||||
@ -489,11 +545,11 @@ get_parser({bufnr}, {lang}, {opts}) *get_parser()*
|
||||
If needed, this will create the parser.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number|nil) Buffer the parser should be tied to (default:
|
||||
• {bufnr} (number|nil) Buffer the parser should be tied to (default:
|
||||
current buffer)
|
||||
{lang} (string|nil) Filetype of this parser (default: buffer
|
||||
• {lang} (string|nil) Filetype of this parser (default: buffer
|
||||
filetype)
|
||||
{opts} (table|nil) Options to pass to the created language tree
|
||||
• {opts} (table|nil) Options to pass to the created language tree
|
||||
|
||||
Return: ~
|
||||
LanguageTree |LanguageTree| object to use for parsing
|
||||
@ -502,9 +558,9 @@ get_string_parser({str}, {lang}, {opts}) *get_string_parser()*
|
||||
Returns a string parser
|
||||
|
||||
Parameters: ~
|
||||
{str} (string) Text to parse
|
||||
{lang} (string) Language of this string
|
||||
{opts} (table|nil) Options to pass to the created language tree
|
||||
• {str} (string) Text to parse
|
||||
• {lang} (string) Language of this string
|
||||
• {opts} (table|nil) Options to pass to the created language tree
|
||||
|
||||
Return: ~
|
||||
LanguageTree |LanguageTree| object to use for parsing
|
||||
@ -513,8 +569,8 @@ is_ancestor({dest}, {source}) *is_ancestor()*
|
||||
Determines whether a node is the ancestor of another
|
||||
|
||||
Parameters: ~
|
||||
{dest} userdata Possible ancestor |tsnode|
|
||||
{source} userdata Possible descendant |tsnode|
|
||||
• {dest} userdata Possible ancestor |tsnode|
|
||||
• {source} userdata Possible descendant |tsnode|
|
||||
|
||||
Return: ~
|
||||
(boolean) True if {dest} is an ancestor of {source}
|
||||
@ -523,9 +579,9 @@ is_in_node_range({node}, {line}, {col}) *is_in_node_range()*
|
||||
Determines whether (line, col) position is in node range
|
||||
|
||||
Parameters: ~
|
||||
{node} userdata |tsnode| defining the range
|
||||
{line} (number) Line (0-based)
|
||||
{col} (number) Column (0-based)
|
||||
• {node} userdata |tsnode| defining the range
|
||||
• {line} (number) Line (0-based)
|
||||
• {col} (number) Column (0-based)
|
||||
|
||||
Return: ~
|
||||
(boolean) True if the position is in node range
|
||||
@ -534,8 +590,8 @@ node_contains({node}, {range}) *node_contains()*
|
||||
Determines if a node contains a range
|
||||
|
||||
Parameters: ~
|
||||
{node} userdata |tsnode|
|
||||
{range} (table)
|
||||
• {node} userdata |tsnode|
|
||||
• {range} (table)
|
||||
|
||||
Return: ~
|
||||
(boolean) True if the {node} contains the {range}
|
||||
@ -560,16 +616,16 @@ start({bufnr}, {lang}) *start()*
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number|nil) Buffer to be highlighted (default: current
|
||||
• {bufnr} (number|nil) Buffer to be highlighted (default: current
|
||||
buffer)
|
||||
{lang} (string|nil) Language of the parser (default: buffer
|
||||
• {lang} (string|nil) Language of the parser (default: buffer
|
||||
filetype)
|
||||
|
||||
stop({bufnr}) *stop()*
|
||||
Stops treesitter highlighting for a buffer
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} (number|nil) Buffer to stop highlighting (default: current
|
||||
• {bufnr} (number|nil) Buffer to stop highlighting (default: current
|
||||
buffer)
|
||||
|
||||
|
||||
@ -583,7 +639,7 @@ inspect_language({lang}) *inspect_language()*
|
||||
names, ...
|
||||
|
||||
Parameters: ~
|
||||
{lang} (string) Language
|
||||
• {lang} (string) Language
|
||||
|
||||
Return: ~
|
||||
(table)
|
||||
@ -596,11 +652,11 @@ require_language({lang}, {path}, {silent}, {symbol_name})
|
||||
{path}
|
||||
|
||||
Parameters: ~
|
||||
{lang} (string) Language the parser should parse
|
||||
{path} (string|nil) Optional path the parser is located at
|
||||
{silent} (boolean|nil) Don't throw an error if language not
|
||||
• {lang} (string) Language the parser should parse
|
||||
• {path} (string|nil) Optional path the parser is located at
|
||||
• {silent} (boolean|nil) Don't throw an error if language not
|
||||
found
|
||||
{symbol_name} (string|nil) Internal symbol name for the language to
|
||||
• {symbol_name} (string|nil) Internal symbol name for the language to
|
||||
load
|
||||
|
||||
Return: ~
|
||||
@ -619,26 +675,26 @@ add_directive({name}, {handler}, {force}) *add_directive()*
|
||||
`metadata[capture_id].key = value`
|
||||
|
||||
Parameters: ~
|
||||
{name} (string) Name of the directive, without leading #
|
||||
{handler} function(match:string, pattern:string, bufnr:number,
|
||||
• {name} (string) Name of the directive, without leading #
|
||||
• {handler} function(match:string, pattern:string, bufnr:number,
|
||||
predicate:function, metadata:table)
|
||||
|
||||
add_predicate({name}, {handler}, {force}) *add_predicate()*
|
||||
Adds a new predicate to be used in queries
|
||||
|
||||
Parameters: ~
|
||||
{name} (string) Name of the predicate, without leading #
|
||||
{handler} function(match:string, pattern:string, bufnr:number,
|
||||
• {name} (string) Name of the predicate, without leading #
|
||||
• {handler} function(match:string, pattern:string, bufnr:number,
|
||||
predicate:function)
|
||||
|
||||
get_node_text({node}, {source}, {opts}) *get_node_text()*
|
||||
Gets the text corresponding to a given node
|
||||
|
||||
Parameters: ~
|
||||
{node} userdata |tsnode|
|
||||
{source} (number|string) Buffer or string from which the {node} is
|
||||
• {node} userdata |tsnode|
|
||||
• {source} (number|string) Buffer or string from which the {node} is
|
||||
extracted
|
||||
{opts} (table|nil) Optional parameters.
|
||||
• {opts} (table|nil) Optional parameters.
|
||||
• concat: (boolean) Concatenate result in a string (default
|
||||
true)
|
||||
|
||||
@ -649,8 +705,8 @@ get_query({lang}, {query_name}) *get_query()*
|
||||
Returns the runtime query {query_name} for {lang}.
|
||||
|
||||
Parameters: ~
|
||||
{lang} (string) Language to use for the query
|
||||
{query_name} (string) Name of the query (e.g. "highlights")
|
||||
• {lang} (string) Language to use for the query
|
||||
• {query_name} (string) Name of the query (e.g. "highlights")
|
||||
|
||||
Return: ~
|
||||
Query Parsed query
|
||||
@ -660,9 +716,9 @@ get_query_files({lang}, {query_name}, {is_included})
|
||||
Gets the list of files used to make up a query
|
||||
|
||||
Parameters: ~
|
||||
{lang} (string) Language to get query for
|
||||
{query_name} (string) Name of the query to load (e.g., "highlights")
|
||||
{is_included} (boolean|nil) Internal parameter, most of the time left
|
||||
• {lang} (string) Language to get query for
|
||||
• {query_name} (string) Name of the query to load (e.g., "highlights")
|
||||
• {is_included} (boolean|nil) Internal parameter, most of the time left
|
||||
as `nil`
|
||||
|
||||
Return: ~
|
||||
@ -694,8 +750,8 @@ parse_query({lang}, {query}) *parse_query()*
|
||||
• `info.patterns` contains information about predicates.
|
||||
|
||||
Parameters: ~
|
||||
{lang} (string) Language to use for the query
|
||||
{query} (string) Query in s-expr syntax
|
||||
• {lang} (string) Language to use for the query
|
||||
• {query} (string) Query in s-expr syntax
|
||||
|
||||
Return: ~
|
||||
Query Parsed query
|
||||
@ -726,11 +782,11 @@ Query:iter_captures({self}, {node}, {source}, {start}, {stop})
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
{node} userdata |tsnode| under which the search will occur
|
||||
{source} (number|string) Source buffer or string to extract text from
|
||||
{start} (number) Starting line for the search
|
||||
{stop} (number) Stopping line for the search (end-exclusive)
|
||||
{self}
|
||||
• {node} userdata |tsnode| under which the search will occur
|
||||
• {source} (number|string) Source buffer or string to extract text from
|
||||
• {start} (number) Starting line for the search
|
||||
• {stop} (number) Stopping line for the search (end-exclusive)
|
||||
• {self}
|
||||
|
||||
Return: ~
|
||||
(number) capture Matching capture id
|
||||
@ -761,11 +817,11 @@ Query:iter_matches({self}, {node}, {source}, {start}, {stop})
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
{node} userdata |tsnode| under which the search will occur
|
||||
{source} (number|string) Source buffer or string to search
|
||||
{start} (number) Starting line for the search
|
||||
{stop} (number) Stopping line for the search (end-exclusive)
|
||||
{self}
|
||||
• {node} userdata |tsnode| under which the search will occur
|
||||
• {source} (number|string) Source buffer or string to search
|
||||
• {start} (number) Starting line for the search
|
||||
• {stop} (number) Stopping line for the search (end-exclusive)
|
||||
• {self}
|
||||
|
||||
Return: ~
|
||||
(number) pattern id
|
||||
@ -779,9 +835,9 @@ set_query({lang}, {query_name}, {text}) *set_query()*
|
||||
by plugins.
|
||||
|
||||
Parameters: ~
|
||||
{lang} (string) Language to use for the query
|
||||
{query_name} (string) Name of the query (e.g., "highlights")
|
||||
{text} (string) Query text (unparsed).
|
||||
• {lang} (string) Language to use for the query
|
||||
• {query_name} (string) Name of the query (e.g., "highlights")
|
||||
• {text} (string) Query text (unparsed).
|
||||
|
||||
|
||||
==============================================================================
|
||||
@ -791,8 +847,8 @@ new({tree}, {opts}) *highlighter.new()*
|
||||
Creates a new highlighter using
|
||||
|
||||
Parameters: ~
|
||||
{tree} LanguageTree |LanguageTree| parser object to use for highlighting
|
||||
{opts} (table|nil) Configuration of the highlighter:
|
||||
• {tree} LanguageTree |LanguageTree| parser object to use for highlighting
|
||||
• {opts} (table|nil) Configuration of the highlighter:
|
||||
• queries table overwrite queries used by the highlighter
|
||||
|
||||
Return: ~
|
||||
@ -802,7 +858,7 @@ TSHighlighter:destroy({self}) *TSHighlighter:destroy()*
|
||||
Removes all internal references to the highlighter
|
||||
|
||||
Parameters: ~
|
||||
{self}
|
||||
• {self}
|
||||
|
||||
|
||||
==============================================================================
|
||||
@ -812,14 +868,14 @@ LanguageTree:children({self}) *LanguageTree:children()*
|
||||
Returns a map of language to child tree.
|
||||
|
||||
Parameters: ~
|
||||
{self}
|
||||
• {self}
|
||||
|
||||
LanguageTree:contains({self}, {range}) *LanguageTree:contains()*
|
||||
Determines whether {range} is contained in the |LanguageTree|.
|
||||
|
||||
Parameters: ~
|
||||
{range} (table) `{ start_line, start_col, end_line, end_col }`
|
||||
{self}
|
||||
• {range} (table) `{ start_line, start_col, end_line, end_col }`
|
||||
• {self}
|
||||
|
||||
Return: ~
|
||||
(boolean)
|
||||
@ -832,17 +888,17 @@ LanguageTree:destroy({self}) *LanguageTree:destroy()*
|
||||
Note: This DOES NOT remove this tree from a parent. Instead, `remove_child` must be called on the parent to remove it.
|
||||
|
||||
Parameters: ~
|
||||
{self}
|
||||
• {self}
|
||||
|
||||
*LanguageTree:for_each_child()*
|
||||
LanguageTree:for_each_child({self}, {fn}, {include_self})
|
||||
Invokes the callback for each |LanguageTree| and its children recursively
|
||||
|
||||
Parameters: ~
|
||||
{fn} function(tree: LanguageTree, lang: string)
|
||||
{include_self} (boolean) Whether to include the invoking tree in the
|
||||
• {fn} function(tree: LanguageTree, lang: string)
|
||||
• {include_self} (boolean) Whether to include the invoking tree in the
|
||||
results
|
||||
{self}
|
||||
• {self}
|
||||
|
||||
LanguageTree:for_each_tree({self}, {fn}) *LanguageTree:for_each_tree()*
|
||||
Invokes the callback for each |LanguageTree| recursively.
|
||||
@ -850,40 +906,40 @@ LanguageTree:for_each_tree({self}, {fn}) *LanguageTree:for_each_tree()*
|
||||
Note: This includes the invoking tree's child trees as well.
|
||||
|
||||
Parameters: ~
|
||||
{fn} function(tree: TSTree, languageTree: LanguageTree)
|
||||
{self}
|
||||
• {fn} function(tree: TSTree, languageTree: LanguageTree)
|
||||
• {self}
|
||||
|
||||
LanguageTree:included_regions({self}) *LanguageTree:included_regions()*
|
||||
Gets the set of included regions
|
||||
|
||||
Parameters: ~
|
||||
{self}
|
||||
• {self}
|
||||
|
||||
LanguageTree:invalidate({self}, {reload}) *LanguageTree:invalidate()*
|
||||
Invalidates this parser and all its children
|
||||
|
||||
Parameters: ~
|
||||
{self}
|
||||
• {self}
|
||||
|
||||
LanguageTree:is_valid({self}) *LanguageTree:is_valid()*
|
||||
Determines whether this tree is valid. If the tree is invalid, call `parse()` . This will return the updated tree.
|
||||
|
||||
Parameters: ~
|
||||
{self}
|
||||
• {self}
|
||||
|
||||
LanguageTree:lang({self}) *LanguageTree:lang()*
|
||||
Gets the language of this tree node.
|
||||
|
||||
Parameters: ~
|
||||
{self}
|
||||
• {self}
|
||||
|
||||
*LanguageTree:language_for_range()*
|
||||
LanguageTree:language_for_range({self}, {range})
|
||||
Gets the appropriate language that contains {range}.
|
||||
|
||||
Parameters: ~
|
||||
{range} (table) `{ start_line, start_col, end_line, end_col }`
|
||||
{self}
|
||||
• {range} (table) `{ start_line, start_col, end_line, end_col }`
|
||||
• {self}
|
||||
|
||||
Return: ~
|
||||
LanguageTree Managing {range}
|
||||
@ -893,11 +949,11 @@ LanguageTree:named_node_for_range({self}, {range}, {opts})
|
||||
Gets the smallest named node that contains {range}.
|
||||
|
||||
Parameters: ~
|
||||
{range} (table) `{ start_line, start_col, end_line, end_col }`
|
||||
{opts} (table|nil) Optional keyword arguments:
|
||||
• {range} (table) `{ start_line, start_col, end_line, end_col }`
|
||||
• {opts} (table|nil) Optional keyword arguments:
|
||||
• ignore_injections boolean Ignore injected languages
|
||||
(default true)
|
||||
{self}
|
||||
• {self}
|
||||
|
||||
Return: ~
|
||||
userdata|nil Found |tsnode|
|
||||
@ -908,7 +964,7 @@ LanguageTree:parse({self}) *LanguageTree:parse()*
|
||||
determine if any child languages should be created.
|
||||
|
||||
Parameters: ~
|
||||
{self}
|
||||
• {self}
|
||||
|
||||
Return: ~
|
||||
userdata[] Table of parsed |tstree|
|
||||
@ -918,7 +974,7 @@ LanguageTree:register_cbs({self}, {cbs}) *LanguageTree:register_cbs()*
|
||||
Registers callbacks for the |LanguageTree|.
|
||||
|
||||
Parameters: ~
|
||||
{cbs} (table) An |nvim_buf_attach()|-like table argument with the
|
||||
• {cbs} (table) An |nvim_buf_attach()|-like table argument with the
|
||||
following handlers:
|
||||
• `on_bytes` : see |nvim_buf_attach()|, but this will be called after the parsers callback.
|
||||
• `on_changedtree` : a callback that will be called every time
|
||||
@ -929,24 +985,24 @@ LanguageTree:register_cbs({self}, {cbs}) *LanguageTree:register_cbs()*
|
||||
tree.
|
||||
• `on_child_removed` : emitted when a child is removed from
|
||||
the tree.
|
||||
{self}
|
||||
• {self}
|
||||
|
||||
LanguageTree:source({self}) *LanguageTree:source()*
|
||||
Returns the source content of the language tree (bufnr or string).
|
||||
|
||||
Parameters: ~
|
||||
{self}
|
||||
• {self}
|
||||
|
||||
*LanguageTree:tree_for_range()*
|
||||
LanguageTree:tree_for_range({self}, {range}, {opts})
|
||||
Gets the tree that contains {range}.
|
||||
|
||||
Parameters: ~
|
||||
{range} (table) `{ start_line, start_col, end_line, end_col }`
|
||||
{opts} (table|nil) Optional keyword arguments:
|
||||
• {range} (table) `{ start_line, start_col, end_line, end_col }`
|
||||
• {opts} (table|nil) Optional keyword arguments:
|
||||
• ignore_injections boolean Ignore injected languages
|
||||
(default true)
|
||||
{self}
|
||||
• {self}
|
||||
|
||||
Return: ~
|
||||
userdata|nil Contained |tstree|
|
||||
@ -956,7 +1012,7 @@ LanguageTree:trees({self}) *LanguageTree:trees()*
|
||||
languages.
|
||||
|
||||
Parameters: ~
|
||||
{self}
|
||||
• {self}
|
||||
|
||||
new({source}, {lang}, {opts}) *languagetree.new()*
|
||||
A |LanguageTree| holds the treesitter parser for a given language {lang}
|
||||
@ -964,9 +1020,9 @@ new({source}, {lang}, {opts}) *languagetree.new()*
|
||||
may contain child languages themselves, hence the name).
|
||||
|
||||
Parameters: ~
|
||||
{source} (number|string) Buffer or a string of text to parse
|
||||
{lang} (string) Root language this tree represents
|
||||
{opts} (table|nil) Optional keyword arguments:
|
||||
• {source} (number|string) Buffer or a string of text to parse
|
||||
• {lang} (string) Root language this tree represents
|
||||
• {opts} (table|nil) Optional keyword arguments:
|
||||
• injections table Mapping language to injection query
|
||||
strings. This is useful for overriding the built-in
|
||||
runtime file searching for the injection language query
|
||||
|
@ -11,9 +11,9 @@ Vim is Charityware. You can use and copy it as much as you like, but you are
|
||||
encouraged to make a donation for needy children in Uganda. Please see |kcc|
|
||||
below or visit the ICCF web site, available at these URLs:
|
||||
|
||||
http://iccf-holland.org/
|
||||
http://www.vim.org/iccf/
|
||||
http://www.iccf.nl/
|
||||
https://iccf-holland.org/
|
||||
https://www.vim.org/iccf/
|
||||
https://www.iccf.nl/
|
||||
|
||||
You can also sponsor the development of Vim. Vim sponsors can vote for
|
||||
features. See |sponsor|. The money goes to Uganda anyway.
|
||||
@ -239,7 +239,7 @@ Holland: Transfer to the account of "Stichting ICCF Holland" in Lisse.
|
||||
|
||||
Germany: It is possible to make donations that allow for a tax return.
|
||||
Check the ICCF web site for the latest information:
|
||||
http://iccf-holland.org/germany.html
|
||||
https://iccf-holland.org/germany.html
|
||||
|
||||
World: Use a postal money order. That should be possible from any
|
||||
country, mostly from the post office. Use this name (which is
|
||||
|
@ -28,12 +28,14 @@ with these (optional) keys:
|
||||
- `rgb` Decides the color format.
|
||||
- true: (default) 24-bit RGB colors
|
||||
- false: Terminal colors (8-bit, max 256)
|
||||
|
||||
*ui-override*
|
||||
- `override` Decides how UI capabilities are resolved.
|
||||
- true: Enable requested UI capabilities, even if not
|
||||
supported by all connected UIs (including |TUI|).
|
||||
- false: (default) Disable UI capabilities not
|
||||
supported by all connected UIs (including TUI).
|
||||
|
||||
*ui-ext-options*
|
||||
- `ext_cmdline` Externalize the cmdline. |ui-cmdline|
|
||||
- `ext_hlstate` Detailed highlight state. |ui-hlstate|
|
||||
@ -130,14 +132,18 @@ procedure:
|
||||
|
||||
1. Invoke |nvim_get_api_info()|, if needed to setup the client library and/or
|
||||
to get the list of supported UI extensions.
|
||||
|
||||
2. Do any configuration that should be happen before user config is loaded.
|
||||
Buffers and windows are not available at this point, but this could be used
|
||||
to set |g:| variables visible to init.vim
|
||||
|
||||
3. If the UI wants to do additional setup after user config is loaded,
|
||||
register a VimEnter autocmd: >
|
||||
nvim_command("autocmd VimEnter * call rpcrequest(1, 'vimenter')")
|
||||
<4. Now invoke |nvim_ui_attach()|. The UI must handle user input by now:
|
||||
|
||||
4. Now invoke |nvim_ui_attach()|. The UI must handle user input by now:
|
||||
sourcing init.vim and loading buffers might lead to blocking prompts.
|
||||
|
||||
5. If step 3 was used, Nvim will send a blocking "vimenter" request to the UI.
|
||||
Inside this request handler, the UI can safely do any initialization before
|
||||
entering normal mode, for example reading variables set by init.vim.
|
||||
|
@ -85,7 +85,7 @@ The Vim user manual and reference manual are Copyright (c) 1988-2003 by Bram
|
||||
Moolenaar. This material may be distributed only subject to the terms and
|
||||
conditions set forth in the Open Publication License, v1.0 or later. The
|
||||
latest version is presently available at:
|
||||
http://www.opencontent.org/openpub/
|
||||
https://www.opencontent.org/openpub/
|
||||
|
||||
People who contribute to the manuals must agree with the above copyright
|
||||
notice.
|
||||
|
@ -320,7 +320,7 @@ Where can you find plugins?
|
||||
- Some are always loaded, you can see them in the directory $VIMRUNTIME/plugin.
|
||||
- Some come with Vim. You can find them in the directory $VIMRUNTIME/macros
|
||||
and its sub-directories and under $VIM/vimfiles/pack/dist/opt/.
|
||||
- Download from the net. There is a large collection on http://www.vim.org.
|
||||
- Download from the net. There is a large collection on https://www.vim.org.
|
||||
- They are sometimes posted in a Vim maillist.
|
||||
- You could write one yourself, see |write-plugin|.
|
||||
|
||||
|
@ -33,9 +33,8 @@ following command: >
|
||||
ctags *.c
|
||||
|
||||
"ctags" is a separate program. Most Unix systems already have it installed.
|
||||
If you do not have it yet, you can find Universal/Exuberant ctags at:
|
||||
http://ctags.io ~
|
||||
http://ctags.sf.net ~
|
||||
If you do not have it yet, you can find Universal ctags at:
|
||||
https://ctags.io ~
|
||||
|
||||
Universal ctags is preferred, Exuberant ctags is no longer being developed.
|
||||
|
||||
|
@ -1074,8 +1074,8 @@ Various: *various-functions*
|
||||
wordcount() get byte/word/char count of buffer
|
||||
|
||||
luaeval() evaluate |Lua| expression
|
||||
py3eval() evaluate Python expression (|+python3|)
|
||||
pyeval() evaluate Python expression (|+python|)
|
||||
py3eval() evaluate |Python| expression
|
||||
pyeval() evaluate |Python| expression
|
||||
pyxeval() evaluate |python_x| expression
|
||||
rubyeval() evaluate |Ruby| expression
|
||||
|
||||
@ -2624,7 +2624,7 @@ Further reading: |autoload|.
|
||||
==============================================================================
|
||||
*41.16* Distributing Vim scripts *distribute-script*
|
||||
|
||||
Vim users will look for scripts on the Vim website: http://www.vim.org.
|
||||
Vim users will look for scripts on the Vim website: https://www.vim.org.
|
||||
If you made something that is useful for others, share it!
|
||||
|
||||
Vim scripts can be used on any system. There might not be a tar or gzip
|
||||
|
@ -71,8 +71,8 @@ directory src/po/README.txt.
|
||||
programmer. You must know both English and the language you are translating
|
||||
to, of course.
|
||||
When you are satisfied with the translation, consider making it available
|
||||
to others. Upload it at vim-online (http://vim.sf.net) or e-mail it to
|
||||
the Vim maintainer <maintainer@vim.org>. Or both.
|
||||
to others. Upload it to https://github.com/vim/vim or e-mail it to the Vim
|
||||
maintainer <maintainer@vim.org>. Or both.
|
||||
|
||||
==============================================================================
|
||||
*45.2* Language for Menus
|
||||
@ -166,10 +166,7 @@ script files, etc. You can regard 'encoding' as the setting for the internals
|
||||
of Vim.
|
||||
This example assumes you have this font on your system. The name in the
|
||||
example is for the X Window System. This font is in a package that is used to
|
||||
enhance xterm with Unicode support. If you don't have this font, you might
|
||||
find it here:
|
||||
|
||||
http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz ~
|
||||
enhance xterm with Unicode support.
|
||||
|
||||
For MS-Windows, some fonts have a limited number of Unicode characters. Try
|
||||
using the "Courier New" font. You can use the Edit/Select Font... menu to
|
||||
@ -178,10 +175,7 @@ though. Example: >
|
||||
|
||||
:set guifont=courier_new:h12
|
||||
|
||||
If it doesn't work well, try getting a fontpack. If Microsoft didn't move it,
|
||||
you can find it here:
|
||||
|
||||
http://www.microsoft.com/typography/fonts/default.aspx ~
|
||||
If it doesn't work well, try getting a fontpack.
|
||||
|
||||
Now you have told Vim to use Unicode internally and display text with a
|
||||
Unicode font.
|
||||
|
@ -5,7 +5,7 @@
|
||||
Table Of Contents *user-manual*
|
||||
|
||||
==============================================================================
|
||||
Overview ~
|
||||
Overview
|
||||
|
||||
Getting Started
|
||||
|usr_01.txt| About the manuals
|
||||
@ -52,7 +52,7 @@ The user manual is online:
|
||||
https://neovim.io/doc/user
|
||||
|
||||
==============================================================================
|
||||
Getting Started ~
|
||||
Getting Started
|
||||
|
||||
Read this from start to end to learn the essential commands.
|
||||
|
||||
@ -167,7 +167,7 @@ Read this from start to end to learn the essential commands.
|
||||
|12.8| Find where a word is used
|
||||
|
||||
==============================================================================
|
||||
Editing Effectively ~
|
||||
Editing Effectively
|
||||
|
||||
Subjects that can be read independently.
|
||||
|
||||
@ -275,7 +275,7 @@ Subjects that can be read independently.
|
||||
|32.4| Time travelling
|
||||
|
||||
==============================================================================
|
||||
Tuning Vim ~
|
||||
Tuning Vim
|
||||
|
||||
Make Vim work as you like it.
|
||||
|
||||
|
@ -82,27 +82,24 @@ centralized reference of the differences.
|
||||
|
||||
Default Mouse ~
|
||||
*default-mouse* *disable-mouse*
|
||||
By default the mouse is enabled. The right button click opens |popup-menu|
|
||||
with standard actions, such as "Cut", "Copy" and "Paste".
|
||||
By default the mouse is enabled, and <RightMouse> opens a |popup-menu| with
|
||||
standard actions ("Cut", "Copy", "Paste", …). Mouse is NOT enabled in
|
||||
|command-mode| or the |more-prompt|, so you can temporarily disable it just by
|
||||
typing ":".
|
||||
|
||||
If you don't like this you can add to your |config| any of the following:
|
||||
|
||||
- ignore mouse completely >
|
||||
If you don't like this you can disable the mouse in your |config| using any of
|
||||
the following:
|
||||
- Disable mouse completely by unsetting the 'mouse' option: >
|
||||
set mouse=
|
||||
<
|
||||
- no |popup-menu| but the right button extends selection >
|
||||
- Pressing <RightMouse> extends selection instead of showing popup-menu: >
|
||||
set mousemodel=extend
|
||||
>
|
||||
- pressing ALT+LeftMouse releases mouse until main cursor moves >
|
||||
nnoremap <M-LeftMouse> <Cmd>
|
||||
- Pressing <A-LeftMouse> releases mouse until the cursor moves: >
|
||||
nnoremap <A-LeftMouse> <Cmd>
|
||||
\ set mouse=<Bar>
|
||||
\ echo 'mouse OFF until next cursor-move'<Bar>
|
||||
\ autocmd CursorMoved * ++once set mouse&<Bar>
|
||||
\ echo 'mouse ON'<CR>
|
||||
<
|
||||
Also, mouse is not in use in |command-mode| or at |more-prompt|. So if you
|
||||
need to copy/paste with your terminal then just pressing ':' makes Nvim to
|
||||
release the mouse cursor temporarily.
|
||||
|
||||
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
|
||||
is delegated to external plugins/extensions. E.g. the `-X` platform-specific
|
||||
option is "sometimes" available in Vim (with potential surprises:
|
||||
http://stackoverflow.com/q/14635295).
|
||||
https://stackoverflow.com/q/14635295).
|
||||
|
||||
- Vim's internal test functions (test_autochdir(), test_settime(), etc.) are
|
||||
not exposed (nor implemented); instead Nvim has a robust API.
|
||||
@ -642,6 +639,9 @@ Options:
|
||||
*'ttytype'* *'tty'*
|
||||
weirdinvert
|
||||
|
||||
Performance:
|
||||
Folds are not updated during insert-mode.
|
||||
|
||||
Startup:
|
||||
--literal (file args are always literal; to expand wildcards on Windows, use
|
||||
|:n| e.g. `nvim +"n *"`)
|
||||
|
@ -447,7 +447,7 @@ local function get_page(path, silent)
|
||||
end
|
||||
|
||||
local function put_page(page)
|
||||
vim.bo.modified = true
|
||||
vim.bo.modifiable = true
|
||||
vim.bo.readonly = false
|
||||
vim.bo.swapfile = false
|
||||
|
||||
|
20
runtime/lua/man/health.lua
Normal file
20
runtime/lua/man/health.lua
Normal 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
|
@ -12,21 +12,8 @@
|
||||
-- Guideline: "If in doubt, put it in the runtime".
|
||||
--
|
||||
-- Most functions should live directly in `vim.`, not in submodules.
|
||||
-- The only "forbidden" names are those claimed by legacy `if_lua`:
|
||||
-- $ vim
|
||||
-- :lua for k,v in pairs(vim) do print(k) end
|
||||
-- buffer
|
||||
-- open
|
||||
-- window
|
||||
-- lastline
|
||||
-- firstline
|
||||
-- type
|
||||
-- line
|
||||
-- eval
|
||||
-- dict
|
||||
-- beep
|
||||
-- list
|
||||
-- command
|
||||
--
|
||||
-- Compatibility with Vim's `if_lua` is explicitly a non-goal.
|
||||
--
|
||||
-- Reference (#6580):
|
||||
-- - https://github.com/luafun/luafun
|
||||
@ -122,9 +109,7 @@ function vim._os_proc_children(ppid)
|
||||
return children
|
||||
end
|
||||
|
||||
-- TODO(ZyX-I): Create compatibility layer.
|
||||
|
||||
--- Return a human-readable representation of the given object.
|
||||
--- Gets a human-readable representation of the given object.
|
||||
---
|
||||
---@see https://github.com/kikito/inspect.lua
|
||||
---@see https://github.com/mpeterv/vinspect
|
||||
@ -183,7 +168,8 @@ do
|
||||
local line1 = lines[1]:gsub('(%c)', '\022%1')
|
||||
-- nvim_input() is affected by mappings,
|
||||
-- so use nvim_feedkeys() with "n" flag to ignore mappings.
|
||||
vim.api.nvim_feedkeys(line1, 'n', true)
|
||||
-- "t" flag is also needed so the pasted text is saved in cmdline history.
|
||||
vim.api.nvim_feedkeys(line1, 'nt', true)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
@ -825,23 +825,16 @@ end
|
||||
---
|
||||
--- See |vim.lsp.start_client()| for all available options. The most important are:
|
||||
---
|
||||
--- `name` is an arbitrary name for the LSP client. It should be unique per
|
||||
--- language server.
|
||||
---
|
||||
--- `cmd` the command as list - used to start the language server.
|
||||
--- The command must be present in the `$PATH` environment variable or an
|
||||
--- absolute path to the executable. Shell constructs like `~` are *NOT* expanded.
|
||||
---
|
||||
--- `root_dir` path to the project root.
|
||||
--- By default this is used to decide if an existing client should be re-used.
|
||||
--- The example above uses |vim.fs.find()| and |vim.fs.dirname()| to detect the
|
||||
--- root by traversing the file system upwards starting
|
||||
--- from the current directory until either a `pyproject.toml` or `setup.py`
|
||||
--- file is found.
|
||||
---
|
||||
--- `workspace_folders` a list of { uri:string, name: string } tables.
|
||||
--- The project root folders used by the language server.
|
||||
--- If `nil` the property is derived from the `root_dir` for convenience.
|
||||
--- - `name` arbitrary name for the LSP client. Should be unique per language server.
|
||||
--- - `cmd` command (in list form) used to start the language server. Must be absolute, or found on
|
||||
--- `$PATH`. Shell constructs like `~` are not expanded.
|
||||
--- - `root_dir` path to the project root. By default this is used to decide if an existing client
|
||||
--- should be re-used. The example above uses |vim.fs.find()| and |vim.fs.dirname()| to detect the
|
||||
--- root by traversing the file system upwards starting from the current directory until either
|
||||
--- a `pyproject.toml` or `setup.py` file is found.
|
||||
--- - `workspace_folders` list of `{ uri:string, name: string }` tables specifying the project root
|
||||
--- folders used by the language server. If `nil` the property is derived from `root_dir` for
|
||||
--- convenience.
|
||||
---
|
||||
--- Language servers use this information to discover metadata like the
|
||||
--- dependencies of your project and they tend to index the contents within the
|
||||
|
@ -99,10 +99,10 @@ end
|
||||
---
|
||||
--- Examples:
|
||||
--- <pre>
|
||||
--- split(":aa::b:", ":") --> {'','aa','','b',''}
|
||||
--- split("axaby", "ab?") --> {'','x','y'}
|
||||
--- split("x*yz*o", "*", {plain=true}) --> {'x','yz','o'}
|
||||
--- split("|x|y|z|", "|", {trimempty=true}) --> {'x', 'y', 'z'}
|
||||
--- split(":aa::b:", ":") => {'','aa','','b',''}
|
||||
--- split("axaby", "ab?") => {'','x','y'}
|
||||
--- split("x*yz*o", "*", {plain=true}) => {'x','yz','o'}
|
||||
--- split("|x|y|z|", "|", {trimempty=true}) => {'x', 'y', 'z'}
|
||||
--- </pre>
|
||||
---
|
||||
---@see |vim.gsplit()|
|
||||
|
@ -164,7 +164,7 @@ function TSHighlighter:get_query(lang)
|
||||
end
|
||||
|
||||
---@private
|
||||
local function on_line_impl(self, buf, line, spell)
|
||||
local function on_line_impl(self, buf, line, is_spell_nav)
|
||||
self.tree:for_each_tree(function(tstree, tree)
|
||||
if not tstree then
|
||||
return
|
||||
@ -201,17 +201,26 @@ local function on_line_impl(self, buf, line, spell)
|
||||
local start_row, start_col, end_row, end_col = node:range()
|
||||
local hl = highlighter_query.hl_cache[capture]
|
||||
|
||||
local is_spell = highlighter_query:query().captures[capture] == 'spell'
|
||||
local capture_name = highlighter_query:query().captures[capture]
|
||||
local spell = nil
|
||||
if capture_name == 'spell' then
|
||||
spell = true
|
||||
elseif capture_name == 'nospell' then
|
||||
spell = false
|
||||
end
|
||||
|
||||
if hl and end_row >= line and (not spell or is_spell) then
|
||||
-- Give nospell a higher priority so it always overrides spell captures.
|
||||
local spell_pri_offset = capture_name == 'nospell' and 1 or 0
|
||||
|
||||
if hl and end_row >= line and (not is_spell_nav or spell ~= nil) then
|
||||
a.nvim_buf_set_extmark(buf, ns, start_row, start_col, {
|
||||
end_line = end_row,
|
||||
end_col = end_col,
|
||||
hl_group = hl,
|
||||
ephemeral = true,
|
||||
priority = tonumber(metadata.priority) or 100, -- Low but leaves room below
|
||||
priority = (tonumber(metadata.priority) or 100) + spell_pri_offset, -- Low but leaves room below
|
||||
conceal = metadata.conceal,
|
||||
spell = is_spell,
|
||||
spell = spell,
|
||||
})
|
||||
end
|
||||
if start_row > line then
|
||||
|
@ -26,6 +26,7 @@
|
||||
</screenshots>
|
||||
|
||||
<releases>
|
||||
<release date="2022-11-14" version="0.8.1"/>
|
||||
<release date="2022-09-30" version="0.8.0"/>
|
||||
<release date="2022-04-15" version="0.7.0"/>
|
||||
<release date="2021-12-31" version="0.6.1"/>
|
||||
|
14
runtime/pack/dist/opt/vimball/doc/vimball.txt
vendored
14
runtime/pack/dist/opt/vimball/doc/vimball.txt
vendored
@ -88,7 +88,7 @@ MAKING A VIMBALL *:MkVimball*
|
||||
If you wish to force slashes into the filename, that can also be done
|
||||
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
|
||||
make.
|
||||
|
||||
@ -171,12 +171,12 @@ WINDOWS *vimball-windows*
|
||||
>
|
||||
Item Tool/Suite Free Website
|
||||
---- ---------- ---- -------
|
||||
7zip tool y http://www.7-zip.org/
|
||||
Winzip tool n http://www.winzip.com/downwz.htm
|
||||
unxutils suite y http://unxutils.sourceforge.net/
|
||||
cygwin suite y http://www.cygwin.com/
|
||||
GnuWin32 suite y http://gnuwin32.sourceforge.net/
|
||||
MinGW suite y http://www.mingw.org/
|
||||
7zip tool y https://www.7-zip.org/
|
||||
Winzip tool n https://www.winzip.com/downwz.htm
|
||||
unxutils suite y https://unxutils.sourceforge.net/
|
||||
cygwin suite y https://www.cygwin.com/
|
||||
GnuWin32 suite y https://gnuwin32.sourceforge.net/
|
||||
MinGW suite y https://www.mingw.org/
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
|
@ -9,8 +9,11 @@
|
||||
"|" @conceal (#set! conceal "")
|
||||
text: (_) @text.reference)
|
||||
(optionlink
|
||||
text: (_) @text.literal)
|
||||
text: (_) @text.reference)
|
||||
(codespan
|
||||
"`" @conceal (#set! conceal "")
|
||||
text: (_) @string)
|
||||
text: (_) @text.literal)
|
||||
(codeblock) @text.literal
|
||||
(argument) @parameter
|
||||
(keycode) @string.special
|
||||
(url) @text.uri
|
||||
|
@ -17,9 +17,13 @@ BASENAME="$(basename "${0}")"
|
||||
readonly BASENAME
|
||||
|
||||
usage() {
|
||||
echo "Bump Neovim dependencies"
|
||||
echo "Bump Nvim dependencies"
|
||||
echo
|
||||
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 "Options:"
|
||||
echo " -h show this message and exit."
|
||||
|
@ -33,6 +33,7 @@ local spell_dict = {
|
||||
NeoVim = 'Nvim',
|
||||
neovim = 'Nvim',
|
||||
lua = 'Lua',
|
||||
VimL = 'Vimscript',
|
||||
}
|
||||
|
||||
local M = {}
|
||||
@ -42,7 +43,9 @@ local M = {}
|
||||
local new_layout = {
|
||||
['api.txt'] = true,
|
||||
['channel.txt'] = true,
|
||||
['deprecated.txt'] = true,
|
||||
['develop.txt'] = true,
|
||||
['lua.txt'] = true,
|
||||
['luaref.txt'] = true,
|
||||
['nvim.txt'] = true,
|
||||
['pi_health.txt'] = true,
|
||||
@ -67,7 +70,24 @@ local exclude_invalid = {
|
||||
["v:_null_string"] = "builtin.txt",
|
||||
["vim.lsp.buf_request()"] = "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)
|
||||
@ -96,11 +116,6 @@ local function url_encode(s)
|
||||
'g')
|
||||
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)
|
||||
return s:gsub('\t', (' '):rep(8))
|
||||
end
|
||||
@ -123,15 +138,29 @@ local function basename_noext(f)
|
||||
end
|
||||
|
||||
local function is_blank(s)
|
||||
return not not s:find('^%s*$')
|
||||
return not not s:find([[^[\t ]*$]])
|
||||
end
|
||||
|
||||
local function trim(s)
|
||||
return vim.trim(s)
|
||||
local function trim(s, dir)
|
||||
return vim.fn.trim(s, '\r\t\n ', dir or 0)
|
||||
end
|
||||
|
||||
local function trim_bullet(s)
|
||||
return s:gsub('^%s*[-*•]%s', '')
|
||||
-- Remove common punctuation from URLs.
|
||||
--
|
||||
-- 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
|
||||
|
||||
-- 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*$')
|
||||
-- modeline
|
||||
-- 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*vi[m]%:.*filetype=help')
|
||||
or line:find('^%s*vim?%:.*ft=help')
|
||||
or line:find('^%s*vim?%:.*filetype=help')
|
||||
or line:find('[*>]local%-additions[*<]')
|
||||
) then
|
||||
-- table.insert(stats.noise_lines, getbuflinestr(root, opt.buf, 0))
|
||||
@ -199,7 +228,7 @@ local function get_helppage(f)
|
||||
return 'index.html'
|
||||
end
|
||||
|
||||
return f:gsub('%.txt$', '.html')
|
||||
return (f:gsub('%.txt$', '.html'))
|
||||
end
|
||||
|
||||
-- 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')
|
||||
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 text = vim.treesitter.get_node_text(node, bufnr)
|
||||
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.
|
||||
local function ignore_invalid(s)
|
||||
-- Strings like |~/====| appear in various places and the parser thinks they are links, but they
|
||||
-- are just table borders.
|
||||
return not not (s:find('===') or exclude_invalid[s])
|
||||
return not not (
|
||||
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
|
||||
|
||||
local function ignore_parse_error(s)
|
||||
-- Ignore parse errors for unclosed codespan/optionlink/tag.
|
||||
-- This is common in vimdocs and is treated as plaintext by :help.
|
||||
return s:find("^[`'|*]")
|
||||
local function ignore_parse_error(s, fname)
|
||||
local helpfile = vim.fs.basename(fname)
|
||||
return (helpfile == 'pi_netrw.txt'
|
||||
-- Ignore parse errors for unclosed tag.
|
||||
-- This is common in vimdocs and is treated as plaintext by :help.
|
||||
or s:find("^[`'|*]")
|
||||
)
|
||||
end
|
||||
|
||||
local function has_ancestor(node, ancestor_name)
|
||||
@ -270,12 +316,36 @@ local function has_ancestor(node, ancestor_name)
|
||||
return false
|
||||
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 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
|
||||
invalid_links[tagname] = vim.fs.basename(fname)
|
||||
local ignored = false
|
||||
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
|
||||
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
|
||||
|
||||
-- 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
|
||||
|
||||
if node_name == 'ERROR' then
|
||||
if ignore_parse_error(text) then
|
||||
if ignore_parse_error(text, opt.fname) then
|
||||
return
|
||||
end
|
||||
-- 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
|
||||
elseif node_name == 'url' then
|
||||
if text:find('http%:') then
|
||||
invalid_urls[text] = vim.fs.basename(opt.fname)
|
||||
end
|
||||
local fixed_url, _ = fix_url(trim(text))
|
||||
validate_url(fixed_url, opt.fname)
|
||||
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
|
||||
|
||||
@ -332,17 +401,28 @@ local function visit_node(root, level, lang_tree, headings, opt, stats)
|
||||
-- Parent kind (string).
|
||||
local parent = root:parent() and root:parent():type() or nil
|
||||
local text = ''
|
||||
local toplevel = level < 1
|
||||
local function node_text(node)
|
||||
return vim.treesitter.get_node_text(node or root, opt.buf)
|
||||
local trimmed
|
||||
-- Gets leading whitespace of `node`.
|
||||
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
|
||||
-- Gets leading whitespace of the current node.
|
||||
local function ws()
|
||||
return node_text():match('^%s+') or ''
|
||||
local function node_text(node, ws_)
|
||||
node = node or root
|
||||
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
|
||||
|
||||
if root:child_count() == 0 or node_name == 'ERROR' then
|
||||
text = node_text()
|
||||
trimmed = html_esc(trim(text))
|
||||
text = html_esc(text)
|
||||
else
|
||||
-- Process children and join them with whitespace.
|
||||
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)
|
||||
end
|
||||
end
|
||||
trimmed = trim(text)
|
||||
end
|
||||
local trimmed = trim(text)
|
||||
|
||||
if node_name == 'help_file' then -- root node
|
||||
return text
|
||||
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
|
||||
return html_esc(text)
|
||||
return text
|
||||
elseif node_name == 'h1' or node_name == 'h2' or node_name == 'h3' then
|
||||
if is_noise(text, stats.noise_lines) then
|
||||
return '' -- Discard common "noise" lines.
|
||||
end
|
||||
-- Remove "===" and tags from ToC text.
|
||||
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
|
||||
table.insert(headings, { name = hname, subheadings = {}, })
|
||||
table.insert(headings, { name = hname, subheadings = {}, tag = tagname })
|
||||
else
|
||||
table.insert(headings[#headings].subheadings, { name = hname, subheadings = {}, })
|
||||
table.insert(headings[#headings].subheadings, { name = hname, subheadings = {}, tag = tagname })
|
||||
end
|
||||
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
|
||||
if root:has_error() then
|
||||
return text
|
||||
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
|
||||
if is_blank(text) then
|
||||
return ''
|
||||
end
|
||||
if opt.old then
|
||||
-- XXX: Treat old docs as preformatted; random indentation is used for layout there.
|
||||
return ('<div class="old-help-para">%s</div>\n'):format(text)
|
||||
-- XXX: Treat "old" docs as preformatted: they use indentation for layout.
|
||||
-- Trim trailing newlines to avoid too much whitespace between divs.
|
||||
return ('<div class="old-help-para">%s</div>\n'):format(trim(text, 2))
|
||||
end
|
||||
return string.format('<div class="help-para">\n%s\n</div>\n', text)
|
||||
elseif node_name == 'line' then
|
||||
local sib = root:prev_sibling()
|
||||
local sib_last = sib and sib:named_child(sib:named_child_count() - 1)
|
||||
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()
|
||||
if parent ~= 'codeblock' and (is_blank(text) or is_noise(text, stats.noise_lines)) then
|
||||
return '' -- Discard common "noise" lines.
|
||||
end
|
||||
|
||||
-- Close the current listitem.
|
||||
local close = (in_li and next_ ~= 'line') and '</div>' or ''
|
||||
|
||||
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)
|
||||
-- XXX: Avoid newlines (too much whitespace) after block elements in old (preformatted) layout.
|
||||
local div = opt.old and root:child(0) and vim.tbl_contains({'column_heading', 'h1', 'h2', 'h3'}, root:child(0):type())
|
||||
return string.format('%s%s', div and trim(text) or text, div and '' or '\n')
|
||||
elseif node_name == 'line_li' then
|
||||
-- Close the listitem immediately if the next sibling is not a line.
|
||||
local close = (next_ ~= 'line') and '</div>' or ''
|
||||
return string.format('<div class="help-li">%s %s', trim_bullet(text), close)
|
||||
local sib = root:prev_sibling()
|
||||
local prev_li = sib and sib:type() == 'line_li'
|
||||
|
||||
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
|
||||
if root:has_error() then
|
||||
local helppage, tagname, ignored = validate_link(root, opt.buf, opt.fname)
|
||||
if ignored then
|
||||
return text
|
||||
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))
|
||||
elseif node_name == 'codespan' then
|
||||
elseif vim.tbl_contains({'codespan', 'keycode'}, node_name) then
|
||||
if root:has_error() then
|
||||
return text
|
||||
end
|
||||
return ('%s<code>%s</code>'):format(ws(), text)
|
||||
return ('%s<code>%s</code>'):format(ws(), trimmed)
|
||||
elseif node_name == 'argument' then
|
||||
return ('%s<code>{%s}</code>'):format(ws(), text)
|
||||
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
|
||||
if root:has_error() then
|
||||
return text
|
||||
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 tagname = node_text(root:child(1))
|
||||
local tagname = node_text(root:child(1), false)
|
||||
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)
|
||||
return ''
|
||||
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
|
||||
-- Start the <span> container for tags in a heading.
|
||||
-- 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
|
||||
return s
|
||||
elseif node_name == 'ERROR' then
|
||||
if ignore_parse_error(trimmed) then
|
||||
if ignore_parse_error(trimmed, opt.fname) then
|
||||
return text
|
||||
end
|
||||
|
||||
-- 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)
|
||||
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)
|
||||
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(
|
||||
node_name, get_bug_url_nvim(opt.fname, opt.to_fname, sample_text, node_name), trimmed), ('unknown-token:"%s"'):format(node_name)
|
||||
end
|
||||
@ -630,7 +719,9 @@ local function gen_one(fname, to_fname, old, commit)
|
||||
|
||||
local main = ''
|
||||
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
|
||||
|
||||
main = ([[
|
||||
@ -672,10 +763,10 @@ local function gen_one(fname, to_fname, old, commit)
|
||||
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
|
||||
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.
|
||||
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
|
||||
toc = toc .. '</div>'
|
||||
@ -718,6 +809,17 @@ local function gen_css(fname)
|
||||
position: fixed;
|
||||
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) {
|
||||
:root {
|
||||
@ -726,6 +828,8 @@ local function gen_css(fname)
|
||||
}
|
||||
.toc {
|
||||
/* 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 {
|
||||
text-overflow: ellipsis;
|
||||
@ -784,7 +888,7 @@ local function gen_css(fname)
|
||||
.help-tag-right {
|
||||
color: var(--tag-color);
|
||||
}
|
||||
h1 .help-tag, h2 .help-tag {
|
||||
h1 .help-tag, h2 .help-tag, h3 .help-tag {
|
||||
font-size: smaller;
|
||||
}
|
||||
.help-heading {
|
||||
@ -831,11 +935,6 @@ local function gen_css(fname)
|
||||
color: gray;
|
||||
font-size: smaller;
|
||||
}
|
||||
.golden-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 65% auto;
|
||||
grid-gap: 1em;
|
||||
}
|
||||
]]
|
||||
tofile(fname, css)
|
||||
end
|
||||
@ -869,6 +968,22 @@ function M._test()
|
||||
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'))
|
||||
|
||||
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')
|
||||
end
|
||||
|
||||
|
@ -2,9 +2,7 @@
|
||||
"""Generates Nvim :help docs from C/Lua docstrings, using Doxygen.
|
||||
|
||||
Also generates *.mpack files. To inspect the *.mpack structure:
|
||||
|
||||
:new | put=v:lua.vim.inspect(msgpackparse(readfile('runtime/doc/api.mpack')))
|
||||
|
||||
:new | put=v:lua.vim.inspect(v:lua.vim.mpack.unpack(readfile('runtime/doc/api.mpack','B')))
|
||||
|
||||
Flow:
|
||||
main
|
||||
@ -14,15 +12,10 @@ Flow:
|
||||
update_params_map /
|
||||
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
|
||||
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:
|
||||
The generated :help text for each function is formatted as follows:
|
||||
|
||||
- Max width of 78 columns (`text_width`).
|
||||
- Indent with spaces (not tabs).
|
||||
@ -287,7 +280,7 @@ annotation_map = {
|
||||
'FUNC_API_FAST': '|api-fast|',
|
||||
'FUNC_API_CHECK_TEXTLOCK': 'not allowed when |textlock| is active',
|
||||
'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
|
||||
out = ''
|
||||
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)
|
||||
return out.rstrip()
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user