mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
Compare commits
74 Commits
v0.6.0
...
release-0.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1e1fd71fea | ||
![]() |
606ace0fbe | ||
![]() |
b69ceaa2e8 | ||
![]() |
3ad07553e2 | ||
![]() |
64ec1f5b02 | ||
![]() |
b60293b76d | ||
![]() |
e86f95eb10 | ||
![]() |
f65c52d235 | ||
![]() |
2e77847896 | ||
![]() |
5ba88321a6 | ||
![]() |
d8ccee30b0 | ||
![]() |
b5276b36d4 | ||
![]() |
3f20d8bb09 | ||
![]() |
9eed756cad | ||
![]() |
5908d88a3e | ||
![]() |
71950115eb | ||
![]() |
14ff19bc36 | ||
![]() |
7b822ea72b | ||
![]() |
a3a56cf60c | ||
![]() |
0159e4daae | ||
![]() |
c9e4f86b75 | ||
![]() |
14cdaca6a8 | ||
![]() |
7b0ae589f0 | ||
![]() |
8ec5bc9126 | ||
![]() |
959cf5e53c | ||
![]() |
dc15b3a92c | ||
![]() |
18375c6df6 | ||
![]() |
7b1315fe61 | ||
![]() |
27bac13be6 | ||
![]() |
d26d489e2e | ||
![]() |
a6eab6e25e | ||
![]() |
cd8f6c5fb7 | ||
![]() |
f8e0011534 | ||
![]() |
7d67bd5865 | ||
![]() |
2132c063af | ||
![]() |
132053c1d2 | ||
![]() |
51d6b26729 | ||
![]() |
f7002337c0 | ||
![]() |
6bda2f56eb | ||
![]() |
be58ba250e | ||
![]() |
d0e9a11e39 | ||
![]() |
5c42376c15 | ||
![]() |
41f761130e | ||
![]() |
a265201307 | ||
![]() |
33000bd9cf | ||
![]() |
9f73b7c214 | ||
![]() |
eaa1c47377 | ||
![]() |
942b16adf7 | ||
![]() |
cf62554e5a | ||
![]() |
6436100b6e | ||
![]() |
04cde576ed | ||
![]() |
cd864748d3 | ||
![]() |
09ff3146f3 | ||
![]() |
f809664f89 | ||
![]() |
d83df7f7b5 | ||
![]() |
64dc7a1b55 | ||
![]() |
5a813160ae | ||
![]() |
917f306666 | ||
![]() |
a9cca1b050 | ||
![]() |
989ccb8222 | ||
![]() |
2ae4c96d91 | ||
![]() |
ae89330ec0 | ||
![]() |
2229e99ef9 | ||
![]() |
88336851ee | ||
![]() |
3a0543bd61 | ||
![]() |
008b83f5a2 | ||
![]() |
915dda3f96 | ||
![]() |
b6b12ea7c3 | ||
![]() |
502a56867d | ||
![]() |
78482138ae | ||
![]() |
fe815244f0 | ||
![]() |
56d86970b0 | ||
![]() |
6c4f66f381 | ||
![]() |
f589c2619b |
@@ -1,6 +1,6 @@
|
||||
BasedOnStyle: Google
|
||||
Language: Cpp
|
||||
ColumnLimit: 100
|
||||
ColumnLimit: 80
|
||||
IndentWidth: 2
|
||||
TabWidth: 2
|
||||
UseTab: Never
|
||||
|
@@ -1,38 +0,0 @@
|
||||
# To use this file (requires git 2.23):
|
||||
# git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||
|
||||
# eval.c: factor out eval/funcs.c #11828
|
||||
# - This is a move/rename. git 2.33 doesn't know how to ignore it.
|
||||
# It is here anyway, (1) in case git improves later, and (2) to
|
||||
# save you the trouble of attempting this.
|
||||
6c5bbf07d988ef55e5e8ba8d70b62c1f0885261b
|
||||
|
||||
# symbol renames
|
||||
6186df3562e33e92f04ed8c850204ceabc4746e1
|
||||
|
||||
# style (uncrustify, etc.)
|
||||
2d240024acbd68c2d3f82bc72cb12b1a4928c6bf
|
||||
61178778230e609d68b271ffd53ffd993cd23c42
|
||||
15af08ad176339d1f269ce264bb0efea283c9536
|
||||
47f99d66440ae8be26b34531989ac61edc1ad9fe
|
||||
1e49a1c888a3d9a581f4aa409a26ada3ac2417cb
|
||||
3b3dbcf7b7ba5466e6ab643e256f2374b520a6b2
|
||||
e8067d1490a31ff76143d576dc9948b4f09c6c55
|
||||
d5b66e88601b4d2fde5d905f9d12847126ba4449
|
||||
07715044887d82f74254e64c4c32fa49b0501bea
|
||||
6ed43f8f1caad702f9590d174c5ec142f3d85b18
|
||||
0a83017fe95df0290adb98ec6bf457b96a3fab17
|
||||
867e8885991ae450019c18aa5e42546bd4b62c2c
|
||||
1f49268c46fcbe65f7e2e2cb620e6f51c059cf9e
|
||||
51a98aa0c2fe3231a0ffc8a78189bc6fafd6abf6
|
||||
853346a94d6aa78c97314a3b217fb5a5408a47f1
|
||||
30fefee684e641a0c6867446c6de30efa2f0a126
|
||||
f4ca3a29ddcb0c98e8e09c45a6342af709f8cc45
|
||||
48e67b229415b4e2b3315bd00b817e5f9ab970c8
|
||||
7a26eb8a567cbc831d4f629f9eccb767a44436b8
|
||||
2f9b9e61d7417183f2d9f36d804247c0926be9d4
|
||||
c0767bd4f3ce7b34bb77da0657c49ba10ba1b32e
|
||||
d90fb1c0bfc1e64c783c385a79e7de87013dadba
|
||||
9c268263b1792d00b3ffdfd7495af2575862656e
|
||||
8c74c895b300bcee5fa937a2329d1d4756567b42
|
||||
40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf
|
34
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
34
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report a problem in Nvim
|
||||
title: ''
|
||||
labels: bug
|
||||
|
||||
---
|
||||
|
||||
<!-- Before reporting: search existing issues and check the FAQ. -->
|
||||
|
||||
- `nvim --version`:
|
||||
- Operating system/version:
|
||||
- Terminal name/version:
|
||||
- `$TERM`:
|
||||
|
||||
<!--
|
||||
If this report is about different behaviour between Nvim and Vim, make sure to
|
||||
read `:h vim-differences` first. Otherwise remove the next line.
|
||||
-->
|
||||
[ ] `vim -u DEFAULTS` (version: ) behaves differently
|
||||
|
||||
### Steps to reproduce using `nvim -u NORC`
|
||||
|
||||
```
|
||||
nvim -u NORC
|
||||
# Alternative for shell-related problems:
|
||||
# env -i TERM=ansi-256color "$(which nvim)"
|
||||
|
||||
```
|
||||
|
||||
### Actual behaviour
|
||||
|
||||
### Expected behaviour
|
||||
|
75
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
75
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -1,75 +0,0 @@
|
||||
name: Bug Report
|
||||
description: Report a problem in Neovim
|
||||
labels: [bug]
|
||||
body:
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions such as "How do I...?" belong on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will be closed.
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Neovim version (nvim -v)"
|
||||
placeholder: "0.6.0 commit db1b0ee3b30f"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Vim (not Nvim) behaves the same?"
|
||||
description: "Does `vim -u DEFAULTS` have the same issue? Note the exact Vim version (`8.x.yyyy`)."
|
||||
placeholder: "no, vim 7.3.432"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Operating system/version"
|
||||
placeholder: "macOS 11.5"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Terminal name/version"
|
||||
placeholder: "xterm 3.1"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: "$TERM environment variable"
|
||||
placeholder: "xterm-256color"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Installation"
|
||||
description: "How did you install neovim: build from repo / system package manager / appimage / homebrew / snap / chocolatey / other (describe)?"
|
||||
placeholder: "Arch User Repository (AUR)"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "How to reproduce the issue"
|
||||
description: |
|
||||
- Steps to reproduce using `nvim --clean` ("factory defaults").
|
||||
- For build failures: list the exact steps including CMake flags (if any).
|
||||
- For shell-related problems: try `env -i TERM=ansi-256color "$(which nvim)"`.
|
||||
placeholder: |
|
||||
nvim --clean
|
||||
:edit foo
|
||||
yiwp
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Expected behavior"
|
||||
description: "Describe the behavior you expect. May include logs, images, or videos."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Actual behavior"
|
||||
validations:
|
||||
required: true
|
5
.github/ISSUE_TEMPLATE/config.yml
vendored
5
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,5 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Question
|
||||
url: https://neovim.discourse.group/
|
||||
about: Ask questions about configuration and usage of Neovim
|
27
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
27
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Request an enhancement for Nvim
|
||||
title: ''
|
||||
labels: enhancement
|
||||
|
||||
---
|
||||
|
||||
<!-- Before reporting: search existing issues and check the FAQ. -->
|
||||
|
||||
- `nvim --version`:
|
||||
- `vim -u DEFAULTS` (version: ) behaves differently?
|
||||
- Operating system/version:
|
||||
- Terminal name/version:
|
||||
- `$TERM`:
|
||||
|
||||
### Steps to reproduce using `nvim -u NORC`
|
||||
|
||||
```
|
||||
nvim -u NORC
|
||||
|
||||
```
|
||||
|
||||
### Actual behaviour
|
||||
|
||||
### Expected behaviour
|
||||
|
21
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
21
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -1,21 +0,0 @@
|
||||
name: Feature request
|
||||
description: Request an enhancement for Neovim
|
||||
labels: [enhancement]
|
||||
body:
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Before requesting: search [existing issues](https://github.com/neovim/neovim/labels/enhancement) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ).
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Feature already in Vim?"
|
||||
description: "Does the feature already exist in Vim? If possible, specify which version (or commit) that introduced it."
|
||||
placeholder: "Yes, Vim 7.3.432"
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Feature description"
|
||||
validations:
|
||||
required: true
|
58
.github/ISSUE_TEMPLATE/lsp_bug_report.md
vendored
Normal file
58
.github/ISSUE_TEMPLATE/lsp_bug_report.md
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
name: Language server client bug report
|
||||
about: Report a built-in lsp problem in Nvim
|
||||
title: ''
|
||||
labels: bug, lsp
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Before reporting: search existing issues and check the FAQ. Usage questions
|
||||
such as "How do I...?" or "Why isn't X language server/feature working?" belong
|
||||
on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will
|
||||
be closed.
|
||||
-->
|
||||
|
||||
- `nvim --version`:
|
||||
- language server name/version:
|
||||
- Operating system/version:
|
||||
|
||||
<details>
|
||||
<summary>nvim -c ":checkhealth nvim lspconfig"</summary>
|
||||
|
||||
<!-- Paste the results from `nvim -c ":checkhealth nvim lspconfig"` here. -->
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>lsp.log</summary>
|
||||
|
||||
<!--
|
||||
Please paste the lsp log before and after the problem.
|
||||
|
||||
You can set log level like this.
|
||||
`:lua vim.lsp.set_log_level("debug")`
|
||||
|
||||
You can find the location of the log with the following command.
|
||||
`:lua print(vim.lsp.get_log_path())`
|
||||
-->
|
||||
|
||||
</details>
|
||||
|
||||
### Steps to reproduce using nvim -u minimal_init.lua
|
||||
<!--
|
||||
Note, if the issue is with an autocompletion or other LSP plugin, please
|
||||
report to the upstream tracker. Download the minmal config with
|
||||
wget https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua
|
||||
and modify it to include any specific commands or servers pertaining to your issues.
|
||||
-->
|
||||
|
||||
|
||||
```
|
||||
nvim -u minimal_init.lua
|
||||
```
|
||||
|
||||
### Actual behaviour
|
||||
|
||||
### Expected behaviour
|
||||
|
61
.github/ISSUE_TEMPLATE/lsp_bug_report.yml
vendored
61
.github/ISSUE_TEMPLATE/lsp_bug_report.yml
vendored
@@ -1,61 +0,0 @@
|
||||
name: Language server (LSP) client bug
|
||||
description: Report an issue with Neovim LSP
|
||||
labels: [bug, lsp]
|
||||
body:
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions such as "How do I...?" or "Why isn't X language server/feature working?" belong on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will be closed.
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Neovim version (nvim -v)"
|
||||
placeholder: "0.6.0 commit db1b0ee3b30f"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Language server name/version"
|
||||
placeholder: "rls 0.5.2"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Operating system/version"
|
||||
placeholder: "emacs 23"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: ':checkhealth'
|
||||
description: |
|
||||
Paste the results from `nvim -c ":checkhealth nvim lspconfig"`
|
||||
render: markdown
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 'Steps to reproduce using "nvim -u minimal_init.lua"'
|
||||
description: |
|
||||
- Download the minimal config with `curl -LO https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua` and modify it to include any specific commands or servers pertaining to your issues.
|
||||
- _Note_: if the issue is with an autocompletion or other LSP plugin, report to that plugin's issue tracker.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Expected behavior"
|
||||
description: "Describe the behavior you expect. May include logs, images, or videos."
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Actual behavior"
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Log file"
|
||||
placeholder: "https://gist.github.com/prakhar1989/1b0a2c9849b2e1e912fb"
|
||||
description: |
|
||||
- Upload `lsp.log` before and after the problem in a [secret gist](https://gist.github.com/). Paste the URL to the gist.
|
||||
- You can set the log level by adding `vim.lsp.set_log_level("debug")` after setting up LSP in your config.
|
||||
- You can find the location of the log with `:lua print(vim.lsp.get_log_path())`
|
61
.github/labeler.yml
vendored
61
.github/labeler.yml
vendored
@@ -1,61 +0,0 @@
|
||||
"lsp":
|
||||
- runtime/lua/vim/lsp.lua
|
||||
- runtime/lua/vim/lsp/*
|
||||
|
||||
"lua":
|
||||
- runtime/lua/**/*
|
||||
- src/nvim/lua/*
|
||||
|
||||
"tui":
|
||||
- src/nvim/tui/tui.*
|
||||
|
||||
"treesitter":
|
||||
- src/nvim/lua/treesitter.*
|
||||
- runtime/lua/vim/treesitter.lua
|
||||
- runtime/lua/vim/treesitter/*
|
||||
|
||||
"diagnostic":
|
||||
- runtime/lua/vim/diagnostic.lua
|
||||
|
||||
"dependencies":
|
||||
- third-party/**/*
|
||||
|
||||
"spell":
|
||||
- src/nvim/spell*
|
||||
|
||||
"terminal":
|
||||
- src/nvim/terminal.*
|
||||
|
||||
"column":
|
||||
- src/nvim/mark.h
|
||||
- src/nvim/mark.c
|
||||
- src/nvim/sign*
|
||||
|
||||
"folds":
|
||||
- src/nvim/fold*
|
||||
|
||||
"mouse":
|
||||
- src/nvim/mouse*
|
||||
|
||||
"documentation":
|
||||
- all: ["runtime/doc/*"]
|
||||
|
||||
"clipboard":
|
||||
- runtime/autoload/provider/clipboard.vim
|
||||
|
||||
"diff":
|
||||
- src/nvim/diff.*
|
||||
|
||||
"build":
|
||||
- CMakeLists.txt
|
||||
- "**/CMakeLists.txt"
|
||||
- "**/*.cmake"
|
||||
|
||||
"tests":
|
||||
- all: ["test/**/*"]
|
||||
|
||||
"ci":
|
||||
- .github/labeler.yml
|
||||
- .github/workflows/**/*
|
||||
- .builds/*
|
||||
- ci/**/*
|
33
.github/workflows/backport.yml
vendored
33
.github/workflows/backport.yml
vendored
@@ -1,33 +0,0 @@
|
||||
name: Backport
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [closed, labeled]
|
||||
issue_comment:
|
||||
types: [created]
|
||||
jobs:
|
||||
backport:
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
name: Backport Pull Request
|
||||
if: >
|
||||
github.repository_owner == 'neovim' && (
|
||||
github.event_name == 'pull_request' &&
|
||||
github.event.pull_request.merged
|
||||
) || (
|
||||
github.event_name == 'issue_comment' &&
|
||||
github.event.issue.pull_request &&
|
||||
contains(github.event.comment.body, '/backport')
|
||||
)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
# required to find all branches
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Create backport PRs
|
||||
uses: zeebe-io/backport-action@v0.0.7
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
github_workspace: ${{ github.workspace }}
|
87
.github/workflows/ci.yml
vendored
87
.github/workflows/ci.yml
vendored
@@ -1,18 +1,15 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'release-[0-9]+.[0-9]+'
|
||||
branches: '**'
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
branches:
|
||||
- 'master'
|
||||
- 'release-[0-9]+.[0-9]+'
|
||||
|
||||
jobs:
|
||||
unixish:
|
||||
name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
|
||||
name: ${{ matrix.os }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -32,11 +29,11 @@ jobs:
|
||||
- cc: clang
|
||||
runner: macos-10.15
|
||||
os: osx
|
||||
- cc: clang
|
||||
runner: macos-11.0
|
||||
os: osx
|
||||
- flavor: functionaltest-lua
|
||||
cc: gcc
|
||||
runner: ubuntu-20.04
|
||||
os: linux
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 45
|
||||
if: github.event.pull_request.draft == false
|
||||
env:
|
||||
CC: ${{ matrix.cc }}
|
||||
@@ -44,7 +41,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup common environment variables
|
||||
- name: Setup commom environment variables
|
||||
run: ./.github/workflows/env.sh ${{ matrix.flavor }}
|
||||
|
||||
- name: Install apt packages
|
||||
@@ -81,7 +78,7 @@ jobs:
|
||||
path: |
|
||||
${{ env.CACHE_NVIM_DEPS_DIR }}
|
||||
~/.ccache
|
||||
key: ${{ matrix.runner }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'third-party/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
|
||||
key: ${{ runner.os }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'third-party/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
|
||||
|
||||
- name: Build third-party
|
||||
run: ./ci/before_script.sh
|
||||
@@ -103,7 +100,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config: [ MINGW_64-gcov, MSVC_64 ]
|
||||
config: [ MINGW_64-gcov, MINGW_32, MSVC_64, MSVC_32 ]
|
||||
name: windows (${{ matrix.config }})
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -117,69 +114,3 @@ jobs:
|
||||
run: powershell ci\build.ps1
|
||||
env:
|
||||
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
|
||||
|
19
.github/workflows/commitlint.yml
vendored
19
.github/workflows/commitlint.yml
vendored
@@ -1,19 +0,0 @@
|
||||
name: "Commit Linter"
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
jobs:
|
||||
lint-commits:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.pull_request.draft == false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: rhysd/action-setup-vim@v1
|
||||
with:
|
||||
neovim: true
|
||||
- run: nvim --clean -es +"lua require('scripts.lintcommit').main({trace=true})"
|
30
.github/workflows/labeler.yml
vendored
30
.github/workflows/labeler.yml
vendored
@@ -1,30 +0,0 @@
|
||||
name: "Pull Request Labeler"
|
||||
on:
|
||||
pull_request_target:
|
||||
types: opened
|
||||
jobs:
|
||||
triage:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/labeler@main
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
type-scope:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
steps:
|
||||
# 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
|
||||
|
||||
# Extract scope 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
|
3
.github/workflows/notes.md
vendored
3
.github/workflows/notes.md
vendored
@@ -6,7 +6,7 @@ ${NVIM_VERSION}
|
||||
|
||||
### Windows
|
||||
|
||||
1. Extract **nvim-win64.zip**
|
||||
1. Extract **nvim-win64.zip** (or **nvim-win32.zip**)
|
||||
2. Run `nvim-qt.exe`
|
||||
|
||||
### macOS
|
||||
@@ -37,4 +37,5 @@ ${SHA_APP_IMAGE}
|
||||
${SHA_APP_IMAGE_ZSYNC}
|
||||
${SHA_MACOS}
|
||||
${SHA_WIN_64}
|
||||
${SHA_WIN_32}
|
||||
```
|
||||
|
11
.github/workflows/release.yml
vendored
11
.github/workflows/release.yml
vendored
@@ -125,6 +125,8 @@ jobs:
|
||||
include:
|
||||
- config: MSVC_64
|
||||
archive: nvim-win64
|
||||
- config: MSVC_32
|
||||
archive: nvim-win32
|
||||
name: windows (${{ matrix.config }})
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -205,6 +207,11 @@ jobs:
|
||||
cd ./nvim-macos
|
||||
sha256sum nvim-macos.tar.gz > nvim-macos.tar.gz.sha256sum
|
||||
echo "SHA_MACOS=$(cat nvim-macos.tar.gz.sha256sum)" >> $GITHUB_ENV
|
||||
- name: Generate Win32 SHA256 checksums
|
||||
run: |
|
||||
cd ./nvim-win32
|
||||
sha256sum nvim-win32.zip > nvim-win32.zip.sha256sum
|
||||
echo "SHA_WIN_32=$(cat nvim-win32.zip.sha256sum)" >> $GITHUB_ENV
|
||||
- name: Generate Win64 SHA256 checksums
|
||||
run: |
|
||||
cd ./nvim-win64
|
||||
@@ -216,7 +223,7 @@ jobs:
|
||||
NVIM_VERSION: ${{ needs.linux.outputs.version }}
|
||||
run: |
|
||||
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-win32/* nvim-win64/*
|
||||
if [ "$TAG_NAME" != "nightly" ]; then
|
||||
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
||||
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win32/* nvim-win64/*
|
||||
fi
|
||||
|
33
.github/workflows/squash-typos.yml
vendored
33
.github/workflows/squash-typos.yml
vendored
@@ -1,33 +0,0 @@
|
||||
name: Squash Typo Pull Requests
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: labeled
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
jobs:
|
||||
build:
|
||||
if: github.event.label.name == 'typo'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v2
|
||||
|
||||
- name: Setup git config
|
||||
run: |
|
||||
git config --global user.name 'marvim'
|
||||
git config --global user.email 'marvim@users.noreply.github.com'
|
||||
|
||||
- run: python scripts/squash_typos.py
|
||||
env:
|
||||
PR_NUMBER: ${{ github.event.number }}
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,7 +13,6 @@ compile_commands.json
|
||||
/tmp/
|
||||
/.clangd/
|
||||
/.cache/clangd/
|
||||
/.ccls-cache/
|
||||
|
||||
.DS_Store
|
||||
*.mo
|
||||
|
@@ -25,7 +25,3 @@ ignore = {
|
||||
read_globals = {
|
||||
"vim",
|
||||
}
|
||||
|
||||
exclude_files = {
|
||||
'test/functional/fixtures/lua/syntax_error.lua',
|
||||
}
|
||||
|
@@ -133,6 +133,8 @@ jobs:
|
||||
- BUILD_32BIT=ON
|
||||
- CMAKE_FLAGS="$CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
|
||||
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
|
||||
# Minimum required CMake.
|
||||
- CMAKE_URL=https://cmake.org/files/v2.8/cmake-2.8.12-Linux-i386.sh
|
||||
- *common-job-env
|
||||
- name: big-endian
|
||||
os: linux
|
||||
|
@@ -2,8 +2,8 @@
|
||||
# intro: https://codingnest.com/basic-cmake/
|
||||
# best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
|
||||
|
||||
# Version should match the tested CMAKE_URL in .github/workflows/ci.yml.
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
# Version should match the tested CMAKE_URL in .travis.yml.
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
project(nvim C)
|
||||
|
||||
if(POLICY CMP0065)
|
||||
@@ -136,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
|
||||
# version string, else they are combined with the result of `git describe`.
|
||||
set(NVIM_VERSION_MAJOR 0)
|
||||
set(NVIM_VERSION_MINOR 6)
|
||||
set(NVIM_VERSION_PATCH 0)
|
||||
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||
set(NVIM_VERSION_MINOR 5)
|
||||
set(NVIM_VERSION_PATCH 2)
|
||||
set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers
|
||||
|
||||
# API level
|
||||
set(NVIM_API_LEVEL 8) # Bump this after any API change.
|
||||
set(NVIM_API_LEVEL 7) # Bump this after any API change.
|
||||
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
|
||||
set(NVIM_API_PRERELEASE false)
|
||||
|
||||
@@ -590,7 +590,9 @@ if(BUSTED_PRG)
|
||||
# console pool: to do so we need to use the USES_TERMINAL
|
||||
# option, but this is only available in CMake 3.2
|
||||
set(TEST_TARGET_ARGS)
|
||||
if(NOT (${CMAKE_VERSION} VERSION_LESS 3.2.0))
|
||||
list(APPEND TEST_TARGET_ARGS "USES_TERMINAL")
|
||||
endif()
|
||||
|
||||
set(UNITTEST_PREREQS nvim-test unittest-headers)
|
||||
set(FUNCTIONALTEST_PREREQS nvim printenv-test printargs-test shell-test streams-test tty-test ${GENERATED_HELP_TAGS})
|
||||
@@ -689,7 +691,7 @@ endif()
|
||||
|
||||
if(LUACHECK_PRG)
|
||||
add_custom_target(lualint
|
||||
COMMAND ${LUACHECK_PRG} -q runtime/ scripts/ src/ test/
|
||||
COMMAND ${LUACHECK_PRG} -q runtime/ src/ test/ --exclude-files test/functional/fixtures/lua/syntax_error.lua
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
else()
|
||||
add_custom_target(lualint false
|
||||
|
106
CONTRIBUTING.md
106
CONTRIBUTING.md
@@ -8,10 +8,9 @@ If you want to help but don't know where to start, here are some
|
||||
low-risk/isolated tasks:
|
||||
|
||||
- [Merge a Vim patch].
|
||||
- Try a [good first issue](../../labels/good-first-issue) or [complexity:low] issue.
|
||||
- Try a [good first issue](../../labels/good%20first%20issue) or [complexity:low] issue.
|
||||
- Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or
|
||||
[Coverity](#coverity).
|
||||
- [Improve documentation][wiki-contribute-help]
|
||||
|
||||
Reporting problems
|
||||
------------------
|
||||
@@ -19,12 +18,11 @@ Reporting problems
|
||||
- [Check the FAQ][wiki-faq].
|
||||
- [Search existing issues][github-issues] (including closed!)
|
||||
- Update Neovim to the latest version to see if your problem persists.
|
||||
- Try to reproduce with `nvim --clean` ("factory defaults").
|
||||
- [Bisect](https://neovim.io/doc/user/starting.html#bisect) your config: disable plugins incrementally, to narrow down the cause of the issue.
|
||||
- [Bisect][git-bisect] Neovim's source code to find the cause of a regression, if you can. This is _extremely_ helpful.
|
||||
- Disable plugins incrementally, to narrow down the cause of the issue.
|
||||
- When reporting a crash, [include a stacktrace](https://github.com/neovim/neovim/wiki/FAQ#backtrace-linux).
|
||||
- Use [ASAN/UBSAN](#clang-sanitizers-asan-and-ubsan) to get detailed errors for segfaults and undefined behavior.
|
||||
- Check the logs. `:edit $NVIM_LOG_FILE`
|
||||
- [Bisect][git-bisect] to the cause of a regression, if you are able. This is _extremely_ helpful.
|
||||
- Check `$NVIM_LOG_FILE`, if it exists.
|
||||
- Include `cmake --system-information` for build-related issues.
|
||||
|
||||
Developer guidelines
|
||||
@@ -39,12 +37,13 @@ Developer guidelines
|
||||
make distclean
|
||||
make # Nvim build system uses ninja automatically, if available.
|
||||
```
|
||||
- [Improve documentation][wiki-contribute-help]
|
||||
|
||||
Pull requests (PRs)
|
||||
---------------------
|
||||
|
||||
- To avoid duplicate work, create a draft pull request.
|
||||
- Your PR must include [test coverage][run-tests].
|
||||
- To avoid duplicate work, create a `[WIP]` pull request as soon as possible.
|
||||
- Your PR must include **test coverage.** See [test/README.md][run-tests].
|
||||
- Avoid cosmetic changes to unrelated files in the same commit.
|
||||
- Use a [feature branch][git-feature-branch] instead of the master branch.
|
||||
- Use a **rebase workflow** for small PRs.
|
||||
@@ -63,25 +62,21 @@ Pull requests (PRs)
|
||||
- During a squash/fixup, use `exec make -C build unittest` between each
|
||||
pick/edit/reword.
|
||||
|
||||
### Stages: Draft and Ready for review
|
||||
### Stages: WIP, RFC, RDY
|
||||
|
||||
Pull requests have two stages: Draft and Ready for review.
|
||||
Pull requests have three stages: `[WIP]` (Work In Progress), `[RFC]` (Request
|
||||
For Comment) and `[RDY]` (Ready).
|
||||
|
||||
1. [Create a Draft PR][pr-draft] while you are _not_ requesting feedback as
|
||||
you are still working on the PR.
|
||||
- You can skip this if your PR is ready for review.
|
||||
2. [Change your PR to ready][pr-ready] when the PR is ready for review.
|
||||
- You can convert back to Draft at any time.
|
||||
|
||||
Do __not__ add labels like `[RFC]` or `[WIP]` in the title to indicate the
|
||||
state of your PR: this just adds noise. Non-Draft PRs are assumed to be open
|
||||
for comments; if you want feedback from specific people, `@`-mention them in
|
||||
a comment.
|
||||
1. `[RFC]` is assumed by default, **do not** put "RFC" in the PR title (it adds
|
||||
noise to merge commit messages).
|
||||
2. Add `[WIP]` to the PR title if you are _not_ requesting feedback and the work
|
||||
is still in flux.
|
||||
3. Add `[RDY]` to the PR title if you are _done_ and only waiting on merge.
|
||||
|
||||
### Commit messages
|
||||
|
||||
Follow the [conventional commits guidelines][conventional_commits] to *make reviews easier* and to make
|
||||
the VCS/git logs more valuable. The general structure of a commit message is:
|
||||
Follow the [convential commits guidelines][conventional_commits] to *make reviews easier* and to make
|
||||
the VCS/git logs more valuable. The general structure of a commit message is as follows:
|
||||
|
||||
```
|
||||
<type>([optional scope]): <description>
|
||||
@@ -91,27 +86,21 @@ the VCS/git logs more valuable. The general structure of a commit message is:
|
||||
[optional footer(s)]
|
||||
```
|
||||
|
||||
- Prefix the commit subject with one of these [_types_](https://github.com/commitizen/conventional-commit-types/blob/master/index.json):
|
||||
- `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `test`, `vim-patch`, `chore`
|
||||
- You can **ignore this for "fixup" commits** or any commits you expect to be squashed.
|
||||
- Append optional scope to _type_ such as `(lsp)`, `(treesitter)`, `(float)`, …
|
||||
- _Description_ shouldn't start with a capital letter or end in a period.
|
||||
- Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
|
||||
- **Prefix the commit subject with a _type_:** `doc:`, `test:`
|
||||
`runtime:`, ...
|
||||
- Subject line for commits with only style/lint changes can be a single
|
||||
word: `style` or `lint`.
|
||||
- **Add the optional scope following <type> if possible:** `(lsp)`, `(treesitter)`, `(multigrid)`, ...
|
||||
- Try to keep the first line under 72 characters.
|
||||
- A blank line must follow the subject.
|
||||
- Breaking API changes must be indicated by
|
||||
1. "!" after the type/scope, and
|
||||
2. a "BREAKING CHANGE" footer describing the change.
|
||||
Example:
|
||||
```
|
||||
refactor(provider)!: drop support for Python 2
|
||||
|
||||
BREAKING CHANGE: refactor to use Python 3 features since Python 2 is no longer supported.
|
||||
```
|
||||
- A blank line must separate the subject from the description.
|
||||
- Breaking changes must be indicated at the very beginning of the footer or body section of a commit. A breaking change must consist of the uppercase text BREAKING CHANGE, followed by a colon, a space, and a description of what has changed about the API.
|
||||
- Check your commit message for spelling and grammatical mistakes.
|
||||
- Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
|
||||
|
||||
### Automated builds (CI)
|
||||
|
||||
Each pull request must pass the automated builds on [sourcehut] and [GitHub Actions].
|
||||
Each pull request must pass the automated builds on [Travis CI], [sourcehut]
|
||||
and [AppVeyor].
|
||||
|
||||
- CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings
|
||||
will fail the build.
|
||||
@@ -162,7 +151,7 @@ see potential bugs found by [PVS Studio](https://www.viva64.com/en/pvs-studio/).
|
||||
|
||||
- Use this format for commit messages (where `{id}` is the PVS warning-id)):
|
||||
```
|
||||
fix(PVS/V{id}): {description}
|
||||
PVS/V{id}: {description}
|
||||
```
|
||||
- Search the Neovim commit history to find examples:
|
||||
```
|
||||
@@ -178,7 +167,7 @@ master build. To view the defects, just request access; you will be approved.
|
||||
- Use this format for commit messages (where `{id}` is the CID (Coverity ID);
|
||||
([example](https://github.com/neovim/neovim/pull/804))):
|
||||
```
|
||||
fix(coverity/{id}): {description}
|
||||
coverity/{id}: {description}
|
||||
```
|
||||
- Search the Neovim commit history to find examples:
|
||||
```
|
||||
@@ -188,16 +177,15 @@ master build. To view the defects, just request access; you will be approved.
|
||||
### Clang sanitizers (ASAN and UBSAN)
|
||||
|
||||
ASAN/UBSAN can be used to detect memory errors and other common forms of undefined behavior at runtime in debug builds.
|
||||
|
||||
- To build Neovim with sanitizers enabled, use
|
||||
To build neovim with sanitizers enabled, use
|
||||
```
|
||||
rm -rf build && CMAKE_EXTRA_FLAGS="-DCMAKE_C_COMPILER=clang -DCLANG_ASAN_UBSAN=1" make
|
||||
```
|
||||
- When running Neovim, use
|
||||
When running neovim, use
|
||||
```
|
||||
UBSAN_OPTIONS=print_stacktrace=1 ASAN_OPTIONS=log_path=/tmp/nvim_asan nvim args...
|
||||
```
|
||||
- If Neovim exits unexpectedly, check `/tmp/nvim_asan.{PID}` (or your preferred `log_path`) for log files with error messages.
|
||||
If neovim exits unexpectedly, check `/tmp/nvim_asan.{PID}` (or your preferred `log_path`) for log files with error messages.
|
||||
|
||||
|
||||
Coding
|
||||
@@ -218,28 +206,16 @@ You can lint a single file (but this will _not_ exclude legacy errors):
|
||||
|
||||
### Style
|
||||
|
||||
- Style rules are (mostly) defined by `src/uncrustify.cfg` which tries to match
|
||||
the [style-guide]. To use the Nvim `gq` command with `uncrustify`:
|
||||
```
|
||||
if !empty(findfile('src/uncrustify.cfg', ';'))
|
||||
setlocal formatprg=uncrustify\ -q\ -l\ C\ -c\ src/uncrustify.cfg\ --no-backup
|
||||
endif
|
||||
```
|
||||
The required version of `uncrustify` is specified in `uncrustify.cfg`.
|
||||
- There is also `.clang-format` which has drifted from the [style-guide], but
|
||||
is available for reference. To use the Nvim `gq` command with `clang-format`:
|
||||
```
|
||||
The repo includes a `.clang-format` config file which (mostly) matches the
|
||||
[style-guide]. You can use `clang-format` to format code with the `gq`
|
||||
operator in Nvim:
|
||||
|
||||
if !empty(findfile('.clang-format', ';'))
|
||||
setlocal formatprg=clang-format\ -style=file
|
||||
endif
|
||||
```
|
||||
|
||||
### Navigate
|
||||
|
||||
- Set `blame.ignoreRevsFile` to ignore [noise commits](https://github.com/neovim/neovim/commit/2d240024acbd68c2d3f82bc72cb12b1a4928c6bf) in git blame:
|
||||
```
|
||||
git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||
```
|
||||
- Use **[universal-ctags](https://github.com/universal-ctags/ctags).**
|
||||
("Exuberant ctags", the typical `ctags` binary provided by your distro, is
|
||||
unmaintained and won't recognize many function signatures in Neovim source.)
|
||||
@@ -272,19 +248,17 @@ as context, use the `-W` argument as well.
|
||||
[1820]: https://github.com/neovim/neovim/pull/1820
|
||||
[hub]: https://hub.github.com/
|
||||
[conventional_commits]: https://www.conventionalcommits.org
|
||||
[style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style
|
||||
[style-guide]: http://neovim.io/develop/style-guide.xml
|
||||
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
|
||||
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
|
||||
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
|
||||
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
|
||||
[3174]: https://github.com/neovim/neovim/issues/3174
|
||||
[Travis CI]: https://travis-ci.org/neovim/neovim
|
||||
[sourcehut]: https://builds.sr.ht/~jmk
|
||||
[GitHub Actions]: https://github.com/neovim/neovim/actions
|
||||
[AppVeyor]: https://ci.appveyor.com/project/neovim/neovim
|
||||
[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
|
||||
[Clang report]: https://neovim.io/doc/reports/clang/
|
||||
[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
|
||||
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp
|
||||
[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
|
||||
[uncrustify]: https://formulae.brew.sh/formula/uncrustify
|
||||
|
11
LICENSE
11
LICENSE
@@ -189,17 +189,8 @@ contributed under the Vim license and (2) externally maintained libraries.
|
||||
The externally maintained libraries used by Neovim are:
|
||||
|
||||
- Klib: a Generic Library in C. MIT/X11 license.
|
||||
- Lua: MIT license
|
||||
- LuaJIT: a Just-In-Time Compiler for Lua. Copyright Mike Pall. MIT license.
|
||||
- Luv: Apache 2.0 license
|
||||
- libmpack: MIT license
|
||||
- libtermkey: MIT license
|
||||
- libuv. Copyright Joyent, Inc. and other Node contributors. Node.js license.
|
||||
- libvterm: MIT license
|
||||
- lua-compat: MIT license
|
||||
- tree-sitter: MIT license
|
||||
- xdiff: LGPL license
|
||||
- lua-cjson: MIT license
|
||||
- LuaJIT: a Just-In-Time Compiler for Lua. Copyright Mike Pall. MIT license.
|
||||
|
||||
====
|
||||
|
||||
|
43
MAINTAIN.md
43
MAINTAIN.md
@@ -10,13 +10,14 @@ General guidelines
|
||||
* Write down what was decided
|
||||
* Constraints are good
|
||||
* Use automation to solve problems
|
||||
* Never break the API... but sometimes break the UI
|
||||
* Never break the API
|
||||
|
||||
Ticket triage
|
||||
-------------
|
||||
|
||||
In practice we haven't found a way to forecast more precisely than "next" and
|
||||
"after next". So there are usually one or two (at most) planned milestones:
|
||||
In practice we haven't found a meaningful way to forecast more precisely than
|
||||
"next" and "after next". That means there are usually one or two (at most)
|
||||
planned milestones:
|
||||
|
||||
- Next bugfix-release (1.0.x)
|
||||
- Next feature-release (1.x.0)
|
||||
@@ -24,16 +25,16 @@ In practice we haven't found a way to forecast more precisely than "next" and
|
||||
The forecasting problem might be solved with an explicit priority system (like
|
||||
Bram's todo.txt). Meanwhile the Neovim priority system is defined by:
|
||||
|
||||
- PRs nearing completion.
|
||||
- PRs nearing completion (RDY).
|
||||
- Issue labels. E.g. the `+plan` label increases the ticket's priority merely
|
||||
for having a plan written down: it is _closer to completion_ than tickets
|
||||
without a plan.
|
||||
- Comment activity or new information.
|
||||
|
||||
Anything that isn't in the next milestone, and doesn't have a finished PR—is
|
||||
Anything that isn't in the next milestone, and doesn't have a RDY PR ... is
|
||||
just not something you care very much about, by construction. Post-release you
|
||||
can review open issues, but chances are your next milestone is already getting
|
||||
full... :)
|
||||
full :)
|
||||
|
||||
Release policy
|
||||
--------------
|
||||
@@ -55,36 +56,6 @@ has a major bug:
|
||||
- The [nightly job](https://github.com/neovim/bot-ci/blob/master/ci/nightly.sh)
|
||||
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).
|
||||
In order to trigger the action, a PR must be labeled with a label matching the
|
||||
form `backport release-0.X`. If the label is applied before the PR is merged,
|
||||
the backport will be filed automatically against the target branch. Otherwise,
|
||||
comment `\backport` on the merged PR *after* the label has been applied to trigger
|
||||
a backport. Note, the PR must have a description in the issue body, or the backport
|
||||
will fail.
|
||||
|
||||
Third-party dependencies
|
||||
--------------
|
||||
|
||||
These "bundled" dependencies can be updated by bumping their versions in `third-party/CMakeLists.txt`:
|
||||
- [Lua](https://www.lua.org/download.html)
|
||||
- [LuaJIT](https://github.com/LuaJIT/LuaJIT)
|
||||
- [Luv](https://github.com/luvit/luv)
|
||||
- [libtermkey](https://github.com/neovim/libtermkey)
|
||||
- [libuv](https://github.com/libuv/libuv)
|
||||
- [libvterm](http://www.leonerd.org.uk/code/libvterm/)
|
||||
- [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
|
||||
- [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
||||
|
||||
These dependencies are "vendored" (inlined), we need to update the sources manually:
|
||||
- [libmpack](https://github.com/libmpack/libmpack)
|
||||
- [xdiff](https://github.com/git/git/tree/master/xdiff)
|
||||
- [lua-cjson](https://github.com/openresty/lua-cjson)
|
||||
- [Klib](https://github.com/attractivechaos/klib)
|
||||
|
||||
We also maintain some forks, particularly for Windows, if we are waiting on upstream changes:
|
||||
https://github.com/neovim/neovim/wiki/Deps
|
||||
|
||||
See also
|
||||
--------
|
||||
|
||||
|
85
Makefile
85
Makefile
@@ -1,6 +1,4 @@
|
||||
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||
MAKEFILE_DIR := $(dir $(MAKEFILE_PATH))
|
||||
|
||||
THIS_DIR = $(shell pwd)
|
||||
filter-false = $(strip $(filter-out 0 off OFF false FALSE,$1))
|
||||
filter-true = $(strip $(filter-out 1 on ON true TRUE,$1))
|
||||
|
||||
@@ -14,7 +12,6 @@ CMAKE_BUILD_TYPE ?= Debug
|
||||
CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
|
||||
# Extra CMake flags which extend the default set
|
||||
CMAKE_EXTRA_FLAGS ?=
|
||||
NVIM_PRG := $(MAKEFILE_DIR)/build/bin/nvim
|
||||
|
||||
# CMAKE_INSTALL_PREFIX
|
||||
# - May be passed directly or as part of CMAKE_EXTRA_FLAGS.
|
||||
@@ -38,7 +35,7 @@ else
|
||||
checkprefix: ;
|
||||
endif
|
||||
|
||||
CMAKE_GENERATOR ?= $(shell (command -v ninja > /dev/null 2>&1 && echo "Ninja") || \
|
||||
BUILD_TYPE ?= $(shell (type ninja > /dev/null 2>&1 && echo "Ninja") || \
|
||||
echo "Unix Makefiles")
|
||||
DEPS_BUILD_DIR ?= .deps
|
||||
ifneq (1,$(words [$(DEPS_BUILD_DIR)]))
|
||||
@@ -46,28 +43,29 @@ ifneq (1,$(words [$(DEPS_BUILD_DIR)]))
|
||||
endif
|
||||
|
||||
ifeq (,$(BUILD_TOOL))
|
||||
ifeq (Ninja,$(CMAKE_GENERATOR))
|
||||
ifeq (Ninja,$(BUILD_TYPE))
|
||||
ifneq ($(shell $(CMAKE_PRG) --help 2>/dev/null | grep Ninja),)
|
||||
BUILD_TOOL = ninja
|
||||
BUILD_TOOL := ninja
|
||||
else
|
||||
# User's version of CMake doesn't support Ninja
|
||||
BUILD_TOOL = $(MAKE)
|
||||
CMAKE_GENERATOR := Unix Makefiles
|
||||
BUILD_TYPE := Unix Makefiles
|
||||
endif
|
||||
else
|
||||
BUILD_TOOL = $(MAKE)
|
||||
endif
|
||||
endif
|
||||
|
||||
BUILD_CMD = $(BUILD_TOOL)
|
||||
|
||||
# Only need to handle Ninja here. Make will inherit the VERBOSE variable, and the -j, -l, and -n flags.
|
||||
ifeq ($(CMAKE_GENERATOR),Ninja)
|
||||
# Only need to handle Ninja here. Make will inherit the VERBOSE variable, and the -j and -n flags.
|
||||
ifeq ($(BUILD_TYPE),Ninja)
|
||||
ifneq ($(VERBOSE),)
|
||||
BUILD_TOOL += -v
|
||||
BUILD_CMD += -v
|
||||
endif
|
||||
BUILD_TOOL += $(shell printf '%s' '$(MAKEFLAGS)' | grep -o -- ' *-[jl][0-9]\+ *')
|
||||
BUILD_CMD += $(shell printf '%s' '$(MAKEFLAGS)' | grep -o -- '-j[0-9]\+')
|
||||
ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS))))
|
||||
BUILD_TOOL += -n
|
||||
BUILD_CMD += -n
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -89,22 +87,22 @@ endif
|
||||
SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE)
|
||||
|
||||
nvim: build/.ran-cmake deps
|
||||
+$(BUILD_TOOL) -C build
|
||||
+$(BUILD_CMD) -C build
|
||||
|
||||
libnvim: build/.ran-cmake deps
|
||||
+$(BUILD_TOOL) -C build libnvim
|
||||
+$(BUILD_CMD) -C build libnvim
|
||||
|
||||
cmake:
|
||||
touch CMakeLists.txt
|
||||
$(MAKE) build/.ran-cmake
|
||||
|
||||
build/.ran-cmake: | deps
|
||||
cd build && $(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR)
|
||||
cd build && $(CMAKE_PRG) -G '$(BUILD_TYPE)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(THIS_DIR)
|
||||
touch $@
|
||||
|
||||
deps: | build/.ran-third-party-cmake
|
||||
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
||||
+$(BUILD_TOOL) -C $(DEPS_BUILD_DIR)
|
||||
+$(BUILD_CMD) -C $(DEPS_BUILD_DIR)
|
||||
endif
|
||||
|
||||
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
||||
@@ -112,8 +110,8 @@ $(DEPS_BUILD_DIR):
|
||||
mkdir -p "$@"
|
||||
build/.ran-third-party-cmake:: $(DEPS_BUILD_DIR)
|
||||
cd $(DEPS_BUILD_DIR) && \
|
||||
$(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
|
||||
$(DEPS_CMAKE_FLAGS) $(MAKEFILE_DIR)/third-party
|
||||
$(CMAKE_PRG) -G '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
|
||||
$(DEPS_CMAKE_FLAGS) $(THIS_DIR)/third-party
|
||||
endif
|
||||
build/.ran-third-party-cmake::
|
||||
mkdir -p build
|
||||
@@ -123,31 +121,31 @@ build/.ran-third-party-cmake::
|
||||
oldtest: | nvim build/runtime/doc/tags
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir clean
|
||||
ifeq ($(strip $(TEST_FILE)),)
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) $(MAKEOVERRIDES)
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" $(MAKEOVERRIDES)
|
||||
else
|
||||
@# Handle TEST_FILE=test_foo{,.res,.vim}.
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE)))
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE)))
|
||||
endif
|
||||
# Build oldtest by specifying the relative .vim filename.
|
||||
.PHONY: phony_force
|
||||
src/nvim/testdir/%.vim: phony_force
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@)
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@)
|
||||
|
||||
build/runtime/doc/tags helptags: | nvim
|
||||
+$(BUILD_TOOL) -C build runtime/doc/tags
|
||||
+$(BUILD_CMD) -C build runtime/doc/tags
|
||||
|
||||
# Builds help HTML _and_ checks for invalid help tags.
|
||||
helphtml: | nvim build/runtime/doc/tags
|
||||
+$(BUILD_TOOL) -C build doc_html
|
||||
+$(BUILD_CMD) -C build doc_html
|
||||
|
||||
functionaltest: | nvim
|
||||
+$(BUILD_TOOL) -C build functionaltest
|
||||
+$(BUILD_CMD) -C build functionaltest
|
||||
|
||||
functionaltest-lua: | nvim
|
||||
+$(BUILD_TOOL) -C build functionaltest-lua
|
||||
+$(BUILD_CMD) -C build functionaltest-lua
|
||||
|
||||
lualint: | build/.ran-cmake deps
|
||||
$(BUILD_TOOL) -C build lualint
|
||||
$(BUILD_CMD) -C build lualint
|
||||
|
||||
shlint:
|
||||
@shellcheck --version | head -n 2
|
||||
@@ -165,23 +163,16 @@ _opt_pylint:
|
||||
@command -v flake8 && { $(MAKE) pylint; exit $$?; } \
|
||||
|| echo "SKIP: pylint (flake8 not found)"
|
||||
|
||||
commitlint:
|
||||
$(NVIM_PRG) --clean -es +"lua require('scripts.lintcommit').main({trace=false})"
|
||||
|
||||
_opt_commitlint:
|
||||
@test -x build/bin/nvim && { $(MAKE) commitlint; exit $$?; } \
|
||||
|| echo "SKIP: commitlint (build/bin/nvim not found)"
|
||||
|
||||
unittest: | nvim
|
||||
+$(BUILD_TOOL) -C build unittest
|
||||
+$(BUILD_CMD) -C build unittest
|
||||
|
||||
benchmark: | nvim
|
||||
+$(BUILD_TOOL) -C build benchmark
|
||||
+$(BUILD_CMD) -C build benchmark
|
||||
|
||||
test: functionaltest unittest
|
||||
|
||||
clean:
|
||||
+test -d build && $(BUILD_TOOL) -C build clean || true
|
||||
+test -d build && $(BUILD_CMD) -C build clean || true
|
||||
$(MAKE) -C src/nvim/testdir clean
|
||||
$(MAKE) -C runtime/doc clean
|
||||
$(MAKE) -C runtime/indent clean
|
||||
@@ -191,19 +182,19 @@ distclean:
|
||||
$(MAKE) clean
|
||||
|
||||
install: checkprefix nvim
|
||||
+$(BUILD_TOOL) -C build install
|
||||
+$(BUILD_CMD) -C build install
|
||||
|
||||
clint: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build clint
|
||||
+$(BUILD_CMD) -C build clint
|
||||
|
||||
clint-full: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build clint-full
|
||||
+$(BUILD_CMD) -C build clint-full
|
||||
|
||||
check-single-includes: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build check-single-includes
|
||||
+$(BUILD_CMD) -C build check-single-includes
|
||||
|
||||
generated-sources: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build generated-sources
|
||||
+$(BUILD_CMD) -C build generated-sources
|
||||
|
||||
appimage:
|
||||
bash scripts/genappimage.sh
|
||||
@@ -214,16 +205,16 @@ appimage:
|
||||
appimage-%:
|
||||
bash scripts/genappimage.sh $*
|
||||
|
||||
lint: check-single-includes clint lualint _opt_pylint _opt_shlint _opt_commitlint
|
||||
lint: check-single-includes clint lualint _opt_pylint _opt_shlint
|
||||
|
||||
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
|
||||
# Does not work with "Unix Makefiles".
|
||||
ifeq ($(CMAKE_GENERATOR),Ninja)
|
||||
ifeq ($(BUILD_TYPE),Ninja)
|
||||
build/%: phony_force
|
||||
$(BUILD_TOOL) -C build $(patsubst build/%,%,$@)
|
||||
$(BUILD_CMD) -C build $(patsubst build/%,%,$@)
|
||||
|
||||
$(DEPS_BUILD_DIR)/%: phony_force
|
||||
$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
|
||||
$(BUILD_CMD) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
|
||||
endif
|
||||
|
||||
.PHONY: test lualint pylint shlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix commitlint
|
||||
.PHONY: test lualint pylint shlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix
|
||||
|
10
README.md
10
README.md
@@ -1,10 +1,10 @@
|
||||
[](https://neovim.io)
|
||||
|
||||
[Documentation](https://neovim.io/doc/general/) |
|
||||
[Chat](https://app.element.io/#/room/#neovim:matrix.org) |
|
||||
[Chat](https://gitter.im/neovim/neovim) |
|
||||
[Twitter](https://twitter.com/Neovim)
|
||||
|
||||
[](https://github.com/neovim/neovim/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush)
|
||||
[](https://github.com/neovim/neovim/actions?query=workflow%3A%22CI%22)
|
||||
[](https://codecov.io/gh/neovim/neovim)
|
||||
[](https://scan.coverity.com/projects/2227)
|
||||
[](https://neovim.io/doc/reports/clang)
|
||||
@@ -46,7 +46,8 @@ Install from package
|
||||
Pre-built packages for Windows, macOS, and Linux are found on the
|
||||
[Releases](https://github.com/neovim/neovim/releases/) page.
|
||||
|
||||
[Managed packages] are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux], [Void Linux], [Gentoo], and more!
|
||||
[Managed packages] are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux],
|
||||
[Gentoo], and more!
|
||||
|
||||
Install from source
|
||||
-------------------
|
||||
@@ -64,7 +65,7 @@ To install to a non-default location:
|
||||
make CMAKE_INSTALL_PREFIX=/full/path/
|
||||
make install
|
||||
|
||||
CMake hints for inspecting the build:
|
||||
To inspect the build, these CMake features are useful:
|
||||
|
||||
- `cmake --build build --target help` lists all build targets.
|
||||
- `build/CMakeCache.txt` (or `cmake -LAH build/`) contains the resolved values of all CMake variables.
|
||||
@@ -121,7 +122,6 @@ Apache 2.0 license, except for contributions copied from Vim (identified by the
|
||||
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
|
||||
[Fedora]: https://apps.fedoraproject.org/packages/neovim
|
||||
[Arch Linux]: https://www.archlinux.org/packages/?q=neovim
|
||||
[Void Linux]: https://voidlinux.org/packages/?arch=x86_64&q=neovim
|
||||
[Gentoo]: https://packages.gentoo.org/packages/app-editors/neovim
|
||||
[Homebrew]: https://formulae.brew.sh/formula/neovim
|
||||
|
||||
|
@@ -44,3 +44,16 @@ fi
|
||||
|
||||
source ~/.nvm/nvm.sh
|
||||
nvm install 10
|
||||
|
||||
if [[ -n "$CMAKE_URL" ]]; then
|
||||
echo "Installing custom CMake: $CMAKE_URL"
|
||||
curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
|
||||
mkdir -p "$HOME/.local/bin" /opt/cmake-custom
|
||||
bash /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)"
|
||||
echo "$cmake_version" | grep -qF '2.8.12' || {
|
||||
echo "Unexpected CMake version: $cmake_version"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
@@ -72,7 +72,7 @@ if ($compiler -eq 'MINGW') {
|
||||
& C:\msys64\usr\bin\mkdir -p /var/cache/pacman/pkg
|
||||
|
||||
# Build third-party dependencies
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Syu" ; exitIfFailed
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" ; exitIfFailed
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S $mingwPackages" ; exitIfFailed
|
||||
}
|
||||
elseif ($compiler -eq 'MSVC') {
|
||||
|
@@ -24,7 +24,7 @@ snap_realease_needed() {
|
||||
|
||||
trigger_snapcraft_webhook() {
|
||||
[[ -n "${PAYLOAD_SIG}" ]] || exit
|
||||
echo "Triggering new snap release via webhook..."
|
||||
echo "Triggering new snap relase via webhook..."
|
||||
curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Hub-Signature: sha1=${PAYLOAD_SIG}" \
|
||||
|
@@ -15,7 +15,7 @@ find_path(LIBLUV_INCLUDE_DIR luv/luv.h
|
||||
PATHS ${PC_LIBLUV_INCLUDEDIR} ${PC_LIBLUV_INCLUDE_DIRS})
|
||||
|
||||
# Explicitly look for luv.so. #10407
|
||||
list(APPEND LIBLUV_NAMES luv_a luv libluv_a luv${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
list(APPEND LIBLUV_NAMES luv luv${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
|
||||
find_library(LIBLUV_LIBRARY NAMES ${LIBLUV_NAMES}
|
||||
HINTS ${PC_LIBLUV_LIBDIR} ${PC_LIBLUV_LIBRARY_DIRS})
|
||||
|
@@ -75,14 +75,6 @@ if(WIN32)
|
||||
list(APPEND LIBUV_LIBRARIES ws2_32)
|
||||
endif()
|
||||
|
||||
find_package(Threads)
|
||||
if(Threads_FOUND)
|
||||
# TODO: Fix the cmake file to properly handle static deps for bundled builds.
|
||||
# Meanwhile just include the threads library if CMake tells us there's one to
|
||||
# use.
|
||||
list(APPEND LIBUV_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set LIBUV_FOUND to TRUE
|
||||
|
@@ -154,25 +154,3 @@ function(install_helper)
|
||||
${RENAME})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Without CONFIGURE_DEPENDS globbing reuses cached file tree on rebuild.
|
||||
# For example it will ignore new files.
|
||||
# CONFIGURE_DEPENDS was introduced in 3.12
|
||||
|
||||
function(glob_wrapper outvar)
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.12)
|
||||
file(GLOB ${outvar} ${ARGN})
|
||||
else()
|
||||
file(GLOB ${outvar} CONFIGURE_DEPENDS ${ARGN})
|
||||
endif()
|
||||
set(${outvar} ${${outvar}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(globrecurse_wrapper outvar root)
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.12)
|
||||
file(GLOB_RECURSE ${outvar} RELATIVE ${root} ${ARGN})
|
||||
else()
|
||||
file(GLOB_RECURSE ${outvar} CONFIGURE_DEPENDS RELATIVE ${root} ${ARGN})
|
||||
endif()
|
||||
set(${outvar} ${${outvar}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
@@ -10,7 +10,6 @@ set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime)
|
||||
set(ENV{NVIM_RPLUGIN_MANIFEST} ${BUILD_DIR}/Xtest_rplugin_manifest)
|
||||
set(ENV{XDG_CONFIG_HOME} ${BUILD_DIR}/Xtest_xdg/config)
|
||||
set(ENV{XDG_DATA_HOME} ${BUILD_DIR}/Xtest_xdg/share)
|
||||
unset(ENV{XDG_DATA_DIRS})
|
||||
|
||||
if(NOT DEFINED ENV{NVIM_LOG_FILE})
|
||||
set(ENV{NVIM_LOG_FILE} ${BUILD_DIR}/.nvimlog)
|
||||
@@ -50,9 +49,6 @@ endif()
|
||||
set(ENV{TMPDIR} "${BUILD_DIR}/Xtest_tmpdir/${TEST_PATH}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory $ENV{TMPDIR})
|
||||
|
||||
# HISTFILE: do not write into user's ~/.bash_history
|
||||
set(ENV{HISTFILE} "/dev/null")
|
||||
|
||||
if(NOT DEFINED ENV{TEST_TIMEOUT} OR "$ENV{TEST_TIMEOUT}" STREQUAL "")
|
||||
set(ENV{TEST_TIMEOUT} 1200)
|
||||
endif()
|
||||
|
@@ -12,6 +12,11 @@ check_type_size("size_t" SIZEOF_SIZE_T)
|
||||
check_type_size("long long" SIZEOF_LONG_LONG)
|
||||
check_type_size("void *" SIZEOF_VOID_PTR)
|
||||
|
||||
if (CMAKE_HOST_SYSTEM_VERSION MATCHES ".*-(Microsoft|microsoft-standard)")
|
||||
# Windows Subsystem for Linux
|
||||
set(HAVE_WSL 1)
|
||||
endif()
|
||||
|
||||
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
|
||||
|
||||
# Headers
|
||||
@@ -92,7 +97,7 @@ if (NOT "${HAVE_BE64TOH}")
|
||||
# any case and ORDER_BIG_ENDIAN will not be examined.
|
||||
# - CMAKE_CROSSCOMPILING *and* HAVE_BE64TOH are both false. In this case
|
||||
# be64toh function which uses cycle and arithmetic operations is used which
|
||||
# will work regardless of endianness. Function is sub-optimal though.
|
||||
# will work regardless of endianess. Function is sub-optimal though.
|
||||
check_c_source_runs("
|
||||
${SI}
|
||||
${MS}
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#cmakedefine HAVE_SYS_WAIT_H
|
||||
#cmakedefine HAVE_TERMIOS_H
|
||||
#cmakedefine HAVE_WORKING_LIBINTL
|
||||
#cmakedefine HAVE_WSL
|
||||
#cmakedefine UNIX
|
||||
#cmakedefine CASE_INSENSITIVE_FILENAME
|
||||
#cmakedefine USE_FNAME_CASE
|
||||
|
12
contrib/flake.lock
generated
12
contrib/flake.lock
generated
@@ -2,11 +2,11 @@
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1629481132,
|
||||
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
|
||||
"lastModified": 1610051610,
|
||||
"narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "997f7efcb746a9c140ce1f13c72263189225f482",
|
||||
"rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -17,11 +17,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1630074300,
|
||||
"narHash": "sha256-BFM7OiXRs0RvSUZd6NCGAKWVPn3VodgYQ4TUQXxbMBU=",
|
||||
"lastModified": 1613226215,
|
||||
"narHash": "sha256-3rA5cGIrBHD6yeKhNhsF7/t461ww25oJY8KyBb0IhjU=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "21c937f8cb1e6adcfeb36dfd6c90d9d9bfab1d28",
|
||||
"rev": "ff96a0fa5635770390b184ae74debea75c3fd534",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@@ -16,20 +16,24 @@
|
||||
neovim = pkgs.neovim-unwrapped.overrideAttrs (oa: {
|
||||
version = "master";
|
||||
src = ../.;
|
||||
|
||||
buildInputs = oa.buildInputs ++ ([
|
||||
pkgs.tree-sitter
|
||||
]);
|
||||
|
||||
cmakeFlags = oa.cmakeFlags ++ [
|
||||
"-DUSE_BUNDLED=OFF"
|
||||
];
|
||||
});
|
||||
|
||||
# a development binary to help debug issues
|
||||
neovim-debug = let
|
||||
stdenv = if pkgs.stdenv.isLinux then pkgs.llvmPackages_latest.stdenv else pkgs.stdenv;
|
||||
stdenv = pkgs.stdenvAdapters.keepDebugInfo (if pkgs.stdenv.isLinux then pkgs.llvmPackages_latest.stdenv else pkgs.stdenv);
|
||||
in
|
||||
((neovim.override {
|
||||
lua = pkgs.luajit;
|
||||
pkgs.enableDebugging ((neovim.override {
|
||||
lua = pkgs.enableDebugging pkgs.luajit;
|
||||
inherit stdenv;
|
||||
}).overrideAttrs (oa: {
|
||||
|
||||
dontStrip = true;
|
||||
NIX_CFLAGS_COMPILE = " -ggdb -Og";
|
||||
|
||||
cmakeBuildType = "Debug";
|
||||
cmakeFlags = oa.cmakeFlags ++ [
|
||||
"-DMIN_LOG_LEVEL=0"
|
||||
@@ -38,10 +42,16 @@
|
||||
disallowedReferences = [];
|
||||
}));
|
||||
|
||||
# for neovim developers, beware of the slow binary
|
||||
# for neovim developers, builds a slow binary
|
||||
# huge closure size but aims at covering all scripts
|
||||
# brings development tools as well
|
||||
neovim-developer =
|
||||
let
|
||||
lib = nixpkgs.lib;
|
||||
pythonEnv = pkgs.python3.withPackages(ps: [
|
||||
ps.msgpack
|
||||
ps.flake8 # for 'make pylint'
|
||||
]);
|
||||
luacheck = pkgs.luaPackages.luacheck;
|
||||
in
|
||||
(neovim-debug.override ({ doCheck = pkgs.stdenv.isLinux; })).overrideAttrs (oa: {
|
||||
@@ -49,11 +59,29 @@
|
||||
"-DLUACHECK_PRG=${luacheck}/bin/luacheck"
|
||||
"-DMIN_LOG_LEVEL=0"
|
||||
"-DENABLE_LTO=OFF"
|
||||
"-DUSE_BUNDLED=OFF"
|
||||
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
|
||||
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
|
||||
# https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports
|
||||
"-DCLANG_ASAN_UBSAN=ON"
|
||||
];
|
||||
|
||||
nativeBuildInputs = oa.nativeBuildInputs ++ (with pkgs; [
|
||||
pythonEnv
|
||||
include-what-you-use # for scripts/check-includes.py
|
||||
jq # jq for scripts/vim-patch.sh -r
|
||||
shellcheck # for `make shlint`
|
||||
doxygen # for script/gen_vimdoc.py
|
||||
clang-tools # for clangd to find the correct headers
|
||||
]);
|
||||
|
||||
shellHook = oa.shellHook + ''
|
||||
export NVIM_PYTHON_LOG_LEVEL=DEBUG
|
||||
export NVIM_LOG_FILE=/tmp/nvim.log
|
||||
|
||||
export ASAN_OPTIONS="log_path=./test.log:abort_on_error=1"
|
||||
export UBSAN_OPTIONS=print_stacktrace=1
|
||||
'';
|
||||
});
|
||||
};
|
||||
} //
|
||||
@@ -63,11 +91,6 @@
|
||||
overlays = [ self.overlay ];
|
||||
inherit system;
|
||||
};
|
||||
|
||||
pythonEnv = pkgs.python3.withPackages(ps: [
|
||||
ps.msgpack
|
||||
ps.flake8 # for 'make pylint'
|
||||
]);
|
||||
in
|
||||
rec {
|
||||
|
||||
@@ -75,18 +98,6 @@
|
||||
inherit neovim neovim-debug neovim-developer;
|
||||
};
|
||||
|
||||
checks = {
|
||||
pylint = pkgs.runCommandNoCC "pylint" {
|
||||
nativeBuildInputs = [ pythonEnv ];
|
||||
preferLocalBuild = true;
|
||||
} "make -C ${./..} pylint > $out";
|
||||
|
||||
shlint = pkgs.runCommandNoCC "shlint" {
|
||||
nativeBuildInputs = [ pkgs.shellcheck ];
|
||||
preferLocalBuild = true;
|
||||
} "make -C ${./..} shlint > $out";
|
||||
};
|
||||
|
||||
defaultPackage = pkgs.neovim;
|
||||
|
||||
apps = {
|
||||
@@ -96,38 +107,6 @@
|
||||
|
||||
defaultApp = apps.nvim;
|
||||
|
||||
devShell = let
|
||||
in
|
||||
pkgs.neovim-developer.overrideAttrs(oa: {
|
||||
|
||||
buildInputs = with pkgs; oa.buildInputs ++ [
|
||||
cmake
|
||||
pythonEnv
|
||||
include-what-you-use # for scripts/check-includes.py
|
||||
jq # jq for scripts/vim-patch.sh -r
|
||||
shellcheck # for `make shlint`
|
||||
doxygen # for script/gen_vimdoc.py
|
||||
clang-tools # for clangd to find the correct headers
|
||||
];
|
||||
|
||||
shellHook = oa.shellHook + ''
|
||||
export NVIM_PYTHON_LOG_LEVEL=DEBUG
|
||||
export NVIM_LOG_FILE=/tmp/nvim.log
|
||||
export ASAN_SYMBOLIZER_PATH=${pkgs.llvm_11}/bin/llvm-symbolizer
|
||||
|
||||
# ASAN_OPTIONS=detect_leaks=1
|
||||
export ASAN_OPTIONS="log_path=./test.log:abort_on_error=1"
|
||||
export UBSAN_OPTIONS=print_stacktrace=1
|
||||
mkdir -p build/runtime/parser
|
||||
# nvim looks into CMAKE_INSTALL_DIR. Hack to avoid errors
|
||||
# when running the functionaltests
|
||||
mkdir -p outputs/out/share/nvim/syntax
|
||||
touch outputs/out/share/nvim/syntax/syntax.vim
|
||||
|
||||
# for treesitter functionaltests
|
||||
mkdir -p runtime/parser
|
||||
cp -f ${pkgs.tree-sitter.builtGrammars.tree-sitter-c}/parser runtime/parser/c.so
|
||||
'';
|
||||
});
|
||||
devShell = pkgs.neovim-developer;
|
||||
});
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@
|
||||
|
||||
# With non-Debug builds interprocedural optimization (IPO) (which includes
|
||||
# link-time optimization (LTO)) is enabled by default, which causes the link
|
||||
# step to take a significant amount of time, which is relevant when building
|
||||
# step to take a significant amout of time, which is relevant when building
|
||||
# often. You can disable it explicitly:
|
||||
# CMAKE_EXTRA_FLAGS += -DENABLE_LTO=OFF
|
||||
|
||||
|
1578
contrib/uncrustify.cfg
Normal file
1578
contrib/uncrustify.cfg
Normal file
File diff suppressed because it is too large
Load Diff
@@ -100,7 +100,7 @@ Useful for scripting because it does NOT start a UI, unlike
|
||||
.Ic :help silent-mode
|
||||
.It Fl d
|
||||
Diff mode.
|
||||
Show the difference between two to eight files, similar to
|
||||
Show the difference between two to four files, similar to
|
||||
.Xr sdiff 1 .
|
||||
.Ic ":help diff"
|
||||
.It Fl R
|
||||
@@ -177,7 +177,8 @@ If
|
||||
.Ar vimrc
|
||||
is
|
||||
.Cm NORC ,
|
||||
do not load any initialization files (except plugins).
|
||||
do not load any initialization files (except plugins),
|
||||
and do not attempt to parse environment variables.
|
||||
If
|
||||
.Ar vimrc
|
||||
is
|
||||
@@ -200,7 +201,7 @@ Skip loading plugins.
|
||||
Implied by
|
||||
.Cm -u NONE .
|
||||
.It Fl -clean
|
||||
Mimic a fresh install of Nvim. Skip loading non-builtin plugins and shada (viminfo) file.
|
||||
Skip loading plugins and shada (viminfo) file.
|
||||
.It Fl o Ns Op Ar N
|
||||
Open
|
||||
.Ar N
|
||||
|
@@ -21,12 +21,12 @@ add_custom_command(OUTPUT ${GENERATED_SYN_VIM}
|
||||
${FUNCS_DATA}
|
||||
)
|
||||
|
||||
glob_wrapper(PACKAGES ${PROJECT_SOURCE_DIR}/runtime/pack/dist/opt/*)
|
||||
file(GLOB PACKAGES ${PROJECT_SOURCE_DIR}/runtime/pack/dist/opt/*)
|
||||
|
||||
set(GENERATED_PACKAGE_TAGS)
|
||||
foreach(PACKAGE ${PACKAGES})
|
||||
get_filename_component(PACKNAME ${PACKAGE} NAME)
|
||||
glob_wrapper("${PACKNAME}_DOC_FILES" ${PACKAGE}/doc/*.txt)
|
||||
file(GLOB "${PACKNAME}_DOC_FILES" ${PACKAGE}/doc/*.txt)
|
||||
if(${PACKNAME}_DOC_FILES)
|
||||
file(MAKE_DIRECTORY ${GENERATED_PACKAGE_DIR}/${PACKNAME})
|
||||
add_custom_command(OUTPUT "${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags"
|
||||
@@ -54,7 +54,7 @@ foreach(PACKAGE ${PACKAGES})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
glob_wrapper(DOCFILES ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
|
||||
file(GLOB DOCFILES ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
|
||||
|
||||
set(BUILDDOCFILES)
|
||||
foreach(DF ${DOCFILES})
|
||||
@@ -114,7 +114,9 @@ if(NOT APPLE)
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps)
|
||||
endif()
|
||||
|
||||
globrecurse_wrapper(RUNTIME_PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR} *.awk *.sh *.bat)
|
||||
file(GLOB_RECURSE RUNTIME_PROGRAMS
|
||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
*.awk *.sh *.bat)
|
||||
|
||||
foreach(PROG ${RUNTIME_PROGRAMS})
|
||||
get_filename_component(BASEDIR ${PROG} PATH)
|
||||
@@ -122,7 +124,9 @@ foreach(PROG ${RUNTIME_PROGRAMS})
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/${BASEDIR})
|
||||
endforeach()
|
||||
|
||||
globrecurse_wrapper(RUNTIME_FILES ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
file(GLOB_RECURSE RUNTIME_FILES
|
||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
rgb.txt
|
||||
*.vim *.lua *.dict *.py *.rb *.ps *.spl *.tutor *.tutor.json)
|
||||
|
||||
foreach(F ${RUNTIME_FILES})
|
||||
|
@@ -67,13 +67,13 @@ if exists ('g:ada_with_gnat_project_files')
|
||||
endfor
|
||||
endif
|
||||
|
||||
" Section: add standard exception {{{2
|
||||
" Section: add standart exception {{{2
|
||||
"
|
||||
for Item in ['Constraint_Error', 'Program_Error', 'Storage_Error', 'Tasking_Error', 'Status_Error', 'Mode_Error', 'Name_Error', 'Use_Error', 'Device_Error', 'End_Error', 'Data_Error', 'Layout_Error', 'Length_Error', 'Pattern_Error', 'Index_Error', 'Translation_Error', 'Time_Error', 'Argument_Error', 'Tag_Error', 'Picture_Error', 'Terminator_Error', 'Conversion_Error', 'Pointer_Error', 'Dereference_Error', 'Update_Error']
|
||||
let g:ada#Keywords += [{
|
||||
\ 'word': Item,
|
||||
\ 'menu': 'exception',
|
||||
\ 'info': 'Ada standard exception.',
|
||||
\ 'info': 'Ada standart exception.',
|
||||
\ 'kind': 'x',
|
||||
\ 'icase': 1}]
|
||||
endfor
|
||||
@@ -210,7 +210,7 @@ function ada#Word (...)
|
||||
let l:Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' )
|
||||
|
||||
" Cope with tag searching for items in comments; if we are, don't loop
|
||||
" backwards looking for previous lines
|
||||
" backards looking for previous lines
|
||||
if l:Column_Nr > strlen(l:Line)
|
||||
" We were in a comment
|
||||
let l:Line = getline(l:Line_Nr)
|
||||
|
@@ -14,7 +14,7 @@
|
||||
" 15.10.2006 MK Bram's suggestion for runtime integration
|
||||
" 05.11.2006 MK Bram suggested not to use include protection for
|
||||
" autoload
|
||||
" 05.11.2006 MK Bram suggested against using setlocal omnifunc
|
||||
" 05.11.2006 MK Bram suggested agaist using setlocal omnifunc
|
||||
" 05.11.2006 MK Bram suggested to save on spaces
|
||||
" Help Page: ft-ada-omni
|
||||
"------------------------------------------------------------------------------
|
||||
|
File diff suppressed because one or more lines are too long
@@ -4,7 +4,7 @@
|
||||
" plus CSS Speech Module <http://www.w3.org/TR/css3-speech/>
|
||||
" Maintainer: Kao, Wei-Ko(othree) ( othree AT gmail DOT com )
|
||||
" Original Author: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2021 Sep 21
|
||||
" Last Change: 2018 Jul 02
|
||||
|
||||
let s:values = split("all additive-symbols align-content align-items align-self animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size block-size border border-block-end border-block-end-color border-block-end-style border-block-end-width border-block-start border-block-start-color border-block-start-style border-block-start-width border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-inline-end border-inline-end-color border-inline-end-style border-inline-end-width border-inline-start border-inline-start-color border-inline-start-style border-inline-start-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side clear clip clip-path color columns column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width content counter-increment counter-reset cue cue-before cue-after cursor direction display empty-cells fallback filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font font-family font-feature-settings font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-weight grid grid-area grid-auto-columns grid-auto-flow grid-auto-position grid-auto-rows grid-column grid-column-start grid-column-end grid-row grid-row-start grid-row-end grid-template grid-template-areas grid-template-rows grid-template-columns height hyphens image-rendering image-resolution image-orientation ime-mode inline-size isolation justify-content left letter-spacing line-break line-height list-style list-style-image list-style-position list-style-type margin margin-block-end margin-block-start margin-bottom margin-inline-end margin-inline-start margin-left margin-right margin-top marks mask mask-type max-block-size max-height max-inline-size max-width max-zoom min-block-size min-height min-inline-size min-width min-zoom mix-blend-mode negative object-fit object-position offset-block-end offset-block-start offset-inline-end offset-inline-start opacity order orientation orphans outline outline-color outline-offset outline-style outline-width overflow overflow-wrap overflow-x overflow-y pad padding padding-block-end padding-block-start padding-bottom padding-inline-end padding-inline-start padding-left padding-right padding-top page-break-after page-break-before page-break-inside pause-before pause-after pause perspective perspective-origin pointer-events position prefix quotes range resize rest rest-before rest-after right ruby-align ruby-merge ruby-position scroll-behavior scroll-snap-coordinate scroll-snap-destination scroll-snap-points-x scroll-snap-points-y scroll-snap-type scroll-snap-type-x scroll-snap-type-y shape-image-threshold shape-margin shape-outside speak speak-as suffix symbols system table-layout tab-size text-align text-align-last text-combine-upright text-decoration text-decoration-color text-decoration-line text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-indent text-orientation text-overflow text-rendering text-shadow text-transform text-underline-position top touch-action transform transform-box transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi unicode-range user-zoom vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-rate voice-range voice-stress voice-volume white-space widows width will-change word-break word-spacing word-wrap writing-mode z-index zoom")
|
||||
|
||||
@@ -38,12 +38,12 @@ function! csscomplete#CompleteCSS(findstart, base)
|
||||
if exists("b:compl_context")
|
||||
let line = getline('.')
|
||||
let compl_begin = col('.') - 2
|
||||
let b:after = line[compl_begin:]
|
||||
let after = line[compl_begin:]
|
||||
let line = b:compl_context
|
||||
unlet! b:compl_context
|
||||
else
|
||||
let line = a:base
|
||||
let b:after = ''
|
||||
let after = ''
|
||||
endif
|
||||
|
||||
let res = []
|
||||
@@ -311,7 +311,7 @@ function! csscomplete#CompleteCSS(findstart, base)
|
||||
let values = ["normal", "italic", "oblique", "small-caps", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller", "sans-serif", "serif", "monospace", "cursive", "fantasy", "caption", "icon", "menu", "message-box", "small-caption", "status-bar"]
|
||||
elseif prop =~ '^\%(height\|width\)$'
|
||||
let values = ["auto", "border-box", "content-box", "max-content", "min-content", "available", "fit-content"]
|
||||
elseif prop =~ '^\%(left\|right\)$'
|
||||
elseif prop =~ '^\%(left\|rigth\)$'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'image-rendering'
|
||||
let values = ["auto", "crisp-edges", "pixelated"]
|
||||
|
@@ -23,7 +23,7 @@ endif
|
||||
|
||||
function decada#Unit_Name () dict " {{{1
|
||||
" Convert filename into acs unit:
|
||||
" 1: remove the file extension.
|
||||
" 1: remove the file extenstion.
|
||||
" 2: replace all double '_' or '-' with an dot (which denotes a separate)
|
||||
" 3: remove a trailing '_' (which denotes a specification)
|
||||
return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '')
|
||||
|
40
runtime/autoload/dist/ft.vim
vendored
40
runtime/autoload/dist/ft.vim
vendored
@@ -219,23 +219,6 @@ func dist#ft#FTe()
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Distinguish between Forth and F#.
|
||||
" Provided by Doug Kearns.
|
||||
func dist#ft#FTfs()
|
||||
if exists("g:filetype_fs")
|
||||
exe "setf " . g:filetype_fs
|
||||
else
|
||||
let line = getline(nextnonblank(1))
|
||||
" comments and colon definitions
|
||||
if line =~ '^\s*\.\=( ' || line =~ '^\s*\\G\= ' || line =~ '^\\$'
|
||||
\ || line =~ '^\s*: \S'
|
||||
setf forth
|
||||
else
|
||||
setf fsharp
|
||||
endif
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Distinguish between HTML, XHTML and Django
|
||||
func dist#ft#FThtml()
|
||||
let n = 1
|
||||
@@ -281,16 +264,6 @@ func dist#ft#ProtoCheck(default)
|
||||
endfunc
|
||||
|
||||
func dist#ft#FTm()
|
||||
if exists("g:filetype_m")
|
||||
exe "setf " . g:filetype_m
|
||||
return
|
||||
endif
|
||||
|
||||
" excluding end(for|function|if|switch|while) common to Murphi
|
||||
let octave_block_terminators = '\<end\%(_try_catch\|classdef\|enumeration\|events\|methods\|parfor\|properties\)\>'
|
||||
|
||||
let objc_preprocessor = '^\s*#\s*\%(import\|include\|define\|if\|ifn\=def\|undef\|line\|error\|pragma\)\>'
|
||||
|
||||
let n = 1
|
||||
let saw_comment = 0 " Whether we've seen a multiline comment leader.
|
||||
while n < 100
|
||||
@@ -301,16 +274,10 @@ func dist#ft#FTm()
|
||||
" anything more definitive.
|
||||
let saw_comment = 1
|
||||
endif
|
||||
if line =~ '^\s*//' || line =~ '^\s*@import\>' || line =~ objc_preprocessor
|
||||
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|//\)'
|
||||
setf objc
|
||||
return
|
||||
endif
|
||||
if line =~ '^\s*\%(#\|%!\)' || line =~ '^\s*unwind_protect\>' ||
|
||||
\ line =~ '\%(^\|;\)\s*' .. octave_block_terminators
|
||||
setf octave
|
||||
return
|
||||
endif
|
||||
" TODO: could be Matlab or Octave
|
||||
if line =~ '^\s*%'
|
||||
setf matlab
|
||||
return
|
||||
@@ -331,8 +298,11 @@ func dist#ft#FTm()
|
||||
" or Murphi based on the comment leader. Assume the former as it is more
|
||||
" common.
|
||||
setf objc
|
||||
elseif exists("g:filetype_m")
|
||||
" Use user specified default filetype for .m
|
||||
exe "setf " . g:filetype_m
|
||||
else
|
||||
" Default is Matlab
|
||||
" Default is matlab
|
||||
setf matlab
|
||||
endif
|
||||
endfunc
|
||||
|
@@ -54,7 +54,7 @@ function! haskellcomplete#Complete(findstart, base)
|
||||
|
||||
if b:completingLangExtension
|
||||
if a:base ==? ""
|
||||
" Return all possible Lang extensions
|
||||
" Return all posible Lang extensions
|
||||
return s:langExtensions
|
||||
else
|
||||
let l:matches = []
|
||||
@@ -70,7 +70,7 @@ function! haskellcomplete#Complete(findstart, base)
|
||||
|
||||
elseif b:completingOptionsGHC
|
||||
if a:base ==? ""
|
||||
" Return all possible GHC options
|
||||
" Return all posible GHC options
|
||||
return s:optionsGHC
|
||||
else
|
||||
let l:matches = []
|
||||
@@ -86,7 +86,7 @@ function! haskellcomplete#Complete(findstart, base)
|
||||
|
||||
elseif b:completingModule
|
||||
if a:base ==? ""
|
||||
" Return all possible modules
|
||||
" Return all posible modules
|
||||
return s:commonModules
|
||||
else
|
||||
let l:matches = []
|
||||
|
@@ -26,8 +26,8 @@ endfunction
|
||||
" Runs all discovered healthchecks if a:plugin_names is empty.
|
||||
function! health#check(plugin_names) abort
|
||||
let healthchecks = empty(a:plugin_names)
|
||||
\ ? s:discover_healthchecks()
|
||||
\ : s:get_healthcheck(a:plugin_names)
|
||||
\ ? s:discover_health_checks()
|
||||
\ : s:to_fn_names(a:plugin_names)
|
||||
|
||||
tabnew
|
||||
setlocal wrap breakindent linebreak
|
||||
@@ -41,29 +41,25 @@ function! health#check(plugin_names) abort
|
||||
call setline(1, 'ERROR: No healthchecks found.')
|
||||
else
|
||||
redraw|echo 'Running healthchecks...'
|
||||
for name in sort(keys(healthchecks))
|
||||
let [func, type] = healthchecks[name]
|
||||
let s:output = []
|
||||
for c in healthchecks
|
||||
let output = ''
|
||||
call append('$', split(printf("\n%s\n%s", c, repeat('=',72)), "\n"))
|
||||
try
|
||||
if func == ''
|
||||
throw 'healthcheck_not_found'
|
||||
endif
|
||||
eval type == 'v' ? call(func, []) : luaeval(func)
|
||||
let output = "\n\n".execute('call '.c.'()')
|
||||
catch
|
||||
let s:output = [] " Clear the output
|
||||
if v:exception =~# 'healthcheck_not_found'
|
||||
call health#report_error('No healthcheck found for "'.name.'" plugin.')
|
||||
if v:exception =~# '^Vim\%((\a\+)\)\=:E117.*\V'.c
|
||||
let output = execute(
|
||||
\ 'call health#report_error(''No healthcheck found for "'
|
||||
\ .s:to_plugin_name(c)
|
||||
\ .'" plugin.'')')
|
||||
else
|
||||
call health#report_error(printf(
|
||||
\ "Failed to run healthcheck for \"%s\" plugin. Exception:\n%s\n%s",
|
||||
\ name, v:throwpoint, v:exception))
|
||||
let output = execute(
|
||||
\ 'call health#report_error(''Failed to run healthcheck for "'
|
||||
\ .s:to_plugin_name(c)
|
||||
\ .'" plugin. Exception:''."\n".v:throwpoint."\n".v:exception)')
|
||||
endif
|
||||
endtry
|
||||
let header = [name. ': ' . func, repeat('=', 72)]
|
||||
" remove empty line after header from report_start
|
||||
let s:output = s:output[0] == '' ? s:output[1:] : s:output
|
||||
let s:output = header + s:output + ['']
|
||||
call append('$', s:output)
|
||||
call append('$', split(output, "\n") + [''])
|
||||
redraw
|
||||
endfor
|
||||
endif
|
||||
@@ -75,13 +71,9 @@ function! health#check(plugin_names) abort
|
||||
redraw|echo ''
|
||||
endfunction
|
||||
|
||||
function! s:collect_output(output)
|
||||
let s:output += split(a:output, "\n", 1)
|
||||
endfunction
|
||||
|
||||
" Starts a new report.
|
||||
function! health#report_start(name) abort
|
||||
call s:collect_output("\n## " . a:name)
|
||||
echo "\n## " . a:name
|
||||
endfunction
|
||||
|
||||
" Indents lines *except* line 1 of a string if it contains newlines.
|
||||
@@ -127,21 +119,21 @@ endfunction " }}}
|
||||
|
||||
" Use {msg} to report information in the current section
|
||||
function! health#report_info(msg) abort " {{{
|
||||
call s:collect_output(s:format_report_message('INFO', a:msg))
|
||||
echo s:format_report_message('INFO', a:msg)
|
||||
endfunction " }}}
|
||||
|
||||
" Reports a successful healthcheck.
|
||||
function! health#report_ok(msg) abort " {{{
|
||||
call s:collect_output(s:format_report_message('OK', a:msg))
|
||||
echo s:format_report_message('OK', a:msg)
|
||||
endfunction " }}}
|
||||
|
||||
" Reports a health warning.
|
||||
" a:1: Optional advice (string or list)
|
||||
function! health#report_warn(msg, ...) abort " {{{
|
||||
if a:0 > 0
|
||||
call s:collect_output(s:format_report_message('WARNING', a:msg, a:1))
|
||||
echo s:format_report_message('WARNING', a:msg, a:1)
|
||||
else
|
||||
call s:collect_output(s:format_report_message('WARNING', a:msg))
|
||||
echo s:format_report_message('WARNING', a:msg)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
@@ -149,73 +141,37 @@ endfunction " }}}
|
||||
" a:1: Optional advice (string or list)
|
||||
function! health#report_error(msg, ...) abort " {{{
|
||||
if a:0 > 0
|
||||
call s:collect_output(s:format_report_message('ERROR', a:msg, a:1))
|
||||
echo s:format_report_message('ERROR', a:msg, a:1)
|
||||
else
|
||||
call s:collect_output(s:format_report_message('ERROR', a:msg))
|
||||
echo s:format_report_message('ERROR', a:msg)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" From a path return a list [{name}, {func}, {type}] representing a healthcheck
|
||||
function! s:filepath_to_healthcheck(path) abort
|
||||
if a:path =~# 'vim$'
|
||||
let name = matchstr(a:path, '\zs[^\/]*\ze\.vim$')
|
||||
let func = 'health#'.name.'#check'
|
||||
let type = 'v'
|
||||
else
|
||||
let base_path = substitute(a:path,
|
||||
\ '.*lua[\/]\(.\{-}\)[\/]health\([\/]init\)\?\.lua$',
|
||||
\ '\1', '')
|
||||
let name = substitute(base_path, '[\/]', '.', 'g')
|
||||
let func = 'require("'.name.'.health").check()'
|
||||
let type = 'l'
|
||||
endif
|
||||
return [name, func, type]
|
||||
function! s:filepath_to_function(name) abort
|
||||
return substitute(substitute(substitute(a:name, '.*autoload[\/]', '', ''),
|
||||
\ '\.vim', '#check', ''), '[\/]', '#', 'g')
|
||||
endfunction
|
||||
|
||||
function! s:discover_healthchecks() abort
|
||||
return s:get_healthcheck('*')
|
||||
function! s:discover_health_checks() abort
|
||||
let healthchecks = globpath(&runtimepath, 'autoload/health/*.vim', 1, 1)
|
||||
let healthchecks = map(healthchecks, '<SID>filepath_to_function(v:val)')
|
||||
return healthchecks
|
||||
endfunction
|
||||
|
||||
" Returns Dictionary {name: [func, type], ..} representing healthchecks
|
||||
function! s:get_healthcheck(plugin_names) abort
|
||||
let health_list = s:get_healthcheck_list(a:plugin_names)
|
||||
let healthchecks = {}
|
||||
for c in health_list
|
||||
let normalized_name = substitute(c[0], '-', '_', 'g')
|
||||
let existent = get(healthchecks, normalized_name, [])
|
||||
" Prefer Lua over vim entries
|
||||
if existent != [] && existent[2] == 'l'
|
||||
continue
|
||||
else
|
||||
let healthchecks[normalized_name] = c
|
||||
endif
|
||||
endfor
|
||||
let output = {}
|
||||
for v in values(healthchecks)
|
||||
let output[v[0]] = v[1:]
|
||||
endfor
|
||||
return output
|
||||
endfunction
|
||||
|
||||
" Returns list of lists [ [{name}, {func}, {type}] ] representing healthchecks
|
||||
function! s:get_healthcheck_list(plugin_names) abort
|
||||
" Translates a list of plugin names to healthcheck function names.
|
||||
function! s:to_fn_names(plugin_names) abort
|
||||
let healthchecks = []
|
||||
let plugin_names = type('') == type(a:plugin_names)
|
||||
let plugin_names = type('') ==# type(a:plugin_names)
|
||||
\ ? split(a:plugin_names, '', v:false)
|
||||
\ : a:plugin_names
|
||||
for p in plugin_names
|
||||
" support vim/lsp/health{/init/}.lua as :checkhealth vim.lsp
|
||||
let p = substitute(p, '\.', '/', 'g')
|
||||
let p = substitute(p, '*$', '**', 'g') " find all submodule e.g vim*
|
||||
let paths = nvim_get_runtime_file('autoload/health/'.p.'.vim', v:true)
|
||||
\ + nvim_get_runtime_file('lua/**/'.p.'/health/init.lua', v:true)
|
||||
\ + nvim_get_runtime_file('lua/**/'.p.'/health.lua', v:true)
|
||||
if len(paths) == 0
|
||||
let healthchecks += [[p, '', '']] " healthchek not found
|
||||
else
|
||||
let healthchecks += map(uniq(sort(paths)),
|
||||
\'<SID>filepath_to_healthcheck(v:val)')
|
||||
end
|
||||
call add(healthchecks, 'health#'.p.'#check')
|
||||
endfor
|
||||
return healthchecks
|
||||
endfunction
|
||||
|
||||
" Extracts 'foo' from 'health#foo#check'.
|
||||
function! s:to_plugin_name(fn_name) abort
|
||||
return substitute(a:fn_name,
|
||||
\ '\v.*health\#(.+)\#check.*', '\1', '')
|
||||
endfunction
|
||||
|
@@ -710,7 +710,7 @@ function! s:check_perl() abort
|
||||
|
||||
let latest_cpan = s:system(latest_cpan_cmd)
|
||||
if s:shell_error || empty(latest_cpan)
|
||||
call health#report_error('Failed to run: '. join(latest_cpan_cmd, " "),
|
||||
call health#report_error('Failed to run: '. latest_cpan_cmd,
|
||||
\ ["Make sure you're connected to the internet.",
|
||||
\ 'Are you behind a firewall or proxy?'])
|
||||
return
|
||||
|
5
runtime/autoload/health/treesitter.vim
Normal file
5
runtime/autoload/health/treesitter.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
function! health#treesitter#check() abort
|
||||
call health#report_start('Checking treesitter configuration')
|
||||
lua require 'vim.treesitter.health'.check_health()
|
||||
endfunction
|
||||
|
@@ -486,7 +486,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
|
||||
endif
|
||||
endif
|
||||
" Value of attribute completion {{{
|
||||
" If attr contains =\s*[\"'] we match value of attribute
|
||||
" If attr contains =\s*[\"'] we catched value of attribute
|
||||
if attr =~ "=\s*[\"']" || attr =~ "=\s*$"
|
||||
" Let do attribute specific completion
|
||||
let attrname = matchstr(attr, '.*\ze\s*=')
|
||||
|
@@ -58,7 +58,6 @@ function! man#open_page(count, mods, ...) abort
|
||||
else
|
||||
execute 'silent keepalt' a:mods 'stag' l:target
|
||||
endif
|
||||
call s:set_options(v:false)
|
||||
finally
|
||||
call setbufvar(l:buf, '&tagfunc', l:save_tfu)
|
||||
endtry
|
||||
@@ -197,21 +196,13 @@ function! s:extract_sect_and_name_ref(ref) abort
|
||||
if empty(name)
|
||||
throw 'manpage reference cannot contain only parentheses'
|
||||
endif
|
||||
return ['', s:spaces_to_underscores(name)]
|
||||
return ['', name]
|
||||
endif
|
||||
let left = split(ref, '(')
|
||||
" see ':Man 3X curses' on why tolower.
|
||||
" TODO(nhooyr) Not sure if this is portable across OSs
|
||||
" but I have not seen a single uppercase section.
|
||||
return [tolower(split(left[1], ')')[0]), s:spaces_to_underscores(left[0])]
|
||||
endfunction
|
||||
|
||||
" replace spaces in a man page name with underscores
|
||||
" intended for PostgreSQL, which has man pages like 'CREATE_TABLE(7)';
|
||||
" while editing SQL source code, it's nice to visually select 'CREATE TABLE'
|
||||
" and hit 'K', which requires this transformation
|
||||
function! s:spaces_to_underscores(str)
|
||||
return substitute(a:str, ' ', '_', 'g')
|
||||
return [tolower(split(left[1], ')')[0]), left[0]]
|
||||
endfunction
|
||||
|
||||
function! s:get_path(sect, name) abort
|
||||
|
@@ -1,7 +1,7 @@
|
||||
" netrw.vim: Handles file transfer and remote directory listing across
|
||||
" AUTOLOAD SECTION
|
||||
" Date: Aug 16, 2021
|
||||
" Version: 171
|
||||
" Date: Sep 18, 2020
|
||||
" Version: 170
|
||||
" Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
|
||||
" Copyright: Copyright (C) 2016 Charles E. Campbell {{{1
|
||||
@@ -43,7 +43,7 @@ if exists("s:needspatches")
|
||||
endfor
|
||||
endif
|
||||
|
||||
let g:loaded_netrw = "v171"
|
||||
let g:loaded_netrw = "v170"
|
||||
if !exists("s:NOTE")
|
||||
let s:NOTE = 0
|
||||
let s:WARNING = 1
|
||||
@@ -93,7 +93,7 @@ fun! netrw#ErrorMsg(level,msg,errnum)
|
||||
else
|
||||
let msg= level.a:msg
|
||||
endif
|
||||
let s:popuperr_id = popup_atcursor(msg,{})
|
||||
let s:popuperr_id = popup_beval(msg,{})
|
||||
let s:popuperr_text= ""
|
||||
elseif g:netrw_use_errorwindow
|
||||
" (default) netrw creates a one-line window to show error/warning
|
||||
@@ -322,7 +322,6 @@ call s:NetrwInit("g:netrw_banner" , 1)
|
||||
call s:NetrwInit("g:netrw_browse_split", 0)
|
||||
call s:NetrwInit("g:netrw_bufsettings" , "noma nomod nonu nobl nowrap ro nornu")
|
||||
call s:NetrwInit("g:netrw_chgwin" , -1)
|
||||
call s:NetrwInit("g:netrw_clipboard" , 1)
|
||||
call s:NetrwInit("g:netrw_compress" , "gzip")
|
||||
call s:NetrwInit("g:netrw_ctags" , "ctags")
|
||||
if exists("g:netrw_cursorline") && !exists("g:netrw_cursor")
|
||||
@@ -332,7 +331,6 @@ endif
|
||||
call s:NetrwInit("g:netrw_cursor" , 2)
|
||||
let s:netrw_usercul = &cursorline
|
||||
let s:netrw_usercuc = &cursorcolumn
|
||||
"call Decho("(netrw) COMBAK: cuc=".&l:cuc." cul=".&l:cul." initialization of s:netrw_cu[cl]")
|
||||
call s:NetrwInit("g:netrw_cygdrive","/cygdrive")
|
||||
" Default values - d-g ---------- {{{3
|
||||
call s:NetrwInit("s:didstarstar",0)
|
||||
@@ -1608,8 +1606,7 @@ endfun
|
||||
fun! s:NetrwOptionsSave(vt)
|
||||
" call Dfunc("s:NetrwOptionsSave(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")."<".bufname(bufnr("%")).">"." winnr($)=".winnr("$")." mod=".&mod." ma=".&ma)
|
||||
" call Decho(a:vt."netrw_optionsave".(exists("{a:vt}netrw_optionsave")? ("=".{a:vt}netrw_optionsave) : " doesn't exist"),'~'.expand("<slnum>"))
|
||||
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt." hid=".&hid,'~'.expand("<slnum>"))
|
||||
" call Decho("(s:NetrwOptionsSave) lines=".&lines)
|
||||
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>"))
|
||||
|
||||
if !exists("{a:vt}netrw_optionsave")
|
||||
let {a:vt}netrw_optionsave= 1
|
||||
@@ -1635,9 +1632,6 @@ fun! s:NetrwOptionsSave(vt)
|
||||
let {a:vt}netrw_cinokeep = &l:cino
|
||||
let {a:vt}netrw_comkeep = &l:com
|
||||
let {a:vt}netrw_cpokeep = &l:cpo
|
||||
let {a:vt}netrw_cuckeep = &l:cuc
|
||||
let {a:vt}netrw_culkeep = &l:cul
|
||||
" call Decho("(s:NetrwOptionsSave) COMBAK: cuc=".&l:cuc." cul=".&l:cul)
|
||||
let {a:vt}netrw_diffkeep = &l:diff
|
||||
let {a:vt}netrw_fenkeep = &l:fen
|
||||
if !exists("g:netrw_ffkeep") || g:netrw_ffkeep
|
||||
@@ -1645,11 +1639,9 @@ fun! s:NetrwOptionsSave(vt)
|
||||
endif
|
||||
let {a:vt}netrw_fokeep = &l:fo " formatoptions
|
||||
let {a:vt}netrw_gdkeep = &l:gd " gdefault
|
||||
let {a:vt}netrw_gokeep = &l:go " guioptions
|
||||
let {a:vt}netrw_hidkeep = &l:hidden
|
||||
let {a:vt}netrw_imkeep = &l:im
|
||||
let {a:vt}netrw_iskkeep = &l:isk
|
||||
let {a:vt}netrw_lines = &lines
|
||||
let {a:vt}netrw_lskeep = &l:ls
|
||||
let {a:vt}netrw_makeep = &l:ma
|
||||
let {a:vt}netrw_magickeep = &l:magic
|
||||
@@ -1701,18 +1693,12 @@ fun! s:NetrwOptionsSafe(islocal)
|
||||
endif
|
||||
call s:NetrwSetSafeSetting("&l:ci",0)
|
||||
call s:NetrwSetSafeSetting("&l:cin",0)
|
||||
if g:netrw_fastbrowse > a:islocal
|
||||
call s:NetrwSetSafeSetting("&l:bh","hide")
|
||||
else
|
||||
call s:NetrwSetSafeSetting("&l:bh","delete")
|
||||
endif
|
||||
call s:NetrwSetSafeSetting("&l:cino","")
|
||||
call s:NetrwSetSafeSetting("&l:com","")
|
||||
if &cpo =~ 'a' | call s:NetrwSetSafeSetting("&cpo",substitute(&cpo,'a','','g')) | endif
|
||||
if &cpo =~ 'A' | call s:NetrwSetSafeSetting("&cpo",substitute(&cpo,'A','','g')) | endif
|
||||
setl fo=nroql2
|
||||
" call s:NetrwSetSafeSetting("&go","begmr")
|
||||
if &go =~ '\ca' | call s:NetrwSetSafeSetting("&go",substitute(&go,'\ca','','g')) | endif
|
||||
call s:NetrwSetSafeSetting("&l:hid",0)
|
||||
call s:NetrwSetSafeSetting("&l:im",0)
|
||||
setl isk+=@ isk+=* isk+=/
|
||||
@@ -1726,10 +1712,7 @@ fun! s:NetrwOptionsSafe(islocal)
|
||||
call s:NetrwSetSafeSetting("&l:tw",0)
|
||||
call s:NetrwSetSafeSetting("&l:wig","")
|
||||
setl cedit&
|
||||
|
||||
" set up cuc and cul based on g:netrw_cursor and listing style
|
||||
" COMBAK -- cuc cul related
|
||||
call s:NetrwCursor(0)
|
||||
call s:NetrwCursor()
|
||||
|
||||
" allow the user to override safe options
|
||||
" call Decho("ft<".&ft."> ei=".&ei,'~'.expand("<slnum>"))
|
||||
@@ -1747,14 +1730,11 @@ endfun
|
||||
" s:NetrwOptionsRestore: restore options (based on prior s:NetrwOptionsSave) {{{2
|
||||
fun! s:NetrwOptionsRestore(vt)
|
||||
" call Dfunc("s:NetrwOptionsRestore(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> winnr($)=".winnr("$"))
|
||||
" call Decho("(s:NetrwOptionsRestore) lines=".&lines)
|
||||
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>"))
|
||||
if !exists("{a:vt}netrw_optionsave")
|
||||
" call Decho("case ".a:vt."netrw_optionsave : doesn't exist",'~'.expand("<slnum>"))
|
||||
" call Decho("..doing filetype detect anyway")
|
||||
filetype detect
|
||||
" call Decho("..settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>"))
|
||||
" call Decho("..ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
|
||||
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>"))
|
||||
" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
|
||||
" call Dret("s:NetrwOptionsRestore : ".a:vt."netrw_optionsave doesn't exist")
|
||||
return
|
||||
endif
|
||||
@@ -1771,53 +1751,41 @@ fun! s:NetrwOptionsRestore(vt)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
" call Decho("(s:NetrwOptionsRestore) #1 lines=".&lines)
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_aikeep","&l:ai")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_awkeep","&l:aw")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_blkeep","&l:bl")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_btkeep","&l:bt")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_bombkeep","&l:bomb")
|
||||
" call Decho("(s:NetrwOptionsRestore) #2 lines=".&lines)
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_cedit","&cedit")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_cikeep","&l:ci")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_cinkeep","&l:cin")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_cinokeep","&l:cino")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_comkeep","&l:com")
|
||||
" call Decho("(s:NetrwOptionsRestore) #3 lines=".&lines)
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_cpokeep","&l:cpo")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_diffkeep","&l:diff")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_fenkeep","&l:fen")
|
||||
if exists("g:netrw_ffkeep") && g:netrw_ffkeep
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_ffkeep")","&l:ff")
|
||||
endif
|
||||
" call Decho("(s:NetrwOptionsRestore) #4 lines=".&lines)
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_fokeep","&l:fo")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_gdkeep","&l:gd")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_gokeep" ,"&l:go")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_hidkeep","&l:hidden")
|
||||
" call Decho("(s:NetrwOptionsRestore) #5 lines=".&lines)
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_imkeep","&l:im")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_iskkeep","&l:isk")
|
||||
" call Decho("(s:NetrwOptionsRestore) #6 lines=".&lines)
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_lines" ,"&lines")
|
||||
" call Decho("(s:NetrwOptionsRestore) #7 lines=".&lines)
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_lskeep","&l:ls")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_makeep","&l:ma")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_magickeep","&l:magic")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_modkeep","&l:mod")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_nukeep","&l:nu")
|
||||
" call Decho("(s:NetrwOptionsRestore) #8 lines=".&lines)
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_rnukeep","&l:rnu")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_repkeep","&l:report")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_rokeep","&l:ro")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_selkeep","&l:sel")
|
||||
" call Decho("(s:NetrwOptionsRestore) #9 lines=".&lines)
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_spellkeep","&l:spell")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_twkeep","&l:tw")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_wigkeep","&l:wig")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_wrapkeep","&l:wrap")
|
||||
call s:NetrwRestoreSetting(a:vt."netrw_writekeep","&l:write")
|
||||
" call Decho("(s:NetrwOptionsRestore) #10 lines=".&lines)
|
||||
call s:NetrwRestoreSetting("s:yykeep","@@")
|
||||
" former problem: start with liststyle=0; press <i> : result, following line resets l:ts.
|
||||
" Fixed; in s:PerformListing, when w:netrw_liststyle is s:LONGLIST, will use a printf to pad filename with spaces
|
||||
@@ -1859,11 +1827,9 @@ fun! s:NetrwOptionsRestore(vt)
|
||||
" were having their filetype detect-generated settings overwritten by
|
||||
" NetrwOptionRestore.
|
||||
if &ft != "netrw"
|
||||
" call Decho("before: filetype detect (ft=".&ft.")",'~'.expand("<slnum>"))
|
||||
" call Decho("filetype detect (ft=".&ft.")",'~'.expand("<slnum>"))
|
||||
filetype detect
|
||||
" call Decho("after : filetype detect (ft=".&ft.")",'~'.expand("<slnum>"))
|
||||
endif
|
||||
" call Decho("(s:NetrwOptionsRestore) lines=".&lines)
|
||||
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>"))
|
||||
" call Dret("s:NetrwOptionsRestore : tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> modified=".&modified." modifiable=".&modifiable." readonly=".&readonly)
|
||||
endfun
|
||||
@@ -1913,7 +1879,7 @@ fun! s:NetrwRestoreSetting(keepvar,setting)
|
||||
" typically called from s:NetrwOptionsRestore
|
||||
" call s:NetrwRestoreSettings(keep-option-variable-name,'associated-option')
|
||||
" ex. call s:NetrwRestoreSetting(a:vt."netrw_selkeep","&l:sel")
|
||||
" Restores option (but only if different) from a:keepvar
|
||||
" Restores option (if different) from a keepvar
|
||||
if exists(a:keepvar)
|
||||
exe "let keepvarval= ".a:keepvar
|
||||
exe "let setting= ".a:setting
|
||||
@@ -2841,10 +2807,8 @@ fun! netrw#SetTreetop(iscmd,...)
|
||||
if isdirectory(s:NetrwFile(a:1))
|
||||
" call Decho("a:1<".a:1."> is a directory",'~'.expand("<slnum>"))
|
||||
let treedir= a:1
|
||||
let s:netrw_treetop = treedir
|
||||
elseif exists("b:netrw_curdir") && (isdirectory(s:NetrwFile(b:netrw_curdir."/".a:1)) || a:1 =~ '^\a\{3,}://')
|
||||
let treedir= b:netrw_curdir."/".a:1
|
||||
let s:netrw_treetop = treedir
|
||||
" call Decho("a:1<".a:1."> is NOT a directory, using treedir<".treedir.">",'~'.expand("<slnum>"))
|
||||
else
|
||||
" normally the cursor is left in the message window.
|
||||
@@ -2853,7 +2817,6 @@ fun! netrw#SetTreetop(iscmd,...)
|
||||
call netrw#ErrorMsg(s:ERROR,"sorry, ".a:1." doesn't seem to be a directory!",95)
|
||||
exe bufwinnr(netrwbuf)."wincmd w"
|
||||
let treedir= "."
|
||||
let s:netrw_treetop = getcwd()
|
||||
endif
|
||||
endif
|
||||
" call Decho("treedir<".treedir.">",'~'.expand("<slnum>"))
|
||||
@@ -4108,7 +4071,6 @@ fun! s:NetrwFileInfo(islocal,fname)
|
||||
elseif g:netrw_sizestyle =~# 'h'
|
||||
let lsopt= "-lsadh --si"
|
||||
endif
|
||||
" call Decho("(s:NetrwFileInfo) lsopt<".lsopt.">")
|
||||
if (has("unix") || has("macunix")) && executable("/bin/ls")
|
||||
|
||||
if getline(".") == "../"
|
||||
@@ -4170,10 +4132,9 @@ endfun
|
||||
" s:NetrwGetBuffer: [get a new|find an old netrw] buffer for a netrw listing {{{2
|
||||
" returns 0=cleared buffer
|
||||
" 1=re-used buffer (buffer not cleared)
|
||||
" Nov 09, 2020: tst952 shows that when user does :set hidden that NetrwGetBuffer will come up with a [No Name] buffer (hid fix)
|
||||
fun! s:NetrwGetBuffer(islocal,dirname)
|
||||
" call Dfunc("s:NetrwGetBuffer(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".g:netrw_liststyle)
|
||||
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." hid=".&hid,'~'.expand("<slnum>"))
|
||||
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo,'~'.expand("<slnum>"))
|
||||
" call Decho("netrwbuf dictionary=".(exists("s:netrwbuf")? string(s:netrwbuf) : 'n/a'),'~'.expand("<slnum>"))
|
||||
" call Dredir("ls!","s:NetrwGetBuffer")
|
||||
let dirname= a:dirname
|
||||
@@ -4223,26 +4184,17 @@ fun! s:NetrwGetBuffer(islocal,dirname)
|
||||
endif
|
||||
" call Decho(" bufnum#".bufnum,'~'.expand("<slnum>"))
|
||||
|
||||
" hijack the current buffer
|
||||
" IF the buffer already has the desired name
|
||||
" AND it is empty
|
||||
let curbuf = bufname("%")
|
||||
if curbuf == '.'
|
||||
let curbuf = getcwd()
|
||||
endif
|
||||
" call Dredir("ls!","NetrwGetFile (renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">)")
|
||||
" call Decho("deciding if netrw may hijack the current buffer#".bufnr("%")."<".curbuf.">",'~'.expand("<slnum>"))
|
||||
" call Decho("..dirname<".dirname."> IF dirname == bufname",'~'.expand("<slnum>"))
|
||||
" call Decho("..curbuf<".curbuf.">",'~'.expand("<slnum>"))
|
||||
" call Decho("..line($)=".line("$")." AND this is 1",'~'.expand("<slnum>"))
|
||||
" call Decho("..getline(%)<".getline("%")."> AND this line is empty",'~'.expand("<slnum>"))
|
||||
if dirname == curbuf && line("$") == 1 && getline("%") == ""
|
||||
" highjack the current buffer if
|
||||
" it has the desired name
|
||||
" it is empty
|
||||
" call Decho("deciding if I can highjack the current buffer#".bufnr("%"),'~'.expand("<slnum>"))
|
||||
" call Decho("..dirname<".dirname.">",'~'.expand("<slnum>"))
|
||||
" call Decho("..bufname<".bufname("%").">",'~'.expand("<slnum>"))
|
||||
" call Decho("..getline($)<".getline("$").">",'~'.expand("<slnum>"))
|
||||
if dirname == bufname("%") && line("$") == 1 && getline("%") == ""
|
||||
" call Dret("s:NetrwGetBuffer 0<cleared buffer> : highjacking buffer#".bufnr("%"))
|
||||
return 0
|
||||
else " DEBUG
|
||||
" call Decho("..did NOT hijack buffer",'~'.expand("<slnum>"))
|
||||
endif
|
||||
" Aug 14, 2021: was thinking about looking for a [No Name] buffer here and using it, but that might cause problems
|
||||
|
||||
" get enew buffer and name it -or- re-use buffer {{{3
|
||||
if bufnum < 0 " get enew buffer and name it
|
||||
@@ -4567,7 +4519,7 @@ fun! s:NetrwListStyle(islocal)
|
||||
" refresh the listing
|
||||
" call Decho("refresh the listing",'~'.expand("<slnum>"))
|
||||
NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
|
||||
NetrwKeepj call s:NetrwCursor(0)
|
||||
NetrwKeepj call s:NetrwCursor()
|
||||
|
||||
" repoint t:netrw_lexbufnr if appropriate
|
||||
if exists("repointlexbufnr")
|
||||
@@ -4773,7 +4725,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
|
||||
endif
|
||||
" call Decho("b:netrw_curdir<".b:netrw_curdir.">")
|
||||
|
||||
" NetrwBrowseChgDir; save options and initialize {{{3
|
||||
" NetrwBrowseChgDir: save options and initialize {{{3
|
||||
" call Decho("saving options",'~'.expand("<slnum>"))
|
||||
call s:SavePosn(s:netrw_posn)
|
||||
NetrwKeepj call s:NetrwOptionsSave("s:")
|
||||
@@ -4841,8 +4793,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
|
||||
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") && newdir !~ '^\(/\|\a:\)'
|
||||
" call Decho("edit-a-file: handle tree listing: w:netrw_treedict<".(exists("w:netrw_treedict")? string(w:netrw_treedict) : 'n/a').">",'~'.expand("<slnum>"))
|
||||
" call Decho("edit-a-file: newdir<".newdir.">",'~'.expand("<slnum>"))
|
||||
" let newdir = s:NetrwTreePath(s:netrw_treetop)
|
||||
" call Decho("edit-a-file: COMBAK why doesn't this recognize file1's directory???")
|
||||
let dirname= s:NetrwTreeDir(a:islocal)
|
||||
"COMBAK : not working for a symlink -- but what about a regular file? a directory?
|
||||
" call Decho("COMBAK : not working for a symlink -- but what about a regular file? a directory?")
|
||||
@@ -4956,8 +4906,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
|
||||
exe "NetrwKeepj e ".fnameescape(dirname)
|
||||
endif
|
||||
" call Decho("edit-a-file: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod,'~'.expand("<slnum>"))
|
||||
" COMBAK -- cuc cul related
|
||||
call s:NetrwCursor(1)
|
||||
call s:NetrwCursor()
|
||||
if &hidden || &bufhidden == "hide"
|
||||
" file came from vim's hidden storage. Don't "restore" options with it.
|
||||
let dorestore= 0
|
||||
@@ -4978,8 +4927,8 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
|
||||
elseif type(g:Netrw_funcref) == 3
|
||||
" call Decho("edit-a-file: handling a list of g:Netrw_funcrefs",'~'.expand("<slnum>"))
|
||||
for Fncref in g:Netrw_funcref
|
||||
if type(Fncref) == 2
|
||||
NetrwKeepj call Fncref()
|
||||
if type(FncRef) == 2
|
||||
NetrwKeepj call FncRef()
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
@@ -5271,12 +5220,6 @@ fun! netrw#BrowseX(fname,remote)
|
||||
endif
|
||||
" call Decho("not a local file nor a webpage request",'~'.expand("<slnum>"))
|
||||
|
||||
if exists("g:netrw_browsex_viewer") && exists("g:netrw_browsex_support_remote") && !g:netrw_browsex_support_remote
|
||||
let remote = a:remote
|
||||
else
|
||||
let remote = 0
|
||||
endif
|
||||
|
||||
let ykeep = @@
|
||||
let screenposn = winsaveview()
|
||||
" call Decho("saving posn to screenposn<".string(screenposn).">",'~'.expand("<slnum>"))
|
||||
@@ -5321,9 +5264,9 @@ fun! netrw#BrowseX(fname,remote)
|
||||
endif
|
||||
" call Decho("exten<".exten.">",'~'.expand("<slnum>"))
|
||||
|
||||
if remote == 1
|
||||
if a:remote == 1
|
||||
" create a local copy
|
||||
" call Decho("remote: remote=".remote.": create a local copy of <".a:fname.">",'~'.expand("<slnum>"))
|
||||
" call Decho("remote: a:remote=".a:remote.": create a local copy of <".a:fname.">",'~'.expand("<slnum>"))
|
||||
setl bh=delete
|
||||
call netrw#NetRead(3,a:fname)
|
||||
" attempt to rename tempfile
|
||||
@@ -5345,7 +5288,7 @@ fun! netrw#BrowseX(fname,remote)
|
||||
let fname= s:netrw_tmpfile
|
||||
endif
|
||||
else
|
||||
" call Decho("local: remote=".remote.": handling local copy of <".a:fname.">",'~'.expand("<slnum>"))
|
||||
" call Decho("local: a:remote=".a:remote.": handling local copy of <".a:fname.">",'~'.expand("<slnum>"))
|
||||
let fname= a:fname
|
||||
" special ~ handler for local
|
||||
if fname =~ '^\~' && expand("$HOME") != ""
|
||||
@@ -5439,8 +5382,8 @@ fun! netrw#BrowseX(fname,remote)
|
||||
if a:fname =~ '^https\=://'
|
||||
" atril does not appear to understand how to handle html -- so use gvim to edit the document
|
||||
let use_ctrlo= 0
|
||||
" call Decho("fname<".fname.">")
|
||||
" call Decho("a:fname<".a:fname.">")
|
||||
" call Decho("(COMBAK) fname<".fname.">")
|
||||
" call Decho("(COMBAK) a:fname<".a:fname.">")
|
||||
call s:NetrwExe("sil! !gvim ".fname.' -c "keepj keepalt file '.fnameescape(a:fname).'"')
|
||||
|
||||
else
|
||||
@@ -5488,12 +5431,12 @@ fun! netrw#BrowseX(fname,remote)
|
||||
" return to prior buffer (directory listing)
|
||||
" Feb 12, 2008: had to de-activiate removal of
|
||||
" temporary file because it wasn't getting seen.
|
||||
" if remote == 1 && fname != a:fname
|
||||
" if a:remote == 1 && fname != a:fname
|
||||
"" call Decho("deleting temporary file<".fname.">",'~'.expand("<slnum>"))
|
||||
" call s:NetrwDelete(fname)
|
||||
" endif
|
||||
|
||||
if remote == 1
|
||||
if a:remote == 1
|
||||
setl bh=delete bt=nofile
|
||||
if g:netrw_use_noswf
|
||||
setl noswf
|
||||
@@ -5552,7 +5495,7 @@ fun! s:NetrwBufRename(newname)
|
||||
let b:junk= 1
|
||||
" call Decho("rename buffer: sil! keepj keepalt file ".fnameescape(a:newname),'~'.expand("<slnum>"))
|
||||
exe 'sil! keepj keepalt file '.fnameescape(a:newname)
|
||||
" call Dredir("ls!","s:NetrwBufRename (before bwipe)~".expand("<slnum>"))
|
||||
" call Dredir("ls!","s:NetrwBufRename (before bwipe)")
|
||||
let oldbufnr= bufnr(oldbufname)
|
||||
" call Decho("oldbufname<".oldbufname."> oldbufnr#".oldbufnr,'~'.expand("<slnum>"))
|
||||
" call Decho("bufnr(%)=".bufnr("%"),'~'.expand("<slnum>"))
|
||||
@@ -5561,9 +5504,6 @@ fun! s:NetrwBufRename(newname)
|
||||
exe "bwipe! ".oldbufnr
|
||||
" else " Decho
|
||||
" call Decho("did *not* bwipe buf#".oldbufnr,'~'.expand("<slnum>"))
|
||||
" call Decho("..reason: if oldbufname<".oldbufname."> is empty",'~'.expand("<slnum>"))"
|
||||
" call Decho("..reason: if oldbufnr#".oldbufnr." is -1",'~'.expand("<slnum>"))"
|
||||
" call Decho("..reason: if oldbufnr#".oldbufnr." != bufnr(%)#".bufnr("%"),'~'.expand("<slnum>"))"
|
||||
endif
|
||||
" call Dredir("ls!","s:NetrwBufRename (after rename)")
|
||||
" else " Decho
|
||||
@@ -6542,7 +6482,7 @@ fun! s:NetrwMaps(islocal)
|
||||
if !hasmapto('<Plug>NetrwRefresh')
|
||||
nmap <buffer> <unique> <c-l> <Plug>NetrwRefresh
|
||||
endif
|
||||
nnoremap <buffer> <silent> <Plug>NetrwRefresh <c-l>:call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,(exists("w:netrw_liststyle") && exists("w:netrw_treetop") && w:netrw_liststyle == 3)? w:netrw_treetop : './'))<cr>
|
||||
nnoremap <buffer> <silent> <Plug>NetrwRefresh <c-l>:call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,(w:netrw_liststyle == 3)? w:netrw_treetop : './'))<cr>
|
||||
if s:didstarstar || !mapcheck("<s-down>","n")
|
||||
nnoremap <buffer> <silent> <s-down> :Nexplore<cr>
|
||||
endif
|
||||
@@ -6791,7 +6731,7 @@ fun! s:NetrwMarkFile(islocal,fname)
|
||||
|
||||
" sanity check
|
||||
if empty(a:fname)
|
||||
" call Dret("s:NetrwMarkFile : empty fname")
|
||||
" call Dret("s:NetrwMarkFile : emtpy fname")
|
||||
return
|
||||
endif
|
||||
let curdir = s:NetrwGetCurdir(a:islocal)
|
||||
@@ -8170,23 +8110,6 @@ fun! s:NetrwOpenFile(islocal)
|
||||
call inputsave()
|
||||
let fname= input("Enter filename: ")
|
||||
call inputrestore()
|
||||
" call Decho("(s:NetrwOpenFile) fname<".fname.">",'~'.expand("<slnum>"))
|
||||
|
||||
" determine if Lexplore is in use
|
||||
if exists("t:netrw_lexbufnr")
|
||||
" check if t:netrw_lexbufnr refers to a netrw window
|
||||
" call Decho("(s:netrwOpenFile) ..t:netrw_lexbufnr=".t:netrw_lexbufnr,'~'.expand("<slnum>"))
|
||||
let lexwinnr = bufwinnr(t:netrw_lexbufnr)
|
||||
if lexwinnr != -1 && exists("g:netrw_chgwin") && g:netrw_chgwin != -1
|
||||
" call Decho("(s:netrwOpenFile) ..Lexplore in use",'~'.expand("<slnum>"))
|
||||
exe "NetrwKeepj keepalt ".g:netrw_chgwin."wincmd w"
|
||||
exe "NetrwKeepj e ".fnameescape(fname)
|
||||
let @@= ykeep
|
||||
" call Dret("s:NetrwOpenFile : creating a file with Lexplore mode")
|
||||
endif
|
||||
endif
|
||||
|
||||
" Does the filename contain a path?
|
||||
if fname !~ '[/\\]'
|
||||
if exists("b:netrw_curdir")
|
||||
if exists("g:netrw_quiet")
|
||||
@@ -8525,7 +8448,6 @@ fun! s:NetrwPrevWinOpen(islocal)
|
||||
let lastwinnr = winnr("$")
|
||||
let curword = s:NetrwGetWord()
|
||||
let choice = 0
|
||||
let s:prevwinopen= 1 " lets s:NetrwTreeDir() know that NetrwPrevWinOpen called it
|
||||
let s:treedir = s:NetrwTreeDir(a:islocal)
|
||||
let curdir = s:treedir
|
||||
" call Decho("winnr($)#".lastwinnr." curword<".curword.">",'~'.expand("<slnum>"))
|
||||
@@ -8853,7 +8775,7 @@ fun! s:NetrwPreview(path) range
|
||||
" 0 : 1: top -- preview window is horizontally split off and on the top
|
||||
" 0 : 0: bot -- preview window is horizontally split off and on the bottom
|
||||
"
|
||||
" Note that the file being previewed is already known to not be a directory, hence we can avoid doing a LocalBrowseCheck() check via
|
||||
" Note that the file being previewed is already known to not be a directory, hence we can avoid doing a LocalBrowse() check via
|
||||
" the BufEnter event set up in netrwPlugin.vim
|
||||
" call Decho("exe ".(g:netrw_alto? "top " : "bot ").(g:netrw_preview? "vert " : "")."pedit ".fnameescape(a:path),'~'.expand("<slnum>"))
|
||||
let eikeep = &ei
|
||||
@@ -9288,20 +9210,14 @@ fun! s:NetrwTreeDir(islocal)
|
||||
" call Decho("g:netrw_keepdir =".(exists("g:netrw_keepdir")? g:netrw_keepdir : 'n/a'),'~'.expand("<slnum>"))
|
||||
" call Decho("w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'),'~'.expand("<slnum>"))
|
||||
" call Decho("w:netrw_treetop =".(exists("w:netrw_treetop")? w:netrw_treetop : 'n/a'),'~'.expand("<slnum>"))
|
||||
" call Decho("current line<".getline(".").">")
|
||||
|
||||
if exists("s:treedir") && exists("s:prevwinopen")
|
||||
if exists("s:treedir")
|
||||
" s:NetrwPrevWinOpen opens a "previous" window -- and thus needs to and does call s:NetrwTreeDir early
|
||||
" call Decho('s:NetrwPrevWinOpen opens a "previous" window -- and thus needs to and does call s:NetrwTreeDir early')
|
||||
let treedir= s:treedir
|
||||
unlet s:treedir
|
||||
unlet s:prevwinopen
|
||||
" call Dret("s:NetrwTreeDir ".treedir.": early return since s:treedir existed previously")
|
||||
" call Dret("s:NetrwTreeDir ".treedir)
|
||||
return treedir
|
||||
endif
|
||||
if exists("s:prevwinopen")
|
||||
unlet s:prevwinopen
|
||||
endif
|
||||
|
||||
if !exists("b:netrw_curdir") || b:netrw_curdir == ""
|
||||
let b:netrw_curdir= getcwd()
|
||||
@@ -9508,29 +9424,20 @@ endfun
|
||||
" Called by s:PerformListing()
|
||||
fun! s:NetrwTreeListing(dirname)
|
||||
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
|
||||
" call Dfunc("s:NetrwTreeListing() bufname<".expand("%").">")
|
||||
" call Dfunc("NetrwTreeListing() bufname<".expand("%").">")
|
||||
" call Decho("curdir<".a:dirname.">",'~'.expand("<slnum>"))
|
||||
" call Decho("win#".winnr().": w:netrw_treetop ".(exists("w:netrw_treetop")? "exists" : "doesn't exist")." w:netrw_treedict ".(exists("w:netrw_treedict")? "exists" : "doesn't exit"),'~'.expand("<slnum>"))
|
||||
" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
|
||||
|
||||
" update the treetop
|
||||
" call Decho("update the treetop",'~'.expand("<slnum>"))
|
||||
if !exists("w:netrw_treetop")
|
||||
" call Decho("update the treetop (w:netrw_treetop doesn't exist yet)",'~'.expand("<slnum>"))
|
||||
let w:netrw_treetop= a:dirname
|
||||
let s:netrw_treetop= w:netrw_treetop
|
||||
" call Decho("w:netrw_treetop<".w:netrw_treetop."> (reusing)",'~'.expand("<slnum>"))
|
||||
elseif (w:netrw_treetop =~ ('^'.a:dirname) && s:Strlen(a:dirname) < s:Strlen(w:netrw_treetop)) || a:dirname !~ ('^'.w:netrw_treetop)
|
||||
" call Decho("update the treetop (override w:netrw_treetop with a:dirname<".a:dirname.">)",'~'.expand("<slnum>"))
|
||||
let w:netrw_treetop= a:dirname
|
||||
let s:netrw_treetop= w:netrw_treetop
|
||||
" call Decho("w:netrw_treetop<".w:netrw_treetop."> (went up)",'~'.expand("<slnum>"))
|
||||
endif
|
||||
if exists("w:netrw_treetop")
|
||||
let s:netrw_treetop= w:netrw_treetop
|
||||
else
|
||||
let w:netrw_treetop= getcwd()
|
||||
let s:netrw_treetop= w:netrw_treetop
|
||||
endif
|
||||
|
||||
if !exists("w:netrw_treedict")
|
||||
" insure that we have a treedict, albeit empty
|
||||
@@ -9568,7 +9475,7 @@ fun! s:NetrwTreeListing(dirname)
|
||||
|
||||
exe "setl ".g:netrw_bufsettings
|
||||
|
||||
" call Dret("s:NetrwTreeListing : bufname<".expand("%").">")
|
||||
" call Dret("NetrwTreeListing : bufname<".expand("%").">")
|
||||
return
|
||||
endif
|
||||
endfun
|
||||
@@ -10712,7 +10619,7 @@ endfun
|
||||
" ---------------------------------------------------------------------
|
||||
" netrw#LocalBrowseCheck: {{{2
|
||||
fun! netrw#LocalBrowseCheck(dirname)
|
||||
" This function is called by netrwPlugin.vim's s:LocalBrowseCheck(), s:NetrwRexplore(),
|
||||
" This function is called by netrwPlugin.vim's s:LocalBrowse(), s:NetrwRexplore(),
|
||||
" and by <cr> when atop a listed file/directory (via a buffer-local map)
|
||||
"
|
||||
" unfortunate interaction -- split window debugging can't be used here, must use
|
||||
@@ -10863,7 +10770,7 @@ endfun
|
||||
" Hiding a buffer means that it will be re-used when examined, hence "fast".
|
||||
" (re-using a buffer may not be as accurate)
|
||||
"
|
||||
" s:netrw_events : doesn't exist, s:LocalFastBrowser() will install autocmds with medium-speed or fast browsing
|
||||
" s:netrw_events : doesn't exist, s:LocalFastBrowser() will install autocmds whena med or fast browsing
|
||||
" =1: autocmds installed, but ignore next FocusGained event to avoid initial double-refresh of listing.
|
||||
" BufEnter may be first event, then a FocusGained event. Ignore the first FocusGained event.
|
||||
" If :Explore used: it sets s:netrw_events to 2, so no FocusGained events are ignored.
|
||||
@@ -11025,14 +10932,13 @@ fun! s:LocalListing()
|
||||
let sz= s:NetrwHumanReadable(sz)
|
||||
endif
|
||||
let longfile= printf("%-".(g:netrw_maxfilenamelen+1)."s",pfile)
|
||||
let pfile = longfile.sz." ".strftime(g:netrw_timefmt,getftime(filename))
|
||||
let pfile = longfile.fsz." ".strftime(g:netrw_timefmt,getftime(filename))
|
||||
" call Decho("longlist support: sz=".sz." fsz=".fsz,'~'.expand("<slnum>"))
|
||||
endif
|
||||
|
||||
if g:netrw_sort_by =~# "^t"
|
||||
" sort by time (handles time up to 1 quintillion seconds, US)
|
||||
" Decorate listing by prepending a timestamp/ . Sorting will then be done based on time.
|
||||
" call Decho("implementing g:netrw_sort_by=".g:netrw_sort_by." (time)")
|
||||
" call Decho("getftime(".filename.")=".getftime(filename),'~'.expand("<slnum>"))
|
||||
let t = getftime(filename)
|
||||
let ft = strpart("000000000000000000",1,18-strlen(t)).t
|
||||
@@ -11042,7 +10948,6 @@ fun! s:LocalListing()
|
||||
|
||||
elseif g:netrw_sort_by =~ "^s"
|
||||
" sort by size (handles file sizes up to 1 quintillion bytes, US)
|
||||
" call Decho("implementing g:netrw_sort_by=".g:netrw_sort_by." (size)")
|
||||
" call Decho("getfsize(".filename.")=".getfsize(filename),'~'.expand("<slnum>"))
|
||||
let sz = getfsize(filename)
|
||||
if g:netrw_sizestyle =~# "[hH]"
|
||||
@@ -11055,7 +10960,6 @@ fun! s:LocalListing()
|
||||
|
||||
else
|
||||
" sort by name
|
||||
" call Decho("implementing g:netrw_sort_by=".g:netrw_sort_by." (name)")
|
||||
" call Decho("exe NetrwKeepj put ='".pfile."'",'~'.expand("<slnum>"))
|
||||
sil! NetrwKeepj put=pfile
|
||||
endif
|
||||
@@ -11778,32 +11682,19 @@ endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" s:NetrwCursor: responsible for setting cursorline/cursorcolumn based upon g:netrw_cursor {{{2
|
||||
fun! s:NetrwCursor(editfile)
|
||||
fun! s:NetrwCursor()
|
||||
if !exists("w:netrw_liststyle")
|
||||
let w:netrw_liststyle= g:netrw_liststyle
|
||||
endif
|
||||
" call Dfunc("s:NetrwCursor() ft<".&ft."> liststyle=".w:netrw_liststyle." g:netrw_cursor=".g:netrw_cursor." s:netrw_usercuc=".s:netrw_usercuc." s:netrw_usercul=".s:netrw_usercul)
|
||||
|
||||
" call Decho("(s:NetrwCursor) COMBAK: cuc=".&l:cuc." cul=".&l:cul)
|
||||
|
||||
if &ft != "netrw"
|
||||
" if the current window isn't a netrw directory listing window, then use user cursorline/column
|
||||
" settings. Affects when netrw is used to read/write a file using scp/ftp/etc.
|
||||
" call Decho("case ft!=netrw: use user cul,cuc",'~'.expand("<slnum>"))
|
||||
let &l:cursorline = s:netrw_usercul
|
||||
let &l:cursorcolumn = s:netrw_usercuc
|
||||
|
||||
elseif g:netrw_cursor == 8
|
||||
if w:netrw_liststyle == s:WIDELIST
|
||||
setl cursorline
|
||||
setl cursorcolumn
|
||||
else
|
||||
setl cursorline
|
||||
endif
|
||||
elseif g:netrw_cursor == 7
|
||||
setl cursorline
|
||||
elseif g:netrw_cursor == 6
|
||||
if w:netrw_liststyle == s:WIDELIST
|
||||
setl cursorline
|
||||
endif
|
||||
elseif g:netrw_cursor == 4
|
||||
" all styles: cursorline, cursorcolumn
|
||||
" call Decho("case g:netrw_cursor==4: setl cul cuc",'~'.expand("<slnum>"))
|
||||
@@ -11820,22 +11711,26 @@ fun! s:NetrwCursor(editfile)
|
||||
else
|
||||
" call Decho("case g:netrw_cursor==3 and not wide: setl cul (use user's cuc)",'~'.expand("<slnum>"))
|
||||
setl cursorline
|
||||
let &l:cursorcolumn = s:netrw_usercuc
|
||||
endif
|
||||
|
||||
elseif g:netrw_cursor == 2
|
||||
" thin-long-tree: cursorline, user's cursorcolumn
|
||||
" wide : cursorline, user's cursorcolumn
|
||||
" call Decho("case g:netrw_cursor==2: setl cuc (use user's cul)",'~'.expand("<slnum>"))
|
||||
let &l:cursorcolumn = s:netrw_usercuc
|
||||
setl cursorline
|
||||
|
||||
elseif g:netrw_cursor == 1
|
||||
" thin-long-tree: user's cursorline, user's cursorcolumn
|
||||
" wide : cursorline, user's cursorcolumn
|
||||
let &l:cursorcolumn = s:netrw_usercuc
|
||||
if w:netrw_liststyle == s:WIDELIST
|
||||
" call Decho("case g:netrw_cursor==2 and wide: setl cul (use user's cuc)",'~'.expand("<slnum>"))
|
||||
setl cursorline
|
||||
else
|
||||
" call Decho("case g:netrw_cursor==2 and not wide: (use user's cul,cuc)",'~'.expand("<slnum>"))
|
||||
let &l:cursorline = s:netrw_usercul
|
||||
endif
|
||||
|
||||
else
|
||||
@@ -11845,7 +11740,6 @@ fun! s:NetrwCursor(editfile)
|
||||
let &l:cursorcolumn = s:netrw_usercuc
|
||||
endif
|
||||
|
||||
" call Decho("(s:NetrwCursor) COMBAK: cuc=".&l:cuc." cul=".&l:cul)
|
||||
" call Dret("s:NetrwCursor : l:cursorline=".&l:cursorline." l:cursorcolumn=".&l:cursorcolumn)
|
||||
endfun
|
||||
|
||||
@@ -11859,7 +11753,6 @@ fun! s:RestoreCursorline()
|
||||
if exists("s:netrw_usercuc")
|
||||
let &l:cursorcolumn = s:netrw_usercuc
|
||||
endif
|
||||
" call Decho("(s:RestoreCursorline) COMBAK: cuc=".&l:cuc." cul=".&l:cul)
|
||||
" call Dret("s:RestoreCursorline : restored cul=".&l:cursorline." cuc=".&l:cursorcolumn)
|
||||
endfun
|
||||
|
||||
@@ -11894,38 +11787,12 @@ fun! s:NetrwDelete(path)
|
||||
return result
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" s:NetrwBufRemover: removes a buffer that: {{{2s
|
||||
" has buffer-id > 1
|
||||
" is unlisted
|
||||
" is unnamed
|
||||
" does not appear in any window
|
||||
fun! s:NetrwBufRemover(bufid)
|
||||
" call Dfunc("s:NetrwBufRemover(".a:bufid.")")
|
||||
" call Decho("buf#".a:bufid." ".((a:bufid > 1)? ">" : "≯")." must be >1 for removal","~".expand("<slnum>"))
|
||||
" call Decho("buf#".a:bufid." is ".(buflisted(a:bufid)? "listed" : "unlisted"),"~".expand("<slnum>"))
|
||||
" call Decho("buf#".a:bufid." has name <".bufname(a:bufid).">","~".expand("<slnum>"))
|
||||
" call Decho("buf#".a:bufid." has winid#".bufwinid(a:bufid),"~".expand("<slnum>"))
|
||||
|
||||
if a:bufid > 1 && !buflisted(a:bufid) && bufname(a:bufid) == "" && bufwinid(a:bufid) == -1
|
||||
" call Decho("(s:NetrwBufRemover) removing buffer#".a:bufid,"~".expand("<slnum>"))
|
||||
exe "bd! ".a:bufid
|
||||
endif
|
||||
|
||||
" call Dret("s:NetrwBufRemover")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" s:NetrwEnew: opens a new buffer, passes netrw buffer variables through {{{2
|
||||
fun! s:NetrwEnew(...)
|
||||
" call Dfunc("s:NetrwEnew() a:0=".a:0." win#".winnr()." winnr($)=".winnr("$")." bufnr($)=".bufnr("$")." expand(%)<".expand("%").">")
|
||||
" call Decho("curdir<".((a:0>0)? a:1 : "")."> buf#".bufnr("%")."<".bufname("%").">",'~'.expand("<slnum>"))
|
||||
|
||||
" Clean out the last buffer:
|
||||
" Check if the last buffer has # > 1, is unlisted, is unnamed, and does not appear in a window
|
||||
" If so, delete it.
|
||||
call s:NetrwBufRemover(bufnr("$"))
|
||||
|
||||
" grab a function-local-variable copy of buffer variables
|
||||
" call Decho("make function-local copy of netrw variables",'~'.expand("<slnum>"))
|
||||
if exists("b:netrw_bannercnt") |let netrw_bannercnt = b:netrw_bannercnt |endif
|
||||
|
@@ -1,7 +1,7 @@
|
||||
" netrwSettings.vim: makes netrw settings simpler
|
||||
" Date: Aug 12, 2021
|
||||
" Date: Nov 09, 2016
|
||||
" Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" Version: 17 ASTRO-ONLY
|
||||
" Version: 16
|
||||
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{1
|
||||
" Permission is hereby granted to use and distribute this code,
|
||||
" with or without modifications, provided that this copyright
|
||||
@@ -19,7 +19,7 @@
|
||||
if exists("g:loaded_netrwSettings") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_netrwSettings = "v17"
|
||||
let g:loaded_netrwSettings = "v16"
|
||||
if v:version < 700
|
||||
echohl WarningMsg
|
||||
echo "***warning*** this version of netrwSettings needs vim 7.0"
|
||||
@@ -31,7 +31,7 @@ endif
|
||||
" NetrwSettings: {{{1
|
||||
fun! netrwSettings#NetrwSettings()
|
||||
" this call is here largely just to insure that netrw has been loaded
|
||||
call netrw#WinPath("")
|
||||
call netrw#SavePosn()
|
||||
if !exists("g:loaded_netrw")
|
||||
echohl WarningMsg | echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" | echohl None
|
||||
return
|
||||
|
@@ -9,7 +9,7 @@
|
||||
"
|
||||
" let g:phpcomplete_relax_static_constraint = 1/0 [default 0]
|
||||
" Enables completion for non-static methods when completing for static context (::).
|
||||
" This generates E_STRICT level warning, but php calls these methods nonetheless.
|
||||
" This generates E_STRICT level warning, but php calls these methods nontheless.
|
||||
"
|
||||
" let g:phpcomplete_complete_for_unknown_classes = 1/0 [default 0]
|
||||
" Enables completion of variables and functions in "everything under the sun" fashion
|
||||
@@ -28,7 +28,7 @@
|
||||
" This option controls the number of characters the user needs to type before
|
||||
" the tags will be searched for namespaces and classes in typed out namespaces in
|
||||
" "use ..." context. Setting this to 0 is not recommended because that means the code
|
||||
" have to scan every tag, and vim's taglist() function runs extremely slow with a
|
||||
" have to scan every tag, and vim's taglist() function runs extremly slow with a
|
||||
" "match everything" pattern.
|
||||
"
|
||||
" let g:phpcomplete_parse_docblock_comments = 1/0 [default 0]
|
||||
@@ -268,7 +268,7 @@ function! phpcomplete#CompleteUse(base) " {{{
|
||||
call add(no_namespace_matches, {'word': namespace_for_class.'\'.tag.name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename })
|
||||
endif
|
||||
endfor
|
||||
" if it seems that the tags file have namespace information we can safely throw
|
||||
" if it seems that the tags file have namespace informations we can safely throw
|
||||
" away namespaceless tag matches since we can be sure they are invalid
|
||||
if patched_ctags_detected
|
||||
no_namespace_matches = []
|
||||
@@ -810,7 +810,7 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports)
|
||||
endif
|
||||
endfor
|
||||
|
||||
" resolve the typed in part with namespaces (if there's a \ in it)
|
||||
" resolve the typed in part with namespaces (if theres a \ in it)
|
||||
let [tag_match_pattern, namespace_for_class] = phpcomplete#ExpandClassName(a:base, a:current_namespace, a:imports)
|
||||
|
||||
let tags = []
|
||||
@@ -926,11 +926,11 @@ function! s:getNextCharWithPos(filelines, current_pos) " {{{
|
||||
endfunction " }}}
|
||||
|
||||
function! phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibited_modifiers) " {{{
|
||||
" if there's no modifier, and no modifier is allowed and no modifier is required
|
||||
" if theres no modifier, and no modifier is allowed and no modifier is required
|
||||
if len(a:modifiers) == 0 && len(a:required_modifiers) == 0
|
||||
return 1
|
||||
else
|
||||
" check if every required modifier is present
|
||||
" check if every requred modifier is present
|
||||
for required_modifier in a:required_modifiers
|
||||
if index(a:modifiers, required_modifier) == -1
|
||||
return 0
|
||||
@@ -1258,7 +1258,7 @@ function! phpcomplete#GetCurrentInstruction(line_number, col_number, phpbegin) "
|
||||
endif
|
||||
endif
|
||||
|
||||
" save the coma position for later use if there's a "naked" , possibly separating a parameter and it is not in a parented part
|
||||
" save the coma position for later use if theres a "naked" , possibly separating a parameter and it is not in a parented part
|
||||
if first_coma_break_pos == -1 && current_char == ','
|
||||
let first_coma_break_pos = len(instruction)
|
||||
endif
|
||||
@@ -1304,7 +1304,7 @@ function! phpcomplete#GetCurrentInstruction(line_number, col_number, phpbegin) "
|
||||
|
||||
" there were a "naked" coma in the instruction
|
||||
if first_coma_break_pos != -1
|
||||
if instruction !~? '^use' && instruction !~? '^class' " use ... statements and class declarations should not be broken up by comas
|
||||
if instruction !~? '^use' && instruction !~? '^class' " use ... statements and class delcarations should not be broken up by comas
|
||||
let pos = (-1 * first_coma_break_pos) + 1
|
||||
let instruction = instruction[pos :]
|
||||
endif
|
||||
@@ -1316,7 +1316,7 @@ function! phpcomplete#GetCurrentInstruction(line_number, col_number, phpbegin) "
|
||||
" clear everything up until the first (
|
||||
let instruction = substitute(instruction, '^\(if\|while\|foreach\|for\)\s*(\s*', '', '')
|
||||
|
||||
" lets iterate through the instruction until we can find the pair for the opening (
|
||||
" lets iterate trough the instruction until we can find the pair for the opening (
|
||||
let i = 0
|
||||
let depth = 1
|
||||
while i < len(instruction)
|
||||
@@ -1424,7 +1424,7 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
|
||||
let parts = split(substitute(type, '^\\', '', ''), '\')
|
||||
let class_candidate_namespace = join(parts[0:-2], '\')
|
||||
let classname_candidate = parts[-1]
|
||||
" check for renamed namespace in imports
|
||||
" check for renamed namepsace in imports
|
||||
if has_key(classstructure.imports, class_candidate_namespace)
|
||||
let class_candidate_namespace = classstructure.imports[class_candidate_namespace].name
|
||||
endif
|
||||
@@ -2023,7 +2023,7 @@ function! phpcomplete#GetCachedClassContents(classlocation, class_name) " {{{
|
||||
if getftime(classstructure.file) != classstructure.mtime
|
||||
let valid = 0
|
||||
" we could break here, but the time required for checking probably worth
|
||||
" the memory we can free by checking every file in the cached hierarchy
|
||||
" the the memory we can free by checking every file in the cached hirearchy
|
||||
call phpcomplete#ClearCachedClassContents(classstructure.file)
|
||||
endif
|
||||
endfor
|
||||
@@ -2037,7 +2037,7 @@ function! phpcomplete#GetCachedClassContents(classlocation, class_name) " {{{
|
||||
call remove(s:cache_classstructures, cache_key)
|
||||
call phpcomplete#ClearCachedClassContents(full_file_path)
|
||||
|
||||
" fall through for the read from files path
|
||||
" fall trough for the read from files path
|
||||
endif
|
||||
else
|
||||
call phpcomplete#ClearCachedClassContents(full_file_path)
|
||||
@@ -2590,7 +2590,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
let search_line = line
|
||||
let use_line = line
|
||||
|
||||
" add lines from the file until there's no ';' in them
|
||||
" add lines from the file until theres no ';' in them
|
||||
while search_line !~? ';' && l > 0
|
||||
" file lines are reversed so we need to go backwards
|
||||
let l -= 1
|
||||
@@ -2622,7 +2622,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
" find kind flags from tags or built in methods for the objects we extracted
|
||||
" they can be either classes, interfaces or namespaces, no other thing is importable in php
|
||||
for [key, import] in items(imports)
|
||||
" if there's a \ in the name we have it's definitely not a built in thing, look for tags
|
||||
" if theres a \ in the name we have it's definitely not a built in thing, look for tags
|
||||
if import.name =~ '\\'
|
||||
let patched_ctags_detected = 0
|
||||
let [classname, namespace_for_classes] = phpcomplete#ExpandClassName(import.name, '\', {})
|
||||
@@ -2679,10 +2679,10 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
let import['kind'] = 'i'
|
||||
let import['builtin'] = 1
|
||||
else
|
||||
" or can be a tag with exactly matching name
|
||||
" or can be a tag with exactly matchign name
|
||||
let tags = phpcomplete#GetTaglist('^'.import['name'].'$')
|
||||
for tag in tags
|
||||
" search for the first matching namespace, class, interface with no namespace
|
||||
" search for the first matchin namespace, class, interface with no namespace
|
||||
if !has_key(tag, 'namespace') && (tag.kind == 'n' || tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't')
|
||||
call extend(import, tag)
|
||||
let import['builtin'] = 0
|
||||
@@ -2900,7 +2900,7 @@ for [ext, data] in items(php_builtin['functions'])
|
||||
call extend(g:php_builtin_functions, data)
|
||||
endfor
|
||||
|
||||
" Built in class
|
||||
" Built in classs
|
||||
let g:php_builtin_classes = {}
|
||||
for [ext, data] in items(php_builtin['classes'])
|
||||
call extend(g:php_builtin_classes, data)
|
||||
@@ -2918,10 +2918,10 @@ for [ext, data] in items(php_builtin['constants'])
|
||||
call extend(g:php_constants, data)
|
||||
endfor
|
||||
|
||||
" When the classname not found or found but the tags doesn't contain that
|
||||
" class we will try to complete any method of any builtin class. To speed up
|
||||
" When the classname not found or found but the tags dosen't contain that
|
||||
" class we will try to complate any method of any builtin class. To speed up
|
||||
" that lookup we compile a 'ClassName::MethodName':'info' dictionary from the
|
||||
" builtin class information
|
||||
" builtin class informations
|
||||
let g:php_builtin_object_functions = {}
|
||||
|
||||
" When completing for 'everyting imaginable' (no class context, not a
|
||||
|
@@ -96,7 +96,7 @@ function! provider#pythonx#CheckForModule(prog, module, major_version) abort
|
||||
if prog_version !~ '^' . a:major_version
|
||||
return [0, prog_path . ' is Python ' . prog_version . ' and cannot provide Python '
|
||||
\ . a:major_version . '.']
|
||||
elseif prog_version =~ '^' . a:major_version && str2nr(prog_version[2:]) < str2nr(min_version[2:])
|
||||
elseif prog_version =~ '^' . a:major_version && prog_version < min_version
|
||||
return [0, prog_path . ' is Python ' . prog_version . ' and cannot provide Python >= '
|
||||
\ . min_version . '.']
|
||||
endif
|
||||
|
@@ -114,7 +114,7 @@ function! s:RegistrationCommands(host) abort
|
||||
let host_id = a:host.'-registration-clone'
|
||||
call remote#host#RegisterClone(host_id, a:host)
|
||||
let pattern = s:plugin_patterns[a:host]
|
||||
let paths = nvim_get_runtime_file('rplugin/'.a:host.'/'.pattern, 1)
|
||||
let paths = globpath(&rtp, 'rplugin/'.a:host.'/'.pattern, 1, 1)
|
||||
let paths = map(paths, 'tr(resolve(v:val),"\\","/")') " Normalize slashes #4795
|
||||
let paths = uniq(sort(paths))
|
||||
if empty(paths)
|
||||
|
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Mark Guzman <segfault@hasno.info>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2020 Apr 12
|
||||
" Last Change: 2019 Feb 25
|
||||
" ----------------------------------------------------------------------------
|
||||
"
|
||||
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
|
||||
@@ -501,8 +501,13 @@ class VimRubyCompletion
|
||||
return if rails_base == nil
|
||||
$:.push rails_base unless $:.index( rails_base )
|
||||
|
||||
bootfile = rails_base + "config/boot.rb"
|
||||
envfile = rails_base + "config/environment.rb"
|
||||
rails_config = rails_base + "config/"
|
||||
rails_lib = rails_base + "lib/"
|
||||
$:.push rails_config unless $:.index( rails_config )
|
||||
$:.push rails_lib unless $:.index( rails_lib )
|
||||
|
||||
bootfile = rails_config + "boot.rb"
|
||||
envfile = rails_config + "environment.rb"
|
||||
if File.exists?( bootfile ) && File.exists?( envfile )
|
||||
begin
|
||||
require bootfile
|
||||
|
@@ -17,7 +17,7 @@
|
||||
" and complete it.
|
||||
"
|
||||
" Version 16.0 (Dec 2015)
|
||||
" - NF: If resetting the cache and table, procedure or view completion
|
||||
" - NF: If reseting the cache and table, procedure or view completion
|
||||
" had been used via dbext, have dbext delete or recreate the
|
||||
" dictionary so that new objects are picked up for the
|
||||
" next completion.
|
||||
@@ -554,7 +554,7 @@ function! sqlcomplete#PreCacheSyntax(...)
|
||||
let syn_group_arr = g:omni_sql_precache_syntax_groups
|
||||
endif
|
||||
" For each group specified in the list, precache all
|
||||
" the syntax items.
|
||||
" the sytnax items.
|
||||
if !empty(syn_group_arr)
|
||||
for group_name in syn_group_arr
|
||||
let syn_items = extend( syn_items, s:SQLCGetSyntaxList(group_name) )
|
||||
@@ -577,7 +577,7 @@ function! sqlcomplete#ResetCacheSyntax(...)
|
||||
let syn_group_arr = g:omni_sql_precache_syntax_groups
|
||||
endif
|
||||
" For each group specified in the list, precache all
|
||||
" the syntax items.
|
||||
" the sytnax items.
|
||||
if !empty(syn_group_arr)
|
||||
for group_name in syn_group_arr
|
||||
let list_idx = index(s:syn_list, group_name, 0, &ignorecase)
|
||||
@@ -843,7 +843,7 @@ function! s:SQLCGetColumns(table_name, list_type)
|
||||
let curline = line(".")
|
||||
let curcol = col(".")
|
||||
|
||||
" Do not let searches wrap
|
||||
" Do not let searchs wrap
|
||||
setlocal nowrapscan
|
||||
" If . was entered, look at the word just before the .
|
||||
" We are looking for something like this:
|
||||
|
@@ -778,7 +778,7 @@ fun! tar#Vimuntar(...)
|
||||
elseif executable("gzip")
|
||||
silent exe "!gzip -d ".shellescape(tartail)
|
||||
else
|
||||
echoerr "unable to decompress<".tartail."> on this system"
|
||||
echoerr "unable to decompress<".tartail."> on this sytem"
|
||||
if simplify(curdir) != simplify(tarhome)
|
||||
" remove decompressed tarball, restore directory
|
||||
" call Decho("delete(".tartail.".tar)")
|
||||
|
@@ -693,7 +693,7 @@ func! tohtml#GetUserSettings() "{{{
|
||||
let user_settings = {}
|
||||
|
||||
" Define the correct option if the old option name exists and we haven't
|
||||
" already defined the correct one. Maybe I'll put out a warning message about
|
||||
" already defined the correct one. Maybe I'll put out a warnig message about
|
||||
" this sometime and remove the old option entirely at some even later time,
|
||||
" but for now just silently accept the old option.
|
||||
if exists('g:use_xhtml') && !exists("g:html_use_xhtml")
|
||||
|
@@ -39,7 +39,7 @@ let s:Parser.LINE_BUFFER_MAX_LEN = 100
|
||||
" Create a new Parser instance with the initial state and a target. The target
|
||||
" is a dictionary that will be the `self` of every State method call associated
|
||||
" with the parser, and may contain options normally passed to
|
||||
" `jobstart`(on_stdout/on_stderr will be overridden). Returns the target so it
|
||||
" `jobstart`(on_stdout/on_stderr will be overriden). Returns the target so it
|
||||
" can be called directly as the second argument of `jobstart`:
|
||||
"
|
||||
" call jobstart(prog_argv, vimexpect#Parser(initial_state, {'pty': 1}))
|
||||
|
@@ -199,7 +199,7 @@ function! xmlcomplete#CompleteTags(findstart, base)
|
||||
" 1. Events attributes
|
||||
if context =~ '\s'
|
||||
|
||||
" If attr contains =\s*[\"'] we catch value of attribute
|
||||
" If attr contains =\s*[\"'] we catched value of attribute
|
||||
if attr =~ "=\s*[\"']" || attr =~ "=\s*$"
|
||||
" Let do attribute specific completion
|
||||
let attrname = matchstr(attr, '.*\ze\s*=')
|
||||
|
@@ -1,7 +1,7 @@
|
||||
" zip.vim: Handles browsing zipfiles
|
||||
" AUTOLOAD PORTION
|
||||
" Date: Nov 08, 2021
|
||||
" Version: 32
|
||||
" Date: Jan 07, 2020
|
||||
" Version: 31
|
||||
" Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" License: Vim License (see vim's :help license)
|
||||
" Copyright: Copyright (C) 2005-2019 Charles E. Campbell {{{1
|
||||
@@ -20,7 +20,7 @@
|
||||
if &cp || exists("g:loaded_zip")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_zip= "v32"
|
||||
let g:loaded_zip= "v31"
|
||||
if v:version < 702
|
||||
echohl WarningMsg
|
||||
echo "***warning*** this version of zip needs vim 7.2 or later"
|
||||
@@ -81,7 +81,7 @@ fun! zip#Browse(zipfile)
|
||||
" sanity checks
|
||||
if !exists("*fnameescape")
|
||||
if &verbose > 1
|
||||
echoerr "the zip plugin is not available (your vim doesn't support fnameescape())"
|
||||
echoerr "the zip plugin is not available (your vim doens't support fnameescape())"
|
||||
endif
|
||||
return
|
||||
endif
|
||||
@@ -115,13 +115,7 @@ fun! zip#Browse(zipfile)
|
||||
setlocal bufhidden=hide
|
||||
setlocal nobuflisted
|
||||
setlocal nowrap
|
||||
|
||||
" Oct 12, 2021: need to re-use Bram's syntax/tar.vim.
|
||||
" Setting the filetype to zip doesn't do anything (currently),
|
||||
" but it is perhaps less confusing to curious perusers who do
|
||||
" a :echo &ft
|
||||
setf zip
|
||||
run! syntax/tar.vim
|
||||
set ft=tar
|
||||
|
||||
" give header
|
||||
call append(0, ['" zip.vim version '.g:loaded_zip,
|
||||
@@ -193,8 +187,8 @@ fun! s:ZipBrowseSelect()
|
||||
wincmd _
|
||||
endif
|
||||
let s:zipfile_{winnr()}= curfile
|
||||
" call Decho("exe e ".fnameescape("zipfile://".zipfile.'::'.fname))
|
||||
exe "noswapfile e ".fnameescape("zipfile://".zipfile.'::'.fname)
|
||||
" call Decho("exe e ".fnameescape("zipfile:".zipfile.'::'.fname))
|
||||
exe "noswapfile e ".fnameescape("zipfile:".zipfile.'::'.fname)
|
||||
filetype detect
|
||||
|
||||
let &report= repkeep
|
||||
@@ -209,11 +203,11 @@ fun! zip#Read(fname,mode)
|
||||
set report=10
|
||||
|
||||
if has("unix")
|
||||
let zipfile = substitute(a:fname,'zipfile://\(.\{-}\)::[^\\].*$','\1','')
|
||||
let fname = substitute(a:fname,'zipfile://.\{-}::\([^\\].*\)$','\1','')
|
||||
let zipfile = substitute(a:fname,'zipfile:\(.\{-}\)::[^\\].*$','\1','')
|
||||
let fname = substitute(a:fname,'zipfile:.\{-}::\([^\\].*\)$','\1','')
|
||||
else
|
||||
let zipfile = substitute(a:fname,'^.\{-}zipfile://\(.\{-}\)::[^\\].*$','\1','')
|
||||
let fname = substitute(a:fname,'^.\{-}zipfile://.\{-}::\([^\\].*\)$','\1','')
|
||||
let zipfile = substitute(a:fname,'^.\{-}zipfile:\(.\{-}\)::[^\\].*$','\1','')
|
||||
let fname = substitute(a:fname,'^.\{-}zipfile:.\{-}::\([^\\].*\)$','\1','')
|
||||
let fname = substitute(fname, '[', '[[]', 'g')
|
||||
endif
|
||||
" call Decho("zipfile<".zipfile.">")
|
||||
@@ -230,7 +224,7 @@ fun! zip#Read(fname,mode)
|
||||
|
||||
" the following code does much the same thing as
|
||||
" exe "keepj sil! r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fnameescape(fname),1)
|
||||
" but allows zipfile://... entries in quickfix lists
|
||||
" but allows zipfile:... entries in quickfix lists
|
||||
let temp = tempname()
|
||||
" call Decho("using temp file<".temp.">")
|
||||
let fn = expand('%:p')
|
||||
@@ -302,11 +296,11 @@ fun! zip#Write(fname)
|
||||
" call Decho("current directory now: ".getcwd())
|
||||
|
||||
if has("unix")
|
||||
let zipfile = substitute(a:fname,'zipfile://\(.\{-}\)::[^\\].*$','\1','')
|
||||
let fname = substitute(a:fname,'zipfile://.\{-}::\([^\\].*\)$','\1','')
|
||||
let zipfile = substitute(a:fname,'zipfile:\(.\{-}\)::[^\\].*$','\1','')
|
||||
let fname = substitute(a:fname,'zipfile:.\{-}::\([^\\].*\)$','\1','')
|
||||
else
|
||||
let zipfile = substitute(a:fname,'^.\{-}zipfile://\(.\{-}\)::[^\\].*$','\1','')
|
||||
let fname = substitute(a:fname,'^.\{-}zipfile://.\{-}::\([^\\].*\)$','\1','')
|
||||
let zipfile = substitute(a:fname,'^.\{-}zipfile:\(.\{-}\)::[^\\].*$','\1','')
|
||||
let fname = substitute(a:fname,'^.\{-}zipfile:.\{-}::\([^\\].*\)$','\1','')
|
||||
endif
|
||||
" call Decho("zipfile<".zipfile.">")
|
||||
" call Decho("fname <".fname.">")
|
||||
|
@@ -12,6 +12,6 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
" NOTE: compiler must be run with -vb to write whole source path, not only file
|
||||
" NOTE: compiler must be runned with -vb to write whole source path, not only file
|
||||
" name.
|
||||
CompilerSet errorformat=%f(%l\\,%c)\ %m
|
||||
|
@@ -1,16 +0,0 @@
|
||||
" scdoc compiler for Vim
|
||||
" Compiler: scdoc
|
||||
" Maintainer: Greg Anders <greg@gpanders.com>
|
||||
" Last Updated: 2019-10-24
|
||||
|
||||
if exists('current_compiler')
|
||||
finish
|
||||
endif
|
||||
let current_compiler = 'scdoc'
|
||||
|
||||
if exists(':CompilerSet') != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=scdoc\ <\ %\ 2>&1
|
||||
CompilerSet errorformat=Error\ at\ %l:%c:\ %m,%-G%.%#
|
@@ -1,17 +0,0 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Spectral for YAML
|
||||
" Maintainer: Romain Lafourcade <romainlafourcade@gmail.com>
|
||||
" Last Change: 2021 July 21
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "spectral"
|
||||
|
||||
if exists(":CompilerSet") != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=spectral\ lint\ %\ -f\ text
|
||||
CompilerSet errorformat=%f:%l:%c\ %t%.%\\{-}\ %m
|
||||
|
@@ -18,7 +18,7 @@ endif
|
||||
if exists('b:tex_ignore_makefile') || exists('g:tex_ignore_makefile') ||
|
||||
\(!filereadable('Makefile') && !filereadable('makefile'))
|
||||
" If buffer-local variable 'tex_flavor' exists, it defines TeX flavor,
|
||||
" otherwise the same for global variable with same name, else it will be
|
||||
" otherwize the same for global variable with same name, else it will be
|
||||
" LaTeX
|
||||
if exists("b:tex_flavor")
|
||||
let current_compiler = b:tex_flavor
|
||||
|
@@ -1,16 +0,0 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Yamllint for YAML
|
||||
" Maintainer: Romain Lafourcade <romainlafourcade@gmail.com>
|
||||
" Last Change: 2021 July 21
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "yamllint"
|
||||
|
||||
if exists(":CompilerSet") != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=yamllint\ -f\ parsable
|
||||
|
1631
runtime/doc/api.txt
1631
runtime/doc/api.txt
File diff suppressed because it is too large
Load Diff
@@ -171,13 +171,6 @@ o Enable Arabic settings [short-cut]
|
||||
and its support is preferred due to its level of offerings.
|
||||
'arabic' when 'termbidi' is enabled only sets the keymap.
|
||||
|
||||
For vertical window isolation while setting 'termbidi' an LTR
|
||||
vertical separator like "l" or "𝖨" may be used. It may also be
|
||||
hidden by changing its color to the foreground color: >
|
||||
:set fillchars=vert:l
|
||||
:hi VertSplit ctermbg=White
|
||||
< Note that this is a workaround, not a proper solution.
|
||||
|
||||
If, on the other hand, you'd like to be verbose and explicit and
|
||||
are opting not to use the 'arabic' short-cut command, here's what
|
||||
is needed (i.e. if you use ':set arabic' you can skip this section) -
|
||||
|
@@ -57,7 +57,7 @@ The special pattern <buffer> or <buffer=N> defines a buffer-local autocommand.
|
||||
See |autocmd-buflocal|.
|
||||
|
||||
Note: The ":autocmd" command can only be followed by another command when the
|
||||
'|' appears where the pattern is expected. This works: >
|
||||
'|' appears before {cmd}. This works: >
|
||||
:augroup mine | au! BufRead | augroup END
|
||||
But this sees "augroup" as part of the defined command: >
|
||||
:augroup mine | au! BufRead * | augroup END
|
||||
@@ -232,7 +232,7 @@ BufDelete Before deleting a buffer from the buffer list.
|
||||
*BufEnter*
|
||||
BufEnter After entering a buffer. Useful for setting
|
||||
options for a file type. Also executed when
|
||||
starting to edit a buffer.
|
||||
starting to edit a buffer, after the
|
||||
After |BufAdd|.
|
||||
After |BufReadPost|.
|
||||
*BufFilePost*
|
||||
@@ -499,10 +499,8 @@ CursorMoved After the cursor was moved in Normal or Visual
|
||||
mode or to another window. Also when the text
|
||||
of the cursor line has been changed, e.g. with
|
||||
"x", "rx" or "p".
|
||||
Not triggered when there is typeahead, while
|
||||
executing a script file, when an operator is
|
||||
pending, or when moving to another window while
|
||||
remaining at the same cursor position.
|
||||
Not triggered when there is typeahead or when
|
||||
an operator is pending.
|
||||
For an example see |match-parens|.
|
||||
Note: Cannot be skipped with |:noautocmd|.
|
||||
Careful: This is triggered very often, don't
|
||||
@@ -519,17 +517,11 @@ DiffUpdated After diffs have been updated. Depending on
|
||||
change or when doing |:diffupdate|.
|
||||
*DirChanged*
|
||||
DirChanged After the |current-directory| was changed.
|
||||
The pattern can be:
|
||||
"window" to trigger on `:lcd`
|
||||
"tabpage" to trigger on `:tcd`
|
||||
"global" to trigger on `:cd`
|
||||
"auto" to trigger on 'autochdir'.
|
||||
Sets these |v:event| keys:
|
||||
cwd: current working directory
|
||||
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).
|
||||
*FileAppendCmd*
|
||||
FileAppendCmd Before appending to a file. Should do the
|
||||
@@ -636,7 +628,7 @@ FilterReadPre Before reading a file from a filter command.
|
||||
*FilterWritePost*
|
||||
FilterWritePost After writing a file for a filter command or
|
||||
making a diff with an external diff (see
|
||||
|DiffUpdated| for internal diff).
|
||||
DiffUpdated for internal diff).
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer as with FilterWritePre.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
@@ -689,6 +681,23 @@ InsertCharPre When a character is typed in Insert mode,
|
||||
|
||||
Cannot change the text. |textlock|
|
||||
Not triggered when 'paste' is set.
|
||||
*TextYankPost*
|
||||
TextYankPost Just after a |yank| or |deleting| command, but not
|
||||
if the black hole register |quote_| is used nor
|
||||
for |setreg()|. Pattern must be *.
|
||||
Sets these |v:event| keys:
|
||||
inclusive
|
||||
operator
|
||||
regcontents
|
||||
regname
|
||||
regtype
|
||||
visual
|
||||
The `inclusive` flag combined with the |'[|
|
||||
and |']| marks can be used to calculate the
|
||||
precise region of the operation.
|
||||
|
||||
Non-recursive (event cannot trigger itself).
|
||||
Cannot change the text. |textlock|
|
||||
*InsertEnter*
|
||||
InsertEnter Just before starting Insert mode. Also for
|
||||
Replace mode and Virtual Replace mode. The
|
||||
@@ -789,11 +798,10 @@ QuickFixCmdPost Like QuickFixCmdPre, but after a quickfix
|
||||
*QuitPre*
|
||||
QuitPre When using `:quit`, `:wq` or `:qall`, before
|
||||
deciding whether it closes the current window
|
||||
or quits Vim. For `:wq` the buffer is written
|
||||
before QuitPre is triggered. Can be used to
|
||||
close any non-essential window if the current
|
||||
window is the last ordinary window.
|
||||
See also |ExitPre|, |WinClosed|.
|
||||
or quits Vim. Can be used to close any
|
||||
non-essential window if the current window is
|
||||
the last ordinary window.
|
||||
See also |ExitPre|, ||WinClosed|.
|
||||
*RemoteReply*
|
||||
RemoteReply When a reply from a Vim that functions as
|
||||
server was received |server2client()|. The
|
||||
@@ -906,8 +914,6 @@ TermLeave After leaving |Terminal-mode|.
|
||||
After TermClose.
|
||||
*TermClose*
|
||||
TermClose When a |terminal| job ends.
|
||||
Sets these |v:event| keys:
|
||||
status
|
||||
*TermResponse*
|
||||
TermResponse After the response to t_RV is received from
|
||||
the terminal. The value of |v:termresponse|
|
||||
@@ -937,23 +943,6 @@ TextChangedP After a change was made to the text in the
|
||||
current buffer in Insert mode, only when the
|
||||
popup menu is visible. Otherwise the same as
|
||||
TextChanged.
|
||||
*TextYankPost*
|
||||
TextYankPost Just after a |yank| or |deleting| command, but not
|
||||
if the black hole register |quote_| is used nor
|
||||
for |setreg()|. Pattern must be *.
|
||||
Sets these |v:event| keys:
|
||||
inclusive
|
||||
operator
|
||||
regcontents
|
||||
regname
|
||||
regtype
|
||||
visual
|
||||
The `inclusive` flag combined with the |'[|
|
||||
and |']| marks can be used to calculate the
|
||||
precise region of the operation.
|
||||
|
||||
Non-recursive (event cannot trigger itself).
|
||||
Cannot change the text. |textlock|
|
||||
*User*
|
||||
User Not executed automatically. Use |:doautocmd|
|
||||
to trigger this, typically for "custom events"
|
||||
@@ -1002,9 +991,8 @@ VimResume After Nvim resumes from |suspend| state.
|
||||
*VimSuspend*
|
||||
VimSuspend Before Nvim enters |suspend| state.
|
||||
*WinClosed*
|
||||
WinClosed After closing a window. The pattern is
|
||||
matched against the |window-ID|. Both
|
||||
<amatch> and <afile> are set to the |window-ID|.
|
||||
WinClosed After closing a window. <afile> expands to the
|
||||
|window-ID|.
|
||||
After WinLeave.
|
||||
Non-recursive (event cannot trigger itself).
|
||||
See also |ExitPre|, |QuitPre|.
|
||||
@@ -1239,13 +1227,6 @@ Example: >
|
||||
This prevents having the autocommands defined twice (e.g., after sourcing the
|
||||
vimrc file again).
|
||||
|
||||
*FileExplorer*
|
||||
There is one group that is recognized by Vim: FileExplorer. If this group
|
||||
exists Vim assumes that editing a directory is possible and will trigger a
|
||||
plugin that lists the files in that directory. This is used by the |netrw|
|
||||
plugin. This allows you to do: >
|
||||
browse edit
|
||||
|
||||
==============================================================================
|
||||
9. Executing autocommands *autocmd-execute*
|
||||
|
||||
|
@@ -568,7 +568,9 @@ with ".". Vim does not recognize a comment (starting with '"') after the
|
||||
option is empty (this is the default), use the
|
||||
internal formatting function |C-indenting| and
|
||||
|'lisp'|. But when 'indentexpr' is not empty, it will
|
||||
be used instead |indent-expression|.
|
||||
be used instead |indent-expression|. When Vim was
|
||||
compiled without internal formatting then the "indent"
|
||||
program is used as a last resort.
|
||||
|
||||
*==*
|
||||
== Filter [count] lines like with ={motion}.
|
||||
@@ -747,14 +749,12 @@ For compatibility with Vi these two exceptions are allowed:
|
||||
"\/{string}/" and "\?{string}?" do the same as "//{string}/r".
|
||||
"\&{string}&" does the same as "//{string}/".
|
||||
*pattern-delimiter* *E146*
|
||||
Instead of the '/' which surrounds the pattern and replacement string, you can
|
||||
use another single-byte character. This is useful if you want to include a
|
||||
'/' in the search pattern or replacement string. Example: >
|
||||
Instead of the '/' which surrounds the pattern and replacement string, you
|
||||
can use any other single-byte character, but not an alphanumeric character,
|
||||
'\', '"' or '|'. This is useful if you want to include a '/' in the search
|
||||
pattern or replacement string. Example: >
|
||||
:s+/+//+
|
||||
|
||||
You can use most characters, but not an alphanumeric character, '\', '"' or
|
||||
'|'.
|
||||
|
||||
For the definition of a pattern, see |pattern|. In Visual block mode, use
|
||||
|/\%V| in the pattern to have the substitute work in the block only.
|
||||
Otherwise it works on whole lines anyway.
|
||||
@@ -988,9 +988,9 @@ inside of strings can change! Also see 'softtabstop' option. >
|
||||
|
||||
*Y*
|
||||
["x]Y yank [count] lines [into register x] (synonym for
|
||||
yy, |linewise|).
|
||||
*Y-default*
|
||||
Mapped to "y$" by default. |default-mappings|
|
||||
yy, |linewise|). If you like "Y" to work from the
|
||||
cursor to the end of line (which is more logical,
|
||||
but not Vi-compatible) use ":map Y y$".
|
||||
|
||||
*zy*
|
||||
["x]zy{motion} Yank {motion} text [into register x]. Only differs
|
||||
@@ -1011,7 +1011,9 @@ inside of strings can change! Also see 'softtabstop' option. >
|
||||
with `zp`. (for {Visual} see |Visual-mode|)
|
||||
|
||||
*:y* *:yank* *E850*
|
||||
:[range]y[ank] [x] Yank [range] lines [into register x].
|
||||
:[range]y[ank] [x] Yank [range] lines [into register x]. Yanking to the
|
||||
"* or "+ registers is possible only when the
|
||||
|+clipboard| feature is included.
|
||||
|
||||
:[range]y[ank] [x] {count}
|
||||
Yank {count} lines, starting with last line number
|
||||
@@ -1129,6 +1131,9 @@ a register, a paste on a visual selected area will paste that single line on
|
||||
each of the selected lines (thus replacing the blockwise selected region by a
|
||||
block of the pasted line).
|
||||
|
||||
Use |zP|/|zp| to paste a blockwise yanked register without appending trailing
|
||||
spaces.
|
||||
|
||||
*blockwise-register*
|
||||
If you use a blockwise Visual mode command to get the text into the register,
|
||||
the block of text will be inserted before ("P") or after ("p") the cursor
|
||||
@@ -1139,9 +1144,6 @@ this happen. However, if the width of the block is not a multiple of a <Tab>
|
||||
width and the text after the inserted block contains <Tab>s, that text may be
|
||||
misaligned.
|
||||
|
||||
Use |zP|/|zp| to paste a blockwise yanked register without appending trailing
|
||||
spaces.
|
||||
|
||||
Note that after a charwise yank command, Vim leaves the cursor on the first
|
||||
yanked character that is closest to the start of the buffer. This means that
|
||||
"yl" doesn't move the cursor, but "yh" moves the cursor one character left.
|
||||
@@ -1800,7 +1802,8 @@ found here: |sort()|, |uniq()|.
|
||||
With [f] sorting is done on the Float in the line.
|
||||
The value of Float is determined similar to passing
|
||||
the text (after or inside a {pattern} match) to
|
||||
str2float() function.
|
||||
str2float() function. This option is available only
|
||||
if Vim was compiled with Floating point support.
|
||||
|
||||
With [x] sorting is done on the first hexadecimal
|
||||
number in the line (after or inside a {pattern}
|
||||
|
@@ -153,12 +153,7 @@ CTRL-R {register} *c_CTRL-R* *c_<C-R>*
|
||||
too.
|
||||
When the result is a Float it's automatically
|
||||
converted to a String.
|
||||
Note that when you only want to move the
|
||||
cursor and not insert anything, you must make
|
||||
sure the expression evaluates to an empty
|
||||
string. E.g.: >
|
||||
<C-R><C-R>=setcmdpos(2)[-1]<CR>
|
||||
< See |registers| about registers.
|
||||
See |registers| about registers.
|
||||
Implementation detail: When using the |expression| register
|
||||
and invoking setcmdpos(), this sets the position before
|
||||
inserting the resulting string. Use CTRL-R CTRL-R to set the
|
||||
@@ -1072,7 +1067,7 @@ in Normal mode and Insert mode.
|
||||
It is possible to use ":", "/" and other commands that use the command-line,
|
||||
but it's not possible to open another command-line window then. There is no
|
||||
nesting.
|
||||
*E11* *E1188*
|
||||
*E11*
|
||||
The command-line window is not a normal window. It is not possible to move to
|
||||
another window or edit another buffer. All commands that would do this are
|
||||
disabled in the command-line window. Of course it _is_ possible to execute
|
||||
@@ -1145,11 +1140,6 @@ Thus you can resize the command-line window, but not others.
|
||||
The |getcmdwintype()| function returns the type of the command-line being
|
||||
edited as described in |cmdwin-char|.
|
||||
|
||||
Nvim defines this default CmdWinEnter autocmd in the "nvim_cmdwin" group: >
|
||||
autocmd CmdWinEnter [:>] syntax sync minlines=1 maxlines=1
|
||||
<
|
||||
You can disable this in your config with "autocmd! nvim_cmdwin". |default-autocmds|
|
||||
|
||||
|
||||
AUTOCOMMANDS
|
||||
|
||||
|
@@ -14,7 +14,6 @@ updated.
|
||||
|
||||
API ~
|
||||
*nvim_buf_clear_highlight()* Use |nvim_buf_clear_namespace()| instead.
|
||||
*nvim_buf_set_virtual_text()* Use |nvim_buf_set_extmark()| instead.
|
||||
*nvim_command_output()* Use |nvim_exec()| instead.
|
||||
*nvim_execute_lua()* Use |nvim_exec_lua()| instead.
|
||||
|
||||
@@ -55,56 +54,6 @@ Functions ~
|
||||
without stopping the job. Use chanclose(id) to close
|
||||
any socket.
|
||||
|
||||
LSP Diagnostics ~
|
||||
|
||||
For each of the functions below, use the corresponding function in
|
||||
|vim.diagnostic| instead (unless otherwise noted). For example, use
|
||||
|vim.diagnostic.get()| instead of |vim.lsp.diagnostic.get()|.
|
||||
|
||||
*vim.lsp.diagnostic.clear()* Use |vim.diagnostic.hide()| instead.
|
||||
*vim.lsp.diagnostic.disable()*
|
||||
*vim.lsp.diagnostic.display()* Use |vim.diagnostic.show()| instead.
|
||||
*vim.lsp.diagnostic.enable()*
|
||||
*vim.lsp.diagnostic.get()*
|
||||
*vim.lsp.diagnostic.get_all()* Use |vim.diagnostic.get()| instead.
|
||||
*vim.lsp.diagnostic.get_count()* Use |vim.diagnostic.get()| instead.
|
||||
*vim.lsp.diagnostic.get_line_diagnostics()*
|
||||
Use |vim.diagnostic.get()| instead.
|
||||
*vim.lsp.diagnostic.get_next()*
|
||||
*vim.lsp.diagnostic.get_next_pos()*
|
||||
*vim.lsp.diagnostic.get_prev()*
|
||||
*vim.lsp.diagnostic.get_prev_pos()*
|
||||
*vim.lsp.diagnostic.get_virtual_text_chunks_for_line()*
|
||||
No replacement. Use options provided by
|
||||
|vim.diagnostic.config()| to customize
|
||||
virtual text.
|
||||
*vim.lsp.diagnostic.goto_next()*
|
||||
*vim.lsp.diagnostic.goto_prev()*
|
||||
*vim.lsp.diagnostic.redraw()* Use |vim.diagnostic.show()| instead.
|
||||
*vim.lsp.diagnostic.reset()*
|
||||
*vim.lsp.diagnostic.save()* Use |vim.diagnostic.set()| instead.
|
||||
*vim.lsp.diagnostic.set_loclist()* Use |vim.diagnostic.setloclist()| instead.
|
||||
*vim.lsp.diagnostic.set_qflist()* Use |vim.diagnostic.setqflist()| instead.
|
||||
|
||||
The following have been replaced by |vim.diagnostic.open_float()|.
|
||||
|
||||
*vim.lsp.diagnostic.show_line_diagnostics()*
|
||||
*vim.lsp.diagnostic.show_position_diagnostics()*
|
||||
|
||||
The following are deprecated without replacement. These functions are moved
|
||||
internally and are no longer exposed as part of the API. Instead, use
|
||||
|vim.diagnostic.config()| and |vim.diagnostic.show()|.
|
||||
|
||||
*vim.lsp.diagnostic.set_signs()*
|
||||
*vim.lsp.diagnostic.set_underline()*
|
||||
*vim.lsp.diagnostic.set_virtual_text()*
|
||||
|
||||
LSP Utility Functions ~
|
||||
|
||||
*vim.lsp.util.diagnostics_to_items()* Use |vim.diagnostic.toqflist()| instead.
|
||||
*vim.lsp.util.set_qflist()* Use |setqflist()| instead.
|
||||
*vim.lsp.util.set_loclist()* Use |setloclist()| instead.
|
||||
|
||||
Lua ~
|
||||
*vim.register_keystroke_callback()* Use |vim.on_key()| instead.
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -46,7 +46,7 @@ NVIM IS... WELL DOCUMENTED *design-documented*
|
||||
item is easier to find.
|
||||
|
||||
|
||||
NVIM IS... FAST AND SMALL *design-speed-size*
|
||||
NVIM IS... HIGH SPEED AND SMALL IN SIZE *design-speed-size*
|
||||
|
||||
Keep Nvim small and fast.
|
||||
- Computers are becoming faster and bigger each year. Vim can grow too, but
|
||||
@@ -166,7 +166,7 @@ Docstring format:
|
||||
- Use `<pre>` for code samples.
|
||||
|
||||
Example: the help for |nvim_open_win()| is generated from a docstring defined
|
||||
in src/nvim/api/win_config.c like this: >
|
||||
in src/nvim/api/vim.c like this: >
|
||||
|
||||
/// Opens a new window.
|
||||
/// ...
|
||||
@@ -197,8 +197,8 @@ definitions. The |lua-vim| :help is generated from the docstrings.
|
||||
|
||||
Docstring format:
|
||||
- Lines in the main description start with `---`
|
||||
- Special tokens start with `---@` followed by the token name:
|
||||
`---@see`, `---@param`, `---@returns`
|
||||
- Special tokens start with `--@` followed by the token name:
|
||||
`--@see`, `--@param`, `--@returns`
|
||||
- Limited markdown is supported.
|
||||
- List-items start with `-` (useful to nest or "indent")
|
||||
- Use `<pre>` for code samples.
|
||||
@@ -217,11 +217,11 @@ vim.paste in src/nvim/lua/vim.lua like this: >
|
||||
--- end)()
|
||||
--- </pre>
|
||||
---
|
||||
---@see |paste|
|
||||
--@see |paste|
|
||||
---
|
||||
---@param lines ...
|
||||
---@param phase ...
|
||||
---@returns false if client should cancel the paste.
|
||||
--@param lines ...
|
||||
--@param phase ...
|
||||
--@returns false if client should cancel the paste.
|
||||
|
||||
|
||||
LUA *dev-lua*
|
||||
|
@@ -1,726 +0,0 @@
|
||||
*diagnostic.txt* Diagnostics
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL
|
||||
|
||||
|
||||
Diagnostic framework *vim.diagnostic*
|
||||
|
||||
Nvim provides a framework for displaying errors or warnings from external
|
||||
tools, otherwise known as "diagnostics". These diagnostics can come from a
|
||||
variety of sources, such as linters or LSP servers. The diagnostic framework
|
||||
is an extension to existing error handling functionality such as the
|
||||
|quickfix| list.
|
||||
|
||||
Type |gO| to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
QUICKSTART *diagnostic-quickstart*
|
||||
|
||||
Anything that reports diagnostics is referred to below as a "diagnostic
|
||||
producer". Diagnostic producers need only follow a few simple steps to
|
||||
report diagnostics:
|
||||
|
||||
1. Create a namespace |nvim_create_namespace()|. Note that the namespace must
|
||||
have a name. Anonymous namespaces WILL NOT WORK.
|
||||
2. (Optional) Configure options for the diagnostic namespace
|
||||
|vim.diagnostic.config()|.
|
||||
3. Generate diagnostics.
|
||||
4. Set the diagnostics for the buffer |vim.diagnostic.set()|.
|
||||
5. Repeat from step 3.
|
||||
|
||||
Generally speaking, the API is split between functions meant to be used by
|
||||
diagnostic producers and those meant for diagnostic consumers (i.e. end users
|
||||
who want to read and view the diagnostics for a buffer). The APIs for
|
||||
producers require a {namespace} as their first argument, while those for
|
||||
consumers generally do not require a namespace (though often one may be
|
||||
optionally supplied). A good rule of thumb is that if a method is meant to
|
||||
modify the diagnostics for a buffer (e.g. |vim.diagnostic.set()|) then it
|
||||
requires a namespace.
|
||||
|
||||
*diagnostic-structure*
|
||||
A diagnostic is a Lua table with the following keys:
|
||||
|
||||
lnum: The starting line of the diagnostic
|
||||
end_lnum: The final line of the diagnostic
|
||||
col: The starting column of the diagnostic
|
||||
end_col: The final column of the diagnostic
|
||||
severity: The severity of the diagnostic |vim.diagnostic.severity|
|
||||
message: The diagnostic text
|
||||
source: The source of the diagnostic
|
||||
|
||||
Diagnostics use the same indexing as the rest of the Nvim API (i.e. 0-based
|
||||
rows and columns). |api-indexing|
|
||||
|
||||
*vim.diagnostic.severity* *diagnostic-severity*
|
||||
The "severity" key in a diagnostic is one of the values defined in
|
||||
`vim.diagnostic.severity`:
|
||||
|
||||
vim.diagnostic.severity.ERROR
|
||||
vim.diagnostic.severity.WARN
|
||||
vim.diagnostic.severity.INFO
|
||||
vim.diagnostic.severity.HINT
|
||||
|
||||
Functions that take a severity as an optional parameter (e.g.
|
||||
|vim.diagnostic.get()|) accept one of two forms:
|
||||
|
||||
1. A single |vim.diagnostic.severity| value: >
|
||||
|
||||
vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN })
|
||||
|
||||
2. A table with a "min" or "max" key (or both): >
|
||||
|
||||
vim.diagnostic.get(0, { severity = {min=vim.diagnostic.severity.WARN})
|
||||
|
||||
The latter form allows users to specify a range of severities.
|
||||
|
||||
==============================================================================
|
||||
HANDLERS *diagnostic-handlers*
|
||||
|
||||
Diagnostics are shown to the user with |vim.diagnostic.show()|. The display of
|
||||
diagnostics is managed through handlers. A handler is a table with a "show"
|
||||
and (optionally) a "hide" function. The "show" function has the signature
|
||||
>
|
||||
function(namespace, bufnr, diagnostics, opts)
|
||||
<
|
||||
and is responsible for displaying or otherwise handling the given
|
||||
diagnostics. The "hide" function takes care of "cleaning up" any actions taken
|
||||
by the "show" function and has the signature
|
||||
>
|
||||
function(namespace, bufnr)
|
||||
<
|
||||
Handlers can be configured with |vim.diagnostic.config()| and added by
|
||||
creating a new key in `vim.diagnostic.handlers` (see
|
||||
|diagnostic-handlers-example|).
|
||||
|
||||
The {opts} table passed to a handler is the full set of configuration options
|
||||
(that is, it is not limited to just the options for the handler itself). The
|
||||
values in the table are already resolved (i.e. if a user specifies a
|
||||
function for a config option, the function has already been evaluated).
|
||||
|
||||
Nvim provides these handlers by default: "virtual_text", "signs", and
|
||||
"underline".
|
||||
|
||||
*diagnostic-handlers-example*
|
||||
The example below creates a new handler that notifies the user of diagnostics
|
||||
with |vim.notify()|: >
|
||||
|
||||
-- It's good practice to namespace custom handlers to avoid collisions
|
||||
vim.diagnostic.handlers["my/notify"] = {
|
||||
show = function(namespace, bufnr, diagnostics, opts)
|
||||
-- In our example, the opts table has a "log_level" option
|
||||
local level = opts["my/notify"].log_level
|
||||
|
||||
local name = vim.diagnostic.get_namespace(namespace).name
|
||||
local msg = string.format("%d diagnostics in buffer %d from %s",
|
||||
#diagnostics,
|
||||
bufnr,
|
||||
name)
|
||||
vim.notify(msg, level)
|
||||
end,
|
||||
}
|
||||
|
||||
-- Users can configure the handler
|
||||
vim.diagnostic.config({
|
||||
["my/notify"] = {
|
||||
log_level = vim.log.levels.INFO
|
||||
}
|
||||
})
|
||||
<
|
||||
In this example, there is nothing to do when diagnostics are hidden, so we
|
||||
omit the "hide" function.
|
||||
|
||||
Existing handlers can be overriden. For example, use the following to only
|
||||
show a sign for the highest severity diagnostic on a given line: >
|
||||
|
||||
-- Create a custom namespace. This will aggregate signs from all other
|
||||
-- namespaces and only show the one with the highest severity on a
|
||||
-- given line
|
||||
local ns = vim.api.nvim_create_namespace("my_namespace")
|
||||
|
||||
-- Get a reference to the original signs handler
|
||||
local orig_signs_handler = vim.diagnostic.handlers.signs
|
||||
|
||||
-- Override the built-in signs handler
|
||||
vim.diagnostic.handlers.signs = {
|
||||
show = function(_, bufnr, _, opts)
|
||||
-- Get all diagnostics from the whole buffer rather than just the
|
||||
-- diagnostics passed to the handler
|
||||
local diagnostics = vim.diagnostic.get(bufnr)
|
||||
|
||||
-- Find the "worst" diagnostic per line
|
||||
local max_severity_per_line = {}
|
||||
for _, d in pairs(diagnostics) do
|
||||
local m = max_severity_per_line[d.lnum]
|
||||
if not m or d.severity < m.severity then
|
||||
max_severity_per_line[d.lnum] = d
|
||||
end
|
||||
end
|
||||
|
||||
-- Pass the filtered diagnostics (with our custom namespace) to
|
||||
-- the original handler
|
||||
local filtered_diagnostics = vim.tbl_values(max_severity_per_line)
|
||||
orig_signs_handler.show(ns, bufnr, filtered_diagnostics, opts)
|
||||
end,
|
||||
hide = function(_, bufnr)
|
||||
orig_signs_handler.hide(ns, bufnr)
|
||||
end,
|
||||
}
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
HIGHLIGHTS *diagnostic-highlights*
|
||||
|
||||
All highlights defined for diagnostics begin with `Diagnostic` followed by
|
||||
the type of highlight (e.g., `Sign`, `Underline`, etc.) and the severity (e.g.
|
||||
`Error`, `Warn`, etc.)
|
||||
|
||||
Sign, underline and virtual text highlights (by default) are linked to their
|
||||
corresponding default highlight.
|
||||
|
||||
For example, the default highlighting for |hl-DiagnosticSignError| is linked
|
||||
to |hl-DiagnosticError|. To change the default (and therefore the linked
|
||||
highlights), use the |:highlight| command: >
|
||||
|
||||
highlight DiagnosticError guifg="BrightRed"
|
||||
<
|
||||
*hl-DiagnosticError*
|
||||
DiagnosticError
|
||||
Used as the base highlight group.
|
||||
Other Diagnostic highlights link to this by default (except Underline)
|
||||
|
||||
*hl-DiagnosticWarn*
|
||||
DiagnosticWarn
|
||||
Used as the base highlight group.
|
||||
Other Diagnostic highlights link to this by default (except Underline)
|
||||
|
||||
*hl-DiagnosticInfo*
|
||||
DiagnosticInfo
|
||||
Used as the base highlight group.
|
||||
Other Diagnostic highlights link to this by default (except Underline)
|
||||
|
||||
*hl-DiagnosticHint*
|
||||
DiagnosticHint
|
||||
Used as the base highlight group.
|
||||
Other Diagnostic highlights link to this by default (except Underline)
|
||||
|
||||
*hl-DiagnosticVirtualTextError*
|
||||
DiagnosticVirtualTextError
|
||||
Used for "Error" diagnostic virtual text.
|
||||
|
||||
*hl-DiagnosticVirtualTextWarn*
|
||||
DiagnosticVirtualTextWarn
|
||||
Used for "Warn" diagnostic virtual text.
|
||||
|
||||
*hl-DiagnosticVirtualTextInfo*
|
||||
DiagnosticVirtualTextInfo
|
||||
Used for "Info" diagnostic virtual text.
|
||||
|
||||
*hl-DiagnosticVirtualTextHint*
|
||||
DiagnosticVirtualTextHint
|
||||
Used for "Hint" diagnostic virtual text.
|
||||
|
||||
*hl-DiagnosticUnderlineError*
|
||||
DiagnosticUnderlineError
|
||||
Used to underline "Error" diagnostics.
|
||||
|
||||
*hl-DiagnosticUnderlineWarn*
|
||||
DiagnosticUnderlineWarn
|
||||
Used to underline "Warn" diagnostics.
|
||||
|
||||
*hl-DiagnosticUnderlineInfo*
|
||||
DiagnosticUnderlineInfo
|
||||
Used to underline "Info" diagnostics.
|
||||
|
||||
*hl-DiagnosticUnderlineHint*
|
||||
DiagnosticUnderlineHint
|
||||
Used to underline "Hint" diagnostics.
|
||||
|
||||
*hl-DiagnosticFloatingError*
|
||||
DiagnosticFloatingError
|
||||
Used to color "Error" diagnostic messages in diagnostics float.
|
||||
See |vim.diagnostic.open_float()|
|
||||
|
||||
*hl-DiagnosticFloatingWarn*
|
||||
DiagnosticFloatingWarn
|
||||
Used to color "Warn" diagnostic messages in diagnostics float.
|
||||
|
||||
*hl-DiagnosticFloatingInfo*
|
||||
DiagnosticFloatingInfo
|
||||
Used to color "Info" diagnostic messages in diagnostics float.
|
||||
|
||||
*hl-DiagnosticFloatingHint*
|
||||
DiagnosticFloatingHint
|
||||
Used to color "Hint" diagnostic messages in diagnostics float.
|
||||
|
||||
*hl-DiagnosticSignError*
|
||||
DiagnosticSignError
|
||||
Used for "Error" signs in sign column.
|
||||
|
||||
*hl-DiagnosticSignWarn*
|
||||
DiagnosticSignWarn
|
||||
Used for "Warn" signs in sign column.
|
||||
|
||||
*hl-DiagnosticSignInfo*
|
||||
DiagnosticSignInfo
|
||||
Used for "Info" signs in sign column.
|
||||
|
||||
*hl-DiagnosticSignHint*
|
||||
DiagnosticSignHint
|
||||
Used for "Hint" signs in sign column.
|
||||
|
||||
==============================================================================
|
||||
SIGNS *diagnostic-signs*
|
||||
|
||||
Signs are defined for each diagnostic severity. The default text for each sign
|
||||
is the first letter of the severity name (for example, "E" for ERROR). Signs
|
||||
can be customized using the following: >
|
||||
|
||||
sign define DiagnosticSignError text=E texthl=DiagnosticSignError linehl= numhl=
|
||||
sign define DiagnosticSignWarn text=W texthl=DiagnosticSignWarn linehl= numhl=
|
||||
sign define DiagnosticSignInfo text=I texthl=DiagnosticSignInfo linehl= numhl=
|
||||
sign define DiagnosticSignHint text=H texthl=DiagnosticSignHint linehl= numhl=
|
||||
|
||||
When the "severity_sort" option is set (see |vim.diagnostic.config()|) the
|
||||
priority of each sign depends on the severity of the associated diagnostic.
|
||||
Otherwise, all signs have the same priority (the value of the "priority"
|
||||
option in the "signs" table of |vim.diagnostic.config()| or 10 if unset).
|
||||
|
||||
==============================================================================
|
||||
EVENTS *diagnostic-events*
|
||||
|
||||
*DiagnosticChanged*
|
||||
DiagnosticChanged After diagnostics have changed.
|
||||
|
||||
Example: >
|
||||
autocmd DiagnosticChanged * lua vim.diagnostic.setqflist({open = false })
|
||||
<
|
||||
==============================================================================
|
||||
==============================================================================
|
||||
Lua module: vim.diagnostic *diagnostic-api*
|
||||
|
||||
config({opts}, {namespace}) *vim.diagnostic.config()*
|
||||
Configure diagnostic options globally or for a specific
|
||||
diagnostic namespace.
|
||||
|
||||
Configuration can be specified globally, per-namespace, or
|
||||
ephemerally (i.e. only for a single call to
|
||||
|vim.diagnostic.set()| or |vim.diagnostic.show()|). Ephemeral
|
||||
configuration has highest priority, followed by namespace
|
||||
configuration, and finally global configuration.
|
||||
|
||||
For example, if a user enables virtual text globally with >
|
||||
|
||||
vim.diagnostic.config({virtual_text = true})
|
||||
<
|
||||
|
||||
and a diagnostic producer sets diagnostics with >
|
||||
|
||||
vim.diagnostic.set(ns, 0, diagnostics, {virtual_text = false})
|
||||
<
|
||||
|
||||
then virtual text will not be enabled for those diagnostics.
|
||||
|
||||
Note:
|
||||
Each of the configuration options below accepts one of the
|
||||
following:
|
||||
• `false` : Disable this feature
|
||||
• `true` : Enable this feature, use default settings.
|
||||
• `table` : Enable this feature with overrides. Use an
|
||||
empty table to use default values.
|
||||
• `function` : Function with signature (namespace, bufnr)
|
||||
that returns any of the above.
|
||||
|
||||
Parameters: ~
|
||||
{opts} table Configuration table with the following
|
||||
keys:
|
||||
• underline: (default true) Use underline for
|
||||
diagnostics. Options:
|
||||
• severity: Only underline diagnostics
|
||||
matching the given severity
|
||||
|diagnostic-severity|
|
||||
|
||||
• virtual_text: (default true) Use virtual
|
||||
text for diagnostics. Options:
|
||||
• severity: Only show virtual text for
|
||||
diagnostics matching the given severity
|
||||
|diagnostic-severity|
|
||||
• source: (string) Include the diagnostic
|
||||
source in virtual text. One of "always"
|
||||
or "if_many".
|
||||
• format: (function) A function that takes
|
||||
a diagnostic as input and returns a
|
||||
string. The return value is the text used
|
||||
to display the diagnostic. Example: >
|
||||
|
||||
function(diagnostic)
|
||||
if diagnostic.severity == vim.diagnostic.severity.ERROR then
|
||||
return string.format("E: %s", diagnostic.message)
|
||||
end
|
||||
return diagnostic.message
|
||||
end
|
||||
<
|
||||
|
||||
• signs: (default true) Use signs for
|
||||
diagnostics. Options:
|
||||
• severity: Only show signs for diagnostics
|
||||
matching the given severity
|
||||
|diagnostic-severity|
|
||||
• priority: (number, default 10) Base
|
||||
priority to use for signs. When
|
||||
{severity_sort} is used, the priority of
|
||||
a sign is adjusted based on its severity.
|
||||
Otherwise, all signs use the same
|
||||
priority.
|
||||
|
||||
• float: Options for floating windows. See
|
||||
|vim.diagnostic.open_float()|.
|
||||
• update_in_insert: (default false) Update
|
||||
diagnostics in Insert mode (if false,
|
||||
diagnostics are updated on InsertLeave)
|
||||
• severity_sort: (default false) Sort
|
||||
diagnostics by severity. This affects the
|
||||
order in which signs and virtual text are
|
||||
displayed. When true, higher severities are
|
||||
displayed before lower severities (e.g.
|
||||
ERROR is displayed before WARN). Options:
|
||||
• reverse: (boolean) Reverse sort order
|
||||
{namespace} number|nil Update the options for the given
|
||||
namespace. When omitted, update the global
|
||||
diagnostic options.
|
||||
|
||||
disable({bufnr}, {namespace}) *vim.diagnostic.disable()*
|
||||
Disable diagnostics in the given buffer.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} number|nil Buffer number, or 0 for current
|
||||
buffer. When omitted, disable diagnostics in
|
||||
all buffers.
|
||||
{namespace} number|nil Only disable diagnostics for the
|
||||
given namespace.
|
||||
|
||||
enable({bufnr}, {namespace}) *vim.diagnostic.enable()*
|
||||
Enable diagnostics in the given buffer.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} number|nil Buffer number, or 0 for current
|
||||
buffer. When omitted, enable diagnostics in
|
||||
all buffers.
|
||||
{namespace} number|nil Only enable diagnostics for the
|
||||
given namespace.
|
||||
|
||||
fromqflist({list}) *vim.diagnostic.fromqflist()*
|
||||
Convert a list of quickfix items to a list of diagnostics.
|
||||
|
||||
Parameters: ~
|
||||
{list} table A list of quickfix items from |getqflist()|
|
||||
or |getloclist()|.
|
||||
|
||||
Return: ~
|
||||
array of diagnostics |diagnostic-structure|
|
||||
|
||||
get({bufnr}, {opts}) *vim.diagnostic.get()*
|
||||
Get current diagnostics.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} number|nil Buffer number to get diagnostics from.
|
||||
Use 0 for current buffer or nil for all buffers.
|
||||
{opts} table|nil A table with the following keys:
|
||||
• namespace: (number) Limit diagnostics to the
|
||||
given namespace.
|
||||
• lnum: (number) Limit diagnostics to the given
|
||||
line number.
|
||||
• severity: See |diagnostic-severity|.
|
||||
|
||||
Return: ~
|
||||
table A list of diagnostic items |diagnostic-structure|.
|
||||
|
||||
get_namespace({namespace}) *vim.diagnostic.get_namespace()*
|
||||
Get namespace metadata.
|
||||
|
||||
Parameters: ~
|
||||
{namespace} number Diagnostic namespace
|
||||
|
||||
Return: ~
|
||||
table Namespace metadata
|
||||
|
||||
get_namespaces() *vim.diagnostic.get_namespaces()*
|
||||
Get current diagnostic namespaces.
|
||||
|
||||
Return: ~
|
||||
table A list of active diagnostic namespaces
|
||||
|vim.diagnostic|.
|
||||
|
||||
get_next({opts}) *vim.diagnostic.get_next()*
|
||||
Get the next diagnostic closest to the cursor position.
|
||||
|
||||
Parameters: ~
|
||||
{opts} table See |vim.diagnostic.goto_next()|
|
||||
|
||||
Return: ~
|
||||
table Next diagnostic
|
||||
|
||||
get_next_pos({opts}) *vim.diagnostic.get_next_pos()*
|
||||
Return the position of the next diagnostic in the current
|
||||
buffer.
|
||||
|
||||
Parameters: ~
|
||||
{opts} table See |vim.diagnostic.goto_next()|
|
||||
|
||||
Return: ~
|
||||
table Next diagnostic position as a (row, col) tuple.
|
||||
|
||||
get_prev({opts}) *vim.diagnostic.get_prev()*
|
||||
Get the previous diagnostic closest to the cursor position.
|
||||
|
||||
Parameters: ~
|
||||
{opts} table See |vim.diagnostic.goto_next()|
|
||||
|
||||
Return: ~
|
||||
table Previous diagnostic
|
||||
|
||||
get_prev_pos({opts}) *vim.diagnostic.get_prev_pos()*
|
||||
Return the position of the previous diagnostic in the current
|
||||
buffer.
|
||||
|
||||
Parameters: ~
|
||||
{opts} table See |vim.diagnostic.goto_next()|
|
||||
|
||||
Return: ~
|
||||
table Previous diagnostic position as a (row, col) tuple.
|
||||
|
||||
goto_next({opts}) *vim.diagnostic.goto_next()*
|
||||
Move to the next diagnostic.
|
||||
|
||||
Parameters: ~
|
||||
{opts} table|nil Configuration table with the following
|
||||
keys:
|
||||
• namespace: (number) Only consider diagnostics
|
||||
from the given namespace.
|
||||
• cursor_position: (cursor position) Cursor
|
||||
position as a (row, col) tuple. See
|
||||
|nvim_win_get_cursor()|. Defaults to the current
|
||||
cursor position.
|
||||
• wrap: (boolean, default true) Whether to loop
|
||||
around file or not. Similar to 'wrapscan'.
|
||||
• severity: See |diagnostic-severity|.
|
||||
• float: (boolean or table, default true) If
|
||||
"true", call |vim.diagnostic.open_float()| after
|
||||
moving. If a table, pass the table as the {opts}
|
||||
parameter to |vim.diagnostic.open_float()|.
|
||||
Unless overridden, the float will show
|
||||
diagnostics at the new cursor position (as if
|
||||
"cursor" were passed to the "scope" option).
|
||||
• win_id: (number, default 0) Window ID
|
||||
|
||||
goto_prev({opts}) *vim.diagnostic.goto_prev()*
|
||||
Move to the previous diagnostic in the current buffer.
|
||||
|
||||
Parameters: ~
|
||||
{opts} table See |vim.diagnostic.goto_next()|
|
||||
|
||||
hide({namespace}, {bufnr}) *vim.diagnostic.hide()*
|
||||
Hide currently displayed diagnostics.
|
||||
|
||||
This only clears the decorations displayed in the buffer.
|
||||
Diagnostics can be redisplayed with |vim.diagnostic.show()|.
|
||||
To completely remove diagnostics, use
|
||||
|vim.diagnostic.reset()|.
|
||||
|
||||
To hide diagnostics and prevent them from re-displaying, use
|
||||
|vim.diagnostic.disable()|.
|
||||
|
||||
Parameters: ~
|
||||
{namespace} number|nil Diagnostic namespace. When
|
||||
omitted, hide diagnostics from all
|
||||
namespaces.
|
||||
{bufnr} number|nil Buffer number, or 0 for current
|
||||
buffer. When omitted, hide diagnostics in all
|
||||
buffers.
|
||||
|
||||
*vim.diagnostic.match()*
|
||||
match({str}, {pat}, {groups}, {severity_map}, {defaults})
|
||||
Parse a diagnostic from a string.
|
||||
|
||||
For example, consider a line of output from a linter: >
|
||||
|
||||
WARNING filename:27:3: Variable 'foo' does not exist
|
||||
<
|
||||
|
||||
This can be parsed into a diagnostic |diagnostic-structure|
|
||||
with: >
|
||||
|
||||
local s = "WARNING filename:27:3: Variable 'foo' does not exist"
|
||||
local pattern = "^(%w+) %w+:(%d+):(%d+): (.+)$"
|
||||
local groups = {"severity", "lnum", "col", "message"}
|
||||
vim.diagnostic.match(s, pattern, groups, {WARNING = vim.diagnostic.WARN})
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
{str} string String to parse diagnostics from.
|
||||
{pat} string Lua pattern with capture groups.
|
||||
{groups} table List of fields in a
|
||||
|diagnostic-structure| to associate with
|
||||
captures from {pat}.
|
||||
{severity_map} table A table mapping the severity field
|
||||
from {groups} with an item from
|
||||
|vim.diagnostic.severity|.
|
||||
{defaults} table|nil Table of default values for any
|
||||
fields not listed in {groups}. When
|
||||
omitted, numeric values default to 0 and
|
||||
"severity" defaults to ERROR.
|
||||
|
||||
Return: ~
|
||||
diagnostic |diagnostic-structure| or `nil` if {pat} fails
|
||||
to match {str}.
|
||||
|
||||
open_float({bufnr}, {opts}) *vim.diagnostic.open_float()*
|
||||
Show diagnostics in a floating window.
|
||||
|
||||
Parameters: ~
|
||||
{bufnr} number|nil Buffer number. Defaults to the current
|
||||
buffer.
|
||||
{opts} table|nil Configuration table with the same keys
|
||||
as |vim.lsp.util.open_floating_preview()| in
|
||||
addition to the following:
|
||||
• namespace: (number) Limit diagnostics to the
|
||||
given namespace
|
||||
• scope: (string, default "line") Show
|
||||
diagnostics from the whole buffer ("buffer"),
|
||||
the current cursor line ("line"), or the
|
||||
current cursor position ("cursor").
|
||||
• pos: (number or table) If {scope} is "line" or
|
||||
"cursor", use this position rather than the
|
||||
cursor position. If a number, interpreted as a
|
||||
line number; otherwise, a (row, col) tuple.
|
||||
• severity_sort: (default false) Sort diagnostics
|
||||
by severity. Overrides the setting from
|
||||
|vim.diagnostic.config()|.
|
||||
• severity: See |diagnostic-severity|. Overrides
|
||||
the setting from |vim.diagnostic.config()|.
|
||||
• header: (string or table) String to use as the
|
||||
header for the floating window. If a table, it
|
||||
is interpreted as a [text, hl_group] tuple.
|
||||
Overrides the setting from
|
||||
|vim.diagnostic.config()|.
|
||||
• source: (string) Include the diagnostic source
|
||||
in the message. One of "always" or "if_many".
|
||||
Overrides the setting from
|
||||
|vim.diagnostic.config()|.
|
||||
• format: (function) A function that takes a
|
||||
diagnostic as input and returns a string. The
|
||||
return value is the text used to display the
|
||||
diagnostic. Overrides the setting from
|
||||
|vim.diagnostic.config()|.
|
||||
• prefix: (function, string, or table) Prefix
|
||||
each diagnostic in the floating window. If a
|
||||
function, it must have the signature
|
||||
(diagnostic, i, total) -> (string, string),
|
||||
where {i} is the index of the diagnostic being
|
||||
evaluated and {total} is the total number of
|
||||
diagnostics displayed in the window. The
|
||||
function should return a string which is
|
||||
prepended to each diagnostic in the window as
|
||||
well as an (optional) highlight group which
|
||||
will be used to highlight the prefix. If
|
||||
{prefix} is a table, it is interpreted as a
|
||||
[text, hl_group] tuple as in |nvim_echo()|;
|
||||
otherwise, if {prefix} is a string, it is
|
||||
prepended to each diagnostic in the window with
|
||||
no highlight. Overrides the setting from
|
||||
|vim.diagnostic.config()|.
|
||||
|
||||
Return: ~
|
||||
tuple ({float_bufnr}, {win_id})
|
||||
|
||||
reset({namespace}, {bufnr}) *vim.diagnostic.reset()*
|
||||
Remove all diagnostics from the given namespace.
|
||||
|
||||
Unlike |vim.diagnostic.hide()|, this function removes all
|
||||
saved diagnostics. They cannot be redisplayed using
|
||||
|vim.diagnostic.show()|. To simply remove diagnostic
|
||||
decorations in a way that they can be re-displayed, use
|
||||
|vim.diagnostic.hide()|.
|
||||
|
||||
Parameters: ~
|
||||
{namespace} number|nil Diagnostic namespace. When
|
||||
omitted, remove diagnostics from all
|
||||
namespaces.
|
||||
{bufnr} number|nil Remove diagnostics for the given
|
||||
buffer. When omitted, diagnostics are removed
|
||||
for all buffers.
|
||||
|
||||
set({namespace}, {bufnr}, {diagnostics}, {opts}) *vim.diagnostic.set()*
|
||||
Set diagnostics for the given namespace and buffer.
|
||||
|
||||
Parameters: ~
|
||||
{namespace} number The diagnostic namespace
|
||||
{bufnr} number Buffer number
|
||||
{diagnostics} table A list of diagnostic items
|
||||
|diagnostic-structure|
|
||||
{opts} table|nil Display options to pass to
|
||||
|vim.diagnostic.show()|
|
||||
|
||||
setloclist({opts}) *vim.diagnostic.setloclist()*
|
||||
Add buffer diagnostics to the location list.
|
||||
|
||||
Parameters: ~
|
||||
{opts} table|nil Configuration table with the following
|
||||
keys:
|
||||
• namespace: (number) Only add diagnostics from
|
||||
the given namespace.
|
||||
• winnr: (number, default 0) Window number to set
|
||||
location list for.
|
||||
• open: (boolean, default true) Open the location
|
||||
list after setting.
|
||||
• title: (string) Title of the location list.
|
||||
Defaults to "Diagnostics".
|
||||
• severity: See |diagnostic-severity|.
|
||||
|
||||
setqflist({opts}) *vim.diagnostic.setqflist()*
|
||||
Add all diagnostics to the quickfix list.
|
||||
|
||||
Parameters: ~
|
||||
{opts} table|nil Configuration table with the following
|
||||
keys:
|
||||
• namespace: (number) Only add diagnostics from
|
||||
the given namespace.
|
||||
• open: (boolean, default true) Open quickfix list
|
||||
after setting.
|
||||
• title: (string) Title of quickfix list. Defaults
|
||||
to "Diagnostics".
|
||||
• severity: See |diagnostic-severity|.
|
||||
|
||||
*vim.diagnostic.show()*
|
||||
show({namespace}, {bufnr}, {diagnostics}, {opts})
|
||||
Display diagnostics for the given namespace and buffer.
|
||||
|
||||
Parameters: ~
|
||||
{namespace} number|nil Diagnostic namespace. When
|
||||
omitted, show diagnostics from all
|
||||
namespaces.
|
||||
{bufnr} number|nil Buffer number, or 0 for current
|
||||
buffer. When omitted, show diagnostics in
|
||||
all buffers.
|
||||
{diagnostics} table|nil The diagnostics to display. When
|
||||
omitted, use the saved diagnostics for the
|
||||
given namespace and buffer. This can be
|
||||
used to display a list of diagnostics
|
||||
without saving them or to display only a
|
||||
subset of diagnostics. May not be used when
|
||||
{namespace} or {bufnr} is nil.
|
||||
{opts} table|nil Display options. See
|
||||
|vim.diagnostic.config()|.
|
||||
|
||||
toqflist({diagnostics}) *vim.diagnostic.toqflist()*
|
||||
Convert a list of diagnostics to a list of quickfix items that
|
||||
can be passed to |setqflist()| or |setloclist()|.
|
||||
|
||||
Parameters: ~
|
||||
{diagnostics} table List of diagnostics
|
||||
|diagnostic-structure|.
|
||||
|
||||
Return: ~
|
||||
array of quickfix list items |setqflist-what|
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
@@ -334,11 +334,9 @@ between file1 and file2: >
|
||||
|
||||
The ">" is replaced with the value of 'shellredir'.
|
||||
|
||||
The output of "diff" must be a normal "ed" style diff or a unified diff. A
|
||||
context diff will NOT work. For a unified diff no context lines can be used.
|
||||
Using "diff -u" will NOT work, use "diff -U0".
|
||||
|
||||
This example explains the format that Vim expects for the "ed" style diff: >
|
||||
The output of "diff" must be a normal "ed" style diff or a unified diff. Do
|
||||
NOT use a context diff. This example explains the format that Vim expects for
|
||||
the "ed" style diff: >
|
||||
|
||||
1a2
|
||||
> bbb
|
||||
|
@@ -165,7 +165,7 @@ ROUBLE
|
||||
The rouble sign was added in 2014 as 0x20bd. Vim supports the digraphs =R and
|
||||
=P for this. Note that R= and P= are other characters.
|
||||
|
||||
*digraph-table* *digraph-table-mbyte*
|
||||
*digraph-table*
|
||||
char digraph hex dec official name ~
|
||||
^@ NU 0x00 0 NULL (NUL)
|
||||
^A SH 0x01 1 START OF HEADING (SOH)
|
||||
@@ -341,6 +341,12 @@ $ DO 0x24 36 DOLLAR SIGN
|
||||
ý y' 0xfd 253 LATIN SMALL LETTER Y WITH ACUTE
|
||||
þ th 0xfe 254 LATIN SMALL LETTER THORN (Icelandic)
|
||||
ÿ y: 0xff 255 LATIN SMALL LETTER Y WITH DIAERESIS
|
||||
|
||||
If your Vim is compiled with |multibyte| support and you are using a multibyte
|
||||
'encoding', Vim provides this enhanced set of additional digraphs:
|
||||
|
||||
*digraph-table-mbyte*
|
||||
char digraph hex dec official name ~
|
||||
Ā A- 0100 0256 LATIN CAPITAL LETTER A WITH MACRON
|
||||
ā a- 0101 0257 LATIN SMALL LETTER A WITH MACRON
|
||||
Ă A( 0102 0258 LATIN CAPITAL LETTER A WITH BREVE
|
||||
|
@@ -1183,8 +1183,7 @@ If you want to always use ":confirm", set the 'confirm' option.
|
||||
|:diffsplit|, |:diffpatch|, |:pedit|, |:redir|,
|
||||
|:source|, |:update|, |:visual|, |:vsplit|,
|
||||
and |:qall| if 'confirm' is set.
|
||||
{only in Win32 GUI, in console `browse edit` works
|
||||
if the FileExplorer autocommand group exists}
|
||||
{only in Win32 GUI}
|
||||
When ":browse" is not possible you get an error
|
||||
message. If {command} doesn't support browsing, the
|
||||
{command} is executed without a dialog.
|
||||
@@ -1275,12 +1274,10 @@ exist, the next-higher scope in the hierarchy applies.
|
||||
*:chd* *:chdir*
|
||||
:chd[ir][!] [path] Same as |:cd|.
|
||||
|
||||
*:tc* *:tcd*
|
||||
:tc[d][!] {path} Like |:cd|, but only set the directory for the current
|
||||
tab. The current window will also use this directory.
|
||||
The current directory is not changed for windows in
|
||||
other tabs and for windows in the current tab that
|
||||
have their own window-local directory.
|
||||
*:tc* *:tcd* *E5000* *E5001* *E5002*
|
||||
:tc[d][!] {path} Like |:cd|, but set the current directory for the
|
||||
current tab and window. The current directory for
|
||||
other tabs and windows is not changed.
|
||||
|
||||
*:tcd-*
|
||||
:tc[d][!] - Change to the previous current directory (before the
|
||||
@@ -1304,39 +1301,23 @@ exist, the next-higher scope in the hierarchy applies.
|
||||
*:pw* *:pwd* *E187*
|
||||
:pw[d] Print the current directory name.
|
||||
Also see |getcwd()|.
|
||||
*:pwd-verbose*
|
||||
When 'verbose' is non-zero, |:pwd| will also display
|
||||
what scope the current directory was set. Example: >
|
||||
|
||||
" Set by :cd
|
||||
:verbose pwd
|
||||
[global] /path/to/current
|
||||
|
||||
" Set by :lcd
|
||||
:verbose pwd
|
||||
[window] /path/to/current
|
||||
|
||||
" Set by :tcd
|
||||
:verbose pwd
|
||||
[tabpage] /path/to/current
|
||||
|
||||
So long as no |:lcd| or |:tcd| command has been used, all windows share the
|
||||
same current directory. Using a command to jump to another window doesn't
|
||||
So long as no |:tcd| or |:lcd| command has been used, all windows share the
|
||||
same "current directory". Using a command to jump to another window doesn't
|
||||
change anything for the current directory.
|
||||
|
||||
When |:lcd| has been used for a window, the specified directory becomes the
|
||||
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
|
||||
window the current directory is changed to the last specified local current
|
||||
window the current directory will become the last specified local current
|
||||
directory. If none was specified, the global or tab-local directory is used.
|
||||
|
||||
When changing tabs the same behaviour applies. If the current tab has no
|
||||
local working directory the global working directory is used.
|
||||
|
||||
When a |:cd| command is used, the current window and tab will lose their local
|
||||
current directories and will use the global current directory from now on.
|
||||
When a |:tcd| command is used, only the current window will lose its local
|
||||
working directory.
|
||||
local working directory the global working directory is used. When a |:cd|
|
||||
command is used, the current window and tab will lose their local current
|
||||
directories and will use the global current directory from now on. When
|
||||
a |:tcd| command is used, only the current window will lose its local working
|
||||
directory.
|
||||
|
||||
After using |:cd| the full path name will be used for reading and writing
|
||||
files. On some networked file systems this may cause problems. The result of
|
||||
@@ -1485,11 +1466,6 @@ It is also possible that you modified the file yourself, from another edit
|
||||
session or with another command (e.g., a filter command). Then you will know
|
||||
which version of the file you want to keep.
|
||||
|
||||
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
|
||||
second. Use has('nanotime') check if sub-second time stamp checks are
|
||||
available.
|
||||
|
||||
There is one situation where you get the message while there is nothing wrong:
|
||||
On a Win32 system on the day daylight saving time starts. There is something
|
||||
in the Win32 libraries that confuses Vim about the hour time difference. The
|
||||
|
1911
runtime/doc/eval.txt
1911
runtime/doc/eval.txt
File diff suppressed because it is too large
Load Diff
@@ -128,19 +128,17 @@ can be used to overrule the filetype used for certain extensions:
|
||||
|
||||
file name variable ~
|
||||
*.asa g:filetype_asa |ft-aspvbs-syntax| |ft-aspperl-syntax|
|
||||
*.asm g:asmsyntax |ft-asm-syntax|
|
||||
*.asp g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax|
|
||||
*.fs g:filetype_fs |ft-forth-syntax|
|
||||
*.i g:filetype_i |ft-progress-syntax|
|
||||
*.inc g:filetype_inc
|
||||
*.m g:filetype_m |ft-mathematica-syntax|
|
||||
*.p g:filetype_p |ft-pascal-syntax|
|
||||
*.pl g:filetype_pl
|
||||
*.pp g:filetype_pp |ft-pascal-syntax|
|
||||
*.asm g:asmsyntax |ft-asm-syntax|
|
||||
*.prg g:filetype_prg
|
||||
*.pl g:filetype_pl
|
||||
*.inc g:filetype_inc
|
||||
*.w g:filetype_w |ft-cweb-syntax|
|
||||
*.i g:filetype_i |ft-progress-syntax|
|
||||
*.p g:filetype_p |ft-pascal-syntax|
|
||||
*.pp g:filetype_pp |ft-pascal-syntax|
|
||||
*.sh g:bash_is_sh |ft-sh-syntax|
|
||||
*.tex g:tex_flavor |ft-tex-plugin|
|
||||
*.w g:filetype_w |ft-cweb-syntax|
|
||||
|
||||
*filetype-ignore*
|
||||
To avoid that certain files are being inspected, the g:ft_ignore_pat variable
|
||||
@@ -495,20 +493,13 @@ Options:
|
||||
For further discussion of fortran_have_tabs and the method used for the
|
||||
detection of source format see |ft-fortran-syntax|.
|
||||
|
||||
|
||||
GIT COMMIT *ft-gitcommit-plugin*
|
||||
|
||||
One command, :DiffGitCached, is provided to show a diff of the current commit
|
||||
in the preview window. It is equivalent to calling "git diff --cached" plus
|
||||
any arguments given to the command.
|
||||
|
||||
GPROF *ft-gprof-plugin*
|
||||
|
||||
The gprof filetype plugin defines a mapping <C-]> to jump from a function
|
||||
entry in the gprof flat profile or from a function entry in the call graph
|
||||
to the details of that function in the call graph.
|
||||
|
||||
The mapping can be disabled with: >
|
||||
let g:no_gprof_maps = 1
|
||||
|
||||
MAIL *ft-mail-plugin*
|
||||
|
||||
|
@@ -535,8 +535,6 @@ nest, the nested fold is one character right of the fold it's contained in.
|
||||
|
||||
A closed fold is indicated with a '+'.
|
||||
|
||||
These characters can be changed with the 'fillchars' option.
|
||||
|
||||
Where the fold column is too narrow to display all nested folds, digits are
|
||||
shown to indicate the nesting level.
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*ft_ps1.txt* A Windows PowerShell syntax plugin for Vim
|
||||
*ps1.txt* A Windows PowerShell syntax plugin for Vim
|
||||
|
||||
Author: Peter Provost <https://www.github.com/PProvost>
|
||||
License: Apache 2.0
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*ft_raku.txt* The Raku programming language filetype
|
||||
*vim-raku.txt* The Raku programming language filetype
|
||||
|
||||
*vim-raku*
|
||||
|
||||
@@ -45,7 +45,7 @@ Numbers, subscripts and superscripts are available with 's' and 'S':
|
||||
1s ₁ 1S ¹ ~
|
||||
2s ₂ 9S ⁹ ~
|
||||
|
||||
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. >
|
||||
exec 'digraph \\ '.char2nr('∖')
|
||||
exec 'digraph \< '.char2nr('≼')
|
||||
|
@@ -436,7 +436,7 @@ the space bar):
|
||||
replace the column list with the list of tables.
|
||||
- This allows you to quickly drill down into a
|
||||
table to view its columns and back again.
|
||||
- <Right> and <Left> can also be chosen via
|
||||
- <Right> and <Left> can be also be chosen via
|
||||
your |init.vim| >
|
||||
let g:ftplugin_sql_omni_key_right = '<Right>'
|
||||
let g:ftplugin_sql_omni_key_left = '<Left>'
|
||||
|
@@ -175,6 +175,7 @@ system. To do this, put these commands in your vimrc file: >
|
||||
:map <F4> :emenu <C-Z>
|
||||
Pressing <F4> will start the menu. You can now use the cursor keys to select
|
||||
a menu entry. Hit <Enter> to execute it. Hit <Esc> if you want to cancel.
|
||||
This does require the |+menu| feature enabled at compile time.
|
||||
|
||||
Creating New Menus *creating-menus*
|
||||
|
||||
@@ -472,8 +473,9 @@ Executing Menus *execute-menus*
|
||||
insert-mode menu Eg: >
|
||||
:emenu File.Exit
|
||||
|
||||
You can use :emenu to access useful menu items you may have got used to from
|
||||
GUI mode. See 'wildmenu' for an option that works well with this. See
|
||||
If the console-mode vim has been compiled with WANT_MENU defined, you can
|
||||
use :emenu to access useful menu items you may have got used to from GUI
|
||||
mode. See 'wildmenu' for an option that works well with this. See
|
||||
|console-menus| for an example.
|
||||
|
||||
When using a range, if the lines match with '<,'>, then the menu is executed
|
||||
|
@@ -125,12 +125,11 @@ Advanced editing ~
|
||||
|windows.txt| commands for using multiple windows and buffers
|
||||
|tabpage.txt| commands for using multiple tab pages
|
||||
|spell.txt| spell checking
|
||||
|diff.txt| working with two to eight versions of the same file
|
||||
|diff.txt| working with two to four versions of the same file
|
||||
|autocmd.txt| automatically executing commands on an event
|
||||
|eval.txt| expression evaluation, conditional commands
|
||||
|fold.txt| hide (fold) ranges of lines
|
||||
|lua.txt| Lua API
|
||||
|api.txt| Nvim API via RPC, Lua and VimL
|
||||
|
||||
Special issues ~
|
||||
|testing.txt| testing Vim and Vim scripts
|
||||
@@ -140,13 +139,10 @@ Special issues ~
|
||||
Programming language support ~
|
||||
|indent.txt| automatic indenting for C and other languages
|
||||
|lsp.txt| Language Server Protocol (LSP)
|
||||
|treesitter.txt| tree-sitter library for incremental parsing of buffers
|
||||
|syntax.txt| syntax highlighting
|
||||
|filetype.txt| settings done specifically for a type of file
|
||||
|quickfix.txt| commands for a quick edit-compile-fix cycle
|
||||
|ft_ada.txt| Ada (the programming language) support
|
||||
|ft_ps1.txt| Filetype plugin for Windows PowerShell
|
||||
|ft_raku.txt| Filetype plugin for Raku
|
||||
|ft_rust.txt| Filetype plugin for Rust
|
||||
|ft_sql.txt| about the SQL filetype plugin
|
||||
|
||||
|
@@ -249,6 +249,7 @@ command: >
|
||||
|
||||
It is possible to add translated help files, next to the original English help
|
||||
files. Vim will search for all help in "doc" directories in 'runtimepath'.
|
||||
This is only available when compiled with the |+multi_lang| feature.
|
||||
|
||||
At this moment translations are available for:
|
||||
Chinese - multiple authors
|
||||
@@ -319,25 +320,21 @@ Hints for translators:
|
||||
3. Writing help files *help-writing*
|
||||
|
||||
For ease of use, a Vim help file for a plugin should follow the format of the
|
||||
standard Vim help files, except for the first line. If you are writing a new
|
||||
help file it's best to copy one of the existing files and use it as a
|
||||
template.
|
||||
standard Vim help files. If you are writing a new help file it's best to copy
|
||||
one of the existing files and use it as a template.
|
||||
|
||||
The first line in a help file should have the following format:
|
||||
|
||||
*plugin_name.txt* {short description of the plugin}
|
||||
*helpfile_name.txt* For Vim version 7.3 Last change: 2010 June 4
|
||||
|
||||
The first field is a help tag where ":help plugin_name" will jump to. The
|
||||
remainder of the line, after a Tab, describes the plugin purpose in a short
|
||||
way. This will show up in the "LOCAL ADDITIONS" section of the main help
|
||||
file. Check there that it shows up properly: |local-additions|.
|
||||
|
||||
If you want to add a version number or last modification date, put it in the
|
||||
second line, right aligned.
|
||||
The first field is a link to the help file name. The second field describes
|
||||
the applicable Vim version. The last field specifies the last modification
|
||||
date of the file. Each field is separated by a tab.
|
||||
|
||||
At the bottom of the help file, place a Vim modeline to set the 'textwidth'
|
||||
and 'tabstop' options and the 'filetype' to "help". Never set a global option
|
||||
in such a modeline, that can have undesired consequences.
|
||||
in such a modeline, that can have consequences undesired by whoever reads that
|
||||
help.
|
||||
|
||||
|
||||
TAGS
|
||||
@@ -393,5 +390,17 @@ highlighting. So do these:
|
||||
|
||||
You can find the details in $VIMRUNTIME/syntax/help.vim
|
||||
|
||||
*inclusion*
|
||||
Vim is for everybody, no matter race, gender or anything. Some people make a
|
||||
big deal about using "he" or "his" when referring to the user, thinking it
|
||||
means we assume the user is male. That is not the case, it's just a habit of
|
||||
writing help text, which quite often is many years old. Also, a lot of the
|
||||
text is written by contributors for whom English is not their first language.
|
||||
We do not make any assumptions about the gender of the user, no matter how the
|
||||
text is phrased. Some people have suggested using "they", but that is not
|
||||
regular English. We do not want to spend much time on this discussion. The
|
||||
goal is that the reader understands how Vim works, the exact wording is
|
||||
secondary.
|
||||
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
@@ -189,9 +189,6 @@ VIM::Eval({expr}) Evaluates {expr} and returns (success, value) in list
|
||||
A |List| is turned into a string by joining the items
|
||||
and inserting line breaks.
|
||||
|
||||
*perl-Blob*
|
||||
VIM::Blob({expr}) Return Blob literal string 0zXXXX from scalar value.
|
||||
|
||||
==============================================================================
|
||||
3. VIM::Buffer objects *perl-buffer*
|
||||
|
||||
|
@@ -45,11 +45,6 @@ To see what version of Python you have: >
|
||||
|
||||
There is no need to "import sys", it's done by default.
|
||||
|
||||
*python-environment*
|
||||
Environment variables set in Vim are not always available in Python. This
|
||||
depends on how Vim and Python were build. Also see
|
||||
https://docs.python.org/3/library/os.html#os.environ
|
||||
|
||||
Note: Python is very sensitive to indenting. Make sure the "class" line and
|
||||
"EOF" do not have any indent.
|
||||
|
||||
|
@@ -32,6 +32,10 @@ downloading Ruby there.
|
||||
This form of the |:ruby| command is mainly useful for
|
||||
including ruby code in vim scripts.
|
||||
|
||||
Note: This command doesn't work when the Ruby feature
|
||||
wasn't compiled in. To avoid errors, see
|
||||
|script-here|.
|
||||
|
||||
Example Vim script: >
|
||||
|
||||
function! RedGem()
|
||||
|
@@ -604,22 +604,26 @@ CLOJURE *ft-clojure-indent* *clojure-indent*
|
||||
Clojure indentation differs somewhat from traditional Lisps, due in part to
|
||||
the use of square and curly brackets, and otherwise by community convention.
|
||||
These conventions are not universally followed, so the Clojure indent script
|
||||
offers a few configuration options.
|
||||
offers a few configurable options, listed below.
|
||||
|
||||
If the current vim does not include searchpairpos(), the indent script falls
|
||||
back to normal 'lisp' indenting, and the following options are ignored.
|
||||
|
||||
*g:clojure_maxlines*
|
||||
|
||||
Sets maximum scan distance of `searchpairpos()`. Larger values trade
|
||||
performance for correctness when dealing with very long forms. A value of
|
||||
0 will scan without limits. The default is 300.
|
||||
|
||||
|
||||
Set maximum scan distance of searchpairpos(). Larger values trade performance
|
||||
for correctness when dealing with very long forms. A value of 0 will scan
|
||||
without limits.
|
||||
>
|
||||
" Default
|
||||
let g:clojure_maxlines = 100
|
||||
<
|
||||
*g:clojure_fuzzy_indent*
|
||||
*g:clojure_fuzzy_indent_patterns*
|
||||
*g:clojure_fuzzy_indent_blacklist*
|
||||
|
||||
The 'lispwords' option is a list of comma-separated words that mark special
|
||||
forms whose subforms should be indented with two spaces.
|
||||
forms whose subforms must be indented with two spaces.
|
||||
|
||||
For example:
|
||||
>
|
||||
@@ -637,11 +641,15 @@ the fuzzy indent feature:
|
||||
let g:clojure_fuzzy_indent_patterns = ['^with', '^def', '^let']
|
||||
let g:clojure_fuzzy_indent_blacklist =
|
||||
\ ['-fn$', '\v^with-%(meta|out-str|loading-context)$']
|
||||
|
||||
" Legacy comma-delimited string version; the list format above is
|
||||
" recommended. Note that patterns are implicitly anchored with ^ and $
|
||||
let g:clojure_fuzzy_indent_patterns = 'with.*,def.*,let.*'
|
||||
<
|
||||
|g:clojure_fuzzy_indent_patterns| and |g:clojure_fuzzy_indent_blacklist| are
|
||||
lists of patterns that will be matched against the unqualified symbol at the
|
||||
head of a list. This means that a pattern like `"^foo"` will match all these
|
||||
candidates: `foobar`, `my.ns/foobar`, and `#'foobar`.
|
||||
|Lists| of patterns that will be matched against the unquoted, unqualified
|
||||
symbol at the head of a list. This means that a pattern like "^foo" will match
|
||||
all these candidates: "foobar", "my.ns/foobar", and "#'foobar".
|
||||
|
||||
Each candidate word is tested for special treatment in this order:
|
||||
|
||||
@@ -652,22 +660,20 @@ Each candidate word is tested for special treatment in this order:
|
||||
|g:clojure_fuzzy_indent_patterns|
|
||||
4. Return false and indent normally otherwise
|
||||
|
||||
|
||||
*g:clojure_special_indent_words*
|
||||
|
||||
Some forms in Clojure are indented such that every subform is indented by only
|
||||
two spaces, regardless of 'lispwords'. If you have a custom construct that
|
||||
should be indented in this idiosyncratic fashion, you can add your symbols to
|
||||
the default list below.
|
||||
Some forms in Clojure are indented so that every subform is indented only two
|
||||
spaces, regardless of 'lispwords'. If you have a custom construct that should
|
||||
be indented in this idiosyncratic fashion, you can add your symbols to the
|
||||
default list below.
|
||||
>
|
||||
" Default
|
||||
let g:clojure_special_indent_words =
|
||||
\ 'deftype,defrecord,reify,proxy,extend-type,extend-protocol,letfn'
|
||||
<
|
||||
|
||||
*g:clojure_align_multiline_strings*
|
||||
|
||||
Align subsequent lines in multi-line strings to the column after the opening
|
||||
Align subsequent lines in multiline strings to the column after the opening
|
||||
quote, instead of the same column.
|
||||
|
||||
For example:
|
||||
@@ -684,7 +690,11 @@ For example:
|
||||
enim ad minim veniam, quis nostrud exercitation ullamco laboris
|
||||
nisi ut aliquip ex ea commodo consequat.")
|
||||
<
|
||||
|
||||
This option is off by default.
|
||||
>
|
||||
" Default
|
||||
let g:clojure_align_multiline_strings = 0
|
||||
<
|
||||
*g:clojure_align_subforms*
|
||||
|
||||
By default, parenthesized compound forms that look like function calls and
|
||||
@@ -695,14 +705,18 @@ two spaces relative to the opening paren:
|
||||
bar
|
||||
baz)
|
||||
<
|
||||
Setting this option to `1` changes this behaviour so that all subforms are
|
||||
aligned to the same column, emulating the default behaviour of
|
||||
clojure-mode.el:
|
||||
Setting this option changes this behavior so that all subforms are aligned to
|
||||
the same column, emulating the default behavior of clojure-mode.el:
|
||||
>
|
||||
(foo
|
||||
bar
|
||||
baz)
|
||||
<
|
||||
This option is off by default.
|
||||
>
|
||||
" Default
|
||||
let g:clojure_align_subforms = 0
|
||||
<
|
||||
|
||||
FORTRAN *ft-fortran-indent*
|
||||
|
||||
|
@@ -155,7 +155,6 @@ commands in CTRL-X submode *i_CTRL-X_index*
|
||||
|i_CTRL-X_CTRL-Y| CTRL-X CTRL-Y scroll down
|
||||
|i_CTRL-X_CTRL-U| CTRL-X CTRL-U complete with 'completefunc'
|
||||
|i_CTRL-X_CTRL-V| CTRL-X CTRL-V complete like in : command line
|
||||
|i_CTRL-X_CTRL-Z| CTRL-X CTRL-Z stop completion, keeping the text as-is
|
||||
|i_CTRL-X_CTRL-]| CTRL-X CTRL-] complete tags
|
||||
|i_CTRL-X_s| CTRL-X s spelling suggestions
|
||||
|
||||
@@ -700,7 +699,8 @@ tag char note action in Normal mode ~
|
||||
|
||||
tag char note action in Normal mode ~
|
||||
------------------------------------------------------------------------------
|
||||
|g_CTRL-A| g CTRL-A dump a memory profile
|
||||
|g_CTRL-A| g CTRL-A only when compiled with MEM_PROFILE
|
||||
defined: dump a memory profile
|
||||
|g_CTRL-G| g CTRL-G show information about current cursor
|
||||
position
|
||||
|g_CTRL-H| g CTRL-H start Select block mode
|
||||
@@ -1097,9 +1097,8 @@ tag command action in Command-line editing mode ~
|
||||
==============================================================================
|
||||
5. Terminal mode *terminal-mode-index*
|
||||
|
||||
In a |terminal| buffer all keys except CTRL-\ are forwarded to the terminal
|
||||
job. If CTRL-\ is pressed, the next key is forwarded unless it is CTRL-N.
|
||||
Use |CTRL-\_CTRL-N| to go to Normal mode.
|
||||
In a |terminal| buffer all keys except |CTRL-\_CTRL-N| are forwarded to the
|
||||
terminal job. Use CTRL-\_CTRL-N to go to Normal mode.
|
||||
|
||||
|
||||
You found it, Arthur! *holy-grail*
|
||||
@@ -1610,7 +1609,7 @@ tag command action ~
|
||||
|:tab| :tab create new tab when opening new window
|
||||
|:tag| :ta[g] jump to tag
|
||||
|:tags| :tags show the contents of the tag stack
|
||||
|:tcd| :tc[d] change directory for tab page
|
||||
|:tcd| :tcd change directory for tab page
|
||||
|:tchdir| :tch[dir] change directory for tab page
|
||||
|:terminal| :te[rminal] open a terminal buffer
|
||||
|:tfirst| :tf[irst] jump to first matching tag
|
||||
|
@@ -68,18 +68,12 @@ CTRL-A Insert previously inserted text.
|
||||
CTRL-W Delete the word before the cursor (see |i_backspacing| about
|
||||
joining lines). See the section "word motions",
|
||||
|word-motions|, for the definition of a word.
|
||||
*i_CTRL-W-default*
|
||||
By default, sets a new undo point before deleting.
|
||||
|default-mappings|
|
||||
*i_CTRL-U*
|
||||
CTRL-U Delete all entered characters before the cursor in the current
|
||||
line. If there are no newly entered characters and
|
||||
'backspace' is not empty, delete all characters before the
|
||||
cursor in the current line.
|
||||
See |i_backspacing| about joining lines.
|
||||
*i_CTRL-U-default*
|
||||
By default, sets a new undo point before deleting.
|
||||
|default-mappings|
|
||||
*i_CTRL-I* *i_<Tab>* *i_Tab*
|
||||
<Tab> or CTRL-I Insert a tab. If the 'expandtab' option is on, the
|
||||
equivalent number of spaces is inserted (use CTRL-V <Tab> to
|
||||
@@ -622,8 +616,6 @@ Completion can be done for:
|
||||
12. Spelling suggestions |i_CTRL-X_s|
|
||||
13. keywords in 'complete' |i_CTRL-N| |i_CTRL-P|
|
||||
|
||||
Additionally, |i_CTRL-X_CTRL-Z| stops completion without changing the text.
|
||||
|
||||
All these, except CTRL-N and CTRL-P, are done in CTRL-X mode. This is a
|
||||
sub-mode of Insert and Replace modes. You enter CTRL-X mode by typing CTRL-X
|
||||
and one of the CTRL-X commands. You exit CTRL-X mode by typing a key that is
|
||||
@@ -804,9 +796,6 @@ CTRL-X CTRL-K Search the files given with the 'dictionary' option
|
||||
CTRL-P Search backwards for next matching keyword. This
|
||||
keyword replaces the previous matching keyword.
|
||||
|
||||
|
||||
Completing words in 'thesaurus' *compl-thesaurus*
|
||||
|
||||
*i_CTRL-X_CTRL-T*
|
||||
CTRL-X CTRL-T Works as CTRL-X CTRL-K, but in a special way. It uses
|
||||
the 'thesaurus' option instead of 'dictionary'. If a
|
||||
@@ -815,6 +804,16 @@ CTRL-X CTRL-T Works as CTRL-X CTRL-K, but in a special way. It uses
|
||||
matches, even though they don't complete the word.
|
||||
Thus a word can be completely replaced.
|
||||
|
||||
For an example, imagine the 'thesaurus' file has a
|
||||
line like this: >
|
||||
angry furious mad enraged
|
||||
< 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 "furious",
|
||||
"mad" etc.
|
||||
Other uses include translation between two languages,
|
||||
or grouping API functions by keyword.
|
||||
|
||||
CTRL-T or
|
||||
CTRL-N Search forward for next matching keyword. This
|
||||
keyword replaces the previous matching keyword.
|
||||
@@ -822,59 +821,6 @@ CTRL-X CTRL-T Works as CTRL-X CTRL-K, but in a special way. It uses
|
||||
CTRL-P Search backwards for next matching keyword. This
|
||||
keyword replaces the previous matching keyword.
|
||||
|
||||
In the file used by the 'thesaurus' option each line in the file should
|
||||
contain words with similar meaning, separated by non-keyword characters (white
|
||||
space is preferred). Maximum line length is 510 bytes.
|
||||
|
||||
For an example, imagine the 'thesaurus' file has a line like this: >
|
||||
angry furious mad enraged
|
||||
<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
|
||||
"furious", "mad" etc.
|
||||
|
||||
Other uses include translation between two languages, or grouping API
|
||||
functions by keyword.
|
||||
|
||||
An English word list was added to this github issue:
|
||||
https://github.com/vim/vim/issues/629#issuecomment-443293282
|
||||
Unpack thesaurus_pkg.zip, put the thesaurus.txt file somewhere, e.g.
|
||||
~/.vim/thesaurus/english.txt, and the 'thesaurus' option to this file name.
|
||||
|
||||
|
||||
Completing keywords with 'thesaurusfunc' *compl-thesaurusfunc*
|
||||
|
||||
If the 'thesaurusfunc' option is set, then the user specified function is
|
||||
invoked to get the list of completion matches and the 'thesaurus' option is
|
||||
not used. See |complete-functions| for an explanation of how the function is
|
||||
invoked and what it should return.
|
||||
|
||||
Here is an example that uses the "aiksaurus" command (provided by Magnus
|
||||
Groß): >
|
||||
|
||||
func Thesaur(findstart, base)
|
||||
if a:findstart
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
while start > 0 && line[start - 1] =~ '\a'
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
else
|
||||
let res = []
|
||||
let h = ''
|
||||
for l in split(system('aiksaurus '.shellescape(a:base)), '\n')
|
||||
if l[:3] == '=== '
|
||||
let h = substitute(l[4:], ' =*$', '', '')
|
||||
elseif l[0] =~ '\a'
|
||||
call extend(res, map(split(l, ', '), {_, val -> {'word': val, 'menu': '('.h.')'}}))
|
||||
endif
|
||||
endfor
|
||||
return res
|
||||
endif
|
||||
endfunc
|
||||
|
||||
set thesaurusfunc=Thesaur
|
||||
|
||||
|
||||
Completing keywords in the current and included files *compl-keyword*
|
||||
|
||||
@@ -1070,15 +1016,9 @@ CTRL-P Find previous match for words that start with the
|
||||
other contexts unless a double CTRL-X is used.
|
||||
|
||||
|
||||
Stop completion *compl-stop*
|
||||
|
||||
*i_CTRL-X_CTRL-Z*
|
||||
CTRL-X CTRL-Z Stop completion without changing the text.
|
||||
|
||||
|
||||
FUNCTIONS FOR FINDING COMPLETIONS *complete-functions*
|
||||
|
||||
This applies to 'completefunc', 'thesaurusfunc' and 'omnifunc'.
|
||||
This applies to 'completefunc' and 'omnifunc'.
|
||||
|
||||
The function is called in two different ways:
|
||||
- First the function is called to find the start of the text to be completed.
|
||||
@@ -1107,8 +1047,7 @@ On the second invocation the arguments are:
|
||||
|
||||
The function must return a List with the matching words. These matches
|
||||
usually include the "a:base" text. When there are no matches return an empty
|
||||
List. Note that the cursor may have moved since the first invocation, the
|
||||
text may have been changed.
|
||||
List.
|
||||
|
||||
In order to return more information than the matching words, return a Dict
|
||||
that contains the List. The Dict can have these items:
|
||||
@@ -1179,7 +1118,7 @@ match to the total list. These matches should then not appear in the returned
|
||||
list! Call |complete_check()| now and then to allow the user to press a key
|
||||
while still searching for matches. Stop searching when it returns non-zero.
|
||||
|
||||
*E840*
|
||||
*E839* *E840*
|
||||
The function is allowed to move the cursor, it is restored afterwards.
|
||||
The function is not allowed to move to another window or delete text.
|
||||
|
||||
|
@@ -55,7 +55,7 @@ Nvim on the interwebs *internet*
|
||||
Nvim home page: https://neovim.io/
|
||||
Nvim FAQ: https://github.com/neovim/neovim/wiki/FAQ
|
||||
Downloads: https://github.com/neovim/neovim/releases
|
||||
Vim FAQ: https://vimhelp.org/vim_faq.txt.html
|
||||
Vim FAQ: https://vimhelp.appspot.com/vim_faq.txt.html
|
||||
|
||||
|
||||
*bugs* *bug-report*
|
||||
@@ -312,6 +312,7 @@ notation meaning equivalent decimal value(s) ~
|
||||
<Tab> tab CTRL-I 9 *tab* *Tab*
|
||||
*linefeed*
|
||||
<NL> linefeed CTRL-J 10 (used for <Nul>)
|
||||
<FF> formfeed CTRL-L 12 *formfeed*
|
||||
<CR> carriage return CTRL-M 13 *carriage-return*
|
||||
<Return> same as <CR> *<Return>*
|
||||
<Enter> same as <CR> *<Enter>*
|
||||
@@ -453,10 +454,9 @@ Ex mode Like Command-line mode, but after entering a command
|
||||
command line. |Ex-mode|
|
||||
|
||||
*Terminal-mode*
|
||||
Terminal mode In Terminal mode all input (except CTRL-\) is sent to
|
||||
the process running in the current |terminal| buffer.
|
||||
If CTRL-\ is pressed, the next key is sent unless it
|
||||
is CTRL-N (|CTRL-\_CTRL-N|).
|
||||
Terminal mode In Terminal mode all input (except |c_CTRL-\_CTRL-N|)
|
||||
is sent to the process running in the current
|
||||
|terminal| buffer.
|
||||
If the 'showmode' option is on "-- TERMINAL --" is shown
|
||||
at the bottom of the window.
|
||||
|
||||
|
@@ -19,7 +19,7 @@ Job Id *job-id*
|
||||
Each job is identified by an integer id, unique for the life of the current
|
||||
Nvim session. Each job-id is a valid |channel-id|: they share the same "key
|
||||
space". Functions like |jobstart()| return job ids; functions like
|
||||
|jobstop()|, |chansend()|, |rpcnotify()|, and |rpcrequest()| take job ids.
|
||||
|jobsend()|, |jobstop()|, |rpcnotify()|, and |rpcrequest()| take job ids.
|
||||
|
||||
Job stdio streams form a |channel| which can send and receive raw bytes or
|
||||
|msgpack-rpc| messages.
|
||||
@@ -28,7 +28,7 @@ Job stdio streams form a |channel| which can send and receive raw bytes or
|
||||
Usage *job-control-usage*
|
||||
|
||||
To control jobs, use the "job…" family of functions: |jobstart()|,
|
||||
|jobstop()|, etc.
|
||||
|jobsend()|, |jobstop()|.
|
||||
|
||||
Example: >
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user