mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
Compare commits
95 Commits
v0.7.0
...
release-0.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
be368a6f74 | ||
![]() |
c624f260d3 | ||
![]() |
6e31a3a51e | ||
![]() |
57180fcb39 | ||
![]() |
bacc0b9c0b | ||
![]() |
b535db77d8 | ||
![]() |
74a949b859 | ||
![]() |
0986b8be4f | ||
![]() |
332cc6424a | ||
![]() |
3a826ceed3 | ||
![]() |
d8561c078c | ||
![]() |
bee7b6167d | ||
![]() |
786272d00b | ||
![]() |
71294e6430 | ||
![]() |
a375053492 | ||
![]() |
0ad89969e1 | ||
![]() |
c91c6381ee | ||
![]() |
6d2e0ab621 | ||
![]() |
145dd051c3 | ||
![]() |
ba9b424154 | ||
![]() |
8f3621c4b7 | ||
![]() |
37b78620db | ||
![]() |
74cbddf6e1 | ||
![]() |
ca73525485 | ||
![]() |
1af25791d5 | ||
![]() |
6c6ce6894a | ||
![]() |
40caaeb041 | ||
![]() |
a92baa095a | ||
![]() |
cee2de23ab | ||
![]() |
b25b41997a | ||
![]() |
d89523ba62 | ||
![]() |
cc2e16f4e0 | ||
![]() |
33284615fe | ||
![]() |
239e549d23 | ||
![]() |
f0101d696c | ||
![]() |
315f8b92d0 | ||
![]() |
f1ab73cf6c | ||
![]() |
a6a6f7ba16 | ||
![]() |
f365e68293 | ||
![]() |
11dafcaf05 | ||
![]() |
dd0d4fc666 | ||
![]() |
e44f88bbe7 | ||
![]() |
5901b4c624 | ||
![]() |
01cb4d8846 | ||
![]() |
bdd92e46b3 | ||
![]() |
11f18a8adf | ||
![]() |
ede410ae3d | ||
![]() |
cebda91abb | ||
![]() |
6177030e4a | ||
![]() |
5b839ced69 | ||
![]() |
844872cc0a | ||
![]() |
0e96f7d04c | ||
![]() |
1cc63abf4a | ||
![]() |
9f51da3442 | ||
![]() |
857678c2ec | ||
![]() |
03bd9147f0 | ||
![]() |
ee9e3420fd | ||
![]() |
7b60ec79ea | ||
![]() |
14357c83c5 | ||
![]() |
571609fb89 | ||
![]() |
37a00be7c0 | ||
![]() |
09306f07c4 | ||
![]() |
ec101b9fd9 | ||
![]() |
222d1414dc | ||
![]() |
7f4fa077cd | ||
![]() |
00889948dd | ||
![]() |
1bb861c7a1 | ||
![]() |
d547d874af | ||
![]() |
060eeaa14c | ||
![]() |
9dae939b1f | ||
![]() |
8c6a4fab66 | ||
![]() |
1b54344c11 | ||
![]() |
8f68548384 | ||
![]() |
25da2430f9 | ||
![]() |
93f1ec0a59 | ||
![]() |
5c8e5432c0 | ||
![]() |
e86997a812 | ||
![]() |
a0ebba7052 | ||
![]() |
ae249d81fb | ||
![]() |
785baceaee | ||
![]() |
aa0ddc6690 | ||
![]() |
2cd272decb | ||
![]() |
08ddfa9851 | ||
![]() |
beac24d6f3 | ||
![]() |
5dcf2c77a9 | ||
![]() |
ce4c8010cc | ||
![]() |
270f71b571 | ||
![]() |
3c0f239c3e | ||
![]() |
1d32521135 | ||
![]() |
bd057d4b40 | ||
![]() |
096f8418c5 | ||
![]() |
84784a8391 | ||
![]() |
fb11ef0aad | ||
![]() |
faf3159ab0 | ||
![]() |
a4699892af |
@@ -1,10 +1,11 @@
|
|||||||
image: freebsd/latest
|
image: freebsd/12.x
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
- cmake
|
- cmake
|
||||||
- gmake
|
- gmake
|
||||||
- ninja
|
- ninja
|
||||||
- libtool
|
- libtool
|
||||||
|
- sha
|
||||||
- automake
|
- automake
|
||||||
- pkgconf
|
- pkgconf
|
||||||
- unzip
|
- unzip
|
||||||
@@ -12,7 +13,6 @@ packages:
|
|||||||
- gettext
|
- gettext
|
||||||
- python
|
- python
|
||||||
- libffi
|
- libffi
|
||||||
- gdb
|
|
||||||
|
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/neovim/neovim
|
- https://github.com/neovim/neovim
|
||||||
@@ -35,6 +35,10 @@ tasks:
|
|||||||
- unittest: |
|
- unittest: |
|
||||||
cd neovim
|
cd neovim
|
||||||
gmake unittest
|
gmake unittest
|
||||||
- oldtest: |
|
|
||||||
cd neovim
|
# Unfortunately, oldtest is tanking hard on sourcehut's FreeBSD instance
|
||||||
gmake oldtest
|
# and not producing any logs as a result. So don't do this task for now.
|
||||||
|
# Ref: https://github.com/neovim/neovim/pull/11477#discussion_r352095005.
|
||||||
|
# - test-oldtest: |
|
||||||
|
# cd neovim
|
||||||
|
# gmake oldtest
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
# sourcehut CI: https://builds.sr.ht/~jmk/neovim
|
# sourcehut CI: https://builds.sr.ht/~jmk/neovim
|
||||||
|
|
||||||
image: openbsd/latest
|
image: openbsd/6.9
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
- autoconf-2.71
|
- autoconf-2.71
|
||||||
@@ -12,7 +12,6 @@ packages:
|
|||||||
- libtool
|
- libtool
|
||||||
- ninja-1.10.2p0
|
- ninja-1.10.2p0
|
||||||
- unzip-6.0p14
|
- unzip-6.0p14
|
||||||
- gdb
|
|
||||||
|
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/neovim/neovim
|
- https://github.com/neovim/neovim
|
||||||
|
@@ -2,10 +2,10 @@ BasedOnStyle: Google
|
|||||||
Language: Cpp
|
Language: Cpp
|
||||||
ColumnLimit: 100
|
ColumnLimit: 100
|
||||||
IndentWidth: 2
|
IndentWidth: 2
|
||||||
TabWidth: 8
|
TabWidth: 2
|
||||||
UseTab: Never
|
UseTab: Never
|
||||||
IndentCaseLabels: false
|
IndentCaseLabels: true
|
||||||
BreakBeforeBraces: Custom
|
BreakBeforeBraces: Linux
|
||||||
AlignEscapedNewlinesLeft: false
|
AlignEscapedNewlinesLeft: false
|
||||||
AllowShortFunctionsOnASingleLine: false
|
AllowShortFunctionsOnASingleLine: false
|
||||||
AlignTrailingComments: true
|
AlignTrailingComments: true
|
||||||
@@ -17,24 +17,4 @@ AllowShortLoopsOnASingleLine: false
|
|||||||
BinPackParameters: false
|
BinPackParameters: false
|
||||||
BreakBeforeBinaryOperators: true
|
BreakBeforeBinaryOperators: true
|
||||||
BreakBeforeTernaryOperators: true
|
BreakBeforeTernaryOperators: true
|
||||||
ContinuationIndentWidth: 2
|
ContinuationIndentWidth: 4
|
||||||
AlwaysBreakAfterDefinitionReturnType: None
|
|
||||||
AlwaysBreakAfterReturnType: None
|
|
||||||
AlwaysBreakBeforeMultilineStrings: No
|
|
||||||
AlwaysBreakTemplateDeclarations: No
|
|
||||||
AlignEscapedNewlines: DontAlign
|
|
||||||
BinPackArguments: false
|
|
||||||
BraceWrapping:
|
|
||||||
AfterClass: false
|
|
||||||
AfterControlStatement: false
|
|
||||||
AfterEnum: false
|
|
||||||
AfterFunction: true
|
|
||||||
AfterObjCDeclaration: false
|
|
||||||
AfterStruct: false
|
|
||||||
AfterUnion: false
|
|
||||||
BeforeCatch: false
|
|
||||||
BeforeElse: false
|
|
||||||
IndentBraces: false
|
|
||||||
PointerAlignment: Right
|
|
||||||
SortIncludes: false
|
|
||||||
Cpp11BracedListStyle: false
|
|
||||||
|
@@ -8,9 +8,6 @@ end_of_line = lf
|
|||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
|
|
||||||
[*.{c,h,in,lua}]
|
|
||||||
max_line_length = 100
|
|
||||||
|
|
||||||
[{Makefile,**/Makefile,runtime/doc/*.txt}]
|
[{Makefile,**/Makefile,runtime/doc/*.txt}]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
indent_size = 8
|
indent_size = 8
|
||||||
|
@@ -36,18 +36,3 @@ d90fb1c0bfc1e64c783c385a79e7de87013dadba
|
|||||||
9c268263b1792d00b3ffdfd7495af2575862656e
|
9c268263b1792d00b3ffdfd7495af2575862656e
|
||||||
8c74c895b300bcee5fa937a2329d1d4756567b42
|
8c74c895b300bcee5fa937a2329d1d4756567b42
|
||||||
40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf
|
40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf
|
||||||
4472c56d54f447040f6e8610b261b7efa0d04eb6
|
|
||||||
a68faed02dc8e37b8f10da14dc02e33e6ed93947
|
|
||||||
725cbe7d414f609e769081276f2a034e32a4337b
|
|
||||||
7e3bdc75e44b9139d8afaea4381b53ae78b15746
|
|
||||||
4ba12b3dda34472c193c9fa8ffd7d3bd5b6c04d6
|
|
||||||
849f104c2789c884428fd45501912c6591a78e12
|
|
||||||
38dd53c525054daf83dba27d7d46e90e8b41fa50
|
|
||||||
6059784770c4c88fb6fe528b9f7634192fa1164e
|
|
||||||
ee031eb5256bb83e0d6add2bae6fd943a4186ffe
|
|
||||||
69e11b58b4db0952f11a5ff85aa7150b5f5b8db8
|
|
||||||
271bb32855853b011fceaf0ad2f829bce66b2a19
|
|
||||||
|
|
||||||
# typos
|
|
||||||
d238b8f6003d34cae7f65ff7585b48a2cd9449fb
|
|
||||||
4547137aaff32b20172870a549d3a28a3c7adf1c
|
|
||||||
|
7
.github/ISSUE_TEMPLATE/lsp_bug_report.yml
vendored
7
.github/ISSUE_TEMPLATE/lsp_bug_report.yml
vendored
@@ -27,6 +27,13 @@ body:
|
|||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: ':checkhealth'
|
||||||
|
description: |
|
||||||
|
Paste the results from `nvim -c ":checkhealth nvim lspconfig"`
|
||||||
|
render: markdown
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: 'Steps to reproduce using "nvim -u minimal_init.lua"'
|
label: 'Steps to reproduce using "nvim -u minimal_init.lua"'
|
||||||
|
6
.github/labeler.yml
vendored
6
.github/labeler.yml
vendored
@@ -49,10 +49,9 @@
|
|||||||
"build":
|
"build":
|
||||||
- CMakeLists.txt
|
- CMakeLists.txt
|
||||||
- "**/CMakeLists.txt"
|
- "**/CMakeLists.txt"
|
||||||
- "**/Makefile"
|
|
||||||
- "**/*.cmake"
|
- "**/*.cmake"
|
||||||
|
|
||||||
"test":
|
"tests":
|
||||||
- all: ["test/**/*"]
|
- all: ["test/**/*"]
|
||||||
|
|
||||||
"ci":
|
"ci":
|
||||||
@@ -60,6 +59,3 @@
|
|||||||
- .github/workflows/**/*
|
- .github/workflows/**/*
|
||||||
- .builds/*
|
- .builds/*
|
||||||
- ci/**/*
|
- ci/**/*
|
||||||
|
|
||||||
"filetype":
|
|
||||||
- runtime/lua/vim/filetype.lua
|
|
||||||
|
16
.github/scripts/remove-reviewers.js
vendored
16
.github/scripts/remove-reviewers.js
vendored
@@ -1,16 +0,0 @@
|
|||||||
module.exports = async ({github, context}) => {
|
|
||||||
const requestedReviewers = await github.rest.pulls.listRequestedReviewers({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
pull_number: context.issue.number
|
|
||||||
});
|
|
||||||
|
|
||||||
const reviewers = requestedReviewers.data.users.map(e => e.login)
|
|
||||||
|
|
||||||
github.rest.pulls.removeRequestedReviewers({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
pull_number: context.issue.number,
|
|
||||||
reviewers: reviewers
|
|
||||||
});
|
|
||||||
}
|
|
95
.github/scripts/reviews.js
vendored
95
.github/scripts/reviews.js
vendored
@@ -1,95 +0,0 @@
|
|||||||
module.exports = async ({github, context}) => {
|
|
||||||
const pr_data = await github.rest.pulls.get({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
pull_number: context.issue.number
|
|
||||||
})
|
|
||||||
const labels = pr_data.data.labels.map(e => e.name)
|
|
||||||
|
|
||||||
const reviewers = new Set()
|
|
||||||
if (labels.includes('api')) {
|
|
||||||
reviewers.add("bfredl")
|
|
||||||
reviewers.add("gpanders")
|
|
||||||
reviewers.add("muniter")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('build')) {
|
|
||||||
reviewers.add("jamessan")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('ci')) {
|
|
||||||
reviewers.add("jamessan")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('column')) {
|
|
||||||
reviewers.add("lewis6991")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('diagnostic')) {
|
|
||||||
reviewers.add("gpanders")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('diff')) {
|
|
||||||
reviewers.add("lewis6991")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('dependencies')) {
|
|
||||||
reviewers.add("jamessan")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('distribution')) {
|
|
||||||
reviewers.add("jamessan")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('documentation')) {
|
|
||||||
reviewers.add("clason")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('extmarks')) {
|
|
||||||
reviewers.add("bfredl")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('filetype')) {
|
|
||||||
reviewers.add("clason")
|
|
||||||
reviewers.add("gpanders")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('gui')) {
|
|
||||||
reviewers.add("glacambre")
|
|
||||||
reviewers.add("smolck")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('lsp')) {
|
|
||||||
reviewers.add("mfussenegger")
|
|
||||||
reviewers.add("mjlbach")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('treesitter')) {
|
|
||||||
reviewers.add("bfredl")
|
|
||||||
reviewers.add("vigoux")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('typo')) {
|
|
||||||
reviewers.add("dundargoc")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('ui')) {
|
|
||||||
reviewers.add("bfredl")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes('vim-patch')) {
|
|
||||||
reviewers.add("seandewar")
|
|
||||||
reviewers.add("zeertzjq")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove person that opened the PR since they can't review themselves
|
|
||||||
const pr_opener = pr_data.data.user.login
|
|
||||||
reviewers.delete(pr_opener)
|
|
||||||
|
|
||||||
github.rest.pulls.requestReviewers({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
pull_number: context.issue.number,
|
|
||||||
reviewers: Array.from(reviewers)
|
|
||||||
});
|
|
||||||
}
|
|
20
.github/workflows/api-docs-check.yml
vendored
20
.github/workflows/api-docs-check.yml
vendored
@@ -1,20 +0,0 @@
|
|||||||
name: Missing API docs
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
|
||||||
branches-ignore:
|
|
||||||
- 'marvim/api-doc-update**'
|
|
||||||
paths:
|
|
||||||
- 'src/nvim/api/*.[ch]'
|
|
||||||
- 'runtime/lua/**.lua'
|
|
||||||
- 'runtime/doc/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
call-regen-api-docs:
|
|
||||||
if: github.event.pull_request.draft == false
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
uses: ./.github/workflows/api-docs.yml
|
|
||||||
with:
|
|
||||||
check_only: true
|
|
25
.github/workflows/api-docs.yml
vendored
25
.github/workflows/api-docs.yml
vendored
@@ -1,23 +1,14 @@
|
|||||||
# Autogenerate the API docs on new commit to important branches
|
|
||||||
# Also work as a check for PR's to not forget committing their doc changes
|
|
||||||
# called from api-docs-check.yml
|
|
||||||
name: Autogenerate API docs
|
name: Autogenerate API docs
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- 'src/nvim/api/*.[ch]'
|
- 'src/nvim/api/*.[ch]'
|
||||||
|
- 'src/nvim/**.lua'
|
||||||
- 'runtime/lua/**.lua'
|
- 'runtime/lua/**.lua'
|
||||||
- 'runtime/doc/**'
|
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
- 'release-[0-9]+.[0-9]+'
|
- 'release-[0-9]+.[0-9]+'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
check_only:
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
regen-api-docs:
|
regen-api-docs:
|
||||||
@@ -53,18 +44,10 @@ jobs:
|
|||||||
python3 scripts/gen_vimdoc.py
|
python3 scripts/gen_vimdoc.py
|
||||||
printf '::set-output name=UPDATED_DOCS::%s\n' $([ -z "$(git diff)" ]; echo $?)
|
printf '::set-output name=UPDATED_DOCS::%s\n' $([ -z "$(git diff)" ]; echo $?)
|
||||||
|
|
||||||
- name: FAIL, PR has not committed doc changes
|
|
||||||
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && inputs.check_only }}
|
|
||||||
run: |
|
|
||||||
echo "Job failed, run ./scripts/gen_vimdoc.py and commit your doc changes"
|
|
||||||
echo "The doc generation produces the following changes:"
|
|
||||||
git --no-pager diff
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
- name: Automatic PR
|
- name: Automatic PR
|
||||||
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && !inputs.check_only }}
|
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 }}
|
||||||
run: |
|
run: |
|
||||||
git add -u
|
git add -u
|
||||||
git commit -m 'docs: regenerate [skip ci]'
|
git commit -m 'docs: regenerate'
|
||||||
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${DOC_BRANCH}
|
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${DOC_BRANCH}
|
||||||
gh pr create --draft --fill --base ${GITHUB_REF#refs/heads/} --head ${DOC_BRANCH} || true
|
gh pr create --fill --base ${GITHUB_REF#refs/heads/} --head ${DOC_BRANCH} || true
|
||||||
|
2
.github/workflows/backport.yml
vendored
2
.github/workflows/backport.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
name: Backport Pull Request
|
name: Backport Pull Request
|
||||||
if: >
|
if: >
|
||||||
github.repository_owner == 'neovim' && (
|
github.repository_owner == 'neovim' && (
|
||||||
github.event_name == 'pull_request_target' &&
|
github.event_name == 'pull_request' &&
|
||||||
github.event.pull_request.merged
|
github.event.pull_request.merged
|
||||||
) || (
|
) || (
|
||||||
github.event_name == 'issue_comment' &&
|
github.event_name == 'issue_comment' &&
|
||||||
|
215
.github/workflows/ci.yml
vendored
215
.github/workflows/ci.yml
vendored
@@ -9,24 +9,11 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
- 'release-[0-9]+.[0-9]+'
|
- 'release-[0-9]+.[0-9]+'
|
||||||
paths-ignore:
|
|
||||||
- 'runtime/doc/*'
|
|
||||||
|
|
||||||
# Cancel any in-progress CI runs for a PR if it is updated
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
# This job tests two things: it lints the code but also builds neovim using
|
|
||||||
# system dependencies instead of bundled dependencies. This is to make sure
|
|
||||||
# we are able to build neovim without pigeonholing ourselves into specifics
|
|
||||||
# of the bundled dependencies.
|
|
||||||
|
|
||||||
if: (github.event_name == 'pull_request' && github.base_ref == 'master' && !github.event.pull_request.draft) || (github.event_name == 'push' && github.ref == 'refs/heads/master')
|
if: (github.event_name == 'pull_request' && github.base_ref == 'master' && !github.event.pull_request.draft) || (github.event_name == 'push' && github.ref == 'refs/heads/master')
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
timeout-minutes: 10
|
|
||||||
env:
|
env:
|
||||||
CC: gcc
|
CC: gcc
|
||||||
steps:
|
steps:
|
||||||
@@ -37,86 +24,44 @@ jobs:
|
|||||||
|
|
||||||
- name: Install apt packages
|
- name: Install apt packages
|
||||||
run: |
|
run: |
|
||||||
sudo add-apt-repository ppa:neovim-ppa/stable
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y autoconf automake build-essential ccache cmake cpanminus gettext gperf language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip
|
||||||
autoconf \
|
|
||||||
automake \
|
|
||||||
build-essential \
|
|
||||||
ccache \
|
|
||||||
cmake \
|
|
||||||
flake8 \
|
|
||||||
gettext \
|
|
||||||
gperf \
|
|
||||||
libluajit-5.1-dev \
|
|
||||||
libmsgpack-dev \
|
|
||||||
libtermkey-dev \
|
|
||||||
libtool-bin \
|
|
||||||
libtree-sitter-dev \
|
|
||||||
libunibilium-dev \
|
|
||||||
libuv1-dev \
|
|
||||||
libvterm-dev \
|
|
||||||
locales \
|
|
||||||
lua-busted \
|
|
||||||
lua-check \
|
|
||||||
lua-filesystem \
|
|
||||||
lua-inspect \
|
|
||||||
lua-lpeg \
|
|
||||||
lua-luv-dev \
|
|
||||||
lua-nvim \
|
|
||||||
luajit \
|
|
||||||
ninja-build \
|
|
||||||
pkg-config
|
|
||||||
|
|
||||||
- name: Cache artifacts
|
- name: Setup interpreter packages
|
||||||
|
run: |
|
||||||
|
./ci/before_install.sh
|
||||||
|
./ci/install.sh
|
||||||
|
|
||||||
|
- name: Cache dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
${{ env.CACHE_NVIM_DEPS_DIR }}
|
${{ env.CACHE_NVIM_DEPS_DIR }}
|
||||||
~/.ccache
|
~/.ccache
|
||||||
key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!third-party/**CMakeLists.txt') }}-${{ github.base_ref }}
|
key: ${{ matrix.runner }}-lint-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'third-party/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
|
||||||
|
|
||||||
- name: Build third-party
|
- name: Build third-party
|
||||||
run: ./ci/before_script.sh
|
run: ./ci/before_script.sh
|
||||||
|
|
||||||
- name: Build nvim
|
- name: Run lint
|
||||||
run: ./ci/run_tests.sh build_nvim
|
run: ./ci/script.sh
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: clint-full
|
|
||||||
run: ./ci/run_lint.sh clint-full
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: lualint
|
|
||||||
run: ./ci/run_lint.sh lualint
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: pylint
|
|
||||||
run: ./ci/run_lint.sh pylint
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: shlint
|
|
||||||
run: ./ci/run_lint.sh shlint
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: check-single-includes
|
|
||||||
run: ./ci/run_lint.sh check-single-includes
|
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
|
if: ${{ success() }}
|
||||||
run: ./ci/before_cache.sh
|
run: ./ci/before_cache.sh
|
||||||
|
|
||||||
posix:
|
unixish:
|
||||||
name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
|
name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- flavor: asan
|
- flavor: asan
|
||||||
cc: clang-13
|
cc: clang-12
|
||||||
runner: ubuntu-20.04
|
runner: ubuntu-20.04
|
||||||
os: linux
|
os: linux
|
||||||
- flavor: tsan
|
- flavor: tsan
|
||||||
cc: clang-13
|
cc: clang-12
|
||||||
runner: ubuntu-20.04
|
runner: ubuntu-20.04
|
||||||
os: linux
|
os: linux
|
||||||
- cc: clang
|
- cc: clang
|
||||||
@@ -125,17 +70,6 @@ jobs:
|
|||||||
- cc: clang
|
- cc: clang
|
||||||
runner: macos-11.0
|
runner: macos-11.0
|
||||||
os: osx
|
os: osx
|
||||||
|
|
||||||
# The functionaltest-lua test two things simultaneously:
|
|
||||||
# 1. Check that the tests pass with PUC Lua instead of LuaJIT.
|
|
||||||
# 2. Use as oldest/minimum versions of dependencies/build tools we
|
|
||||||
# still explicitly support so we don't accidentally rely on
|
|
||||||
# features that is only available on later versions.
|
|
||||||
- flavor: functionaltest-lua
|
|
||||||
cc: gcc
|
|
||||||
runner: ubuntu-20.04
|
|
||||||
os: linux
|
|
||||||
cmake: minimum_required
|
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
if: github.event.pull_request.draft == false
|
if: github.event.pull_request.draft == false
|
||||||
@@ -154,40 +88,27 @@ jobs:
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y autoconf automake build-essential ccache cmake cpanminus cscope gcc-multilib gdb gettext gperf language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
|
sudo apt-get install -y autoconf automake build-essential ccache cmake cpanminus cscope gcc-multilib gdb gettext gperf language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
|
||||||
|
|
||||||
- name: Install minimum required version of cmake
|
|
||||||
if: matrix.cmake == 'minimum_required'
|
|
||||||
env:
|
|
||||||
CMAKE_URL: 'https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh'
|
|
||||||
CMAKE_VERSION: '3.10.0'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
|
|
||||||
mkdir -p "$HOME/.local/bin" /opt/cmake-custom
|
|
||||||
chmod a+x /tmp/cmake-installer.sh
|
|
||||||
/tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
|
|
||||||
ln -sfn /opt/cmake-custom/bin/cmake "$HOME/.local/bin/cmake"
|
|
||||||
cmake_version="$(cmake --version | head -1)"
|
|
||||||
echo "$cmake_version" | grep -qF "cmake version $CMAKE_VERSION" || {
|
|
||||||
echo "Unexpected CMake version: $cmake_version"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Install new clang
|
- name: Install new clang
|
||||||
if: matrix.flavor == 'asan' || matrix.flavor == 'tsan'
|
if: matrix.flavor == 'asan' || matrix.flavor == 'tsan'
|
||||||
run: |
|
run: |
|
||||||
wget https://apt.llvm.org/llvm.sh
|
wget https://apt.llvm.org/llvm.sh
|
||||||
chmod a+x llvm.sh
|
chmod a+x llvm.sh
|
||||||
sudo ./llvm.sh 13
|
sudo ./llvm.sh 12
|
||||||
rm llvm.sh
|
rm llvm.sh
|
||||||
|
|
||||||
- name: Install brew packages
|
- name: Install brew packages
|
||||||
if: matrix.os == 'osx'
|
if: matrix.os == 'osx'
|
||||||
run: |
|
run: |
|
||||||
brew update --quiet
|
# Workaround brew issues
|
||||||
brew install automake ccache cpanminus ninja
|
rm -f /usr/local/bin/2to3
|
||||||
|
brew update >/dev/null
|
||||||
|
brew upgrade
|
||||||
|
brew install automake ccache perl cpanminus ninja
|
||||||
|
|
||||||
- name: Setup interpreter packages
|
- name: Setup interpreter packages
|
||||||
run: ./ci/install.sh
|
run: |
|
||||||
|
./ci/before_install.sh
|
||||||
|
./ci/install.sh
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
@@ -200,31 +121,15 @@ jobs:
|
|||||||
- name: Build third-party
|
- name: Build third-party
|
||||||
run: ./ci/before_script.sh
|
run: ./ci/before_script.sh
|
||||||
|
|
||||||
- name: Build
|
- name: Build and test
|
||||||
run: ./ci/run_tests.sh build_nvim
|
run: ./ci/script.sh
|
||||||
|
|
||||||
- if: matrix.flavor != 'tsan' && matrix.flavor != 'functionaltest-lua' && !cancelled()
|
|
||||||
name: Unittests
|
|
||||||
run: ./ci/run_tests.sh unittests
|
|
||||||
|
|
||||||
- if: matrix.flavor != 'tsan' && !cancelled()
|
|
||||||
name: Functionaltests
|
|
||||||
run: ./ci/run_tests.sh functionaltests
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: Oldtests
|
|
||||||
run: ./ci/run_tests.sh oldtests
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: Install nvim
|
|
||||||
run: ./ci/run_tests.sh install_nvim
|
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
|
if: ${{ success() }}
|
||||||
run: ./ci/before_cache.sh
|
run: ./ci/before_cache.sh
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
runs-on: windows-2019
|
runs-on: windows-2016
|
||||||
timeout-minutes: 45
|
|
||||||
if: github.event.pull_request.draft == false
|
if: github.event.pull_request.draft == false
|
||||||
env:
|
env:
|
||||||
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
||||||
@@ -247,3 +152,69 @@ jobs:
|
|||||||
run: powershell ci\build.ps1
|
run: powershell ci\build.ps1
|
||||||
env:
|
env:
|
||||||
CONFIGURATION: ${{ matrix.config }}
|
CONFIGURATION: ${{ matrix.config }}
|
||||||
|
|
||||||
|
functionaltest:
|
||||||
|
name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- flavor: functionaltest-lua
|
||||||
|
cc: gcc
|
||||||
|
runner: ubuntu-20.04
|
||||||
|
os: linux
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
|
timeout-minutes: 45
|
||||||
|
env:
|
||||||
|
CC: ${{ matrix.cc }}
|
||||||
|
CI_OS_NAME: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup commom environment variables
|
||||||
|
run: ./.github/workflows/env.sh ${{ matrix.flavor }}
|
||||||
|
|
||||||
|
- name: Install apt packages
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y autoconf automake build-essential ccache cmake cpanminus cscope gcc-multilib gdb gettext gperf language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
|
||||||
|
|
||||||
|
- name: Install minimum required version of cmake
|
||||||
|
env:
|
||||||
|
CMAKE_URL: 'https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh'
|
||||||
|
CMAKE_VERSION: '3.10.0'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
|
||||||
|
mkdir -p "$HOME/.local/bin" /opt/cmake-custom
|
||||||
|
chmod a+x /tmp/cmake-installer.sh
|
||||||
|
/tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
|
||||||
|
ln -sfn /opt/cmake-custom/bin/cmake "$HOME/.local/bin/cmake"
|
||||||
|
cmake_version="$(cmake --version | head -1)"
|
||||||
|
echo "$cmake_version" | grep -qF "cmake version $CMAKE_VERSION" || {
|
||||||
|
echo "Unexpected CMake version: $cmake_version"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Setup interpreter packages
|
||||||
|
run: |
|
||||||
|
./ci/before_install.sh
|
||||||
|
./ci/install.sh
|
||||||
|
|
||||||
|
- name: Cache dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
${{ env.CACHE_NVIM_DEPS_DIR }}
|
||||||
|
~/.ccache
|
||||||
|
key: ${{ matrix.runner }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'third-party/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
|
||||||
|
|
||||||
|
- name: Build third-party
|
||||||
|
run: ./ci/before_script.sh
|
||||||
|
|
||||||
|
- name: Build and test
|
||||||
|
run: ./ci/script.sh
|
||||||
|
|
||||||
|
- name: Cache dependencies
|
||||||
|
if: ${{ success() }}
|
||||||
|
run: ./ci/before_cache.sh
|
||||||
|
8
.github/workflows/commitlint.yml
vendored
8
.github/workflows/commitlint.yml
vendored
@@ -1,15 +1,15 @@
|
|||||||
name: "Commit Linter"
|
name: "Commit Linter"
|
||||||
on:
|
on:
|
||||||
# Only pull_request and push honor [skip ci]. Since this workflow must pass
|
pull_request:
|
||||||
# to merge a PR, it can't be skipped, so use pull_request_target
|
|
||||||
pull_request_target:
|
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
jobs:
|
jobs:
|
||||||
lint-commits:
|
lint-commits:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event.pull_request.draft == false
|
if: github.event.pull_request.draft == false
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2.3.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
9
.github/workflows/env.sh
vendored
9
.github/workflows/env.sh
vendored
@@ -34,23 +34,18 @@ case "$FLAVOR" in
|
|||||||
BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
|
BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
|
||||||
cat <<EOF >> "$GITHUB_ENV"
|
cat <<EOF >> "$GITHUB_ENV"
|
||||||
CLANG_SANITIZER=ASAN_UBSAN
|
CLANG_SANITIZER=ASAN_UBSAN
|
||||||
SYMBOLIZER=asan_symbolize-13
|
SYMBOLIZER=asan_symbolize-12
|
||||||
ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:log_path=$GITHUB_WORKSPACE/build/log/asan:intercept_tls_get_addr=0
|
ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:log_path=$GITHUB_WORKSPACE/build/log/asan
|
||||||
UBSAN_OPTIONS=print_stacktrace=1 log_path=$GITHUB_WORKSPACE/build/log/ubsan
|
UBSAN_OPTIONS=print_stacktrace=1 log_path=$GITHUB_WORKSPACE/build/log/ubsan
|
||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
tsan)
|
tsan)
|
||||||
cat <<EOF >> "$GITHUB_ENV"
|
cat <<EOF >> "$GITHUB_ENV"
|
||||||
TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan
|
TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan
|
||||||
CLANG_SANITIZER=TSAN
|
|
||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
lint)
|
lint)
|
||||||
# Re-enable once system deps are available
|
|
||||||
# BUILD_FLAGS="$BUILD_FLAGS -DLIBLUV_LIBRARY:FILEPATH=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/lua/5.1/luv.so -DLIBLUV_INCLUDE_DIR:PATH=/usr/include/lua5.1"
|
|
||||||
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUV=ON"
|
|
||||||
cat <<EOF >> "$GITHUB_ENV"
|
cat <<EOF >> "$GITHUB_ENV"
|
||||||
USE_BUNDLED=OFF
|
|
||||||
CI_TARGET=lint
|
CI_TARGET=lint
|
||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
29
.github/workflows/labeler.yml
vendored
29
.github/workflows/labeler.yml
vendored
@@ -1,9 +1,8 @@
|
|||||||
name: "Pull Request Labeler"
|
name: "Pull Request Labeler"
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [opened]
|
types: opened
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
triage:
|
triage:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
@@ -13,8 +12,6 @@ jobs:
|
|||||||
- uses: actions/labeler@main
|
- uses: actions/labeler@main
|
||||||
with:
|
with:
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
sync-labels: ""
|
|
||||||
|
|
||||||
type-scope:
|
type-scope:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
@@ -26,24 +23,8 @@ jobs:
|
|||||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||||
steps:
|
steps:
|
||||||
- name: "Extract commit type and add as label"
|
# Extract type and try to add it as a label
|
||||||
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')" || true
|
- run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')" || true
|
||||||
- name: "Extract commit scope and add as label"
|
|
||||||
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+\((.+)\)!?:.*|\1|')" || true
|
|
||||||
- name: "Extract if the PR is a breaking change and add it as label"
|
|
||||||
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true
|
|
||||||
|
|
||||||
request-reviewer:
|
# Extract scope and try to add it as a label
|
||||||
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
|
- run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+\((.+)\)!?:.*|\1|')" || true
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: ["triage", "type-scope"]
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: 'Request reviewers'
|
|
||||||
uses: actions/github-script@v6
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const script = require('./.github/scripts/reviews.js')
|
|
||||||
await script({github, context})
|
|
||||||
|
32
.github/workflows/notes.md
vendored
32
.github/workflows/notes.md
vendored
@@ -6,17 +6,8 @@ ${NVIM_VERSION}
|
|||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
#### Zip
|
1. Extract **nvim-win64.zip**
|
||||||
|
2. Run `nvim-qt.exe`
|
||||||
1. Download **nvim-win64.zip**
|
|
||||||
2. Extract the zip.
|
|
||||||
3. Run `nvim-qt.exe`
|
|
||||||
|
|
||||||
#### MSI
|
|
||||||
|
|
||||||
1. Download **nvim-win64.msi**
|
|
||||||
2. Run the MSI
|
|
||||||
3. Search and run `nvim-qt.exe` or run `nvim.exe` on your CLI of choice.
|
|
||||||
|
|
||||||
### macOS
|
### macOS
|
||||||
|
|
||||||
@@ -26,19 +17,6 @@ ${NVIM_VERSION}
|
|||||||
|
|
||||||
### Linux (x64)
|
### Linux (x64)
|
||||||
|
|
||||||
#### Tarball
|
|
||||||
|
|
||||||
1. Download **nvim-linux64.tar.gz**
|
|
||||||
2. Extract: `tar xzvf nvim-linux64.tar.gz`
|
|
||||||
3. Run `./nvim-linux64/bin/nvim`
|
|
||||||
|
|
||||||
#### Debian Package
|
|
||||||
|
|
||||||
1. Download **nvim-linux64.deb**
|
|
||||||
2. Install the package using `sudo apt install ./nvim-linux64.deb`
|
|
||||||
3. Run `nvim`
|
|
||||||
|
|
||||||
#### AppImage
|
|
||||||
1. Download **nvim.appimage**
|
1. Download **nvim.appimage**
|
||||||
2. Run `chmod u+x nvim.appimage && ./nvim.appimage`
|
2. Run `chmod u+x nvim.appimage && ./nvim.appimage`
|
||||||
- If your system does not have FUSE you can [extract the appimage](https://github.com/AppImage/AppImageKit/wiki/FUSE#type-2-appimage):
|
- If your system does not have FUSE you can [extract the appimage](https://github.com/AppImage/AppImageKit/wiki/FUSE#type-2-appimage):
|
||||||
@@ -54,11 +32,9 @@ ${NVIM_VERSION}
|
|||||||
## SHA256 Checksums
|
## SHA256 Checksums
|
||||||
|
|
||||||
```
|
```
|
||||||
${SHA_LINUX_64_TAR}
|
${SHA_LINUX_64}
|
||||||
${SHA_LINUX_64_DEB}
|
|
||||||
${SHA_APP_IMAGE}
|
${SHA_APP_IMAGE}
|
||||||
${SHA_APP_IMAGE_ZSYNC}
|
${SHA_APP_IMAGE_ZSYNC}
|
||||||
${SHA_MACOS}
|
${SHA_MACOS}
|
||||||
${SHA_WIN_64_ZIP}
|
${SHA_WIN_64}
|
||||||
${SHA_WIN_64_MSI}
|
|
||||||
```
|
```
|
||||||
|
32
.github/workflows/release.yml
vendored
32
.github/workflows/release.yml
vendored
@@ -39,17 +39,12 @@ jobs:
|
|||||||
printf '::set-output name=version::%s\n' "$(./build/bin/nvim --version | head -n 3 | sed -z 's/\n/%0A/g')"
|
printf '::set-output name=version::%s\n' "$(./build/bin/nvim --version | head -n 3 | sed -z 's/\n/%0A/g')"
|
||||||
printf '::set-output name=release::%s\n' "$(./build/bin/nvim --version | head -n 1)"
|
printf '::set-output name=release::%s\n' "$(./build/bin/nvim --version | head -n 1)"
|
||||||
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install
|
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install
|
||||||
cd "$GITHUB_WORKSPACE/build/"
|
cd "$GITHUB_WORKSPACE/build/release"
|
||||||
cpack -C $NVIM_BUILD_TYPE
|
tar cfz nvim-linux64.tar.gz nvim-linux64
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: nvim-linux64
|
name: nvim-linux64
|
||||||
path: build/nvim-linux64.tar.gz
|
path: build/release/nvim-linux64.tar.gz
|
||||||
retention-days: 1
|
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: nvim-linux64
|
|
||||||
path: build/nvim-linux64.deb
|
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
appimage:
|
appimage:
|
||||||
@@ -85,7 +80,9 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Install brew packages
|
- name: Install brew packages
|
||||||
run: |
|
run: |
|
||||||
brew update --quiet
|
rm -f /usr/local/bin/2to3
|
||||||
|
brew update >/dev/null
|
||||||
|
brew upgrade
|
||||||
brew install automake ninja
|
brew install automake ninja
|
||||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
||||||
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
|
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
|
||||||
@@ -119,7 +116,7 @@ jobs:
|
|||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
runs-on: windows-2019
|
runs-on: windows-2016
|
||||||
env:
|
env:
|
||||||
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
||||||
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
|
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
|
||||||
@@ -136,16 +133,12 @@ jobs:
|
|||||||
- run: powershell ci\build.ps1 -NoTests
|
- run: powershell ci\build.ps1 -NoTests
|
||||||
env:
|
env:
|
||||||
CONFIGURATION: ${{ matrix.config }}
|
CONFIGURATION: ${{ matrix.config }}
|
||||||
|
- run: move build\Neovim.zip build\${{ matrix.archive }}.zip
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.archive }}
|
name: ${{ matrix.archive }}
|
||||||
path: build/${{ matrix.archive }}.zip
|
path: build/${{ matrix.archive }}.zip
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.archive }}
|
|
||||||
path: build/${{ matrix.archive }}.msi
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
needs: [linux, appimage, macOS, windows]
|
needs: [linux, appimage, macOS, windows]
|
||||||
@@ -196,9 +189,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd ./nvim-linux64
|
cd ./nvim-linux64
|
||||||
sha256sum nvim-linux64.tar.gz > nvim-linux64.tar.gz.sha256sum
|
sha256sum nvim-linux64.tar.gz > nvim-linux64.tar.gz.sha256sum
|
||||||
echo "SHA_LINUX_64_TAR=$(cat nvim-linux64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
echo "SHA_LINUX_64=$(cat nvim-linux64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
||||||
sha256sum nvim-linux64.deb > nvim-linux64.deb.sha256sum
|
|
||||||
echo "SHA_LINUX_64_DEB=$(cat nvim-linux64.deb.sha256sum)" >> $GITHUB_ENV
|
|
||||||
- name: Generate App Image SHA256 checksums
|
- name: Generate App Image SHA256 checksums
|
||||||
run: |
|
run: |
|
||||||
cd ./appimage
|
cd ./appimage
|
||||||
@@ -218,14 +209,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd ./nvim-win64
|
cd ./nvim-win64
|
||||||
sha256sum nvim-win64.zip > nvim-win64.zip.sha256sum
|
sha256sum nvim-win64.zip > nvim-win64.zip.sha256sum
|
||||||
echo "SHA_WIN_64_ZIP=$(cat nvim-win64.zip.sha256sum)" >> $GITHUB_ENV
|
echo "SHA_WIN_64=$(cat nvim-win64.zip.sha256sum)" >> $GITHUB_ENV
|
||||||
sha256sum nvim-win64.msi > nvim-win64.msi.sha256sum
|
|
||||||
echo "SHA_WIN_64_MSI=$(cat nvim-win64.msi.sha256sum)" >> $GITHUB_ENV
|
|
||||||
- name: Publish release
|
- name: Publish release
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
NVIM_VERSION: ${{ needs.linux.outputs.version }}
|
NVIM_VERSION: ${{ needs.linux.outputs.version }}
|
||||||
DEBUG: api
|
|
||||||
run: |
|
run: |
|
||||||
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md"
|
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md"
|
||||||
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
||||||
|
17
.github/workflows/remove-reviewers-on-draft.yml
vendored
17
.github/workflows/remove-reviewers-on-draft.yml
vendored
@@ -1,17 +0,0 @@
|
|||||||
name: "Remove reviewers"
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types: [converted_to_draft, closed]
|
|
||||||
jobs:
|
|
||||||
remove-reviewers:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: 'Remove reviewers'
|
|
||||||
uses: actions/github-script@v6
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const script = require('./.github/scripts/remove-reviewers.js')
|
|
||||||
await script({github, context})
|
|
18
.github/workflows/reviews.yml
vendored
18
.github/workflows/reviews.yml
vendored
@@ -1,18 +0,0 @@
|
|||||||
name: "Request reviews"
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types: [labeled, ready_for_review]
|
|
||||||
jobs:
|
|
||||||
request-reviewer:
|
|
||||||
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: 'Request reviewers'
|
|
||||||
uses: actions/github-script@v6
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const script = require('./.github/scripts/reviews.js')
|
|
||||||
await script({github, context})
|
|
2
.github/workflows/vim-patches.yml
vendored
2
.github/workflows/vim-patches.yml
vendored
@@ -49,4 +49,4 @@ jobs:
|
|||||||
git add -u
|
git add -u
|
||||||
git commit -m 'version.c: update [skip ci]'
|
git commit -m 'version.c: update [skip ci]'
|
||||||
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${VERSION_BRANCH}
|
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${VERSION_BRANCH}
|
||||||
gh pr create --draft --fill --label vim-patch --base ${GITHUB_REF#refs/heads/} --head ${VERSION_BRANCH} || true
|
gh pr create --fill --label vim-patch --base ${GITHUB_REF#refs/heads/} --head ${VERSION_BRANCH} || true
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,7 +1,6 @@
|
|||||||
# Tools
|
# Tools
|
||||||
/venv/
|
/venv/
|
||||||
compile_commands.json
|
compile_commands.json
|
||||||
/.luarc.json
|
|
||||||
|
|
||||||
# IDEs
|
# IDEs
|
||||||
/.vs/
|
/.vs/
|
||||||
@@ -15,7 +14,6 @@ compile_commands.json
|
|||||||
/.clangd/
|
/.clangd/
|
||||||
/.cache/clangd/
|
/.cache/clangd/
|
||||||
/.ccls-cache/
|
/.ccls-cache/
|
||||||
/.clang-tidy
|
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.mo
|
*.mo
|
||||||
|
@@ -26,10 +26,6 @@ read_globals = {
|
|||||||
"vim",
|
"vim",
|
||||||
}
|
}
|
||||||
|
|
||||||
globals = {
|
|
||||||
"vim.g",
|
|
||||||
}
|
|
||||||
|
|
||||||
exclude_files = {
|
exclude_files = {
|
||||||
'test/functional/fixtures/lua/syntax_error.lua',
|
'test/functional/fixtures/lua/syntax_error.lua',
|
||||||
}
|
}
|
||||||
|
134
.mailmap
134
.mailmap
@@ -1,134 +0,0 @@
|
|||||||
Abdelhakeem <abdelhakeem.osama@hotmail.com> Abdelhakeem Osama
|
|
||||||
Alvaro Muñoz <alvaro@pwntester.com> Alvaro Muñoz
|
|
||||||
Andreas Johansson <andreas@ndrs.xyz> <ndreas@users.noreply.github.com>
|
|
||||||
Andrew Pyatkov <mrbiggfoot@gmail.com> <mrbiggfoot@users.noreply.github.com>
|
|
||||||
Anmol Sethi <hi@nhooyr.io> <anmol@aubble.com>
|
|
||||||
Anmol Sethi <hi@nhooyr.io> <me@anmol.io>
|
|
||||||
Anmol Sethi <hi@nhooyr.io> <nhooyr@users.noreply.github.com>
|
|
||||||
BK1603 <chouhan.shreyansh2702@gmail.com> Shreyansh Chouhan
|
|
||||||
Billy Su <g4691821@gmail.com> Billy SU
|
|
||||||
Billy Vong <billyvg@gmail.com> <billyvg@users.noreply.github.com>
|
|
||||||
Björn Linse <bjorn.linse@gmail.com> bfredl
|
|
||||||
Carlos Hernandez <carlos@techbyte.ca> <hurricanehrndz@users.noreply.github.com>
|
|
||||||
Chris Kipp <ckipp@pm.me> ckipp01
|
|
||||||
Christian Clason <c.clason@uni-graz.at> <christian.clason@uni-due.de>
|
|
||||||
Cédric Barreteau <> <cbarrete@users.noreply.github.com>
|
|
||||||
Dan Aloni <alonid@gmail.com> <dan@kernelim.com>
|
|
||||||
Daniel Hahler <git@thequod.de> <github@thequod.de>
|
|
||||||
Eisuke Kawashima <e-kwsm@users.noreply.github.com> E Kawashima
|
|
||||||
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
|
|
||||||
Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez
|
|
||||||
Fabian Viöl <f.vioel@googlemail.com> Fabian
|
|
||||||
Florian Walch <florian@fwalch.com> <fwalch@users.noreply.github.com>
|
|
||||||
Gabriel Cruz <gabs.oficial98@gmail.com> <LTKills@users.noreply.github.com>
|
|
||||||
Gaelan Steele <gbs@canishe.com> Gaelan
|
|
||||||
Gavin D. Howard <gavin@schedmd.com> <yzena.tech@gmail.com>
|
|
||||||
George Zhao <zhaozg@gmail.com> <zhaozg@aliyun.com>
|
|
||||||
George Zhao <zhaozg@gmail.com> George Zhao
|
|
||||||
Gregory Anders <greg@gpanders.com> <8965202+gpanders@users.noreply.github.com>
|
|
||||||
Gregory Anders <greg@gpanders.com> Greg Anders
|
|
||||||
Grzegorz Milka <grzegorzmilka@gmail.com> Grzegorz
|
|
||||||
Harm te Hennepe <dhtehennepe@gmail.com> <d.h.tehennepe@student.utwente.nl>
|
|
||||||
Harm te Hennepe <dhtehennepe@gmail.com> <harm@tehennepe.org>
|
|
||||||
Hirokazu Hata <h.hata.ai.t@gmail.com> <h-michael@users.noreply.github.com>
|
|
||||||
Ihor Antonov <ngortheone@gmail.com> <ngortheone@users.noreply.github.com>
|
|
||||||
J Phani Mahesh <phanimahesh@gmail.com> <github@phanimahesh.me>
|
|
||||||
Jack Bracewell <FriedSock@users.noreply.github.com> <jack.bracewell@unboxedconsulting.com>
|
|
||||||
Jack Bracewell <FriedSock@users.noreply.github.com> <jbtwentythree@gmail.com>
|
|
||||||
Jacques Germishuys <jacquesg@striata.com> <jacquesg@users.noreply.github.com>
|
|
||||||
Jakub Łuczyński <doubleloop@o2.pl> <doubleloop@users.noreply.github.com>
|
|
||||||
James McCoy <jamessan@jamessan.com> <vega.james@gmail.com>
|
|
||||||
Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> <janedmundlazo@hotmail.com>
|
|
||||||
Jan Viljanen <jan.a.viljanen@gmail.com> <jan.viljanen@greenpeace.org>
|
|
||||||
Javier Lopez <graulopezjavier@gmail.com> Javier López
|
|
||||||
Jit Yao Yap <jityao@gmail.com> <jityao+github@gmail.com>
|
|
||||||
Jit Yao Yap <jityao@gmail.com> Jit
|
|
||||||
John Gehrig <jdg.gehrig@gmail.com> <jgehrig@users.noreply.github.com>
|
|
||||||
John Schmidt <john.schmidt.h@gmail.com> John
|
|
||||||
John Szakmeister <john@szakmeister.net> <jszakmeister@users.noreply.github.com>
|
|
||||||
Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> <jdebp@users.noreply.github.com>
|
|
||||||
Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> <postmaster@localhost>
|
|
||||||
Jurica Bradaric <jbradaric@gmail.com> <jbradaric@users.noreply.github.com>
|
|
||||||
Jurica Bradaric <jbradaric@gmail.com> <jurica.bradaric@avl.com>
|
|
||||||
KillTheMule <KillTheMule@users.noreply.github.com> <github@pipsfrank.de>
|
|
||||||
Kwon-Young Choi <kwon-young.choi@hotmail.fr> Kwon-Young
|
|
||||||
Lucas Hoffmann <l-m-h@web.de> <lucc@posteo.de>
|
|
||||||
Lucas Hoffmann <l-m-h@web.de> <lucc@users.noreply.github.com>
|
|
||||||
Marco Hinz <mh.codebro@gmail.com> <mh.codebro+github@gmail.com>
|
|
||||||
Marvim the Paranoid Android <marvim@users.noreply.github.com> marvim
|
|
||||||
Mateusz Czapliński <czapkofan@gmail.com> Mateusz Czaplinski
|
|
||||||
Mathias Fussenegger <f.mathias@zignar.net> <mfussenegger@users.noreply.github.com>
|
|
||||||
Mathias Fussenegger <f.mathias@zignar.net> Mathias Fußenegger
|
|
||||||
Matt Wozniski <godlygeek@gmail.com> <godlygeek+git@gmail.com>
|
|
||||||
Matthieu Coudron <mattator@gmail.com> <coudron@iij.ad.jp>
|
|
||||||
Matthieu Coudron <mattator@gmail.com> <matthieu.coudron@upmc.fr>
|
|
||||||
Matthieu Coudron <mattator@gmail.com> <mcoudron@hotmail.com>
|
|
||||||
Matthieu Coudron <mattator@gmail.com> <teto@users.noreply.github.com>
|
|
||||||
MichaHoffmann <michoffmann.potsdam@gmail.com> Michael Hoffmann
|
|
||||||
MichaHoffmann <michoffmann.potsdam@gmail.com> micha
|
|
||||||
Michael Ennen <mike.ennen@gmail.com> <brcolow@users.noreply.github.com>
|
|
||||||
Michael Ennen <mike.ennen@gmail.com> brcolow
|
|
||||||
Michael Reed <m.reed@mykolab.com> <Pyrohh@users.noreply.github.com>
|
|
||||||
Michael Schupikov <michael@schupikov.de> <DarkDeepBlue@users.noreply.github.com>
|
|
||||||
Nicolas Hillegeer <nicolas@hillegeer.com> <nicolashillegeer@gmail.com>
|
|
||||||
Panashe M. Fundira <fundirap@gmail.com> Panashe Fundira
|
|
||||||
Patrice Peterson <patrice.peterson@mailbox.org> runiq
|
|
||||||
Pavel Platto <hinidu@gmail.com> Hinidu
|
|
||||||
Petter Wahlman <petter@wahlman.no> <pwahlman@cisco.com>
|
|
||||||
Poh Zi How <poh.zihow@gmail.com> pohzipohzi
|
|
||||||
Rich Wareham <rjw57@cam.ac.uk> <rjw57@cantab.net>
|
|
||||||
Rui Abreu Ferreira <equalsraf@users.noreply.github.com> @equalsraf
|
|
||||||
Rui Abreu Ferreira <raf-ep@gmx.com> <equalsraf@users.noreply.github.com>
|
|
||||||
Rui Abreu Ferreira <raf-ep@gmx.com> <rap-ep@gmx.com>
|
|
||||||
Sam Wilson <tecywiz121@hotmail.com> <sawilson@akamai.com>
|
|
||||||
Sander Bosma <sanderbosma@gmail.com> sander2
|
|
||||||
Santos Gallegos <stsewd@protonmail.com> <santos_g@outlook.com>
|
|
||||||
Sebastian Parborg <darkdefende@gmail.com> DarkDefender
|
|
||||||
Shirasaka <tk.shirasaka@gmail.com> tk-shirasaka
|
|
||||||
Shota <shotat@users.noreply.github.com> shotat
|
|
||||||
Shougo Matsushita <Shougo.Matsu@gmail.com> Shougo
|
|
||||||
Stephan Seitz <stephan.seitz@fau.de> <stephan.lauf@yahoo.de>
|
|
||||||
Steven Sojka <Steven.Sojka@tdameritrade.com> <steelsojka@gmail.com>
|
|
||||||
Steven Sojka <steelsojka@gmail.com> <steelsojka@users.noreply.github.com>
|
|
||||||
TJ DeVries <devries.timothyj@gmail.com> <timothydvrs1234@gmail.com>
|
|
||||||
Thomas Fehér <thomas.feher@yahoo.de> <thomasfeher@web.de>
|
|
||||||
Thomas Vigouroux <tomvig38@gmail.com> <39092278+vigoux@users.noreply.github.com>
|
|
||||||
Utkarsh Maheshwari <UtkarshME96@gmail.com> UTkarsh Maheshwari
|
|
||||||
Utkarsh Maheshwari <utkarshme96@gmail.com> <UtkarshME96@gmail.com>
|
|
||||||
VVKot <volodymyr.kot.ua@gmail.com> Volodymyr Kot
|
|
||||||
Victor Adam <victor.adam@cofelyineo-gdfsuez.com> <Victor.Adam@derpymail.org>
|
|
||||||
Wang Shidong <wsdjeg@outlook.com> <wsdjeg@users.noreply.github.com>
|
|
||||||
Wei Huang <daviseago@gmail.com> davix
|
|
||||||
Xu Cheng <xucheng@me.com> <xu-cheng@users.noreply.github.com>
|
|
||||||
Yamakaky <yamakaky@gmail.com> <yamakaky@yamaworld.fr>
|
|
||||||
Yegappan Lakshmanan <yegappan@yahoo.com> <4298407+yegappan@users.noreply.github.com>
|
|
||||||
Yichao Zhou <broken.zhoug@gmail.com> Yichao Zhou <broken.zhou@gmail.com>
|
|
||||||
Yichao Zhou <broken.zhoug@gmail.com> zhou13 <broken.zhou@gmail.com>
|
|
||||||
Yorick Peterse <git@yorickpeterse.com> <yorick@yorickpeterse.com>
|
|
||||||
ZyX <kp-pav@yandex.ru> <kp-pav@ya.ru>
|
|
||||||
ZyX <kp-pav@yandex.ru> Nikolai Aleksandrovich Pavlov
|
|
||||||
aph <a.hewson@gmail.com> Ashley Hewson
|
|
||||||
butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com> We're Yet
|
|
||||||
chemzqm <chemzqm@gmail.com> Qiming zhao
|
|
||||||
chentau <tchen1998@gmail.com> Tony Chen
|
|
||||||
dedmass <carlo.abelli@gmail.com> Carlo Abelli
|
|
||||||
equal-l2 <eng.equall2@gmail.com> <equal-l2@users.noreply.github.com>
|
|
||||||
francisco souza <fsouza@users.noreply.github.com> <108725+fsouza@users.noreply.github.com>
|
|
||||||
glacambre <code@lacamb.re> <me@r4>
|
|
||||||
glacambre <code@lacamb.re> Ghjuvan Lacambre
|
|
||||||
ii14 <ii14@users.noreply.github.com> <59243201+ii14@users.noreply.github.com>
|
|
||||||
jdrouhard <john@jmdtech.org> <github@jmdtech.org>
|
|
||||||
kuuote <znmxodq1@gmail.com> <36663503+kuuote@users.noreply.github.com>
|
|
||||||
matveyt <matthewtarasov@gmail.com> <35012635+matveyt@users.noreply.github.com>
|
|
||||||
nate <nateozemon@gmail.com> nateozem
|
|
||||||
ray-x <rayx.cn@gmail.com> rayx
|
|
||||||
relnod <mail@paul-schiffers.de> <relnod@users.noreply.github.com>
|
|
||||||
rockerBOO <rockerboo@gmail.com> Dave Lage
|
|
||||||
rpigott <rpigott@berkeley.edu> Ronan Pigott
|
|
||||||
sach1t <sach0010t@gmail.com> <sach1t@users.noreply.github.com>
|
|
||||||
shade-of-noon <73705427+shade-of-noon@users.noreply.github.com> Edwin Pujols
|
|
||||||
shadmansaleh <shadmansaleh3@gmail.com> <13149513+shadmansaleh@users.noreply.github.com>
|
|
||||||
shadmansaleh <shadmansaleh3@gmail.com> Shadman
|
|
||||||
sohnryang <loop.infinitely@gmail.com> 손량
|
|
||||||
timeyyy <timeyyy_da_man@hotmail.com> Timothy C Eichler
|
|
||||||
timeyyy <timeyyy_da_man@hotmail.com> timothy eichler
|
|
@@ -12,9 +12,6 @@ endif()
|
|||||||
if(POLICY CMP0060)
|
if(POLICY CMP0060)
|
||||||
cmake_policy(SET CMP0060 NEW)
|
cmake_policy(SET CMP0060 NEW)
|
||||||
endif()
|
endif()
|
||||||
if(POLICY CMP0075)
|
|
||||||
cmake_policy(SET CMP0075 NEW)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Point CMake at any custom modules we may ship
|
# Point CMake at any custom modules we may ship
|
||||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||||
@@ -139,12 +136,12 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
|||||||
# If not in a git repo (e.g., a tarball) these tokens define the complete
|
# If not in a git repo (e.g., a tarball) these tokens define the complete
|
||||||
# version string, else they are combined with the result of `git describe`.
|
# version string, else they are combined with the result of `git describe`.
|
||||||
set(NVIM_VERSION_MAJOR 0)
|
set(NVIM_VERSION_MAJOR 0)
|
||||||
set(NVIM_VERSION_MINOR 7)
|
set(NVIM_VERSION_MINOR 6)
|
||||||
set(NVIM_VERSION_PATCH 0)
|
set(NVIM_VERSION_PATCH 2)
|
||||||
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers
|
||||||
|
|
||||||
# API level
|
# API level
|
||||||
set(NVIM_API_LEVEL 9) # Bump this after any API change.
|
set(NVIM_API_LEVEL 8) # Bump this after any API change.
|
||||||
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
|
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
|
||||||
set(NVIM_API_PRERELEASE false)
|
set(NVIM_API_PRERELEASE false)
|
||||||
|
|
||||||
@@ -284,9 +281,6 @@ if(MSVC)
|
|||||||
else()
|
else()
|
||||||
add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter
|
add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter
|
||||||
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
|
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
|
||||||
-Wdouble-promotion
|
|
||||||
-Wmissing-noreturn
|
|
||||||
-Wmissing-format-attribute
|
|
||||||
-Wmissing-prototypes)
|
-Wmissing-prototypes)
|
||||||
|
|
||||||
check_c_compiler_flag(-Wimplicit-fallthrough HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
|
check_c_compiler_flag(-Wimplicit-fallthrough HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||||
@@ -294,27 +288,6 @@ else()
|
|||||||
add_compile_options(-Wimplicit-fallthrough)
|
add_compile_options(-Wimplicit-fallthrough)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Clang doesn't have -Wsuggest-attribute so check for each one.
|
|
||||||
check_c_compiler_flag(-Wsuggest-attribute=pure HAVE_WSUGGEST_ATTRIBUTE_PURE)
|
|
||||||
if(HAVE_WSUGGEST_ATTRIBUTE_PURE)
|
|
||||||
add_compile_options(-Wsuggest-attribute=pure)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
check_c_compiler_flag(-Wsuggest-attribute=const HAVE_WSUGGEST_ATTRIBUTE_CONST)
|
|
||||||
if(HAVE_WSUGGEST_ATTRIBUTE_CONST)
|
|
||||||
add_compile_options(-Wsuggest-attribute=const)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
check_c_compiler_flag(-Wsuggest-attribute=malloc HAVE_WSUGGEST_ATTRIBUTE_MALLOC)
|
|
||||||
if(HAVE_WSUGGEST_ATTRIBUTE_MALLOC)
|
|
||||||
add_compile_options(-Wsuggest-attribute=malloc)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
check_c_compiler_flag(-Wsuggest-attribute=cold HAVE_WSUGGEST_ATTRIBUTE_COLD)
|
|
||||||
if(HAVE_WSUGGEST_ATTRIBUTE_COLD)
|
|
||||||
add_compile_options(-Wsuggest-attribute=cold)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
|
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
|
||||||
# 3.4.1 used there.
|
# 3.4.1 used there.
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
|
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
@@ -414,7 +387,7 @@ include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
|
|||||||
find_package(Msgpack 1.0.0 REQUIRED)
|
find_package(Msgpack 1.0.0 REQUIRED)
|
||||||
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
|
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
|
||||||
|
|
||||||
find_package(LibLUV 1.43.0 REQUIRED)
|
find_package(LibLUV 1.30.0 REQUIRED)
|
||||||
include_directories(SYSTEM ${LIBLUV_INCLUDE_DIRS})
|
include_directories(SYSTEM ${LIBLUV_INCLUDE_DIRS})
|
||||||
|
|
||||||
find_package(TreeSitter REQUIRED)
|
find_package(TreeSitter REQUIRED)
|
||||||
@@ -435,19 +408,6 @@ main(void)
|
|||||||
if(TS_HAS_SET_MATCH_LIMIT)
|
if(TS_HAS_SET_MATCH_LIMIT)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_MATCH_LIMIT")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_MATCH_LIMIT")
|
||||||
endif()
|
endif()
|
||||||
check_c_source_compiles("
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <tree_sitter/api.h>
|
|
||||||
int
|
|
||||||
main(void)
|
|
||||||
{
|
|
||||||
ts_set_allocator(malloc, calloc, realloc, free);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
" TS_HAS_SET_ALLOCATOR)
|
|
||||||
if(TS_HAS_SET_ALLOCATOR)
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_ALLOCATOR")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Note: The test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
|
# Note: The test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
|
||||||
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
|
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
|
||||||
@@ -583,33 +543,6 @@ endif()
|
|||||||
|
|
||||||
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
|
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
|
||||||
|
|
||||||
if(DEBUG)
|
|
||||||
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" OFF)
|
|
||||||
else()
|
|
||||||
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(COMPILE_LUA AND NOT WIN32)
|
|
||||||
if(PREFER_LUA)
|
|
||||||
foreach(CURRENT_LUAC_PRG luac5.1 luac)
|
|
||||||
find_program(_CHECK_LUAC_PRG ${CURRENT_LUAC_PRG})
|
|
||||||
if(_CHECK_LUAC_PRG)
|
|
||||||
set(LUAC_PRG "${_CHECK_LUAC_PRG} -s -o - %s" CACHE STRING "Format for compiling to Lua bytecode")
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
elseif(LUA_PRG MATCHES "luajit")
|
|
||||||
check_lua_module(${LUA_PRG} "jit.bcsave" LUAJIT_HAS_JIT_BCSAVE)
|
|
||||||
if(LUAJIT_HAS_JIT_BCSAVE)
|
|
||||||
set(LUAC_PRG "${LUA_PRG} -b -s %s -" CACHE STRING "Format for compiling to Lua bytecode")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(LUAC_PRG)
|
|
||||||
message(STATUS "Using Lua compiler: ${LUAC_PRG}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Setup busted.
|
# Setup busted.
|
||||||
find_program(BUSTED_PRG NAMES busted busted.bat)
|
find_program(BUSTED_PRG NAMES busted busted.bat)
|
||||||
find_program(BUSTED_LUA_PRG busted-lua)
|
find_program(BUSTED_LUA_PRG busted-lua)
|
||||||
@@ -763,6 +696,17 @@ else()
|
|||||||
COMMENT "lualint: LUACHECK_PRG not defined")
|
COMMENT "lualint: LUACHECK_PRG not defined")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(CPACK_PACKAGE_NAME "Neovim")
|
||||||
|
set(CPACK_PACKAGE_VENDOR "neovim.io")
|
||||||
|
set(CPACK_PACKAGE_VERSION ${NVIM_VERSION_MEDIUM})
|
||||||
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Neovim")
|
||||||
|
# Set toplevel directory/installer name as Neovim
|
||||||
|
set(CPACK_PACKAGE_FILE_NAME "Neovim")
|
||||||
|
set(CPACK_TOPLEVEL_TAG "Neovim")
|
||||||
|
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||||
|
set(CPACK_NSIS_MODIFY_PATH ON)
|
||||||
|
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
||||||
|
include(CPack)
|
||||||
|
|
||||||
#add uninstall target
|
#add uninstall target
|
||||||
if(NOT TARGET uninstall)
|
if(NOT TARGET uninstall)
|
||||||
@@ -774,8 +718,3 @@ if(NOT TARGET uninstall)
|
|||||||
add_custom_target(uninstall
|
add_custom_target(uninstall
|
||||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/UninstallHelper.cmake)
|
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/UninstallHelper.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
add_subdirectory(packaging)
|
|
||||||
endif()
|
|
||||||
|
@@ -7,11 +7,11 @@ Getting started
|
|||||||
If you want to help but don't know where to start, here are some
|
If you want to help but don't know where to start, here are some
|
||||||
low-risk/isolated tasks:
|
low-risk/isolated tasks:
|
||||||
|
|
||||||
- Try a [complexity:low] issue.
|
- [Merge a Vim patch].
|
||||||
|
- Try a [good first issue](../../labels/good-first-issue) or [complexity:low] issue.
|
||||||
- Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or
|
- Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or
|
||||||
[Coverity](#coverity).
|
[Coverity](#coverity).
|
||||||
- [Improve documentation][wiki-contribute-help]
|
- [Improve documentation][wiki-contribute-help]
|
||||||
- [Merge a Vim patch] (familiarity with Vim is *strongly* recommended)
|
|
||||||
|
|
||||||
Reporting problems
|
Reporting problems
|
||||||
------------------
|
------------------
|
||||||
@@ -244,10 +244,6 @@ You can lint a single file (but this will _not_ exclude legacy errors):
|
|||||||
("Exuberant ctags", the typical `ctags` binary provided by your distro, is
|
("Exuberant ctags", the typical `ctags` binary provided by your distro, is
|
||||||
unmaintained and won't recognize many function signatures in Neovim source.)
|
unmaintained and won't recognize many function signatures in Neovim source.)
|
||||||
- Explore the source code [on the web](https://sourcegraph.com/github.com/neovim/neovim).
|
- Explore the source code [on the web](https://sourcegraph.com/github.com/neovim/neovim).
|
||||||
- If using [lua-language-server][], symlink `contrib/luarc.json` into the
|
|
||||||
project root:
|
|
||||||
|
|
||||||
$ ln -s contrib/luarc.json .luarc.json
|
|
||||||
|
|
||||||
|
|
||||||
Reviewing
|
Reviewing
|
||||||
@@ -256,10 +252,10 @@ Reviewing
|
|||||||
To help review pull requests, start with [this checklist][review-checklist].
|
To help review pull requests, start with [this checklist][review-checklist].
|
||||||
|
|
||||||
Reviewing can be done on GitHub, but you may find it easier to do locally.
|
Reviewing can be done on GitHub, but you may find it easier to do locally.
|
||||||
Using [GitHub CLI][gh], you can create a new branch with the contents of a pull
|
Using [`hub`][hub], you can create a new branch with the contents of a pull
|
||||||
request, e.g. [#1820][1820]:
|
request, e.g. [#1820][1820]:
|
||||||
|
|
||||||
gh pr checkout https://github.com/neovim/neovim/pull/1820
|
hub checkout https://github.com/neovim/neovim/pull/1820
|
||||||
|
|
||||||
Use [`git log -p master..FETCH_HEAD`][git-history-filtering] to list all
|
Use [`git log -p master..FETCH_HEAD`][git-history-filtering] to list all
|
||||||
commits in the feature branch which aren't in the `master` branch; `-p`
|
commits in the feature branch which aren't in the `master` branch; `-p`
|
||||||
@@ -274,7 +270,7 @@ as context, use the `-W` argument as well.
|
|||||||
[git-rebasing]: http://git-scm.com/book/en/v2/Git-Branching-Rebasing
|
[git-rebasing]: http://git-scm.com/book/en/v2/Git-Branching-Rebasing
|
||||||
[github-issues]: https://github.com/neovim/neovim/issues
|
[github-issues]: https://github.com/neovim/neovim/issues
|
||||||
[1820]: https://github.com/neovim/neovim/pull/1820
|
[1820]: https://github.com/neovim/neovim/pull/1820
|
||||||
[gh]: https://cli.github.com/
|
[hub]: https://hub.github.com/
|
||||||
[conventional_commits]: https://www.conventionalcommits.org
|
[conventional_commits]: https://www.conventionalcommits.org
|
||||||
[style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style
|
[style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style
|
||||||
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
|
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
|
||||||
@@ -289,7 +285,6 @@ as context, use the `-W` argument as well.
|
|||||||
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
|
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
|
||||||
[master error list]: https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json
|
[master error list]: https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json
|
||||||
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp
|
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp
|
||||||
[pr-draft]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
|
[pr-draft]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
|
||||||
[pr-ready]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request
|
[pr-ready]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request
|
||||||
[uncrustify]: http://uncrustify.sourceforge.net/
|
[uncrustify]: https://formulae.brew.sh/formula/uncrustify
|
||||||
[lua-language-server]: https://github.com/sumneko/lua-language-server/
|
|
||||||
|
@@ -52,7 +52,7 @@ has a major bug:
|
|||||||
3. Cut a release from `release-x.y`.
|
3. Cut a release from `release-x.y`.
|
||||||
- Run `./scripts/release.sh`
|
- Run `./scripts/release.sh`
|
||||||
- Update (force-push) the remote `stable` tag.
|
- Update (force-push) the remote `stable` tag.
|
||||||
- The [nightly job](https://github.com/neovim/neovim/blob/master/.github/workflows/release.yml#L4)
|
- The [nightly job](https://github.com/neovim/bot-ci/blob/master/ci/nightly.sh)
|
||||||
will update the release assets based on the `stable` tag.
|
will update the release assets based on the `stable` tag.
|
||||||
|
|
||||||
The neovim repository includes a backport [github action](https://github.com/zeebe-io/backport-action).
|
The neovim repository includes a backport [github action](https://github.com/zeebe-io/backport-action).
|
||||||
@@ -76,12 +76,6 @@ These "bundled" dependencies can be updated by bumping their versions in `third-
|
|||||||
- [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
|
- [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
|
||||||
- [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
- [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
||||||
|
|
||||||
`scripts/bump-dep.sh` is a script that can automate this process for `LuaJIT`, `Luv`, `libuv` & `tree-sitter`. See usage guide:
|
|
||||||
- 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): `
|
|
||||||
|
|
||||||
These dependencies are "vendored" (inlined), we need to update the sources manually:
|
These dependencies are "vendored" (inlined), we need to update the sources manually:
|
||||||
- [libmpack](https://github.com/libmpack/libmpack)
|
- [libmpack](https://github.com/libmpack/libmpack)
|
||||||
- [xdiff](https://github.com/git/git/tree/master/xdiff)
|
- [xdiff](https://github.com/git/git/tree/master/xdiff)
|
||||||
|
2
Makefile
2
Makefile
@@ -166,7 +166,7 @@ _opt_pylint:
|
|||||||
|| echo "SKIP: pylint (flake8 not found)"
|
|| echo "SKIP: pylint (flake8 not found)"
|
||||||
|
|
||||||
commitlint:
|
commitlint:
|
||||||
$(NVIM_PRG) -u NONE -es +"lua require('scripts.lintcommit').main({trace=false})"
|
$(NVIM_PRG) --clean -es +"lua require('scripts.lintcommit').main({trace=false})"
|
||||||
|
|
||||||
_opt_commitlint:
|
_opt_commitlint:
|
||||||
@test -x build/bin/nvim && { $(MAKE) commitlint; exit $$?; } \
|
@test -x build/bin/nvim && { $(MAKE) commitlint; exit $$?; } \
|
||||||
|
@@ -1,6 +1,4 @@
|
|||||||
<h1 align="center">
|
[](https://neovim.io)
|
||||||
<img src="https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png" alt="Neovim">
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
[Documentation](https://neovim.io/doc/general/) |
|
[Documentation](https://neovim.io/doc/general/) |
|
||||||
[Chat](https://app.element.io/#/room/#neovim:matrix.org) |
|
[Chat](https://app.element.io/#/room/#neovim:matrix.org) |
|
||||||
@@ -121,7 +119,7 @@ Apache 2.0 license, except for contributions copied from Vim (identified by the
|
|||||||
[Managed packages]: https://github.com/neovim/neovim/wiki/Installing-Neovim#install-from-package
|
[Managed packages]: https://github.com/neovim/neovim/wiki/Installing-Neovim#install-from-package
|
||||||
[Debian]: https://packages.debian.org/testing/neovim
|
[Debian]: https://packages.debian.org/testing/neovim
|
||||||
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
|
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
|
||||||
[Fedora]: https://packages.fedoraproject.org/pkgs/neovim/neovim/
|
[Fedora]: https://apps.fedoraproject.org/packages/neovim
|
||||||
[Arch Linux]: https://www.archlinux.org/packages/?q=neovim
|
[Arch Linux]: https://www.archlinux.org/packages/?q=neovim
|
||||||
[Void Linux]: https://voidlinux.org/packages/?arch=x86_64&q=neovim
|
[Void Linux]: https://voidlinux.org/packages/?arch=x86_64&q=neovim
|
||||||
[Gentoo]: https://packages.gentoo.org/packages/app-editors/neovim
|
[Gentoo]: https://packages.gentoo.org/packages/app-editors/neovim
|
||||||
|
@@ -7,8 +7,6 @@ CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
source "${CI_DIR}/common/build.sh"
|
source "${CI_DIR}/common/build.sh"
|
||||||
source "${CI_DIR}/common/suite.sh"
|
source "${CI_DIR}/common/suite.sh"
|
||||||
|
|
||||||
mkdir -p "${HOME}/.cache"
|
|
||||||
|
|
||||||
echo "before_cache.sh: cache size"
|
echo "before_cache.sh: cache size"
|
||||||
du -chd 1 "${HOME}/.cache" | sort -rh | head -20
|
du -chd 1 "${HOME}/.cache" | sort -rh | head -20
|
||||||
|
|
||||||
@@ -18,7 +16,7 @@ ccache -s 2>/dev/null || true
|
|||||||
find "${HOME}/.ccache" -name stats -delete
|
find "${HOME}/.ccache" -name stats -delete
|
||||||
|
|
||||||
# Update the third-party dependency cache only if the build was successful.
|
# Update the third-party dependency cache only if the build was successful.
|
||||||
if ended_successfully && [ -d "${DEPS_BUILD_DIR}" ]; then
|
if ended_successfully; then
|
||||||
# Do not cache downloads. They should not be needed with up-to-date deps.
|
# Do not cache downloads. They should not be needed with up-to-date deps.
|
||||||
rm -rf "${DEPS_BUILD_DIR}/build/downloads"
|
rm -rf "${DEPS_BUILD_DIR}/build/downloads"
|
||||||
rm -rf "${CACHE_NVIM_DEPS_DIR}"
|
rm -rf "${CACHE_NVIM_DEPS_DIR}"
|
||||||
|
46
ci/before_install.sh
Executable file
46
ci/before_install.sh
Executable file
@@ -0,0 +1,46 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
echo 'Python info:'
|
||||||
|
(
|
||||||
|
set -x
|
||||||
|
python3 --version
|
||||||
|
python2 --version
|
||||||
|
python --version
|
||||||
|
pip3 --version
|
||||||
|
pip2 --version
|
||||||
|
pip --version
|
||||||
|
|
||||||
|
pyenv --version
|
||||||
|
pyenv versions
|
||||||
|
) 2>&1 | sed 's/^/ /' || true
|
||||||
|
|
||||||
|
# Use pyenv, but not for OSX on Travis, where it only has the "system" version.
|
||||||
|
if [[ "${TRAVIS_OS_NAME}" != osx ]] && command -v pyenv; then
|
||||||
|
echo 'Setting Python versions via pyenv'
|
||||||
|
|
||||||
|
# Prefer Python 2 over 3 (more conservative).
|
||||||
|
pyenv global 2.7:3.8
|
||||||
|
|
||||||
|
echo 'Updated Python info:'
|
||||||
|
(
|
||||||
|
set -x
|
||||||
|
python3 --version
|
||||||
|
python2 --version
|
||||||
|
python --version
|
||||||
|
|
||||||
|
python3 -m pip --version
|
||||||
|
python2 -m pip --version
|
||||||
|
) 2>&1 | sed 's/^/ /'
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Install node (LTS)"
|
||||||
|
|
||||||
|
if [[ "${TRAVIS_OS_NAME}" == osx ]] || [ ! -f ~/.nvm/nvm.sh ]; then
|
||||||
|
curl -o ~/.nvm/nvm.sh https://raw.githubusercontent.com/creationix/nvm/master/nvm.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
source ~/.nvm/nvm.sh
|
||||||
|
nvm install 10
|
@@ -6,6 +6,12 @@ set -o pipefail
|
|||||||
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
source "${CI_DIR}/common/build.sh"
|
source "${CI_DIR}/common/build.sh"
|
||||||
|
|
||||||
|
# Enable ipv6 on Travis. ref: a39c8b7ce30d
|
||||||
|
if test -n "${TRAVIS_OS_NAME}" && ! test "${TRAVIS_OS_NAME}" = osx ; then
|
||||||
|
echo "before_script.sh: enable ipv6"
|
||||||
|
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
|
||||||
|
fi
|
||||||
|
|
||||||
# Test some of the configuration variables.
|
# Test some of the configuration variables.
|
||||||
if [[ -n "${GCOV}" ]] && [[ ! $(type -P "${GCOV}") ]]; then
|
if [[ -n "${GCOV}" ]] && [[ ! $(type -P "${GCOV}") ]]; then
|
||||||
echo "\$GCOV: '${GCOV}' is not executable."
|
echo "\$GCOV: '${GCOV}' is not executable."
|
||||||
@@ -21,6 +27,13 @@ ccache -s
|
|||||||
# Reset ccache stats for real results in before_cache.
|
# Reset ccache stats for real results in before_cache.
|
||||||
ccache --zero-stats
|
ccache --zero-stats
|
||||||
|
|
||||||
|
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||||
|
# Adds user to a dummy group.
|
||||||
|
# That allows to test changing the group of the file by `os_fchown`.
|
||||||
|
sudo dscl . -create /Groups/chown_test
|
||||||
|
sudo dscl . -append /Groups/chown_test GroupMembership "${USER}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Compile dependencies.
|
# Compile dependencies.
|
||||||
build_deps
|
build_deps
|
||||||
|
|
||||||
|
45
ci/build.ps1
45
ci/build.ps1
@@ -77,16 +77,11 @@ if ($compiler -eq 'MINGW') {
|
|||||||
}
|
}
|
||||||
elseif ($compiler -eq 'MSVC') {
|
elseif ($compiler -eq 'MSVC') {
|
||||||
$cmakeGeneratorArgs = '/verbosity:normal'
|
$cmakeGeneratorArgs = '/verbosity:normal'
|
||||||
$cmakeGenerator = 'Visual Studio 16 2019'
|
if ($bits -eq 32) {
|
||||||
}
|
$cmakeGenerator = 'Visual Studio 15 2017'
|
||||||
|
}
|
||||||
if ($compiler -eq 'MSVC') {
|
elseif ($bits -eq 64) {
|
||||||
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
$cmakeGenerator = 'Visual Studio 15 2017 Win64'
|
||||||
if ($installationPath -and (test-path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
|
|
||||||
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x${bits} -no_logo && set" | foreach-object {
|
|
||||||
$name, $value = $_ -split '=', 2
|
|
||||||
set-content env:\"$name" $value
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,35 +99,24 @@ if (-not $NoTests) {
|
|||||||
npm.cmd link neovim
|
npm.cmd link neovim
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($compiler -eq 'MSVC') {
|
||||||
|
# Required for LuaRocks (https://github.com/luarocks/luarocks/issues/1039#issuecomment-507296940).
|
||||||
|
$env:VCINSTALLDIR = "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/"
|
||||||
|
}
|
||||||
|
|
||||||
function convertToCmakeArgs($vars) {
|
function convertToCmakeArgs($vars) {
|
||||||
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
|
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
|
||||||
}
|
}
|
||||||
|
|
||||||
cd $env:DEPS_BUILD_DIR
|
cd $env:DEPS_BUILD_DIR
|
||||||
if ($compiler -eq 'MSVC') {
|
cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
|
||||||
if ($bits -eq 32) {
|
|
||||||
cmake -G $cmakeGenerator -A Win32 $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
|
|
||||||
} else {
|
|
||||||
cmake -G $cmakeGenerator -A x64 $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
|
|
||||||
}
|
|
||||||
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
|
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
|
||||||
cd $buildDir
|
cd $buildDir
|
||||||
|
|
||||||
# Build Neovim
|
# Build Neovim
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
if ($compiler -eq 'MSVC') {
|
cmake -G $cmakeGenerator $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
|
||||||
if ($bits -eq 32) {
|
|
||||||
cmake -G $cmakeGenerator -A Win32 $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
|
|
||||||
} else {
|
|
||||||
cmake -G $cmakeGenerator -A x64 $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
cmake -G $cmakeGenerator $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
|
|
||||||
}
|
|
||||||
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
|
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
|
||||||
.\bin\nvim --version ; exitIfFailed
|
.\bin\nvim --version ; exitIfFailed
|
||||||
|
|
||||||
@@ -183,4 +167,7 @@ if (Test-Path -Path $env:ChocolateyInstall\bin\cpack.exe) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Build artifacts
|
# Build artifacts
|
||||||
cpack -C $cmakeBuildType
|
cpack -G ZIP -C RelWithDebInfo
|
||||||
|
if ($env:APPVEYOR_REPO_TAG_NAME -ne $null) {
|
||||||
|
cpack -G NSIS -C RelWithDebInfo
|
||||||
|
}
|
||||||
|
@@ -8,6 +8,8 @@ _stat() {
|
|||||||
|
|
||||||
top_make() {
|
top_make() {
|
||||||
printf '%78s\n' | tr ' ' '='
|
printf '%78s\n' | tr ' ' '='
|
||||||
|
# Travis has 1.5 virtual cores according to:
|
||||||
|
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
|
||||||
ninja "$@"
|
ninja "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,9 +46,7 @@ build_deps() {
|
|||||||
cd "${CI_BUILD_DIR}"
|
cd "${CI_BUILD_DIR}"
|
||||||
}
|
}
|
||||||
|
|
||||||
build_nvim() {
|
prepare_build() {
|
||||||
check_core_dumps --delete quiet
|
|
||||||
|
|
||||||
if test -n "${CLANG_SANITIZER}" ; then
|
if test -n "${CLANG_SANITIZER}" ; then
|
||||||
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
|
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
|
||||||
fi
|
fi
|
||||||
@@ -55,8 +55,9 @@ build_nvim() {
|
|||||||
cd "${BUILD_DIR}"
|
cd "${BUILD_DIR}"
|
||||||
echo "Configuring with '${CMAKE_FLAGS} $@'."
|
echo "Configuring with '${CMAKE_FLAGS} $@'."
|
||||||
cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}"
|
cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}"
|
||||||
|
}
|
||||||
|
|
||||||
|
build_nvim() {
|
||||||
echo "Building nvim."
|
echo "Building nvim."
|
||||||
if ! top_make nvim ; then
|
if ! top_make nvim ; then
|
||||||
exit 1
|
exit 1
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
# Args:
|
# Args:
|
||||||
# $1: Flag(s) for codecov, separated by comma.
|
# $1: Flag(s) for codecov, separated by comma.
|
||||||
|
|
||||||
set -e
|
set -ex
|
||||||
|
|
||||||
# Change to grandparent dir (POSIXly).
|
# Change to grandparent dir (POSIXly).
|
||||||
CDPATH='' cd -P -- "$(dirname -- "$0")/../.." || exit
|
CDPATH='' cd -P -- "$(dirname -- "$0")/../.." || exit
|
||||||
@@ -18,12 +18,12 @@ if ! [ -f "$codecov_sh" ]; then
|
|||||||
curl --retry 5 --silent --fail -o "$codecov_sh" https://codecov.io/bash
|
curl --retry 5 --silent --fail -o "$codecov_sh" https://codecov.io/bash
|
||||||
chmod +x "$codecov_sh"
|
chmod +x "$codecov_sh"
|
||||||
|
|
||||||
python -m pip install --quiet --user gcovr
|
python3 -m pip install --quiet --user gcovr
|
||||||
fi
|
fi
|
||||||
|
|
||||||
(
|
(
|
||||||
cd build
|
cd build
|
||||||
python -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 --exclude '.*/auto/.*' --root .. --delete -o ../coverage.xml --xml
|
python3 -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 --exclude '.*/auto/.*' --root .. --delete -o ../coverage.xml --xml
|
||||||
)
|
)
|
||||||
|
|
||||||
# Upload to codecov.
|
# Upload to codecov.
|
||||||
|
@@ -1,3 +1,9 @@
|
|||||||
|
# HACK: get newline for use in strings given that "\n" and $'' do not work.
|
||||||
|
NL="$(printf '\nE')"
|
||||||
|
NL="${NL%E}"
|
||||||
|
|
||||||
|
FAIL_SUMMARY=""
|
||||||
|
|
||||||
# Test success marker. If END_MARKER file exists, we know that all tests
|
# Test success marker. If END_MARKER file exists, we know that all tests
|
||||||
# finished. If FAIL_SUMMARY_FILE exists we know that some tests failed, this
|
# finished. If FAIL_SUMMARY_FILE exists we know that some tests failed, this
|
||||||
# file will contain information about failed tests. Build is considered
|
# file will contain information about failed tests. Build is considered
|
||||||
@@ -5,27 +11,190 @@
|
|||||||
END_MARKER="$BUILD_DIR/.tests_finished"
|
END_MARKER="$BUILD_DIR/.tests_finished"
|
||||||
FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors"
|
FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors"
|
||||||
|
|
||||||
|
ANSI_CLEAR="\033[0K"
|
||||||
|
|
||||||
|
if test "$TRAVIS" = "true"; then
|
||||||
|
ci_fold() {
|
||||||
|
local action="$1"
|
||||||
|
local name="$2"
|
||||||
|
name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
|
||||||
|
name="$(echo -n "$name" | sed 's/-$//')"
|
||||||
|
echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
|
||||||
|
}
|
||||||
|
elif test "$GITHUB_ACTIONS" = "true"; then
|
||||||
|
ci_fold() {
|
||||||
|
local action="$1"
|
||||||
|
local name="$2"
|
||||||
|
name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
|
||||||
|
name="$(echo -n "$name" | sed 's/-$//')"
|
||||||
|
case "$action" in
|
||||||
|
start)
|
||||||
|
echo "::group::${name}"
|
||||||
|
;;
|
||||||
|
end)
|
||||||
|
echo "::endgroup::"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
:;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ci_fold() {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
enter_suite() {
|
||||||
|
set +x
|
||||||
|
FAILED=0
|
||||||
|
rm -f "${END_MARKER}"
|
||||||
|
local suite_name="$1"
|
||||||
|
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE}/$suite_name"
|
||||||
|
ci_fold start "${NVIM_TEST_CURRENT_SUITE}"
|
||||||
|
set -x
|
||||||
|
}
|
||||||
|
|
||||||
|
exit_suite() {
|
||||||
|
set +x
|
||||||
|
if test $FAILED -ne 0 ; then
|
||||||
|
echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:"
|
||||||
|
echo "${FAIL_SUMMARY}"
|
||||||
|
else
|
||||||
|
ci_fold end "${NVIM_TEST_CURRENT_SUITE}"
|
||||||
|
fi
|
||||||
|
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}"
|
||||||
|
if test "$1" != "--continue" ; then
|
||||||
|
exit $FAILED
|
||||||
|
else
|
||||||
|
local saved_failed=$FAILED
|
||||||
|
FAILED=0
|
||||||
|
return $saved_failed
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
fail() {
|
fail() {
|
||||||
local test_name="$1"
|
local test_name="$1"
|
||||||
local message="$2"
|
local fail_char="$2"
|
||||||
|
local message="$3"
|
||||||
|
|
||||||
|
: ${fail_char:=F}
|
||||||
: ${message:=Test $test_name failed}
|
: ${message:=Test $test_name failed}
|
||||||
|
|
||||||
local full_msg="$test_name :: $message"
|
local full_msg="$fail_char $NVIM_TEST_CURRENT_SUITE|$test_name :: $message"
|
||||||
|
FAIL_SUMMARY="${FAIL_SUMMARY}${NL}${full_msg}"
|
||||||
echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}"
|
echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}"
|
||||||
echo "Failed: $full_msg"
|
echo "Failed: $full_msg"
|
||||||
FAILED=1
|
FAILED=1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run_test() {
|
||||||
|
local cmd="$1"
|
||||||
|
test $# -gt 0 && shift
|
||||||
|
local test_name="$1"
|
||||||
|
: ${test_name:=$cmd}
|
||||||
|
test $# -gt 0 && shift
|
||||||
|
if ! eval "$cmd" ; then
|
||||||
|
fail "${test_name}" "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
run_test_wd() {
|
||||||
|
local hang_ok=
|
||||||
|
if test "$1" = "--allow-hang" ; then
|
||||||
|
hang_ok=1
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
local timeout="$1"
|
||||||
|
test $# -gt 0 && shift
|
||||||
|
|
||||||
|
local cmd="$1"
|
||||||
|
test $# -gt 0 && shift
|
||||||
|
|
||||||
|
local restart_cmd="$1"
|
||||||
|
: ${restart_cmd:=true}
|
||||||
|
test $# -gt 0 && shift
|
||||||
|
|
||||||
|
local test_name="$1"
|
||||||
|
: ${test_name:=$cmd}
|
||||||
|
test $# -gt 0 && shift
|
||||||
|
|
||||||
|
local output_file="$(mktemp)"
|
||||||
|
local status_file="$(mktemp)"
|
||||||
|
local sid_file="$(mktemp)"
|
||||||
|
|
||||||
|
local restarts=5
|
||||||
|
local prev_tmpsize=-1
|
||||||
|
while test $restarts -gt 0 ; do
|
||||||
|
: > "$status_file"
|
||||||
|
: > "$sid_file"
|
||||||
|
setsid \
|
||||||
|
env \
|
||||||
|
output_file="$output_file" \
|
||||||
|
status_file="$status_file" \
|
||||||
|
sid_file="$sid_file" \
|
||||||
|
cmd="$cmd" \
|
||||||
|
CI_DIR="$CI_DIR" \
|
||||||
|
sh -c '
|
||||||
|
. "${CI_DIR}/common/test.sh"
|
||||||
|
ps -o sid= > "$sid_file"
|
||||||
|
(
|
||||||
|
ret=0
|
||||||
|
if ! eval "$cmd" 2>&1 ; then
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
|
echo "$ret" > "$status_file"
|
||||||
|
) | tee -a "$output_file"
|
||||||
|
'
|
||||||
|
while test "$(stat -c "%s" "$status_file")" -eq 0 ; do
|
||||||
|
prev_tmpsize=$tmpsize
|
||||||
|
sleep $timeout
|
||||||
|
tmpsize="$(stat -c "%s" "$output_file")"
|
||||||
|
if test $tempsize -eq $prev_temsize ; then
|
||||||
|
# no output, assuming either hang or exit
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
restarts=$(( restarts - 1 ))
|
||||||
|
if test "$(stat -c "%s" "$status_file")" -eq 0 ; then
|
||||||
|
# Status file not updated, assuming hang
|
||||||
|
|
||||||
|
# SID not known, this should not ever happen
|
||||||
|
if test "$(stat -c "%s" "$sid_file")" -eq 0 ; then
|
||||||
|
fail "$test_name" E "Shell did not run"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Kill all processes which belong to one session: should get rid of test
|
||||||
|
# processes as well as sh itself.
|
||||||
|
pkill -KILL -s$(cat "$sid_file")
|
||||||
|
|
||||||
|
if test $restarts -eq 0 ; then
|
||||||
|
if test -z "$hang_ok" ; then
|
||||||
|
fail "$test_name" E "Test hang up"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Test ${test_name} hang up, restarting"
|
||||||
|
eval "$restart_cmd"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
local new_failed="$(cat "$status_file")"
|
||||||
|
if test "$new_failed" != "0" ; then
|
||||||
|
fail "$test_name" F "Test failed in run_test_wd"
|
||||||
|
fi
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -f "$output_file"
|
||||||
|
rm -f "$status_file"
|
||||||
|
rm -f "$sid_file"
|
||||||
|
}
|
||||||
|
|
||||||
ended_successfully() {
|
ended_successfully() {
|
||||||
if test -f "${FAIL_SUMMARY_FILE}" ; then
|
if test -f "${FAIL_SUMMARY_FILE}" ; then
|
||||||
echo 'Test failed, complete summary:'
|
echo 'Test failed, complete summary:'
|
||||||
cat "${FAIL_SUMMARY_FILE}"
|
cat "${FAIL_SUMMARY_FILE}"
|
||||||
|
|
||||||
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
|
|
||||||
rm -f "$FAIL_SUMMARY_FILE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if ! test -f "${END_MARKER}" ; then
|
if ! test -f "${END_MARKER}" ; then
|
||||||
|
@@ -51,7 +51,7 @@ check_core_dumps() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if test "$app" != quiet ; then
|
if test "$app" != quiet ; then
|
||||||
fail 'cores' 'Core dumps found'
|
fail 'cores' E 'Core dumps found'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ check_logs() {
|
|||||||
rm "${log}"
|
rm "${log}"
|
||||||
done
|
done
|
||||||
if test -n "${err}" ; then
|
if test -n "${err}" ; then
|
||||||
fail 'logs' 'Runtime errors detected.'
|
fail 'logs' E 'Runtime errors detected.'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,39 +86,46 @@ check_sanitizer() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
unittests() {(
|
run_unittests() {(
|
||||||
|
enter_suite unittests
|
||||||
ulimit -c unlimited || true
|
ulimit -c unlimited || true
|
||||||
if ! build_make unittest ; then
|
if ! build_make unittest ; then
|
||||||
fail 'unittests' 'Unit tests failed'
|
fail 'unittests' F 'Unit tests failed'
|
||||||
fi
|
fi
|
||||||
submit_coverage unittest
|
submit_coverage unittest
|
||||||
check_core_dumps "$(command -v luajit)"
|
check_core_dumps "$(command -v luajit)"
|
||||||
|
exit_suite
|
||||||
)}
|
)}
|
||||||
|
|
||||||
functionaltests() {(
|
run_functionaltests() {(
|
||||||
|
enter_suite functionaltests
|
||||||
ulimit -c unlimited || true
|
ulimit -c unlimited || true
|
||||||
if ! build_make ${FUNCTIONALTEST}; then
|
if ! build_make ${FUNCTIONALTEST}; then
|
||||||
fail 'functionaltests' 'Functional tests failed'
|
fail 'functionaltests' F 'Functional tests failed'
|
||||||
fi
|
fi
|
||||||
submit_coverage functionaltest
|
submit_coverage functionaltest
|
||||||
check_sanitizer "${LOG_DIR}"
|
check_sanitizer "${LOG_DIR}"
|
||||||
valgrind_check "${LOG_DIR}"
|
valgrind_check "${LOG_DIR}"
|
||||||
check_core_dumps
|
check_core_dumps
|
||||||
|
exit_suite
|
||||||
)}
|
)}
|
||||||
|
|
||||||
oldtests() {(
|
run_oldtests() {(
|
||||||
|
enter_suite oldtests
|
||||||
ulimit -c unlimited || true
|
ulimit -c unlimited || true
|
||||||
if ! make oldtest; then
|
if ! make oldtest; then
|
||||||
reset
|
reset
|
||||||
fail 'oldtests' 'Legacy tests failed'
|
fail 'oldtests' F 'Legacy tests failed'
|
||||||
fi
|
fi
|
||||||
submit_coverage oldtest
|
submit_coverage oldtest
|
||||||
check_sanitizer "${LOG_DIR}"
|
check_sanitizer "${LOG_DIR}"
|
||||||
valgrind_check "${LOG_DIR}"
|
valgrind_check "${LOG_DIR}"
|
||||||
check_core_dumps
|
check_core_dumps
|
||||||
|
exit_suite
|
||||||
)}
|
)}
|
||||||
|
|
||||||
check_runtime_files() {(
|
check_runtime_files() {(
|
||||||
|
set +x
|
||||||
local test_name="$1" ; shift
|
local test_name="$1" ; shift
|
||||||
local message="$1" ; shift
|
local message="$1" ; shift
|
||||||
local tst="$1" ; shift
|
local tst="$1" ; shift
|
||||||
@@ -129,25 +136,27 @@ check_runtime_files() {(
|
|||||||
# Prefer failing the build over using more robust construct because files
|
# Prefer failing the build over using more robust construct because files
|
||||||
# with IFS are not welcome.
|
# with IFS are not welcome.
|
||||||
if ! test -e "$file" ; then
|
if ! test -e "$file" ; then
|
||||||
fail "$test_name" "It appears that $file is only a part of the file name"
|
fail "$test_name" E \
|
||||||
|
"It appears that $file is only a part of the file name"
|
||||||
fi
|
fi
|
||||||
if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then
|
if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then
|
||||||
fail "$test_name" "$(printf "$message" "$file")"
|
fail "$test_name" F "$(printf "$message" "$file")"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
)}
|
)}
|
||||||
|
|
||||||
install_nvim() {(
|
install_nvim() {(
|
||||||
|
enter_suite 'install_nvim'
|
||||||
if ! build_make install ; then
|
if ! build_make install ; then
|
||||||
fail 'install' 'make install failed'
|
fail 'install' E 'make install failed'
|
||||||
exit 1
|
exit_suite
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"${INSTALL_PREFIX}/bin/nvim" --version
|
"${INSTALL_PREFIX}/bin/nvim" --version
|
||||||
if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then
|
if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then
|
||||||
echo "Running ':help' in the installed nvim failed."
|
echo "Running ':help' in the installed nvim failed."
|
||||||
echo "Maybe the helptags have not been generated properly."
|
echo "Maybe the helptags have not been generated properly."
|
||||||
fail 'help' 'Failed running :help'
|
fail 'help' F 'Failed running :help'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check that all runtime files were installed
|
# Check that all runtime files were installed
|
||||||
@@ -168,6 +177,13 @@ install_nvim() {(
|
|||||||
local genvimsynf=syntax/vim/generated.vim
|
local genvimsynf=syntax/vim/generated.vim
|
||||||
local gpat='syn keyword vimFuncName .*eval'
|
local gpat='syn keyword vimFuncName .*eval'
|
||||||
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then
|
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then
|
||||||
fail 'funcnames' "It appears that $genvimsynf does not contain $gpat."
|
fail 'funcnames' F "It appears that $genvimsynf does not contain $gpat."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
exit_suite
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
csi_clean() {
|
||||||
|
find "${BUILD_DIR}/bin" -name 'test-includes-*' -delete
|
||||||
|
find "${BUILD_DIR}" -name '*test-include*.o' -delete
|
||||||
|
}
|
||||||
|
@@ -3,14 +3,29 @@
|
|||||||
set -e
|
set -e
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
if [[ "${CI_TARGET}" == lint ]]; then
|
||||||
|
python3 -m pip -q install --user --upgrade flake8
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||||
|
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
# Use default CC to avoid compilation problems when installing Python modules.
|
# Use default CC to avoid compilation problems when installing Python modules.
|
||||||
echo "Install neovim module for Python."
|
echo "Install neovim module for Python 3."
|
||||||
CC=cc python -m pip -q install --user --upgrade pynvim
|
CC=cc python3 -m pip -q install --user --upgrade pynvim
|
||||||
|
if python2 -m pip -c True 2>&1; then
|
||||||
|
echo "Install neovim module for Python 2."
|
||||||
|
CC=cc python2 -m pip -q install --user --upgrade pynvim
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Install neovim RubyGem."
|
echo "Install neovim RubyGem."
|
||||||
gem install --no-document --bindir "$HOME/.local/bin" --user-install --pre neovim
|
gem install --no-document --bindir "$HOME/.local/bin" --user-install --pre neovim
|
||||||
|
|
||||||
echo "Install neovim npm package"
|
echo "Install neovim npm package"
|
||||||
|
source ~/.nvm/nvm.sh
|
||||||
|
nvm use 10
|
||||||
npm install -g neovim
|
npm install -g neovim
|
||||||
npm link neovim
|
npm link neovim
|
||||||
|
|
||||||
|
@@ -8,17 +8,29 @@ CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
source "${CI_DIR}/common/build.sh"
|
source "${CI_DIR}/common/build.sh"
|
||||||
source "${CI_DIR}/common/suite.sh"
|
source "${CI_DIR}/common/suite.sh"
|
||||||
|
|
||||||
rm -f "$END_MARKER"
|
enter_suite 'clint'
|
||||||
|
run_test 'make clint-full' clint
|
||||||
|
exit_suite --continue
|
||||||
|
|
||||||
# Run all tests if no input argument is given
|
enter_suite 'lualint'
|
||||||
if (($# == 0)); then
|
run_test 'make lualint' lualint
|
||||||
tests=('clint-full' 'lualint' 'pylint' 'shlint' 'check-single-includes')
|
exit_suite --continue
|
||||||
else
|
|
||||||
tests=("$@")
|
|
||||||
fi
|
|
||||||
|
|
||||||
for i in "${tests[@]}"; do
|
enter_suite 'pylint'
|
||||||
make "$i" || fail "$i"
|
run_test 'make pylint' pylint
|
||||||
done
|
exit_suite --continue
|
||||||
|
|
||||||
|
enter_suite 'shlint'
|
||||||
|
run_test 'make shlint' shlint
|
||||||
|
exit_suite --continue
|
||||||
|
|
||||||
|
enter_suite single-includes
|
||||||
|
CLICOLOR_FORCE=1 run_test_wd \
|
||||||
|
--allow-hang \
|
||||||
|
10s \
|
||||||
|
'make check-single-includes' \
|
||||||
|
'csi_clean' \
|
||||||
|
single-includes
|
||||||
|
exit_suite --continue
|
||||||
|
|
||||||
end_tests
|
end_tests
|
||||||
|
@@ -8,28 +8,33 @@ source "${CI_DIR}/common/build.sh"
|
|||||||
source "${CI_DIR}/common/test.sh"
|
source "${CI_DIR}/common/test.sh"
|
||||||
source "${CI_DIR}/common/suite.sh"
|
source "${CI_DIR}/common/suite.sh"
|
||||||
|
|
||||||
rm -f "$END_MARKER"
|
enter_suite build
|
||||||
|
|
||||||
# Run all tests (with some caveats) if no input argument is given
|
check_core_dumps --delete quiet
|
||||||
if (($# == 0)); then
|
|
||||||
tests=('build_nvim')
|
|
||||||
|
|
||||||
if test "$CLANG_SANITIZER" != "TSAN"; then
|
prepare_build
|
||||||
# Additional threads are only created when the builtin UI starts, which
|
build_nvim
|
||||||
# doesn't happen in the unit/functional tests
|
|
||||||
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
|
exit_suite --continue
|
||||||
tests+=('unittests')
|
|
||||||
fi
|
source ~/.nvm/nvm.sh
|
||||||
tests+=('functionaltests')
|
nvm use 10
|
||||||
|
|
||||||
|
|
||||||
|
enter_suite tests
|
||||||
|
|
||||||
|
if test "$CLANG_SANITIZER" != "TSAN" ; then
|
||||||
|
# Additional threads are only created when the builtin UI starts, which
|
||||||
|
# doesn't happen in the unit/functional tests
|
||||||
|
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
|
||||||
|
run_test run_unittests
|
||||||
fi
|
fi
|
||||||
|
run_test run_functionaltests
|
||||||
tests+=('oldtests' 'install_nvim')
|
|
||||||
else
|
|
||||||
tests=("$@")
|
|
||||||
fi
|
fi
|
||||||
|
run_test run_oldtests
|
||||||
|
|
||||||
for i in "${tests[@]}"; do
|
run_test install_nvim
|
||||||
eval "$i" || fail "$i"
|
|
||||||
done
|
exit_suite --continue
|
||||||
|
|
||||||
end_tests
|
end_tests
|
||||||
|
@@ -3,7 +3,14 @@
|
|||||||
set -e
|
set -e
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
ci/run_${CI_TARGET}.sh
|
# This will pass the environment variables down to a bash process which runs
|
||||||
|
# as $USER, while retaining the environment variables defined and belonging
|
||||||
|
# to secondary groups given above in usermod.
|
||||||
|
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||||
|
sudo -E su "${USER}" -c "ci/run_${CI_TARGET}.sh"
|
||||||
|
else
|
||||||
|
ci/run_${CI_TARGET}.sh
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -s "${GCOV_ERROR_FILE}" ]]; then
|
if [[ -s "${GCOV_ERROR_FILE}" ]]; then
|
||||||
echo '=== Unexpected gcov errors: ==='
|
echo '=== Unexpected gcov errors: ==='
|
||||||
|
@@ -8,7 +8,7 @@ WEBHOOK_PAYLOAD="$(cat "${SNAP_DIR}/.snapcraft_payload")"
|
|||||||
PAYLOAD_SIG="${SECRET_SNAP_SIG}"
|
PAYLOAD_SIG="${SECRET_SNAP_SIG}"
|
||||||
|
|
||||||
|
|
||||||
snap_release_needed() {
|
snap_realease_needed() {
|
||||||
last_committed_tag="$(git tag -l --sort=refname|head -1)"
|
last_committed_tag="$(git tag -l --sort=refname|head -1)"
|
||||||
last_snap_release="$(snap info nvim | awk '$1 == "latest/edge:" { print $2 }' | perl -lpe 's/v\d.\d.\d-//g')"
|
last_snap_release="$(snap info nvim | awk '$1 == "latest/edge:" { print $2 }' | perl -lpe 's/v\d.\d.\d-//g')"
|
||||||
git fetch -f --tags
|
git fetch -f --tags
|
||||||
@@ -33,7 +33,7 @@ trigger_snapcraft_webhook() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if $(snap_release_needed); then
|
if $(snap_realease_needed); then
|
||||||
echo "New snap release required"
|
echo "New snap release required"
|
||||||
trigger_snapcraft_webhook
|
trigger_snapcraft_webhook
|
||||||
fi
|
fi
|
||||||
|
@@ -45,24 +45,10 @@ check_function_exists(readlink HAVE_READLINK)
|
|||||||
check_function_exists(setpgid HAVE_SETPGID)
|
check_function_exists(setpgid HAVE_SETPGID)
|
||||||
check_function_exists(setsid HAVE_SETSID)
|
check_function_exists(setsid HAVE_SETSID)
|
||||||
check_function_exists(sigaction HAVE_SIGACTION)
|
check_function_exists(sigaction HAVE_SIGACTION)
|
||||||
check_function_exists(strnlen HAVE_STRNLEN)
|
|
||||||
check_function_exists(strcasecmp HAVE_STRCASECMP)
|
check_function_exists(strcasecmp HAVE_STRCASECMP)
|
||||||
check_function_exists(strncasecmp HAVE_STRNCASECMP)
|
check_function_exists(strncasecmp HAVE_STRNCASECMP)
|
||||||
check_function_exists(strptime HAVE_STRPTIME)
|
check_function_exists(strptime HAVE_STRPTIME)
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
|
||||||
check_c_source_compiles("
|
|
||||||
#include <termios.h>
|
|
||||||
int
|
|
||||||
main(void)
|
|
||||||
{
|
|
||||||
return forkpty(0, NULL, NULL, NULL);
|
|
||||||
}
|
|
||||||
" HAVE_FORKPTY)
|
|
||||||
else()
|
|
||||||
set(HAVE_FORKPTY 1)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Symbols
|
# Symbols
|
||||||
check_symbol_exists(FD_CLOEXEC "fcntl.h" HAVE_FD_CLOEXEC)
|
check_symbol_exists(FD_CLOEXEC "fcntl.h" HAVE_FD_CLOEXEC)
|
||||||
if(HAVE_LANGINFO_H)
|
if(HAVE_LANGINFO_H)
|
||||||
|
@@ -30,7 +30,6 @@
|
|||||||
#cmakedefine HAVE_SETPGID
|
#cmakedefine HAVE_SETPGID
|
||||||
#cmakedefine HAVE_SETSID
|
#cmakedefine HAVE_SETSID
|
||||||
#cmakedefine HAVE_SIGACTION
|
#cmakedefine HAVE_SIGACTION
|
||||||
#cmakedefine HAVE_STRNLEN
|
|
||||||
#cmakedefine HAVE_STRCASECMP
|
#cmakedefine HAVE_STRCASECMP
|
||||||
#cmakedefine HAVE_STRINGS_H
|
#cmakedefine HAVE_STRINGS_H
|
||||||
#cmakedefine HAVE_STRNCASECMP
|
#cmakedefine HAVE_STRNCASECMP
|
||||||
@@ -50,7 +49,6 @@
|
|||||||
# undef HAVE_SYS_UIO_H
|
# undef HAVE_SYS_UIO_H
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#cmakedefine HAVE_FORKPTY
|
|
||||||
|
|
||||||
#cmakedefine FEAT_TUI
|
#cmakedefine FEAT_TUI
|
||||||
|
|
||||||
|
12
contrib/flake.lock
generated
12
contrib/flake.lock
generated
@@ -2,11 +2,11 @@
|
|||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1644229661,
|
"lastModified": 1629481132,
|
||||||
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
|
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
|
"rev": "997f7efcb746a9c140ce1f13c72263189225f482",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -17,11 +17,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1646254136,
|
"lastModified": 1630074300,
|
||||||
"narHash": "sha256-8nQx02tTzgYO21BP/dy5BCRopE8OwE8Drsw98j+Qoaw=",
|
"narHash": "sha256-BFM7OiXRs0RvSUZd6NCGAKWVPn3VodgYQ4TUQXxbMBU=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "3e072546ea98db00c2364b81491b893673267827",
|
"rev": "21c937f8cb1e6adcfeb36dfd6c90d9d9bfab1d28",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"runtime.version": "LuaJIT",
|
|
||||||
"diagnostics": {
|
|
||||||
"enable": true,
|
|
||||||
"globals": [
|
|
||||||
"vim",
|
|
||||||
"describe",
|
|
||||||
"it",
|
|
||||||
"before_each",
|
|
||||||
"after_each",
|
|
||||||
"setup",
|
|
||||||
"teardown"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"workspace": {
|
|
||||||
"library": {
|
|
||||||
"runtime/lua": true
|
|
||||||
},
|
|
||||||
"maxPreload": 2000,
|
|
||||||
"preloadFileSize": 1000
|
|
||||||
},
|
|
||||||
"telemetry.enable": false
|
|
||||||
}
|
|
@@ -1,64 +0,0 @@
|
|||||||
set(CPACK_PACKAGE_NAME "Neovim")
|
|
||||||
set(CPACK_PACKAGE_VENDOR "neovim.io")
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME "nvim")
|
|
||||||
|
|
||||||
# From the GitHub About section
|
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Vim-fork focused on extensibility and usability.")
|
|
||||||
|
|
||||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
|
|
||||||
|
|
||||||
# Pull the versions defined with the top level CMakeLists.txt
|
|
||||||
set(CPACK_PACKAGE_VERSION_MAJOR ${NVIM_VERSION_MAJOR})
|
|
||||||
set(CPACK_PACKAGE_VERSION_MINOR ${NVIM_VERSION_MINOR})
|
|
||||||
set(CPACK_PACKAGE_VERSION_PATCH ${NVIM_VERSION_PATCH})
|
|
||||||
|
|
||||||
# CPACK_VERBATIM_VARIABLES ensures that the variables prefixed with *CPACK_*
|
|
||||||
# are correctly passed to the cpack program.
|
|
||||||
# This should always be set to true.
|
|
||||||
set(CPACK_VERBATIM_VARIABLES TRUE)
|
|
||||||
|
|
||||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
|
|
||||||
set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.md)
|
|
||||||
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME "nvim-win64")
|
|
||||||
set(CPACK_GENERATOR ZIP WIX)
|
|
||||||
|
|
||||||
# WIX
|
|
||||||
# CPACK_WIX_UPGRADE_GUID should be set, but should never change.
|
|
||||||
# CPACK_WIX_PRODUCT_GUID should not be set (leave as default to auto-generate).
|
|
||||||
|
|
||||||
# The following guid is just a randomly generated guid that's been pasted here.
|
|
||||||
# It has no special meaning other than to supply it to WIX.
|
|
||||||
set(CPACK_WIX_UPGRADE_GUID "207A1A70-7B0C-418A-A153-CA6883E38F4D")
|
|
||||||
set(CPACK_WIX_PRODUCT_ICON ${CMAKE_CURRENT_LIST_DIR}/neovim.ico)
|
|
||||||
|
|
||||||
# We use a wix patch to add further options to the installer. At present, it's just to add neovim to the path
|
|
||||||
# on installation, however, it can be extended.
|
|
||||||
# See: https://cmake.org/cmake/help/v3.7/module/CPackWIX.html#variable:CPACK_WIX_PATCH_FILE
|
|
||||||
list(APPEND CPACK_WIX_EXTENSIONS WixUtilExtension)
|
|
||||||
list(APPEND CPACK_WIX_PATCH_FILE ${CMAKE_CURRENT_LIST_DIR}/WixPatch.xml)
|
|
||||||
elseif(APPLE)
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME "nvim-macos")
|
|
||||||
set(CPACK_GENERATOR TGZ)
|
|
||||||
set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_LIST_DIR}/neovim.icns)
|
|
||||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME "nvim-linux64")
|
|
||||||
set(CPACK_GENERATOR TGZ DEB)
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_NAME "Neovim") # required
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Neovim.io") # required
|
|
||||||
|
|
||||||
# Automatically compute required shared lib dependencies.
|
|
||||||
# Unfortunately, you "just need to know" that this has a hidden
|
|
||||||
# dependency on dpkg-shlibdeps whilst using a debian based host.
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE)
|
|
||||||
else()
|
|
||||||
set(CPACK_GENERATOR TGZ)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# CPack variables are loaded in on the call to include(CPack). If you set
|
|
||||||
# variables *after* the inclusion, they don't get updated within the CPack
|
|
||||||
# config. Note that some CPack commands should still be run after it, such
|
|
||||||
# as cpack_add_component().
|
|
||||||
include(CPack)
|
|
@@ -1,16 +0,0 @@
|
|||||||
<CPackWiXPatch>
|
|
||||||
<!-- Fragment ID is from: <your build dir>/_CPack_Packages/win64/WIX/files.wxs -->
|
|
||||||
<CPackWiXFragment Id="CM_CP_bin.nvim.exe">
|
|
||||||
<!-- Note: if we were to specify Value='[INSTALL_ROOT]\bin' - with a backslash, the installer will still
|
|
||||||
use a forward slash in the path. -->
|
|
||||||
<Environment
|
|
||||||
Id='UpdatePath'
|
|
||||||
Name='PATH'
|
|
||||||
Action='set'
|
|
||||||
Permanent='no'
|
|
||||||
System='yes'
|
|
||||||
Part='last'
|
|
||||||
Value='[INSTALL_ROOT]/bin'
|
|
||||||
/>
|
|
||||||
</CPackWiXFragment>
|
|
||||||
</CPackWiXPatch>
|
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 120 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.6 KiB |
@@ -1,147 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<svg
|
|
||||||
xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="256"
|
|
||||||
height="256"
|
|
||||||
viewBox="0 0 256 256"
|
|
||||||
version="1.1"
|
|
||||||
id="svg4612"
|
|
||||||
sodipodi:docname="neovim.svg"
|
|
||||||
inkscape:version="0.92.4 5da689c313, 2019-01-14">
|
|
||||||
<metadata
|
|
||||||
id="metadata4616">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title>neovim-mark@2x</dc:title>
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<sodipodi:namedview
|
|
||||||
pagecolor="#ffffff"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1"
|
|
||||||
objecttolerance="10"
|
|
||||||
gridtolerance="10"
|
|
||||||
guidetolerance="10"
|
|
||||||
inkscape:pageopacity="0"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:window-width="2560"
|
|
||||||
inkscape:window-height="1333"
|
|
||||||
id="namedview4614"
|
|
||||||
showgrid="false"
|
|
||||||
inkscape:zoom="2.1945358"
|
|
||||||
inkscape:cx="132.84232"
|
|
||||||
inkscape:cy="196.34741"
|
|
||||||
inkscape:window-x="0"
|
|
||||||
inkscape:window-y="34"
|
|
||||||
inkscape:window-maximized="1"
|
|
||||||
inkscape:current-layer="svg4612" />
|
|
||||||
<title
|
|
||||||
id="title4587">neovim-mark@2x</title>
|
|
||||||
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
|
|
||||||
<defs
|
|
||||||
id="defs4604">
|
|
||||||
<linearGradient
|
|
||||||
x1="167.95833"
|
|
||||||
y1="-0.46142399"
|
|
||||||
x2="167.95833"
|
|
||||||
y2="335.45523"
|
|
||||||
id="linearGradient-1"
|
|
||||||
gradientTransform="scale(0.46142398,2.1672042)"
|
|
||||||
gradientUnits="userSpaceOnUse">
|
|
||||||
<stop
|
|
||||||
stop-color="#16B0ED"
|
|
||||||
stop-opacity="0.800235524"
|
|
||||||
offset="0%"
|
|
||||||
id="stop4589" />
|
|
||||||
<stop
|
|
||||||
stop-color="#0F59B2"
|
|
||||||
stop-opacity="0.83700023"
|
|
||||||
offset="100%"
|
|
||||||
id="stop4591" />
|
|
||||||
</linearGradient>
|
|
||||||
<linearGradient
|
|
||||||
x1="1118.3427"
|
|
||||||
y1="-0.46586797"
|
|
||||||
x2="1118.3427"
|
|
||||||
y2="338.68604"
|
|
||||||
id="linearGradient-2"
|
|
||||||
gradientTransform="scale(0.46586797,2.1465309)"
|
|
||||||
gradientUnits="userSpaceOnUse">
|
|
||||||
<stop
|
|
||||||
stop-color="#7DB643"
|
|
||||||
offset="0%"
|
|
||||||
id="stop4594" />
|
|
||||||
<stop
|
|
||||||
stop-color="#367533"
|
|
||||||
offset="100%"
|
|
||||||
id="stop4596" />
|
|
||||||
</linearGradient>
|
|
||||||
<linearGradient
|
|
||||||
x1="356.33795"
|
|
||||||
y1="0"
|
|
||||||
x2="356.33795"
|
|
||||||
y2="612.90131"
|
|
||||||
id="linearGradient-3"
|
|
||||||
gradientTransform="scale(0.84189739,1.1877932)"
|
|
||||||
gradientUnits="userSpaceOnUse">
|
|
||||||
<stop
|
|
||||||
stop-color="#88C649"
|
|
||||||
stop-opacity="0.8"
|
|
||||||
offset="0%"
|
|
||||||
id="stop4599" />
|
|
||||||
<stop
|
|
||||||
stop-color="#439240"
|
|
||||||
stop-opacity="0.84"
|
|
||||||
offset="100%"
|
|
||||||
id="stop4601" />
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
<g
|
|
||||||
id="Page-1"
|
|
||||||
sketch:type="MSPage"
|
|
||||||
style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1"
|
|
||||||
transform="matrix(0.34367476,0,0,0.34367476,25.312651,1.7737533)">
|
|
||||||
<g
|
|
||||||
id="mark-copy"
|
|
||||||
sketch:type="MSLayerGroup"
|
|
||||||
transform="translate(2,3)">
|
|
||||||
<path
|
|
||||||
d="M 0,155.5704 155,-1 V 727 L 0,572.23792 Z"
|
|
||||||
id="Left---green"
|
|
||||||
sketch:type="MSShapeGroup"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
style="fill:url(#linearGradient-1)" />
|
|
||||||
<path
|
|
||||||
d="M 443.0604,156.9824 600,-1 596.81879,727 442,572.21994 Z"
|
|
||||||
id="Right---blue"
|
|
||||||
sketch:type="MSShapeGroup"
|
|
||||||
transform="matrix(-1,0,0,1,1042,0)"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
style="fill:url(#linearGradient-2)" />
|
|
||||||
<path
|
|
||||||
d="M 154.98629,0 558,615.1897 445.2246,728 42,114.17202 Z"
|
|
||||||
id="Cross---blue"
|
|
||||||
sketch:type="MSShapeGroup"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
style="fill:url(#linearGradient-3)" />
|
|
||||||
<path
|
|
||||||
d="M 155,283.83232 154.78675,308 31,124.71061 42.461949,113 Z"
|
|
||||||
id="Shadow"
|
|
||||||
sketch:type="MSShapeGroup"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
style="fill:#000000;fill-opacity:0.12999998" />
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 4.3 KiB |
File diff suppressed because one or more lines are too long
216
runtime/autoload/dist/ft.vim
vendored
216
runtime/autoload/dist/ft.vim
vendored
@@ -1,7 +1,7 @@
|
|||||||
" Vim functions for file type detection
|
" Vim functions for file type detection
|
||||||
"
|
"
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||||
" Last Change: 2022 Apr 06
|
" Last Change: 2020 Aug 17
|
||||||
|
|
||||||
" These functions are moved here from runtime/filetype.vim to make startup
|
" These functions are moved here from runtime/filetype.vim to make startup
|
||||||
" faster.
|
" faster.
|
||||||
@@ -67,32 +67,13 @@ func dist#ft#FTasmsyntax()
|
|||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
let s:ft_visual_basic_content = '\cVB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)'
|
" Check if one of the first five lines contains "VB_Name". In that case it is
|
||||||
|
" probably a Visual Basic file. Otherwise it's assumed to be "alt" filetype.
|
||||||
" See FTfrm() for Visual Basic form file detection
|
func dist#ft#FTVB(alt)
|
||||||
func dist#ft#FTbas()
|
if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)'
|
||||||
if exists("g:filetype_bas")
|
|
||||||
exe "setf " . g:filetype_bas
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
" most frequent FreeBASIC-specific keywords in distro files
|
|
||||||
let fb_keywords = '\c^\s*\%(extern\|var\|enum\|private\|scope\|union\|byref\|operator\|constructor\|delete\|namespace\|public\|property\|with\|destructor\|using\)\>\%(\s*[:=(]\)\@!'
|
|
||||||
let fb_preproc = '\c^\s*\%(#\a\+\|option\s\+\%(byval\|dynamic\|escape\|\%(no\)\=gosub\|nokeyword\|private\|static\)\>\)'
|
|
||||||
let fb_comment = "^\\s*/'"
|
|
||||||
" OPTION EXPLICIT, without the leading underscore, is common to many dialects
|
|
||||||
let qb64_preproc = '\c^\s*\%($\a\+\|option\s\+\%(_explicit\|_\=explicitarray\)\>\)'
|
|
||||||
|
|
||||||
let lines = getline(1, min([line("$"), 100]))
|
|
||||||
|
|
||||||
if match(lines, fb_preproc) > -1 || match(lines, fb_comment) > -1 || match(lines, fb_keywords) > -1
|
|
||||||
setf freebasic
|
|
||||||
elseif match(lines, qb64_preproc) > -1
|
|
||||||
setf qb64
|
|
||||||
elseif match(lines, s:ft_visual_basic_content) > -1
|
|
||||||
setf vb
|
setf vb
|
||||||
else
|
else
|
||||||
setf basic
|
exe "setf " . a:alt
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@@ -112,25 +93,6 @@ func dist#ft#BindzoneCheck(default)
|
|||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Returns true if file content looks like RAPID
|
|
||||||
func IsRapid(sChkExt = "")
|
|
||||||
if a:sChkExt == "cfg"
|
|
||||||
return getline(1) =~? '\v^%(EIO|MMC|MOC|PROC|SIO|SYS):CFG'
|
|
||||||
endif
|
|
||||||
" called from FTmod, FTprg or FTsys
|
|
||||||
return getline(nextnonblank(1)) =~? '\v^\s*%(\%{3}|module\s+\k+\s*%(\(|$))'
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
func dist#ft#FTcfg()
|
|
||||||
if exists("g:filetype_cfg")
|
|
||||||
exe "setf " .. g:filetype_cfg
|
|
||||||
elseif IsRapid("cfg")
|
|
||||||
setf rapid
|
|
||||||
else
|
|
||||||
setf cfg
|
|
||||||
endif
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
func dist#ft#FTlpc()
|
func dist#ft#FTlpc()
|
||||||
if exists("g:lpc_syntax_for_c")
|
if exists("g:lpc_syntax_for_c")
|
||||||
let lnum = 1
|
let lnum = 1
|
||||||
@@ -192,7 +154,7 @@ endfunc
|
|||||||
|
|
||||||
func dist#ft#FTent()
|
func dist#ft#FTent()
|
||||||
" This function checks for valid cl syntax in the first five lines.
|
" This function checks for valid cl syntax in the first five lines.
|
||||||
" Look for either an opening comment, '#', or a block start, '{'.
|
" Look for either an opening comment, '#', or a block start, '{".
|
||||||
" If not found, assume SGML.
|
" If not found, assume SGML.
|
||||||
let lnum = 1
|
let lnum = 1
|
||||||
while lnum < 6
|
while lnum < 6
|
||||||
@@ -230,10 +192,6 @@ func dist#ft#EuphoriaCheck()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func dist#ft#DtraceCheck()
|
func dist#ft#DtraceCheck()
|
||||||
if did_filetype()
|
|
||||||
" Filetype was already detected
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
let lines = getline(1, min([line("$"), 100]))
|
let lines = getline(1, min([line("$"), 100]))
|
||||||
if match(lines, '^module\>\|^import\>') > -1
|
if match(lines, '^module\>\|^import\>') > -1
|
||||||
" D files often start with a module and/or import statement.
|
" D files often start with a module and/or import statement.
|
||||||
@@ -261,21 +219,6 @@ func dist#ft#FTe()
|
|||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func dist#ft#FTfrm()
|
|
||||||
if exists("g:filetype_frm")
|
|
||||||
exe "setf " . g:filetype_frm
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
let lines = getline(1, min([line("$"), 5]))
|
|
||||||
|
|
||||||
if match(lines, s:ft_visual_basic_content) > -1
|
|
||||||
setf vb
|
|
||||||
else
|
|
||||||
setf form
|
|
||||||
endif
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" Distinguish between Forth and F#.
|
" Distinguish between Forth and F#.
|
||||||
" Provided by Doug Kearns.
|
" Provided by Doug Kearns.
|
||||||
func dist#ft#FTfs()
|
func dist#ft#FTfs()
|
||||||
@@ -434,36 +377,6 @@ func dist#ft#FTmm()
|
|||||||
setf nroff
|
setf nroff
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Returns true if file content looks like LambdaProlog
|
|
||||||
func IsLProlog()
|
|
||||||
" skip apparent comments and blank lines, what looks like
|
|
||||||
" LambdaProlog comment may be RAPID header
|
|
||||||
let l = nextnonblank(1)
|
|
||||||
while l > 0 && l < line('$') && getline(l) =~ '^\s*%' " LambdaProlog comment
|
|
||||||
let l = nextnonblank(l + 1)
|
|
||||||
endwhile
|
|
||||||
" this pattern must not catch a go.mod file
|
|
||||||
return getline(l) =~ '\<module\s\+\w\+\s*\.\s*\(%\|$\)'
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" Determine if *.mod is ABB RAPID, LambdaProlog, Modula-2, Modsim III or go.mod
|
|
||||||
func dist#ft#FTmod()
|
|
||||||
if exists("g:filetype_mod")
|
|
||||||
exe "setf " .. g:filetype_mod
|
|
||||||
elseif IsLProlog()
|
|
||||||
setf lprolog
|
|
||||||
elseif getline(nextnonblank(1)) =~ '\%(\<MODULE\s\+\w\+\s*;\|^\s*(\*\)'
|
|
||||||
setf modula2
|
|
||||||
elseif IsRapid()
|
|
||||||
setf rapid
|
|
||||||
elseif expand("<afile>") =~ '\<go.mod$'
|
|
||||||
setf gomod
|
|
||||||
else
|
|
||||||
" Nothing recognized, assume modsim3
|
|
||||||
setf modsim3
|
|
||||||
endif
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
func dist#ft#FTpl()
|
func dist#ft#FTpl()
|
||||||
if exists("g:filetype_pl")
|
if exists("g:filetype_pl")
|
||||||
exe "setf " . g:filetype_pl
|
exe "setf " . g:filetype_pl
|
||||||
@@ -580,18 +493,6 @@ func dist#ft#FTpp()
|
|||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Determine if *.prg is ABB RAPID. Can also be Clipper, FoxPro or eviews
|
|
||||||
func dist#ft#FTprg()
|
|
||||||
if exists("g:filetype_prg")
|
|
||||||
exe "setf " .. g:filetype_prg
|
|
||||||
elseif IsRapid()
|
|
||||||
setf rapid
|
|
||||||
else
|
|
||||||
" Nothing recognized, assume Clipper
|
|
||||||
setf clipper
|
|
||||||
endif
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
func dist#ft#FTr()
|
func dist#ft#FTr()
|
||||||
let max = line("$") > 50 ? 50 : line("$")
|
let max = line("$") > 50 ? 50 : line("$")
|
||||||
|
|
||||||
@@ -773,28 +674,6 @@ func dist#ft#SQL()
|
|||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" This function checks the first 25 lines of file extension "sc" to resolve
|
|
||||||
" detection between scala and SuperCollider
|
|
||||||
func dist#ft#FTsc()
|
|
||||||
for lnum in range(1, min([line("$"), 25]))
|
|
||||||
if getline(lnum) =~# '[A-Za-z0-9]*\s:\s[A-Za-z0-9]\|var\s<\|classvar\s<\|\^this.*\||\w*|\|+\s\w*\s{\|\*ar\s'
|
|
||||||
setf supercollider
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
setf scala
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" This function checks the first line of file extension "scd" to resolve
|
|
||||||
" detection between scdoc and SuperCollider
|
|
||||||
func dist#ft#FTscd()
|
|
||||||
if getline(1) =~# '\%^\S\+(\d[0-9A-Za-z]*)\%(\s\+\"[^"]*\"\%(\s\+\"[^"]*\"\)\=\)\=$'
|
|
||||||
setf scdoc
|
|
||||||
else
|
|
||||||
setf supercollider
|
|
||||||
endif
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" If the file has an extension of 't' and is in a directory 't' or 'xt' then
|
" If the file has an extension of 't' and is in a directory 't' or 'xt' then
|
||||||
" it is almost certainly a Perl test file.
|
" it is almost certainly a Perl test file.
|
||||||
" If the first line starts with '#' and contains 'perl' it's probably a Perl
|
" If the first line starts with '#' and contains 'perl' it's probably a Perl
|
||||||
@@ -813,7 +692,7 @@ func dist#ft#FTperl()
|
|||||||
endif
|
endif
|
||||||
let save_cursor = getpos('.')
|
let save_cursor = getpos('.')
|
||||||
call cursor(1,1)
|
call cursor(1,1)
|
||||||
let has_use = search('^use\s\s*\k', 'c', 30) > 0
|
let has_use = search('^use\s\s*\k', 'c', 30)
|
||||||
call setpos('.', save_cursor)
|
call setpos('.', save_cursor)
|
||||||
if has_use
|
if has_use
|
||||||
setf perl
|
setf perl
|
||||||
@@ -822,16 +701,6 @@ func dist#ft#FTperl()
|
|||||||
return 0
|
return 0
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func dist#ft#FTsys()
|
|
||||||
if exists("g:filetype_sys")
|
|
||||||
exe "setf " .. g:filetype_sys
|
|
||||||
elseif IsRapid()
|
|
||||||
setf rapid
|
|
||||||
else
|
|
||||||
setf bat
|
|
||||||
endif
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" Choose context, plaintex, or tex (LaTeX) based on these rules:
|
" Choose context, plaintex, or tex (LaTeX) based on these rules:
|
||||||
" 1. Check the first line of the file for "%&<format>".
|
" 1. Check the first line of the file for "%&<format>".
|
||||||
" 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords.
|
" 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords.
|
||||||
@@ -855,8 +724,7 @@ func dist#ft#FTtex()
|
|||||||
let save_cursor = getpos('.')
|
let save_cursor = getpos('.')
|
||||||
call cursor(1,1)
|
call cursor(1,1)
|
||||||
let firstNC = search('^\s*[^[:space:]%]', 'c', 1000)
|
let firstNC = search('^\s*[^[:space:]%]', 'c', 1000)
|
||||||
if firstNC > 0
|
if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword.
|
||||||
" Check the next thousand lines for a LaTeX or ConTeXt keyword.
|
|
||||||
let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>'
|
let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>'
|
||||||
let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>'
|
let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>'
|
||||||
let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)',
|
let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)',
|
||||||
@@ -943,72 +811,6 @@ func dist#ft#Redif()
|
|||||||
endwhile
|
endwhile
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" This function is called for all files under */debian/patches/*, make sure not
|
|
||||||
" to non-dep3patch files, such as README and other text files.
|
|
||||||
func dist#ft#Dep3patch()
|
|
||||||
if expand('%:t') ==# 'series'
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
for ln in getline(1, 100)
|
|
||||||
if ln =~# '^\%(Description\|Subject\|Origin\|Bug\|Forwarded\|Author\|From\|Reviewed-by\|Acked-by\|Last-Updated\|Applied-Upstream\):'
|
|
||||||
setf dep3patch
|
|
||||||
return
|
|
||||||
elseif ln =~# '^---'
|
|
||||||
" end of headers found. stop processing
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" This function checks the first 15 lines for appearance of 'FoamFile'
|
|
||||||
" and then 'object' in a following line.
|
|
||||||
" In that case, it's probably an OpenFOAM file
|
|
||||||
func dist#ft#FTfoam()
|
|
||||||
let ffile = 0
|
|
||||||
let lnum = 1
|
|
||||||
while lnum <= 15
|
|
||||||
if getline(lnum) =~# '^FoamFile'
|
|
||||||
let ffile = 1
|
|
||||||
elseif ffile == 1 && getline(lnum) =~# '^\s*object'
|
|
||||||
setf foam
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
let lnum = lnum + 1
|
|
||||||
endwhile
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" Determine if a *.tf file is TF mud client or terraform
|
|
||||||
func dist#ft#FTtf()
|
|
||||||
let numberOfLines = line('$')
|
|
||||||
for i in range(1, numberOfLines)
|
|
||||||
let currentLine = trim(getline(i))
|
|
||||||
let firstCharacter = currentLine[0]
|
|
||||||
if firstCharacter !=? ";" && firstCharacter !=? "/" && firstCharacter !=? ""
|
|
||||||
setf terraform
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
setf tf
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" Determine if a *.src file is Kuka Robot Language
|
|
||||||
func dist#ft#FTsrc()
|
|
||||||
if exists("g:filetype_src")
|
|
||||||
exe "setf " .. g:filetype_src
|
|
||||||
elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|\%(global\s\+\)\?def\>\)'
|
|
||||||
setf krl
|
|
||||||
endif
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" Determine if a *.dat file is Kuka Robot Language
|
|
||||||
func dist#ft#FTdat()
|
|
||||||
if exists("g:filetype_dat")
|
|
||||||
exe "setf " .. g:filetype_dat
|
|
||||||
elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|defdat\>\)'
|
|
||||||
setf krl
|
|
||||||
endif
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" Restore 'cpoptions'
|
" Restore 'cpoptions'
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
|
@@ -1,41 +0,0 @@
|
|||||||
" Vim filetype plugin file
|
|
||||||
" Language: FreeBASIC
|
|
||||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
|
||||||
" Last Change: 2021 Mar 16
|
|
||||||
|
|
||||||
" Dialects can be one of fb, qb, fblite, or deprecated
|
|
||||||
" Precedence is forcelang > #lang > lang
|
|
||||||
function! freebasic#GetDialect() abort
|
|
||||||
if exists("g:freebasic_forcelang")
|
|
||||||
return g:freebasic_forcelang
|
|
||||||
endif
|
|
||||||
|
|
||||||
if exists("g:freebasic_lang")
|
|
||||||
let dialect = g:freebasic_lang
|
|
||||||
else
|
|
||||||
let dialect = "fb"
|
|
||||||
endif
|
|
||||||
|
|
||||||
" override with #lang directive or metacommand
|
|
||||||
|
|
||||||
let skip = "has('syntax_items') && synIDattr(synID(line('.'), col('.'), 1), 'name') =~ 'Comment$'"
|
|
||||||
let pat = '\c^\s*\%(#\s*lang\s\+\|''\s*$lang\s*:\s*\)"\([^"]*\)"'
|
|
||||||
|
|
||||||
let save_cursor = getcurpos()
|
|
||||||
call cursor(1, 1)
|
|
||||||
let lnum = search(pat, 'n', '', '', skip)
|
|
||||||
call setpos('.', save_cursor)
|
|
||||||
|
|
||||||
if lnum
|
|
||||||
let word = matchlist(getline(lnum), pat)[1]
|
|
||||||
if word =~? '\%(fb\|deprecated\|fblite\|qb\)'
|
|
||||||
let dialect = word
|
|
||||||
else
|
|
||||||
echomsg "freebasic#GetDialect: Invalid lang, found '" .. word .. "' at line " .. lnum .. " " .. getline(lnum)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
return dialect
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
|
@@ -21,17 +21,10 @@ function! health#check(plugin_names) abort
|
|||||||
throw 'healthcheck_not_found'
|
throw 'healthcheck_not_found'
|
||||||
endif
|
endif
|
||||||
eval type == 'v' ? call(func, []) : luaeval(func)
|
eval type == 'v' ? call(func, []) : luaeval(func)
|
||||||
" in the event the healthcheck doesn't return anything
|
|
||||||
" (the plugin author should avoid this possibility)
|
|
||||||
if len(s:output) == 0
|
|
||||||
throw 'healthcheck_no_return_value'
|
|
||||||
endif
|
|
||||||
catch
|
catch
|
||||||
let s:output = [] " Clear the output
|
let s:output = [] " Clear the output
|
||||||
if v:exception =~# 'healthcheck_not_found'
|
if v:exception =~# 'healthcheck_not_found'
|
||||||
call health#report_error('No healthcheck found for "'.name.'" plugin.')
|
call health#report_error('No healthcheck found for "'.name.'" plugin.')
|
||||||
elseif v:exception =~# 'healthcheck_no_return_value'
|
|
||||||
call health#report_error('The healthcheck report for "'.name.'" plugin is empty.')
|
|
||||||
else
|
else
|
||||||
call health#report_error(printf(
|
call health#report_error(printf(
|
||||||
\ "Failed to run healthcheck for \"%s\" plugin. Exception:\n%s\n%s",
|
\ "Failed to run healthcheck for \"%s\" plugin. Exception:\n%s\n%s",
|
||||||
@@ -134,7 +127,7 @@ endfunction " }}}
|
|||||||
|
|
||||||
" From a path return a list [{name}, {func}, {type}] representing a healthcheck
|
" From a path return a list [{name}, {func}, {type}] representing a healthcheck
|
||||||
function! s:filepath_to_healthcheck(path) abort
|
function! s:filepath_to_healthcheck(path) abort
|
||||||
if a:path =~# 'vim$'
|
if a:path =~# 'vim$'
|
||||||
let name = matchstr(a:path, '\zs[^\/]*\ze\.vim$')
|
let name = matchstr(a:path, '\zs[^\/]*\ze\.vim$')
|
||||||
let func = 'health#'.name.'#check'
|
let func = 'health#'.name.'#check'
|
||||||
let type = 'v'
|
let type = 'v'
|
||||||
@@ -188,7 +181,7 @@ function! s:get_healthcheck_list(plugin_names) abort
|
|||||||
\ + nvim_get_runtime_file('lua/**/'.p.'/health/init.lua', v:true)
|
\ + nvim_get_runtime_file('lua/**/'.p.'/health/init.lua', v:true)
|
||||||
\ + nvim_get_runtime_file('lua/**/'.p.'/health.lua', v:true)
|
\ + nvim_get_runtime_file('lua/**/'.p.'/health.lua', v:true)
|
||||||
if len(paths) == 0
|
if len(paths) == 0
|
||||||
let healthchecks += [[p, '', '']] " healthcheck not found
|
let healthchecks += [[p, '', '']] " healthchek not found
|
||||||
else
|
else
|
||||||
let healthchecks += map(uniq(sort(paths)),
|
let healthchecks += map(uniq(sort(paths)),
|
||||||
\'<SID>filepath_to_healthcheck(v:val)')
|
\'<SID>filepath_to_healthcheck(v:val)')
|
||||||
|
@@ -104,8 +104,8 @@ function! s:check_rplugin_manifest() abort
|
|||||||
if !has_key(existing_rplugins, script)
|
if !has_key(existing_rplugins, script)
|
||||||
let msg = printf('"%s" is not registered.', fnamemodify(path, ':t'))
|
let msg = printf('"%s" is not registered.', fnamemodify(path, ':t'))
|
||||||
if python_version ==# 'pythonx'
|
if python_version ==# 'pythonx'
|
||||||
if !has('python3')
|
if !has('python2') && !has('python3')
|
||||||
let msg .= ' (python3 not available)'
|
let msg .= ' (python2 and python3 not available)'
|
||||||
endif
|
endif
|
||||||
elseif !has(python_version)
|
elseif !has(python_version)
|
||||||
let msg .= printf(' (%s not available)', python_version)
|
let msg .= printf(' (%s not available)', python_version)
|
||||||
@@ -148,14 +148,14 @@ endfunction
|
|||||||
|
|
||||||
function! s:get_tmux_option(option) abort
|
function! s:get_tmux_option(option) abort
|
||||||
let cmd = 'tmux show-option -qvg '.a:option " try global scope
|
let cmd = 'tmux show-option -qvg '.a:option " try global scope
|
||||||
let out = system(split(cmd))
|
let out = system(cmd)
|
||||||
let val = substitute(out, '\v(\s|\r|\n)', '', 'g')
|
let val = substitute(out, '\v(\s|\r|\n)', '', 'g')
|
||||||
if v:shell_error
|
if v:shell_error
|
||||||
call health#report_error('command failed: '.cmd."\n".out)
|
call health#report_error('command failed: '.cmd."\n".out)
|
||||||
return 'error'
|
return 'error'
|
||||||
elseif empty(val)
|
elseif empty(val)
|
||||||
let cmd = 'tmux show-option -qvgs '.a:option " try session scope
|
let cmd = 'tmux show-option -qvgs '.a:option " try session scope
|
||||||
let out = system(split(cmd))
|
let out = system(cmd)
|
||||||
let val = substitute(out, '\v(\s|\r|\n)', '', 'g')
|
let val = substitute(out, '\v(\s|\r|\n)', '', 'g')
|
||||||
if v:shell_error
|
if v:shell_error
|
||||||
call health#report_error('command failed: '.cmd."\n".out)
|
call health#report_error('command failed: '.cmd."\n".out)
|
||||||
@@ -202,11 +202,11 @@ function! s:check_tmux() abort
|
|||||||
" check default-terminal and $TERM
|
" check default-terminal and $TERM
|
||||||
call health#report_info('$TERM: '.$TERM)
|
call health#report_info('$TERM: '.$TERM)
|
||||||
let cmd = 'tmux show-option -qvg default-terminal'
|
let cmd = 'tmux show-option -qvg default-terminal'
|
||||||
let out = system(split(cmd))
|
let out = system(cmd)
|
||||||
let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g')
|
let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g')
|
||||||
if empty(tmux_default_term)
|
if empty(tmux_default_term)
|
||||||
let cmd = 'tmux show-option -qvgs default-terminal'
|
let cmd = 'tmux show-option -qvgs default-terminal'
|
||||||
let out = system(split(cmd))
|
let out = system(cmd)
|
||||||
let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g')
|
let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -225,7 +225,7 @@ function! s:check_tmux() abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" check for RGB capabilities
|
" check for RGB capabilities
|
||||||
let info = system(['tmux', 'server-info'])
|
let info = system('tmux server-info')
|
||||||
let has_tc = stridx(info, " Tc: (flag) true") != -1
|
let has_tc = stridx(info, " Tc: (flag) true") != -1
|
||||||
let has_rgb = stridx(info, " RGB: (flag) true") != -1
|
let has_rgb = stridx(info, " RGB: (flag) true") != -1
|
||||||
if !has_tc && !has_rgb
|
if !has_tc && !has_rgb
|
||||||
@@ -242,7 +242,7 @@ function! s:check_terminal() abort
|
|||||||
endif
|
endif
|
||||||
call health#report_start('terminal')
|
call health#report_start('terminal')
|
||||||
let cmd = 'infocmp -L'
|
let cmd = 'infocmp -L'
|
||||||
let out = system(split(cmd))
|
let out = system(cmd)
|
||||||
let kbs_entry = matchstr(out, 'key_backspace=[^,[:space:]]*')
|
let kbs_entry = matchstr(out, 'key_backspace=[^,[:space:]]*')
|
||||||
let kdch1_entry = matchstr(out, 'key_dc=[^,[:space:]]*')
|
let kdch1_entry = matchstr(out, 'key_dc=[^,[:space:]]*')
|
||||||
|
|
||||||
|
@@ -282,10 +282,10 @@ function! s:disabled_via_loaded_var(provider) abort
|
|||||||
return 0
|
return 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:check_python() abort
|
function! s:check_python(version) abort
|
||||||
call health#report_start('Python 3 provider (optional)')
|
call health#report_start('Python ' . a:version . ' provider (optional)')
|
||||||
|
|
||||||
let pyname = 'python3'
|
let pyname = 'python'.(a:version == 2 ? '' : '3')
|
||||||
let python_exe = ''
|
let python_exe = ''
|
||||||
let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : ''
|
let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : ''
|
||||||
let host_prog_var = pyname.'_host_prog'
|
let host_prog_var = pyname.'_host_prog'
|
||||||
@@ -301,7 +301,7 @@ function! s:check_python() abort
|
|||||||
call health#report_info(printf('Using: g:%s = "%s"', host_prog_var, get(g:, host_prog_var)))
|
call health#report_info(printf('Using: g:%s = "%s"', host_prog_var, get(g:, host_prog_var)))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let [pyname, pythonx_warnings] = provider#pythonx#Detect(3)
|
let [pyname, pythonx_errors] = provider#pythonx#Detect(a:version)
|
||||||
|
|
||||||
if empty(pyname)
|
if empty(pyname)
|
||||||
call health#report_warn('No Python executable found that can `import neovim`. '
|
call health#report_warn('No Python executable found that can `import neovim`. '
|
||||||
@@ -311,9 +311,8 @@ function! s:check_python() abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" No Python executable could `import neovim`, or host_prog_var was used.
|
" No Python executable could `import neovim`, or host_prog_var was used.
|
||||||
if !empty(pythonx_warnings)
|
if !empty(pythonx_errors)
|
||||||
call health#report_warn(pythonx_warnings, ['See :help provider-python for more information.',
|
call health#report_error('Python provider error:', pythonx_errors)
|
||||||
\ 'You may disable this provider (and warning) by adding `let g:loaded_python3_provider = 0` to your init.vim'])
|
|
||||||
|
|
||||||
elseif !empty(pyname) && empty(python_exe)
|
elseif !empty(pyname) && empty(python_exe)
|
||||||
if !exists('g:'.host_prog_var)
|
if !exists('g:'.host_prog_var)
|
||||||
@@ -406,7 +405,7 @@ function! s:check_python() abort
|
|||||||
" can import 'pynvim'. If so, that Python failed to import 'neovim' as
|
" can import 'pynvim'. If so, that Python failed to import 'neovim' as
|
||||||
" well, which is most probably due to a failed pip upgrade:
|
" well, which is most probably due to a failed pip upgrade:
|
||||||
" https://github.com/neovim/neovim/wiki/Following-HEAD#20181118
|
" https://github.com/neovim/neovim/wiki/Following-HEAD#20181118
|
||||||
let [pynvim_exe, errors] = provider#pythonx#DetectByModule('pynvim', 3)
|
let [pynvim_exe, errors] = provider#pythonx#DetectByModule('pynvim', a:version)
|
||||||
if !empty(pynvim_exe)
|
if !empty(pynvim_exe)
|
||||||
call health#report_error(
|
call health#report_error(
|
||||||
\ 'Detected pip upgrade failure: Python executable can import "pynvim" but '
|
\ 'Detected pip upgrade failure: Python executable can import "pynvim" but '
|
||||||
@@ -417,14 +416,14 @@ function! s:check_python() abort
|
|||||||
\ . pynvim_exe ." -m pip install neovim # only if needed by third-party software")
|
\ . pynvim_exe ." -m pip install neovim # only if needed by third-party software")
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
let [majorpyversion, current, latest, status] = s:version_info(python_exe)
|
let [pyversion, current, latest, status] = s:version_info(python_exe)
|
||||||
|
|
||||||
if 3 != str2nr(majorpyversion)
|
if a:version != str2nr(pyversion)
|
||||||
call health#report_warn('Unexpected Python version.' .
|
call health#report_warn('Unexpected Python version.' .
|
||||||
\ ' This could lead to confusing error messages.')
|
\ ' This could lead to confusing error messages.')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call health#report_info('Python version: ' . majorpyversion)
|
call health#report_info('Python version: ' . pyversion)
|
||||||
|
|
||||||
if s:is_bad_response(status)
|
if s:is_bad_response(status)
|
||||||
call health#report_info(printf('pynvim version: %s (%s)', current, status))
|
call health#report_info(printf('pynvim version: %s (%s)', current, status))
|
||||||
@@ -566,7 +565,7 @@ function! s:check_ruby() abort
|
|||||||
\ ['Install Ruby and verify that `ruby` and `gem` commands work.'])
|
\ ['Install Ruby and verify that `ruby` and `gem` commands work.'])
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
call health#report_info('Ruby: '. s:system(['ruby', '-v']))
|
call health#report_info('Ruby: '. s:system('ruby -v'))
|
||||||
|
|
||||||
let [host, err] = provider#ruby#Detect()
|
let [host, err] = provider#ruby#Detect()
|
||||||
if empty(host)
|
if empty(host)
|
||||||
@@ -574,8 +573,7 @@ function! s:check_ruby() abort
|
|||||||
\ ['Run `gem install neovim` to ensure the neovim RubyGem is installed.',
|
\ ['Run `gem install neovim` to ensure the neovim RubyGem is installed.',
|
||||||
\ 'Run `gem environment` to ensure the gem bin directory is in $PATH.',
|
\ 'Run `gem environment` to ensure the gem bin directory is in $PATH.',
|
||||||
\ 'If you are using rvm/rbenv/chruby, try "rehashing".',
|
\ 'If you are using rvm/rbenv/chruby, try "rehashing".',
|
||||||
\ 'See :help g:ruby_host_prog for non-standard gem installations.',
|
\ 'See :help g:ruby_host_prog for non-standard gem installations.'])
|
||||||
\ 'You may disable this provider (and warning) by adding `let g:loaded_ruby_provider = 0` to your init.vim'])
|
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
call health#report_info('Host: '. host)
|
call health#report_info('Host: '. host)
|
||||||
@@ -590,11 +588,11 @@ function! s:check_ruby() abort
|
|||||||
endif
|
endif
|
||||||
let latest_gem = get(split(latest_gem, 'neovim (\|, \|)$' ), 0, 'not found')
|
let latest_gem = get(split(latest_gem, 'neovim (\|, \|)$' ), 0, 'not found')
|
||||||
|
|
||||||
let current_gem_cmd = [host, '--version']
|
let current_gem_cmd = host .' --version'
|
||||||
let current_gem = s:system(current_gem_cmd)
|
let current_gem = s:system(current_gem_cmd)
|
||||||
if s:shell_error
|
if s:shell_error
|
||||||
call health#report_error('Failed to run: '. join(current_gem_cmd),
|
call health#report_error('Failed to run: '. current_gem_cmd,
|
||||||
\ ['Report this issue with the output of: ', join(current_gem_cmd)])
|
\ ['Report this issue with the output of: ', current_gem_cmd])
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -621,7 +619,7 @@ function! s:check_node() abort
|
|||||||
\ ['Install Node.js and verify that `node` and `npm` (or `yarn`) commands work.'])
|
\ ['Install Node.js and verify that `node` and `npm` (or `yarn`) commands work.'])
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let node_v = get(split(s:system(['node', '-v']), "\n"), 0, '')
|
let node_v = get(split(s:system('node -v'), "\n"), 0, '')
|
||||||
call health#report_info('Node.js: '. node_v)
|
call health#report_info('Node.js: '. node_v)
|
||||||
if s:shell_error || s:version_cmp(node_v[1:], '6.0.0') < 0
|
if s:shell_error || s:version_cmp(node_v[1:], '6.0.0') < 0
|
||||||
call health#report_warn('Nvim node.js host does not support '.node_v)
|
call health#report_warn('Nvim node.js host does not support '.node_v)
|
||||||
@@ -636,8 +634,7 @@ function! s:check_node() abort
|
|||||||
if empty(host)
|
if empty(host)
|
||||||
call health#report_warn('Missing "neovim" npm (or yarn) package.',
|
call health#report_warn('Missing "neovim" npm (or yarn) package.',
|
||||||
\ ['Run in shell: npm install -g neovim',
|
\ ['Run in shell: npm install -g neovim',
|
||||||
\ 'Run in shell (if you use yarn): yarn global add neovim',
|
\ 'Run in shell (if you use yarn): yarn global add neovim'])
|
||||||
\ 'You may disable this provider (and warning) by adding `let g:loaded_node_provider = 0` to your init.vim'])
|
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
call health#report_info('Nvim node.js host: '. host)
|
call health#report_info('Nvim node.js host: '. host)
|
||||||
@@ -663,8 +660,8 @@ function! s:check_node() abort
|
|||||||
let current_npm_cmd = ['node', host, '--version']
|
let current_npm_cmd = ['node', host, '--version']
|
||||||
let current_npm = s:system(current_npm_cmd)
|
let current_npm = s:system(current_npm_cmd)
|
||||||
if s:shell_error
|
if s:shell_error
|
||||||
call health#report_error('Failed to run: '. join(current_npm_cmd),
|
call health#report_error('Failed to run: '. string(current_npm_cmd),
|
||||||
\ ['Report this issue with the output of: ', join(current_npm_cmd)])
|
\ ['Report this issue with the output of: ', string(current_npm_cmd)])
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -686,15 +683,14 @@ function! s:check_perl() abort
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let [perl_exec, perl_warnings] = provider#perl#Detect()
|
let [perl_exec, perl_errors] = provider#perl#Detect()
|
||||||
if empty(perl_exec)
|
if empty(perl_exec)
|
||||||
if !empty(perl_warnings)
|
if !empty(perl_errors)
|
||||||
call health#report_warn(perl_warnings, ['See :help provider-perl for more information.',
|
call health#report_error('perl provider error:', perl_errors)
|
||||||
\ 'You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim'])
|
else
|
||||||
else
|
|
||||||
call health#report_warn('No usable perl executable found')
|
call health#report_warn('No usable perl executable found')
|
||||||
endif
|
endif
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call health#report_info('perl executable: '. perl_exec)
|
call health#report_info('perl executable: '. perl_exec)
|
||||||
@@ -738,8 +734,8 @@ function! s:check_perl() abort
|
|||||||
let current_cpan_cmd = [perl_exec, '-W', '-MNeovim::Ext', '-e', 'print $Neovim::Ext::VERSION']
|
let current_cpan_cmd = [perl_exec, '-W', '-MNeovim::Ext', '-e', 'print $Neovim::Ext::VERSION']
|
||||||
let current_cpan = s:system(current_cpan_cmd)
|
let current_cpan = s:system(current_cpan_cmd)
|
||||||
if s:shell_error
|
if s:shell_error
|
||||||
call health#report_error('Failed to run: '. join(current_cpan_cmd),
|
call health#report_error('Failed to run: '. string(current_cpan_cmd),
|
||||||
\ ['Report this issue with the output of: ', join(current_cpan_cmd)])
|
\ ['Report this issue with the output of: ', string(current_cpan_cmd)])
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -755,7 +751,8 @@ endfunction
|
|||||||
|
|
||||||
function! health#provider#check() abort
|
function! health#provider#check() abort
|
||||||
call s:check_clipboard()
|
call s:check_clipboard()
|
||||||
call s:check_python()
|
call s:check_python(2)
|
||||||
|
call s:check_python(3)
|
||||||
call s:check_virtualenv()
|
call s:check_virtualenv()
|
||||||
call s:check_ruby()
|
call s:check_ruby()
|
||||||
call s:check_node()
|
call s:check_node()
|
||||||
|
@@ -7,6 +7,7 @@ let s:loaded_man = 1
|
|||||||
|
|
||||||
let s:find_arg = '-w'
|
let s:find_arg = '-w'
|
||||||
let s:localfile_arg = v:true " Always use -l if possible. #6683
|
let s:localfile_arg = v:true " Always use -l if possible. #6683
|
||||||
|
let s:section_arg = '-S'
|
||||||
|
|
||||||
function! man#init() abort
|
function! man#init() abort
|
||||||
try
|
try
|
||||||
@@ -215,42 +216,16 @@ endfunction
|
|||||||
|
|
||||||
function! s:get_path(sect, name) abort
|
function! s:get_path(sect, name) abort
|
||||||
" Some man implementations (OpenBSD) return all available paths from the
|
" Some man implementations (OpenBSD) return all available paths from the
|
||||||
" search command. Previously, this function would simply select the first one.
|
" search command, so we get() the first one. #8341
|
||||||
"
|
|
||||||
" However, some searches will report matches that are incorrect:
|
|
||||||
" man -w strlen may return string.3 followed by strlen.3, and therefore
|
|
||||||
" selecting the first would get us the wrong page. Thus, we must find the
|
|
||||||
" first matching one.
|
|
||||||
"
|
|
||||||
" There's yet another special case here. Consider the following:
|
|
||||||
" If you run man -w strlen and string.3 comes up first, this is a problem. We
|
|
||||||
" should search for a matching named one in the results list.
|
|
||||||
" However, if you search for man -w clock_gettime, you will *only* get
|
|
||||||
" clock_getres.2, which is the right page. Searching the resuls for
|
|
||||||
" clock_gettime will no longer work. In this case, we should just use the
|
|
||||||
" first one that was found in the correct section.
|
|
||||||
"
|
|
||||||
" Finally, we can avoid relying on -S or -s here since they are very
|
|
||||||
" inconsistently supported. Instead, call -w with a section and a name.
|
|
||||||
if empty(a:sect)
|
if empty(a:sect)
|
||||||
let results = split(s:system(['man', s:find_arg, a:name]))
|
return substitute(get(split(s:system(['man', s:find_arg, a:name])), 0, ''), '\n\+$', '', '')
|
||||||
else
|
|
||||||
let results = split(s:system(['man', s:find_arg, a:sect, a:name]))
|
|
||||||
endif
|
endif
|
||||||
|
" '-s' flag handles:
|
||||||
if empty(results)
|
" - tokens like 'printf(echo)'
|
||||||
return ''
|
" - sections starting with '-'
|
||||||
endif
|
" - 3pcap section (found on macOS)
|
||||||
|
" - commas between sections (for section priority)
|
||||||
" find any that match the specified name
|
return substitute(get(split(s:system(['man', s:find_arg, s:section_arg, a:sect, a:name])), 0, ''), '\n\+$', '', '')
|
||||||
let namematches = filter(copy(results), 'fnamemodify(v:val, ":t") =~ a:name')
|
|
||||||
let sectmatches = []
|
|
||||||
|
|
||||||
if !empty(namematches) && !empty(a:sect)
|
|
||||||
let sectmatches = filter(copy(namematches), 'fnamemodify(v:val, ":e") == a:sect')
|
|
||||||
endif
|
|
||||||
|
|
||||||
return substitute(get(sectmatches, 0, get(namematches, 0, results[0])), '\n\+$', '', '')
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" s:verify_exists attempts to find the path to a manpage
|
" s:verify_exists attempts to find the path to a manpage
|
||||||
@@ -268,72 +243,40 @@ endfunction
|
|||||||
" then we don't do it again in step 2.
|
" then we don't do it again in step 2.
|
||||||
function! s:verify_exists(sect, name) abort
|
function! s:verify_exists(sect, name) abort
|
||||||
let sect = a:sect
|
let sect = a:sect
|
||||||
|
|
||||||
if empty(sect)
|
if empty(sect)
|
||||||
" no section specified, so search with b:man_default_sects
|
let sect = get(b:, 'man_default_sects', '')
|
||||||
if exists('b:man_default_sects')
|
|
||||||
let sects = split(b:man_default_sects, ',')
|
|
||||||
for sec in sects
|
|
||||||
try
|
|
||||||
let res = s:get_path(sec, a:name)
|
|
||||||
if !empty(res)
|
|
||||||
return res
|
|
||||||
endif
|
|
||||||
catch /^command error (/
|
|
||||||
endtry
|
|
||||||
endfor
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
" try with specified section
|
|
||||||
try
|
|
||||||
let res = s:get_path(sect, a:name)
|
|
||||||
if !empty(res)
|
|
||||||
return res
|
|
||||||
endif
|
|
||||||
catch /^command error (/
|
|
||||||
endtry
|
|
||||||
|
|
||||||
" try again with b:man_default_sects
|
|
||||||
if exists('b:man_default_sects')
|
|
||||||
let sects = split(b:man_default_sects, ',')
|
|
||||||
for sec in sects
|
|
||||||
try
|
|
||||||
let res = s:get_path(sec, a:name)
|
|
||||||
if !empty(res)
|
|
||||||
return res
|
|
||||||
endif
|
|
||||||
catch /^command error (/
|
|
||||||
endtry
|
|
||||||
endfor
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" if none of the above worked, we will try with no section
|
|
||||||
try
|
try
|
||||||
let res = s:get_path('', a:name)
|
return s:get_path(sect, a:name)
|
||||||
if !empty(res)
|
|
||||||
return res
|
|
||||||
endif
|
|
||||||
catch /^command error (/
|
catch /^command error (/
|
||||||
endtry
|
endtry
|
||||||
|
|
||||||
" if that still didn't work, we will check for $MANSECT and try again with it
|
if !empty(get(b:, 'man_default_sects', '')) && sect !=# b:man_default_sects
|
||||||
" unset
|
try
|
||||||
|
return s:get_path(b:man_default_sects, a:name)
|
||||||
|
catch /^command error (/
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !empty(sect)
|
||||||
|
try
|
||||||
|
return s:get_path('', a:name)
|
||||||
|
catch /^command error (/
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
|
|
||||||
if !empty($MANSECT)
|
if !empty($MANSECT)
|
||||||
try
|
try
|
||||||
let MANSECT = $MANSECT
|
let MANSECT = $MANSECT
|
||||||
call setenv('MANSECT', v:null)
|
call setenv('MANSECT', v:null)
|
||||||
let res = s:get_path('', a:name)
|
return s:get_path('', a:name)
|
||||||
if !empty(res)
|
|
||||||
return res
|
|
||||||
endif
|
|
||||||
catch /^command error (/
|
catch /^command error (/
|
||||||
finally
|
finally
|
||||||
call setenv('MANSECT', MANSECT)
|
call setenv('MANSECT', MANSECT)
|
||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" finally, if that didn't work, there is no hope
|
|
||||||
throw 'no manual entry for ' . a:name
|
throw 'no manual entry for ' . a:name
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
45
runtime/autoload/provider/python.vim
Normal file
45
runtime/autoload/provider/python.vim
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
" The Python provider uses a Python host to emulate an environment for running
|
||||||
|
" python-vim plugins. :help provider
|
||||||
|
"
|
||||||
|
" Associating the plugin with the Python host is the first step because plugins
|
||||||
|
" will be passed as command-line arguments
|
||||||
|
|
||||||
|
if exists('g:loaded_python_provider')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let [s:prog, s:err] = provider#pythonx#Detect(2)
|
||||||
|
let g:loaded_python_provider = empty(s:prog) ? 1 : 2
|
||||||
|
|
||||||
|
function! provider#python#Prog() abort
|
||||||
|
return s:prog
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! provider#python#Error() abort
|
||||||
|
return s:err
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" The Python provider plugin will run in a separate instance of the Python
|
||||||
|
" host.
|
||||||
|
call remote#host#RegisterClone('legacy-python-provider', 'python')
|
||||||
|
call remote#host#RegisterPlugin('legacy-python-provider', 'script_host.py', [])
|
||||||
|
|
||||||
|
function! provider#python#Call(method, args) abort
|
||||||
|
if s:err != ''
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
if !exists('s:host')
|
||||||
|
let s:rpcrequest = function('rpcrequest')
|
||||||
|
|
||||||
|
" Ensure that we can load the Python host before bootstrapping
|
||||||
|
try
|
||||||
|
let s:host = remote#host#Require('legacy-python-provider')
|
||||||
|
catch
|
||||||
|
let s:err = v:exception
|
||||||
|
echohl WarningMsg
|
||||||
|
echomsg v:exception
|
||||||
|
echohl None
|
||||||
|
return
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
|
return call(s:rpcrequest, insert(insert(a:args, 'python_'.a:method), s:host))
|
||||||
|
endfunction
|
@@ -6,8 +6,10 @@ endif
|
|||||||
let s:loaded_pythonx_provider = 1
|
let s:loaded_pythonx_provider = 1
|
||||||
|
|
||||||
function! provider#pythonx#Require(host) abort
|
function! provider#pythonx#Require(host) abort
|
||||||
|
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
|
||||||
|
|
||||||
" Python host arguments
|
" Python host arguments
|
||||||
let prog = provider#python3#Prog()
|
let prog = (ver == '2' ? provider#python#Prog() : provider#python3#Prog())
|
||||||
let args = [prog, '-c', 'import sys; sys.path = list(filter(lambda x: x != "", sys.path)); import neovim; neovim.start_host()']
|
let args = [prog, '-c', 'import sys; sys.path = list(filter(lambda x: x != "", sys.path)); import neovim; neovim.start_host()']
|
||||||
|
|
||||||
|
|
||||||
@@ -21,12 +23,14 @@ function! provider#pythonx#Require(host) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:get_python_executable_from_host_var(major_version) abort
|
function! s:get_python_executable_from_host_var(major_version) abort
|
||||||
return expand(get(g:, 'python'.(a:major_version == 3 ? '3' : execute("throw 'unsupported'")).'_host_prog', ''), v:true)
|
return expand(get(g:, 'python'.(a:major_version == 3 ? '3' : '').'_host_prog', ''), v:true)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:get_python_candidates(major_version) abort
|
function! s:get_python_candidates(major_version) abort
|
||||||
return {
|
return {
|
||||||
\ 3: ['python3', 'python3.10', 'python3.9', 'python3.8', 'python3.7', 'python']
|
\ 2: ['python2', 'python2.7', 'python2.6', 'python'],
|
||||||
|
\ 3: ['python3', 'python3.10', 'python3.9', 'python3.8', 'python3.7',
|
||||||
|
\ 'python3.6', 'python']
|
||||||
\ }[a:major_version]
|
\ }[a:major_version]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -56,7 +60,7 @@ function! provider#pythonx#DetectByModule(module, major_version) abort
|
|||||||
endfor
|
endfor
|
||||||
|
|
||||||
" No suitable Python executable found.
|
" No suitable Python executable found.
|
||||||
return ['', 'Could not load Python '.a:major_version.":\n".join(errors, "\n")]
|
return ['', 'provider/pythonx: Could not load Python '.a:major_version.":\n".join(errors, "\n")]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Returns array: [prog_exitcode, prog_version]
|
" Returns array: [prog_exitcode, prog_version]
|
||||||
@@ -78,7 +82,7 @@ function! provider#pythonx#CheckForModule(prog, module, major_version) abort
|
|||||||
return [0, a:prog . ' not found in search path or not executable.']
|
return [0, a:prog . ' not found in search path or not executable.']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let min_version = '3.7'
|
let min_version = (a:major_version == 2) ? '2.6' : '3.3'
|
||||||
|
|
||||||
" Try to load module, and output Python version.
|
" Try to load module, and output Python version.
|
||||||
" Exit codes:
|
" Exit codes:
|
||||||
@@ -99,7 +103,7 @@ function! provider#pythonx#CheckForModule(prog, module, major_version) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if prog_exitcode == 2
|
if prog_exitcode == 2
|
||||||
return [0, prog_path.' does not have the "' . a:module . '" module.']
|
return [0, prog_path.' does not have the "' . a:module . '" module. :help provider-python']
|
||||||
elseif prog_exitcode == 127
|
elseif prog_exitcode == 127
|
||||||
" This can happen with pyenv's shims.
|
" This can happen with pyenv's shims.
|
||||||
return [0, prog_path . ' does not exist: ' . prog_version]
|
return [0, prog_path . ' does not exist: ' . prog_version]
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
" Maintainer: <vacancy>
|
" Maintainer: <vacancy>
|
||||||
" Previous Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
|
" Previous Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
|
||||||
" Version: 0.9
|
" Version: 0.9
|
||||||
" Last Updated: 2022 Mar 30
|
" Last Updated: 2020 Oct 9
|
||||||
"
|
"
|
||||||
" Roland Puntaier: this file contains adaptations for python3 and is parallel to pythoncomplete.vim
|
" Roland Puntaier: this file contains adaptations for python3 and is parallel to pythoncomplete.vim
|
||||||
"
|
"
|
||||||
@@ -91,9 +91,6 @@ endfunction
|
|||||||
|
|
||||||
function! s:DefPython()
|
function! s:DefPython()
|
||||||
py3 << PYTHONEOF
|
py3 << PYTHONEOF
|
||||||
import warnings
|
|
||||||
warnings.simplefilter(action='ignore', category=FutureWarning)
|
|
||||||
|
|
||||||
import sys, tokenize, io, types
|
import sys, tokenize, io, types
|
||||||
from token import NAME, DEDENT, NEWLINE, STRING
|
from token import NAME, DEDENT, NEWLINE, STRING
|
||||||
|
|
||||||
|
@@ -240,11 +240,7 @@ function! s:GetAutocmdPrefix(name, opts)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if has_key(a:opts, 'nested') && a:opts.nested
|
if has_key(a:opts, 'nested') && a:opts.nested
|
||||||
call add(rv, '++nested')
|
call add(rv, 'nested')
|
||||||
endif
|
|
||||||
|
|
||||||
if has_key(a:opts, 'once') && a:opts.once
|
|
||||||
call add(rv, '++once')
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return join(rv, ' ')
|
return join(rv, ' ')
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
" Vim compiler file
|
" Vim compiler file
|
||||||
" Compiler: Jest
|
" Compiler: Jest
|
||||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||||
" Last Change: 2021 Nov 20
|
" Last Change: 2018 May 15
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists("current_compiler")
|
||||||
finish
|
finish
|
||||||
@@ -15,14 +15,12 @@ endif
|
|||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
" CompilerSet makeprg=npx\ --no-install\ jest\ --no-colors
|
" CompilerSet makeprg=npx\ jest\ --no-colors
|
||||||
|
|
||||||
CompilerSet makeprg=jest\ --no-colors
|
CompilerSet makeprg=jest\ --no-colors
|
||||||
CompilerSet errorformat=%-A\ \ ●\ Console,
|
CompilerSet errorformat=%E\ \ ●\ %m,
|
||||||
\%E\ \ ●\ %m,
|
|
||||||
\%Z\ %\\{4}%.%#Error:\ %f:\ %m\ (%l:%c):%\\=,
|
\%Z\ %\\{4}%.%#Error:\ %f:\ %m\ (%l:%c):%\\=,
|
||||||
\%Z\ %\\{6}at\ %\\S%#\ (%f:%l:%c),
|
\%Z\ %\\{6}at\ %\\S%#\ (%f:%l:%c),
|
||||||
\%Z\ %\\{6}at\ %\\S%#\ %f:%l:%c,
|
|
||||||
\%+C\ %\\{4}%\\w%.%#,
|
\%+C\ %\\{4}%\\w%.%#,
|
||||||
\%+C\ %\\{4}%[-+]%.%#,
|
\%+C\ %\\{4}%[-+]%.%#,
|
||||||
\%-C%.%#,
|
\%-C%.%#,
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
" Vim compiler file
|
" Vim compiler file
|
||||||
" Compiler: SML/NJ Compiler
|
" Compiler: SML/NJ Compiler
|
||||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||||
" Last Change: 2022 Feb 09
|
" Last Change: 2020 Feb 10
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists("current_compiler")
|
||||||
finish
|
finish
|
||||||
@@ -16,10 +16,10 @@ let s:cpo_save = &cpo
|
|||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
CompilerSet makeprg=sml
|
CompilerSet makeprg=sml
|
||||||
CompilerSet errorformat=%f:%l.%c-%e.%k\ %trror:\ %m,
|
CompilerSet errorformat=%f:%l.%c-%\\d%\\+.%\\d%\\+\ %trror:\ %m,
|
||||||
\%f:%l.%c\ %trror:\ %m,
|
\%f:%l.%c\ %trror:\ %m,
|
||||||
\%trror:\ %m,
|
\%trror:\ %m
|
||||||
\%f:%l.%c-%e.%k\ %tarning:\ %m,
|
\%f:%l.%c-%\\d%\\+.%\\d%\\+\ %tarning:\ %m,
|
||||||
\%f:%l.%c\ %tarning:\ %m,
|
\%f:%l.%c\ %tarning:\ %m,
|
||||||
\%tarning:\ %m,
|
\%tarning:\ %m,
|
||||||
\%-G%.%#
|
\%-G%.%#
|
||||||
|
@@ -45,7 +45,7 @@ start with a TCP/IP socket instead, use |--listen| with a TCP-style address: >
|
|||||||
More endpoints can be started with |serverstart()|.
|
More endpoints can be started with |serverstart()|.
|
||||||
|
|
||||||
Note that localhost TCP sockets are generally less secure than named pipes,
|
Note that localhost TCP sockets are generally less secure than named pipes,
|
||||||
and can lead to vulnerabilities like remote code execution.
|
and can lead to vunerabilities like remote code execution.
|
||||||
|
|
||||||
Connecting to the socket is the easiest way a programmer can test the API,
|
Connecting to the socket is the easiest way a programmer can test the API,
|
||||||
which can be done through any msgpack-rpc client library or full-featured
|
which can be done through any msgpack-rpc client library or full-featured
|
||||||
@@ -186,7 +186,7 @@ About the `functions` map:
|
|||||||
a type name, e.g. `nvim_buf_get_lines` is the `get_lines` method of
|
a type name, e.g. `nvim_buf_get_lines` is the `get_lines` method of
|
||||||
a Buffer instance. |dev-api|
|
a Buffer instance. |dev-api|
|
||||||
- Global functions have the "method=false" flag and are prefixed with just
|
- Global functions have the "method=false" flag and are prefixed with just
|
||||||
`nvim_`, e.g. `nvim_list_bufs`.
|
`nvim_`, e.g. `nvim_get_buffers`.
|
||||||
|
|
||||||
*api-mapping*
|
*api-mapping*
|
||||||
External programs (clients) can use the metadata to discover the API, using
|
External programs (clients) can use the metadata to discover the API, using
|
||||||
@@ -198,7 +198,7 @@ any of these approaches:
|
|||||||
|
|
||||||
2. Start Nvim with |--api-info|. Useful for statically-compiled clients.
|
2. Start Nvim with |--api-info|. Useful for statically-compiled clients.
|
||||||
Example (requires Python "pyyaml" and "msgpack-python" modules): >
|
Example (requires Python "pyyaml" and "msgpack-python" modules): >
|
||||||
nvim --api-info | python -c 'import msgpack, sys, yaml; yaml.dump(msgpack.unpackb(sys.stdin.buffer.read()), sys.stdout)'
|
nvim --api-info | python -c 'import msgpack, sys, yaml; print yaml.dump(msgpack.unpackb(sys.stdin.read()))'
|
||||||
<
|
<
|
||||||
3. Use the |api_info()| Vimscript function. >
|
3. Use the |api_info()| Vimscript function. >
|
||||||
:lua print(vim.inspect(vim.fn.api_info()))
|
:lua print(vim.inspect(vim.fn.api_info()))
|
||||||
@@ -452,7 +452,7 @@ Extended marks (extmarks) represent buffer annotations that track text changes
|
|||||||
in the buffer. They can represent cursors, folds, misspelled words, anything
|
in the buffer. They can represent cursors, folds, misspelled words, anything
|
||||||
that needs to track a logical location in the buffer over time. |api-indexing|
|
that needs to track a logical location in the buffer over time. |api-indexing|
|
||||||
|
|
||||||
Extmark position works like "bar" cursor: it exists between characters. Thus,
|
Extmark position works like "bar" cursor: it exists between characters. Thus
|
||||||
the maximum extmark index on a line is 1 more than the character index: >
|
the maximum extmark index on a line is 1 more than the character index: >
|
||||||
|
|
||||||
f o o b a r line contents
|
f o o b a r line contents
|
||||||
@@ -468,7 +468,7 @@ extmark position and enter some text, the extmark migrates forward. >
|
|||||||
f o o z|b a r line (| = cursor)
|
f o o z|b a r line (| = cursor)
|
||||||
4 extmark (after typing "z")
|
4 extmark (after typing "z")
|
||||||
|
|
||||||
If an extmark is on the last index of a line and you input a newline at that
|
If an extmark is on the last index of a line and you inputsa newline at that
|
||||||
point, the extmark will accordingly migrate to the next line: >
|
point, the extmark will accordingly migrate to the next line: >
|
||||||
|
|
||||||
f o o z b a r| line (| = cursor)
|
f o o z b a r| line (| = cursor)
|
||||||
@@ -594,8 +594,7 @@ nvim__id_float({flt}) *nvim__id_float()*
|
|||||||
its argument.
|
its argument.
|
||||||
|
|
||||||
nvim__inspect_cell({grid}, {row}, {col}) *nvim__inspect_cell()*
|
nvim__inspect_cell({grid}, {row}, {col}) *nvim__inspect_cell()*
|
||||||
NB: if your UI doesn't use hlstate, this will not return
|
TODO: Documentation
|
||||||
hlstate first time.
|
|
||||||
|
|
||||||
nvim__runtime_inspect() *nvim__runtime_inspect()*
|
nvim__runtime_inspect() *nvim__runtime_inspect()*
|
||||||
TODO: Documentation
|
TODO: Documentation
|
||||||
@@ -635,7 +634,7 @@ nvim_call_atomic({calls}) *nvim_call_atomic()*
|
|||||||
atomically, i.e. without interleaving redraws, RPC requests
|
atomically, i.e. without interleaving redraws, RPC requests
|
||||||
from other clients, or user interactions (however API
|
from other clients, or user interactions (however API
|
||||||
methods may trigger autocommands or event processing which
|
methods may trigger autocommands or event processing which
|
||||||
have such side effects, e.g. |:sleep| may wake timers).
|
have such side-effects, e.g. |:sleep| may wake timers).
|
||||||
2. To minimize RPC overhead (roundtrips) of a sequence of many
|
2. To minimize RPC overhead (roundtrips) of a sequence of many
|
||||||
requests.
|
requests.
|
||||||
|
|
||||||
@@ -654,11 +653,11 @@ nvim_call_atomic({calls}) *nvim_call_atomic()*
|
|||||||
be returned.
|
be returned.
|
||||||
|
|
||||||
nvim_chan_send({chan}, {data}) *nvim_chan_send()*
|
nvim_chan_send({chan}, {data}) *nvim_chan_send()*
|
||||||
Send data to channel `id`. For a job, it writes it to the
|
Send data to channel `id` . For a job, it writes it to the
|
||||||
stdin of the process. For the stdio channel |channel-stdio|,
|
stdin of the process. For the stdio channel |channel-stdio|,
|
||||||
it writes to Nvim's stdout. For an internal terminal instance
|
it writes to Nvim's stdout. For an internal terminal instance
|
||||||
(|nvim_open_term()|) it writes directly to terminal output.
|
(|nvim_open_term()|) it writes directly to terimal output. See
|
||||||
See |channel-bytes| for more information.
|
|channel-bytes| for more information.
|
||||||
|
|
||||||
This function writes raw data, not RPC messages. If the
|
This function writes raw data, not RPC messages. If the
|
||||||
channel was created with `rpc=true` then the channel expects
|
channel was created with `rpc=true` then the channel expects
|
||||||
@@ -684,62 +683,6 @@ nvim_create_buf({listed}, {scratch}) *nvim_create_buf()*
|
|||||||
See also: ~
|
See also: ~
|
||||||
buf_open_scratch
|
buf_open_scratch
|
||||||
|
|
||||||
*nvim_create_user_command()*
|
|
||||||
nvim_create_user_command({name}, {command}, {*opts})
|
|
||||||
Create a new user command |user-commands|
|
|
||||||
|
|
||||||
{name} is the name of the new command. The name must begin
|
|
||||||
with an uppercase letter.
|
|
||||||
|
|
||||||
{command} is the replacement text or Lua function to execute.
|
|
||||||
|
|
||||||
Example: >
|
|
||||||
:call nvim_create_user_command('SayHello', 'echo "Hello world!"', {})
|
|
||||||
:SayHello
|
|
||||||
Hello world!
|
|
||||||
<
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{name} Name of the new user command. Must begin with
|
|
||||||
an uppercase letter.
|
|
||||||
{command} Replacement command to execute when this user
|
|
||||||
command is executed. When called from Lua, the
|
|
||||||
command can also be a Lua function. The
|
|
||||||
function is called with a single table argument
|
|
||||||
that contains the following keys:
|
|
||||||
• args: (string) The args passed to the
|
|
||||||
command, if any |<args>|
|
|
||||||
• fargs: (table) The args split by unescaped
|
|
||||||
whitespace (when more than one argument is
|
|
||||||
allowed), if any |<f-args>|
|
|
||||||
• bang: (boolean) "true" if the command was
|
|
||||||
executed with a ! modifier |<bang>|
|
|
||||||
• line1: (number) The starting line of the
|
|
||||||
command range |<line1>|
|
|
||||||
• line2: (number) The final line of the command
|
|
||||||
range |<line2>|
|
|
||||||
• range: (number) The number of items in the
|
|
||||||
command range: 0, 1, or 2 |<range>|
|
|
||||||
• count: (number) Any count supplied |<count>|
|
|
||||||
• reg: (string) The optional register, if
|
|
||||||
specified |<reg>|
|
|
||||||
• mods: (string) Command modifiers, if any
|
|
||||||
|<mods>|
|
|
||||||
{opts} Optional command attributes. See
|
|
||||||
|command-attributes| for more details. To use
|
|
||||||
boolean attributes (such as |:command-bang| or
|
|
||||||
|:command-bar|) set the value to "true". In
|
|
||||||
addition to the string options listed in
|
|
||||||
|:command-complete|, the "complete" key also
|
|
||||||
accepts a Lua function which works like the
|
|
||||||
"customlist" completion mode
|
|
||||||
|:command-completion-customlist|. Additional
|
|
||||||
parameters:
|
|
||||||
• desc: (string) Used for listing the command
|
|
||||||
when a Lua function is used for {command}.
|
|
||||||
• force: (boolean, default true) Override any
|
|
||||||
previous definition.
|
|
||||||
|
|
||||||
nvim_del_current_line() *nvim_del_current_line()*
|
nvim_del_current_line() *nvim_del_current_line()*
|
||||||
Deletes the current line.
|
Deletes the current line.
|
||||||
|
|
||||||
@@ -755,7 +698,7 @@ nvim_del_keymap({mode}, {lhs}) *nvim_del_keymap()*
|
|||||||
|nvim_set_keymap()|
|
|nvim_set_keymap()|
|
||||||
|
|
||||||
nvim_del_mark({name}) *nvim_del_mark()*
|
nvim_del_mark({name}) *nvim_del_mark()*
|
||||||
Deletes an uppercase/file named mark. See |mark-motions|.
|
Deletes a uppercase/file named mark. See |mark-motions|.
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
fails with error if a lowercase or buffer local named mark
|
fails with error if a lowercase or buffer local named mark
|
||||||
@@ -771,12 +714,6 @@ nvim_del_mark({name}) *nvim_del_mark()*
|
|||||||
|nvim_buf_del_mark()|
|
|nvim_buf_del_mark()|
|
||||||
|nvim_get_mark()|
|
|nvim_get_mark()|
|
||||||
|
|
||||||
nvim_del_user_command({name}) *nvim_del_user_command()*
|
|
||||||
Delete a user-defined command.
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{name} Name of the command to delete.
|
|
||||||
|
|
||||||
nvim_del_var({name}) *nvim_del_var()*
|
nvim_del_var({name}) *nvim_del_var()*
|
||||||
Removes a global (g:) variable.
|
Removes a global (g:) variable.
|
||||||
|
|
||||||
@@ -826,7 +763,6 @@ nvim_eval_statusline({str}, {*opts}) *nvim_eval_statusline()*
|
|||||||
• maxwidth: (number) Maximum width of statusline.
|
• maxwidth: (number) Maximum width of statusline.
|
||||||
• fillchar: (string) Character to fill blank
|
• fillchar: (string) Character to fill blank
|
||||||
spaces in the statusline (see 'fillchars').
|
spaces in the statusline (see 'fillchars').
|
||||||
Treated as single-width even if it isn't.
|
|
||||||
• highlights: (boolean) Return highlight
|
• highlights: (boolean) Return highlight
|
||||||
information.
|
information.
|
||||||
• use_tabline: (boolean) Evaluate tabline instead
|
• use_tabline: (boolean) Evaluate tabline instead
|
||||||
@@ -851,7 +787,7 @@ nvim_exec_lua({code}, {args}) *nvim_exec_lua()*
|
|||||||
inside the chunk. The chunk can return a value.
|
inside the chunk. The chunk can return a value.
|
||||||
|
|
||||||
Only statements are executed. To evaluate an expression,
|
Only statements are executed. To evaluate an expression,
|
||||||
prefix it with `return`: return my_function(...)
|
prefix it with `return` : return my_function(...)
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{code} Lua code to execute
|
{code} Lua code to execute
|
||||||
@@ -860,7 +796,7 @@ nvim_exec_lua({code}, {args}) *nvim_exec_lua()*
|
|||||||
Return: ~
|
Return: ~
|
||||||
Return value of Lua code if present or NIL.
|
Return value of Lua code if present or NIL.
|
||||||
|
|
||||||
nvim_feedkeys({keys}, {mode}, {escape_ks}) *nvim_feedkeys()*
|
nvim_feedkeys({keys}, {mode}, {escape_csi}) *nvim_feedkeys()*
|
||||||
Sends input-keys to Nvim, subject to various quirks controlled
|
Sends input-keys to Nvim, subject to various quirks controlled
|
||||||
by `mode` flags. This is a blocking call, unlike
|
by `mode` flags. This is a blocking call, unlike
|
||||||
|nvim_input()|.
|
|nvim_input()|.
|
||||||
@@ -868,25 +804,23 @@ nvim_feedkeys({keys}, {mode}, {escape_ks}) *nvim_feedkeys()*
|
|||||||
On execution error: does not fail, but updates v:errmsg.
|
On execution error: does not fail, but updates v:errmsg.
|
||||||
|
|
||||||
To input sequences like <C-o> use |nvim_replace_termcodes()|
|
To input sequences like <C-o> use |nvim_replace_termcodes()|
|
||||||
(typically with escape_ks=false) to replace |keycodes|, then
|
(typically with escape_csi=true) to replace |keycodes|, then
|
||||||
pass the result to nvim_feedkeys().
|
pass the result to nvim_feedkeys().
|
||||||
|
|
||||||
Example: >
|
Example: >
|
||||||
:let key = nvim_replace_termcodes("<C-o>", v:true, v:false, v:true)
|
:let key = nvim_replace_termcodes("<C-o>", v:true, v:false, v:true)
|
||||||
:call nvim_feedkeys(key, 'n', v:false)
|
:call nvim_feedkeys(key, 'n', v:true)
|
||||||
<
|
<
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{keys} to be typed
|
{keys} to be typed
|
||||||
{mode} behavior flags, see |feedkeys()|
|
{mode} behavior flags, see |feedkeys()|
|
||||||
{escape_ks} If true, escape K_SPECIAL bytes in `keys`
|
{escape_csi} If true, escape K_SPECIAL/CSI bytes in
|
||||||
This should be false if you already used
|
`keys`
|
||||||
|nvim_replace_termcodes()|, and true
|
|
||||||
otherwise.
|
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
feedkeys()
|
feedkeys()
|
||||||
vim_strsave_escape_ks
|
vim_strsave_escape_csi
|
||||||
|
|
||||||
nvim_get_all_options_info() *nvim_get_all_options_info()*
|
nvim_get_all_options_info() *nvim_get_all_options_info()*
|
||||||
Gets the option information for all options.
|
Gets the option information for all options.
|
||||||
@@ -1084,7 +1018,7 @@ nvim_get_mode() *nvim_get_mode()*
|
|||||||
{fast}
|
{fast}
|
||||||
|
|
||||||
nvim_get_option({name}) *nvim_get_option()*
|
nvim_get_option({name}) *nvim_get_option()*
|
||||||
Gets the global value of an option.
|
Gets an option value string.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{name} Option name
|
{name} Option name
|
||||||
@@ -1115,32 +1049,14 @@ nvim_get_option_info({name}) *nvim_get_option_info()*
|
|||||||
Return: ~
|
Return: ~
|
||||||
Option Information
|
Option Information
|
||||||
|
|
||||||
nvim_get_option_value({name}, {*opts}) *nvim_get_option_value()*
|
|
||||||
Gets the value of an option. The behavior of this function
|
|
||||||
matches that of |:set|: the local value of an option is
|
|
||||||
returned if it exists; otherwise, the global value is
|
|
||||||
returned. Local values always correspond to the current buffer
|
|
||||||
or window. To get a buffer-local or window-local option for a
|
|
||||||
specific buffer or window, use |nvim_buf_get_option()| or
|
|
||||||
|nvim_win_get_option()|.
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{name} Option name
|
|
||||||
{opts} Optional parameters
|
|
||||||
• scope: One of 'global' or 'local'. Analogous to
|
|
||||||
|:setglobal| and |:setlocal|, respectively.
|
|
||||||
|
|
||||||
Return: ~
|
|
||||||
Option value
|
|
||||||
|
|
||||||
nvim_get_proc({pid}) *nvim_get_proc()*
|
nvim_get_proc({pid}) *nvim_get_proc()*
|
||||||
Gets info describing process `pid`.
|
Gets info describing process `pid` .
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
Map of process properties, or NIL if process not found.
|
Map of process properties, or NIL if process not found.
|
||||||
|
|
||||||
nvim_get_proc_children({pid}) *nvim_get_proc_children()*
|
nvim_get_proc_children({pid}) *nvim_get_proc_children()*
|
||||||
Gets the immediate children of process `pid`.
|
Gets the immediate children of process `pid` .
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
Array of child process ids, empty if process not found.
|
Array of child process ids, empty if process not found.
|
||||||
@@ -1249,8 +1165,8 @@ nvim_input_mouse({button}, {action}, {modifier}, {grid}, {row}, {col})
|
|||||||
nvim_list_bufs() *nvim_list_bufs()*
|
nvim_list_bufs() *nvim_list_bufs()*
|
||||||
Gets the current list of buffer handles
|
Gets the current list of buffer handles
|
||||||
|
|
||||||
Includes unlisted (unloaded/deleted) buffers, like `:ls!`. Use
|
Includes unlisted (unloaded/deleted) buffers, like `:ls!` .
|
||||||
|nvim_buf_is_loaded()| to check if a buffer is loaded.
|
Use |nvim_buf_is_loaded()| to check if a buffer is loaded.
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
List of buffer handles
|
List of buffer handles
|
||||||
@@ -1359,7 +1275,7 @@ nvim_paste({data}, {crlf}, {phase}) *nvim_paste()*
|
|||||||
|
|
||||||
Errors ('nomodifiable', `vim.paste()` failure, …) are
|
Errors ('nomodifiable', `vim.paste()` failure, …) are
|
||||||
reflected in `err` but do not affect the return value (which
|
reflected in `err` but do not affect the return value (which
|
||||||
is strictly decided by `vim.paste()`). On error, subsequent
|
is strictly decided by `vim.paste()` ). On error, subsequent
|
||||||
calls are ignored ("drained") until the next paste is
|
calls are ignored ("drained") until the next paste is
|
||||||
initiated (phase 1 or -1).
|
initiated (phase 1 or -1).
|
||||||
|
|
||||||
@@ -1412,7 +1328,7 @@ nvim_replace_termcodes({str}, {from_part}, {do_lt}, {special})
|
|||||||
{from_part} Legacy Vim parameter. Usually true.
|
{from_part} Legacy Vim parameter. Usually true.
|
||||||
{do_lt} Also translate <lt>. Ignored if `special` is
|
{do_lt} Also translate <lt>. Ignored if `special` is
|
||||||
false.
|
false.
|
||||||
{special} Replace |keycodes|, e.g. <CR> becomes a "\r"
|
{special} Replace |keycodes|, e.g. <CR> becomes a "\n"
|
||||||
char.
|
char.
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
@@ -1436,7 +1352,7 @@ nvim_select_popupmenu_item({item}, {insert}, {finish}, {opts})
|
|||||||
{insert} Whether the selection should be inserted in the
|
{insert} Whether the selection should be inserted in the
|
||||||
buffer.
|
buffer.
|
||||||
{finish} Finish the completion and dismiss the popupmenu.
|
{finish} Finish the completion and dismiss the popupmenu.
|
||||||
Implies `insert`.
|
Implies `insert` .
|
||||||
{opts} Optional parameters. Reserved for future use.
|
{opts} Optional parameters. Reserved for future use.
|
||||||
|
|
||||||
*nvim_set_client_info()*
|
*nvim_set_client_info()*
|
||||||
@@ -1545,30 +1461,25 @@ nvim_set_current_win({window}) *nvim_set_current_win()*
|
|||||||
Parameters: ~
|
Parameters: ~
|
||||||
{window} Window handle
|
{window} Window handle
|
||||||
|
|
||||||
nvim_set_hl({ns_id}, {name}, {*val}) *nvim_set_hl()*
|
nvim_set_hl({ns_id}, {name}, {val}) *nvim_set_hl()*
|
||||||
Sets a highlight group.
|
Set a highlight group.
|
||||||
|
|
||||||
Note: Unlike the `:highlight` command which can update a
|
TODO: ns_id = 0, should modify :highlight namespace TODO val
|
||||||
highlight group, this function completely replaces the
|
should take update vs reset flag
|
||||||
definition. For example: `nvim_set_hl(0, 'Visual', {})` will
|
|
||||||
clear the highlight group 'Visual'.
|
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{ns_id} Namespace id for this highlight
|
{ns_id} number of namespace for this highlight
|
||||||
|nvim_create_namespace()|. Use 0 to set a
|
{name} highlight group name, like ErrorMsg
|
||||||
highlight group globally |:highlight|.
|
{val} highlight definition map, like
|
||||||
{name} Highlight group name, e.g. "ErrorMsg"
|
|nvim_get_hl_by_name|. in addition the following
|
||||||
{val} Highlight definition map, like |synIDattr()|. In
|
keys are also recognized: `default` : don't
|
||||||
addition, the following keys are recognized:
|
override existing definition, like `hi default`
|
||||||
• default: Don't override existing definition
|
`ctermfg` : sets foreground of cterm color
|
||||||
|:hi-default|
|
`ctermbg` : sets background of cterm color
|
||||||
• ctermfg: Sets foreground of cterm color
|
`cterm` : cterm attribute map. sets attributed
|
||||||
|highlight-ctermfg|
|
for cterm colors. similer to `hi cterm` Note: by
|
||||||
• ctermbg: Sets background of cterm color
|
default cterm attributes are same as attributes
|
||||||
|highlight-ctermbg|
|
of gui color
|
||||||
• cterm: cterm attribute map, like
|
|
||||||
|highlight-args|. Note: Attributes default to
|
|
||||||
those set for `gui` if not set.
|
|
||||||
|
|
||||||
nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts}) *nvim_set_keymap()*
|
nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts}) *nvim_set_keymap()*
|
||||||
Sets a global |mapping| for the given mode.
|
Sets a global |mapping| for the given mode.
|
||||||
@@ -1595,33 +1506,16 @@ nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts}) *nvim_set_keymap()*
|
|||||||
{rhs} Right-hand-side |{rhs}| of the mapping.
|
{rhs} Right-hand-side |{rhs}| of the mapping.
|
||||||
{opts} Optional parameters map. Accepts all
|
{opts} Optional parameters map. Accepts all
|
||||||
|:map-arguments| as keys excluding |<buffer>| but
|
|:map-arguments| as keys excluding |<buffer>| but
|
||||||
including |noremap| and "desc". "desc" can be used
|
including |noremap|. Values are Booleans. Unknown
|
||||||
to give a description to keymap. When called from
|
key is an error.
|
||||||
Lua, also accepts a "callback" key that takes a
|
|
||||||
Lua function to call when the mapping is executed.
|
|
||||||
Values are Booleans. Unknown key is an error.
|
|
||||||
|
|
||||||
nvim_set_option({name}, {value}) *nvim_set_option()*
|
nvim_set_option({name}, {value}) *nvim_set_option()*
|
||||||
Sets the global value of an option.
|
Sets an option value.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{name} Option name
|
{name} Option name
|
||||||
{value} New option value
|
{value} New option value
|
||||||
|
|
||||||
*nvim_set_option_value()*
|
|
||||||
nvim_set_option_value({name}, {value}, {*opts})
|
|
||||||
Sets the value of an option. The behavior of this function
|
|
||||||
matches that of |:set|: for global-local options, both the
|
|
||||||
global and local value are set unless otherwise specified with
|
|
||||||
{scope}.
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{name} Option name
|
|
||||||
{value} New option value
|
|
||||||
{opts} Optional parameters
|
|
||||||
• scope: One of 'global' or 'local'. Analogous to
|
|
||||||
|:setglobal| and |:setlocal|, respectively.
|
|
||||||
|
|
||||||
nvim_set_var({name}, {value}) *nvim_set_var()*
|
nvim_set_var({name}, {value}) *nvim_set_var()*
|
||||||
Sets a global (g:) variable.
|
Sets a global (g:) variable.
|
||||||
|
|
||||||
@@ -1637,7 +1531,7 @@ nvim_set_vvar({name}, {value}) *nvim_set_vvar()*
|
|||||||
{value} Variable value
|
{value} Variable value
|
||||||
|
|
||||||
nvim_strwidth({text}) *nvim_strwidth()*
|
nvim_strwidth({text}) *nvim_strwidth()*
|
||||||
Calculates the number of display cells occupied by `text`.
|
Calculates the number of display cells occupied by `text` .
|
||||||
<Tab> counts as one cell.
|
<Tab> counts as one cell.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
@@ -1879,10 +1773,9 @@ nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()*
|
|||||||
{buffer} Buffer handle, or 0 for current buffer
|
{buffer} Buffer handle, or 0 for current buffer
|
||||||
{send_buffer} True if the initial notification should
|
{send_buffer} True if the initial notification should
|
||||||
contain the whole buffer: first
|
contain the whole buffer: first
|
||||||
notification will be
|
notification will be `nvim_buf_lines_event`
|
||||||
`nvim_buf_lines_event`. Else the first
|
. Else the first notification will be
|
||||||
notification will be
|
`nvim_buf_changedtick_event` . Not for Lua
|
||||||
`nvim_buf_changedtick_event`. Not for Lua
|
|
||||||
callbacks.
|
callbacks.
|
||||||
{opts} Optional parameters.
|
{opts} Optional parameters.
|
||||||
• on_lines: Lua callback invoked on change.
|
• on_lines: Lua callback invoked on change.
|
||||||
@@ -1933,12 +1826,12 @@ nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()*
|
|||||||
• on_reload: Lua callback invoked on
|
• on_reload: Lua callback invoked on
|
||||||
reload. The entire buffer content should
|
reload. The entire buffer content should
|
||||||
be considered changed. Args:
|
be considered changed. Args:
|
||||||
• the string "reload"
|
• the string "detach"
|
||||||
• buffer handle
|
• buffer handle
|
||||||
|
|
||||||
• utf_sizes: include UTF-32 and UTF-16 size
|
• utf_sizes: include UTF-32 and UTF-16 size
|
||||||
of the replaced region, as args to
|
of the replaced region, as args to
|
||||||
`on_lines`.
|
`on_lines` .
|
||||||
• preview: also attach to command preview
|
• preview: also attach to command preview
|
||||||
(i.e. 'inccommand') events.
|
(i.e. 'inccommand') events.
|
||||||
|
|
||||||
@@ -1973,16 +1866,6 @@ nvim_buf_call({buffer}, {fun}) *nvim_buf_call()*
|
|||||||
Return value of function. NB: will deepcopy lua values
|
Return value of function. NB: will deepcopy lua values
|
||||||
currently, use upvalues to send lua references in and out.
|
currently, use upvalues to send lua references in and out.
|
||||||
|
|
||||||
*nvim_buf_create_user_command()*
|
|
||||||
nvim_buf_create_user_command({buffer}, {name}, {command}, {*opts})
|
|
||||||
Create a new user command |user-commands| in the given buffer.
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{buffer} Buffer handle, or 0 for current buffer.
|
|
||||||
|
|
||||||
See also: ~
|
|
||||||
nvim_create_user_command
|
|
||||||
|
|
||||||
nvim_buf_del_keymap({buffer}, {mode}, {lhs}) *nvim_buf_del_keymap()*
|
nvim_buf_del_keymap({buffer}, {mode}, {lhs}) *nvim_buf_del_keymap()*
|
||||||
Unmaps a buffer-local |mapping| for the given mode.
|
Unmaps a buffer-local |mapping| for the given mode.
|
||||||
|
|
||||||
@@ -2010,18 +1893,6 @@ nvim_buf_del_mark({buffer}, {name}) *nvim_buf_del_mark()*
|
|||||||
|nvim_buf_set_mark()|
|
|nvim_buf_set_mark()|
|
||||||
|nvim_del_mark()|
|
|nvim_del_mark()|
|
||||||
|
|
||||||
*nvim_buf_del_user_command()*
|
|
||||||
nvim_buf_del_user_command({buffer}, {name})
|
|
||||||
Delete a buffer-local user-defined command.
|
|
||||||
|
|
||||||
Only commands created with |:command-buffer| or
|
|
||||||
|nvim_buf_create_user_command()| can be deleted with this
|
|
||||||
function.
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{buffer} Buffer handle, or 0 for current buffer.
|
|
||||||
{name} Name of the command to delete.
|
|
||||||
|
|
||||||
nvim_buf_del_var({buffer}, {name}) *nvim_buf_del_var()*
|
nvim_buf_del_var({buffer}, {name}) *nvim_buf_del_var()*
|
||||||
Removes a buffer-scoped (b:) variable
|
Removes a buffer-scoped (b:) variable
|
||||||
|
|
||||||
@@ -2164,29 +2035,6 @@ nvim_buf_get_option({buffer}, {name}) *nvim_buf_get_option()*
|
|||||||
Return: ~
|
Return: ~
|
||||||
Option value
|
Option value
|
||||||
|
|
||||||
*nvim_buf_get_text()*
|
|
||||||
nvim_buf_get_text({buffer}, {start_row}, {start_col}, {end_row}, {end_col},
|
|
||||||
{opts})
|
|
||||||
Gets a range from the buffer.
|
|
||||||
|
|
||||||
This differs from |nvim_buf_get_lines()| in that it allows
|
|
||||||
retrieving only portions of a line.
|
|
||||||
|
|
||||||
Indexing is zero-based. Column indices are end-exclusive.
|
|
||||||
|
|
||||||
Prefer |nvim_buf_get_lines()| when retrieving entire lines.
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{buffer} Buffer handle, or 0 for current buffer
|
|
||||||
{start_row} First line index
|
|
||||||
{start_col} Starting byte offset of first line
|
|
||||||
{end_row} Last line index
|
|
||||||
{end_col} Ending byte offset of last line (exclusive)
|
|
||||||
{opts} Optional parameters. Currently unused.
|
|
||||||
|
|
||||||
Return: ~
|
|
||||||
Array of lines, or empty array for unloaded buffer.
|
|
||||||
|
|
||||||
nvim_buf_get_var({buffer}, {name}) *nvim_buf_get_var()*
|
nvim_buf_get_var({buffer}, {name}) *nvim_buf_get_var()*
|
||||||
Gets a buffer-scoped (b:) variable.
|
Gets a buffer-scoped (b:) variable.
|
||||||
|
|
||||||
@@ -2221,7 +2069,7 @@ nvim_buf_is_valid({buffer}) *nvim_buf_is_valid()*
|
|||||||
true if the buffer is valid, false otherwise.
|
true if the buffer is valid, false otherwise.
|
||||||
|
|
||||||
nvim_buf_line_count({buffer}) *nvim_buf_line_count()*
|
nvim_buf_line_count({buffer}) *nvim_buf_line_count()*
|
||||||
Returns the number of lines in the given buffer.
|
Gets the buffer line count
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{buffer} Buffer handle, or 0 for current buffer
|
{buffer} Buffer handle, or 0 for current buffer
|
||||||
@@ -2363,7 +2211,7 @@ nvim_buf_add_highlight({buffer}, {ns_id}, {hl_group}, {line}, {col_start},
|
|||||||
namespace. All highlights in the same namespace can then be
|
namespace. All highlights in the same namespace can then be
|
||||||
cleared with single call to |nvim_buf_clear_namespace()|. If
|
cleared with single call to |nvim_buf_clear_namespace()|. If
|
||||||
the highlight never will be deleted by an API call, pass
|
the highlight never will be deleted by an API call, pass
|
||||||
`ns_id = -1`.
|
`ns_id = -1` .
|
||||||
|
|
||||||
As a shorthand, `ns_id = 0` can be used to create a new
|
As a shorthand, `ns_id = 0` can be used to create a new
|
||||||
namespace for the highlight, the allocated id is then
|
namespace for the highlight, the allocated id is then
|
||||||
@@ -2443,8 +2291,8 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts})
|
|||||||
nvim_buf_get_extmarks(0, my_ns, [0,0], [-1,-1], {})
|
nvim_buf_get_extmarks(0, my_ns, [0,0], [-1,-1], {})
|
||||||
<
|
<
|
||||||
|
|
||||||
If `end` is less than `start`, traversal works backwards.
|
If `end` is less than `start` , traversal works backwards.
|
||||||
(Useful with `limit`, to get the first marks prior to a given
|
(Useful with `limit` , to get the first marks prior to a given
|
||||||
position.)
|
position.)
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
@@ -2453,9 +2301,9 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts})
|
|||||||
local pos = a.nvim_win_get_cursor(0)
|
local pos = a.nvim_win_get_cursor(0)
|
||||||
local ns = a.nvim_create_namespace('my-plugin')
|
local ns = a.nvim_create_namespace('my-plugin')
|
||||||
-- Create new extmark at line 1, column 1.
|
-- Create new extmark at line 1, column 1.
|
||||||
local m1 = a.nvim_buf_set_extmark(0, ns, 0, 0, {})
|
local m1 = a.nvim_buf_set_extmark(0, ns, 0, 0, 0, {})
|
||||||
-- Create new extmark at line 3, column 1.
|
-- Create new extmark at line 3, column 1.
|
||||||
local m2 = a.nvim_buf_set_extmark(0, ns, 0, 2, {})
|
local m2 = a.nvim_buf_set_extmark(0, ns, 0, 2, 0, {})
|
||||||
-- Get extmarks only from line 3.
|
-- Get extmarks only from line 3.
|
||||||
local ms = a.nvim_buf_get_extmarks(0, ns, {2,0}, {2,0}, {})
|
local ms = a.nvim_buf_get_extmarks(0, ns, {2,0}, {2,0}, {})
|
||||||
-- Get all marks in this buffer + namespace.
|
-- Get all marks in this buffer + namespace.
|
||||||
@@ -2584,39 +2432,6 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts})
|
|||||||
• priority: a priority value for the highlight
|
• priority: a priority value for the highlight
|
||||||
group. For example treesitter highlighting
|
group. For example treesitter highlighting
|
||||||
uses a value of 100.
|
uses a value of 100.
|
||||||
• strict: boolean that indicates extmark should
|
|
||||||
not be placed if the line or column value is
|
|
||||||
past the end of the buffer or end of the line
|
|
||||||
respectively. Defaults to true.
|
|
||||||
• sign_text: string of length 1-2 used to
|
|
||||||
display in the sign column. Note: ranges are
|
|
||||||
unsupported and decorations are only applied
|
|
||||||
to start_row
|
|
||||||
• sign_hl_group: name of the highlight group
|
|
||||||
used to highlight the sign column text. Note:
|
|
||||||
ranges are unsupported and decorations are
|
|
||||||
only applied to start_row
|
|
||||||
• number_hl_group: name of the highlight group
|
|
||||||
used to highlight the number column. Note:
|
|
||||||
ranges are unsupported and decorations are
|
|
||||||
only applied to start_row
|
|
||||||
• line_hl_group: name of the highlight group
|
|
||||||
used to highlight the whole line. Note: ranges
|
|
||||||
are unsupported and decorations are only
|
|
||||||
applied to start_row
|
|
||||||
• cursorline_hl_group: name of the highlight
|
|
||||||
group used to highlight the line when the
|
|
||||||
cursor is on the same line as the mark and
|
|
||||||
'cursorline' is enabled. Note: ranges are
|
|
||||||
unsupported and decorations are only applied
|
|
||||||
to start_row
|
|
||||||
• conceal: string which should be either empty
|
|
||||||
or a single character. Enable concealing
|
|
||||||
similar to |:syn-conceal|. When a character is
|
|
||||||
supplied it is used as |:syn-cchar|.
|
|
||||||
"hl_group" is used as highlight for the cchar
|
|
||||||
if provided, otherwise it defaults to
|
|
||||||
|hl-Conceal|.
|
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
Id of the created/updated extmark
|
Id of the created/updated extmark
|
||||||
@@ -2820,7 +2635,7 @@ nvim_win_hide({window}) *nvim_win_hide()*
|
|||||||
|:hide| with a |window-ID|).
|
|:hide| with a |window-ID|).
|
||||||
|
|
||||||
Like |:hide| the buffer becomes hidden unless another window
|
Like |:hide| the buffer becomes hidden unless another window
|
||||||
is editing it, or 'bufhidden' is `unload`, `delete` or `wipe`
|
is editing it, or 'bufhidden' is `unload` , `delete` or `wipe`
|
||||||
as opposed to |:close| or |nvim_win_close|, which will close
|
as opposed to |:close| or |nvim_win_close|, which will close
|
||||||
the buffer.
|
the buffer.
|
||||||
|
|
||||||
@@ -2840,7 +2655,7 @@ nvim_win_is_valid({window}) *nvim_win_is_valid()*
|
|||||||
true if the window is valid, false otherwise
|
true if the window is valid, false otherwise
|
||||||
|
|
||||||
nvim_win_set_buf({window}, {buffer}) *nvim_win_set_buf()*
|
nvim_win_set_buf({window}, {buffer}) *nvim_win_set_buf()*
|
||||||
Sets the current buffer in a window, without side effects
|
Sets the current buffer in a window, without side-effects
|
||||||
|
|
||||||
Attributes: ~
|
Attributes: ~
|
||||||
not allowed when |textlock| is active
|
not allowed when |textlock| is active
|
||||||
@@ -2851,15 +2666,15 @@ nvim_win_set_buf({window}, {buffer}) *nvim_win_set_buf()*
|
|||||||
|
|
||||||
nvim_win_set_cursor({window}, {pos}) *nvim_win_set_cursor()*
|
nvim_win_set_cursor({window}, {pos}) *nvim_win_set_cursor()*
|
||||||
Sets the (1,0)-indexed cursor position in the window.
|
Sets the (1,0)-indexed cursor position in the window.
|
||||||
|api-indexing| This scrolls the window even if it is not the
|
|api-indexing|
|
||||||
current one.
|
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{window} Window handle, or 0 for current window
|
{window} Window handle, or 0 for current window
|
||||||
{pos} (row, col) tuple representing the new position
|
{pos} (row, col) tuple representing the new position
|
||||||
|
|
||||||
nvim_win_set_height({window}, {height}) *nvim_win_set_height()*
|
nvim_win_set_height({window}, {height}) *nvim_win_set_height()*
|
||||||
Sets the window height.
|
Sets the window height. This will only succeed if the screen
|
||||||
|
is split horizontally.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{window} Window handle, or 0 for current window
|
{window} Window handle, or 0 for current window
|
||||||
@@ -3036,10 +2851,9 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
|
|||||||
">", "", "", "", "<" ] will only make
|
">", "", "", "", "<" ] will only make
|
||||||
vertical borders but not horizontal ones. By
|
vertical borders but not horizontal ones. By
|
||||||
default, `FloatBorder` highlight is used,
|
default, `FloatBorder` highlight is used,
|
||||||
which links to `WinSeparator` when not
|
which links to `VertSplit` when not defined.
|
||||||
defined. It could also be specified by
|
It could also be specified by character: [
|
||||||
character: [ {"+", "MyCorner"}, {"x",
|
{"+", "MyCorner"}, {"x", "MyBorder"} ].
|
||||||
"MyBorder"} ].
|
|
||||||
|
|
||||||
• noautocmd: If true then no buffer-related
|
• noautocmd: If true then no buffer-related
|
||||||
autocommand events such as |BufEnter|,
|
autocommand events such as |BufEnter|,
|
||||||
@@ -3069,7 +2883,7 @@ nvim_win_set_config({window}, {*config}) *nvim_win_set_config()*
|
|||||||
layouts).
|
layouts).
|
||||||
|
|
||||||
When reconfiguring a floating window, absent option keys will
|
When reconfiguring a floating window, absent option keys will
|
||||||
not be changed. `row`/`col` and `relative` must be
|
not be changed. `row` / `col` and `relative` must be
|
||||||
reconfigured together.
|
reconfigured together.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
@@ -3147,256 +2961,6 @@ nvim_tabpage_set_var({tabpage}, {name}, {value})
|
|||||||
{value} Variable value
|
{value} Variable value
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
Autocmd Functions *api-autocmd*
|
|
||||||
|
|
||||||
nvim_clear_autocmds({*opts}) *nvim_clear_autocmds()*
|
|
||||||
Clear all autocommands that match the corresponding {opts}. To
|
|
||||||
delete a particular autocmd, see |nvim_del_autocmd|.
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{opts} Parameters
|
|
||||||
• event: (string|table) Examples:
|
|
||||||
• event: "pat1"
|
|
||||||
• event: { "pat1" }
|
|
||||||
• event: { "pat1", "pat2", "pat3" }
|
|
||||||
|
|
||||||
• pattern: (string|table)
|
|
||||||
• pattern or patterns to match exactly.
|
|
||||||
• For example, if you have `*.py` as that
|
|
||||||
pattern for the autocmd, you must pass
|
|
||||||
`*.py` exactly to clear it. `test.py` will
|
|
||||||
not match the pattern.
|
|
||||||
|
|
||||||
• defaults to clearing all patterns.
|
|
||||||
• NOTE: Cannot be used with {buffer}
|
|
||||||
|
|
||||||
• buffer: (bufnr)
|
|
||||||
• clear only |autocmd-buflocal| autocommands.
|
|
||||||
• NOTE: Cannot be used with {pattern}
|
|
||||||
|
|
||||||
• group: (string|int) The augroup name or id.
|
|
||||||
• NOTE: If not passed, will only delete autocmds not in any group.
|
|
||||||
|
|
||||||
nvim_create_augroup({name}, {*opts}) *nvim_create_augroup()*
|
|
||||||
Create or get an autocommand group |autocmd-groups|.
|
|
||||||
|
|
||||||
To get an existing group id, do: >
|
|
||||||
local id = vim.api.nvim_create_augroup("MyGroup", {
|
|
||||||
clear = false
|
|
||||||
})
|
|
||||||
<
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{name} String: The name of the group
|
|
||||||
{opts} Dictionary Parameters
|
|
||||||
• clear (bool) optional: defaults to true. Clear
|
|
||||||
existing commands if the group already exists
|
|
||||||
|autocmd-groups|.
|
|
||||||
|
|
||||||
Return: ~
|
|
||||||
Integer id of the created group.
|
|
||||||
|
|
||||||
See also: ~
|
|
||||||
|autocmd-groups|
|
|
||||||
|
|
||||||
nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()*
|
|
||||||
Create an |autocommand|
|
|
||||||
|
|
||||||
The API allows for two (mutually exclusive) types of actions
|
|
||||||
to be executed when the autocommand triggers: a callback
|
|
||||||
function (Lua or Vimscript), or a command (like regular
|
|
||||||
autocommands).
|
|
||||||
|
|
||||||
Example using callback: >
|
|
||||||
-- Lua function
|
|
||||||
local myluafun = function() print("This buffer enters") end
|
|
||||||
|
|
||||||
-- Vimscript function name (as a string)
|
|
||||||
local myvimfun = "g:MyVimFunction"
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
|
|
||||||
pattern = {"*.c", "*.h"},
|
|
||||||
callback = myluafun, -- Or myvimfun
|
|
||||||
})
|
|
||||||
<
|
|
||||||
|
|
||||||
Example using command: >
|
|
||||||
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
|
|
||||||
pattern = {"*.c", "*.h"},
|
|
||||||
command = "echo 'Entering a C or C++ file'",
|
|
||||||
})
|
|
||||||
<
|
|
||||||
|
|
||||||
Example values for pattern: >
|
|
||||||
pattern = "*.py"
|
|
||||||
pattern = { "*.py", "*.pyi" }
|
|
||||||
<
|
|
||||||
|
|
||||||
Example values for event: >
|
|
||||||
"BufWritePre"
|
|
||||||
{"CursorHold", "BufWritePre", "BufWritePost"}
|
|
||||||
<
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{event} (string|array) The event or events to register
|
|
||||||
this autocommand
|
|
||||||
{opts} Dictionary of autocommand options:
|
|
||||||
• group (string|integer) optional: the
|
|
||||||
autocommand group name or id to match against.
|
|
||||||
• pattern (string|array) optional: pattern or
|
|
||||||
patterns to match against |autocmd-pattern|.
|
|
||||||
• buffer (integer) optional: buffer number for
|
|
||||||
buffer local autocommands |autocmd-buflocal|.
|
|
||||||
Cannot be used with {pattern}.
|
|
||||||
• desc (string) optional: description of the
|
|
||||||
autocommand.
|
|
||||||
• callback (function|string) optional: if a
|
|
||||||
string, the name of a Vimscript function to
|
|
||||||
call when this autocommand is triggered.
|
|
||||||
Otherwise, a Lua function which is called when
|
|
||||||
this autocommand is triggered. Cannot be used
|
|
||||||
with {command}. Lua callbacks can return true
|
|
||||||
to delete the autocommand; in addition, they
|
|
||||||
accept a single table argument with the
|
|
||||||
following keys:
|
|
||||||
• id: (number) the autocommand id
|
|
||||||
• event: (string) the name of the event that
|
|
||||||
triggered the autocommand |autocmd-events|
|
|
||||||
• group: (number|nil) the autocommand group id,
|
|
||||||
if it exists
|
|
||||||
• match: (string) the expanded value of
|
|
||||||
|<amatch>|
|
|
||||||
• buf: (number) the expanded value of |<abuf>|
|
|
||||||
• file: (string) the expanded value of
|
|
||||||
|<afile>|
|
|
||||||
|
|
||||||
• command (string) optional: Vim command to
|
|
||||||
execute on event. Cannot be used with
|
|
||||||
{callback}
|
|
||||||
• once (boolean) optional: defaults to false. Run
|
|
||||||
the autocommand only once |autocmd-once|.
|
|
||||||
• nested (boolean) optional: defaults to false.
|
|
||||||
Run nested autocommands |autocmd-nested|.
|
|
||||||
|
|
||||||
Return: ~
|
|
||||||
Integer id of the created autocommand.
|
|
||||||
|
|
||||||
See also: ~
|
|
||||||
|autocommand|
|
|
||||||
|nvim_del_autocmd()|
|
|
||||||
|
|
||||||
nvim_del_augroup_by_id({id}) *nvim_del_augroup_by_id()*
|
|
||||||
Delete an autocommand group by id.
|
|
||||||
|
|
||||||
To get a group id one can use |nvim_get_autocmds()|.
|
|
||||||
|
|
||||||
NOTE: behavior differs from |augroup-delete|. When deleting a
|
|
||||||
group, autocommands contained in this group will also be
|
|
||||||
deleted and cleared. This group will no longer exist.
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{id} Integer The id of the group.
|
|
||||||
|
|
||||||
See also: ~
|
|
||||||
|nvim_del_augroup_by_name()|
|
|
||||||
|nvim_create_augroup()|
|
|
||||||
|
|
||||||
nvim_del_augroup_by_name({name}) *nvim_del_augroup_by_name()*
|
|
||||||
Delete an autocommand group by name.
|
|
||||||
|
|
||||||
NOTE: behavior differs from |augroup-delete|. When deleting a
|
|
||||||
group, autocommands contained in this group will also be
|
|
||||||
deleted and cleared. This group will no longer exist.
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{name} String The name of the group.
|
|
||||||
|
|
||||||
See also: ~
|
|
||||||
|autocommand-groups|
|
|
||||||
|
|
||||||
nvim_del_autocmd({id}) *nvim_del_autocmd()*
|
|
||||||
Delete an autocommand by id.
|
|
||||||
|
|
||||||
NOTE: Only autocommands created via the API have an id.
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{id} Integer The id returned by nvim_create_autocmd
|
|
||||||
|
|
||||||
See also: ~
|
|
||||||
|nvim_create_autocmd()|
|
|
||||||
|
|
||||||
nvim_exec_autocmds({event}, {*opts}) *nvim_exec_autocmds()*
|
|
||||||
Execute all autocommands for {event} that match the
|
|
||||||
corresponding {opts} |autocmd-execute|.
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{event} (String|Array) The event or events to execute
|
|
||||||
{opts} Dictionary of autocommand options:
|
|
||||||
• group (string|integer) optional: the
|
|
||||||
autocommand group name or id to match against.
|
|
||||||
|autocmd-groups|.
|
|
||||||
• pattern (string|array) optional: defaults to
|
|
||||||
"*" |autocmd-pattern|. Cannot be used with
|
|
||||||
{buffer}.
|
|
||||||
• buffer (integer) optional: buffer number
|
|
||||||
|autocmd-buflocal|. Cannot be used with
|
|
||||||
{pattern}.
|
|
||||||
• modeline (bool) optional: defaults to true.
|
|
||||||
Process the modeline after the autocommands
|
|
||||||
|<nomodeline>|.
|
|
||||||
|
|
||||||
See also: ~
|
|
||||||
|:doautocmd|
|
|
||||||
|
|
||||||
nvim_get_autocmds({*opts}) *nvim_get_autocmds()*
|
|
||||||
Get all autocommands that match the corresponding {opts}.
|
|
||||||
|
|
||||||
These examples will get autocommands matching ALL the given
|
|
||||||
criteria: >
|
|
||||||
-- Matches all criteria
|
|
||||||
autocommands = vim.api.nvim_get_autocmds({
|
|
||||||
group = "MyGroup",
|
|
||||||
event = {"BufEnter", "BufWinEnter"},
|
|
||||||
pattern = {"*.c", "*.h"}
|
|
||||||
})
|
|
||||||
|
|
||||||
-- All commands from one group
|
|
||||||
autocommands = vim.api.nvim_get_autocmds({
|
|
||||||
group = "MyGroup",
|
|
||||||
})
|
|
||||||
<
|
|
||||||
|
|
||||||
NOTE: When multiple patterns or events are provided, it will
|
|
||||||
find all the autocommands that match any combination of them.
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{opts} Dictionary with at least one of the following:
|
|
||||||
• group (string|integer): the autocommand group
|
|
||||||
name or id to match against.
|
|
||||||
• event (string|array): event or events to match
|
|
||||||
against |autocmd-events|.
|
|
||||||
• pattern (string|array): pattern or patterns to
|
|
||||||
match against |autocmd-pattern|.
|
|
||||||
|
|
||||||
Return: ~
|
|
||||||
Array of autocommands matching the criteria, with each
|
|
||||||
item containing the following fields:
|
|
||||||
• id (number): the autocommand id (only when defined with
|
|
||||||
the API).
|
|
||||||
• group (integer): the autocommand group id.
|
|
||||||
• desc (string): the autocommand description.
|
|
||||||
• event (string): the autocommand event.
|
|
||||||
• command (string): the autocommand command.
|
|
||||||
• once (boolean): whether the autocommand is only run
|
|
||||||
once.
|
|
||||||
• pattern (string): the autocommand pattern. If the
|
|
||||||
autocommand is buffer local |autocmd-buffer-local|:
|
|
||||||
• buflocal (boolean): true if the autocommand is buffer
|
|
||||||
local.
|
|
||||||
• buffer (number): the buffer number.
|
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
UI Functions *api-ui*
|
UI Functions *api-ui*
|
||||||
|
|
||||||
|
@@ -175,7 +175,7 @@ o Enable Arabic settings [short-cut]
|
|||||||
vertical separator like "l" or "𝖨" may be used. It may also be
|
vertical separator like "l" or "𝖨" may be used. It may also be
|
||||||
hidden by changing its color to the foreground color: >
|
hidden by changing its color to the foreground color: >
|
||||||
:set fillchars=vert:l
|
:set fillchars=vert:l
|
||||||
:hi WinSeparator ctermbg=White
|
:hi VertSplit ctermbg=White
|
||||||
< Note that this is a workaround, not a proper solution.
|
< Note that this is a workaround, not a proper solution.
|
||||||
|
|
||||||
If, on the other hand, you'd like to be verbose and explicit and
|
If, on the other hand, you'd like to be verbose and explicit and
|
||||||
|
@@ -40,10 +40,10 @@ effects. Be careful not to destroy your text.
|
|||||||
2. Defining autocommands *autocmd-define*
|
2. Defining autocommands *autocmd-define*
|
||||||
|
|
||||||
*:au* *:autocmd*
|
*:au* *:autocmd*
|
||||||
:au[tocmd] [group] {event} {aupat} [++once] [++nested] {cmd}
|
:au[tocmd] [group] {event} {pat} [++once] [++nested] {cmd}
|
||||||
Add {cmd} to the list of commands that Vim will
|
Add {cmd} to the list of commands that Vim will
|
||||||
execute automatically on {event} for a file matching
|
execute automatically on {event} for a file matching
|
||||||
{aupat} |autocmd-pattern|.
|
{pat} |autocmd-pattern|.
|
||||||
Note: A quote character is seen as argument to the
|
Note: A quote character is seen as argument to the
|
||||||
:autocmd and won't start a comment.
|
:autocmd and won't start a comment.
|
||||||
Nvim always adds {cmd} after existing autocommands so
|
Nvim always adds {cmd} after existing autocommands so
|
||||||
@@ -119,19 +119,19 @@ prompt. When one command outputs two messages this can happen anyway.
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
3. Removing autocommands *autocmd-remove*
|
3. Removing autocommands *autocmd-remove*
|
||||||
|
|
||||||
:au[tocmd]! [group] {event} {aupat} [++once] [++nested] {cmd}
|
:au[tocmd]! [group] {event} {pat} [++once] [++nested] {cmd}
|
||||||
Remove all autocommands associated with {event} and
|
Remove all autocommands associated with {event} and
|
||||||
{aupat}, and add the command {cmd}.
|
{pat}, and add the command {cmd}.
|
||||||
See |autocmd-once| for [++once].
|
See |autocmd-once| for [++once].
|
||||||
See |autocmd-nested| for [++nested].
|
See |autocmd-nested| for [++nested].
|
||||||
|
|
||||||
:au[tocmd]! [group] {event} {aupat}
|
:au[tocmd]! [group] {event} {pat}
|
||||||
Remove all autocommands associated with {event} and
|
Remove all autocommands associated with {event} and
|
||||||
{aupat}.
|
{pat}.
|
||||||
|
|
||||||
:au[tocmd]! [group] * {aupat}
|
:au[tocmd]! [group] * {pat}
|
||||||
Remove all autocommands associated with {aupat} for
|
Remove all autocommands associated with {pat} for all
|
||||||
all events.
|
events.
|
||||||
|
|
||||||
:au[tocmd]! [group] {event}
|
:au[tocmd]! [group] {event}
|
||||||
Remove ALL autocommands for {event}.
|
Remove ALL autocommands for {event}.
|
||||||
@@ -151,12 +151,12 @@ with ":augroup"); otherwise, Vim uses the group defined with [group].
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
4. Listing autocommands *autocmd-list*
|
4. Listing autocommands *autocmd-list*
|
||||||
|
|
||||||
:au[tocmd] [group] {event} {aupat}
|
:au[tocmd] [group] {event} {pat}
|
||||||
Show the autocommands associated with {event} and
|
Show the autocommands associated with {event} and
|
||||||
{aupat}.
|
{pat}.
|
||||||
|
|
||||||
:au[tocmd] [group] * {aupat}
|
:au[tocmd] [group] * {pat}
|
||||||
Show the autocommands associated with {aupat} for all
|
Show the autocommands associated with {pat} for all
|
||||||
events.
|
events.
|
||||||
|
|
||||||
:au[tocmd] [group] {event}
|
:au[tocmd] [group] {event}
|
||||||
@@ -499,10 +499,10 @@ CursorMoved After the cursor was moved in Normal or Visual
|
|||||||
mode or to another window. Also when the text
|
mode or to another window. Also when the text
|
||||||
of the cursor line has been changed, e.g. with
|
of the cursor line has been changed, e.g. with
|
||||||
"x", "rx" or "p".
|
"x", "rx" or "p".
|
||||||
Not always triggered when there is typeahead,
|
Not triggered when there is typeahead, while
|
||||||
while executing commands in a script file, or
|
executing a script file, when an operator is
|
||||||
when an operator is pending. Always triggered
|
pending, or when moving to another window while
|
||||||
when moving to another window.
|
remaining at the same cursor position.
|
||||||
For an example see |match-parens|.
|
For an example see |match-parens|.
|
||||||
Note: Cannot be skipped with |:noautocmd|.
|
Note: Cannot be skipped with |:noautocmd|.
|
||||||
Careful: This is triggered very often, don't
|
Careful: This is triggered very often, don't
|
||||||
@@ -525,19 +525,8 @@ DirChanged After the |current-directory| was changed.
|
|||||||
"global" to trigger on `:cd`
|
"global" to trigger on `:cd`
|
||||||
"auto" to trigger on 'autochdir'.
|
"auto" to trigger on 'autochdir'.
|
||||||
Sets these |v:event| keys:
|
Sets these |v:event| keys:
|
||||||
cwd: current working directory
|
cwd: current working directory
|
||||||
scope: "global", "tabpage", "window"
|
scope: "global", "tab", "window"
|
||||||
changed_window: v:true if we fired the event
|
|
||||||
switching window (or tab)
|
|
||||||
<afile> is set to the new directory name.
|
|
||||||
Non-recursive (event cannot trigger itself).
|
|
||||||
*DirChangedPre*
|
|
||||||
DirChangedPre When the |current-directory| is going to be
|
|
||||||
changed, as with |DirChanged|.
|
|
||||||
The pattern is like with |DirChanged|.
|
|
||||||
Sets these |v:event| keys:
|
|
||||||
directory: new working directory
|
|
||||||
scope: "global", "tabpage", "window"
|
|
||||||
changed_window: v:true if we fired the event
|
changed_window: v:true if we fired the event
|
||||||
switching window (or tab)
|
switching window (or tab)
|
||||||
<afile> is set to the new directory name.
|
<afile> is set to the new directory name.
|
||||||
@@ -674,19 +663,15 @@ FuncUndefined When a user function is used but it isn't
|
|||||||
alternative is to use an autoloaded function.
|
alternative is to use an autoloaded function.
|
||||||
See |autoload-functions|.
|
See |autoload-functions|.
|
||||||
*UIEnter*
|
*UIEnter*
|
||||||
UIEnter After a UI connects via |nvim_ui_attach()|, or
|
UIEnter After a UI connects via |nvim_ui_attach()|,
|
||||||
after builtin TUI is started, after |VimEnter|.
|
after VimEnter. Can be used for GUI-specific
|
||||||
|
configuration.
|
||||||
Sets these |v:event| keys:
|
Sets these |v:event| keys:
|
||||||
chan: 0 for builtin TUI
|
chan
|
||||||
1 for |--embed|
|
|
||||||
|channel-id| of the UI otherwise
|
|
||||||
*UILeave*
|
*UILeave*
|
||||||
UILeave After a UI disconnects from Nvim, or after
|
UILeave After a UI disconnects from Nvim.
|
||||||
builtin TUI is stopped, after |VimLeave|.
|
|
||||||
Sets these |v:event| keys:
|
Sets these |v:event| keys:
|
||||||
chan: 0 for builtin TUI
|
chan
|
||||||
1 for |--embed|
|
|
||||||
|channel-id| of the UI otherwise
|
|
||||||
*InsertChange*
|
*InsertChange*
|
||||||
InsertChange When typing <Insert> while in Insert or
|
InsertChange When typing <Insert> while in Insert or
|
||||||
Replace mode. The |v:insertmode| variable
|
Replace mode. The |v:insertmode| variable
|
||||||
@@ -733,27 +718,7 @@ MenuPopup Just before showing the popup menu (under the
|
|||||||
o Operator-pending
|
o Operator-pending
|
||||||
i Insert
|
i Insert
|
||||||
c Command line
|
c Command line
|
||||||
*ModeChanged*
|
*OptionSet*
|
||||||
ModeChanged After changing the mode. The pattern is
|
|
||||||
matched against `'old_mode:new_mode'`, for
|
|
||||||
example match against `*:c` to simulate
|
|
||||||
|CmdlineEnter|.
|
|
||||||
The following values of |v:event| are set:
|
|
||||||
old_mode The mode before it changed.
|
|
||||||
new_mode The new mode as also returned
|
|
||||||
by |mode()| called with a
|
|
||||||
non-zero argument.
|
|
||||||
When ModeChanged is triggered, old_mode will
|
|
||||||
have the value of new_mode when the event was
|
|
||||||
last triggered.
|
|
||||||
This will be triggered on every minor mode
|
|
||||||
change.
|
|
||||||
Usage example to use relative line numbers
|
|
||||||
when entering visual mode: >
|
|
||||||
:au ModeChanged [vV\x16]*:* let &l:rnu = mode() =~# '^[vV\x16]'
|
|
||||||
:au ModeChanged *:[vV\x16]* let &l:rnu = mode() =~# '^[vV\x16]'
|
|
||||||
:au WinEnter,WinLeave * let &l:rnu = mode() =~# '^[vV\x16]'
|
|
||||||
< *OptionSet*
|
|
||||||
OptionSet After setting an option (except during
|
OptionSet After setting an option (except during
|
||||||
|startup|). The |autocmd-pattern| is matched
|
|startup|). The |autocmd-pattern| is matched
|
||||||
against the long option name. |<amatch>|
|
against the long option name. |<amatch>|
|
||||||
@@ -839,25 +804,6 @@ RemoteReply When a reply from a Vim that functions as
|
|||||||
Note that even if an autocommand is defined,
|
Note that even if an autocommand is defined,
|
||||||
the reply should be read with |remote_read()|
|
the reply should be read with |remote_read()|
|
||||||
to consume it.
|
to consume it.
|
||||||
*SearchWrapped*
|
|
||||||
SearchWrapped After making a search with |n| or |N| if the
|
|
||||||
search wraps around the document back to
|
|
||||||
the start/finish respectively.
|
|
||||||
*RecordingEnter*
|
|
||||||
RecordingEnter When a macro starts recording.
|
|
||||||
The pattern is the current file name, and
|
|
||||||
|reg_recording()| is the current register that
|
|
||||||
is used.
|
|
||||||
*RecordingLeave*
|
|
||||||
RecordingLeave When a macro stops recording.
|
|
||||||
The pattern is the current file name, and
|
|
||||||
|reg_recording()| is the recorded
|
|
||||||
register.
|
|
||||||
|reg_recorded()| is only updated after this
|
|
||||||
event.
|
|
||||||
Sets these |v:event| keys:
|
|
||||||
regcontents
|
|
||||||
regname
|
|
||||||
*SessionLoadPost*
|
*SessionLoadPost*
|
||||||
SessionLoadPost After loading the session file created using
|
SessionLoadPost After loading the session file created using
|
||||||
the |:mksession| command.
|
the |:mksession| command.
|
||||||
@@ -870,7 +816,7 @@ ShellCmdPost After executing a shell command with |:!cmd|,
|
|||||||
*Signal*
|
*Signal*
|
||||||
Signal After Nvim receives a signal. The pattern is
|
Signal After Nvim receives a signal. The pattern is
|
||||||
matched against the signal name. Only
|
matched against the signal name. Only
|
||||||
"SIGUSR1" and "SIGWINCH" are supported. Example: >
|
"SIGUSR1" is supported. Example: >
|
||||||
autocmd Signal SIGUSR1 call some#func()
|
autocmd Signal SIGUSR1 call some#func()
|
||||||
< *ShellFilterPost*
|
< *ShellFilterPost*
|
||||||
ShellFilterPost After executing a shell command with
|
ShellFilterPost After executing a shell command with
|
||||||
@@ -1079,36 +1025,27 @@ WinLeave Before leaving a window. If the window to be
|
|||||||
executes the BufLeave autocommands before the
|
executes the BufLeave autocommands before the
|
||||||
WinLeave autocommands (but not for ":new").
|
WinLeave autocommands (but not for ":new").
|
||||||
Not used for ":qa" or ":q" when exiting Vim.
|
Not used for ":qa" or ":q" when exiting Vim.
|
||||||
Before WinClosed.
|
After WinClosed.
|
||||||
*WinNew*
|
*WinNew*
|
||||||
WinNew When a new window was created. Not done for
|
WinNew When a new window was created. Not done for
|
||||||
the first window, when Vim has just started.
|
the first window, when Vim has just started.
|
||||||
Before WinEnter.
|
Before WinEnter.
|
||||||
|
|
||||||
*WinScrolled*
|
*WinScrolled*
|
||||||
WinScrolled After scrolling the content of a window or
|
WinScrolled After scrolling the viewport of the current
|
||||||
resizing a window.
|
window.
|
||||||
The pattern is matched against the
|
|
||||||
|window-ID|. Both <amatch> and <afile> are
|
|
||||||
set to the |window-ID|.
|
|
||||||
Non-recursive (the event cannot trigger
|
|
||||||
itself). However, if the command causes the
|
|
||||||
window to scroll or change size another
|
|
||||||
WinScrolled event will be triggered later.
|
|
||||||
Does not trigger when the command is added,
|
|
||||||
only after the first scroll or resize.
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
6. Patterns *autocmd-pattern* *{aupat}*
|
6. Patterns *autocmd-pattern* *{pat}*
|
||||||
|
|
||||||
The {aupat} argument of `:autocmd` can be a comma-separated list. This works
|
The {pat} argument can be a comma separated list. This works as if the
|
||||||
as if the command was given with each pattern separately. Thus this command: >
|
command was given with each pattern separately. Thus this command: >
|
||||||
:autocmd BufRead *.txt,*.info set et
|
:autocmd BufRead *.txt,*.info set et
|
||||||
Is equivalent to: >
|
Is equivalent to: >
|
||||||
:autocmd BufRead *.txt set et
|
:autocmd BufRead *.txt set et
|
||||||
:autocmd BufRead *.info set et
|
:autocmd BufRead *.info set et
|
||||||
|
|
||||||
The file pattern {aupat} is tested for a match against the file name in one of
|
The file pattern {pat} is tested for a match against the file name in one of
|
||||||
two ways:
|
two ways:
|
||||||
1. When there is no '/' in the pattern, Vim checks for a match against only
|
1. When there is no '/' in the pattern, Vim checks for a match against only
|
||||||
the tail part of the file name (without its leading directory path).
|
the tail part of the file name (without its leading directory path).
|
||||||
@@ -1419,7 +1356,7 @@ Examples for reading and writing compressed files: >
|
|||||||
: autocmd BufReadPre,FileReadPre *.gz set bin
|
: autocmd BufReadPre,FileReadPre *.gz set bin
|
||||||
: autocmd BufReadPost,FileReadPost *.gz '[,']!gunzip
|
: autocmd BufReadPost,FileReadPost *.gz '[,']!gunzip
|
||||||
: autocmd BufReadPost,FileReadPost *.gz set nobin
|
: autocmd BufReadPost,FileReadPost *.gz set nobin
|
||||||
: autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " .. expand("%:r")
|
: autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " . expand("%:r")
|
||||||
: autocmd BufWritePost,FileWritePost *.gz !mv <afile> <afile>:r
|
: autocmd BufWritePost,FileWritePost *.gz !mv <afile> <afile>:r
|
||||||
: autocmd BufWritePost,FileWritePost *.gz !gzip <afile>:r
|
: autocmd BufWritePost,FileWritePost *.gz !gzip <afile>:r
|
||||||
|
|
||||||
@@ -1518,7 +1455,7 @@ To insert the current date and time in a *.html file when writing it: >
|
|||||||
: else
|
: else
|
||||||
: let l = line("$")
|
: let l = line("$")
|
||||||
: endif
|
: endif
|
||||||
: exe "1," .. l .. "g/Last modified: /s/Last modified: .*/Last modified: " ..
|
: exe "1," . l . "g/Last modified: /s/Last modified: .*/Last modified: " .
|
||||||
: \ strftime("%Y %b %d")
|
: \ strftime("%Y %b %d")
|
||||||
:endfun
|
:endfun
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -42,6 +42,8 @@ For inserting text see |insert.txt|.
|
|||||||
of the line and [count]-1 more lines [into register
|
of the line and [count]-1 more lines [into register
|
||||||
x]; synonym for "d$".
|
x]; synonym for "d$".
|
||||||
(not |linewise|)
|
(not |linewise|)
|
||||||
|
When the '#' flag is in 'cpoptions' the count is
|
||||||
|
ignored.
|
||||||
|
|
||||||
{Visual}["x]x or *v_x* *v_d* *v_<Del>*
|
{Visual}["x]x or *v_x* *v_d* *v_<Del>*
|
||||||
{Visual}["x]d or
|
{Visual}["x]d or
|
||||||
@@ -353,14 +355,14 @@ CTRL-A Add [count] to the number or alphabetic character at
|
|||||||
|
|
||||||
*v_CTRL-A*
|
*v_CTRL-A*
|
||||||
{Visual}CTRL-A Add [count] to the number or alphabetic character in
|
{Visual}CTRL-A Add [count] to the number or alphabetic character in
|
||||||
the highlighted text.
|
the highlighted text. {not in Vi}
|
||||||
|
|
||||||
*v_g_CTRL-A*
|
*v_g_CTRL-A*
|
||||||
{Visual}g CTRL-A Add [count] to the number or alphabetic character in
|
{Visual}g CTRL-A Add [count] to the number or alphabetic character in
|
||||||
the highlighted text. If several lines are
|
the highlighted text. If several lines are
|
||||||
highlighted, each one will be incremented by an
|
highlighted, each one will be incremented by an
|
||||||
additional [count] (so effectively creating a
|
additional [count] (so effectively creating a
|
||||||
[count] incrementing sequence).
|
[count] incrementing sequence). {not in Vi}
|
||||||
For Example, if you have this list of numbers:
|
For Example, if you have this list of numbers:
|
||||||
1. ~
|
1. ~
|
||||||
1. ~
|
1. ~
|
||||||
@@ -379,14 +381,14 @@ CTRL-X Subtract [count] from the number or alphabetic
|
|||||||
|
|
||||||
*v_CTRL-X*
|
*v_CTRL-X*
|
||||||
{Visual}CTRL-X Subtract [count] from the number or alphabetic
|
{Visual}CTRL-X Subtract [count] from the number or alphabetic
|
||||||
character in the highlighted text.
|
character in the highlighted text. {not in Vi}
|
||||||
|
|
||||||
*v_g_CTRL-X*
|
*v_g_CTRL-X*
|
||||||
{Visual}g CTRL-X Subtract [count] from the number or alphabetic
|
{Visual}g CTRL-X Subtract [count] from the number or alphabetic
|
||||||
character in the highlighted text. If several lines
|
character in the highlighted text. If several lines
|
||||||
are highlighted, each value will be decremented by an
|
are highlighted, each value will be decremented by an
|
||||||
additional [count] (so effectively creating a [count]
|
additional [count] (so effectively creating a [count]
|
||||||
decrementing sequence).
|
decrementing sequence). {not in Vi}
|
||||||
|
|
||||||
The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned
|
The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned
|
||||||
binary/octal/hexadecimal numbers and alphabetic characters.
|
binary/octal/hexadecimal numbers and alphabetic characters.
|
||||||
@@ -904,7 +906,7 @@ Consider using a character like "@" or ":". There is no problem if the result
|
|||||||
of the expression contains the separation character.
|
of the expression contains the separation character.
|
||||||
|
|
||||||
Examples: >
|
Examples: >
|
||||||
:s@\n@\="\r" .. expand("$HOME") .. "\r"@
|
:s@\n@\="\r" . expand("$HOME") . "\r"@
|
||||||
This replaces an end-of-line with a new line containing the value of $HOME. >
|
This replaces an end-of-line with a new line containing the value of $HOME. >
|
||||||
|
|
||||||
s/E/\="\<Char-0x20ac>"/g
|
s/E/\="\<Char-0x20ac>"/g
|
||||||
@@ -1016,7 +1018,7 @@ inside of strings can change! Also see 'softtabstop' option. >
|
|||||||
in [range] (default: current line |cmdline-ranges|),
|
in [range] (default: current line |cmdline-ranges|),
|
||||||
[into register x].
|
[into register x].
|
||||||
|
|
||||||
*p* *put* *E353* *E1240*
|
*p* *put* *E353*
|
||||||
["x]p Put the text [from register x] after the cursor
|
["x]p Put the text [from register x] after the cursor
|
||||||
[count] times.
|
[count] times.
|
||||||
|
|
||||||
@@ -1063,7 +1065,7 @@ inside of strings can change! Also see 'softtabstop' option. >
|
|||||||
the command. You need to escape the '|' and '"'
|
the command. You need to escape the '|' and '"'
|
||||||
characters to prevent them from terminating the
|
characters to prevent them from terminating the
|
||||||
command. Example: >
|
command. Example: >
|
||||||
:put ='path' .. \",/test\"
|
:put ='path' . \",/test\"
|
||||||
< If there is no expression after '=', Vim uses the
|
< If there is no expression after '=', Vim uses the
|
||||||
previous expression. You can see it with ":dis =".
|
previous expression. You can see it with ":dis =".
|
||||||
|
|
||||||
@@ -1116,13 +1118,10 @@ register. With blockwise selection it also depends on the size of the block
|
|||||||
and whether the corners are on an existing character. (Implementation detail:
|
and whether the corners are on an existing character. (Implementation detail:
|
||||||
it actually works by first putting the register after the selection and then
|
it actually works by first putting the register after the selection and then
|
||||||
deleting the selection.)
|
deleting the selection.)
|
||||||
With 'p' the previously selected text is put in the unnamed register. This is
|
The previously selected text is put in the unnamed register. If you want to
|
||||||
useful if you want to put that text somewhere else. But you cannot repeat the
|
put the same text into a Visual selection several times you need to use
|
||||||
same change.
|
|
||||||
With 'P' the unnamed register is not changed, you can repeat the same change.
|
|
||||||
But the deleted text cannot be used. If you do need it you can use 'p' with
|
|
||||||
another register. E.g., yank the text to copy, Visually select the text to
|
another register. E.g., yank the text to copy, Visually select the text to
|
||||||
replace and use "0p . You can repeat this as many times as you like, and the
|
replace and use "0p . You can repeat this as many times as you like, the
|
||||||
unnamed register will be changed each time.
|
unnamed register will be changed each time.
|
||||||
|
|
||||||
When you use a blockwise Visual mode command and yank only a single line into
|
When you use a blockwise Visual mode command and yank only a single line into
|
||||||
@@ -1596,8 +1595,7 @@ r Automatically insert the current comment leader after hitting
|
|||||||
<Enter> in Insert mode.
|
<Enter> in Insert mode.
|
||||||
*fo-o*
|
*fo-o*
|
||||||
o Automatically insert the current comment leader after hitting 'o' or
|
o Automatically insert the current comment leader after hitting 'o' or
|
||||||
'O' in Normal mode. In case comment is unwanted in a specific place
|
'O' in Normal mode.
|
||||||
use CTRL-U to quickly delete it. |i_CTRL-U|
|
|
||||||
*fo-q*
|
*fo-q*
|
||||||
q Allow formatting of comments with "gq".
|
q Allow formatting of comments with "gq".
|
||||||
Note that formatting will not change blank lines or lines containing
|
Note that formatting will not change blank lines or lines containing
|
||||||
|
@@ -44,7 +44,7 @@ functions like |chansend()| consume channel ids.
|
|||||||
2. Reading and writing raw bytes *channel-bytes*
|
2. Reading and writing raw bytes *channel-bytes*
|
||||||
|
|
||||||
Channels opened by Vimscript functions operate with raw bytes by default. For
|
Channels opened by Vimscript functions operate with raw bytes by default. For
|
||||||
a job channel using RPC, bytes can still be read over its stderr. Similarly,
|
a job channel using RPC, bytes can still be read over its stderr. Similarily,
|
||||||
only bytes can be written to Nvim's own stderr.
|
only bytes can be written to Nvim's own stderr.
|
||||||
|
|
||||||
*channel-callback*
|
*channel-callback*
|
||||||
@@ -210,11 +210,6 @@ effective prompt text for a buffer, with |prompt_getprompt()|.
|
|||||||
The user can go to Normal mode and navigate through the buffer. This can be
|
The user can go to Normal mode and navigate through the buffer. This can be
|
||||||
useful to see older output or copy text.
|
useful to see older output or copy text.
|
||||||
|
|
||||||
The CTRL-W key can be used to start a window command, such as CTRL-W w to
|
|
||||||
switch to the next window. This also works in Insert mode (use Shift-CTRL-W
|
|
||||||
to delete a word). When leaving the window Insert mode will be stopped. When
|
|
||||||
coming back to the prompt window Insert mode will be restored.
|
|
||||||
|
|
||||||
Any command that starts Insert mode, such as "a", "i", "A" and "I", will move
|
Any command that starts Insert mode, such as "a", "i", "A" and "I", will move
|
||||||
the cursor to the last line. "A" will move to the end of the line, "I" to the
|
the cursor to the last line. "A" will move to the end of the line, "I" to the
|
||||||
start of the line.
|
start of the line.
|
||||||
@@ -229,12 +224,12 @@ prompt. >
|
|||||||
call chansend(g:shell_job, [a:text, ''])
|
call chansend(g:shell_job, [a:text, ''])
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Function handling output from the shell: Add it above the prompt.
|
" Function handling output from the shell: Added above the prompt.
|
||||||
func GotOutput(channel, msg, name)
|
func GotOutput(channel, msg, name)
|
||||||
call append(line("$") - 1, a:msg)
|
call append(line("$") - 1, a:msg)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Function handling the shell exits: close the window.
|
" Function handling the shell exit: close the window.
|
||||||
func JobExit(job, status, event)
|
func JobExit(job, status, event)
|
||||||
quit!
|
quit!
|
||||||
endfunc
|
endfunc
|
||||||
|
@@ -207,7 +207,7 @@ CTRL-\ e {expr} *c_CTRL-\_e*
|
|||||||
Example: >
|
Example: >
|
||||||
:cmap <F7> <C-\>eAppendSome()<CR>
|
:cmap <F7> <C-\>eAppendSome()<CR>
|
||||||
:func AppendSome()
|
:func AppendSome()
|
||||||
:let cmd = getcmdline() .. " Some()"
|
:let cmd = getcmdline() . " Some()"
|
||||||
:" place the cursor on the )
|
:" place the cursor on the )
|
||||||
:call setcmdpos(strlen(cmd))
|
:call setcmdpos(strlen(cmd))
|
||||||
:return cmd
|
:return cmd
|
||||||
@@ -679,7 +679,7 @@ If more line specifiers are given than required for the command, the first
|
|||||||
one(s) will be ignored.
|
one(s) will be ignored.
|
||||||
|
|
||||||
Line numbers may be specified with: *:range* *{address}*
|
Line numbers may be specified with: *:range* *{address}*
|
||||||
{number} an absolute line number *E1247*
|
{number} an absolute line number
|
||||||
. the current line *:.*
|
. the current line *:.*
|
||||||
$ the last line in the file *:$*
|
$ the last line in the file *:$*
|
||||||
% equal to 1,$ (the entire file) *:%*
|
% equal to 1,$ (the entire file) *:%*
|
||||||
@@ -697,8 +697,7 @@ Line numbers may be specified with: *:range* *{address}*
|
|||||||
|
|
||||||
Each may be followed (several times) by '+' or '-' and an optional number.
|
Each may be followed (several times) by '+' or '-' and an optional number.
|
||||||
This number is added or subtracted from the preceding line number. If the
|
This number is added or subtracted from the preceding line number. If the
|
||||||
number is omitted, 1 is used. If there is nothing before the '+' or '-' then
|
number is omitted, 1 is used.
|
||||||
the current line is used.
|
|
||||||
|
|
||||||
The "/" and "?" after {pattern} are required to separate the pattern from
|
The "/" and "?" after {pattern} are required to separate the pattern from
|
||||||
anything that follows.
|
anything that follows.
|
||||||
@@ -728,7 +727,7 @@ Some commands allow for a count after the command. This count is used as the
|
|||||||
number of lines to be used, starting with the line given in the last line
|
number of lines to be used, starting with the line given in the last line
|
||||||
specifier (the default is the cursor line). The commands that accept a count
|
specifier (the default is the cursor line). The commands that accept a count
|
||||||
are the ones that use a range but do not have a file name argument (because
|
are the ones that use a range but do not have a file name argument (because
|
||||||
a file name can also be a number). The count cannot be negative.
|
a file name can also be a number).
|
||||||
|
|
||||||
Examples: >
|
Examples: >
|
||||||
:s/x/X/g 5 substitute 'x' by 'X' in the current line and four
|
:s/x/X/g 5 substitute 'x' by 'X' in the current line and four
|
||||||
@@ -864,11 +863,9 @@ Note: these are typed literally, they are not special keys!
|
|||||||
*:<amatch>* *<amatch>*
|
*:<amatch>* *<amatch>*
|
||||||
<amatch> When executing autocommands, is replaced with the match for
|
<amatch> When executing autocommands, is replaced with the match for
|
||||||
which this autocommand was executed. *E497*
|
which this autocommand was executed. *E497*
|
||||||
It differs from <afile> when the file name isn't used to
|
It differs from <afile> only when the file name isn't used
|
||||||
match with (for FileType, Syntax and SpellFileMissing
|
to match with (for FileType, Syntax and SpellFileMissing
|
||||||
events).
|
events).
|
||||||
When the match is with a file name, it is expanded to the
|
|
||||||
full path.
|
|
||||||
*:<sfile>* *<sfile>*
|
*:<sfile>* *<sfile>*
|
||||||
<sfile> When executing a ":source" command, is replaced with the
|
<sfile> When executing a ":source" command, is replaced with the
|
||||||
file name of the sourced file. *E498*
|
file name of the sourced file. *E498*
|
||||||
@@ -908,7 +905,8 @@ These modifiers can be given, in this order:
|
|||||||
directory.
|
directory.
|
||||||
:. Reduce file name to be relative to current directory, if
|
:. Reduce file name to be relative to current directory, if
|
||||||
possible. File name is unmodified if it is not below the
|
possible. File name is unmodified if it is not below the
|
||||||
current directory.
|
current directory, but on MS-Windows the drive is removed if
|
||||||
|
it is the current drive.
|
||||||
For maximum shortness, use ":~:.".
|
For maximum shortness, use ":~:.".
|
||||||
:h Head of the file name (the last component and any separators
|
:h Head of the file name (the last component and any separators
|
||||||
removed). Cannot be used with :e, :r or :t.
|
removed). Cannot be used with :e, :r or :t.
|
||||||
|
@@ -105,7 +105,7 @@ in eval.c:
|
|||||||
|
|
||||||
- eval_call_provider(name, method, arguments, discard): calls
|
- eval_call_provider(name, method, arguments, discard): calls
|
||||||
provider#{name}#Call with the method and arguments. If discard is true, any
|
provider#{name}#Call with the method and arguments. If discard is true, any
|
||||||
value returned by the provider will be discarded and empty value will be
|
value returned by the provider will be discarded and and empty value be
|
||||||
returned.
|
returned.
|
||||||
- eval_has_provider(name): Checks the `g:loaded_{name}_provider` variable
|
- eval_has_provider(name): Checks the `g:loaded_{name}_provider` variable
|
||||||
which must be set to 2 by the provider script to indicate that it is
|
which must be set to 2 by the provider script to indicate that it is
|
||||||
@@ -204,7 +204,7 @@ Docstring format:
|
|||||||
- Use `<pre>` for code samples.
|
- Use `<pre>` for code samples.
|
||||||
|
|
||||||
Example: the help for |vim.paste()| is generated from a docstring decorating
|
Example: the help for |vim.paste()| is generated from a docstring decorating
|
||||||
vim.paste in runtime/lua/vim/_editor.lua like this: >
|
vim.paste in src/nvim/lua/vim.lua like this: >
|
||||||
|
|
||||||
--- Paste handler, invoked by |nvim_paste()| when a conforming UI
|
--- Paste handler, invoked by |nvim_paste()| when a conforming UI
|
||||||
--- (such as the |TUI|) pastes text into the editor.
|
--- (such as the |TUI|) pastes text into the editor.
|
||||||
@@ -243,13 +243,12 @@ If the function acts on an object then {thing} is the name of that object
|
|||||||
with a {thing} that groups functions under a common concept).
|
with a {thing} that groups functions under a common concept).
|
||||||
|
|
||||||
Use existing common {action} names if possible:
|
Use existing common {action} names if possible:
|
||||||
add Append to, or insert into, a collection
|
add Append to, or insert into, a collection
|
||||||
create Create a new thing
|
del Delete a thing (or group of things)
|
||||||
del Delete a thing (or group of things)
|
exec Execute code
|
||||||
exec Execute code
|
get Get a thing (or group of things by query)
|
||||||
get Get a thing (or group of things by query)
|
list Get all things
|
||||||
list Get all things
|
set Set a thing (or group of things)
|
||||||
set Set a thing (or group of things)
|
|
||||||
|
|
||||||
Use consistent names for {thing} in all API functions. E.g. a buffer is called
|
Use consistent names for {thing} in all API functions. E.g. a buffer is called
|
||||||
"buf" everywhere, not "buffer" in some places and "buf" in others.
|
"buf" everywhere, not "buffer" in some places and "buf" in others.
|
||||||
|
@@ -39,19 +39,15 @@ modify the diagnostics for a buffer (e.g. |vim.diagnostic.set()|) then it
|
|||||||
requires a namespace.
|
requires a namespace.
|
||||||
|
|
||||||
*diagnostic-structure*
|
*diagnostic-structure*
|
||||||
A diagnostic is a Lua table with the following keys. Required keys are
|
A diagnostic is a Lua table with the following keys:
|
||||||
indicated with (*):
|
|
||||||
|
|
||||||
bufnr: Buffer number
|
lnum: The starting line of the diagnostic
|
||||||
lnum(*): The starting line of the diagnostic
|
|
||||||
end_lnum: The final line of the diagnostic
|
end_lnum: The final line of the diagnostic
|
||||||
col(*): The starting column of the diagnostic
|
col: The starting column of the diagnostic
|
||||||
end_col: The final column of the diagnostic
|
end_col: The final column of the diagnostic
|
||||||
severity: The severity of the diagnostic |vim.diagnostic.severity|
|
severity: The severity of the diagnostic |vim.diagnostic.severity|
|
||||||
message(*): The diagnostic text
|
message: The diagnostic text
|
||||||
source: The source of the diagnostic
|
source: The source of the diagnostic
|
||||||
code: The diagnostic code
|
|
||||||
user_data: Arbitrary data plugins or users can add
|
|
||||||
|
|
||||||
Diagnostics use the same indexing as the rest of the Nvim API (i.e. 0-based
|
Diagnostics use the same indexing as the rest of the Nvim API (i.e. 0-based
|
||||||
rows and columns). |api-indexing|
|
rows and columns). |api-indexing|
|
||||||
@@ -74,7 +70,7 @@ Functions that take a severity as an optional parameter (e.g.
|
|||||||
|
|
||||||
2. A table with a "min" or "max" key (or both): >
|
2. A table with a "min" or "max" key (or both): >
|
||||||
|
|
||||||
vim.diagnostic.get(0, { severity = {min=vim.diagnostic.severity.WARN} })
|
vim.diagnostic.get(0, { severity = {min=vim.diagnostic.severity.WARN})
|
||||||
|
|
||||||
The latter form allows users to specify a range of severities.
|
The latter form allows users to specify a range of severities.
|
||||||
|
|
||||||
@@ -328,17 +324,16 @@ config({opts}, {namespace}) *vim.diagnostic.config()*
|
|||||||
Note:
|
Note:
|
||||||
Each of the configuration options below accepts one of the
|
Each of the configuration options below accepts one of the
|
||||||
following:
|
following:
|
||||||
• `false`: Disable this feature
|
• `false` : Disable this feature
|
||||||
• `true`: Enable this feature, use default settings.
|
• `true` : Enable this feature, use default settings.
|
||||||
• `table`: Enable this feature with overrides. Use an
|
• `table` : Enable this feature with overrides. Use an
|
||||||
empty table to use default values.
|
empty table to use default values.
|
||||||
• `function`: Function with signature (namespace, bufnr)
|
• `function` : Function with signature (namespace, bufnr)
|
||||||
that returns any of the above.
|
that returns any of the above.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{opts} table|nil When omitted or "nil", retrieve the
|
{opts} table Configuration table with the following
|
||||||
current configuration. Otherwise, a
|
keys:
|
||||||
configuration table with the following keys:
|
|
||||||
• underline: (default true) Use underline for
|
• underline: (default true) Use underline for
|
||||||
diagnostics. Options:
|
diagnostics. Options:
|
||||||
• severity: Only underline diagnostics
|
• severity: Only underline diagnostics
|
||||||
|
@@ -324,9 +324,8 @@ After setting this variable, reload the syntax script: >
|
|||||||
|
|
||||||
FINDING THE DIFFERENCES *diff-diffexpr*
|
FINDING THE DIFFERENCES *diff-diffexpr*
|
||||||
|
|
||||||
The 'diffexpr' option can be set to use something else than the internal diff
|
The 'diffexpr' option can be set to use something else than the standard
|
||||||
support or the standard "diff" program to compare two files and find the
|
"diff" program to compare two files and find the differences. *E959*
|
||||||
differences.
|
|
||||||
|
|
||||||
When 'diffexpr' is empty, Vim uses this command to find the differences
|
When 'diffexpr' is empty, Vim uses this command to find the differences
|
||||||
between file1 and file2: >
|
between file1 and file2: >
|
||||||
@@ -359,7 +358,7 @@ format mentioned. These variables are set to the file names used:
|
|||||||
|
|
||||||
v:fname_in original file
|
v:fname_in original file
|
||||||
v:fname_new new version of the same file
|
v:fname_new new version of the same file
|
||||||
v:fname_out where to write the resulting diff file
|
v:fname_out resulting diff file
|
||||||
|
|
||||||
Additionally, 'diffexpr' should take care of "icase" and "iwhite" in the
|
Additionally, 'diffexpr' should take care of "icase" and "iwhite" in the
|
||||||
'diffopt' option. 'diffexpr' cannot change the value of 'lines' and
|
'diffopt' option. 'diffexpr' cannot change the value of 'lines' and
|
||||||
@@ -371,13 +370,13 @@ Example (this does almost the same as 'diffexpr' being empty): >
|
|||||||
function MyDiff()
|
function MyDiff()
|
||||||
let opt = ""
|
let opt = ""
|
||||||
if &diffopt =~ "icase"
|
if &diffopt =~ "icase"
|
||||||
let opt = opt .. "-i "
|
let opt = opt . "-i "
|
||||||
endif
|
endif
|
||||||
if &diffopt =~ "iwhite"
|
if &diffopt =~ "iwhite"
|
||||||
let opt = opt .. "-b "
|
let opt = opt . "-b "
|
||||||
endif
|
endif
|
||||||
silent execute "!diff -a --binary " .. opt .. v:fname_in .. " " .. v:fname_new ..
|
silent execute "!diff -a --binary " . opt . v:fname_in . " " . v:fname_new .
|
||||||
\ " > " .. v:fname_out
|
\ " > " . v:fname_out
|
||||||
redraw!
|
redraw!
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -427,8 +426,8 @@ Example (this does the same as 'patchexpr' being empty): >
|
|||||||
|
|
||||||
set patchexpr=MyPatch()
|
set patchexpr=MyPatch()
|
||||||
function MyPatch()
|
function MyPatch()
|
||||||
:call system("patch -o " .. v:fname_out .. " " .. v:fname_in ..
|
:call system("patch -o " . v:fname_out . " " . v:fname_in .
|
||||||
\ " < " .. v:fname_diff)
|
\ " < " . v:fname_diff)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
Make sure that using the "patch" program doesn't have unwanted side effects.
|
Make sure that using the "patch" program doesn't have unwanted side effects.
|
||||||
|
@@ -35,9 +35,6 @@ An alternative is using the 'keymap' option.
|
|||||||
< Avoid defining a digraph with '_' (underscore) as the
|
< Avoid defining a digraph with '_' (underscore) as the
|
||||||
first character, it has a special meaning in the
|
first character, it has a special meaning in the
|
||||||
future.
|
future.
|
||||||
NOTE: This command cannot add a digraph that starts
|
|
||||||
with a white space. If you want to add such digraph,
|
|
||||||
you can use |digraph_set()| instead.
|
|
||||||
|
|
||||||
Example of the output of ":digraphs": >
|
Example of the output of ":digraphs": >
|
||||||
TH Þ 222 ss ß 223 a! à 224 a' á 225 a> â 226 a? ã 227 a: ä 228
|
TH Þ 222 ss ß 223 a! à 224 a' á 225 a> â 226 a? ã 227 a: ä 228
|
||||||
|
@@ -196,7 +196,7 @@ If you want to keep the changed buffer without saving it, switch on the
|
|||||||
Edit {file} always. Discard any changes to the
|
Edit {file} always. Discard any changes to the
|
||||||
current buffer.
|
current buffer.
|
||||||
Also see |++opt| and |+cmd|.
|
Also see |++opt| and |+cmd|.
|
||||||
*:edit_#* *:e#*
|
|
||||||
:e[dit] [++opt] [+cmd] #[count]
|
:e[dit] [++opt] [+cmd] #[count]
|
||||||
Edit the [count]th buffer (as shown by |:files|).
|
Edit the [count]th buffer (as shown by |:files|).
|
||||||
This command does the same as [count] CTRL-^. But ":e
|
This command does the same as [count] CTRL-^. But ":e
|
||||||
@@ -356,7 +356,7 @@ as a wildcard when "[" is in the 'isfname' option. A simple way to avoid this
|
|||||||
is to use "path\[[]abc]", this matches the file "path\[abc]".
|
is to use "path\[[]abc]", this matches the file "path\[abc]".
|
||||||
|
|
||||||
*starstar-wildcard*
|
*starstar-wildcard*
|
||||||
Expanding "**" is possible on Unix, Win32, macOS and a few other systems.
|
Expanding "**" is possible on Unix, Win32, Mac OS/X and a few other systems.
|
||||||
This allows searching a directory tree. This goes up to 100 directories deep.
|
This allows searching a directory tree. This goes up to 100 directories deep.
|
||||||
Note there are some commands where this works slightly differently, see
|
Note there are some commands where this works slightly differently, see
|
||||||
|file-searching|.
|
|file-searching|.
|
||||||
@@ -411,9 +411,9 @@ does apply like to other wildcards.
|
|||||||
|
|
||||||
Environment variables in the expression are expanded when evaluating the
|
Environment variables in the expression are expanded when evaluating the
|
||||||
expression, thus this works: >
|
expression, thus this works: >
|
||||||
:e `=$HOME .. '/.vimrc'`
|
:e `=$HOME . '/.vimrc'`
|
||||||
This does not work, $HOME is inside a string and used literally: >
|
This does not work, $HOME is inside a string and used literally: >
|
||||||
:e `='$HOME' .. '/.vimrc'`
|
:e `='$HOME' . '/.vimrc'`
|
||||||
|
|
||||||
If the expression returns a string then names are to be separated with line
|
If the expression returns a string then names are to be separated with line
|
||||||
breaks. When the result is a |List| then each item is used as a name. Line
|
breaks. When the result is a |List| then each item is used as a name. Line
|
||||||
@@ -845,7 +845,7 @@ Note: When the 'write' option is off, you are not able to write any file.
|
|||||||
|
|
||||||
*:w* *:write*
|
*:w* *:write*
|
||||||
*E502* *E503* *E504* *E505*
|
*E502* *E503* *E504* *E505*
|
||||||
*E512* *E514* *E667* *E949*
|
*E512* *E514* *E667* *E796* *E949*
|
||||||
:w[rite] [++opt] Write the whole buffer to the current file. This is
|
:w[rite] [++opt] Write the whole buffer to the current file. This is
|
||||||
the normal way to save changes to a file. It fails
|
the normal way to save changes to a file. It fails
|
||||||
when the 'readonly' option is set or when there is
|
when the 'readonly' option is set or when there is
|
||||||
@@ -1253,12 +1253,10 @@ working directory. If a local working directory (tab or window) does not
|
|||||||
exist, the next-higher scope in the hierarchy applies.
|
exist, the next-higher scope in the hierarchy applies.
|
||||||
|
|
||||||
*:cd* *E747* *E472*
|
*:cd* *E747* *E472*
|
||||||
:cd[!] On non-Unix systems when 'cdhome' is off: Print the
|
:cd[!] On non-Unix systems: Print the current directory
|
||||||
current directory name.
|
name. On Unix systems: Change the current directory
|
||||||
Otherwise: Change the current directory to the home
|
to the home directory. Use |:pwd| to print the
|
||||||
directory. Clear any window-local directory.
|
current directory on all systems.
|
||||||
Use |:pwd| to print the current directory on all
|
|
||||||
systems.
|
|
||||||
|
|
||||||
:cd[!] {path} Change the current directory to {path}.
|
:cd[!] {path} Change the current directory to {path}.
|
||||||
If {path} is relative, it is searched for in the
|
If {path} is relative, it is searched for in the
|
||||||
@@ -1331,7 +1329,6 @@ current directory for that window. Windows where the |:lcd| command has not
|
|||||||
been used stick to the global or tab-local directory. When jumping to another
|
been used stick to the global or tab-local directory. When jumping to another
|
||||||
window the current directory is changed to the last specified local current
|
window the current directory is changed to the last specified local current
|
||||||
directory. If none was specified, the global or tab-local directory is used.
|
directory. If none was specified, the global or tab-local directory is used.
|
||||||
When creating a new window it inherits the local directory of the current window.
|
|
||||||
|
|
||||||
When changing tabs the same behaviour applies. If the current tab has no
|
When changing tabs the same behaviour applies. If the current tab has no
|
||||||
local working directory the global working directory is used.
|
local working directory the global working directory is used.
|
||||||
@@ -1450,11 +1447,6 @@ If you don't get warned often enough you can use the following command.
|
|||||||
if it exists now.
|
if it exists now.
|
||||||
Once a file has been checked the timestamp is reset,
|
Once a file has been checked the timestamp is reset,
|
||||||
you will not be warned again.
|
you will not be warned again.
|
||||||
Syntax highlighting, marks, diff status,
|
|
||||||
'fileencoding', 'fileformat' and 'binary' options
|
|
||||||
are not changed. See |v:fcs_choice| to reload these
|
|
||||||
too (for example, if a code formatting tools has
|
|
||||||
changed the file).
|
|
||||||
|
|
||||||
:[N]checkt[ime] {filename}
|
:[N]checkt[ime] {filename}
|
||||||
:[N]checkt[ime] [N]
|
:[N]checkt[ime] [N]
|
||||||
@@ -1495,7 +1487,7 @@ which version of the file you want to keep.
|
|||||||
|
|
||||||
The accuracy of the time check depends on the filesystem. On Unix it is
|
The accuracy of the time check depends on the filesystem. On Unix it is
|
||||||
usually sub-second. With old file sytems and on MS-Windows it is normally one
|
usually sub-second. With old file sytems and on MS-Windows it is normally one
|
||||||
second. Use `has('nanotime')` to check if sub-second time stamp checks are
|
second. Use has('nanotime') check if sub-second time stamp checks are
|
||||||
available.
|
available.
|
||||||
|
|
||||||
There is one situation where you get the message while there is nothing wrong:
|
There is one situation where you get the message while there is nothing wrong:
|
||||||
@@ -1574,10 +1566,6 @@ There are three different types of searching:
|
|||||||
/u/user_x/work/include
|
/u/user_x/work/include
|
||||||
/u/user_x/include
|
/u/user_x/include
|
||||||
|
|
||||||
< Note: If your 'path' setting includes a non-existing directory, Vim will
|
|
||||||
skip the non-existing directory, and also does not search in the parent of
|
|
||||||
the non-existing directory if upwards searching is used.
|
|
||||||
|
|
||||||
3) Combined up/downward search:
|
3) Combined up/downward search:
|
||||||
If Vim's current path is /u/user_x/work/release and you do >
|
If Vim's current path is /u/user_x/work/release and you do >
|
||||||
set path=**;/u/user_x
|
set path=**;/u/user_x
|
||||||
|
8686
runtime/doc/eval.txt
8686
runtime/doc/eval.txt
File diff suppressed because it is too large
Load Diff
@@ -24,21 +24,12 @@ Each time a new or existing file is edited, Vim will try to recognize the type
|
|||||||
of the file and set the 'filetype' option. This will trigger the FileType
|
of the file and set the 'filetype' option. This will trigger the FileType
|
||||||
event, which can be used to set the syntax highlighting, set options, etc.
|
event, which can be used to set the syntax highlighting, set options, etc.
|
||||||
|
|
||||||
Detail: The ":filetype on" command will load these files:
|
Detail: The ":filetype on" command will load this file:
|
||||||
$VIMRUNTIME/filetype.lua
|
|
||||||
$VIMRUNTIME/filetype.vim
|
$VIMRUNTIME/filetype.vim
|
||||||
filetype.lua creates an autocommand that fires for all BufNewFile and
|
This file is a Vim script that defines autocommands for the
|
||||||
BufRead events. It tries to detect the filetype based off of the
|
BufNewFile and BufRead events. If the file type is not found by the
|
||||||
file's extension or name.
|
name, the file $VIMRUNTIME/scripts.vim is used to detect it from the
|
||||||
|
contents of the file.
|
||||||
filetype.vim is a Vim script that defines autocommands for the
|
|
||||||
BufNewFile and BufRead events. In contrast to filetype.lua, this
|
|
||||||
file creates separate BufNewFile and BufRead events for each filetype
|
|
||||||
pattern.
|
|
||||||
|
|
||||||
If the file type is not found by the name, the file
|
|
||||||
$VIMRUNTIME/scripts.vim is used to detect it from the contents of the
|
|
||||||
file.
|
|
||||||
When the GUI is running or will start soon, the |menu.vim| script is
|
When the GUI is running or will start soon, the |menu.vim| script is
|
||||||
also sourced. See |'go-M'| about avoiding that.
|
also sourced. See |'go-M'| about avoiding that.
|
||||||
|
|
||||||
@@ -131,37 +122,26 @@ shell script: "#!/bin/csh".
|
|||||||
argument was used.
|
argument was used.
|
||||||
|
|
||||||
*filetype-overrule*
|
*filetype-overrule*
|
||||||
When the same extension is used for multiple filetypes, Vim tries to guess
|
When the same extension is used for two filetypes, Vim tries to guess what
|
||||||
what kind of file it is. This doesn't always work. A number of global
|
kind of file it is. This doesn't always work. A number of global variables
|
||||||
variables can be used to overrule the filetype used for certain extensions:
|
can be used to overrule the filetype used for certain extensions:
|
||||||
|
|
||||||
file name variable ~
|
file name variable ~
|
||||||
*.asa g:filetype_asa |ft-aspvbs-syntax| |ft-aspperl-syntax|
|
*.asa g:filetype_asa |ft-aspvbs-syntax| |ft-aspperl-syntax|
|
||||||
*.asm g:asmsyntax |ft-asm-syntax|
|
*.asm g:asmsyntax |ft-asm-syntax|
|
||||||
*.asp g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax|
|
*.asp g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax|
|
||||||
*.bas g:filetype_bas |ft-basic-syntax|
|
*.fs g:filetype_fs |ft-forth-syntax|
|
||||||
*.cfg g:filetype_cfg
|
|
||||||
*.dat g:filetype_dat
|
|
||||||
*.frm g:filetype_frm |ft-form-syntax|
|
|
||||||
*.fs g:filetype_fs |ft-forth-syntax|
|
|
||||||
*.i g:filetype_i |ft-progress-syntax|
|
*.i g:filetype_i |ft-progress-syntax|
|
||||||
*.inc g:filetype_inc
|
*.inc g:filetype_inc
|
||||||
*.m g:filetype_m |ft-mathematica-syntax|
|
*.m g:filetype_m |ft-mathematica-syntax|
|
||||||
*.mod g:filetype_mod
|
|
||||||
*.p g:filetype_p |ft-pascal-syntax|
|
*.p g:filetype_p |ft-pascal-syntax|
|
||||||
*.pl g:filetype_pl
|
*.pl g:filetype_pl
|
||||||
*.pp g:filetype_pp |ft-pascal-syntax|
|
*.pp g:filetype_pp |ft-pascal-syntax|
|
||||||
*.prg g:filetype_prg
|
*.prg g:filetype_prg
|
||||||
*.src g:filetype_src
|
|
||||||
*.sys g:filetype_sys
|
|
||||||
*.sh g:bash_is_sh |ft-sh-syntax|
|
*.sh g:bash_is_sh |ft-sh-syntax|
|
||||||
*.tex g:tex_flavor |ft-tex-plugin|
|
*.tex g:tex_flavor |ft-tex-plugin|
|
||||||
*.w g:filetype_w |ft-cweb-syntax|
|
*.w g:filetype_w |ft-cweb-syntax|
|
||||||
|
|
||||||
For a few filetypes the global variable is used only when the filetype could
|
|
||||||
not be detected:
|
|
||||||
*.r g:filetype_r |ft-rexx-syntax|
|
|
||||||
|
|
||||||
*filetype-ignore*
|
*filetype-ignore*
|
||||||
To avoid that certain files are being inspected, the g:ft_ignore_pat variable
|
To avoid that certain files are being inspected, the g:ft_ignore_pat variable
|
||||||
is used. The default value is set like this: >
|
is used. The default value is set like this: >
|
||||||
@@ -169,10 +149,9 @@ is used. The default value is set like this: >
|
|||||||
This means that the contents of compressed files are not inspected.
|
This means that the contents of compressed files are not inspected.
|
||||||
|
|
||||||
*new-filetype*
|
*new-filetype*
|
||||||
If a file type that you want to use is not detected yet, there are a few ways
|
If a file type that you want to use is not detected yet, there are four ways
|
||||||
to add it. In any way, it's better not to modify the $VIMRUNTIME/filetype.lua
|
to add it. In any way, it's better not to modify the $VIMRUNTIME/filetype.vim
|
||||||
or $VIMRUNTIME/filetype.vim files. They will be overwritten when installing a
|
file. It will be overwritten when installing a new version of Vim.
|
||||||
new version of Nvim.
|
|
||||||
|
|
||||||
A. If you want to overrule all default file type checks.
|
A. If you want to overrule all default file type checks.
|
||||||
This works by writing one file for each filetype. The disadvantage is that
|
This works by writing one file for each filetype. The disadvantage is that
|
||||||
@@ -212,7 +191,7 @@ B. If you want to detect your file after the default file type checks.
|
|||||||
au BufRead,BufNewFile * if &ft == 'pascal' | set ft=mypascal
|
au BufRead,BufNewFile * if &ft == 'pascal' | set ft=mypascal
|
||||||
| endif
|
| endif
|
||||||
|
|
||||||
C. If your file type can be detected by the file name or extension.
|
C. If your file type can be detected by the file name.
|
||||||
1. Create your user runtime directory. You would normally use the first
|
1. Create your user runtime directory. You would normally use the first
|
||||||
item of the 'runtimepath' option. Example for Unix: >
|
item of the 'runtimepath' option. Example for Unix: >
|
||||||
:!mkdir -p ~/.config/nvim
|
:!mkdir -p ~/.config/nvim
|
||||||
@@ -227,38 +206,9 @@ C. If your file type can be detected by the file name or extension.
|
|||||||
au! BufRead,BufNewFile *.mine setfiletype mine
|
au! BufRead,BufNewFile *.mine setfiletype mine
|
||||||
au! BufRead,BufNewFile *.xyz setfiletype drawing
|
au! BufRead,BufNewFile *.xyz setfiletype drawing
|
||||||
augroup END
|
augroup END
|
||||||
<
|
< Write this file as "filetype.vim" in your user runtime directory. For
|
||||||
Write this file as "filetype.vim" in your user runtime directory. For
|
|
||||||
example, for Unix: >
|
example, for Unix: >
|
||||||
:w ~/.config/nvim/filetype.vim
|
:w ~/.config/nvim/filetype.vim
|
||||||
<
|
|
||||||
Alternatively, create a file called "filetype.lua" that adds new
|
|
||||||
filetypes.
|
|
||||||
Example: >
|
|
||||||
vim.filetype.add({
|
|
||||||
extension = {
|
|
||||||
foo = "fooscript",
|
|
||||||
},
|
|
||||||
filename = {
|
|
||||||
[".foorc"] = "foorc",
|
|
||||||
},
|
|
||||||
pattern = {
|
|
||||||
[".*/etc/foo/.*%.conf"] = "foorc",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
<
|
|
||||||
See |vim.filetype.add()|.
|
|
||||||
*g:do_filetype_lua*
|
|
||||||
For now, Lua filetype detection is opt-in. You can enable it by adding
|
|
||||||
the following to your |init.vim|: >
|
|
||||||
let g:do_filetype_lua = 1
|
|
||||||
< *g:did_load_filetypes*
|
|
||||||
In either case, the builtin filetype detection provided by Nvim can be
|
|
||||||
disabled by setting the did_load_filetypes global variable. If this
|
|
||||||
variable exists, $VIMRUNTIME/filetype.vim will not run.
|
|
||||||
Example: >
|
|
||||||
" Disable filetype.vim
|
|
||||||
let g:did_load_filetypes = 1
|
|
||||||
|
|
||||||
< 3. To use the new filetype detection you must restart Vim.
|
< 3. To use the new filetype detection you must restart Vim.
|
||||||
|
|
||||||
@@ -295,9 +245,9 @@ D. If your filetype can only be detected by inspecting the contents of the
|
|||||||
$VIMRUNTIME/scripts.vim.
|
$VIMRUNTIME/scripts.vim.
|
||||||
|
|
||||||
*remove-filetype*
|
*remove-filetype*
|
||||||
If a file type is detected that is wrong for you, install a filetype.lua,
|
If a file type is detected that is wrong for you, install a filetype.vim or
|
||||||
filetype.vim or scripts.vim to catch it (see above). You can set 'filetype' to
|
scripts.vim to catch it (see above). You can set 'filetype' to a non-existing
|
||||||
a non-existing name to avoid that it will be set later anyway: >
|
name to avoid that it will be set later anyway: >
|
||||||
:set filetype=ignored
|
:set filetype=ignored
|
||||||
|
|
||||||
If you are setting up a system with many users, and you don't want each user
|
If you are setting up a system with many users, and you don't want each user
|
||||||
@@ -364,12 +314,12 @@ define yourself. There are a few ways to avoid this:
|
|||||||
You need to define your own mapping before the plugin is loaded (before
|
You need to define your own mapping before the plugin is loaded (before
|
||||||
editing a file of that type). The plugin will then skip installing the
|
editing a file of that type). The plugin will then skip installing the
|
||||||
default mapping.
|
default mapping.
|
||||||
*no_mail_maps* *g:no_mail_maps*
|
*no_mail_maps*
|
||||||
3. Disable defining mappings for a specific filetype by setting a variable,
|
3. Disable defining mappings for a specific filetype by setting a variable,
|
||||||
which contains the name of the filetype. For the "mail" filetype this
|
which contains the name of the filetype. For the "mail" filetype this
|
||||||
would be: >
|
would be: >
|
||||||
:let no_mail_maps = 1
|
:let no_mail_maps = 1
|
||||||
< *no_plugin_maps* *g:no_plugin_maps*
|
< *no_plugin_maps*
|
||||||
4. Disable defining mappings for all filetypes by setting a variable: >
|
4. Disable defining mappings for all filetypes by setting a variable: >
|
||||||
:let no_plugin_maps = 1
|
:let no_plugin_maps = 1
|
||||||
<
|
<
|
||||||
|
@@ -497,13 +497,11 @@ Note the use of backslashes to avoid some characters to be interpreted by the
|
|||||||
:function MyFoldText()
|
:function MyFoldText()
|
||||||
: let line = getline(v:foldstart)
|
: let line = getline(v:foldstart)
|
||||||
: let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
|
: let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
|
||||||
: return v:folddashes .. sub
|
: return v:folddashes . sub
|
||||||
:endfunction
|
:endfunction
|
||||||
|
|
||||||
Evaluating 'foldtext' is done in the |sandbox|. The current window is set to
|
Evaluating 'foldtext' is done in the |sandbox|. The current window is set to
|
||||||
the window that displays the line.
|
the window that displays the line. Errors are ignored.
|
||||||
|
|
||||||
Errors are ignored. For debugging set the 'debug' option to "throw".
|
|
||||||
|
|
||||||
The default value is |foldtext()|. This returns a reasonable text for most
|
The default value is |foldtext()|. This returns a reasonable text for most
|
||||||
types of folding. If you don't like it, you can specify your own 'foldtext'
|
types of folding. If you don't like it, you can specify your own 'foldtext'
|
||||||
|
@@ -89,9 +89,9 @@ file is opened and adds Ada related entries to the main and pop-up menu.
|
|||||||
*ft-ada-omni*
|
*ft-ada-omni*
|
||||||
|
|
||||||
The Ada omni-completions (|i_CTRL-X_CTRL-O|) uses tags database created either
|
The Ada omni-completions (|i_CTRL-X_CTRL-O|) uses tags database created either
|
||||||
by "gnat xref -v" or the "Universal Ctags" (https://ctags.io). The complete
|
by "gnat xref -v" or the "exuberant Ctags (http://ctags.sourceforge.net). The
|
||||||
function will automatically detect which tool was used to create the tags
|
complete function will automatically detect which tool was used to create the
|
||||||
file.
|
tags file.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
3.1 Omni Completion with "gnat xref" ~
|
3.1 Omni Completion with "gnat xref" ~
|
||||||
@@ -125,18 +125,18 @@ NOTE: "gnat xref -v" is very tricky to use as it has almost no diagnostic
|
|||||||
3.2 Omni Completion with "ctags"~
|
3.2 Omni Completion with "ctags"~
|
||||||
*ada-ctags*
|
*ada-ctags*
|
||||||
|
|
||||||
Universal/Exuberant Ctags use their own multi-language code parser. The
|
Exuberant Ctags uses its own multi-language code parser. The parser is quite
|
||||||
parser is quite fast, produces a lot of extra information and can run on files
|
fast, produces a lot of extra information (hence the name "Exuberant Ctags")
|
||||||
which currently do not compile.
|
and can run on files which currently do not compile.
|
||||||
|
|
||||||
There are also lots of other Vim-tools which use Universal/Exuberant Ctags.
|
There are also lots of other Vim-tools which use exuberant Ctags.
|
||||||
Universal Ctags is preferred, Exuberant Ctags is no longer being developed.
|
|
||||||
|
|
||||||
You will need to install Universal Ctags which is available from
|
You will need to install a version of the Exuberant Ctags which has Ada
|
||||||
https://ctags.io
|
support patched in. Such a version is available from the GNU Ada Project
|
||||||
|
(http://gnuada.sourceforge.net).
|
||||||
|
|
||||||
The Ada parser for Universal/Exuberant Ctags is fairly new - don't expect
|
The Ada parser for Exuberant Ctags is fairly new - don't expect complete
|
||||||
complete support yet.
|
support yet.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
4. Compiler Support ~
|
4. Compiler Support ~
|
||||||
|
@@ -47,20 +47,20 @@ Numbers, subscripts and superscripts are available with 's' and 'S':
|
|||||||
|
|
||||||
But some don't come defined by default. Those are digraph definitions you can
|
But some don't come defined by default. Those are digraph definitions you can
|
||||||
add in your ~/.vimrc file. >
|
add in your ~/.vimrc file. >
|
||||||
exec 'digraph \\ ' .. char2nr('∖')
|
exec 'digraph \\ '.char2nr('∖')
|
||||||
exec 'digraph \< ' .. char2nr('≼')
|
exec 'digraph \< '.char2nr('≼')
|
||||||
exec 'digraph \> ' .. char2nr('≽')
|
exec 'digraph \> '.char2nr('≽')
|
||||||
exec 'digraph (L ' .. char2nr('⊈')
|
exec 'digraph (L '.char2nr('⊈')
|
||||||
exec 'digraph )L ' .. char2nr('⊉')
|
exec 'digraph )L '.char2nr('⊉')
|
||||||
exec 'digraph (/ ' .. char2nr('⊄')
|
exec 'digraph (/ '.char2nr('⊄')
|
||||||
exec 'digraph )/ ' .. char2nr('⊅')
|
exec 'digraph )/ '.char2nr('⊅')
|
||||||
exec 'digraph )/ ' .. char2nr('⊅')
|
exec 'digraph )/ '.char2nr('⊅')
|
||||||
exec 'digraph U+ ' .. char2nr('⊎')
|
exec 'digraph U+ '.char2nr('⊎')
|
||||||
exec 'digraph 0- ' .. char2nr('⊖')
|
exec 'digraph 0- '.char2nr('⊖')
|
||||||
" Euler's constant
|
" Euler's constant
|
||||||
exec 'digraph ne ' .. char2nr('𝑒')
|
exec 'digraph ne '.char2nr('𝑒')
|
||||||
" Raku's atomic operations marker
|
" Raku's atomic operations marker
|
||||||
exec 'digraph @@ ' .. char2nr('⚛')
|
exec 'digraph @@ '.char2nr('⚛')
|
||||||
|
|
||||||
Alternatively, you can write Insert mode abbreviations that convert ASCII-
|
Alternatively, you can write Insert mode abbreviations that convert ASCII-
|
||||||
based operators into their single-character Unicode equivalent. >
|
based operators into their single-character Unicode equivalent. >
|
||||||
|
@@ -26,7 +26,7 @@ behavior of the plugin.
|
|||||||
g:rustc_path~
|
g:rustc_path~
|
||||||
Set this option to the path to rustc for use in the |:RustRun| and
|
Set this option to the path to rustc for use in the |:RustRun| and
|
||||||
|:RustExpand| commands. If unset, "rustc" will be located in $PATH: >
|
|:RustExpand| commands. If unset, "rustc" will be located in $PATH: >
|
||||||
let g:rustc_path = $HOME .. "/bin/rustc"
|
let g:rustc_path = $HOME."/bin/rustc"
|
||||||
<
|
<
|
||||||
|
|
||||||
*g:rustc_makeprg_no_percent*
|
*g:rustc_makeprg_no_percent*
|
||||||
@@ -87,7 +87,7 @@ g:rust_bang_comment_leader~
|
|||||||
g:ftplugin_rust_source_path~
|
g:ftplugin_rust_source_path~
|
||||||
Set this option to a path that should be prepended to 'path' for Rust
|
Set this option to a path that should be prepended to 'path' for Rust
|
||||||
source files: >
|
source files: >
|
||||||
let g:ftplugin_rust_source_path = $HOME .. '/dev/rust'
|
let g:ftplugin_rust_source_path = $HOME.'/dev/rust'
|
||||||
<
|
<
|
||||||
|
|
||||||
*g:rustfmt_command*
|
*g:rustfmt_command*
|
||||||
|
@@ -109,8 +109,8 @@ must be configurable. The filetype plugin attempts to define many of the
|
|||||||
standard objects, plus many additional ones. In order to make this as
|
standard objects, plus many additional ones. In order to make this as
|
||||||
flexible as possible, you can override the list of objects from within your
|
flexible as possible, you can override the list of objects from within your
|
||||||
|vimrc| with the following: >
|
|vimrc| with the following: >
|
||||||
let g:ftplugin_sql_objects = 'function,procedure,event,table,trigger' ..
|
let g:ftplugin_sql_objects = 'function,procedure,event,table,trigger' .
|
||||||
\ ',schema,service,publication,database,datatype,domain' ..
|
\ ',schema,service,publication,database,datatype,domain' .
|
||||||
\ ',index,subscription,synchronization,view,variable'
|
\ ',index,subscription,synchronization,view,variable'
|
||||||
|
|
||||||
The following |Normal| mode and |Visual| mode maps have been created which use
|
The following |Normal| mode and |Visual| mode maps have been created which use
|
||||||
@@ -131,10 +131,10 @@ Repeatedly pressing ]} will cycle through each of these create statements: >
|
|||||||
create index i1 on t1 (c1);
|
create index i1 on t1 (c1);
|
||||||
|
|
||||||
The default setting for g:ftplugin_sql_objects is: >
|
The default setting for g:ftplugin_sql_objects is: >
|
||||||
let g:ftplugin_sql_objects = 'function,procedure,event,' ..
|
let g:ftplugin_sql_objects = 'function,procedure,event,' .
|
||||||
\ '\\(existing\\\\|global\\s\\+temporary\\s\\+\\)\\\{,1}' ..
|
\ '\\(existing\\\\|global\\s\\+temporary\\s\\+\\)\\\{,1}' .
|
||||||
\ 'table,trigger' ..
|
\ 'table,trigger' .
|
||||||
\ ',schema,service,publication,database,datatype,domain' ..
|
\ ',schema,service,publication,database,datatype,domain' .
|
||||||
\ ',index,subscription,synchronization,view,variable'
|
\ ',index,subscription,synchronization,view,variable'
|
||||||
|
|
||||||
The above will also handle these cases: >
|
The above will also handle these cases: >
|
||||||
@@ -555,7 +555,7 @@ the SQL completion plugin. >
|
|||||||
< 1. After typing SELECT press <C-C>t to display a list of tables.
|
< 1. After typing SELECT press <C-C>t to display a list of tables.
|
||||||
2. Highlight the table you need the column list for.
|
2. Highlight the table you need the column list for.
|
||||||
3. Press <Enter> to choose the table from the list.
|
3. Press <Enter> to choose the table from the list.
|
||||||
4. Press <C-C>l to request a comma-separated list of all columns
|
4. Press <C-C>l to request a comma separated list of all columns
|
||||||
for this table.
|
for this table.
|
||||||
5. Based on the table name chosen in step 3, the plugin attempts to
|
5. Based on the table name chosen in step 3, the plugin attempts to
|
||||||
decide on a reasonable table alias. You are then prompted to
|
decide on a reasonable table alias. You are then prompted to
|
||||||
@@ -609,7 +609,7 @@ your |init.vim|: >
|
|||||||
>
|
>
|
||||||
omni_sql_use_tbl_alias
|
omni_sql_use_tbl_alias
|
||||||
< - Default: a
|
< - Default: a
|
||||||
- This setting is only used when generating a comma-separated
|
- This setting is only used when generating a comma separated
|
||||||
column list. By default the map is <C-C>l. When generating
|
column list. By default the map is <C-C>l. When generating
|
||||||
a column list, an alias can be prepended to the beginning of each
|
a column list, an alias can be prepended to the beginning of each
|
||||||
column, for example: e.emp_id, e.emp_name. This option has three
|
column, for example: e.emp_id, e.emp_name. This option has three
|
||||||
@@ -693,9 +693,9 @@ plugin. >
|
|||||||
<C-C>c
|
<C-C>c
|
||||||
< - Displays a list of columns for a specific table. >
|
< - Displays a list of columns for a specific table. >
|
||||||
<C-C>l
|
<C-C>l
|
||||||
< - Displays a comma-separated list of columns for a specific table. >
|
< - Displays a comma separated list of columns for a specific table. >
|
||||||
<C-C>L
|
<C-C>L
|
||||||
< - Displays a comma-separated list of columns for a specific table.
|
< - Displays a comma separated list of columns for a specific table.
|
||||||
This should only be used when the completion window is active. >
|
This should only be used when the completion window is active. >
|
||||||
<Right>
|
<Right>
|
||||||
< - Displays a list of columns for the table currently highlighted in
|
< - Displays a list of columns for the table currently highlighted in
|
||||||
|
@@ -129,7 +129,6 @@ Advanced editing ~
|
|||||||
|diff.txt| working with two to eight versions of the same file
|
|diff.txt| working with two to eight versions of the same file
|
||||||
|autocmd.txt| automatically executing commands on an event
|
|autocmd.txt| automatically executing commands on an event
|
||||||
|eval.txt| expression evaluation, conditional commands
|
|eval.txt| expression evaluation, conditional commands
|
||||||
|builtin.txt| builtin functions
|
|
||||||
|fold.txt| hide (fold) ranges of lines
|
|fold.txt| hide (fold) ranges of lines
|
||||||
|lua.txt| Lua API
|
|lua.txt| Lua API
|
||||||
|api.txt| Nvim API via RPC, Lua and VimL
|
|api.txt| Nvim API via RPC, Lua and VimL
|
||||||
|
@@ -164,7 +164,7 @@ If you would like to open the help in the current window, see this tip:
|
|||||||
|
|
||||||
The initial height of the help window can be set with the 'helpheight' option
|
The initial height of the help window can be set with the 'helpheight' option
|
||||||
(default 20).
|
(default 20).
|
||||||
*help-buffer-options*
|
|
||||||
When the help buffer is created, several local options are set to make sure
|
When the help buffer is created, several local options are set to make sure
|
||||||
the help text is displayed as it was intended:
|
the help text is displayed as it was intended:
|
||||||
'iskeyword' nearly all ASCII chars except ' ', '*', '"' and '|'
|
'iskeyword' nearly all ASCII chars except ' ', '*', '"' and '|'
|
||||||
@@ -219,7 +219,7 @@ command: >
|
|||||||
<
|
<
|
||||||
|
|
||||||
*:helpt* *:helptags*
|
*:helpt* *:helptags*
|
||||||
*E150* *E151* *E152* *E153* *E154* *E670* *E856*
|
*E154* *E150* *E151* *E152* *E153* *E670* *E856*
|
||||||
:helpt[ags] [++t] {dir}
|
:helpt[ags] [++t] {dir}
|
||||||
Generate the help tags file(s) for directory {dir}.
|
Generate the help tags file(s) for directory {dir}.
|
||||||
When {dir} is ALL then all "doc" directories in
|
When {dir} is ALL then all "doc" directories in
|
||||||
@@ -358,7 +358,7 @@ When referring to a Vim option in the help file, place the option name between
|
|||||||
two single quotes, eg. 'statusline'
|
two single quotes, eg. 'statusline'
|
||||||
|
|
||||||
When referring to any other technical term, such as a filename or function
|
When referring to any other technical term, such as a filename or function
|
||||||
parameter, surround it in backticks, eg. `~/.path/to/init.vim`.
|
parameter, surround it in backticks (`), eg. `~/.path/to/init.vim`.
|
||||||
|
|
||||||
|
|
||||||
HIGHLIGHTING
|
HIGHLIGHTING
|
||||||
|
@@ -40,7 +40,7 @@ See |cscope-usage| to get started.
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
Cscope commands *cscope-commands*
|
Cscope commands *cscope-commands*
|
||||||
|
|
||||||
*:cscope* *:cs* *:scs* *:scscope* *E259* *E262* *E560* *E561*
|
*:cscope* *:cs* *:scs* *:scscope* *E259* *E262* *E561* *E560*
|
||||||
All cscope commands are accessed through suboptions to the cscope commands.
|
All cscope commands are accessed through suboptions to the cscope commands.
|
||||||
`:cscope` or `:cs` is the main command
|
`:cscope` or `:cs` is the main command
|
||||||
`:scscope` or `:scs` does the same and splits the window
|
`:scscope` or `:scs` does the same and splits the window
|
||||||
|
8
runtime/doc/if_lua.txt
Normal file
8
runtime/doc/if_lua.txt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
NVIM REFERENCE MANUAL
|
||||||
|
|
||||||
|
Moved to |lua.txt|
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
vim:tw=78:ts=8:noet:ft=help:norl:
|
@@ -1,10 +1,10 @@
|
|||||||
*if_pyth.txt* Nvim
|
*if_pyth.txt* Nvim
|
||||||
|
|
||||||
|
|
||||||
NVIM REFERENCE MANUAL
|
VIM REFERENCE MANUAL by Paul Moore
|
||||||
|
|
||||||
|
|
||||||
The Python Interface to NVim *if_pyth* *python* *Python*
|
The Python Interface to Vim *if_pyth* *python* *Python*
|
||||||
|
|
||||||
See |provider-python| for more information.
|
See |provider-python| for more information.
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ Instead, put the Python command in a function and call that function:
|
|||||||
Note that "EOF" must be at the start of the line.
|
Note that "EOF" must be at the start of the line.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
The vim module *python-vim*
|
The vim module *python-vim* *python2*
|
||||||
|
|
||||||
Python code gets all of its access to vim (with one exception - see
|
Python code gets all of its access to vim (with one exception - see
|
||||||
|python-output| below) via the "vim" module. The vim module implements two
|
|python-output| below) via the "vim" module. The vim module implements two
|
||||||
@@ -322,13 +322,14 @@ Output from Python *python-output*
|
|||||||
supported, and may cause the program to crash. This should probably be
|
supported, and may cause the program to crash. This should probably be
|
||||||
fixed.
|
fixed.
|
||||||
|
|
||||||
*python3-directory* *pythonx-directory*
|
*python2-directory* *python3-directory* *pythonx-directory*
|
||||||
Python 'runtimepath' handling *python-special-path*
|
Python 'runtimepath' handling *python-special-path*
|
||||||
|
|
||||||
In python vim.VIM_SPECIAL_PATH special directory is used as a replacement for
|
In python vim.VIM_SPECIAL_PATH special directory is used as a replacement for
|
||||||
the list of paths found in 'runtimepath': with this directory in sys.path and
|
the list of paths found in 'runtimepath': with this directory in sys.path and
|
||||||
vim.path_hooks in sys.path_hooks python will try to load module from
|
vim.path_hooks in sys.path_hooks python will try to load module from
|
||||||
{rtp}/python3 and {rtp}/pythonx for each {rtp} found in 'runtimepath'.
|
{rtp}/python2 (or python3) and {rtp}/pythonx (for both python versions) for
|
||||||
|
each {rtp} found in 'runtimepath'.
|
||||||
|
|
||||||
Implementation is similar to the following, but written in C: >
|
Implementation is similar to the following, but written in C: >
|
||||||
|
|
||||||
@@ -400,8 +401,8 @@ vim._get_paths *python-_get_paths*
|
|||||||
hook. You should not rely on this method being present in future
|
hook. You should not rely on this method being present in future
|
||||||
versions, but can use it for debugging.
|
versions, but can use it for debugging.
|
||||||
|
|
||||||
It returns a list of {rtp}/python3 and {rtp}/pythonx
|
It returns a list of {rtp}/python2 (or {rtp}/python3) and
|
||||||
directories for each {rtp} in 'runtimepath'.
|
{rtp}/pythonx directories for each {rtp} in 'runtimepath'.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Buffer objects *python-buffer*
|
Buffer objects *python-buffer*
|
||||||
@@ -589,11 +590,6 @@ functions to evaluate Python expressions and pass their values to Vim script.
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
Python 3 *python3*
|
Python 3 *python3*
|
||||||
|
|
||||||
As Python 3 is the only supported version in Nvim, "python" is synonymous
|
|
||||||
with "python3" in the current version. However, code that aims to support older
|
|
||||||
versions of Neovim, as well as Vim, should prefer to use "python3"
|
|
||||||
variants explicitly if Python 3 is required.
|
|
||||||
|
|
||||||
*:py3* *:python3*
|
*:py3* *:python3*
|
||||||
:[range]py3 {stmt}
|
:[range]py3 {stmt}
|
||||||
:[range]py3 << [endmarker]
|
:[range]py3 << [endmarker]
|
||||||
@@ -623,26 +619,31 @@ Raising SystemExit exception in python isn't endorsed way to quit vim, use: >
|
|||||||
:py vim.command("qall!")
|
:py vim.command("qall!")
|
||||||
<
|
<
|
||||||
*has-python*
|
*has-python*
|
||||||
You can test if Python is available with: >
|
You can test what Python version is available with: >
|
||||||
if has('pythonx')
|
if has('python')
|
||||||
echo 'there is Python'
|
echo 'there is Python 2.x'
|
||||||
endif
|
endif
|
||||||
if has('python3')
|
if has('python3')
|
||||||
echo 'there is Python 3.x'
|
echo 'there is Python 3.x'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
Python 2 is no longer supported. Thus `has('python')` always returns
|
|
||||||
zero for backwards compatibility reasons.
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Python X *python_x* *pythonx*
|
Python X *python_x* *pythonx*
|
||||||
|
|
||||||
The "pythonx" and "pyx" prefixes were introduced for python code which
|
Because most python code can be written so that it works with Python 2.6+ and
|
||||||
works with Python 2.6+ and Python 3. As Nvim only supports Python 3,
|
Python 3, the pyx* functions and commands have been written. They work the
|
||||||
all these commands are now synonymous to their "python3" equivalents.
|
same as the Python 2 and 3 variants, but select the Python version using the
|
||||||
|
'pyxversion' setting.
|
||||||
|
|
||||||
|
Set 'pyxversion' in your |vimrc| to prefer Python 2 or Python 3 for Python
|
||||||
|
commands. Changing this setting at runtime risks losing the state of plugins
|
||||||
|
(such as initialization).
|
||||||
|
|
||||||
|
If you want to use a module, you can put it in the {rtp}/pythonx directory.
|
||||||
|
See |pythonx-directory|.
|
||||||
|
|
||||||
*:pyx* *:pythonx*
|
*:pyx* *:pythonx*
|
||||||
`:pyx` and `:pythonx` work the same as `:python3`. To check if `:pyx` works: >
|
`:pyx` and `:pythonx` work similar to `:python`. To check if `:pyx` works: >
|
||||||
:pyx print("Hello")
|
:pyx print("Hello")
|
||||||
|
|
||||||
To see what version of Python is being used: >
|
To see what version of Python is being used: >
|
||||||
@@ -650,15 +651,33 @@ To see what version of Python is being used: >
|
|||||||
:pyx print(sys.version)
|
:pyx print(sys.version)
|
||||||
<
|
<
|
||||||
*:pyxfile* *python_x-special-comments*
|
*:pyxfile* *python_x-special-comments*
|
||||||
`:pyxfile` works the same as `:py3file`.
|
`:pyxfile` works similar to `:pyfile`. But you can add a "shebang" comment to
|
||||||
|
force Vim to use `:pyfile` or `:py3file`: >
|
||||||
|
#!/any string/python2 " Shebang. Must be the first line of the file.
|
||||||
|
#!/any string/python3 " Shebang. Must be the first line of the file.
|
||||||
|
# requires python 2.x " Maximum lines depend on 'modelines'.
|
||||||
|
# requires python 3.x " Maximum lines depend on 'modelines'.
|
||||||
|
Unlike normal modelines, the bottom of the file is not checked.
|
||||||
|
If none of them are found, the 'pyxversion' option is used.
|
||||||
|
*W20* *W21*
|
||||||
|
If Vim does not support the selected Python version a silent message will be
|
||||||
|
printed. Use `:messages` to read them.
|
||||||
|
|
||||||
*:pyxdo*
|
*:pyxdo*
|
||||||
`:pyxdo` works the same as `:py3do`.
|
`:pyxdo` works similar to `:pydo`.
|
||||||
|
|
||||||
*has-pythonx*
|
*has-pythonx*
|
||||||
To check if `pyx*` functions and commands are available: >
|
To check if pyx* functions and commands are available: >
|
||||||
if has('pythonx')
|
if has('pythonx')
|
||||||
echo 'pyx* commands are available. (Python ' .. &pyx .. ')'
|
echo 'pyx* commands are available. (Python ' . &pyx . ')'
|
||||||
|
endif
|
||||||
|
|
||||||
|
If you prefer Python 2 and want to fallback to Python 3, set 'pyxversion'
|
||||||
|
explicitly in your |.vimrc|. Example: >
|
||||||
|
if has('python')
|
||||||
|
set pyx=2
|
||||||
|
elseif has('python3')
|
||||||
|
set pyx=3
|
||||||
endif
|
endif
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
@@ -38,12 +38,11 @@ is not a C compiler: it does not recognize all syntax. One requirement is
|
|||||||
that toplevel functions have a '{' in the first column. Otherwise they are
|
that toplevel functions have a '{' in the first column. Otherwise they are
|
||||||
easily confused with declarations.
|
easily confused with declarations.
|
||||||
|
|
||||||
These five options control C program indenting:
|
These four options control C program indenting:
|
||||||
'cindent' Enables Vim to perform C program indenting automatically.
|
'cindent' Enables Vim to perform C program indenting automatically.
|
||||||
'cinkeys' Specifies which keys trigger reindenting in insert mode.
|
'cinkeys' Specifies which keys trigger reindenting in insert mode.
|
||||||
'cinoptions' Sets your preferred indent style.
|
'cinoptions' Sets your preferred indent style.
|
||||||
'cinwords' Defines keywords that start an extra indent in the next line.
|
'cinwords' Defines keywords that start an extra indent in the next line.
|
||||||
'cinscopedecls' Defines strings that are recognized as a C++ scope declaration.
|
|
||||||
|
|
||||||
If 'lisp' is not on and 'equalprg' is empty, the "=" operator indents using
|
If 'lisp' is not on and 'equalprg' is empty, the "=" operator indents using
|
||||||
Vim's built-in algorithm rather than calling an external program.
|
Vim's built-in algorithm rather than calling an external program.
|
||||||
@@ -290,9 +289,8 @@ The examples below assume a 'shiftwidth' of 4.
|
|||||||
<
|
<
|
||||||
*cino-g*
|
*cino-g*
|
||||||
gN Place C++ scope declarations N characters from the indent of the
|
gN Place C++ scope declarations N characters from the indent of the
|
||||||
block they are in. (default 'shiftwidth'). By default, a scope
|
block they are in. (default 'shiftwidth'). A scope declaration
|
||||||
declaration is "public:", "protected:" or "private:". This can
|
can be "public:", "protected:" or "private:".
|
||||||
be adjusted with the 'cinscopedecls' option.
|
|
||||||
|
|
||||||
cino= cino=g0 >
|
cino= cino=g0 >
|
||||||
{ {
|
{ {
|
||||||
@@ -773,15 +771,6 @@ You can set the indent for the first line after <script> and <style>
|
|||||||
"auto" auto indent (same indent as the blocktag)
|
"auto" auto indent (same indent as the blocktag)
|
||||||
"inc" auto indent + one indent step
|
"inc" auto indent + one indent step
|
||||||
|
|
||||||
You can set the indent for attributes after an open <tag line: >
|
|
||||||
|
|
||||||
:let g:html_indent_attribute = 1
|
|
||||||
<
|
|
||||||
VALUE MEANING ~
|
|
||||||
1 auto indent, one indent step more than <tag
|
|
||||||
2 auto indent, two indent steps (default)
|
|
||||||
> 2 auto indent, more indent steps
|
|
||||||
|
|
||||||
Many tags increase the indent for what follows per default (see "Add Indent
|
Many tags increase the indent for what follows per default (see "Add Indent
|
||||||
Tags" in the script). You can add further tags with: >
|
Tags" in the script). You can add further tags with: >
|
||||||
|
|
||||||
@@ -883,7 +872,7 @@ For example, with N = 1, this will give:
|
|||||||
*PHP_outdentphpescape*
|
*PHP_outdentphpescape*
|
||||||
To indent PHP escape tags as the surrounding non-PHP code (only affects the
|
To indent PHP escape tags as the surrounding non-PHP code (only affects the
|
||||||
PHP escape tags): >
|
PHP escape tags): >
|
||||||
:let g:PHP_outdentphpescape = 0
|
:let g:PHP_outdentphpescape = 0
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
*PHP_removeCRwhenUnix*
|
*PHP_removeCRwhenUnix*
|
||||||
@@ -1210,7 +1199,7 @@ comments will be indented according to the correctly indented code.
|
|||||||
|
|
||||||
|
|
||||||
VIM *ft-vim-indent*
|
VIM *ft-vim-indent*
|
||||||
*g:vim_indent_cont*
|
|
||||||
For indenting Vim scripts there is one variable that specifies the amount of
|
For indenting Vim scripts there is one variable that specifies the amount of
|
||||||
indent for a continuation line, a line that starts with a backslash: >
|
indent for a continuation line, a line that starts with a backslash: >
|
||||||
|
|
||||||
|
@@ -339,6 +339,7 @@ tag char note action in Normal mode ~
|
|||||||
insert text, repeat N times
|
insert text, repeat N times
|
||||||
|P| ["x]P 2 put the text [from register x] before the
|
|P| ["x]P 2 put the text [from register x] before the
|
||||||
cursor N times
|
cursor N times
|
||||||
|
|Q| Q switch to "Ex" mode
|
||||||
|R| R 2 enter replace mode: overtype existing
|
|R| R 2 enter replace mode: overtype existing
|
||||||
characters, repeat the entered text N-1
|
characters, repeat the entered text N-1
|
||||||
times
|
times
|
||||||
@@ -401,7 +402,6 @@ tag char note action in Normal mode ~
|
|||||||
|q| q{0-9a-zA-Z"} record typed characters into named register
|
|q| q{0-9a-zA-Z"} record typed characters into named register
|
||||||
{0-9a-zA-Z"} (uppercase to append)
|
{0-9a-zA-Z"} (uppercase to append)
|
||||||
|q| q (while recording) stops recording
|
|q| q (while recording) stops recording
|
||||||
|Q| Q replay last recorded macro
|
|
||||||
|q:| q: edit : command-line in command-line window
|
|q:| q: edit : command-line in command-line window
|
||||||
|q/| q/ edit / command-line in command-line window
|
|q/| q/ edit / command-line in command-line window
|
||||||
|q?| q? edit ? command-line in command-line window
|
|q?| q? edit ? command-line in command-line window
|
||||||
@@ -431,7 +431,6 @@ tag char note action in Normal mode ~
|
|||||||
|<C-LeftMouse>| <C-LeftMouse> ":ta" to the keyword at the mouse click
|
|<C-LeftMouse>| <C-LeftMouse> ":ta" to the keyword at the mouse click
|
||||||
|<C-Right>| <C-Right> 1 same as "w"
|
|<C-Right>| <C-Right> 1 same as "w"
|
||||||
|<C-RightMouse>| <C-RightMouse> same as "CTRL-T"
|
|<C-RightMouse>| <C-RightMouse> same as "CTRL-T"
|
||||||
|<C-Tab>| <C-Tab> same as "g<Tab>"
|
|
||||||
|<Del>| ["x]<Del> 2 same as "x"
|
|<Del>| ["x]<Del> 2 same as "x"
|
||||||
|N<Del>| {count}<Del> remove the last digit from {count}
|
|N<Del>| {count}<Del> remove the last digit from {count}
|
||||||
|<Down>| <Down> 1 same as "j"
|
|<Down>| <Down> 1 same as "j"
|
||||||
@@ -578,7 +577,7 @@ tag command action in Normal mode ~
|
|||||||
following the file name.
|
following the file name.
|
||||||
|CTRL-W_gt| CTRL-W g t same as `gt`: go to next tab page
|
|CTRL-W_gt| CTRL-W g t same as `gt`: go to next tab page
|
||||||
|CTRL-W_gT| CTRL-W g T same as `gT`: go to previous tab page
|
|CTRL-W_gT| CTRL-W g T same as `gT`: go to previous tab page
|
||||||
|CTRL-W_g<Tab>| CTRL-W g <Tab> same as |g<Tab>|: go to last accessed tab
|
|CTRL-W_g<Tab>| CTRL-W g <Tab> same as `g<Tab>` : go to last accessed tab
|
||||||
page
|
page
|
||||||
|CTRL-W_h| CTRL-W h go to Nth left window (stop at first window)
|
|CTRL-W_h| CTRL-W h go to Nth left window (stop at first window)
|
||||||
|CTRL-W_i| CTRL-W i split window and jump to declaration of
|
|CTRL-W_i| CTRL-W i split window and jump to declaration of
|
||||||
@@ -925,9 +924,7 @@ tag command note action in Visual mode ~
|
|||||||
before the highlighted area
|
before the highlighted area
|
||||||
|v_J| J 2 join the highlighted lines
|
|v_J| J 2 join the highlighted lines
|
||||||
|v_K| K run 'keywordprg' on the highlighted area
|
|v_K| K run 'keywordprg' on the highlighted area
|
||||||
|v_O| O move horizontally to other corner of area
|
|v_O| O Move horizontally to other corner of area.
|
||||||
|v_P| P replace highlighted area with register
|
|
||||||
contents; unnamed register is unchanged
|
|
||||||
Q does not start Ex mode
|
Q does not start Ex mode
|
||||||
|v_R| R 2 delete the highlighted lines and start
|
|v_R| R 2 delete the highlighted lines and start
|
||||||
insert
|
insert
|
||||||
@@ -990,8 +987,6 @@ tag command note action in Visual mode ~
|
|||||||
|v_i{| i{ same as iB
|
|v_i{| i{ same as iB
|
||||||
|v_i}| i} same as iB
|
|v_i}| i} same as iB
|
||||||
|v_o| o move cursor to other corner of area
|
|v_o| o move cursor to other corner of area
|
||||||
|v_p| p replace highlighted area with register
|
|
||||||
contents; deleted text in unnamed register
|
|
||||||
|v_r| r 2 replace highlighted area with a character
|
|v_r| r 2 replace highlighted area with a character
|
||||||
|v_s| s 2 delete highlighted area and start insert
|
|v_s| s 2 delete highlighted area and start insert
|
||||||
|v_u| u 2 make highlighted area lowercase
|
|v_u| u 2 make highlighted area lowercase
|
||||||
|
@@ -76,8 +76,6 @@ CTRL-U Delete all entered characters before the cursor in the current
|
|||||||
line. If there are no newly entered characters and
|
line. If there are no newly entered characters and
|
||||||
'backspace' is not empty, delete all characters before the
|
'backspace' is not empty, delete all characters before the
|
||||||
cursor in the current line.
|
cursor in the current line.
|
||||||
If C-indenting is enabled the indent will be adjusted if the
|
|
||||||
line becomes blank.
|
|
||||||
See |i_backspacing| about joining lines.
|
See |i_backspacing| about joining lines.
|
||||||
*i_CTRL-U-default*
|
*i_CTRL-U-default*
|
||||||
By default, sets a new undo point before deleting.
|
By default, sets a new undo point before deleting.
|
||||||
@@ -258,7 +256,7 @@ CTRL-] Trigger abbreviation, without inserting a character.
|
|||||||
|
|
||||||
*i_backspacing*
|
*i_backspacing*
|
||||||
The effect of the <BS>, CTRL-W, and CTRL-U depend on the 'backspace' option
|
The effect of the <BS>, CTRL-W, and CTRL-U depend on the 'backspace' option
|
||||||
(unless 'revins' is set). This is a comma-separated list of items:
|
(unless 'revins' is set). This is a comma separated list of items:
|
||||||
|
|
||||||
item action ~
|
item action ~
|
||||||
indent allow backspacing over autoindent
|
indent allow backspacing over autoindent
|
||||||
@@ -269,8 +267,8 @@ start allow backspacing over the start position of insert; CTRL-W and
|
|||||||
When 'backspace' is empty, Vi compatible backspacing is used. You cannot
|
When 'backspace' is empty, Vi compatible backspacing is used. You cannot
|
||||||
backspace over autoindent, before column 1 or before where insert started.
|
backspace over autoindent, before column 1 or before where insert started.
|
||||||
|
|
||||||
For backwards compatibility the values "0", "1", "2" and "3" are also allowed,
|
For backwards compatibility the values "0", "1" and "2" are also allowed, see
|
||||||
see |'backspace'|.
|
|'backspace'|.
|
||||||
|
|
||||||
If the 'backspace' option does contain "eol" and the cursor is in column 1
|
If the 'backspace' option does contain "eol" and the cursor is in column 1
|
||||||
when one of the three keys is used, the current line is joined with the
|
when one of the three keys is used, the current line is joined with the
|
||||||
@@ -780,7 +778,7 @@ If the previous expansion was split, because it got longer than 'textwidth',
|
|||||||
then just the text in the current line will be used.
|
then just the text in the current line will be used.
|
||||||
|
|
||||||
If the match found is at the end of a line, then the first word in the next
|
If the match found is at the end of a line, then the first word in the next
|
||||||
line will be inserted and the message "Word from other line" displayed, if
|
line will be inserted and the message "word from next line" displayed, if
|
||||||
this word is accepted the next CTRL-X CTRL-P or CTRL-X CTRL-N will search
|
this word is accepted the next CTRL-X CTRL-P or CTRL-X CTRL-N will search
|
||||||
for those lines starting with this word.
|
for those lines starting with this word.
|
||||||
|
|
||||||
@@ -798,7 +796,6 @@ CTRL-X CTRL-K Search the files given with the 'dictionary' option
|
|||||||
the 'dictionary' option is empty.
|
the 'dictionary' option is empty.
|
||||||
For suggestions where to find a list of words, see the
|
For suggestions where to find a list of words, see the
|
||||||
'dictionary' option.
|
'dictionary' option.
|
||||||
'ignorecase', 'smartcase' and 'infercase' apply.
|
|
||||||
|
|
||||||
CTRL-K or
|
CTRL-K or
|
||||||
CTRL-N Search forward for next matching keyword. This
|
CTRL-N Search forward for next matching keyword. This
|
||||||
@@ -831,7 +828,7 @@ space is preferred). Maximum line length is 510 bytes.
|
|||||||
|
|
||||||
For an example, imagine the 'thesaurus' file has a line like this: >
|
For an example, imagine the 'thesaurus' file has a line like this: >
|
||||||
angry furious mad enraged
|
angry furious mad enraged
|
||||||
Placing the cursor after the letters "ang" and typing CTRL-X CTRL-T would
|
<Placing the cursor after the letters "ang" and typing CTRL-X CTRL-T would
|
||||||
complete the word "angry"; subsequent presses would change the word to
|
complete the word "angry"; subsequent presses would change the word to
|
||||||
"furious", "mad" etc.
|
"furious", "mad" etc.
|
||||||
|
|
||||||
@@ -843,7 +840,7 @@ https://github.com/vim/vim/issues/629#issuecomment-443293282
|
|||||||
Unpack thesaurus_pkg.zip, put the thesaurus.txt file somewhere, e.g.
|
Unpack thesaurus_pkg.zip, put the thesaurus.txt file somewhere, e.g.
|
||||||
~/.vim/thesaurus/english.txt, and the 'thesaurus' option to this file name.
|
~/.vim/thesaurus/english.txt, and the 'thesaurus' option to this file name.
|
||||||
|
|
||||||
|
|
||||||
Completing keywords with 'thesaurusfunc' *compl-thesaurusfunc*
|
Completing keywords with 'thesaurusfunc' *compl-thesaurusfunc*
|
||||||
|
|
||||||
If the 'thesaurusfunc' option is set, then the user specified function is
|
If the 'thesaurusfunc' option is set, then the user specified function is
|
||||||
@@ -865,7 +862,7 @@ Groß): >
|
|||||||
else
|
else
|
||||||
let res = []
|
let res = []
|
||||||
let h = ''
|
let h = ''
|
||||||
for l in split(system('aiksaurus ' .. shellescape(a:base)), '\n')
|
for l in split(system('aiksaurus '.shellescape(a:base)), '\n')
|
||||||
if l[:3] == '=== '
|
if l[:3] == '=== '
|
||||||
let h = substitute(l[4:], ' =*$', '', '')
|
let h = substitute(l[4:], ' =*$', '', '')
|
||||||
elseif l[0] =~ '\a'
|
elseif l[0] =~ '\a'
|
||||||
@@ -1200,7 +1197,7 @@ An example that completes the names of the months: >
|
|||||||
" find months matching with "a:base"
|
" find months matching with "a:base"
|
||||||
let res = []
|
let res = []
|
||||||
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
|
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
|
||||||
if m =~ '^' .. a:base
|
if m =~ '^' . a:base
|
||||||
call add(res, m)
|
call add(res, m)
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
@@ -1222,7 +1219,7 @@ The same, but now pretending searching for matches is slow: >
|
|||||||
else
|
else
|
||||||
" find months matching with "a:base"
|
" find months matching with "a:base"
|
||||||
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
|
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
|
||||||
if m =~ '^' .. a:base
|
if m =~ '^' . a:base
|
||||||
call complete_add(m)
|
call complete_add(m)
|
||||||
endif
|
endif
|
||||||
sleep 300m " simulate searching for next match
|
sleep 300m " simulate searching for next match
|
||||||
@@ -1342,16 +1339,11 @@ in 'runtimepath'. Thus for "java" it is autoload/javacomplete.vim.
|
|||||||
|
|
||||||
C *ft-c-omni*
|
C *ft-c-omni*
|
||||||
|
|
||||||
Completion of C code requires a tags file. You should use Universal/
|
Completion of C code requires a tags file. You should use Exuberant ctags,
|
||||||
Exuberant ctags, because it adds extra information that is needed for
|
because it adds extra information that is needed for completion. You can find
|
||||||
completion. You can find it here:
|
it here: http://ctags.sourceforge.net/ Version 5.6 or later is recommended.
|
||||||
Universal Ctags: https://ctags.io
|
|
||||||
Exuberant Ctags: http://ctags.sourceforge.net
|
|
||||||
|
|
||||||
Universal Ctags is preferred, Exuberant Ctags is no longer being developed.
|
For version 5.5.4 you should add a patch that adds the "typename:" field:
|
||||||
|
|
||||||
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
|
ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
|
||||||
A compiled .exe for MS-Windows can be found at:
|
A compiled .exe for MS-Windows can be found at:
|
||||||
http://ctags.sourceforge.net/
|
http://ctags.sourceforge.net/
|
||||||
@@ -1472,11 +1464,8 @@ will be suggested. All other elements are not placed in suggestion list.
|
|||||||
PHP *ft-php-omni*
|
PHP *ft-php-omni*
|
||||||
|
|
||||||
Completion of PHP code requires a tags file for completion of data from
|
Completion of PHP code requires a tags file for completion of data from
|
||||||
external files and for class aware completion. You should use Universal/
|
external files and for class aware completion. You should use Exuberant ctags
|
||||||
Exuberant ctags version 5.5.4 or newer. You can find it here:
|
version 5.5.4 or newer. You can find it here: http://ctags.sourceforge.net/
|
||||||
|
|
||||||
Universal Ctags: https://ctags.io
|
|
||||||
Exuberant Ctags: http://ctags.sourceforge.net
|
|
||||||
|
|
||||||
Script completes:
|
Script completes:
|
||||||
|
|
||||||
@@ -1872,10 +1861,14 @@ gi Insert text in the same position as where Insert mode
|
|||||||
*o*
|
*o*
|
||||||
o Begin a new line below the cursor and insert text,
|
o Begin a new line below the cursor and insert text,
|
||||||
repeat [count] times.
|
repeat [count] times.
|
||||||
|
When the '#' flag is in 'cpoptions' the count is
|
||||||
|
ignored.
|
||||||
|
|
||||||
*O*
|
*O*
|
||||||
O Begin a new line above the cursor and insert text,
|
O Begin a new line above the cursor and insert text,
|
||||||
repeat [count] times.
|
repeat [count] times.
|
||||||
|
When the '#' flag is in 'cpoptions' the count is
|
||||||
|
ignored.
|
||||||
|
|
||||||
These commands are used to start inserting text. You can end insert mode with
|
These commands are used to start inserting text. You can end insert mode with
|
||||||
<Esc>. See |mode-ins-repl| for the other special characters in Insert mode.
|
<Esc>. See |mode-ins-repl| for the other special characters in Insert mode.
|
||||||
@@ -1885,9 +1878,6 @@ When 'autoindent' is on, the indent for a new line is obtained from the
|
|||||||
previous line. When 'smartindent' or 'cindent' is on, the indent for a line
|
previous line. When 'smartindent' or 'cindent' is on, the indent for a line
|
||||||
is automatically adjusted for C programs.
|
is automatically adjusted for C programs.
|
||||||
|
|
||||||
'formatoptions' can be set to copy the comment leader when opening a new
|
|
||||||
line.
|
|
||||||
|
|
||||||
'textwidth' can be set to the maximum width for a line. When a line becomes
|
'textwidth' can be set to the maximum width for a line. When a line becomes
|
||||||
too long when appending characters a line break is automatically inserted.
|
too long when appending characters a line break is automatically inserted.
|
||||||
|
|
||||||
|
@@ -120,7 +120,7 @@ Vim would never have become what it is now, without the help of these people!
|
|||||||
Daniel Elstner GTK+ 2 port
|
Daniel Elstner GTK+ 2 port
|
||||||
Eric Fischer Mac port, 'cindent', and other improvements
|
Eric Fischer Mac port, 'cindent', and other improvements
|
||||||
Benji Fisher Answering lots of user questions
|
Benji Fisher Answering lots of user questions
|
||||||
Bill Foster Athena GUI port (later removed)
|
Bill Foster Athena GUI port
|
||||||
Google Lets me work on Vim one day a week
|
Google Lets me work on Vim one day a week
|
||||||
Loic Grenie xvim (ideas for multi windows version)
|
Loic Grenie xvim (ideas for multi windows version)
|
||||||
Sven Guckes Vim promoter and previous WWW page maintainer
|
Sven Guckes Vim promoter and previous WWW page maintainer
|
||||||
@@ -322,6 +322,7 @@ notation meaning equivalent decimal value(s) ~
|
|||||||
<Bar> vertical bar | 124 *<Bar>*
|
<Bar> vertical bar | 124 *<Bar>*
|
||||||
<Del> delete 127
|
<Del> delete 127
|
||||||
<CSI> command sequence intro ALT-Esc 155 *<CSI>*
|
<CSI> command sequence intro ALT-Esc 155 *<CSI>*
|
||||||
|
<xCSI> CSI when typed in the GUI *<xCSI>*
|
||||||
|
|
||||||
<EOL> end-of-line (can be <CR>, <NL> or <CR><NL>,
|
<EOL> end-of-line (can be <CR>, <NL> or <CR><NL>,
|
||||||
depends on system and 'fileformat') *<EOL>*
|
depends on system and 'fileformat') *<EOL>*
|
||||||
@@ -562,8 +563,8 @@ The command CTRL-\ CTRL-G or <C-\><C-G> can be used to go to Insert mode when
|
|||||||
make sure Vim is in the mode indicated by 'insertmode', without knowing in
|
make sure Vim is in the mode indicated by 'insertmode', without knowing in
|
||||||
what mode Vim currently is.
|
what mode Vim currently is.
|
||||||
|
|
||||||
*gQ* *mode-Ex* *Ex-mode* *Ex* *EX* *E501*
|
*gQ* *Q* *mode-Ex* *Ex-mode* *Ex* *EX* *E501*
|
||||||
gQ Switch to Ex mode. This is like typing ":" commands
|
Q or gQ Switch to Ex mode. This is like typing ":" commands
|
||||||
one after another, except:
|
one after another, except:
|
||||||
- You don't have to keep pressing ":".
|
- You don't have to keep pressing ":".
|
||||||
- The screen doesn't get updated after each command.
|
- The screen doesn't get updated after each command.
|
||||||
|
@@ -60,7 +60,7 @@ The example will:
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
local dir = bufname
|
local dir = bufname
|
||||||
-- Just in case our algorithm is buggy, don't infinite loop.
|
-- Just in case our algo is buggy, don't infinite loop.
|
||||||
for _ = 1, 100 do
|
for _ = 1, 100 do
|
||||||
local did_change
|
local did_change
|
||||||
dir, did_change = dirname(dir)
|
dir, did_change = dirname(dir)
|
||||||
|
@@ -355,8 +355,8 @@ To configure the behavior of a builtin |lsp-handler|, the convenient method
|
|||||||
*lsp-handler-resolution*
|
*lsp-handler-resolution*
|
||||||
Handlers can be set by:
|
Handlers can be set by:
|
||||||
|
|
||||||
- Setting a field in vim.lsp.handlers. *vim.lsp.handlers*
|
- Setting a field in |vim.lsp.handlers|. *vim.lsp.handlers*
|
||||||
vim.lsp.handlers is a global table that contains the default mapping of
|
|vim.lsp.handlers| is a global table that contains the default mapping of
|
||||||
|lsp-method| names to |lsp-handlers|.
|
|lsp-method| names to |lsp-handlers|.
|
||||||
|
|
||||||
To override the handler for the `"textDocument/definition"` method: >
|
To override the handler for the `"textDocument/definition"` method: >
|
||||||
@@ -563,7 +563,7 @@ buf_request_all({bufnr}, {method}, {params}, {callback})
|
|||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
(function) A function that will cancel all requests which
|
(function) A function that will cancel all requests which
|
||||||
is the same as the one returned from `buf_request`.
|
is the same as the one returned from `buf_request` .
|
||||||
|
|
||||||
*vim.lsp.buf_request_sync()*
|
*vim.lsp.buf_request_sync()*
|
||||||
buf_request_sync({bufnr}, {method}, {params}, {timeout_ms})
|
buf_request_sync({bufnr}, {method}, {params}, {timeout_ms})
|
||||||
@@ -600,9 +600,9 @@ client() *vim.lsp.client*
|
|||||||
{handler} is not specified, If one is not found there,
|
{handler} is not specified, If one is not found there,
|
||||||
then an error will occur. Returns: {status},
|
then an error will occur. Returns: {status},
|
||||||
{[client_id]}. {status} is a boolean indicating if the
|
{[client_id]}. {status} is a boolean indicating if the
|
||||||
notification was successful. If it is `false`, then it
|
notification was successful. If it is `false` , then it
|
||||||
will always be `false` (the client has shutdown). If
|
will always be `false` (the client has shutdown). If
|
||||||
{status} is `true`, the function returns {request_id} as
|
{status} is `true` , the function returns {request_id} as
|
||||||
the second result. You can use this with
|
the second result. You can use this with
|
||||||
`client.cancel_request(request_id)` to cancel the request.
|
`client.cancel_request(request_id)` to cancel the request.
|
||||||
• request_sync(method, params, timeout_ms, bufnr) Sends a
|
• request_sync(method, params, timeout_ms, bufnr) Sends a
|
||||||
@@ -612,13 +612,13 @@ client() *vim.lsp.client*
|
|||||||
`err` and `result` come from the |lsp-handler|. On
|
`err` and `result` come from the |lsp-handler|. On
|
||||||
timeout, cancel or error, returns `(nil, err)` where `err`
|
timeout, cancel or error, returns `(nil, err)` where `err`
|
||||||
is a string describing the failure reason. If the request
|
is a string describing the failure reason. If the request
|
||||||
was unsuccessful returns `nil`.
|
was unsuccessful returns `nil` .
|
||||||
• notify(method, params) Sends a notification to an LSP
|
• notify(method, params) Sends a notification to an LSP
|
||||||
server. Returns: a boolean to indicate if the notification
|
server. Returns: a boolean to indicate if the notification
|
||||||
was successful. If it is false, then it will always be
|
was successful. If it is false, then it will always be
|
||||||
false (the client has shutdown).
|
false (the client has shutdown).
|
||||||
• cancel_request(id) Cancels a request with a given request
|
• cancel_request(id) Cancels a request with a given request
|
||||||
id. Returns: same as `notify()`.
|
id. Returns: same as `notify()` .
|
||||||
• stop([force]) Stops a client, optionally with force. By
|
• stop([force]) Stops a client, optionally with force. By
|
||||||
default, it will just ask the server to shutdown without
|
default, it will just ask the server to shutdown without
|
||||||
force. If you request to stop a client which has
|
force. If you request to stop a client which has
|
||||||
@@ -639,14 +639,14 @@ client() *vim.lsp.client*
|
|||||||
interaction with the client. See |vim.lsp.rpc.start()|.
|
interaction with the client. See |vim.lsp.rpc.start()|.
|
||||||
• {offset_encoding} (string): The encoding used for
|
• {offset_encoding} (string): The encoding used for
|
||||||
communicating with the server. You can modify this in the
|
communicating with the server. You can modify this in the
|
||||||
`config`'s `on_init` method before text is sent to the
|
`config` 's `on_init` method before text is sent to the
|
||||||
server.
|
server.
|
||||||
• {handlers} (table): The handlers used by the client as
|
• {handlers} (table): The handlers used by the client as
|
||||||
described in |lsp-handler|.
|
described in |lsp-handler|.
|
||||||
• {requests} (table): The current pending requests in flight
|
• {requests} (table): The current pending requests in flight
|
||||||
to the server. Entries are key-value pairs with the key
|
to the server. Entries are key-value pairs with the key
|
||||||
being the request ID while the value is a table with
|
being the request ID while the value is a table with
|
||||||
`type`, `bufnr`, and `method` key-value pairs. `type` is
|
`type` , `bufnr` , and `method` key-value pairs. `type` is
|
||||||
either "pending" for an active request, or "cancel" for a
|
either "pending" for an active request, or "cancel" for a
|
||||||
cancel request.
|
cancel request.
|
||||||
• {config} (table): copy of the table that was passed by the
|
• {config} (table): copy of the table that was passed by the
|
||||||
@@ -655,7 +655,7 @@ client() *vim.lsp.client*
|
|||||||
sent on `initialize` describing the server's capabilities.
|
sent on `initialize` describing the server's capabilities.
|
||||||
• {resolved_capabilities} (table): Normalized table of
|
• {resolved_capabilities} (table): Normalized table of
|
||||||
capabilities that we have detected based on the initialize
|
capabilities that we have detected based on the initialize
|
||||||
response from the server in `server_capabilities`.
|
response from the server in `server_capabilities` .
|
||||||
|
|
||||||
client_is_stopped({client_id}) *vim.lsp.client_is_stopped()*
|
client_is_stopped({client_id}) *vim.lsp.client_is_stopped()*
|
||||||
Checks whether a client is stopped.
|
Checks whether a client is stopped.
|
||||||
@@ -686,11 +686,7 @@ formatexpr({opts}) *vim.lsp.formatexpr()*
|
|||||||
Provides an interface between the built-in client and a
|
Provides an interface between the built-in client and a
|
||||||
`formatexpr` function.
|
`formatexpr` function.
|
||||||
|
|
||||||
Currently only supports a single client. This can be set via
|
Currently only supports a single client. This can be set via `setlocal formatexpr=v:lua.vim.lsp.formatexpr()` but will typically or in `on_attach` via vim.api.nvim_buf_set_option(bufnr, 'formatexpr , 'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})')`.
|
||||||
`setlocal formatexpr=v:lua.vim.lsp.formatexpr()` but will
|
|
||||||
typically or in `on_attach` via
|
|
||||||
`vim.api.nvim_buf_set_option(bufnr, 'formatexpr',
|
|
||||||
'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})')`.
|
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{opts} table options for customizing the formatting
|
{opts} table options for customizing the formatting
|
||||||
@@ -779,7 +775,7 @@ start_client({config}) *vim.lsp.start_client()*
|
|||||||
initiates the LSP client.
|
initiates the LSP client.
|
||||||
{cmd_cwd} (string, default=|getcwd()|)
|
{cmd_cwd} (string, default=|getcwd()|)
|
||||||
Directory to launch the `cmd`
|
Directory to launch the `cmd`
|
||||||
process. Not related to `root_dir`.
|
process. Not related to `root_dir` .
|
||||||
{cmd_env} (table) Environment flags to pass to
|
{cmd_env} (table) Environment flags to pass to
|
||||||
the LSP on spawn. Can be specified
|
the LSP on spawn. Can be specified
|
||||||
using keys like a map or as a list
|
using keys like a map or as a list
|
||||||
@@ -804,15 +800,15 @@ start_client({config}) *vim.lsp.start_client()*
|
|||||||
its result.
|
its result.
|
||||||
• Note: To send an empty dictionary
|
• Note: To send an empty dictionary
|
||||||
use
|
use
|
||||||
`{[vim.type_idx]=vim.types.dictionary}`,
|
`{[vim.type_idx]=vim.types.dictionary}`
|
||||||
else it will be encoded as an
|
, else it will be encoded as an
|
||||||
array.
|
array.
|
||||||
{handlers} Map of language server method names
|
{handlers} Map of language server method names
|
||||||
to |lsp-handler|
|
to |lsp-handler|
|
||||||
{settings} Map with language server specific
|
{settings} Map with language server specific
|
||||||
settings. These are returned to the
|
settings. These are returned to the
|
||||||
language server if requested via
|
language server if requested via
|
||||||
`workspace/configuration`. Keys are
|
`workspace/configuration` . Keys are
|
||||||
case-sensitive.
|
case-sensitive.
|
||||||
{commands} table Table that maps string of
|
{commands} table Table that maps string of
|
||||||
clientside commands to user-defined
|
clientside commands to user-defined
|
||||||
@@ -825,7 +821,7 @@ start_client({config}) *vim.lsp.start_client()*
|
|||||||
action, code lenses, ...) triggers
|
action, code lenses, ...) triggers
|
||||||
the command.
|
the command.
|
||||||
{init_options} Values to pass in the initialization
|
{init_options} Values to pass in the initialization
|
||||||
request as `initializationOptions`.
|
request as `initializationOptions` .
|
||||||
See `initialize` in the LSP spec.
|
See `initialize` in the LSP spec.
|
||||||
{name} (string, default=client-id) Name in
|
{name} (string, default=client-id) Name in
|
||||||
log messages.
|
log messages.
|
||||||
@@ -980,7 +976,7 @@ code_action({context}) *vim.lsp.buf.code_action()*
|
|||||||
• only: (string|nil) LSP `CodeActionKind` used
|
• only: (string|nil) LSP `CodeActionKind` used
|
||||||
to filter the code actions. Most language
|
to filter the code actions. Most language
|
||||||
servers support values like `refactor` or
|
servers support values like `refactor` or
|
||||||
`quickfix`.
|
`quickfix` .
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction
|
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction
|
||||||
@@ -1011,8 +1007,8 @@ definition() *vim.lsp.buf.definition()*
|
|||||||
document_highlight() *vim.lsp.buf.document_highlight()*
|
document_highlight() *vim.lsp.buf.document_highlight()*
|
||||||
Send request to the server to resolve document highlights for
|
Send request to the server to resolve document highlights for
|
||||||
the current text document position. This request can be
|
the current text document position. This request can be
|
||||||
triggered by a key mapping or by events such as `CursorHold`,
|
triggered by a key mapping or by events such as `CursorHold` ,
|
||||||
e.g.:
|
eg:
|
||||||
>
|
>
|
||||||
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
||||||
autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()
|
autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()
|
||||||
@@ -1128,7 +1124,7 @@ range_code_action({context}, {start_pos}, {end_pos})
|
|||||||
• only: (string|nil) LSP `CodeActionKind`
|
• only: (string|nil) LSP `CodeActionKind`
|
||||||
used to filter the code actions. Most
|
used to filter the code actions. Most
|
||||||
language servers support values like
|
language servers support values like
|
||||||
`refactor` or `quickfix`.
|
`refactor` or `quickfix` .
|
||||||
{start_pos} ({number, number}, optional) mark-indexed
|
{start_pos} ({number, number}, optional) mark-indexed
|
||||||
position. Defaults to the start of the last
|
position. Defaults to the start of the last
|
||||||
visual selection.
|
visual selection.
|
||||||
@@ -1229,8 +1225,8 @@ on_publish_diagnostics({_}, {result}, {ctx}, {config})
|
|||||||
},
|
},
|
||||||
-- Use a function to dynamically turn signs off
|
-- Use a function to dynamically turn signs off
|
||||||
-- and on, using buffer local variables
|
-- and on, using buffer local variables
|
||||||
signs = function(namespace, bufnr)
|
signs = function(bufnr, client_id)
|
||||||
return vim.b[bufnr].show_signs == true
|
return vim.bo[bufnr].show_signs == false
|
||||||
end,
|
end,
|
||||||
-- Disable a feature
|
-- Disable a feature
|
||||||
update_in_insert = false,
|
update_in_insert = false,
|
||||||
@@ -1250,8 +1246,8 @@ display({lenses}, {bufnr}, {client_id}) *vim.lsp.codelens.display()*
|
|||||||
Display the lenses using virtual text
|
Display the lenses using virtual text
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{lenses} table of lenses to display (`CodeLens[] |
|
{lenses} table of lenses to display ( `CodeLens[] |
|
||||||
null`)
|
null` )
|
||||||
{bufnr} number
|
{bufnr} number
|
||||||
{client_id} number
|
{client_id} number
|
||||||
|
|
||||||
@@ -1263,7 +1259,7 @@ get({bufnr}) *vim.lsp.codelens.get()*
|
|||||||
current buffer.
|
current buffer.
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
table (`CodeLens[]`)
|
table ( `CodeLens[]` )
|
||||||
|
|
||||||
*vim.lsp.codelens.on_codelens()*
|
*vim.lsp.codelens.on_codelens()*
|
||||||
on_codelens({err}, {result}, {ctx}, {_})
|
on_codelens({err}, {result}, {ctx}, {_})
|
||||||
@@ -1285,8 +1281,8 @@ save({lenses}, {bufnr}, {client_id}) *vim.lsp.codelens.save()*
|
|||||||
Store lenses for a specific buffer and client
|
Store lenses for a specific buffer and client
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{lenses} table of lenses to store (`CodeLens[] |
|
{lenses} table of lenses to store ( `CodeLens[] |
|
||||||
null`)
|
null` )
|
||||||
{bufnr} number
|
{bufnr} number
|
||||||
{client_id} number
|
{client_id} number
|
||||||
|
|
||||||
@@ -1336,8 +1332,8 @@ signature_help({_}, {result}, {ctx}, {config})
|
|||||||
Lua module: vim.lsp.util *lsp-util*
|
Lua module: vim.lsp.util *lsp-util*
|
||||||
|
|
||||||
*vim.lsp.util.apply_text_document_edit()*
|
*vim.lsp.util.apply_text_document_edit()*
|
||||||
apply_text_document_edit({text_document_edit}, {index}, {offset_encoding})
|
apply_text_document_edit({text_document_edit}, {index})
|
||||||
Applies a `TextDocumentEdit`, which is a list of changes to a
|
Applies a `TextDocumentEdit` , which is a list of changes to a
|
||||||
single document.
|
single document.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
@@ -1356,18 +1352,18 @@ apply_text_edits({text_edits}, {bufnr}, {offset_encoding})
|
|||||||
Parameters: ~
|
Parameters: ~
|
||||||
{text_edits} table list of `TextEdit` objects
|
{text_edits} table list of `TextEdit` objects
|
||||||
{bufnr} number Buffer id
|
{bufnr} number Buffer id
|
||||||
{offset_encoding} string utf-8|utf-16|utf-32
|
{offset_encoding} string utf-8|utf-16|utf-32|nil defaults
|
||||||
|
to encoding of first client of `bufnr`
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textEdit
|
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textEdit
|
||||||
|
|
||||||
*vim.lsp.util.apply_workspace_edit()*
|
*vim.lsp.util.apply_workspace_edit()*
|
||||||
apply_workspace_edit({workspace_edit}, {offset_encoding})
|
apply_workspace_edit({workspace_edit})
|
||||||
Applies a `WorkspaceEdit`.
|
Applies a `WorkspaceEdit` .
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{workspace_edit} table `WorkspaceEdit`
|
{workspace_edit} (table) `WorkspaceEdit`
|
||||||
{offset_encoding} string utf-8|utf-16|utf-32 (required)
|
|
||||||
|
|
||||||
buf_clear_references({bufnr}) *vim.lsp.util.buf_clear_references()*
|
buf_clear_references({bufnr}) *vim.lsp.util.buf_clear_references()*
|
||||||
Removes document highlights from a buffer.
|
Removes document highlights from a buffer.
|
||||||
@@ -1384,7 +1380,9 @@ buf_highlight_references({bufnr}, {references}, {offset_encoding})
|
|||||||
{references} table List of `DocumentHighlight`
|
{references} table List of `DocumentHighlight`
|
||||||
objects to highlight
|
objects to highlight
|
||||||
{offset_encoding} string One of "utf-8", "utf-16",
|
{offset_encoding} string One of "utf-8", "utf-16",
|
||||||
"utf-32".
|
"utf-32", or nil. Defaults to
|
||||||
|
`offset_encoding` of first client of
|
||||||
|
`bufnr`
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#documentHighlight
|
https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#documentHighlight
|
||||||
@@ -1411,13 +1409,13 @@ convert_input_to_markdown_lines({input}, {contents})
|
|||||||
Converts any of `MarkedString` | `MarkedString[]` |
|
Converts any of `MarkedString` | `MarkedString[]` |
|
||||||
`MarkupContent` into a list of lines containing valid
|
`MarkupContent` into a list of lines containing valid
|
||||||
markdown. Useful to populate the hover window for
|
markdown. Useful to populate the hover window for
|
||||||
`textDocument/hover`, for parsing the result of
|
`textDocument/hover` , for parsing the result of
|
||||||
`textDocument/signatureHelp`, and potentially others.
|
`textDocument/signatureHelp` , and potentially others.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{input} (`MarkedString` | `MarkedString[]` |
|
{input} ( `MarkedString` | `MarkedString[]` |
|
||||||
`MarkupContent`)
|
`MarkupContent` )
|
||||||
{contents} (table, optional, default `{}`) List of
|
{contents} (table, optional, default `{}` ) List of
|
||||||
strings to extend with converted lines
|
strings to extend with converted lines
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
@@ -1461,31 +1459,28 @@ extract_completion_items({result})
|
|||||||
https://microsoft.github.io/language-server-protocol/specification#textDocument_completion
|
https://microsoft.github.io/language-server-protocol/specification#textDocument_completion
|
||||||
|
|
||||||
get_effective_tabstop({bufnr}) *vim.lsp.util.get_effective_tabstop()*
|
get_effective_tabstop({bufnr}) *vim.lsp.util.get_effective_tabstop()*
|
||||||
Returns indentation size.
|
Returns visual width of tabstop.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{bufnr} (optional, number): Buffer handle, defaults to
|
{bufnr} (optional, number): Buffer handle, defaults to
|
||||||
current
|
current
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
(number) indentation size
|
(number) tabstop visual width
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
|shiftwidth|
|
|softtabstop|
|
||||||
|
|
||||||
*vim.lsp.util.jump_to_location()*
|
jump_to_location({location}) *vim.lsp.util.jump_to_location()*
|
||||||
jump_to_location({location}, {offset_encoding})
|
|
||||||
Jumps to a location.
|
Jumps to a location.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{location} table (`Location`|`LocationLink`)
|
{location} ( `Location` | `LocationLink` )
|
||||||
{offset_encoding} string utf-8|utf-16|utf-32 (required)
|
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
`true` if the jump succeeded
|
`true` if the jump succeeded
|
||||||
|
|
||||||
*vim.lsp.util.locations_to_items()*
|
locations_to_items({locations}) *vim.lsp.util.locations_to_items()*
|
||||||
locations_to_items({locations}, {offset_encoding})
|
|
||||||
Returns the items with the byte position calculated correctly
|
Returns the items with the byte position calculated correctly
|
||||||
and in sorted order, for display in quickfix and location
|
and in sorted order, for display in quickfix and location
|
||||||
lists.
|
lists.
|
||||||
@@ -1494,10 +1489,8 @@ locations_to_items({locations}, {offset_encoding})
|
|||||||
|setqflist()| or |setloclist()|.
|
|setqflist()| or |setloclist()|.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{locations} table list of `Location`s or
|
{locations} (table) list of `Location` s or
|
||||||
`LocationLink`s
|
`LocationLink` s
|
||||||
{offset_encoding} string offset_encoding for locations
|
|
||||||
utf-8|utf-16|utf-32
|
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
(table) list of items
|
(table) list of items
|
||||||
@@ -1529,7 +1522,7 @@ make_floating_popup_options({width}, {height}, {opts})
|
|||||||
• border (string or table) override `border`
|
• border (string or table) override `border`
|
||||||
• focusable (string or table) override
|
• focusable (string or table) override
|
||||||
`focusable`
|
`focusable`
|
||||||
• zindex (string or table) override `zindex`,
|
• zindex (string or table) override `zindex` ,
|
||||||
defaults to 50
|
defaults to 50
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
@@ -1569,7 +1562,7 @@ make_given_range_params({start_pos}, {end_pos}, {bufnr}, {offset_encoding})
|
|||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
{ textDocument = { uri = `current_file_uri` }, range = {
|
{ textDocument = { uri = `current_file_uri` }, range = {
|
||||||
start = `start_position`, end = `end_position` } }
|
start = `start_position` , end = `end_position` } }
|
||||||
|
|
||||||
*vim.lsp.util.make_position_params()*
|
*vim.lsp.util.make_position_params()*
|
||||||
make_position_params({window}, {offset_encoding})
|
make_position_params({window}, {offset_encoding})
|
||||||
@@ -1593,9 +1586,9 @@ make_position_params({window}, {offset_encoding})
|
|||||||
make_range_params({window}, {offset_encoding})
|
make_range_params({window}, {offset_encoding})
|
||||||
Using the current position in the current buffer, creates an
|
Using the current position in the current buffer, creates an
|
||||||
object that can be used as a building block for several LSP
|
object that can be used as a building block for several LSP
|
||||||
requests, such as `textDocument/codeAction`,
|
requests, such as `textDocument/codeAction` ,
|
||||||
`textDocument/colorPresentation`,
|
`textDocument/colorPresentation` ,
|
||||||
`textDocument/rangeFormatting`.
|
`textDocument/rangeFormatting` .
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{window} (optional, number): window handle or 0
|
{window} (optional, number): window handle or 0
|
||||||
@@ -1606,7 +1599,7 @@ make_range_params({window}, {offset_encoding})
|
|||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
{ textDocument = { uri = `current_file_uri` }, range = {
|
{ textDocument = { uri = `current_file_uri` }, range = {
|
||||||
start = `current_position`, end = `current_position` } }
|
start = `current_position` , end = `current_position` } }
|
||||||
|
|
||||||
*vim.lsp.util.make_text_document_params()*
|
*vim.lsp.util.make_text_document_params()*
|
||||||
make_text_document_params({bufnr})
|
make_text_document_params({bufnr})
|
||||||
@@ -1660,8 +1653,8 @@ open_floating_preview({contents}, {syntax}, {opts})
|
|||||||
closes the floating window
|
closes the floating window
|
||||||
• focusable: (boolean, default true) Make
|
• focusable: (boolean, default true) Make
|
||||||
float focusable
|
float focusable
|
||||||
• focus: (boolean, default true) If `true`,
|
• focus: (boolean, default true) If `true` ,
|
||||||
and if {focusable} is also `true`, focus an
|
and if {focusable} is also `true` , focus an
|
||||||
existing floating window with the same
|
existing floating window with the same
|
||||||
{focus_id}
|
{focus_id}
|
||||||
|
|
||||||
@@ -1760,7 +1753,7 @@ text_document_completion_list_to_complete_items({result}, {prefix})
|
|||||||
Parameters: ~
|
Parameters: ~
|
||||||
{result} The result of a `textDocument/completion` call,
|
{result} The result of a `textDocument/completion` call,
|
||||||
e.g. from |vim.lsp.buf.completion()|, which may
|
e.g. from |vim.lsp.buf.completion()|, which may
|
||||||
be one of `CompletionItem[]`, `CompletionList`
|
be one of `CompletionItem[]` , `CompletionList`
|
||||||
or `null`
|
or `null`
|
||||||
{prefix} (string) the prefix to filter the completion
|
{prefix} (string) the prefix to filter the completion
|
||||||
items
|
items
|
||||||
|
@@ -17,48 +17,23 @@ an idea of what lurks beneath: >
|
|||||||
:lua print(vim.inspect(package.loaded))
|
:lua print(vim.inspect(package.loaded))
|
||||||
|
|
||||||
Nvim includes a "standard library" |lua-stdlib| for Lua. It complements the
|
Nvim includes a "standard library" |lua-stdlib| for Lua. It complements the
|
||||||
"editor stdlib" (|builtin-functions| and Ex commands) and the |API|, all of
|
"editor stdlib" (|functions| and Ex commands) and the |API|, all of which can
|
||||||
which can be used from Lua code. A good overview of using Lua in neovim is
|
be used from Lua code. A good overview of using Lua in neovim is given by
|
||||||
given by https://github.com/nanotee/nvim-lua-guide.
|
https://github.com/nanotee/nvim-lua-guide.
|
||||||
|
|
||||||
The |:source| and |:runtime| commands can run Lua scripts as well as Vim
|
Module conflicts are resolved by "last wins". For example if both of these
|
||||||
scripts. Lua modules can be loaded with `require('name')`, which
|
are on 'runtimepath':
|
||||||
conventionally returns a table but can return any value.
|
runtime/lua/foo.lua
|
||||||
|
~/.config/nvim/lua/foo.lua
|
||||||
See |lua-require| for details on how Nvim finds and loads Lua modules.
|
then `require('foo')` loads "~/.config/nvim/lua/foo.lua", and
|
||||||
See |lua-require-example| for an example of how to write and use a module.
|
"runtime/lua/foo.lua" is not used. See |lua-require| to understand how Nvim
|
||||||
|
finds and loads Lua modules. The conventions are similar to those of
|
||||||
|
Vimscript |plugin|s, with some extra features. See |lua-require-example| for
|
||||||
|
a walkthrough.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
IMPORTING LUA MODULES *lua-require*
|
IMPORTING LUA MODULES *lua-require*
|
||||||
|
|
||||||
Modules are searched for under the directories specified in 'runtimepath', in
|
|
||||||
the order they appear. Any `.` in the module name is treated as a directory
|
|
||||||
separator when searching. For a module `foo.bar`, each directory is searched
|
|
||||||
for `lua/foo/bar.lua`, then `lua/foo/bar/init.lua`. If no files are found,
|
|
||||||
the directories are searched again for a shared library with a name matching
|
|
||||||
`lua/foo/bar.?`, where `?` is a list of suffixes (such as `so` or `dll`)
|
|
||||||
derived from the initial value of `package.cpath`. If still no files are
|
|
||||||
found, Nvim falls back to Lua's default search mechanism. The first script
|
|
||||||
found is run and `require()` returns the value returned by the script if any,
|
|
||||||
else `true`.
|
|
||||||
|
|
||||||
The return value is cached after the first call to `require()` for each
|
|
||||||
module, with subsequent calls returning the cached value without searching for
|
|
||||||
or executing any script. For further details on `require()`, see the Lua
|
|
||||||
documentation at https://www.lua.org/manual/5.1/manual.html#pdf-require.
|
|
||||||
|
|
||||||
For example, if 'runtimepath' is `foo,bar` and `package.cpath` was
|
|
||||||
`./?.so;./?.dll` at startup, `require('mod')` searches these paths in order
|
|
||||||
and loads the first module found:
|
|
||||||
foo/lua/mod.lua
|
|
||||||
foo/lua/mod/init.lua
|
|
||||||
bar/lua/mod.lua
|
|
||||||
bar/lua/mod/init.lua
|
|
||||||
foo/lua/mod.so
|
|
||||||
foo/lua/mod.dll
|
|
||||||
bar/lua/mod.so
|
|
||||||
bar/lua/mod.dll
|
|
||||||
|
|
||||||
*lua-package-path*
|
*lua-package-path*
|
||||||
Nvim automatically adjusts `package.path` and `package.cpath` according to
|
Nvim automatically adjusts `package.path` and `package.cpath` according to
|
||||||
effective 'runtimepath' value. Adjustment happens whenever 'runtimepath' is
|
effective 'runtimepath' value. Adjustment happens whenever 'runtimepath' is
|
||||||
@@ -274,15 +249,13 @@ arguments separated by " " (space) instead of "\t" (tab).
|
|||||||
*:lua*
|
*:lua*
|
||||||
:[range]lua {chunk}
|
:[range]lua {chunk}
|
||||||
Executes Lua chunk {chunk}.
|
Executes Lua chunk {chunk}.
|
||||||
if {chunk} starts with "=" the rest of the chunk is
|
|
||||||
evaluated as an expression and printed. `:lua =expr`
|
|
||||||
is equivalent to `:lua print(vim.inspect(expr))`
|
|
||||||
Examples: >
|
Examples: >
|
||||||
:lua vim.api.nvim_command('echo "Hello, Nvim!"')
|
:lua vim.api.nvim_command('echo "Hello, Nvim!"')
|
||||||
< To see the Lua version: >
|
< To see the Lua version: >
|
||||||
:lua print(_VERSION)
|
:lua print(_VERSION)
|
||||||
< To see the LuaJIT version: >
|
< To see the LuaJIT version: >
|
||||||
:lua =jit.version
|
:lua print(jit.version)
|
||||||
<
|
<
|
||||||
*:lua-heredoc*
|
*:lua-heredoc*
|
||||||
:[range]lua << [endmarker]
|
:[range]lua << [endmarker]
|
||||||
@@ -299,7 +272,7 @@ arguments separated by " " (space) instead of "\t" (tab).
|
|||||||
lua << EOF
|
lua << EOF
|
||||||
local linenr = vim.api.nvim_win_get_cursor(0)[1]
|
local linenr = vim.api.nvim_win_get_cursor(0)[1]
|
||||||
local curline = vim.api.nvim_buf_get_lines(
|
local curline = vim.api.nvim_buf_get_lines(
|
||||||
0, linenr - 1, linenr, false)[1]
|
0, linenr, linenr + 1, false)[1]
|
||||||
print(string.format("Current line [%d] has %d bytes",
|
print(string.format("Current line [%d] has %d bytes",
|
||||||
linenr, #curline))
|
linenr, #curline))
|
||||||
EOF
|
EOF
|
||||||
@@ -593,26 +566,6 @@ Example: TCP echo-server *tcp-server*
|
|||||||
end)
|
end)
|
||||||
print('TCP echo-server listening on port: '..server:getsockname().port)
|
print('TCP echo-server listening on port: '..server:getsockname().port)
|
||||||
|
|
||||||
|
|
||||||
Multithreading *lua-loop-threading*
|
|
||||||
|
|
||||||
Plugins can perform work in separate (os-level) threads using the threading
|
|
||||||
APIs in luv, for instance `vim.loop.new_thread`. Note that every thread
|
|
||||||
gets its own separate lua interpreter state, with no access to lua globals
|
|
||||||
in the main thread. Neither can the state of the editor (buffers, windows,
|
|
||||||
etc) be directly accessed from threads.
|
|
||||||
|
|
||||||
A subset of the `vim.*` API is available in threads. This includes:
|
|
||||||
|
|
||||||
- `vim.loop` with a separate event loop per thread.
|
|
||||||
- `vim.mpack` and `vim.json` (useful for serializing messages between threads)
|
|
||||||
- `require` in threads can use lua packages from the global |lua-package-path|
|
|
||||||
- `print()` and `vim.inspect`
|
|
||||||
- `vim.diff`
|
|
||||||
- most utility functions in `vim.*` for working with pure lua values
|
|
||||||
like `vim.split`, `vim.tbl_*`, `vim.list_*`, and so on.
|
|
||||||
- `vim.is_thread()` returns true from a non-main thread.
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
VIM.HIGHLIGHT *lua-highlight*
|
VIM.HIGHLIGHT *lua-highlight*
|
||||||
|
|
||||||
@@ -640,33 +593,13 @@ vim.highlight.on_yank({opts}) *vim.highlight.on_yank()*
|
|||||||
- {on_visual} highlight when yanking visual selection (default `true`)
|
- {on_visual} highlight when yanking visual selection (default `true`)
|
||||||
- {event} event structure (default |v:event|)
|
- {event} event structure (default |v:event|)
|
||||||
|
|
||||||
vim.highlight.range({bufnr}, {ns}, {hlgroup}, {start}, {finish}, {opts})
|
vim.highlight.range({bufnr}, {ns}, {higroup}, {start}, {finish}, {rtype}, {inclusive})
|
||||||
*vim.highlight.range()*
|
*vim.highlight.range()*
|
||||||
|
Highlights the range between {start} and {finish} (tuples of {line,col})
|
||||||
Apply highlight group to range of text.
|
in buffer {bufnr} with the highlight group {higroup} using the namespace
|
||||||
|
{ns}. Optional arguments are the type of range (characterwise, linewise,
|
||||||
Parameters: ~
|
or blockwise, see |setreg|; default to characterwise) and whether the
|
||||||
{bufnr} buffer number
|
range is inclusive (default false).
|
||||||
{ns} namespace for highlights
|
|
||||||
{hlgroup} highlight group name
|
|
||||||
{start} starting position (tuple {line,col})
|
|
||||||
{finish} finish position (tuple {line,col})
|
|
||||||
{opts} optional parameters:
|
|
||||||
• `regtype`: type of range (characterwise, linewise,
|
|
||||||
or blockwise, see |setreg|), default `'v'`
|
|
||||||
• `inclusive`: range includes end position, default
|
|
||||||
`false`
|
|
||||||
• `priority`: priority of highlight, default
|
|
||||||
`vim.highlight.user` (see below)
|
|
||||||
|
|
||||||
vim.highlight.priorities *vim.highlight.priorities*
|
|
||||||
|
|
||||||
Table with default priorities used for highlighting:
|
|
||||||
• `syntax`: `50`, used for standard syntax highlighting
|
|
||||||
• `treesitter`: `100`, used for tree-sitter-based highlighting
|
|
||||||
• `diagnostics`: `150`, used for code analysis such as diagnostics
|
|
||||||
• `user`: `200`, used for user-triggered highlights such as LSP
|
|
||||||
document symbols or `on_yank` autocommands
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
VIM.REGEX *lua-regex*
|
VIM.REGEX *lua-regex*
|
||||||
@@ -774,38 +707,6 @@ vim.mpack.encode({obj}) *vim.mpack.encode*
|
|||||||
vim.mpack.decode({str}) *vim.mpack.decode*
|
vim.mpack.decode({str}) *vim.mpack.decode*
|
||||||
Decodes (or "unpacks") the msgpack-encoded {str} to a Lua object.
|
Decodes (or "unpacks") the msgpack-encoded {str} to a Lua object.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
VIM.SPELL *lua-spell*
|
|
||||||
|
|
||||||
vim.spell.check({str}) *vim.spell.check()*
|
|
||||||
Check {str} for spelling errors. Similar to the Vimscript function
|
|
||||||
|spellbadword()|.
|
|
||||||
|
|
||||||
Note: The behaviour of this function is dependent on: 'spelllang',
|
|
||||||
'spellfile', 'spellcapcheck' and 'spelloptions' which can all be local
|
|
||||||
to the buffer. Consider calling this with |nvim_buf_call()|.
|
|
||||||
|
|
||||||
Example: >
|
|
||||||
vim.spell.check("the quik brown fox")
|
|
||||||
-->
|
|
||||||
{
|
|
||||||
{'quik', 'bad', 4}
|
|
||||||
}
|
|
||||||
<
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{str} String to spell check.
|
|
||||||
|
|
||||||
Return: ~
|
|
||||||
List of tuples with three items:
|
|
||||||
- The badly spelled word.
|
|
||||||
- The type of the spelling error:
|
|
||||||
"bad" spelling mistake
|
|
||||||
"rare" rare word
|
|
||||||
"local" word only valid in another region
|
|
||||||
"caps" word should start with Capital
|
|
||||||
- The position in {str} where the word begins.
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
VIM *lua-builtin*
|
VIM *lua-builtin*
|
||||||
|
|
||||||
@@ -1108,7 +1009,7 @@ from within Lua.
|
|||||||
`vim.opt.wildignore = '*.o,*.a,__pycache__'`
|
`vim.opt.wildignore = '*.o,*.a,__pycache__'`
|
||||||
|
|
||||||
However, vim.opt also supports a more elegent way of setting
|
However, vim.opt also supports a more elegent way of setting
|
||||||
list-style options by using lua tables:
|
list-style options, but using lua tables:
|
||||||
`vim.opt.wildignore = { '*.o', '*.a', '__pycache__' }`
|
`vim.opt.wildignore = { '*.o', '*.a', '__pycache__' }`
|
||||||
|
|
||||||
To replicate the behavior of |:set+=|, use: >
|
To replicate the behavior of |:set+=|, use: >
|
||||||
@@ -1151,7 +1052,7 @@ In any of the above examples, to replicate the behavior |setlocal|, use
|
|||||||
|
|
||||||
|vim.opt| returns an Option object.
|
|vim.opt| returns an Option object.
|
||||||
|
|
||||||
For example: `local listchar_object = vim.opt.listchars`
|
For example: `local listchar_object = vim.opt.listchar`
|
||||||
|
|
||||||
An `Option` has the following methods:
|
An `Option` has the following methods:
|
||||||
|
|
||||||
@@ -1284,10 +1185,6 @@ vim.wo *vim.wo*
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
Lua module: vim *lua-vim*
|
Lua module: vim *lua-vim*
|
||||||
|
|
||||||
*vim.connection_failure_errmsg()*
|
|
||||||
connection_failure_errmsg({consequence})
|
|
||||||
TODO: Documentation
|
|
||||||
|
|
||||||
defer_fn({fn}, {timeout}) *vim.defer_fn()*
|
defer_fn({fn}, {timeout}) *vim.defer_fn()*
|
||||||
Defers calling `fn` until `timeout` ms passes.
|
Defers calling `fn` until `timeout` ms passes.
|
||||||
|
|
||||||
@@ -1398,18 +1295,6 @@ paste({lines}, {phase}) *vim.paste()*
|
|||||||
See also: ~
|
See also: ~
|
||||||
|paste|
|
|paste|
|
||||||
|
|
||||||
pretty_print({...}) *vim.pretty_print()*
|
|
||||||
Prints given arguments in human-readable format. Example: >
|
|
||||||
-- Print highlight group Normal and store it's contents in a variable.
|
|
||||||
local hl_normal = vim.pretty_print(vim.api.nvim_get_hl_by_name("Normal", true))
|
|
||||||
<
|
|
||||||
|
|
||||||
Return: ~
|
|
||||||
given arguments.
|
|
||||||
|
|
||||||
See also: ~
|
|
||||||
|vim.inspect()|
|
|
||||||
|
|
||||||
region({bufnr}, {pos1}, {pos2}, {regtype}, {inclusive}) *vim.region()*
|
region({bufnr}, {pos1}, {pos2}, {regtype}, {inclusive}) *vim.region()*
|
||||||
Get a table of lines with start, end columns for a region
|
Get a table of lines with start, end columns for a region
|
||||||
marked by two points
|
marked by two points
|
||||||
@@ -1447,7 +1332,7 @@ deep_equal({a}, {b}) *vim.deep_equal()*
|
|||||||
{b} second value
|
{b} second value
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
`true` if values are equals, else `false`.
|
`true` if values are equals, else `false` .
|
||||||
|
|
||||||
deepcopy({orig}) *vim.deepcopy()*
|
deepcopy({orig}) *vim.deepcopy()*
|
||||||
Returns a deep copy of the given object. Non-table objects are
|
Returns a deep copy of the given object. Non-table objects are
|
||||||
@@ -1464,7 +1349,7 @@ deepcopy({orig}) *vim.deepcopy()*
|
|||||||
New table of copied keys and (nested) values.
|
New table of copied keys and (nested) values.
|
||||||
|
|
||||||
endswith({s}, {suffix}) *vim.endswith()*
|
endswith({s}, {suffix}) *vim.endswith()*
|
||||||
Tests if `s` ends with `suffix`.
|
Tests if `s` ends with `suffix` .
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{s} (string) a string
|
{s} (string) a string
|
||||||
@@ -1568,7 +1453,7 @@ split({s}, {sep}, {kwargs}) *vim.split()*
|
|||||||
|vim.gsplit()|
|
|vim.gsplit()|
|
||||||
|
|
||||||
startswith({s}, {prefix}) *vim.startswith()*
|
startswith({s}, {prefix}) *vim.startswith()*
|
||||||
Tests if `s` starts with `prefix`.
|
Tests if `s` starts with `prefix` .
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{s} (string) a string
|
{s} (string) a string
|
||||||
@@ -1579,13 +1464,13 @@ startswith({s}, {prefix}) *vim.startswith()*
|
|||||||
|
|
||||||
tbl_add_reverse_lookup({o}) *vim.tbl_add_reverse_lookup()*
|
tbl_add_reverse_lookup({o}) *vim.tbl_add_reverse_lookup()*
|
||||||
Add the reverse lookup values to an existing table. For
|
Add the reverse lookup values to an existing table. For
|
||||||
example: `tbl_add_reverse_lookup { A = 1 } == { [1] = 'A', A = 1 }`
|
example: tbl_add_reverse_lookup { A = 1 } == { [1] = 'A , A = 1 }`
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{o} table The table to add the reverse to.
|
{o} table The table to add the reverse to.
|
||||||
|
|
||||||
tbl_contains({t}, {value}) *vim.tbl_contains()*
|
tbl_contains({t}, {value}) *vim.tbl_contains()*
|
||||||
Checks if a list-like (vector) table contains `value`.
|
Checks if a list-like (vector) table contains `value` .
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{t} Table to check
|
{t} Table to check
|
||||||
@@ -1595,7 +1480,7 @@ tbl_contains({t}, {value}) *vim.tbl_contains()*
|
|||||||
true if `t` contains `value`
|
true if `t` contains `value`
|
||||||
|
|
||||||
tbl_count({t}) *vim.tbl_count()*
|
tbl_count({t}) *vim.tbl_count()*
|
||||||
Counts the number of non-nil values in table `t`.
|
Counts the number of non-nil values in table `t` .
|
||||||
>
|
>
|
||||||
|
|
||||||
vim.tbl_count({ a=1, b=2 }) => 2
|
vim.tbl_count({ a=1, b=2 }) => 2
|
||||||
@@ -1659,22 +1544,6 @@ tbl_flatten({t}) *vim.tbl_flatten()*
|
|||||||
See also: ~
|
See also: ~
|
||||||
From https://github.com/premake/premake-core/blob/master/src/base/table.lua
|
From https://github.com/premake/premake-core/blob/master/src/base/table.lua
|
||||||
|
|
||||||
tbl_get({o}, {...}) *vim.tbl_get()*
|
|
||||||
Index into a table (first argument) via string keys passed as
|
|
||||||
subsequent arguments. Return `nil` if the key does not exist. Examples: >
|
|
||||||
|
|
||||||
vim.tbl_get({ key = { nested_key = true }}, 'key', 'nested_key') == true
|
|
||||||
vim.tbl_get({ key = {}}, 'key', 'nested_key') == nil
|
|
||||||
<
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{o} Table to index
|
|
||||||
{...} Optional strings (0 or more, variadic) via which to
|
|
||||||
index the table
|
|
||||||
|
|
||||||
Return: ~
|
|
||||||
nested value indexed by key if it exists, else nil
|
|
||||||
|
|
||||||
tbl_isempty({t}) *vim.tbl_isempty()*
|
tbl_isempty({t}) *vim.tbl_isempty()*
|
||||||
Checks if a table is empty.
|
Checks if a table is empty.
|
||||||
|
|
||||||
@@ -1696,7 +1565,7 @@ tbl_islist({t}) *vim.tbl_islist()*
|
|||||||
{t} Table
|
{t} Table
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
`true` if array-like table, else `false`.
|
`true` if array-like table, else `false` .
|
||||||
|
|
||||||
tbl_keys({t}) *vim.tbl_keys()*
|
tbl_keys({t}) *vim.tbl_keys()*
|
||||||
Return a list of all keys used in a table. However, the order
|
Return a list of all keys used in a table. However, the order
|
||||||
@@ -1768,25 +1637,16 @@ validate({opt}) *vim.validate()*
|
|||||||
=> error('arg1: expected even number, got 3')
|
=> error('arg1: expected even number, got 3')
|
||||||
<
|
<
|
||||||
|
|
||||||
If multiple types are valid they can be given as a list. >
|
|
||||||
|
|
||||||
vim.validate{arg1={{'foo'}, {'table', 'string'}}, arg2={'foo', {'table', 'string'}}}
|
|
||||||
=> NOP (success)
|
|
||||||
|
|
||||||
vim.validate{arg1={1, {'string', table'}}}
|
|
||||||
=> error('arg1: expected string|table, got number')
|
|
||||||
<
|
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{opt} table of parameter names to validations. Each key
|
{opt} Map of parameter names to validations. Each key is
|
||||||
is a parameter name; each value is a tuple in one
|
a parameter name; each value is a tuple in one of
|
||||||
of these forms:
|
these forms:
|
||||||
1. (arg_value, type_name, optional)
|
1. (arg_value, type_name, optional)
|
||||||
• arg_value: argument value
|
• arg_value: argument value
|
||||||
• type_name: string|table type name, one of:
|
• type_name: string type name, one of: ("table",
|
||||||
("table", "t", "string", "s", "number", "n",
|
"t", "string", "s", "number", "n", "boolean",
|
||||||
"boolean", "b", "function", "f", "nil",
|
"b", "function", "f", "nil", "thread",
|
||||||
"thread", "userdata") or list of them.
|
"userdata")
|
||||||
• optional: (optional) boolean, if true, `nil`
|
• optional: (optional) boolean, if true, `nil`
|
||||||
is valid
|
is valid
|
||||||
|
|
||||||
@@ -1848,17 +1708,10 @@ Lua module: ui *lua-ui*
|
|||||||
input({opts}, {on_confirm}) *vim.ui.input()*
|
input({opts}, {on_confirm}) *vim.ui.input()*
|
||||||
Prompts the user for input
|
Prompts the user for input
|
||||||
|
|
||||||
Example: >
|
|
||||||
|
|
||||||
vim.ui.input({ prompt = 'Enter value for shiftwidth: ' }, function(input)
|
|
||||||
vim.o.shiftwidth = tonumber(input)
|
|
||||||
end)
|
|
||||||
<
|
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{opts} table Additional options. See |input()|
|
{opts} table Additional options. See |input()|
|
||||||
• prompt (string|nil) Text of the prompt.
|
• prompt (string|nil) Text of the prompt.
|
||||||
Defaults to `Input:`.
|
Defaults to `Input:` .
|
||||||
• default (string|nil) Default reply to the
|
• default (string|nil) Default reply to the
|
||||||
input
|
input
|
||||||
• completion (string|nil) Specifies type of
|
• completion (string|nil) Specifies type of
|
||||||
@@ -1878,22 +1731,6 @@ select({items}, {opts}, {on_choice}) *vim.ui.select()*
|
|||||||
Prompts the user to pick a single item from a collection of
|
Prompts the user to pick a single item from a collection of
|
||||||
entries
|
entries
|
||||||
|
|
||||||
Example: >
|
|
||||||
|
|
||||||
vim.ui.select({ 'tabs', 'spaces' }, {
|
|
||||||
prompt = 'Select tabs or spaces:',
|
|
||||||
format_item = function(item)
|
|
||||||
return "I'd like to choose " .. item
|
|
||||||
end,
|
|
||||||
}, function(choice)
|
|
||||||
if choice == 'spaces' then
|
|
||||||
vim.o.expandtab = true
|
|
||||||
else
|
|
||||||
vim.o.expandtab = false
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
<
|
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{items} table Arbitrary items
|
{items} table Arbitrary items
|
||||||
{opts} table Additional options
|
{opts} table Additional options
|
||||||
@@ -1901,169 +1738,16 @@ select({items}, {opts}, {on_choice}) *vim.ui.select()*
|
|||||||
Defaults to `Select one of:`
|
Defaults to `Select one of:`
|
||||||
• format_item (function item -> text)
|
• format_item (function item -> text)
|
||||||
Function to format an individual item from
|
Function to format an individual item from
|
||||||
`items`. Defaults to `tostring`.
|
`items` . Defaults to `tostring` .
|
||||||
• kind (string|nil) Arbitrary hint string
|
• kind (string|nil) Arbitrary hint string
|
||||||
indicating the item shape. Plugins
|
indicating the item shape. Plugins
|
||||||
reimplementing `vim.ui.select` may wish to
|
reimplementing `vim.ui.select` may wish to
|
||||||
use this to infer the structure or
|
use this to infer the structure or
|
||||||
semantics of `items`, or the context in
|
semantics of `items` , or the context in
|
||||||
which select() was called.
|
which select() was called.
|
||||||
{on_choice} function ((item|nil, idx|nil) -> ()) Called
|
{on_choice} function ((item|nil, idx|nil) -> ()) Called
|
||||||
once the user made a choice. `idx` is the
|
once the user made a choice. `idx` is the
|
||||||
1-based index of `item` within `items`. `nil`
|
1-based index of `item` within `item` . `nil`
|
||||||
if the user aborted the dialog.
|
if the user aborted the dialog.
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
Lua module: filetype *lua-filetype*
|
|
||||||
|
|
||||||
add({filetypes}) *vim.filetype.add()*
|
|
||||||
Add new filetype mappings.
|
|
||||||
|
|
||||||
Filetype mappings can be added either by extension or by
|
|
||||||
filename (either the "tail" or the full file path). The full
|
|
||||||
file path is checked first, followed by the file name. If a
|
|
||||||
match is not found using the filename, then the filename is
|
|
||||||
matched against the list of patterns (sorted by priority)
|
|
||||||
until a match is found. Lastly, if pattern matching does not
|
|
||||||
find a filetype, then the file extension is used.
|
|
||||||
|
|
||||||
The filetype can be either a string (in which case it is used
|
|
||||||
as the filetype directly) or a function. If a function, it
|
|
||||||
takes the full path and buffer number of the file as arguments
|
|
||||||
(along with captures from the matched pattern, if any) and
|
|
||||||
should return a string that will be used as the buffer's
|
|
||||||
filetype.
|
|
||||||
|
|
||||||
Filename patterns can specify an optional priority to resolve
|
|
||||||
cases when a file path matches multiple patterns. Higher
|
|
||||||
priorities are matched first. When omitted, the priority
|
|
||||||
defaults to 0.
|
|
||||||
|
|
||||||
See $VIMRUNTIME/lua/vim/filetype.lua for more examples.
|
|
||||||
|
|
||||||
Note that Lua filetype detection is only enabled when
|
|
||||||
|g:do_filetype_lua| is set to 1.
|
|
||||||
|
|
||||||
Example: >
|
|
||||||
|
|
||||||
vim.filetype.add({
|
|
||||||
extension = {
|
|
||||||
foo = "fooscript",
|
|
||||||
bar = function(path, bufnr)
|
|
||||||
if some_condition() then
|
|
||||||
return "barscript"
|
|
||||||
end
|
|
||||||
return "bar"
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
filename = {
|
|
||||||
[".foorc"] = "toml",
|
|
||||||
["/etc/foo/config"] = "toml",
|
|
||||||
},
|
|
||||||
pattern = {
|
|
||||||
[".*‍/etc/foo/.*"] = "fooscript",
|
|
||||||
-- Using an optional priority
|
|
||||||
[".*‍/etc/foo/.*%.conf"] = { "dosini", { priority = 10 } },
|
|
||||||
["README.(%a+)$"] = function(path, bufnr, ext)
|
|
||||||
if ext == "md" then
|
|
||||||
return "markdown"
|
|
||||||
elseif ext == "rst" then
|
|
||||||
return "rst"
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
<
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{filetypes} table A table containing new filetype maps
|
|
||||||
(see example).
|
|
||||||
|
|
||||||
match({name}, {bufnr}) *vim.filetype.match()*
|
|
||||||
Set the filetype for the given buffer from a file name.
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{name} string File name (can be an absolute or relative
|
|
||||||
path)
|
|
||||||
{bufnr} number|nil The buffer to set the filetype for.
|
|
||||||
Defaults to the current buffer.
|
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
Lua module: keymap *lua-keymap*
|
|
||||||
|
|
||||||
del({modes}, {lhs}, {opts}) *vim.keymap.del()*
|
|
||||||
Remove an existing mapping. Examples: >
|
|
||||||
|
|
||||||
vim.keymap.del('n', 'lhs')
|
|
||||||
|
|
||||||
vim.keymap.del({'n', 'i', 'v'}, '<leader>w', { buffer = 5 })
|
|
||||||
<
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{opts} table A table of optional arguments:
|
|
||||||
• buffer: (number or boolean) Remove a mapping
|
|
||||||
from the given buffer. When "true" or 0, use the
|
|
||||||
current buffer.
|
|
||||||
|
|
||||||
See also: ~
|
|
||||||
|vim.keymap.set()|
|
|
||||||
|
|
||||||
set({mode}, {lhs}, {rhs}, {opts}) *vim.keymap.set()*
|
|
||||||
Add a new |mapping|. Examples: >
|
|
||||||
|
|
||||||
-- Can add mapping to Lua functions
|
|
||||||
vim.keymap.set('n', 'lhs', function() print("real lua function") end)
|
|
||||||
|
|
||||||
-- Can use it to map multiple modes
|
|
||||||
vim.keymap.set({'n', 'v'}, '<leader>lr', vim.lsp.buf.references, { buffer=true })
|
|
||||||
|
|
||||||
-- Can add mapping for specific buffer
|
|
||||||
vim.keymap.set('n', '<leader>w', "<cmd>w<cr>", { silent = true, buffer = 5 })
|
|
||||||
|
|
||||||
-- Expr mappings
|
|
||||||
vim.keymap.set('i', '<Tab>', function()
|
|
||||||
return vim.fn.pumvisible() == 1 and "<C-n>" or "<Tab>"
|
|
||||||
end, { expr = true })
|
|
||||||
-- <Plug> mappings
|
|
||||||
vim.keymap.set('n', '[%', '<Plug>(MatchitNormalMultiBackward)')
|
|
||||||
<
|
|
||||||
|
|
||||||
Note that in a mapping like: >
|
|
||||||
|
|
||||||
vim.keymap.set('n', 'asdf', require('jkl').my_fun)
|
|
||||||
<
|
|
||||||
|
|
||||||
the `require('jkl')` gets evaluated during this call in order to access the
|
|
||||||
function. If you want to avoid this cost at startup you can
|
|
||||||
wrap it in a function, for example: >
|
|
||||||
|
|
||||||
vim.keymap.set('n', 'asdf', function() return require('jkl').my_fun() end)
|
|
||||||
<
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
{mode} string|table Same mode short names as
|
|
||||||
|nvim_set_keymap()|. Can also be list of modes to
|
|
||||||
create mapping on multiple modes.
|
|
||||||
{lhs} string Left-hand side |{lhs}| of the mapping.
|
|
||||||
{rhs} string|function Right-hand side |{rhs}| of the
|
|
||||||
mapping. Can also be a Lua function. If a Lua
|
|
||||||
function and `opts.expr == true`, returning `nil`
|
|
||||||
is equivalent to an empty string.
|
|
||||||
{opts} table A table of |:map-arguments| such as
|
|
||||||
"silent". In addition to the options listed in
|
|
||||||
|nvim_set_keymap()|, this table also accepts the
|
|
||||||
following keys:
|
|
||||||
• replace_keycodes: (boolean, default true) When
|
|
||||||
both this and expr is "true",
|
|
||||||
|nvim_replace_termcodes()| is applied to the
|
|
||||||
result of Lua expr maps.
|
|
||||||
• remap: (boolean) Make the mapping recursive.
|
|
||||||
This is the inverse of the "noremap" option from
|
|
||||||
|nvim_set_keymap()|. Default `false`.
|
|
||||||
|
|
||||||
See also: ~
|
|
||||||
|nvim_set_keymap()|
|
|
||||||
|
|
||||||
vim:tw=78:ts=8:ft=help:norl:
|
vim:tw=78:ts=8:ft=help:norl:
|
||||||
|
@@ -65,8 +65,6 @@ modes.
|
|||||||
where the map command applies. Disallow mapping of
|
where the map command applies. Disallow mapping of
|
||||||
{rhs}, to avoid nested and recursive mappings. Often
|
{rhs}, to avoid nested and recursive mappings. Often
|
||||||
used to redefine a command.
|
used to redefine a command.
|
||||||
Note: When <Plug> appears in the {rhs} this part is
|
|
||||||
always applied even if remapping is disallowed.
|
|
||||||
|
|
||||||
|
|
||||||
:unm[ap] {lhs} |mapmode-nvo| *:unm* *:unmap*
|
:unm[ap] {lhs} |mapmode-nvo| *:unm* *:unmap*
|
||||||
@@ -84,7 +82,8 @@ modes.
|
|||||||
map command applies. The mapping may remain defined
|
map command applies. The mapping may remain defined
|
||||||
for other modes where it applies.
|
for other modes where it applies.
|
||||||
It also works when {lhs} matches the {rhs} of a
|
It also works when {lhs} matches the {rhs} of a
|
||||||
mapping. This is for when an abbreviation applied.
|
mapping. This is for when when an abbreviation
|
||||||
|
applied.
|
||||||
Note: Trailing spaces are included in the {lhs}. This
|
Note: Trailing spaces are included in the {lhs}. This
|
||||||
unmap does NOT work: >
|
unmap does NOT work: >
|
||||||
:map @@ foo
|
:map @@ foo
|
||||||
@@ -159,7 +158,7 @@ type "a", then "bar" will get inserted.
|
|||||||
"<unique>" can be used in any order. They must appear right after the
|
"<unique>" can be used in any order. They must appear right after the
|
||||||
command, before any other arguments.
|
command, before any other arguments.
|
||||||
|
|
||||||
*:map-local* *:map-<buffer>* *:map-buffer* *E224* *E225*
|
*:map-local* *:map-<buffer>* *E224* *E225*
|
||||||
If the first argument to one of these commands is "<buffer>" the mapping will
|
If the first argument to one of these commands is "<buffer>" the mapping will
|
||||||
be effective in the current buffer only. Example: >
|
be effective in the current buffer only. Example: >
|
||||||
:map <buffer> ,w /[.,;]<CR>
|
:map <buffer> ,w /[.,;]<CR>
|
||||||
@@ -212,7 +211,7 @@ Note: ":map <script>" and ":noremap <script>" do the same thing. The
|
|||||||
"<script>" overrules the command name. Using ":noremap <script>" is
|
"<script>" overrules the command name. Using ":noremap <script>" is
|
||||||
preferred, because it's clearer that remapping is (mostly) disabled.
|
preferred, because it's clearer that remapping is (mostly) disabled.
|
||||||
|
|
||||||
*:map-<unique>* *:map-unique* *E226* *E227*
|
*:map-<unique>* *E226* *E227*
|
||||||
If the first argument to one of these commands is "<unique>" and it is used to
|
If the first argument to one of these commands is "<unique>" and it is used to
|
||||||
define a new mapping or abbreviation, the command will fail if the mapping or
|
define a new mapping or abbreviation, the command will fail if the mapping or
|
||||||
abbreviation already exists. Example: >
|
abbreviation already exists. Example: >
|
||||||
@@ -246,7 +245,7 @@ go through the main loop (e.g. to update the display), return "\<Ignore>".
|
|||||||
This is similar to "nothing" but makes Vim return from the loop that waits for
|
This is similar to "nothing" but makes Vim return from the loop that waits for
|
||||||
input.
|
input.
|
||||||
|
|
||||||
Keep in mind that the expression may be evaluated when looking for
|
Also, keep in mind that the expression may be evaluated when looking for
|
||||||
typeahead, before the previous command has been executed. For example: >
|
typeahead, before the previous command has been executed. For example: >
|
||||||
func StoreColumn()
|
func StoreColumn()
|
||||||
let g:column = col('.')
|
let g:column = col('.')
|
||||||
@@ -287,7 +286,7 @@ Here is an example that inserts a list number that increases: >
|
|||||||
|
|
||||||
func ListItem()
|
func ListItem()
|
||||||
let g:counter += 1
|
let g:counter += 1
|
||||||
return g:counter .. '. '
|
return g:counter . '. '
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func ListReset()
|
func ListReset()
|
||||||
@@ -504,9 +503,7 @@ Note: When using mappings for Visual mode, you can use the "'<" mark, which
|
|||||||
is the start of the last selected Visual area in the current buffer |'<|.
|
is the start of the last selected Visual area in the current buffer |'<|.
|
||||||
|
|
||||||
The |:filter| command can be used to select what mappings to list. The
|
The |:filter| command can be used to select what mappings to list. The
|
||||||
pattern is matched against the {lhs} and {rhs} in the raw form. If a
|
pattern is matched against the {lhs} and {rhs} in the raw form.
|
||||||
description was added using |nvim_set_keymap()| or |nvim_buf_set_keymap()|
|
|
||||||
then the pattern is also matched against it.
|
|
||||||
|
|
||||||
*:map-verbose*
|
*:map-verbose*
|
||||||
When 'verbose' is non-zero, listing a key map will also display where it was
|
When 'verbose' is non-zero, listing a key map will also display where it was
|
||||||
@@ -840,7 +837,8 @@ g@{motion} Call the function set by the 'operatorfunc' option.
|
|||||||
"line" {motion} was |linewise|
|
"line" {motion} was |linewise|
|
||||||
"char" {motion} was |charwise|
|
"char" {motion} was |charwise|
|
||||||
"block" {motion} was |blockwise-visual|
|
"block" {motion} was |blockwise-visual|
|
||||||
The type can be forced, see |forced-motion|.
|
Although "block" would rarely appear, since it can
|
||||||
|
only result from Visual mode where "g@" is not useful.
|
||||||
|
|
||||||
Here is an example that counts the number of spaces with <F4>: >
|
Here is an example that counts the number of spaces with <F4>: >
|
||||||
|
|
||||||
@@ -1221,7 +1219,7 @@ scripts.
|
|||||||
|
|
||||||
*:command-verbose*
|
*:command-verbose*
|
||||||
When 'verbose' is non-zero, listing a command will also display where it was
|
When 'verbose' is non-zero, listing a command will also display where it was
|
||||||
last defined and any completion argument. Example: >
|
last defined. Example: >
|
||||||
|
|
||||||
:verbose command TOhtml
|
:verbose command TOhtml
|
||||||
< Name Args Range Complete Definition ~
|
< Name Args Range Complete Definition ~
|
||||||
@@ -1245,17 +1243,13 @@ See |:verbose-cmd| for more information.
|
|||||||
:delc[ommand] {cmd} *:delc* *:delcommand* *E184*
|
:delc[ommand] {cmd} *:delc* *:delcommand* *E184*
|
||||||
Delete the user-defined command {cmd}.
|
Delete the user-defined command {cmd}.
|
||||||
|
|
||||||
:delc[ommand] -buffer {cmd} *E1237*
|
|
||||||
Delete the user-defined command {cmd} that was defined
|
|
||||||
for the current buffer.
|
|
||||||
|
|
||||||
:comc[lear] *:comc* *:comclear*
|
:comc[lear] *:comc* *:comclear*
|
||||||
Delete all user-defined commands.
|
Delete all user-defined commands.
|
||||||
|
|
||||||
|
|
||||||
Command attributes ~
|
Command attributes ~
|
||||||
*command-attributes*
|
|
||||||
User-defined commands are treated by Nvim just like any other Ex commands. They
|
User-defined commands are treated by Vim just like any other Ex commands. They
|
||||||
can have arguments, or have a range specified. Arguments are subject to
|
can have arguments, or have a range specified. Arguments are subject to
|
||||||
completion as filenames, buffers, etc. Exactly how this works depends upon the
|
completion as filenames, buffers, etc. Exactly how this works depends upon the
|
||||||
command's attributes, which are specified when the command is defined.
|
command's attributes, which are specified when the command is defined.
|
||||||
@@ -1340,8 +1334,6 @@ completion can be enabled:
|
|||||||
-complete=custom,{func} custom completion, defined via {func}
|
-complete=custom,{func} custom completion, defined via {func}
|
||||||
-complete=customlist,{func} custom completion, defined via {func}
|
-complete=customlist,{func} custom completion, defined via {func}
|
||||||
|
|
||||||
If you specify completion while there is nothing to complete (-nargs=0, the
|
|
||||||
default) then you get error *E1208* .
|
|
||||||
Note: That some completion methods might expand environment variables.
|
Note: That some completion methods might expand environment variables.
|
||||||
|
|
||||||
|
|
||||||
@@ -1444,9 +1436,6 @@ There are some special cases as well:
|
|||||||
-register The first argument to the command can be an optional
|
-register The first argument to the command can be an optional
|
||||||
register name (like :del, :put, :yank).
|
register name (like :del, :put, :yank).
|
||||||
-buffer The command will only be available in the current buffer.
|
-buffer The command will only be available in the current buffer.
|
||||||
-keepscript Do not use the location of where the user command was
|
|
||||||
defined for verbose messages, use the location of where
|
|
||||||
the user command was invoked.
|
|
||||||
|
|
||||||
In the cases of the -count and -register attributes, if the optional argument
|
In the cases of the -count and -register attributes, if the optional argument
|
||||||
is supplied, it is removed from the argument list and is available to the
|
is supplied, it is removed from the argument list and is available to the
|
||||||
@@ -1491,12 +1480,12 @@ The valid escape sequences are
|
|||||||
Examples: >
|
Examples: >
|
||||||
command! -nargs=+ -complete=file MyEdit
|
command! -nargs=+ -complete=file MyEdit
|
||||||
\ for f in expand(<q-args>, 0, 1) |
|
\ for f in expand(<q-args>, 0, 1) |
|
||||||
\ exe '<mods> split ' .. f |
|
\ exe '<mods> split ' . f |
|
||||||
\ endfor
|
\ endfor
|
||||||
|
|
||||||
function! SpecialEdit(files, mods)
|
function! SpecialEdit(files, mods)
|
||||||
for f in expand(a:files, 0, 1)
|
for f in expand(a:files, 0, 1)
|
||||||
exe a:mods .. ' split ' .. f
|
exe a:mods . ' split ' . f
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
command! -nargs=+ -complete=file Sedit
|
command! -nargs=+ -complete=file Sedit
|
||||||
@@ -1572,7 +1561,7 @@ This will invoke: >
|
|||||||
: let i = 0
|
: let i = 0
|
||||||
: while i < argc()
|
: while i < argc()
|
||||||
: if filereadable(argv(i))
|
: if filereadable(argv(i))
|
||||||
: execute "e " .. argv(i)
|
: execute "e " . argv(i)
|
||||||
: execute a:command
|
: execute a:command
|
||||||
: endif
|
: endif
|
||||||
: let i = i + 1
|
: let i = i + 1
|
||||||
|
@@ -489,8 +489,8 @@ Use the RPM or port for your system.
|
|||||||
window specific to the input method.
|
window specific to the input method.
|
||||||
|
|
||||||
|
|
||||||
USING XIM *multibyte-input* *E284* *E285* *E286* *E287*
|
USING XIM *multibyte-input* *E284* *E286* *E287* *E288*
|
||||||
*E288* *E289*
|
*E285* *E289*
|
||||||
|
|
||||||
Note that Display and Input are independent. It is possible to see your
|
Note that Display and Input are independent. It is possible to see your
|
||||||
language even though you have no input method for it. But when your Display
|
language even though you have no input method for it. But when your Display
|
||||||
|
@@ -27,7 +27,8 @@ depends on the 'shortmess' option.
|
|||||||
Clear messages, keeping only the {count} most
|
Clear messages, keeping only the {count} most
|
||||||
recent ones.
|
recent ones.
|
||||||
|
|
||||||
The number of remembered messages is fixed at 200.
|
The number of remembered messages is fixed at 20 for the tiny version and 200
|
||||||
|
for other versions.
|
||||||
|
|
||||||
*g<*
|
*g<*
|
||||||
The "g<" command can be used to see the last page of previous command output.
|
The "g<" command can be used to see the last page of previous command output.
|
||||||
@@ -61,7 +62,7 @@ If you are lazy, it also works without the shift key: >
|
|||||||
|
|
||||||
When an error message is displayed, but it is removed before you could read
|
When an error message is displayed, but it is removed before you could read
|
||||||
it, you can see it again with: >
|
it, you can see it again with: >
|
||||||
:echo v:errmsg
|
:echo errmsg
|
||||||
Or view a list of recent messages with: >
|
Or view a list of recent messages with: >
|
||||||
:messages
|
:messages
|
||||||
See `:messages` above.
|
See `:messages` above.
|
||||||
@@ -111,8 +112,7 @@ wiped out a buffer which contains a mark or is referenced in another way.
|
|||||||
*E95* >
|
*E95* >
|
||||||
Buffer with this name already exists
|
Buffer with this name already exists
|
||||||
|
|
||||||
You cannot have two buffers with exactly the same name. This includes the
|
You cannot have two buffers with the same name.
|
||||||
path leading to the file.
|
|
||||||
|
|
||||||
*E72* >
|
*E72* >
|
||||||
Close error on swap file
|
Close error on swap file
|
||||||
@@ -513,10 +513,10 @@ If you type "gq", it will execute this mapping, which will call "gq" again.
|
|||||||
*E22* >
|
*E22* >
|
||||||
Scripts nested too deep
|
Scripts nested too deep
|
||||||
|
|
||||||
Scripts can be read with the "-s" command-line argument and with the
|
Scripts can be read with the "-s" command-line argument and with the ":source"
|
||||||
`:source!` command. The script can then again read another script. This can
|
command. The script can then again read another script. This can continue
|
||||||
continue for about 14 levels. When more nesting is done, Vim assumes that
|
for about 14 levels. When more nesting is done, Vim assumes that there is a
|
||||||
there is a recursive loop and stops with this error message.
|
recursive loop somewhere and stops with this error message.
|
||||||
|
|
||||||
*E300* >
|
*E300* >
|
||||||
Swap file already exists (symlink attack?)
|
Swap file already exists (symlink attack?)
|
||||||
@@ -686,7 +686,6 @@ Ex command or function was given an invalid argument. Or |jobstart()| or
|
|||||||
Trailing characters
|
Trailing characters
|
||||||
|
|
||||||
An argument was given to an Ex command that does not permit one.
|
An argument was given to an Ex command that does not permit one.
|
||||||
Or the argument has invalid characters and has not been recognized.
|
|
||||||
|
|
||||||
*E477* *E478* >
|
*E477* *E478* >
|
||||||
No ! allowed
|
No ! allowed
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user