mirror of
https://github.com/vim/vim
synced 2025-07-30 02:11:39 +00:00
Compare commits
399 Commits
Author | SHA1 | Date | |
---|---|---|---|
a401bba080 | |||
5cebca27b8 | |||
14c7530c4f | |||
dd9de50f42 | |||
2596a4e763 | |||
6aa57295cf | |||
bfb2bb16bc | |||
d2e9ccee90 | |||
4830c211a4 | |||
b521766c56 | |||
88c89c7722 | |||
78a9c2e670 | |||
aacc966c5d | |||
89071cb6a1 | |||
069f90852f | |||
92f05f21af | |||
ef98257593 | |||
bd77aa9274 | |||
3e9c0b9608 | |||
4f0884d6e2 | |||
ed7cb2df35 | |||
7deb4115ef | |||
16e63e6d35 | |||
b85d3627d9 | |||
ba9c23e776 | |||
6e48b84c5f | |||
52eb372a04 | |||
917c46abe5 | |||
b6f55bb5b4 | |||
b56c4419d4 | |||
bd9e796125 | |||
8ee52affe7 | |||
eed9616120 | |||
ed8b099fd2 | |||
33ea9fd4d8 | |||
80a070c361 | |||
2950065e18 | |||
267359902c | |||
9e2fa4bb9e | |||
e525bdda3a | |||
dae453f339 | |||
4270d8b762 | |||
fbeefb1b87 | |||
6ce46b9963 | |||
7de6262373 | |||
1b154ea121 | |||
8493499880 | |||
c611941c60 | |||
3276f5846f | |||
d57a6bd98c | |||
cbae580283 | |||
11328bc7df | |||
5671f3f076 | |||
6f6d58c380 | |||
63b9173693 | |||
af647e76ca | |||
4f33bc20d7 | |||
1b6acf02b7 | |||
6a230c6b32 | |||
bc67e5a0a4 | |||
4a01159da2 | |||
9fe17d473a | |||
f18e8a969a | |||
9dc4bef897 | |||
57942237c1 | |||
d61f2f772a | |||
dd097bdc13 | |||
80d7395dcf | |||
0eec851942 | |||
41a3485dd6 | |||
23e2e11515 | |||
51ad850f5f | |||
2c70711e3f | |||
7bf9a07bd7 | |||
c3160727b9 | |||
bb7ee7abe1 | |||
35578168be | |||
952d9d827e | |||
1321257317 | |||
e041dde7bb | |||
e4db17fb6e | |||
0d4d9ee9bb | |||
f78da4f9d6 | |||
73b8b0ae3a | |||
6db660bed9 | |||
e97976baa7 | |||
78ba933d18 | |||
f24f51d030 | |||
f5d52c90e0 | |||
9e0ee59019 | |||
1780f08ba4 | |||
335c8c7b20 | |||
620c959c6c | |||
78db17c6f3 | |||
8e3fc135e8 | |||
bf634a0a8b | |||
b9115da4be | |||
28d8421bfb | |||
890ee4e2be | |||
4a15504e91 | |||
0f5575d0a7 | |||
1790be6cb6 | |||
60dc8274e9 | |||
921ba52926 | |||
77ab4e28a2 | |||
77111e2bfc | |||
131530a54d | |||
41114a2a27 | |||
83cd0156e0 | |||
0732932553 | |||
6e850a6900 | |||
2a4bd00cef | |||
81530e3603 | |||
d47c39775b | |||
53f7fccc94 | |||
327d3ee455 | |||
eaf3f36168 | |||
6868634abd | |||
78e006b9b0 | |||
e2390c7f32 | |||
7e6a2a64f0 | |||
9088784972 | |||
f723701de0 | |||
4490ec4e83 | |||
5d7c2df536 | |||
53ba05b090 | |||
29b857150c | |||
ccb148ac63 | |||
678b207fb1 | |||
ff34bee3a2 | |||
3c77b6a1ce | |||
a764e73d4f | |||
2ec28aec9d | |||
7a4ca32175 | |||
8a4c812ede | |||
3ed0d93796 | |||
2eb6fc3b52 | |||
5bca906b30 | |||
7d60384a00 | |||
9c9472ff49 | |||
5a9e5845e1 | |||
7973de35ba | |||
dd0b287c1e | |||
88421d6dc8 | |||
1a3e5747b7 | |||
5a234eb18e | |||
0ad871dc4d | |||
1b862c466b | |||
c9e7e344ed | |||
cd268017cf | |||
5dd839ce20 | |||
2b59df00d8 | |||
7a3fe3e180 | |||
a74901929e | |||
f674b358fc | |||
d8e44476d8 | |||
05bd9785fd | |||
c4c5642513 | |||
cd9172077b | |||
189663bdac | |||
11d7e62f1d | |||
63cb6567f0 | |||
e29a27f6f8 | |||
9fa5dabedc | |||
83494b4ac6 | |||
9bb0dad0d8 | |||
605793500b | |||
ac2cd2b08f | |||
6106504e9e | |||
98c2eaed27 | |||
885971e2f5 | |||
9ff9c7b974 | |||
f6488547e3 | |||
24e9316560 | |||
4db572eeb2 | |||
ad2d4969e1 | |||
0c35752d04 | |||
c6ba2f9dde | |||
47bc9c3337 | |||
a9a7c0c602 | |||
20c370d9f2 | |||
f5f1b59d3b | |||
d8cee76b49 | |||
5245beb37c | |||
378697ac58 | |||
547f94f330 | |||
b5841b99e6 | |||
9e60e899ee | |||
0894e0d808 | |||
1557b16dad | |||
1a71d31bf3 | |||
c816a2c226 | |||
4a0b85ad01 | |||
5bea41dea3 | |||
1840a7b4e3 | |||
16e26a3116 | |||
ee41052ccb | |||
042414fa00 | |||
841e498c5d | |||
7b7a118e74 | |||
11005b078d | |||
ffcfddc759 | |||
c72bdd28ac | |||
cc7eb2aa7a | |||
5231224e11 | |||
648594eaf7 | |||
c03fe66ade | |||
4ece152ad6 | |||
0f1227f7d5 | |||
d9162550aa | |||
1aeddeb8bd | |||
de69a7353e | |||
482d2f37a5 | |||
a2438132a6 | |||
31e21766d6 | |||
c323527d67 | |||
fe3418abe0 | |||
5b73992d8f | |||
9da32e4d57 | |||
90fba5627b | |||
6bcb18253a | |||
981217c11f | |||
b885a7c72c | |||
c967d57aa9 | |||
f055d45023 | |||
f32f099761 | |||
d4ab807d62 | |||
09f688c33a | |||
deb108ba0a | |||
1594f31345 | |||
30441bb3d5 | |||
41fb723ee9 | |||
db86472770 | |||
6a9e5c69cf | |||
5ede5b231e | |||
efc5db5215 | |||
90df4b9d42 | |||
303215d60c | |||
b5098060f4 | |||
599a6e5b36 | |||
442b29c968 | |||
5cb09620c1 | |||
404557e6a6 | |||
04db26b360 | |||
f6d877975b | |||
d6fa7bd5b9 | |||
22f85d0459 | |||
6977dba04b | |||
97f227d9c9 | |||
b7480cd893 | |||
f33cae6050 | |||
3777d6e32b | |||
26e88ec8e2 | |||
67b17a6fc6 | |||
7a40ff00ed | |||
4197828dc6 | |||
999db2346b | |||
1d97efce0c | |||
6c72fd51a8 | |||
b17ab86e7b | |||
c60e959cba | |||
fb773a3e0a | |||
74509239df | |||
e28d9b3bd4 | |||
00aaa512d5 | |||
20cc528320 | |||
9cee4a1c9c | |||
fcde67c99f | |||
6fc0161682 | |||
acbb4b5720 | |||
a26f56f675 | |||
72463f883c | |||
b836f631db | |||
11a632d60b | |||
576cb75ceb | |||
a3d1b29bd3 | |||
834193afd7 | |||
d3d8feeb89 | |||
3f987b5917 | |||
80b2ba3e96 | |||
ea042677ab | |||
4067bd3604 | |||
7d7bcc6ba0 | |||
127950241e | |||
ffec6dd16a | |||
108010aa47 | |||
d887297ad0 | |||
1d1ce613cd | |||
17d868b8b2 | |||
577dc93da9 | |||
4d8f476176 | |||
e65081d1b5 | |||
65aee0b714 | |||
4cd5c52d64 | |||
054794c20f | |||
98f9a5f4cb | |||
e3ffaa6b7c | |||
015cf10311 | |||
307dec4567 | |||
14ded11fca | |||
3a3b10e87a | |||
4d5dfe2083 | |||
13e45d14ba | |||
ce024c3e20 | |||
444d878324 | |||
f3caeb63d6 | |||
6582e230a0 | |||
22480d147f | |||
f3d30842dc | |||
b420ac9d20 | |||
98703d7f6c | |||
3a62b14077 | |||
d415d26913 | |||
6738fd2000 | |||
44dea9da4b | |||
18d46587b9 | |||
8cec9273d2 | |||
cc65040986 | |||
8ce3ca8961 | |||
7237cab8f1 | |||
831bdf8622 | |||
ef7be8348f | |||
419a40ac96 | |||
226b28b961 | |||
22f17a29cd | |||
cb54bc6562 | |||
035bd1c99f | |||
f1e7449d56 | |||
2ac4b2536a | |||
4f8f54280f | |||
0d5e1ec37f | |||
2fb1b89d72 | |||
ca81f0e834 | |||
f573c6e1ed | |||
208f0b48b2 | |||
2fb7495686 | |||
6864efa596 | |||
ad52f96a2d | |||
59b50c3bee | |||
fae55a9cb0 | |||
74f4a965bc | |||
6e9695525e | |||
4cea536bdf | |||
29f0dc3689 | |||
6bc30b05e6 | |||
41a7f82dea | |||
b90ac5e96e | |||
55b6b60b69 | |||
61a417b7c1 | |||
a97c36310f | |||
f57b43c230 | |||
8ac681a280 | |||
968a5b62ff | |||
affd0bc626 | |||
caf1a2f296 | |||
3b814af7e1 | |||
47f6db9089 | |||
1b0a9dd413 | |||
26d711645c | |||
b69c6fb7b4 | |||
90478f35a8 | |||
2d6d718dde | |||
5ffefbb35a | |||
2346a63784 | |||
4ee9d8e04d | |||
e70e12b32f | |||
2e66b0d137 | |||
c2dec4cac4 | |||
c3a27bbd53 | |||
6d1792d408 | |||
d9f31c13d2 | |||
e99d422bbd | |||
e6174fd58d | |||
4a27aefe3b | |||
a993153538 | |||
7423577180 | |||
6654ca702c | |||
0b71955552 | |||
5958549760 | |||
744aecf877 | |||
22db0d549f | |||
8de901e1f1 | |||
f0a4069e3d | |||
4f13527598 | |||
3044324e8d | |||
7b4f76c030 | |||
544a38e44d | |||
31e299c08f | |||
a42e6e0082 | |||
54656015d3 | |||
c04f2a4cd4 | |||
e3f50ad640 | |||
b55d618f19 | |||
a733042b12 | |||
445f11d5bc | |||
dc73b4b75d | |||
c41badb748 | |||
8cf02e5cf8 | |||
2f9c209ba0 |
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
@ -51,6 +51,7 @@ runtime/compiler/sass.vim @tpope
|
||||
runtime/compiler/se.vim @dkearns
|
||||
runtime/compiler/shellcheck.vim @dkearns
|
||||
runtime/compiler/sml.vim @dkearns
|
||||
runtime/compiler/spectral.vim @romainl
|
||||
runtime/compiler/stylelint.vim @dkearns
|
||||
runtime/compiler/tcl.vim @dkearns
|
||||
runtime/compiler/tidy.vim @dkearns
|
||||
@ -59,6 +60,7 @@ runtime/compiler/tsc.vim @dkearns
|
||||
runtime/compiler/typedoc.vim @dkearns
|
||||
runtime/compiler/xmllint.vim @dkearns
|
||||
runtime/compiler/xo.vim @dkearns
|
||||
runtime/compiler/yamllint.vim @romainl
|
||||
runtime/compiler/zsh.vim @dkearns
|
||||
runtime/doc/pi_getscript.txt @cecamp
|
||||
runtime/doc/pi_logipat.txt @cecamp
|
||||
@ -236,3 +238,4 @@ src/libvterm/ @leonerd
|
||||
src/po/de.po @chrisbra
|
||||
src/po/eo.po @dpelle
|
||||
src/po/fr.po @dpelle
|
||||
src/xxd/ @jnweiger
|
||||
|
7
.github/workflows/ci.yml
vendored
7
.github/workflows/ci.yml
vendored
@ -56,7 +56,7 @@ jobs:
|
||||
|
||||
- name: Install packages
|
||||
run: |
|
||||
sudo apt-get install -y \
|
||||
sudo apt update && sudo apt install -y \
|
||||
autoconf \
|
||||
lcov \
|
||||
gettext \
|
||||
@ -71,7 +71,8 @@ jobs:
|
||||
cscope \
|
||||
libgtk2.0-dev \
|
||||
desktop-file-utils \
|
||||
libtool-bin
|
||||
libtool-bin \
|
||||
libsodium-dev
|
||||
|
||||
- name: Install clang-11
|
||||
if: matrix.compiler == 'clang'
|
||||
@ -365,7 +366,7 @@ jobs:
|
||||
features: NORMAL
|
||||
|
||||
steps:
|
||||
- name: Initalize
|
||||
- name: Initialize
|
||||
id: init
|
||||
shell: bash
|
||||
run: |
|
||||
|
80
.github/workflows/coverity.yml
vendored
Normal file
80
.github/workflows/coverity.yml
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
name: Coverity
|
||||
on:
|
||||
schedule:
|
||||
- cron: '42 0 * * *' # Run once per day, to avoid Coverity's submission limits
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
scan:
|
||||
runs-on: ubuntu-18.04
|
||||
|
||||
env:
|
||||
CC: gcc
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Download Coverity
|
||||
run: |
|
||||
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=vim" -O coverity_tool.tgz
|
||||
mkdir cov-scan
|
||||
tar ax -f coverity_tool.tgz --strip-components=1 -C cov-scan
|
||||
env:
|
||||
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
||||
|
||||
- name: Install packages
|
||||
run: |
|
||||
sudo apt update && sudo apt install -y \
|
||||
autoconf \
|
||||
gettext \
|
||||
libcanberra-dev \
|
||||
libperl-dev \
|
||||
python-dev \
|
||||
python3-dev \
|
||||
liblua5.3-dev \
|
||||
lua5.3 \
|
||||
ruby-dev \
|
||||
tcl-dev \
|
||||
libgtk2.0-dev \
|
||||
desktop-file-utils \
|
||||
libtool-bin \
|
||||
libsodium-dev
|
||||
|
||||
- name: Set up environment
|
||||
run: |
|
||||
echo "$(pwd)/cov-scan/bin" >> $GITHUB_PATH
|
||||
(
|
||||
echo "NPROC=$(getconf _NPROCESSORS_ONLN)"
|
||||
echo "CONFOPT=--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
|
||||
) >> $GITHUB_ENV
|
||||
|
||||
- name: Set up system
|
||||
run: |
|
||||
# Setup lua5.3 manually since its package doesn't provide alternative.
|
||||
# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
|
||||
sudo update-alternatives --install /usr/bin/lua lua /usr/bin/lua5.3 10
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
./configure --with-features=huge ${CONFOPT} --enable-fail-if-missing
|
||||
# Append various warning flags to CFLAGS.
|
||||
sed -i -f ci/config.mk.sed src/auto/config.mk
|
||||
sed -i -f ci/config.mk.${CC}.sed src/auto/config.mk
|
||||
|
||||
- name: Build/scan vim
|
||||
run: |
|
||||
cov-build --dir cov-int make -j${NPROC}
|
||||
|
||||
- name: Submit results
|
||||
run: |
|
||||
tar zcf cov-scan.tgz cov-int
|
||||
curl --form token=$TOKEN \
|
||||
--form email=$EMAIL \
|
||||
--form file=@cov-scan.tgz \
|
||||
--form version="$(git rev-parse HEAD)" \
|
||||
--form description="Automatic GHA scan" \
|
||||
'https://scan.coverity.com/builds?project=vim'
|
||||
env:
|
||||
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
||||
EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}
|
5
Filelist
5
Filelist
@ -9,6 +9,7 @@ SRC_ALL = \
|
||||
.github/CODEOWNERS \
|
||||
.github/workflows/ci.yml \
|
||||
.github/workflows/codeql-analysis.yml \
|
||||
.github/workflows/coverity.yml \
|
||||
.gitignore \
|
||||
.hgignore \
|
||||
.lgtm.yml \
|
||||
@ -23,6 +24,7 @@ SRC_ALL = \
|
||||
ci/setup-xvfb.sh \
|
||||
src/Make_all.mak \
|
||||
src/README.md \
|
||||
src/alloc.c \
|
||||
src/alloc.h \
|
||||
src/arabic.c \
|
||||
src/arglist.c \
|
||||
@ -134,6 +136,7 @@ SRC_ALL = \
|
||||
src/spell.h \
|
||||
src/spellfile.c \
|
||||
src/spellsuggest.c \
|
||||
src/strings.c \
|
||||
src/structs.h \
|
||||
src/syntax.c \
|
||||
src/tag.c \
|
||||
@ -209,6 +212,7 @@ SRC_ALL = \
|
||||
src/testdir/popupbounce.vim \
|
||||
src/proto.h \
|
||||
src/protodef.h \
|
||||
src/proto/alloc.pro \
|
||||
src/proto/arabic.pro \
|
||||
src/proto/arglist.pro \
|
||||
src/proto/autocmd.pro \
|
||||
@ -296,6 +300,7 @@ SRC_ALL = \
|
||||
src/proto/spell.pro \
|
||||
src/proto/spellfile.pro \
|
||||
src/proto/spellsuggest.pro \
|
||||
src/proto/strings.pro \
|
||||
src/proto/syntax.pro \
|
||||
src/proto/tag.pro \
|
||||
src/proto/term.pro \
|
||||
|
@ -4,6 +4,12 @@
|
||||
|
||||
<sub>For translations of this README see the end.</sub>
|
||||
|
||||
If you find a bug or want to discuss the best way to add a new feature, please
|
||||
open an [issue](https://github.com/vim/vim/issues).
|
||||
If you have a question or want to discuss the best way to do something with
|
||||
Vim, you can use [StackExchange](https://vi.stackexchange.com/)
|
||||
or one of the [Maillists](https://www.vim.org/community.php).
|
||||
|
||||
|
||||
## What is Vim? ##
|
||||
|
||||
|
@ -45,14 +45,16 @@ full code is below):
|
||||
| Vim old | 5.018541 |
|
||||
| Python | 0.369598 |
|
||||
| Lua | 0.078817 |
|
||||
| LuaJit | 0.004245 |
|
||||
| Vim new | 0.073595 |
|
||||
|
||||
That looks very promising! It's just one example, but it shows how much
|
||||
we can gain, and also that Vim script can be faster than builtin
|
||||
interfaces.
|
||||
|
||||
In practice the script would not do something useless as counting but change
|
||||
the text. For example, reindent all the lines:
|
||||
LuaJit is much faster at Lua-only instructions. In practice the script would
|
||||
not do something useless as counting but change the text. For example,
|
||||
reindent all the lines:
|
||||
|
||||
``` vim
|
||||
let totallen = 0
|
||||
@ -64,13 +66,17 @@ the text. For example, reindent all the lines:
|
||||
|
||||
| how | time in sec |
|
||||
| --------| -------- |
|
||||
| Vim old | 0.853752 |
|
||||
| Python | 0.304584 |
|
||||
| Lua | 0.286573 |
|
||||
| Vim new | 0.190276 |
|
||||
| Vim old | 0.578598 |
|
||||
| Python | 0.152040 |
|
||||
| Lua | 0.164917 |
|
||||
| LuaJit | 0.128400 |
|
||||
| Vim new | 0.079692 |
|
||||
|
||||
[These times were measured on a different system by Dominique Pelle]
|
||||
|
||||
The differences are smaller, but Vim 9 script is clearly the fastest.
|
||||
Using LuaJIT gives 0.25, only a little bit faster than plain Lua.
|
||||
Using LuaJIT is only a little bit faster than plain Lua here, clearly the call
|
||||
back to the Vim code is costly.
|
||||
|
||||
How does Vim9 script work? The function is first compiled into a sequence of
|
||||
instructions. Each instruction has one or two parameters and a stack is
|
||||
|
@ -74,7 +74,7 @@ Unpack the images:
|
||||
cd nsis
|
||||
unzip icons.zip
|
||||
|
||||
To build then, enter:
|
||||
Then build gvim.exe:
|
||||
|
||||
cd nsis
|
||||
makensis gvim.nsi
|
||||
|
@ -126,10 +126,11 @@ RequestExecutionLevel highest
|
||||
# This adds '\Vim' to the user choice automagically. The actual value is
|
||||
# obtained below with CheckOldVim.
|
||||
!ifdef WIN64
|
||||
InstallDir "$PROGRAMFILES64\Vim"
|
||||
!define DEFAULT_INSTDIR "$PROGRAMFILES64\Vim"
|
||||
!else
|
||||
InstallDir "$PROGRAMFILES\Vim"
|
||||
!define DEFAULT_INSTDIR "$PROGRAMFILES\Vim"
|
||||
!endif
|
||||
InstallDir ${DEFAULT_INSTDIR}
|
||||
|
||||
# Types of installs we can perform:
|
||||
InstType $(str_type_typical)
|
||||
@ -710,8 +711,13 @@ Function .onInit
|
||||
!insertmacro MUI_LANGDLL_DISPLAY
|
||||
!endif
|
||||
|
||||
# Check $VIM
|
||||
ReadEnvStr $INSTDIR "VIM"
|
||||
${If} $INSTDIR == ${DEFAULT_INSTDIR}
|
||||
# Check $VIM
|
||||
ReadEnvStr $3 "VIM"
|
||||
${If} $3 != ""
|
||||
StrCpy $INSTDIR $3
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
|
||||
call CheckOldVim
|
||||
Pop $3
|
||||
@ -721,20 +727,11 @@ Function .onInit
|
||||
SectionSetInstTypes ${id_section_old_ver} 0
|
||||
SectionSetText ${id_section_old_ver} ""
|
||||
${Else}
|
||||
${If} $INSTDIR == ""
|
||||
${If} $INSTDIR == ${DEFAULT_INSTDIR}
|
||||
StrCpy $INSTDIR $3
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
|
||||
# If did not find a path: use the default dir.
|
||||
${If} $INSTDIR == ""
|
||||
!ifdef WIN64
|
||||
StrCpy $INSTDIR "$PROGRAMFILES64\Vim"
|
||||
!else
|
||||
StrCpy $INSTDIR "$PROGRAMFILES\Vim"
|
||||
!endif
|
||||
${EndIf}
|
||||
|
||||
${If} ${RunningX64}
|
||||
SetRegView 64
|
||||
${EndIf}
|
||||
|
11
runtime/autoload/dist/ft.vim
vendored
11
runtime/autoload/dist/ft.vim
vendored
@ -172,6 +172,17 @@ func dist#ft#FTent()
|
||||
setf dtd
|
||||
endfunc
|
||||
|
||||
func dist#ft#ExCheck()
|
||||
let lines = getline(1, min([line("$"), 100]))
|
||||
if exists('g:filetype_euphoria')
|
||||
exe 'setf ' . g:filetype_euphoria
|
||||
elseif match(lines, '^--\|^ifdef\>\|^include\>') > -1
|
||||
setf euphoria3
|
||||
else
|
||||
setf elixir
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func dist#ft#EuphoriaCheck()
|
||||
if exists('g:filetype_euphoria')
|
||||
exe 'setf ' . g:filetype_euphoria
|
||||
|
@ -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: 2019 Feb 25
|
||||
" Last Change: 2020 Apr 12
|
||||
" ----------------------------------------------------------------------------
|
||||
"
|
||||
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
|
||||
@ -501,13 +501,8 @@ class VimRubyCompletion
|
||||
return if rails_base == nil
|
||||
$:.push rails_base unless $:.index( rails_base )
|
||||
|
||||
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"
|
||||
bootfile = rails_base + "config/boot.rb"
|
||||
envfile = rails_base + "config/environment.rb"
|
||||
if File.exists?( bootfile ) && File.exists?( envfile )
|
||||
begin
|
||||
require bootfile
|
||||
|
16
runtime/compiler/scdoc.vim
Normal file
16
runtime/compiler/scdoc.vim
Normal file
@ -0,0 +1,16 @@
|
||||
" 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%.%#
|
17
runtime/compiler/spectral.vim
Normal file
17
runtime/compiler/spectral.vim
Normal file
@ -0,0 +1,17 @@
|
||||
" 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
|
||||
|
16
runtime/compiler/yamllint.vim
Normal file
16
runtime/compiler/yamllint.vim
Normal file
@ -0,0 +1,16 @@
|
||||
" 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
|
||||
|
@ -1,4 +1,4 @@
|
||||
*arabic.txt* For Vim version 8.2. Last change: 2019 May 05
|
||||
*arabic.txt* For Vim version 8.2. Last change: 2021 Jun 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Nadim Shaikli
|
||||
@ -176,6 +176,13 @@ 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) -
|
||||
|
@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 8.2. Last change: 2021 May 29
|
||||
*autocmd.txt* For Vim version 8.2. Last change: 2021 Aug 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -54,7 +54,7 @@ effects. Be careful not to destroy your text.
|
||||
:au[tocmd] [group] {event} {pat} [++once] [++nested] {cmd}
|
||||
Add {cmd} to the list of commands that Vim will
|
||||
execute automatically on {event} for a file matching
|
||||
{pat} |autocmd-patterns|.
|
||||
{pat} |autocmd-patterns|.
|
||||
Here {event} cannot be "*". *E1155*
|
||||
Note: A quote character is seen as argument to the
|
||||
:autocmd and won't start a comment.
|
||||
@ -76,6 +76,12 @@ and in a `:def` function) then {cmd} will be executed as in Vim9
|
||||
script. Thus this depends on where the autocmd is defined, not where it is
|
||||
triggered.
|
||||
|
||||
{cmd} can be a block, like with `:command`, see |:command-repl|. Example: >
|
||||
au BufReadPost *.xml {
|
||||
setlocal matchpairs+=<:>
|
||||
/<start
|
||||
}
|
||||
|
||||
Note: The ":autocmd" command can only be followed by another command when the
|
||||
'|' appears before {cmd}. This works: >
|
||||
:augroup mine | au! BufRead | augroup END
|
||||
@ -679,8 +685,11 @@ CursorHoldI Just like CursorHold, but in Insert mode.
|
||||
CursorMoved After the cursor was moved in Normal or Visual
|
||||
mode. Also when the text of the cursor line
|
||||
has been changed, e.g., with "x", "rx" or "p".
|
||||
Not triggered when there is typeahead or when
|
||||
an operator is pending.
|
||||
Not triggered when there is typeahead, while
|
||||
executing commands in a script file, when
|
||||
an operator is pending or when moving to
|
||||
another window while remaining at the same
|
||||
cursor position.
|
||||
For an example see |match-parens|.
|
||||
Note: This can not be skipped with
|
||||
`:noautocmd`.
|
||||
|
@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 8.2. Last change: 2021 Mar 01
|
||||
*change.txt* For Vim version 8.2. Last change: 2021 Jun 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -780,12 +780,15 @@ 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 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: >
|
||||
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: >
|
||||
:s+/+//+
|
||||
|
||||
You can use most characters, but not an alphanumeric character, '\', '"' or
|
||||
'|'. In Vim9 script you should not use '#' because it may be recognized as
|
||||
the start of a comment.
|
||||
|
||||
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.
|
||||
@ -1042,6 +1045,10 @@ inside of strings can change! Also see 'softtabstop' option. >
|
||||
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
|
||||
from `y` when selecting a block of text, see |v_zy|.
|
||||
|
||||
*v_y*
|
||||
{Visual}["x]y Yank the highlighted text [into register x] (for
|
||||
{Visual} see |Visual-mode|).
|
||||
@ -1050,6 +1057,12 @@ inside of strings can change! Also see 'softtabstop' option. >
|
||||
{Visual}["x]Y Yank the highlighted lines [into register x] (for
|
||||
{Visual} see |Visual-mode|).
|
||||
|
||||
*v_zy*
|
||||
{Visual}["x]zy Yank the highlighted text [into register x]. Trailing
|
||||
whitespace at the end of each line of a selected block
|
||||
won't be yanked. Especially useful in combination
|
||||
with `zp`. (for {Visual} see |Visual-mode|)
|
||||
|
||||
*:y* *:yank* *E850*
|
||||
:[range]y[ank] [x] Yank [range] lines [into register x]. Yanking to the
|
||||
"* or "+ registers is possible only when the
|
||||
@ -1129,7 +1142,8 @@ inside of strings can change! Also see 'softtabstop' option. >
|
||||
["x]zp or *zp* *zP*
|
||||
["x]zP Like "p" and "P", except without adding trailing spaces
|
||||
when pasting a block. Thus the inserted text will not
|
||||
always be a rectangle.
|
||||
always be a rectangle. Especially useful in
|
||||
combination with |v_zy|.
|
||||
|
||||
You can use these commands to copy text from one place to another. Do this
|
||||
by first getting the text into a register with a yank, delete or change
|
||||
|
@ -536,7 +536,7 @@ ch_evalraw({handle}, {string} [, {options}]) *ch_evalraw()*
|
||||
GetChannel()->ch_evalraw(rawstring)
|
||||
|
||||
ch_getbufnr({handle}, {what}) *ch_getbufnr()*
|
||||
Get the buffer number that {handle} is using for {what}.
|
||||
Get the buffer number that {handle} is using for String {what}.
|
||||
{handle} can be a Channel or a Job that has a Channel.
|
||||
{what} can be "err" for stderr, "out" for stdout or empty for
|
||||
socket output.
|
||||
@ -586,8 +586,8 @@ ch_info({handle}) *ch_info()*
|
||||
|
||||
|
||||
ch_log({msg} [, {handle}]) *ch_log()*
|
||||
Write {msg} in the channel log file, if it was opened with
|
||||
|ch_logfile()|.
|
||||
Write String {msg} in the channel log file, if it was opened
|
||||
with |ch_logfile()|.
|
||||
When {handle} is passed the channel number is used for the
|
||||
message.
|
||||
{handle} can be a Channel or a Job that has a Channel. The
|
||||
@ -625,7 +625,7 @@ ch_open({address} [, {options}]) *ch_open()*
|
||||
Open a channel to {address}. See |channel|.
|
||||
Returns a Channel. Use |ch_status()| to check for failure.
|
||||
|
||||
{address} has the form "hostname:port", e.g.,
|
||||
{address} is a String and has the form "hostname:port", e.g.,
|
||||
"localhost:8765".
|
||||
|
||||
When using an IPv6 address, enclose it within square brackets.
|
||||
@ -852,7 +852,7 @@ available.
|
||||
job_getchannel({job}) *job_getchannel()*
|
||||
Get the channel handle that {job} is using.
|
||||
To check if the job has no channel: >
|
||||
if string(job_getchannel()) == 'channel fail'
|
||||
if string(job_getchannel(job)) == 'channel fail'
|
||||
<
|
||||
Can also be used as a |method|: >
|
||||
GetJob()->job_getchannel()
|
||||
|
@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 8.2. Last change: 2021 May 30
|
||||
*cmdline.txt* For Vim version 8.2. Last change: 2021 Aug 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -170,7 +170,12 @@ CTRL-R {register} *c_CTRL-R* *c_<C-R>*
|
||||
too.
|
||||
When the result is a Float it's automatically
|
||||
converted to a String.
|
||||
See |registers| about registers.
|
||||
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.
|
||||
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
|
||||
|
@ -1,4 +1,4 @@
|
||||
*digraph.txt* For Vim version 8.2. Last change: 2020 Jul 16
|
||||
*digraph.txt* For Vim version 8.2. Last change: 2021 Jul 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -38,6 +38,9 @@ An alternative is using the 'keymap' option.
|
||||
< Avoid defining a digraph with '_' (underscore) as the
|
||||
first character, it has a special meaning in the
|
||||
future.
|
||||
NOTE: This command cannot add a digraph that starts
|
||||
with a white space. If you want to add such digraph,
|
||||
you can use |digraph_set()| instead.
|
||||
|
||||
Vim is normally compiled with the |+digraphs| feature. If the feature is
|
||||
disabled, the ":digraph" command will display an error message.
|
||||
|
@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.2. Last change: 2021 May 27
|
||||
*editing.txt* For Vim version 8.2. Last change: 2021 Jul 25
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -1469,8 +1469,11 @@ be readable again. If you use a wrong key, it will be a mess.
|
||||
:X Prompt for an encryption key. The typing is done without showing the
|
||||
actual text, so that someone looking at the display won't see it.
|
||||
The typed key is stored in the 'key' option, which is used to encrypt
|
||||
the file when it is written. The file will remain unchanged until you
|
||||
write it. See also |-x|.
|
||||
the file when it is written.
|
||||
The file will remain unchanged until you write it. Note that commands
|
||||
such as `:xit` and `ZZ` will NOT write the file unless there are other
|
||||
changes.
|
||||
See also |-x|.
|
||||
|
||||
The value of the 'key' options is used when text is written. When the option
|
||||
is not empty, the written file will be encrypted, using the value as the
|
||||
@ -1749,6 +1752,12 @@ There are three different types of searching:
|
||||
/u/user_x/work/include
|
||||
/u/user_x/include
|
||||
|
||||
< Note: If your 'path' setting includes an non-existing directory, Vim will
|
||||
skip the non-existing directory, but continues searching in the parent of
|
||||
the non-existing directory if upwards searching is used. E.g. when
|
||||
searching "../include" and that doesn't exist, and upward searching is
|
||||
used, also searches in "..".
|
||||
|
||||
3) Combined up/downward search:
|
||||
If Vim's current path is /u/user_x/work/release and you do >
|
||||
set path=**;/u/user_x
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -632,7 +632,7 @@ For fish, add to the config file
|
||||
MARKDOWN *ft-markdown-plugin*
|
||||
|
||||
To enable folding use this: >
|
||||
let g:markdown_folding = 1
|
||||
let g:markdown_folding = 1
|
||||
<
|
||||
|
||||
PDF *ft-pdf-plugin*
|
||||
|
@ -1,4 +1,4 @@
|
||||
*fold.txt* For Vim version 8.2. Last change: 2019 Jun 02
|
||||
*fold.txt* For Vim version 8.2. Last change: 2021 Jul 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -541,6 +541,8 @@ 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 @@
|
||||
*ps1.txt* A Windows PowerShell syntax plugin for Vim
|
||||
*ft_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 @@
|
||||
*vim-raku.txt* The Raku programming language filetype
|
||||
*ft_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('≼')
|
||||
|
@ -1,4 +1,4 @@
|
||||
*gui.txt* For Vim version 8.2. Last change: 2021 May 01
|
||||
*gui.txt* For Vim version 8.2. Last change: 2021 Jun 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -411,7 +411,8 @@ Mouse mapping with modifiers does not work for modeless selection.
|
||||
3.7 Drag and drop *drag-n-drop*
|
||||
|
||||
You can drag and drop one or more files into the Vim window, where they will
|
||||
be opened as if a |:drop| command was used.
|
||||
be opened as if a |:drop| command was used. You can check if this is
|
||||
supported with the *drop_file* feature: `has('drop_file')`.
|
||||
|
||||
If you hold down Shift while doing this, Vim changes to the first dropped
|
||||
file's directory. If you hold Ctrl Vim will always split a new window for the
|
||||
|
@ -132,7 +132,7 @@ 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 four versions of the same file
|
||||
|diff.txt| working with two to eight versions of the same file
|
||||
|autocmd.txt| automatically executing commands on an event
|
||||
|eval.txt| expression evaluation, conditional commands
|
||||
|channel.txt| Jobs, Channels, inter-process communication
|
||||
@ -145,6 +145,7 @@ Special issues ~
|
||||
|term.txt| using different terminals and mice
|
||||
|terminal.txt| Terminal window support
|
||||
|popup.txt| popup window support
|
||||
|vim9.txt| using Vim9 script
|
||||
|
||||
Programming language support ~
|
||||
|indent.txt| automatic indenting for C and other languages
|
||||
@ -153,6 +154,8 @@ Programming language support ~
|
||||
|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
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*if_lua.txt* For Vim version 8.2. Last change: 2021 Apr 07
|
||||
*if_lua.txt* For Vim version 8.2. Last change: 2021 Aug 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Luis Carvalho
|
||||
@ -175,10 +175,17 @@ Vim evaluation and command execution, and others.
|
||||
:lua print(type(l), vim.type(l))
|
||||
:" list
|
||||
<
|
||||
vim.command({cmd}) Executes the vim (ex-mode) command {cmd}.
|
||||
vim.command({cmds}) Executes one or more lines of Ex-mode commands
|
||||
in {cmds}.
|
||||
Examples: >
|
||||
:lua vim.command"set tw=60"
|
||||
:lua vim.command"normal ddp"
|
||||
lua << trim END
|
||||
vim.command([[
|
||||
new Myfile.js
|
||||
call search('start')
|
||||
]])
|
||||
END
|
||||
<
|
||||
vim.eval({expr}) Evaluates expression {expr} (see |expression|),
|
||||
converts the result to Lua, and returns it.
|
||||
@ -211,6 +218,44 @@ Vim evaluation and command execution, and others.
|
||||
vim.lua_version The Lua version Vim was compiled with, in the
|
||||
form {major}.{minor}.{patch}, e.g. "5.1.4".
|
||||
|
||||
vim.version() Returns a Lua table with the Vim version.
|
||||
The table will have the following keys:
|
||||
major - major Vim version.
|
||||
minor - minor Vim version.
|
||||
patch - latest patch included.
|
||||
|
||||
*lua-vim-variables*
|
||||
The Vim editor global dictionaries |g:| |w:| |b:| |t:| |v:| can be accessed
|
||||
from Lua conveniently and idiomatically by referencing the `vim.*` Lua tables
|
||||
described below. In this way you can easily read and modify global Vimscript
|
||||
variables from Lua.
|
||||
|
||||
Example: >
|
||||
|
||||
vim.g.foo = 5 -- Set the g:foo Vimscript variable.
|
||||
print(vim.g.foo) -- Get and print the g:foo Vimscript variable.
|
||||
vim.g.foo = nil -- Delete (:unlet) the Vimscript variable.
|
||||
|
||||
vim.g *vim.g*
|
||||
Global (|g:|) editor variables.
|
||||
Key with no value returns `nil`.
|
||||
|
||||
vim.b *vim.b*
|
||||
Buffer-scoped (|b:|) variables for the current buffer.
|
||||
Invalid or unset key returns `nil`.
|
||||
|
||||
vim.w *vim.w*
|
||||
Window-scoped (|w:|) variables for the current window.
|
||||
Invalid or unset key returns `nil`.
|
||||
|
||||
vim.t *vim.t*
|
||||
Tabpage-scoped (|t:|) variables for the current tabpage.
|
||||
Invalid or unset key returns `nil`.
|
||||
|
||||
vim.v *vim.v*
|
||||
|v:| variables.
|
||||
Invalid or unset key returns `nil`.
|
||||
|
||||
==============================================================================
|
||||
3. List userdata *lua-list*
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 8.2. Last change: 2021 May 27
|
||||
*index.txt* For Vim version 8.2. Last change: 2021 Jun 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -878,6 +878,7 @@ tag char note action in Normal mode ~
|
||||
|zv| zv open enough folds to view the cursor line
|
||||
|zw| zw permanently mark word as incorrectly spelled
|
||||
|zx| zx re-apply 'foldlevel' and do "zv"
|
||||
|zy| zy yank without trailing spaces
|
||||
|zz| zz redraw, cursor line at center of window
|
||||
|z<Left>| z<Left> same as "zh"
|
||||
|z<Right>| z<Right> same as "zl"
|
||||
@ -1311,6 +1312,7 @@ tag command action ~
|
||||
|:endtry| :endt[ry] end previous :try
|
||||
|:endwhile| :endw[hile] end previous :while
|
||||
|:enew| :ene[w] edit a new, unnamed buffer
|
||||
|:eval| :ev[al] evaluate an expression and discard the result
|
||||
|:ex| :ex same as ":edit"
|
||||
|:execute| :exe[cute] execute result of expressions
|
||||
|:exit| :exi[t] same as ":xit"
|
||||
|
@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 8.2. Last change: 2020 Oct 16
|
||||
*insert.txt* For Vim version 8.2. Last change: 2021 Jul 31
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -1073,7 +1073,8 @@ 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.
|
||||
List. Note that the cursor may have moved since the first invocation, the
|
||||
text may have been changed.
|
||||
|
||||
In order to return more information than the matching words, return a Dict
|
||||
that contains the List. The Dict can have these items:
|
||||
@ -1193,7 +1194,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.
|
||||
|
||||
*E839* *E840*
|
||||
*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.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 8.2. Last change: 2021 May 16
|
||||
*map.txt* For Vim version 8.2. Last change: 2021 Aug 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -1571,6 +1571,20 @@ feature. Use the full name for new scripts.
|
||||
|
||||
|
||||
Replacement text ~
|
||||
*:command-repl*
|
||||
The {repl} argument is normally one long string, possibly with "|" separated
|
||||
commands. A special case is when the argument is "{", then the following
|
||||
lines, up to a line starting with "}" are used and |Vim9| syntax applies.
|
||||
Example: >
|
||||
:command MyCommand {
|
||||
echo 'hello'
|
||||
g:calledMyCommand = true
|
||||
}
|
||||
< *E1231*
|
||||
There must be white space before the "{". No nesting is supported, inline
|
||||
functions cannot be used. Commands where a "|" may appear in the argument,
|
||||
such as commands with an expression argument, cannot be followed by a "|" and
|
||||
another command.
|
||||
|
||||
The replacement text {repl} for a user defined command is scanned for special
|
||||
escape sequences, using <...> notation. Escape sequences are replaced with
|
||||
|
@ -1,4 +1,4 @@
|
||||
*message.txt* For Vim version 8.2. Last change: 2020 Dec 29
|
||||
*message.txt* For Vim version 8.2. Last change: 2021 Jul 31
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -774,6 +774,14 @@ a user-defined command.
|
||||
This can only happen when changing the source code, when adding a command in
|
||||
src/ex_cmds.h. The lookup table then needs to be updated, by running: >
|
||||
make cmdidxs
|
||||
<
|
||||
*E928* *E889* *E839* >
|
||||
E928: String required
|
||||
E889: Number required
|
||||
E839: Bool required
|
||||
|
||||
These happen when a value or expression is used that does not have the
|
||||
expected type.
|
||||
|
||||
==============================================================================
|
||||
3. Messages *messages*
|
||||
|
@ -1,4 +1,4 @@
|
||||
*motion.txt* For Vim version 8.2. Last change: 2021 Mar 28
|
||||
*motion.txt* For Vim version 8.2. Last change: 2021 Jun 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -59,9 +59,14 @@ or change text. The following operators are available:
|
||||
|<| < shift left
|
||||
|zf| zf define a fold
|
||||
|g@| g@ call function set with the 'operatorfunc' option
|
||||
|
||||
*motion-count-multiplied*
|
||||
If the motion includes a count and the operator also had a count before it,
|
||||
the two counts are multiplied. For example: "2d3w" deletes six words.
|
||||
*operator-doubled*
|
||||
When doubling the operator it operates on a line. When using a count, before
|
||||
or after the first character, that many lines are operated upon. Thus `3dd`
|
||||
deletes three lines. A count before and after the first character is
|
||||
multiplied, thus `2y3y` yanks six lines.
|
||||
|
||||
After applying the operator the cursor is mostly left at the start of the text
|
||||
that was operated upon. For example, "yfe" doesn't move the cursor, but "yFe"
|
||||
@ -195,9 +200,9 @@ l or *l*
|
||||
*$* *<End>* *<kEnd>*
|
||||
$ or <End> To the end of the line. When a count is given also go
|
||||
[count - 1] lines downward, or as far is possible.
|
||||
|inclusive| motion. If a count of 2 of larger is
|
||||
|inclusive| motion. If a count of 2 or larger is
|
||||
given and the cursor is on the last line, that is an
|
||||
error an the cursor doesn't move.
|
||||
error and the cursor doesn't move.
|
||||
In Visual mode the cursor goes to just after the last
|
||||
character in the line.
|
||||
When 'virtualedit' is active, "$" may move the cursor
|
||||
|
@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.2. Last change: 2021 May 16
|
||||
*options.txt* For Vim version 8.2. Last change: 2021 Jul 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -1326,7 +1326,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
continuation (positive).
|
||||
sbr Display the 'showbreak' value before applying the
|
||||
additional indent.
|
||||
The default value for min is 20 and shift is 0.
|
||||
list:{n} Adds an additional indent for lines that match a
|
||||
numbered or bulleted list (using the
|
||||
'formatlistpat' setting).
|
||||
list:-1 Uses the length of a match with 'formatlistpat'
|
||||
for indentation.
|
||||
The default value for min is 20, shift and list is 0.
|
||||
|
||||
*'browsedir'* *'bsdir'*
|
||||
'browsedir' 'bsdir' string (default: "last")
|
||||
@ -2384,6 +2389,23 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
you write the file the encrypted bytes will be
|
||||
different. The whole undo file is encrypted, not just
|
||||
the pieces of text.
|
||||
*E1193* *E1194* *E1195* *E1196*
|
||||
*E1197* *E1198* *E1199* *E1200* *E1201*
|
||||
xchacha20 XChaCha20 Cipher with Poly1305 Message Authentication
|
||||
Code. Medium strong till strong encryption.
|
||||
Encryption is provided by the libsodium library, it
|
||||
requires Vim to be built with |+sodium|
|
||||
It adds a seed and a message authentication code (MAC)
|
||||
to the file. This needs at least a Vim 8.2.3022 to
|
||||
read the encrypted file.
|
||||
Encryption of swap files is not supported, therefore
|
||||
no swap file will be used when xchacha20 encryption is
|
||||
enabled.
|
||||
Encryption of undo files is not yet supported,
|
||||
therefore no undo file will currently be written.
|
||||
CURRENTLY EXPERIMENTAL: Files written with this method
|
||||
might have to be read back with the same version of
|
||||
Vim if the binary format changes later.
|
||||
|
||||
You should use "blowfish2", also to re-encrypt older files.
|
||||
|
||||
@ -5595,19 +5617,21 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
- abbreviations are disabled
|
||||
- 'autoindent' is reset
|
||||
- 'expandtab' is reset
|
||||
- 'formatoptions' is used like it is empty
|
||||
- 'hkmap' is reset
|
||||
- 'revins' is reset
|
||||
- 'ruler' is reset
|
||||
- 'showmatch' is reset
|
||||
- 'smartindent' is reset
|
||||
- 'smarttab' is reset
|
||||
- 'softtabstop' is set to 0
|
||||
- 'textwidth' is set to 0
|
||||
- 'wrapmargin' is set to 0
|
||||
- 'varsofttabstop' is made empty
|
||||
These options keep their value, but their effect is disabled:
|
||||
- 'cindent'
|
||||
- 'formatoptions' is used like it is empty
|
||||
- 'indentexpr'
|
||||
- 'lisp'
|
||||
- 'smartindent'
|
||||
NOTE: When you start editing another file while the 'paste' option is
|
||||
on, settings from the modelines or autocommands may change the
|
||||
settings again, causing trouble when pasting text. You might want to
|
||||
@ -6575,23 +6599,25 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
*'shellcmdflag'* *'shcf'*
|
||||
'shellcmdflag' 'shcf' string (default: "-c";
|
||||
Win32, when 'shell' does not contain "sh"
|
||||
Win32, when 'shell' contains "powershell":
|
||||
"-Command", or when it does not contain "sh"
|
||||
somewhere: "/c")
|
||||
global
|
||||
Flag passed to the shell to execute "!" and ":!" commands; e.g.,
|
||||
"bash.exe -c ls" or "cmd.exe /c dir". For MS-Windows, the default is
|
||||
set according to the value of 'shell', to reduce the need to set this
|
||||
option by the user.
|
||||
"bash.exe -c ls", "powershell.exe -Command dir", or "cmd.exe /c dir".
|
||||
For MS-Windows, the default is set according to the value of 'shell',
|
||||
to reduce the need to set this option by the user.
|
||||
On Unix it can have more than one flag. Each white space separated
|
||||
part is passed as an argument to the shell command.
|
||||
See |option-backslash| about including spaces and backslashes.
|
||||
Also see |dos-shell| for MS-Windows.
|
||||
Also see |dos-shell| and |dos-powershell| for MS-Windows.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'shellpipe'* *'sp'*
|
||||
'shellpipe' 'sp' string (default ">", ">%s 2>&1", "| tee", "|& tee" or
|
||||
"2>&1| tee")
|
||||
'shellpipe' 'sp' string (default ">", ">%s 2>&1", "| tee", "|& tee"
|
||||
"2>&1| tee", or
|
||||
"2>&1 | Out-File -Encoding default")
|
||||
global
|
||||
{not available when compiled without the |+quickfix|
|
||||
feature}
|
||||
@ -6601,9 +6627,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The name of the temporary file can be represented by "%s" if necessary
|
||||
(the file name is appended automatically if no %s appears in the value
|
||||
of this option).
|
||||
For the Amiga the default is ">". For MS-Windows the default is
|
||||
">%s 2>&1". The output is directly saved in a file and not echoed to
|
||||
the screen.
|
||||
For the Amiga the default is ">". For MS-Windows using powershell the
|
||||
default is "2>&1 | Out-File -Encoding default", otherwise the default
|
||||
is ">%s 2>&1". The output is directly saved in a file and not echoed
|
||||
to the screen.
|
||||
For Unix the default is "| tee". The stdout of the compiler is saved
|
||||
in a file and echoed to the screen. If the 'shell' option is "csh" or
|
||||
"tcsh" after initializations, the default becomes "|& tee". If the
|
||||
@ -6611,6 +6638,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
"bash", "fish", "ash" or "dash" the default becomes "2>&1| tee". This
|
||||
means that stderr is also included. Before using the 'shell' option a
|
||||
path is removed, thus "/bin/sh" uses "sh".
|
||||
For Unix and MS-Windows, when the 'shell' option is "pwsh" the default
|
||||
becomes ">%s 2>&1" and the output is not echoed to the screen.
|
||||
The initialization of this option is done after reading the ".vimrc"
|
||||
and the other initializations, so that when the 'shell' option is set
|
||||
there, the 'shellpipe' option changes automatically, unless it was
|
||||
@ -6626,8 +6655,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
security reasons.
|
||||
|
||||
*'shellquote'* *'shq'*
|
||||
'shellquote' 'shq' string (default: ""; Win32, when 'shell'
|
||||
contains "sh" somewhere: "\"")
|
||||
'shellquote' 'shq' string (default: "")
|
||||
global
|
||||
Quoting character(s), put around the command passed to the shell, for
|
||||
the "!" and ":!" commands. The redirection is kept outside of the
|
||||
@ -6635,14 +6663,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
probably not useful to set both options.
|
||||
This is an empty string by default. Only known to be useful for
|
||||
third-party shells on MS-Windows-like systems, such as the MKS Korn
|
||||
Shell or bash, where it should be "\"". The default is adjusted
|
||||
according the value of 'shell', to reduce the need to set this option
|
||||
by the user. See |dos-shell|.
|
||||
Shell or bash, where it should be "\"". See |dos-shell|.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'shellredir'* *'srr'*
|
||||
'shellredir' 'srr' string (default ">", ">&" or ">%s 2>&1")
|
||||
'shellredir' 'srr' string (default ">", ">&", ">%s 2>&1", or
|
||||
"2>&1 | Out-File -Encoding default")
|
||||
global
|
||||
String to be used to put the output of a filter command in a temporary
|
||||
file. See also |:!|. See |option-backslash| about including spaces
|
||||
@ -6653,10 +6680,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The default is ">". For Unix, if the 'shell' option is "csh" or
|
||||
"tcsh" during initializations, the default becomes ">&". If the
|
||||
'shell' option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta",
|
||||
"bash" or "fish", the default becomes ">%s 2>&1". This means that
|
||||
stderr is also included. For Win32, the Unix checks are done and
|
||||
additionally "cmd" is checked for, which makes the default ">%s 2>&1".
|
||||
Also, the same names with ".exe" appended are checked for.
|
||||
"bash", "fish", or "pwsh", the default becomes ">%s 2>&1". This means
|
||||
that stderr is also included. For Win32, the Unix checks are done and
|
||||
additionally "cmd" is checked for, which makes the default ">%s 2>&1",
|
||||
and "powershell" is checked for which makes the default
|
||||
"2>&1 | Out-File -Encoding default" (see |dos-powershell|). Also, the
|
||||
same names with ".exe" appended are checked for.
|
||||
The initialization of this option is done after reading the ".vimrc"
|
||||
and the other initializations, so that when the 'shell' option is set
|
||||
there, the 'shellredir' option changes automatically unless it was
|
||||
@ -6671,9 +6700,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
{only for MS-Windows}
|
||||
When set, a forward slash is used when expanding file names. This is
|
||||
useful when a Unix-like shell is used instead of cmd.exe. Backward
|
||||
slashes can still be typed, but they are changed to forward slashes by
|
||||
Vim.
|
||||
useful when a Unix-like shell is used instead of cmd.exe, pwsh.exe, or
|
||||
powershell.exe. Backward slashes can still be typed, but they are
|
||||
changed to forward slashes by Vim.
|
||||
Note that setting or resetting this option has no effect for some
|
||||
existing file names, thus this option needs to be set before opening
|
||||
any file for best results. This might change in the future.
|
||||
@ -6727,6 +6756,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'shellxquote'* *'sxq'*
|
||||
'shellxquote' 'sxq' string (default: "";
|
||||
for Win32, when 'shell' is cmd.exe: "("
|
||||
for Win32, when 'shell' is
|
||||
powershell.exe: "\""
|
||||
for Win32, when 'shell' contains "sh"
|
||||
somewhere: "\""
|
||||
for Unix, when using system(): "\"")
|
||||
@ -6739,11 +6770,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
then ')"' is appended.
|
||||
When the value is '(' then also see 'shellxescape'.
|
||||
This is an empty string by default on most systems, but is known to be
|
||||
useful for on Win32 version, either for cmd.exe which automatically
|
||||
strips off the first and last quote on a command, or 3rd-party shells
|
||||
such as the MKS Korn Shell or bash, where it should be "\"". The
|
||||
default is adjusted according the value of 'shell', to reduce the need
|
||||
to set this option by the user. See |dos-shell|.
|
||||
useful for on Win32 version, either for cmd.exe, powershell.exe, or
|
||||
pwsh.exe which automatically strips off the first and last quote on a
|
||||
command, or 3rd-party shells such as the MKS Korn Shell or bash, where
|
||||
it should be "\"". The default is adjusted according the value of
|
||||
'shell', to reduce the need to set this option by the user. See
|
||||
|dos-shell|.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
@ -8611,12 +8643,16 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
*'virtualedit'* *'ve'*
|
||||
'virtualedit' 've' string (default "")
|
||||
global
|
||||
global or local to window |global-local|
|
||||
A comma separated list of these words:
|
||||
block Allow virtual editing in Visual block mode.
|
||||
insert Allow virtual editing in Insert mode.
|
||||
all Allow virtual editing in all modes.
|
||||
onemore Allow the cursor to move just past the end of the line
|
||||
none When used as the local value, do not allow virtual
|
||||
editing even when the global value is set. When used
|
||||
as the global value, "none" is the same as "".
|
||||
NONE Alternative spelling of "none".
|
||||
|
||||
Virtual editing means that the cursor can be positioned where there is
|
||||
no actual character. This can be halfway into a tab or beyond the end
|
||||
@ -8633,6 +8669,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The `g$` command will move to the end of the screen line.
|
||||
It doesn't make sense to combine "all" with "onemore", but you will
|
||||
not get a warning for it.
|
||||
When combined with other words, "none" is ignored.
|
||||
NOTE: This option is set to "" when 'compatible' is set.
|
||||
|
||||
*'visualbell'* *'vb'* *'novisualbell'* *'novb'* *beep*
|
||||
|
@ -17,6 +17,7 @@ versions of Vim. Also see |os_win32.txt| and |os_msdos.txt|.
|
||||
7. Interrupting |dos-CTRL-Break|
|
||||
8. Temp files |dos-temp-files|
|
||||
9. Shell option default |dos-shell|
|
||||
10. PowerShell |dos-powershell|
|
||||
|
||||
==============================================================================
|
||||
1. File locations *dos-locations*
|
||||
@ -297,8 +298,86 @@ For Win32 as:
|
||||
<shell> -c "command name >file"
|
||||
For DOS 32 bit, DJGPP does this internally somehow.
|
||||
|
||||
When starting up, Vim checks for the presence of "sh" anywhere in the 'shell'
|
||||
option. If it is present, Vim sets the 'shellcmdflag' and 'shellquote' or
|
||||
'shellxquote' options will be set as described above.
|
||||
When starting up, if Vim does not recognise a standard Windows shell it checks
|
||||
for the presence of "sh" anywhere in the 'shell' option. If it is present,
|
||||
Vim sets the 'shellcmdflag' and 'shellquote' or 'shellxquote' options will be
|
||||
set as described above.
|
||||
|
||||
==============================================================================
|
||||
10. PowerShell *dos-powershell* *dos-pwsh*
|
||||
|
||||
Vim supports PowerShell Desktop and PowerShell Core. PowerShell Desktop is
|
||||
the version of PowerShell that is installed with Windows, while PowerShell
|
||||
Core is a separate downloadable version that works cross-platform. To see
|
||||
which version you are using then enter the following in a PowerShell prompt -
|
||||
$PSVersionTable.PSEdition
|
||||
|
||||
If 'shell' includes "powershell" in the filename at startup then VIM sets
|
||||
'shellcmdflag', 'shellxquote', 'shellpipe', and 'shellredir' options to the
|
||||
following values:
|
||||
|
||||
'shellcmdflag' -Command
|
||||
'shellxquote' "
|
||||
'shellpipe' 2>&1 | Out-File -Encoding default
|
||||
'shellredir' 2>&1 | Out-File -Encoding default
|
||||
|
||||
If 'shell' includes "pwsh" in the filename at startup then VIM sets
|
||||
'shellcmdflag', 'shellxquote', 'shellpipe', and 'shellredir' options to the
|
||||
following values:
|
||||
|
||||
'shellcmdflag' -c
|
||||
'shellxquote' "
|
||||
'shellpipe' >%s 2>&1
|
||||
'shellredir' >%s 2>&1
|
||||
|
||||
If you find that PowerShell commands are taking a long time to run then try
|
||||
with "-NoProfile" at the beginning of the 'shellcmdflag'. Note this will
|
||||
prevent any PowerShell environment setup by the profile from taking place.
|
||||
|
||||
If you have problems running PowerShell scripts through the 'shell' then try
|
||||
with "-ExecutionPolicy RemoteSigned -Command" at the beginning of
|
||||
'shellcmdflag'. See online Windows documentation for more information on
|
||||
PowerShell Execution Policy settings.
|
||||
|
||||
See |option-backslash| about including spaces in 'shellcmdflag' when using
|
||||
multiple flags.
|
||||
|
||||
The 'shellpipe' and 'shellredir' option values re-encode the UTF-16le output
|
||||
from PowerShell Desktop to your currently configured console codepage. The
|
||||
output can be forced into a different encoding by changing "default" to one of
|
||||
the following:
|
||||
|
||||
unicode - UTF-16le (default output from PowerShell 5.1)
|
||||
bigendianunicode - UTF-16
|
||||
utf8 - UTF-8
|
||||
utf7 - UTF-7 (no BOM)
|
||||
utf32 - UTF-32
|
||||
ascii - 7-bit ASCII character set
|
||||
default - System's active code page (typically ANSI)
|
||||
oem - System's current OEM code page
|
||||
|
||||
Note The abovce multi-byte Unicode encodings include a leading BOM unless
|
||||
otherwise indicated.
|
||||
|
||||
By default PowerShell Core's output is UTF-8 encoded without a BOM. If you
|
||||
want to force the output of PowerShell Core into a different encoding then set
|
||||
'shellredir' and 'shellpipe' to "2>&1 | Out-File -Encoding encoding" where
|
||||
encoding is one of the following:
|
||||
|
||||
ascii - 7-bit ASCII character set
|
||||
bigendianunicode - UTF-16be
|
||||
bigendianutf32 - UTF-32be
|
||||
oem - System's current OEM code page
|
||||
unicode - UTF-16le
|
||||
utf7 - UTF-7
|
||||
utf8 - UTF-8
|
||||
utf8BOM - UTF-8, with BOM
|
||||
utf8NoBOM - UTF-8, no BOM (default output from PowerShell Core)
|
||||
utf32 - UTF-32
|
||||
|
||||
Since PowerShell Core 6.2, the Encoding parameter also supports specifying a
|
||||
numeric ID of a registered code page (-Encoding 1251) or string names of
|
||||
registered code pages (-Encoding "windows-1251"). The .NET documentation for
|
||||
Encoding.CodePage has more information
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
@ -767,12 +767,12 @@ GNU_TOOLS.ZIP package downloadable from http://www.polarhome.com/vim/
|
||||
|
||||
Version 8.2
|
||||
- make all changes needed for clean compile build of v8.2 on VMS on all platforms
|
||||
- fix the call mkdir bug (vicente_polo@yahoo.es)
|
||||
- fix the call mkdir bug (vicente_polo@yahoo.es)
|
||||
- test on VSI OpenVMS Alpha and Itanium platforms
|
||||
- added LUA support
|
||||
- added XPM support - Motif GUI with toolbar on all platforms
|
||||
- XPM v3.4.11 libraries for IA64, AXP and VAX are added
|
||||
- start integrating the new test scripts
|
||||
- XPM v3.4.11 libraries for IA64, AXP and VAX are added
|
||||
- start integrating the new test scripts
|
||||
|
||||
Version 8.1
|
||||
- make necessary changes to build v8.1 on VMS
|
||||
|
@ -18,7 +18,8 @@ The 32 bit version also runs on 64 bit MS-Windows systems.
|
||||
4. Using the mouse |win32-mouse|
|
||||
5. Running under Windows 95 |win32-win95|
|
||||
6. Running under Windows 3.1 |win32-win3.1|
|
||||
7. Win32 mini FAQ |win32-faq|
|
||||
7. Installation package |win32-installer|
|
||||
8. Win32 mini FAQ |win32-faq|
|
||||
|
||||
Additionally, there are a number of common Win32 and DOS items:
|
||||
File locations |dos-locations|
|
||||
@ -30,6 +31,7 @@ File formats |dos-file-formats|
|
||||
Interrupting |dos-CTRL-Break|
|
||||
Temp files |dos-temp-files|
|
||||
Shell option default |dos-shell|
|
||||
PowerShell defaults |dos-powershell|
|
||||
|
||||
Win32 GUI |gui-w32|
|
||||
|
||||
@ -174,7 +176,29 @@ There was a special version of gvim that runs under Windows 3.1 and 3.11.
|
||||
Support was removed in patch 7.4.1364.
|
||||
|
||||
==============================================================================
|
||||
7. Win32 mini FAQ *win32-faq*
|
||||
7. Installation package *win32-installer*
|
||||
|
||||
A simple installer for windows is available at http://www.vim.org/download.php
|
||||
(stable version) and nightly builds are also available at
|
||||
https://github.com/vim/vim-win32-installer/releases/
|
||||
|
||||
The nightly builds include 32bit and 64bit builds, have most features enabled
|
||||
and usually also contain an extra cryptographic signed installer, so Windows
|
||||
will not complain.
|
||||
|
||||
To use the installer, simply run the exe file. The following switches are
|
||||
also supported: >
|
||||
|
||||
gvim_<version>.exe /S -> silent install without any dialogues
|
||||
gvim_<version>.exe /D=C:\vim -> Install into directory c:\vim
|
||||
-> /D must be the last argument
|
||||
gvim_<version>.exe /S /D=c:\vim -> silent install into c:\vim
|
||||
<
|
||||
The default installation directory can alternatively be given by setting the
|
||||
$VIM environment variable.
|
||||
|
||||
==============================================================================
|
||||
8. Win32 mini FAQ *win32-faq*
|
||||
|
||||
Q. How do I change the font?
|
||||
A. In the GUI version, you can use the 'guifont' option. Example: >
|
||||
|
@ -1,4 +1,4 @@
|
||||
*pattern.txt* For Vim version 8.2. Last change: 2021 May 02
|
||||
*pattern.txt* For Vim version 8.2. Last change: 2021 Jul 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -929,13 +929,20 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|
||||
\%23l Matches in a specific line.
|
||||
\%<23l Matches above a specific line (lower line number).
|
||||
\%>23l Matches below a specific line (higher line number).
|
||||
\%.l Matches at the cursor line.
|
||||
\%<.l Matches above the cursor line.
|
||||
\%>.l Matches below the cursor line.
|
||||
These three can be used to match specific lines in a buffer. The "23"
|
||||
can be any line number. The first line is 1.
|
||||
WARNING: When inserting or deleting lines Vim does not automatically
|
||||
update the matches. This means Syntax highlighting quickly becomes
|
||||
wrong.
|
||||
wrong. Also when referring to the cursor position (".") and
|
||||
the cursor moves the display isn't updated for this change. An update
|
||||
is done when using the |CTRL-L| command (the whole screen is updated).
|
||||
Example, to highlight the line where the cursor currently is: >
|
||||
:exe '/\%' . line(".") . 'l.*'
|
||||
:exe '/\%' . line(".") . 'l'
|
||||
< Alternatively use: >
|
||||
/\%.l
|
||||
< When 'hlsearch' is set and you move the cursor around and make changes
|
||||
this will clearly show when the match is updated or not.
|
||||
|
||||
@ -943,15 +950,23 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|
||||
\%23c Matches in a specific column.
|
||||
\%<23c Matches before a specific column.
|
||||
\%>23c Matches after a specific column.
|
||||
\%.c Matches at the cursor column.
|
||||
\%<.c Matches before the cursor column.
|
||||
\%>.c Matches after the cursor column.
|
||||
These three can be used to match specific columns in a buffer or
|
||||
string. The "23" can be any column number. The first column is 1.
|
||||
Actually, the column is the byte number (thus it's not exactly right
|
||||
for multibyte characters).
|
||||
WARNING: When inserting or deleting text Vim does not automatically
|
||||
update the matches. This means Syntax highlighting quickly becomes
|
||||
wrong.
|
||||
wrong. Also when referring to the cursor position (".") and
|
||||
the cursor moves the display isn't updated for this change. An update
|
||||
is done when using the |CTRL-L| command (the whole screen is updated).
|
||||
|
||||
Example, to highlight the column where the cursor currently is: >
|
||||
:exe '/\%' . col(".") . 'c'
|
||||
< Alternatively use: >
|
||||
/\%.c
|
||||
< When 'hlsearch' is set and you move the cursor around and make changes
|
||||
this will clearly show when the match is updated or not.
|
||||
Example for matching a single byte in column 44: >
|
||||
@ -962,6 +977,9 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|
||||
\%23v Matches in a specific virtual column.
|
||||
\%<23v Matches before a specific virtual column.
|
||||
\%>23v Matches after a specific virtual column.
|
||||
\%.v Matches at the current virtual column.
|
||||
\%<.v Matches before the current virtual column.
|
||||
\%>.v Matches after the current virtual column.
|
||||
These three can be used to match specific virtual columns in a buffer
|
||||
or string. When not matching with a buffer in a window, the option
|
||||
values of the current window are used (e.g., 'tabstop').
|
||||
@ -971,13 +989,18 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|
||||
one screen character.
|
||||
WARNING: When inserting or deleting text Vim does not automatically
|
||||
update highlighted matches. This means Syntax highlighting quickly
|
||||
becomes wrong.
|
||||
becomes wrong. Also when referring to the cursor position (".") and
|
||||
the cursor moves the display isn't updated for this change. An update
|
||||
is done when using the |CTRL-L| command (the whole screen is updated).
|
||||
Example, to highlight all the characters after virtual column 72: >
|
||||
/\%>72v.*
|
||||
< When 'hlsearch' is set and you move the cursor around and make changes
|
||||
this will clearly show when the match is updated or not.
|
||||
To match the text up to column 17: >
|
||||
/^.*\%17v
|
||||
< To match all characters after the current virtual column (where the
|
||||
cursor is): >
|
||||
/\%>.v.*
|
||||
< Column 17 is not included, because this is a |/zero-width| match. To
|
||||
include the column use: >
|
||||
/^.*\%17v.
|
||||
@ -1217,7 +1240,7 @@ x A single character, with no special meaning, matches itself
|
||||
|
||||
\%d123 Matches the character specified with a decimal number. Must be
|
||||
followed by a non-digit.
|
||||
\%o40 Matches the character specified with an octal number up to 0377.
|
||||
\%o40 Matches the character specified with an octal number up to 0o377.
|
||||
Numbers below 0o40 must be followed by a non-octal digit or a
|
||||
non-digit.
|
||||
\%x2a Matches the character specified with up to two hexadecimal characters.
|
||||
@ -1449,7 +1472,8 @@ criteria:
|
||||
- The number of characters (distance) between two consecutive matching
|
||||
characters.
|
||||
- Matches at the beginning of a word
|
||||
- Matches after a camel case character or a path separator or a hyphen.
|
||||
- Matches at a camel case character (e.g. Case in CamelCase)
|
||||
- Matches after a path separator or a hyphen.
|
||||
- The number of unmatched characters in a string.
|
||||
The matching string with the highest score is returned first.
|
||||
|
||||
|
@ -3809,7 +3809,7 @@ netrw:
|
||||
Decho.vim is provided as a "vimball"; see |vimball-intro|. You
|
||||
should edit the Decho.vba.gz file and source it in: >
|
||||
|
||||
vim Decho.vba.gz
|
||||
vim Decho.vba.gz
|
||||
:so %
|
||||
:q
|
||||
<
|
||||
|
@ -1,4 +1,4 @@
|
||||
*popup.txt* For Vim version 8.2. Last change: 2021 Feb 21
|
||||
*popup.txt* For Vim version 8.2. Last change: 2021 Aug 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -904,6 +904,8 @@ Some recommended key actions:
|
||||
cursor keys select another entry
|
||||
Tab accept current suggestion
|
||||
|
||||
When CTRL-C is pressed the popup is closed, the filter will not be invoked.
|
||||
|
||||
A mouse click arrives as <LeftMouse>. The coordinates can be obtained with
|
||||
|getmousepos()|.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 8.2. Last change: 2021 May 08
|
||||
*repeat.txt* For Vim version 8.2. Last change: 2021 Jun 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -279,7 +279,9 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
ftdetect scripts are loaded, only the matching
|
||||
directories are added to 'runtimepath'. This is
|
||||
useful in your .vimrc. The plugins will then be
|
||||
loaded during initialization, see |load-plugins|.
|
||||
loaded during initialization, see |load-plugins| (note
|
||||
that the loading order will be reversed, because each
|
||||
directory is inserted before others).
|
||||
Note that for ftdetect scripts to be loaded
|
||||
you will need to write `filetype plugin indent on`
|
||||
AFTER all `packadd!` commands.
|
||||
@ -372,7 +374,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
for some commands.
|
||||
See |:vim9cmd| for executing one command with Vim9
|
||||
syntax and semantics.
|
||||
|
||||
|
||||
*:scr* *:scriptnames*
|
||||
:scr[iptnames] List all sourced script names, in the order they were
|
||||
first sourced. The number is used for the script ID
|
||||
@ -842,6 +844,16 @@ About the additional commands in debug mode:
|
||||
is reset (because it's not clear what you want to repeat).
|
||||
- When you want to use the Ex command with the same name, prepend a colon:
|
||||
":cont", ":next", ":finish" (or shorter).
|
||||
*vim9-debug*
|
||||
When debugging a compiled :def function, "step" will stop before every
|
||||
executed line, not every single instruction. Thus it works mostly like a not
|
||||
compiled function. Access to local variables is limited you can use: >
|
||||
echo varname
|
||||
But not much else.
|
||||
When executing a command that is not a specific bytecode instruction but
|
||||
executed like a normal Ex command, "step" will stop once in the compiled
|
||||
context, where local variables can be inspected, and once just before
|
||||
executing the command.
|
||||
|
||||
The backtrace shows the hierarchy of function calls, e.g.:
|
||||
>bt ~
|
||||
|
@ -1,4 +1,4 @@
|
||||
*rileft.txt* For Vim version 8.2. Last change: 2019 May 05
|
||||
*rileft.txt* For Vim version 8.2. Last change: 2021 Jun 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Avner Lottem
|
||||
@ -75,7 +75,7 @@ o Invocations
|
||||
|
||||
o Typing backwards *ins-reverse*
|
||||
----------------
|
||||
In lieu of using full-fledged the 'rightleft' option, one can opt for
|
||||
In lieu of using the full-fledged 'rightleft' option, one can opt for
|
||||
reverse insertion. When the 'revins' (reverse insert) option is set,
|
||||
inserting happens backwards. This can be used to type right-to-left
|
||||
text. When inserting characters the cursor is not moved and the text
|
||||
|
@ -451,13 +451,13 @@ sign_getdefined([{name}]) *sign_getdefined()*
|
||||
Can also be used as a |method|: >
|
||||
GetSignList()->sign_getdefined()
|
||||
|
||||
sign_getplaced([{expr} [, {dict}]]) *sign_getplaced()*
|
||||
sign_getplaced([{buf} [, {dict}]]) *sign_getplaced()*
|
||||
Return a list of signs placed in a buffer or all the buffers.
|
||||
This is similar to the |:sign-place-list| command.
|
||||
|
||||
If the optional buffer name {expr} is specified, then only the
|
||||
If the optional buffer name {buf} is specified, then only the
|
||||
list of signs placed in that buffer is returned. For the use
|
||||
of {expr}, see |bufname()|. The optional {dict} can contain
|
||||
of {buf}, see |bufname()|. The optional {dict} can contain
|
||||
the following entries:
|
||||
group select only signs in this group
|
||||
id select sign with this identifier
|
||||
@ -515,12 +515,12 @@ sign_getplaced([{expr} [, {dict}]]) *sign_getplaced()*
|
||||
GetBufname()->sign_getplaced()
|
||||
<
|
||||
*sign_jump()*
|
||||
sign_jump({id}, {group}, {expr})
|
||||
Open the buffer {expr} or jump to the window that contains
|
||||
{expr} and position the cursor at sign {id} in group {group}.
|
||||
sign_jump({id}, {group}, {buf})
|
||||
Open the buffer {buf} or jump to the window that contains
|
||||
{buf} and position the cursor at sign {id} in group {group}.
|
||||
This is similar to the |:sign-jump| command.
|
||||
|
||||
For the use of {expr}, see |bufname()|.
|
||||
For the use of {buf}, see |bufname()|.
|
||||
|
||||
Returns the line number of the sign. Returns -1 if the
|
||||
arguments are invalid.
|
||||
@ -533,9 +533,9 @@ sign_jump({id}, {group}, {expr})
|
||||
GetSignid()->sign_jump()
|
||||
<
|
||||
*sign_place()*
|
||||
sign_place({id}, {group}, {name}, {expr} [, {dict}])
|
||||
sign_place({id}, {group}, {name}, {buf} [, {dict}])
|
||||
Place the sign defined as {name} at line {lnum} in file or
|
||||
buffer {expr} and assign {id} and {group} to sign. This is
|
||||
buffer {buf} and assign {id} and {group} to sign. This is
|
||||
similar to the |:sign-place| command.
|
||||
|
||||
If the sign identifier {id} is zero, then a new identifier is
|
||||
@ -546,12 +546,12 @@ sign_place({id}, {group}, {name}, {expr} [, {dict}])
|
||||
and |sign-group| for more information.
|
||||
|
||||
{name} refers to a defined sign.
|
||||
{expr} refers to a buffer name or number. For the accepted
|
||||
{buf} refers to a buffer name or number. For the accepted
|
||||
values, see |bufname()|.
|
||||
|
||||
The optional {dict} argument supports the following entries:
|
||||
lnum line number in the file or buffer
|
||||
{expr} where the sign is to be placed.
|
||||
{buf} where the sign is to be placed.
|
||||
For the accepted values, see |line()|.
|
||||
priority priority of the sign. See
|
||||
|sign-priority| for more information.
|
||||
|
@ -1,4 +1,4 @@
|
||||
*sponsor.txt* For Vim version 8.2. Last change: 2008 Jun 21
|
||||
*sponsor.txt* For Vim version 8.2. Last change: 2021 Jul 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -11,9 +11,8 @@ Fixing bugs and adding new features takes a lot of time and effort. To show
|
||||
your appreciation for the work and motivate Bram and others to continue
|
||||
working on Vim please send a donation.
|
||||
|
||||
Since Bram is back to a paid job the money will now be used to help children
|
||||
in Uganda. See |uganda|. But at the same time donations increase Bram's
|
||||
motivation to keep working on Vim!
|
||||
Since Bram does not need the money it will be used to help children in Uganda,
|
||||
see |uganda|. Donations increase Bram's motivation to keep working on Vim!
|
||||
|
||||
For the most recent information about sponsoring look on the Vim web site:
|
||||
|
||||
@ -74,19 +73,6 @@ Other methods See |iccf-donations|.
|
||||
amount you transferred if you want to vote for features and
|
||||
show others you are a registered Vim user or sponsor.
|
||||
|
||||
Cash Small amounts can be sent with ordinary mail. Put something
|
||||
around the money, so that it's not noticeable from the
|
||||
outside. Mention your e-mail address if you want to vote for
|
||||
features and show others you are a registered Vim user or
|
||||
sponsor.
|
||||
|
||||
You can use this permanent address:
|
||||
Bram Moolenaar
|
||||
Finsterruetihof 1
|
||||
8134 Adliswil
|
||||
Switzerland
|
||||
|
||||
|
||||
|
||||
QUESTIONS AND ANSWERS *sponsor-faq* *register-faq*
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 8.2. Last change: 2021 May 30
|
||||
*syntax.txt* For Vim version 8.2. Last change: 2021 Jul 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -923,7 +923,7 @@ For Visual Basic use: >
|
||||
|
||||
BAAN *baan.vim* *baan-syntax*
|
||||
|
||||
The baan.vim gives syntax support for BaanC of release BaanIV upto SSA ERP LN
|
||||
The baan.vim gives syntax support for BaanC of release BaanIV up to SSA ERP LN
|
||||
for both 3 GL and 4 GL programming. Large number of standard defines/constants
|
||||
are supported.
|
||||
|
||||
@ -1420,11 +1420,17 @@ To select syntax highlighting file for Euphoria, as well as for
|
||||
auto-detecting the *.e and *.E file extensions as Euphoria file type,
|
||||
add the following line to your startup file: >
|
||||
|
||||
:let filetype_euphoria="euphoria3"
|
||||
:let g:filetype_euphoria = "euphoria3"
|
||||
|
||||
or
|
||||
< or >
|
||||
|
||||
:let filetype_euphoria="euphoria4"
|
||||
:let g:filetype_euphoria = "euphoria4"
|
||||
|
||||
Elixir and Euphoria share the *.ex file extension. If the filetype is
|
||||
specifically set as Euphoria with the g:filetype_euphoria variable, or the
|
||||
file is determined to be Euphoria based on keywords in the file, then the
|
||||
filetype will be set as Euphoria. Otherwise, the filetype will default to
|
||||
Elixir.
|
||||
|
||||
|
||||
ERLANG *erlang.vim* *ft-erlang-syntax*
|
||||
@ -1442,6 +1448,22 @@ To enable highlighting some special atoms, put this in your vimrc: >
|
||||
:let g:erlang_highlight_special_atoms = 1
|
||||
|
||||
|
||||
ELIXIR *elixir.vim* *ft-elixir-syntax*
|
||||
|
||||
Elixir is a dynamic, functional language for building scalable and maintainable
|
||||
applications.
|
||||
|
||||
The following file extensions are auto-detected as Elixir file types:
|
||||
|
||||
*.ex, *.exs, *.eex, *.leex, *.lock
|
||||
|
||||
Elixir and Euphoria share the *.ex file extension. If the filetype is
|
||||
specifically set as Euphoria with the g:filetype_euphoria variable, or the
|
||||
file is determined to be Euphoria based on keywords in the file, then the
|
||||
filetype will be set as Euphoria. Otherwise, the filetype will default to
|
||||
Elixir.
|
||||
|
||||
|
||||
FLEXWIKI *flexwiki.vim* *ft-flexwiki-syntax*
|
||||
|
||||
FlexWiki is an ASP.NET-based wiki package available at http://www.flexwiki.com
|
||||
@ -3430,8 +3452,8 @@ syntax highlighting script handles this with the following logic:
|
||||
Tex: Match Check Control~
|
||||
|
||||
Sometimes one actually wants mismatched parentheses, square braces,
|
||||
and or curly braces; for example, \text{(1,10] is a range from but
|
||||
not including 1 to and including 10}. This wish, of course, conflicts
|
||||
and or curly braces; for example, \text{(1,10]} is a range from but
|
||||
not including 1 to and including 10. This wish, of course, conflicts
|
||||
with the desire to provide delimiter mismatch detection. To
|
||||
accommodate these conflicting goals, syntax/tex.vim provides >
|
||||
g:tex_matchcheck = '[({[]'
|
||||
@ -4084,7 +4106,7 @@ match in the same position overrules an earlier one). The "transparent"
|
||||
argument makes the "myVim" match use the same highlighting as "myString". But
|
||||
it does not contain anything. If the "contains=NONE" argument would be left
|
||||
out, then "myVim" would use the contains argument from myString and allow
|
||||
"myWord" to be contained, which will be highlighted as a Constant. This
|
||||
"myWord" to be contained, which will be highlighted as a Comment. This
|
||||
happens because a contained match doesn't match inside itself in the same
|
||||
position, thus the "myVim" match doesn't overrule the "myWord" match here.
|
||||
|
||||
@ -4970,8 +4992,8 @@ ctermul={color-nr} *highlight-ctermul*
|
||||
*tmux*
|
||||
When using tmux you may want to use this in the tmux config: >
|
||||
# tmux colors
|
||||
set -g default-terminal "xterm-256color"
|
||||
set -ag terminal-overrides ",xterm-256color:Tc"
|
||||
set -s default-terminal "tmux-256color"
|
||||
set -as terminal-overrides ",*-256color:Tc"
|
||||
< More info at:
|
||||
https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-a-256-colour-terminal
|
||||
https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-rgb-colour
|
||||
|
@ -1384,6 +1384,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
+scrollbind various.txt /*+scrollbind*
|
||||
+signs various.txt /*+signs*
|
||||
+smartindent various.txt /*+smartindent*
|
||||
+sodium various.txt /*+sodium*
|
||||
+sound various.txt /*+sound*
|
||||
+spell various.txt /*+spell*
|
||||
+startuptime various.txt /*+startuptime*
|
||||
@ -1959,7 +1960,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:& change.txt /*:&*
|
||||
:&& change.txt /*:&&*
|
||||
:' cmdline.txt /*:'*
|
||||
:++ vim9.txt /*:++*
|
||||
:, cmdline.txt /*:,*
|
||||
:-- vim9.txt /*:--*
|
||||
:. cmdline.txt /*:.*
|
||||
:/ cmdline.txt /*:\/*
|
||||
:0file editing.txt /*:0file*
|
||||
@ -2304,6 +2307,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:command-nargs map.txt /*:command-nargs*
|
||||
:command-range map.txt /*:command-range*
|
||||
:command-register map.txt /*:command-register*
|
||||
:command-repl map.txt /*:command-repl*
|
||||
:command-verbose map.txt /*:command-verbose*
|
||||
:comment cmdline.txt /*:comment*
|
||||
:comp quickfix.txt /*:comp*
|
||||
@ -3964,11 +3968,25 @@ E118 eval.txt /*E118*
|
||||
E1187 starting.txt /*E1187*
|
||||
E1188 cmdline.txt /*E1188*
|
||||
E119 eval.txt /*E119*
|
||||
E1193 options.txt /*E1193*
|
||||
E1194 options.txt /*E1194*
|
||||
E1195 options.txt /*E1195*
|
||||
E1196 options.txt /*E1196*
|
||||
E1197 options.txt /*E1197*
|
||||
E1198 options.txt /*E1198*
|
||||
E1199 options.txt /*E1199*
|
||||
E12 message.txt /*E12*
|
||||
E120 eval.txt /*E120*
|
||||
E1200 options.txt /*E1200*
|
||||
E1201 options.txt /*E1201*
|
||||
E1205 eval.txt /*E1205*
|
||||
E121 eval.txt /*E121*
|
||||
E1214 eval.txt /*E1214*
|
||||
E122 eval.txt /*E122*
|
||||
E123 eval.txt /*E123*
|
||||
E1231 map.txt /*E1231*
|
||||
E1232 eval.txt /*E1232*
|
||||
E1233 eval.txt /*E1233*
|
||||
E124 eval.txt /*E124*
|
||||
E125 eval.txt /*E125*
|
||||
E126 eval.txt /*E126*
|
||||
@ -4726,7 +4744,7 @@ E835 options.txt /*E835*
|
||||
E836 if_pyth.txt /*E836*
|
||||
E837 if_pyth.txt /*E837*
|
||||
E838 netbeans.txt /*E838*
|
||||
E839 insert.txt /*E839*
|
||||
E839 message.txt /*E839*
|
||||
E84 windows.txt /*E84*
|
||||
E840 insert.txt /*E840*
|
||||
E841 map.txt /*E841*
|
||||
@ -4779,6 +4797,7 @@ E885 sign.txt /*E885*
|
||||
E886 starting.txt /*E886*
|
||||
E887 if_pyth.txt /*E887*
|
||||
E888 pattern.txt /*E888*
|
||||
E889 message.txt /*E889*
|
||||
E89 message.txt /*E89*
|
||||
E890 syntax.txt /*E890*
|
||||
E891 eval.txt /*E891*
|
||||
@ -4821,7 +4840,7 @@ E924 quickfix.txt /*E924*
|
||||
E925 quickfix.txt /*E925*
|
||||
E926 quickfix.txt /*E926*
|
||||
E927 eval.txt /*E927*
|
||||
E928 eval.txt /*E928*
|
||||
E928 message.txt /*E928*
|
||||
E929 starting.txt /*E929*
|
||||
E93 windows.txt /*E93*
|
||||
E930 eval.txt /*E930*
|
||||
@ -5151,6 +5170,10 @@ TabNew autocmd.txt /*TabNew*
|
||||
Tcl if_tcl.txt /*Tcl*
|
||||
TermChanged autocmd.txt /*TermChanged*
|
||||
TermResponse autocmd.txt /*TermResponse*
|
||||
TermdebugStartPost terminal.txt /*TermdebugStartPost*
|
||||
TermdebugStartPre terminal.txt /*TermdebugStartPre*
|
||||
TermdebugStopPost terminal.txt /*TermdebugStopPost*
|
||||
TermdebugStopPre terminal.txt /*TermdebugStopPre*
|
||||
Terminal-Job terminal.txt /*Terminal-Job*
|
||||
Terminal-Normal terminal.txt /*Terminal-Normal*
|
||||
Terminal-mode terminal.txt /*Terminal-mode*
|
||||
@ -6149,6 +6172,10 @@ digraph-encoding digraph.txt /*digraph-encoding*
|
||||
digraph-table digraph.txt /*digraph-table*
|
||||
digraph-table-mbyte digraph.txt /*digraph-table-mbyte*
|
||||
digraph.txt digraph.txt /*digraph.txt*
|
||||
digraph_get() eval.txt /*digraph_get()*
|
||||
digraph_getlist() eval.txt /*digraph_getlist()*
|
||||
digraph_set() eval.txt /*digraph_set()*
|
||||
digraph_setlist() eval.txt /*digraph_setlist()*
|
||||
digraphs digraph.txt /*digraphs*
|
||||
digraphs-changed version6.txt /*digraphs-changed*
|
||||
digraphs-default digraph.txt /*digraphs-default*
|
||||
@ -6178,6 +6205,8 @@ dos-backslash os_dos.txt /*dos-backslash*
|
||||
dos-colors os_dos.txt /*dos-colors*
|
||||
dos-file-formats os_dos.txt /*dos-file-formats*
|
||||
dos-locations os_dos.txt /*dos-locations*
|
||||
dos-powershell os_dos.txt /*dos-powershell*
|
||||
dos-pwsh os_dos.txt /*dos-pwsh*
|
||||
dos-shell os_dos.txt /*dos-shell*
|
||||
dos-standard-mappings os_dos.txt /*dos-standard-mappings*
|
||||
dos-temp-files os_dos.txt /*dos-temp-files*
|
||||
@ -6190,6 +6219,7 @@ dp diff.txt /*dp*
|
||||
drag-n-drop gui.txt /*drag-n-drop*
|
||||
drag-n-drop-win32 gui_w32.txt /*drag-n-drop-win32*
|
||||
drag-status-line term.txt /*drag-status-line*
|
||||
drop_file gui.txt /*drop_file*
|
||||
dtd.vim syntax.txt /*dtd.vim*
|
||||
dtd2vim insert.txt /*dtd2vim*
|
||||
dying-variable eval.txt /*dying-variable*
|
||||
@ -6210,6 +6240,7 @@ efm-%> quickfix.txt /*efm-%>*
|
||||
efm-entries quickfix.txt /*efm-entries*
|
||||
efm-ignore quickfix.txt /*efm-ignore*
|
||||
eiffel.vim syntax.txt /*eiffel.vim*
|
||||
elixir.vim syntax.txt /*elixir.vim*
|
||||
emacs-keys tips.txt /*emacs-keys*
|
||||
emacs-tags tagsrch.txt /*emacs-tags*
|
||||
emacs_tags tagsrch.txt /*emacs_tags*
|
||||
@ -6290,6 +6321,7 @@ execute-menus gui.txt /*execute-menus*
|
||||
exepath() eval.txt /*exepath()*
|
||||
exim starting.txt /*exim*
|
||||
exists() eval.txt /*exists()*
|
||||
exists_compiled() eval.txt /*exists_compiled()*
|
||||
exiting starting.txt /*exiting*
|
||||
exiting-variable eval.txt /*exiting-variable*
|
||||
exp() eval.txt /*exp()*
|
||||
@ -6559,6 +6591,7 @@ ft-docbkxml-syntax syntax.txt /*ft-docbkxml-syntax*
|
||||
ft-dosbatch-syntax syntax.txt /*ft-dosbatch-syntax*
|
||||
ft-dtd-syntax syntax.txt /*ft-dtd-syntax*
|
||||
ft-eiffel-syntax syntax.txt /*ft-eiffel-syntax*
|
||||
ft-elixir-syntax syntax.txt /*ft-elixir-syntax*
|
||||
ft-erlang-syntax syntax.txt /*ft-erlang-syntax*
|
||||
ft-euphoria-syntax syntax.txt /*ft-euphoria-syntax*
|
||||
ft-flexwiki-syntax syntax.txt /*ft-flexwiki-syntax*
|
||||
@ -6674,6 +6707,8 @@ ft-yaml-syntax syntax.txt /*ft-yaml-syntax*
|
||||
ft-zimbu-plugin filetype.txt /*ft-zimbu-plugin*
|
||||
ft-zsh-syntax syntax.txt /*ft-zsh-syntax*
|
||||
ft_ada.txt ft_ada.txt /*ft_ada.txt*
|
||||
ft_ps1.txt ft_ps1.txt /*ft_ps1.txt*
|
||||
ft_raku.txt ft_raku.txt /*ft_raku.txt*
|
||||
ft_rust.txt ft_rust.txt /*ft_rust.txt*
|
||||
ft_sql.txt ft_sql.txt /*ft_sql.txt*
|
||||
ftdetect filetype.txt /*ftdetect*
|
||||
@ -6917,6 +6952,7 @@ g:tar_nomax pi_tar.txt /*g:tar_nomax*
|
||||
g:tar_readoptions pi_tar.txt /*g:tar_readoptions*
|
||||
g:tar_secure pi_tar.txt /*g:tar_secure*
|
||||
g:tar_writeoptions pi_tar.txt /*g:tar_writeoptions*
|
||||
g:termdebugger terminal.txt /*g:termdebugger*
|
||||
g:terminal_ansi_colors terminal.txt /*g:terminal_ansi_colors*
|
||||
g:tex_comment_nospell syntax.txt /*g:tex_comment_nospell*
|
||||
g:tex_conceal syntax.txt /*g:tex_conceal*
|
||||
@ -7000,6 +7036,7 @@ getchar() eval.txt /*getchar()*
|
||||
getcharmod() eval.txt /*getcharmod()*
|
||||
getcharpos() eval.txt /*getcharpos()*
|
||||
getcharsearch() eval.txt /*getcharsearch()*
|
||||
getcharstr() eval.txt /*getcharstr()*
|
||||
getcmdline() eval.txt /*getcmdline()*
|
||||
getcmdpos() eval.txt /*getcmdpos()*
|
||||
getcmdtype() eval.txt /*getcmdtype()*
|
||||
@ -7744,6 +7781,7 @@ lua-funcref if_lua.txt /*lua-funcref*
|
||||
lua-list if_lua.txt /*lua-list*
|
||||
lua-luaeval if_lua.txt /*lua-luaeval*
|
||||
lua-vim if_lua.txt /*lua-vim*
|
||||
lua-vim-variables if_lua.txt /*lua-vim-variables*
|
||||
lua-window if_lua.txt /*lua-window*
|
||||
lua.vim syntax.txt /*lua.vim*
|
||||
luaeval() eval.txt /*luaeval()*
|
||||
@ -7901,6 +7939,7 @@ moo.vim syntax.txt /*moo.vim*
|
||||
more-compatible version5.txt /*more-compatible*
|
||||
more-prompt message.txt /*more-prompt*
|
||||
more-variables eval.txt /*more-variables*
|
||||
motion-count-multiplied motion.txt /*motion-count-multiplied*
|
||||
motion.txt motion.txt /*motion.txt*
|
||||
mouse-mode-table term.txt /*mouse-mode-table*
|
||||
mouse-overview term.txt /*mouse-overview*
|
||||
@ -8348,6 +8387,7 @@ omni-sql-completion ft_sql.txt /*omni-sql-completion*
|
||||
online-help helphelp.txt /*online-help*
|
||||
opening-window windows.txt /*opening-window*
|
||||
operator motion.txt /*operator*
|
||||
operator-doubled motion.txt /*operator-doubled*
|
||||
operator-pending-index index.txt /*operator-pending-index*
|
||||
operator-variable eval.txt /*operator-variable*
|
||||
option-backslash options.txt /*option-backslash*
|
||||
@ -8401,6 +8441,7 @@ page_up intro.txt /*page_up*
|
||||
pager message.txt /*pager*
|
||||
papp.vim syntax.txt /*papp.vim*
|
||||
paragraph motion.txt /*paragraph*
|
||||
partial eval.txt /*partial*
|
||||
pascal.vim syntax.txt /*pascal.vim*
|
||||
patches-8 version8.txt /*patches-8*
|
||||
patches-8.1 version8.txt /*patches-8.1*
|
||||
@ -8598,7 +8639,6 @@ ps1-compiler ft_ps1.txt /*ps1-compiler*
|
||||
ps1-folding ft_ps1.txt /*ps1-folding*
|
||||
ps1-keyword ft_ps1.txt /*ps1-keyword*
|
||||
ps1-syntax ft_ps1.txt /*ps1-syntax*
|
||||
ps1.txt ft_ps1.txt /*ps1.txt*
|
||||
psql ft_sql.txt /*psql*
|
||||
ptcap.vim syntax.txt /*ptcap.vim*
|
||||
pterm-mouse options.txt /*pterm-mouse*
|
||||
@ -9618,6 +9658,7 @@ termcap-title term.txt /*termcap-title*
|
||||
termdebug-commands terminal.txt /*termdebug-commands*
|
||||
termdebug-communication terminal.txt /*termdebug-communication*
|
||||
termdebug-customizing terminal.txt /*termdebug-customizing*
|
||||
termdebug-events terminal.txt /*termdebug-events*
|
||||
termdebug-example terminal.txt /*termdebug-example*
|
||||
termdebug-prompt terminal.txt /*termdebug-prompt*
|
||||
termdebug-starting terminal.txt /*termdebug-starting*
|
||||
@ -9673,6 +9714,8 @@ test_feedinput() testing.txt /*test_feedinput()*
|
||||
test_garbagecollect_now() testing.txt /*test_garbagecollect_now()*
|
||||
test_garbagecollect_soon() testing.txt /*test_garbagecollect_soon()*
|
||||
test_getvalue() testing.txt /*test_getvalue()*
|
||||
test_gui_drop_files() testing.txt /*test_gui_drop_files()*
|
||||
test_gui_mouse_event() testing.txt /*test_gui_mouse_event()*
|
||||
test_ignore_error() testing.txt /*test_ignore_error()*
|
||||
test_null_blob() testing.txt /*test_null_blob()*
|
||||
test_null_channel() testing.txt /*test_null_channel()*
|
||||
@ -10066,6 +10109,7 @@ v_u change.txt /*v_u*
|
||||
v_v visual.txt /*v_v*
|
||||
v_x change.txt /*v_x*
|
||||
v_y change.txt /*v_y*
|
||||
v_zy change.txt /*v_zy*
|
||||
v_~ change.txt /*v_~*
|
||||
vab motion.txt /*vab*
|
||||
val-variable eval.txt /*val-variable*
|
||||
@ -10135,28 +10179,35 @@ vim-8.2 version8.txt /*vim-8.2*
|
||||
vim-additions vi_diff.txt /*vim-additions*
|
||||
vim-announce intro.txt /*vim-announce*
|
||||
vim-arguments starting.txt /*vim-arguments*
|
||||
vim-changelog version8.txt /*vim-changelog*
|
||||
vim-default-editor gui_w32.txt /*vim-default-editor*
|
||||
vim-dev intro.txt /*vim-dev*
|
||||
vim-mac intro.txt /*vim-mac*
|
||||
vim-modes intro.txt /*vim-modes*
|
||||
vim-modes-intro intro.txt /*vim-modes-intro*
|
||||
vim-raku ft_raku.txt /*vim-raku*
|
||||
vim-raku.txt ft_raku.txt /*vim-raku.txt*
|
||||
vim-script-intro usr_41.txt /*vim-script-intro*
|
||||
vim-use intro.txt /*vim-use*
|
||||
vim-variable eval.txt /*vim-variable*
|
||||
vim.b if_lua.txt /*vim.b*
|
||||
vim.g if_lua.txt /*vim.g*
|
||||
vim.t if_lua.txt /*vim.t*
|
||||
vim.v if_lua.txt /*vim.v*
|
||||
vim.vim syntax.txt /*vim.vim*
|
||||
vim.w if_lua.txt /*vim.w*
|
||||
vim7 version7.txt /*vim7*
|
||||
vim8 version8.txt /*vim8*
|
||||
vim9 vim9.txt /*vim9*
|
||||
vim9-classes vim9.txt /*vim9-classes*
|
||||
vim9-const vim9.txt /*vim9-const*
|
||||
vim9-curly vim9.txt /*vim9-curly*
|
||||
vim9-debug repeat.txt /*vim9-debug*
|
||||
vim9-declaration vim9.txt /*vim9-declaration*
|
||||
vim9-declarations usr_46.txt /*vim9-declarations*
|
||||
vim9-differences vim9.txt /*vim9-differences*
|
||||
vim9-export vim9.txt /*vim9-export*
|
||||
vim9-final vim9.txt /*vim9-final*
|
||||
vim9-function-defined-later vim9.txt /*vim9-function-defined-later*
|
||||
vim9-gotchas vim9.txt /*vim9-gotchas*
|
||||
vim9-ignored-argument vim9.txt /*vim9-ignored-argument*
|
||||
vim9-import vim9.txt /*vim9-import*
|
||||
@ -10280,6 +10331,7 @@ win32-faq os_win32.txt /*win32-faq*
|
||||
win32-gettext mlang.txt /*win32-gettext*
|
||||
win32-gui gui_w32.txt /*win32-gui*
|
||||
win32-hidden-menus gui.txt /*win32-hidden-menus*
|
||||
win32-installer os_win32.txt /*win32-installer*
|
||||
win32-mouse os_win32.txt /*win32-mouse*
|
||||
win32-open-with-menu gui_w32.txt /*win32-open-with-menu*
|
||||
win32-popup-menu gui_w32.txt /*win32-popup-menu*
|
||||
@ -10435,6 +10487,7 @@ zOS-PuTTY os_390.txt /*zOS-PuTTY*
|
||||
zOS-has-ebcdic os_390.txt /*zOS-has-ebcdic*
|
||||
zOS-limitations os_390.txt /*zOS-limitations*
|
||||
zOS-open-source os_390.txt /*zOS-open-source*
|
||||
zP change.txt /*zP*
|
||||
zR fold.txt /*zR*
|
||||
zW spell.txt /*zW*
|
||||
zX fold.txt /*zX*
|
||||
@ -10462,6 +10515,7 @@ zl scroll.txt /*zl*
|
||||
zm fold.txt /*zm*
|
||||
zn fold.txt /*zn*
|
||||
zo fold.txt /*zo*
|
||||
zp change.txt /*zp*
|
||||
zr fold.txt /*zr*
|
||||
zs scroll.txt /*zs*
|
||||
zsh.vim syntax.txt /*zsh.vim*
|
||||
@ -10473,6 +10527,7 @@ zuw spell.txt /*zuw*
|
||||
zv fold.txt /*zv*
|
||||
zw spell.txt /*zw*
|
||||
zx fold.txt /*zx*
|
||||
zy change.txt /*zy*
|
||||
zz scroll.txt /*zz*
|
||||
{ motion.txt /*{*
|
||||
{Visual} intro.txt /*{Visual}*
|
||||
|
@ -373,10 +373,10 @@ Added by Vim (there are no standard codes for these):
|
||||
t_Ri restore icon text from stack *t_Ri* *'t_Ri'*
|
||||
t_TE end of "raw" mode *t_TE* *'t_TE'*
|
||||
t_TI put terminal into "raw" mode *t_TI* *'t_TI'*
|
||||
t_fd disable focus-event tracking *t_fd* *'t_fd'*
|
||||
|xterm-focus-event|
|
||||
t_fe enable focus-event tracking *t_fe* *'t_fe'*
|
||||
|xterm-focus-event|
|
||||
t_fd disable focus-event tracking *t_fd* *'t_fd'*
|
||||
|xterm-focus-event|
|
||||
|
||||
Some codes have a start, middle and end part. The start and end are defined
|
||||
by the termcap option, the middle part is text.
|
||||
|
@ -1,4 +1,4 @@
|
||||
*terminal.txt* For Vim version 8.2. Last change: 2021 Feb 13
|
||||
*terminal.txt* For Vim version 8.2. Last change: 2021 Aug 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -1352,6 +1352,33 @@ Other commands ~
|
||||
*:Asm* jump to the window with the disassembly, create it if there
|
||||
isn't one
|
||||
|
||||
Events ~
|
||||
*termdebug-events*
|
||||
Four autocommands can be used: >
|
||||
au User TermdebugStartPre echomsg 'debugging starting'
|
||||
au User TermdebugStartPost echomsg 'debugging started'
|
||||
au User TermdebugStopPre echomsg 'debugging stopping'
|
||||
au User TermdebugStopPost echomsg 'debugging stopped'
|
||||
<
|
||||
*TermdebugStartPre*
|
||||
TermdebugStartPre Before starting debugging.
|
||||
Not triggered if the debugger is already
|
||||
running or |g:termdebugger| cannot be
|
||||
executed.
|
||||
*TermdebugStartPost*
|
||||
TermdebugStartPost After debugging has initialized.
|
||||
If a "!" bang is passed to `:Termdebug` or
|
||||
`:TermdebugCommand` the event is triggered
|
||||
before running the provided command in gdb.
|
||||
*TermdebugStopPre*
|
||||
TermdebugStopPre Before debugging ends, when gdb is terminated,
|
||||
most likely after issuing a "quit" command in
|
||||
the gdb window.
|
||||
*TermdebugStopPost*
|
||||
TermdebugStopPost After debugging has ended, gdb-related windows
|
||||
are closed, debug buffers wiped out and
|
||||
the state before the debugging was restored.
|
||||
|
||||
|
||||
Prompt mode ~
|
||||
*termdebug-prompt*
|
||||
@ -1396,11 +1423,11 @@ communication channel.
|
||||
|
||||
Customizing ~
|
||||
|
||||
GDB command *termdebug-customizing*
|
||||
|
||||
To change the name of the gdb command, set the "termdebugger" variable before
|
||||
GDB command *termdebug-customizing*
|
||||
*g:termdebugger*
|
||||
To change the name of the gdb command, set the "g:termdebugger" variable before
|
||||
invoking `:Termdebug`: >
|
||||
let termdebugger = "mygdb"
|
||||
let g:termdebugger = "mygdb"
|
||||
< *gdb-version*
|
||||
Only debuggers fully compatible with gdb will work. Vim uses the GDB/MI
|
||||
interface. The "new-ui" command requires gdb version 7.12 or later. if you
|
||||
|
@ -1,4 +1,4 @@
|
||||
*testing.txt* For Vim version 8.2. Last change: 2021 Apr 02
|
||||
*testing.txt* For Vim version 8.2. Last change: 2021 Jul 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -78,6 +78,46 @@ test_getvalue({name}) *test_getvalue()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetName()->test_getvalue()
|
||||
<
|
||||
*test_gui_drop_files()*
|
||||
test_gui_drop_files({list}, {row}, {col}, {mods})
|
||||
Drop one or more files in {list} in the window at {row}, {col}.
|
||||
This function only works when the GUI is running and the
|
||||
|drag-n-drop| feature is present.
|
||||
|
||||
The supported values for {mods} are:
|
||||
0x4 Shift
|
||||
0x8 Alt
|
||||
0x10 Ctrl
|
||||
The files are added to the argument list and the first file in
|
||||
{list} is edited in the window. See |drag-n-drop| for more
|
||||
information.
|
||||
|
||||
*test_gui_mouse_event()*
|
||||
test_gui_mouse_event({button}, {row}, {col}, {multiclick}, {modifiers})
|
||||
Inject a mouse button click event. This function only works
|
||||
when the GUI is running.
|
||||
The supported values for {button} are:
|
||||
0 right mouse button
|
||||
1 middle mouse button
|
||||
2 left mouse button
|
||||
3 mouse button release
|
||||
4 scroll wheel down
|
||||
5 scroll wheel up
|
||||
6 scroll wheel left
|
||||
7 scroll wheel right
|
||||
{row} and {col} specify the location of the mouse click. The
|
||||
first row of the Vim window is 1 and the last row is 'lines'.
|
||||
The maximum value of {col} is 'columns'.
|
||||
To inject a multiclick event, set {multiclick} to 1.
|
||||
The supported values for {modifiers} are:
|
||||
4 shift is pressed
|
||||
8 alt is pressed
|
||||
16 ctrl is pressed
|
||||
After injecting the mouse event you probably should call
|
||||
|feedkeys()| to have them processed, e.g.: >
|
||||
call feedkeys("y", 'Lx!')
|
||||
|
||||
|
||||
test_ignore_error({expr}) *test_ignore_error()*
|
||||
Ignore any error containing {expr}. A normal message is given
|
||||
@ -406,7 +446,7 @@ assert_notmatch({pattern}, {actual} [, {msg}])
|
||||
|
||||
|
||||
assert_report({msg}) *assert_report()*
|
||||
Report a test failure directly, using {msg}.
|
||||
Report a test failure directly, using String {msg}.
|
||||
Always returns one.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
|
@ -211,6 +211,8 @@ prop_list({lnum} [, {props}]) *prop_list()*
|
||||
id property ID
|
||||
type name of the property type, omitted if
|
||||
the type was deleted
|
||||
type_bufnr buffer number for which this type was defined;
|
||||
0 if the type is global
|
||||
start when TRUE property starts in this line
|
||||
end when TRUE property ends in this line
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 May 28
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 Aug 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -38,57 +38,30 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Geen memory leak?
|
||||
|
||||
Crash using outer var from nested lambda:
|
||||
vim9script
|
||||
def F(text: string): func(string): func(string): string
|
||||
return (arg: string): func(string): string => ((sep: string): string => {
|
||||
return text .. ' ' .. arg
|
||||
})
|
||||
enddef
|
||||
|
||||
echo F('hello')(' ')('there')
|
||||
|
||||
|
||||
|
||||
Vim9 - Make everything work:
|
||||
- function returning nothing should return void instead of zero
|
||||
- compile "expr" and "call" expression of a channel in channel_exe_cmd()?
|
||||
- Need some solution for dict function. Can we implement part of classes?
|
||||
- A lambda without {} does not require a return type, using { return x } does.
|
||||
That's unexpected, since the arguments are not required to have a type.
|
||||
alt 1: not require a return type, figure it out from the common type of all
|
||||
the return statements found
|
||||
alt 2: also require argument types
|
||||
- Using "windo echo expr" does not accept a line break inside "expr" (in a
|
||||
:def function and at script level in a not executed block). #7681
|
||||
- use CheckLegacyAndVim9Success(lines) in many more places
|
||||
- Check TODO items in vim9compile.c and vim9execute.c
|
||||
- For builtin functions using tv_get_string*() use check_for_string() to be
|
||||
more strict about the argument type (not a bool).
|
||||
done: balloon_()
|
||||
- Check many more builtin function arguments at compile time.
|
||||
map() could check that the return type of the function argument matches
|
||||
the type of the list or dict member. (#8092)
|
||||
- Allow for using an autoload function name without quotes. It is then loaded
|
||||
(and compiled) right away. #8124
|
||||
- Test more expressions in legacy and Vim9 script, using
|
||||
CheckLegacyAndVim9Success()
|
||||
Same for other functions, such as searchpair().
|
||||
- Test try/catch and throw better, also nested.
|
||||
Test that return inside try/finally jumps to finally and then returns.
|
||||
- Test that a function defined inside a :def function is local to that
|
||||
function, g: functions can be defined and script-local functions cannot be
|
||||
defined.
|
||||
- Make debugging work - at least per function. Need to recompile a function
|
||||
to step through it line-by-line? Evaluate the stack and variables on the
|
||||
stack?
|
||||
- Reserve command for future use: :type, :class, :enum
|
||||
- Unexpected error message when using "var x: any | x.key = 9", because "x" is
|
||||
given the type number. Can we use VAR_ANY?
|
||||
- Check performance with callgrind and kcachegrind.
|
||||
|
||||
Once Vim9 is stable:
|
||||
- Add the "vim9script" feature, can use has('vim9script')
|
||||
- Change the help to prefer Vim9 syntax where appropriate
|
||||
- Add all the error numbers in a good place in documentation.
|
||||
- In the generic eval docs, point out the Vim9 syntax where it differs.
|
||||
- Add the "vim9script" feature, can use has('vim9script')
|
||||
- Use Vim9 for runtime files.
|
||||
PR #7497 for autoload/ccomplete.vim
|
||||
|
||||
@ -98,15 +71,16 @@ Further Vim9 improvements, possibly after launch:
|
||||
'foldexpr', 'foldtext', 'printexpr', 'diffexpr', 'patchexpr', 'charconvert',
|
||||
'balloonexpr', 'includeexpr', 'indentexpr', 'formatexpr'.
|
||||
Give an error if compilation fails. (#7625)
|
||||
Alternatively: Detect a compiled function call and skip the expression
|
||||
evaluation.
|
||||
Use the location where the option was set for deciding whether it's to be
|
||||
evaluated in Vim9 script context.
|
||||
- implement :type, import type declaration.
|
||||
- implement enum, import enum.
|
||||
- Future work: See |vim9-classes|
|
||||
- implement :type, "import type"
|
||||
- implement enum, "import enum".
|
||||
- implement class and interface: See |vim9-classes|
|
||||
- For range: make table of first ASCII character with flag to quickly check if
|
||||
it can be a Vim9 command. E.g. "+" can, but "." can't.
|
||||
- compile get_lambda_tv() in popup_add_timeout()
|
||||
- inline call to map() and filter()
|
||||
- Inline call to map() and filter(), better type checking.
|
||||
- Make accessing varargs faster: arg[expr]
|
||||
EVAL expr
|
||||
LOADVARARG (varargs idx)
|
||||
@ -241,10 +215,13 @@ Terminal emulator window:
|
||||
|
||||
Include patch #6290: recognize shell directory change.
|
||||
|
||||
MS-Windows GUI: default 'encoding' to "utf-8" ? (#8221)
|
||||
Add #ifdef MSWIN before enc_locale() in set_init_1().
|
||||
Or just always for MS-Windows? Conversion to 'termencoding' should always
|
||||
work?
|
||||
When using 'cryptmethod' xchaha20 the undo file is not encrypted.
|
||||
Need to handle extra bytes.
|
||||
|
||||
Test_communicate_ipv6(): is flaky on many systems
|
||||
Fails in line 64 of Ch_communicate, no exception is thrown.
|
||||
|
||||
Rename getdigraphlist -> digraph_getlist() etc.
|
||||
|
||||
Valgrind reports memory leaks in test_options.
|
||||
Valgrind reports overlapping memcpy in
|
||||
@ -256,7 +233,6 @@ Valgrind reports overlapping memcpy in
|
||||
test_normal
|
||||
test_popupwin.35 et al.
|
||||
test_search_stat
|
||||
Using uninitialized value in test_crypt (can't explain why).
|
||||
Memory leak in test_debugger
|
||||
Memory leak in test_paste, using XtOpenDisplay several times
|
||||
OLD:
|
||||
@ -269,10 +245,16 @@ Memory leaks in test_channel? (or is it because of fork())
|
||||
initialization to figure out the default value from 'shell'. Add a test for
|
||||
this.
|
||||
|
||||
MS-Windows: did path modifier :p:8 stop working? #8600
|
||||
|
||||
test_arglist func Test_all_not_allowed_from_cmdwin() hangs on MS-Windows.
|
||||
|
||||
Mapping with partial match not executed properly in GTK. (Ingo Karkat, #7082)
|
||||
|
||||
Problem that a previous silent ":throw" causes a following try/catch not to
|
||||
work. (ZyX, 2013 Sep 28) With examples: (Malcolm Rowe, 2015 Dec 24)
|
||||
Also see #8487 for an example.
|
||||
|
||||
Patch for Template string: #4634
|
||||
Have another look at the implementation.
|
||||
|
||||
@ -292,6 +274,9 @@ Remove SPACE_IN_FILENAME ? It is only used for completion.
|
||||
Searching for \%'> does not find anything when using line Visual selection.
|
||||
Probably because it's using MAXCOL. #8238
|
||||
|
||||
Make "g>" and "g<" in Visual mode move the text right or left.
|
||||
Also for a block selection. #8558
|
||||
|
||||
Add optional argument to virtcol() that specifies "start", "cursor" or "end"
|
||||
to tell which value from getvvcol() should be used. (#7964)
|
||||
Value returned by virtcol() changes depending on how lines wrap. This is
|
||||
@ -300,10 +285,13 @@ inconsistent with the documentation.
|
||||
Making breakat support multibyte characters (Yasuhiro Matsumoto, #6598)
|
||||
Scroll doesn't work correctly, why?
|
||||
|
||||
glob() and globfile() do not always honor 'wildignorecase'. #8350
|
||||
globpath() does not use 'wildignorecase' at all?
|
||||
|
||||
Add 'termguiattr' option, use "gui=" attributes in the terminal? Would work
|
||||
with 'termguicolors'. #1740
|
||||
|
||||
Patch for blockwise paste reporting changes: #6660.
|
||||
Patch for blockwise paste reporting changes: #6660. Asked for a PR.
|
||||
|
||||
Patch to make fillchars global-local. (#5206)
|
||||
|
||||
@ -344,6 +332,12 @@ Should also work without any group:
|
||||
:echo matchstr('aaa bbb', '.\{-1,}\>\|.*')
|
||||
aaa bbb (should be aaa)
|
||||
|
||||
Should add a match/str/list/pos method that also returns the test and position
|
||||
of submatches. #8355
|
||||
|
||||
Syntax highlight for a region does not work with a "nextgroup" if the start
|
||||
match is empty. #8449
|
||||
|
||||
Check out PR #543 (Roland Puntaier).
|
||||
Patch for multibyte characters in langmap and applying a mapping on them.
|
||||
(Christian Brabandt, 2015 Jun 12, update July 25)
|
||||
@ -368,6 +362,7 @@ The buffer list and windows are locked, no changes possible
|
||||
|
||||
Add a ModeChanged autocommand that has an argument indicating the old and new
|
||||
mode, as what's returned from mode(). Also used for switching Terminal mode.
|
||||
#8360, #7863, #7363
|
||||
|
||||
Matchparen doesn't remove highlight after undo. (#7054)
|
||||
Is OK when syntax HL is active.
|
||||
@ -380,6 +375,10 @@ work.
|
||||
Using "au!" after "filetype on" is a bit slow. Can the matching of
|
||||
autocommands be made faster? (#7056)
|
||||
|
||||
Append in Visual block mode inserts the wrong character.
|
||||
Test_visual_block_mode() already has the proper check, which is commented out.
|
||||
(#8288)
|
||||
|
||||
Add the <=> (spaceship) operator and "cond ?< expr ?= expr ?> expr"
|
||||
replace this:
|
||||
let left = GetLeftFunc()
|
||||
@ -717,9 +716,6 @@ tab page. (Ingo Karkat, #4324)
|
||||
This modeline throws unexpected errors: (#4165)
|
||||
vim: syn=nosyntax
|
||||
|
||||
":doau SomeEvent" gives "No matching autocommands". This message doesn't give
|
||||
a hint about how to fix it. (#4300)
|
||||
|
||||
Make balloon_show() work outside of 'balloonexpr'? Users expect it to work:
|
||||
#2948. (related to #1512?)
|
||||
Also see #2352, want better control over balloon, perhaps set the position.
|
||||
@ -1428,9 +1424,6 @@ Appveyor build with self-installing executable, includes getting most
|
||||
interfaces: https://github.com/k-takata/vim/tree/chrisbra-appveyor-build
|
||||
result: https://ci.appveyor.com/project/k-takata/vim/history
|
||||
|
||||
Problem that a previous silent ":throw" causes a following try/catch not to
|
||||
work. (ZyX, 2013 Sep 28) With examples: (Malcolm Rowe, 2015 Dec 24)
|
||||
|
||||
Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
|
||||
|
||||
Patch to make tests pass with EBCDIC. (Owen Leibman, 2016 Apr 10)
|
||||
@ -2263,9 +2256,6 @@ Win32: Improved Makefile for MSVC. (Leonardo Valeri Manera, 2010 Aug 18)
|
||||
|
||||
Win32: Expanding 'path' runs into a maximum size limit. (bgold12, 2009 Nov 15)
|
||||
|
||||
Win32: Patch for enabling quick edit mode in console. (Craig Barkhouse, 2010
|
||||
Sep 1)
|
||||
|
||||
Win32: Patch for using .png files for icons. (Charles Peacech, 2012 Feb 5)
|
||||
|
||||
Putting a Visual block while 'visualedit' is "all" does not leave the cursor
|
||||
@ -3081,7 +3071,7 @@ Awaiting updated patches:
|
||||
7 When 'rightleft' is set, the search pattern should be displayed right
|
||||
to left as well? See patch of Dec 26. (Nadim Shaikli)
|
||||
8 Option to lock all used memory so that it doesn't get swapped to disk
|
||||
(uncrypted). Patch by Jason Holt, 2003 May 23. Uses mlock.
|
||||
(unencrypted). Patch by Jason Holt, 2003 May 23. Uses mlock.
|
||||
7 Add ! register, for shell commands. (patch from Grenie)
|
||||
8 In the gzip plugin, also recognize *.gz.orig, *.gz.bak, etc. Like it's
|
||||
done for filetype detection. Patch from Walter Briscoe, 2003 Jul 1.
|
||||
|
@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2021 Apr 19
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2021 Aug 08
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@ -994,6 +994,10 @@ Window size and position: *window-size-functions*
|
||||
winrestview() restore saved view of current window
|
||||
|
||||
Mappings and Menus: *mapping-functions*
|
||||
digraph_get() get |digraph|
|
||||
digraph_getlist() get all |digraph|s
|
||||
digraph_set() register |digraph|
|
||||
digraph_setlist() register multiple |digraph|s
|
||||
hasmapto() check if a mapping exists
|
||||
mapcheck() check if a matching mapping exists
|
||||
maparg() get rhs of a mapping
|
||||
@ -1021,6 +1025,8 @@ Testing: *test-functions*
|
||||
test_garbagecollect_now() free memory right now
|
||||
test_garbagecollect_soon() set a flag to free memory soon
|
||||
test_getvalue() get value of an internal variable
|
||||
test_gui_drop_files() drop file(s) in a window
|
||||
test_gui_mouse_event() add a GUI mouse event to the input buffer
|
||||
test_ignore_error() ignore a specific error message
|
||||
test_null_blob() return a null Blob
|
||||
test_null_channel() return a null Channel
|
||||
@ -1176,6 +1182,7 @@ Various: *various-functions*
|
||||
state() get current busy state
|
||||
visualmode() last visual mode used
|
||||
exists() check if a variable, function, etc. exists
|
||||
exists_compiled() like exists() but check at compile time
|
||||
has() check if a feature is supported in Vim
|
||||
changenr() return number of most recent change
|
||||
cscope_connection() check if a cscope connection exists
|
||||
|
@ -444,6 +444,7 @@ m *+ruby/dyn* Ruby interface |ruby-dynamic| |/dyn|
|
||||
T *+scrollbind* |'scrollbind'|
|
||||
B *+signs* |:sign|
|
||||
N *+smartindent* |'smartindent'|
|
||||
B *+sodium* compiled with libsodium for better encryption support
|
||||
B *+sound* |sound_playevent()|, |sound_playfile()| functions, etc.
|
||||
N *+spell* spell checking support, see |spell|
|
||||
N *+startuptime* |--startuptime| argument
|
||||
@ -724,7 +725,7 @@ K Run a program to lookup the keyword under the
|
||||
feature}
|
||||
|
||||
*:sl!* *:sleep!*
|
||||
:[N]sl[eep]! [N] [m] Same as above, but hide the cursor.
|
||||
:[N]sl[eep]! [N][m] Same as above, but hide the cursor.
|
||||
|
||||
*:xrestore* *:xr*
|
||||
:xr[estore] [display] Reinitializes the connection to the X11 server. Useful
|
||||
|
@ -2696,7 +2696,7 @@ Multi-byte:
|
||||
double-wide character.
|
||||
- Overstrike mode for the cmdline replaced only the first byte of a multibyte
|
||||
character.
|
||||
- The cursor in Replace mode (also in the cmdline) was to small on a
|
||||
- The cursor in Replace mode (also in the cmdline) was too small on a
|
||||
double-wide character.
|
||||
- When a multibyte character contained a 0x80 byte, it didn't work (was using
|
||||
a CSI byte instead). (Muraoka Taro)
|
||||
@ -3546,7 +3546,7 @@ Added Simplified Chinese translation of the tutor. (Mendel L Chan)
|
||||
Added Russian keymap for yawerty keyboard.
|
||||
|
||||
Added an explanation of using the vimrc file in the tutor.
|
||||
Changed tutor.vim to get the right encoding for the Taiwainese tutor.
|
||||
Changed tutor.vim to get the right encoding for the Taiwanese tutor.
|
||||
|
||||
Added Russian tutor. (Andrey Kiselev)
|
||||
Added Polish tutor. (Mikolaj Machowski)
|
||||
@ -5465,7 +5465,7 @@ Files: src/fileio.c
|
||||
Patch 6.0.267
|
||||
Problem: UTF-8: Although 'isprint' says a character is printable,
|
||||
utf_char2cells() still considers it unprintable.
|
||||
Solution: Use vim_isprintc() for characters upto 0x100. (Yasuhiro Matsumoto)
|
||||
Solution: Use vim_isprintc() for characters up to 0x100. (Yasuhiro Matsumoto)
|
||||
Files: src/mbyte.c
|
||||
|
||||
Patch 6.0.268 (extra) (depends on patch 6.0.255)
|
||||
|
@ -1,4 +1,4 @@
|
||||
*version7.txt* For Vim version 8.2. Last change: 2021 May 13
|
||||
*version7.txt* For Vim version 8.2. Last change: 2021 May 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -16225,7 +16225,7 @@ Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok,
|
||||
Patch 7.3.1018
|
||||
Problem: New regexp engine wastes memory.
|
||||
Solution: Allocate prog with actual number of states, not estimated maximum
|
||||
number of sates.
|
||||
number of states.
|
||||
Files: src/regexp_nfa.c
|
||||
|
||||
Patch 7.3.1019
|
||||
|
@ -1,4 +1,4 @@
|
||||
*version8.txt* For Vim version 8.2. Last change: 2021 May 13
|
||||
*version8.txt* For Vim version 8.2. Last change: 2021 Jul 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -41,6 +41,10 @@ See |vi_diff.txt| for an overview of differences between Vi and Vim 8.0.
|
||||
See |version4.txt|, |version5.txt|, |version6.txt| and |version7.txt| for
|
||||
differences between other versions.
|
||||
|
||||
*vim-changelog*
|
||||
You can find an overview of the most important changes (according to Martin
|
||||
Tournoij) on this site: https://www.arp242.net/vimlog/
|
||||
|
||||
==============================================================================
|
||||
NEW FEATURES *new-8*
|
||||
|
||||
@ -12980,7 +12984,7 @@ Files: src/evalfunc.c, src/testdir/test_cmdline.vim
|
||||
Patch 7.4.2113
|
||||
Problem: Test for undo is flaky.
|
||||
Solution: Turn it into a new style test. Use test_settime() to avoid
|
||||
flakyness.
|
||||
flakiness.
|
||||
Files: src/Makefile, src/undo.c, src/testdir/test61.in,
|
||||
src/testdir/test61.ok, src/testdir/test_undo.vim,
|
||||
src/testdir/test_undolevels.vim, src/testdir/Make_all.mak,
|
||||
@ -30906,7 +30910,7 @@ Files: src/eval.c, src/testdir/test_assert.vim
|
||||
Patch 8.1.0820
|
||||
Problem: Test for sending large data over channel sometimes fails.
|
||||
Solution: Handle that the job may have finished early. Also fix that file
|
||||
changed test doesn't work in the GUI and reduce flakyness. (Ozaki
|
||||
changed test doesn't work in the GUI and reduce flakiness. (Ozaki
|
||||
Kiichi, closes #3861)
|
||||
Files: src/testdir/test_channel.vim, src/testdir/test_filechanged.vim
|
||||
|
||||
@ -35504,7 +35508,7 @@ Files: Filelist, src/testdir/Make_all.mak, src/testdir/check.vim,
|
||||
src/testdir/test_xxd.vim
|
||||
|
||||
Patch 8.1.1545
|
||||
Problem: When the screen is to small there is no message about that.
|
||||
Problem: When the screen is too small there is no message about that.
|
||||
(Daniel Hahler)
|
||||
Solution: Do not use :cquit. (closes #4534)
|
||||
Files: src/testdir/runtest.vim
|
||||
@ -39253,7 +39257,7 @@ Files: src/option.c
|
||||
|
||||
Patch 8.1.2117
|
||||
Problem: CursorLine highlight used while 'cursorline' is off.
|
||||
Solution: Check 'cursorline' is set. (cloes #5017)
|
||||
Solution: Check 'cursorline' is set. (closes #5017)
|
||||
Files: src/drawline.c, src/testdir/test_cursorline.vim
|
||||
|
||||
Patch 8.1.2118
|
||||
@ -41104,7 +41108,7 @@ Files: src/buffer.c, src/testdir/test_popupwin.vim
|
||||
Patch 8.1.2419
|
||||
Problem: With a long file name the hit-enter prompt appears. (J. Lewis
|
||||
Muir)
|
||||
Solution: When checking for text to wrap don't do this when outputing a CR.
|
||||
Solution: When checking for text to wrap don't do this when outputting a CR.
|
||||
Files: src/message.c, src/testdir/test_display.vim,
|
||||
src/testdir/dumps/Test_long_file_name_1.dump
|
||||
|
||||
|
@ -186,7 +186,7 @@ behave mostly like Vi, even though a .vimrc file exists.
|
||||
.TP
|
||||
\-d
|
||||
Start in diff mode.
|
||||
There should be two, three or four file name arguments.
|
||||
There should between two to eight file name arguments.
|
||||
.B Vim
|
||||
will open all the files and show differences between them.
|
||||
Works like vimdiff(1).
|
||||
|
@ -135,9 +135,9 @@ OPTIONS
|
||||
Vim behave mostly like Vi, even though a .vimrc file ex‐
|
||||
ists.
|
||||
|
||||
-d Start in diff mode. There should be two, three or four
|
||||
file name arguments. Vim will open all the files and show
|
||||
differences between them. Works like vimdiff(1).
|
||||
-d Start in diff mode. There should between two to eight file
|
||||
name arguments. Vim will open all the files and show dif‐
|
||||
ferences between them. Works like vimdiff(1).
|
||||
|
||||
-d {device} Open {device} for use as a terminal. Only on the Amiga.
|
||||
Example: "-d con:20/30/600/150".
|
||||
|
@ -1,4 +1,4 @@
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2021 May 26
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2021 Aug 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -169,6 +169,14 @@ created yet. In this case you can call `execute()` to invoke it at runtime. >
|
||||
used for the command or inside a `:try` block), does not get a range passed
|
||||
cannot be a "dict" function, and can always be a closure.
|
||||
|
||||
Later classes will be added, which replaces the "dict function" mechanism.
|
||||
For now you will need to pass the dictionary explicitly: >
|
||||
def DictFunc(d: dict<any>, arg: string)
|
||||
echo d[arg]
|
||||
enddef
|
||||
var d = {item: 'value', func: DictFunc}
|
||||
d.func(d, 'item')
|
||||
|
||||
The argument types and return type need to be specified. The "any" type can
|
||||
be used, type checking will then be done at runtime, like with legacy
|
||||
functions.
|
||||
@ -313,6 +321,25 @@ used: >
|
||||
}
|
||||
echo temp # Error!
|
||||
|
||||
This is especially useful in a user command: >
|
||||
|
||||
command -range Rename {
|
||||
var save = @a
|
||||
@a = 'some expression'
|
||||
echo 'do something with ' .. @a
|
||||
@a = save
|
||||
}
|
||||
|
||||
And with autocommands: >
|
||||
|
||||
au BufWritePre *.go {
|
||||
var save = winsaveview()
|
||||
silent! exe ':%! some formatting command'
|
||||
winrestview(save)
|
||||
}
|
||||
|
||||
Although using a :def function probably works better.
|
||||
|
||||
Declaring a variable with a type but without an initializer will initialize to
|
||||
zero, false or empty.
|
||||
|
||||
@ -324,6 +351,9 @@ with `:unlet`.
|
||||
`:lockvar` does not work on local variables. Use `:const` and `:final`
|
||||
instead.
|
||||
|
||||
The `exists()` and `exists_compiled()` functions do not work on local variables
|
||||
or arguments.
|
||||
|
||||
Variables, functions and function arguments cannot shadow previously defined
|
||||
or imported variables and functions in the same script file.
|
||||
Variables may shadow Ex commands, rename the variable if needed.
|
||||
@ -343,6 +373,32 @@ called without "g:". >
|
||||
echo GlobalFunc()
|
||||
The "g:" prefix is not needed for auto-load functions.
|
||||
|
||||
*vim9-function-defined-later*
|
||||
Although global functions can be called without the "g:" prefix, they must
|
||||
exist when compiled. By adding the "g:" prefix the function can be defined
|
||||
later. Example: >
|
||||
def CallPluginFunc()
|
||||
if exists('g:loaded_plugin')
|
||||
g:PluginFunc()
|
||||
endif
|
||||
enddef
|
||||
|
||||
If you would do it like this you get an error at compile time that
|
||||
"PluginFunc" does not exist, even when "g:loaded_plugin" does not exist: >
|
||||
def CallPluginFunc()
|
||||
if exists('g:loaded_plugin')
|
||||
PluginFunc() # Error - function not found
|
||||
endif
|
||||
enddef
|
||||
|
||||
You can use exists_compiled() to avoid the error, but then the function would
|
||||
not be called, even when "g:loaded_plugin" is defined later: >
|
||||
def CallPluginFunc()
|
||||
if exists_compiled('g:loaded_plugin')
|
||||
PluginFunc() # Function may never be called
|
||||
endif
|
||||
enddef
|
||||
|
||||
Since `&opt = value` is now assigning a value to option "opt", ":&" cannot be
|
||||
used to repeat a `:substitute` command.
|
||||
*vim9-unpack-ignore*
|
||||
@ -418,6 +474,12 @@ line starts with `substitute(` this will use the function. Prepend a colon to
|
||||
use the command instead: >
|
||||
:substitute(pattern (replacement (
|
||||
|
||||
If the expression starts with "!" this is interpreted as a shell command, not
|
||||
negation of a condition. Thus this is a shell command: >
|
||||
!shellCommand->something
|
||||
Put the expression in parenthesis to use the "!" for negation: >
|
||||
(!expression)->Method()
|
||||
|
||||
Note that while variables need to be defined before they can be used,
|
||||
functions can be called before being defined. This is required to allow
|
||||
for cyclic dependencies between functions. It is slightly less efficient,
|
||||
@ -434,7 +496,8 @@ The function must already have been defined. >
|
||||
var Funcref = MyFunction
|
||||
|
||||
When using `function()` the resulting type is "func", a function with any
|
||||
number of arguments and any return type. The function can be defined later.
|
||||
number of arguments and any return type (including void). The function can be
|
||||
defined later.
|
||||
|
||||
|
||||
Lambda using => instead of -> ~
|
||||
@ -445,11 +508,12 @@ it is the start of a lambda or a dictionary, which is now more complicated
|
||||
because of the use of argument types.
|
||||
|
||||
To avoid these problems Vim9 script uses a different syntax for a lambda,
|
||||
which is similar to Javascript: >
|
||||
which is similar to JavaScript: >
|
||||
var Lambda = (arg) => expression
|
||||
|
||||
No line break is allowed in the arguments of a lambda up to and including the
|
||||
"=>". This is OK: >
|
||||
"=>" (so that Vim can tell the difference between an expression in parentheses
|
||||
and lambda arguments). This is OK: >
|
||||
filter(list, (k, v) =>
|
||||
v > 0)
|
||||
This does not work: >
|
||||
@ -522,7 +586,7 @@ And when a dict spans multiple lines: >
|
||||
one: 1,
|
||||
two: 2,
|
||||
}
|
||||
Function call: >
|
||||
With a function call: >
|
||||
var result = Func(
|
||||
arg1,
|
||||
arg2
|
||||
@ -555,10 +619,36 @@ at the start of the line indicates line continuation: >
|
||||
| echo 'match'
|
||||
| endif
|
||||
|
||||
< *E1050*
|
||||
Note that this means that in heredoc the first line cannot be a bar: >
|
||||
var lines =<< trim END
|
||||
| this doesn't work
|
||||
END
|
||||
Either use an empty line at the start or do not use heredoc. Or temporarily
|
||||
add the "C" flag to 'cpoptions': >
|
||||
set cpo+=C
|
||||
var lines =<< trim END
|
||||
| this doesn't work
|
||||
END
|
||||
set cpo-=C
|
||||
If the heredoc is inside a function 'cpoptions' must be set before :def and
|
||||
restored after the :enddef.
|
||||
|
||||
In places where line continuation with a backslash is still needed, such as
|
||||
splitting up a long Ex command, comments can start with '#\ ': >
|
||||
syn region Text
|
||||
\ start='foo'
|
||||
#\ comment
|
||||
\ end='bar'
|
||||
Like with legacy script '"\ ' is used. This is also needed when line
|
||||
continuation is used without a backslash and a line starts with a bar: >
|
||||
au CursorHold * echom 'BEFORE bar'
|
||||
#\ some comment
|
||||
| echom 'AFTER bar'
|
||||
<
|
||||
*E1050*
|
||||
To make it possible for the operator at the start of the line to be
|
||||
recognized, it is required to put a colon before a range. This will add
|
||||
"start" and print: >
|
||||
recognized, it is required to put a colon before a range. This example will
|
||||
add "start" and print: >
|
||||
var result = start
|
||||
+ print
|
||||
Like this: >
|
||||
@ -610,6 +700,9 @@ Notes:
|
||||
< This does not work: >
|
||||
echo [1, 2]
|
||||
[3, 4]
|
||||
- In some cases it is difficult for Vim to parse a command, especially when
|
||||
commands are used as an argument to another command, such as `windo`. In
|
||||
those cases the line continuation with a backslash has to be used.
|
||||
|
||||
|
||||
White space ~
|
||||
@ -648,6 +741,9 @@ White space is not allowed:
|
||||
arg # OK
|
||||
)
|
||||
|
||||
White space space is not allowed in a `:set` command between the option name
|
||||
and a following "&", "!", "<", "=", "+=", "-=" or "^=".
|
||||
|
||||
|
||||
No curly braces expansion ~
|
||||
|
||||
@ -870,7 +966,8 @@ evaluates to false: >
|
||||
use-feature
|
||||
endif
|
||||
enddef
|
||||
< *vim9-user-command*
|
||||
The `exists_compiled()` function can also be used for this.
|
||||
*vim9-user-command*
|
||||
Another side effect of compiling a function is that the presence of a user
|
||||
command is checked at compile time. If the user command is defined later an
|
||||
error will result. This works: >
|
||||
@ -904,6 +1001,16 @@ The 'gdefault' option value is not used.
|
||||
You may also find this wiki useful. It was written by an early adopter of
|
||||
Vim9 script: https://github.com/lacygoill/wiki/blob/master/vim/vim9.md
|
||||
|
||||
*:++* *:--*
|
||||
The ++ and -- commands have been added. They are very similar to adding or
|
||||
subtracting one: >
|
||||
++var
|
||||
var += 1
|
||||
--var
|
||||
var -= 1
|
||||
|
||||
Using ++var or --var in an expression is not supported yet.
|
||||
|
||||
==============================================================================
|
||||
|
||||
3. New style functions *fast-functions*
|
||||
@ -966,9 +1073,14 @@ prefix if they do not exist at the time of compiling.
|
||||
Note that for command line completion of {func} you
|
||||
can prepend "s:" to find script-local functions.
|
||||
|
||||
:disa[ssemble]! {func} Like `:disassemble` but with the instructions used for
|
||||
:disa[ssemble] profile {func}
|
||||
Like `:disassemble` but with the instructions used for
|
||||
profiling.
|
||||
|
||||
:disa[ssemble] debug {func}
|
||||
Like `:disassemble` but with the instructions used for
|
||||
debugging.
|
||||
|
||||
Limitations ~
|
||||
|
||||
Local variables will not be visible to string evaluation. For example: >
|
||||
@ -991,26 +1103,36 @@ For these the backtick expansion can be used. Example: >
|
||||
g/pattern/s/^/`=newText`/
|
||||
enddef
|
||||
|
||||
Or a script variable can be used: >
|
||||
var newText = 'blah'
|
||||
def Replace()
|
||||
g/pattern/s/^/\=newText/
|
||||
enddef
|
||||
|
||||
Closures defined in a loop will share the same context. For example: >
|
||||
var flist: list<func>
|
||||
for i in range(10)
|
||||
for i in range(5)
|
||||
var inloop = i
|
||||
flist[i] = () => inloop
|
||||
endfor
|
||||
echo range(5)->map((i, _) => flist[i]())
|
||||
# Result: [4, 4, 4, 4, 4]
|
||||
|
||||
The "inloop" variable will exist only once, all closures put in the list refer
|
||||
to the same instance, which in the end will have the value 9. This is
|
||||
efficient. If you do want a separate context for each closure call a function
|
||||
to define it: >
|
||||
def GetFunc(i: number): func
|
||||
var inloop = i
|
||||
return () => inloop
|
||||
to the same instance, which in the end will have the value 4. This is
|
||||
efficient, also when looping many times. If you do want a separate context
|
||||
for each closure call a function to define it: >
|
||||
def GetClosure(i: number): func
|
||||
var infunc = i
|
||||
return () => infunc
|
||||
enddef
|
||||
|
||||
var flist: list<func>
|
||||
for i in range(10)
|
||||
flist[i] = GetFunc(i)
|
||||
for i in range(5)
|
||||
flist[i] = GetClosure(i)
|
||||
endfor
|
||||
echo range(5)->map((i, _) => flist[i]())
|
||||
# Result: [0, 1, 2, 3, 4]
|
||||
|
||||
==============================================================================
|
||||
|
||||
@ -1036,10 +1158,8 @@ The following builtin types are supported:
|
||||
Not supported yet:
|
||||
tuple<a: {type}, b: {type}, ...>
|
||||
|
||||
These types can be used in declarations, but no value will have this type:
|
||||
{type}|{type} {not implemented yet}
|
||||
void
|
||||
any
|
||||
These types can be used in declarations, but no simple value will actually
|
||||
have the "void" type.
|
||||
|
||||
There is no array type, use list<{type}> instead. For a list constant an
|
||||
efficient implementation is used that avoids allocating lot of small pieces of
|
||||
@ -1048,8 +1168,16 @@ memory.
|
||||
A partial and function can be declared in more or less specific ways:
|
||||
func any kind of function reference, no type
|
||||
checking for arguments or return value
|
||||
func: void any number and type of arguments, no return
|
||||
value
|
||||
func: {type} any number and type of arguments with specific
|
||||
return type
|
||||
|
||||
func() function with no argument, does not return a
|
||||
value
|
||||
func(): void same
|
||||
func(): {type} function with no argument and return type
|
||||
|
||||
func({type}) function with argument type, does not return
|
||||
a value
|
||||
func({type}): {type} function with argument type and return type
|
||||
@ -1138,6 +1266,18 @@ dictionary. If there is a mix of types, the "any" type is used. >
|
||||
['a', 'b', 'c'] list<string>
|
||||
[1, 'x', 3] list<any>
|
||||
|
||||
The common type of function references, if they do not all have the same
|
||||
number of arguments, uses "(...)" to indicate the number of arguments is not
|
||||
specified. For example: >
|
||||
def Foo(x: bool)
|
||||
enddef
|
||||
def Bar(x: bool, y: bool)
|
||||
enddef
|
||||
var funclist = [Foo, Bar]
|
||||
echo funclist->typename()
|
||||
Results in:
|
||||
list<func(...)>
|
||||
|
||||
For script-local variables in Vim9 script the type is checked, also when the
|
||||
variable was declared in a legacy function.
|
||||
|
||||
@ -1154,16 +1294,24 @@ In Vim9 script this has been made stricter. In most places it works just as
|
||||
before, if the value used matches the expected type. There will sometimes be
|
||||
an error, thus breaking backwards compatibility. For example:
|
||||
- Using a number other than 0 or 1 where a boolean is expected. *E1023*
|
||||
- Using a string value when setting a number options.
|
||||
- Using a string value when setting a number option.
|
||||
- Using a number where a string is expected. *E1024*
|
||||
|
||||
One consequence is that the item type of a list or dict given to map() must
|
||||
not change. This will give an error in Vim9 script: >
|
||||
map([1, 2, 3], (i, v) => 'item ' .. i)
|
||||
vim9 echo map([1, 2, 3], (i, v) => 'item ' .. i)
|
||||
E1012: Type mismatch; expected number but got string
|
||||
Instead use |mapnew()|. If the item type was determined to be "any" it can
|
||||
change to a more specific type. E.g. when a list of mixed types gets changed
|
||||
to a list of numbers.
|
||||
Instead use |mapnew(): >
|
||||
vim9 echo mapnew([1, 2, 3], (i, v) => 'item ' .. i)
|
||||
['item 0', 'item 1', 'item 2']
|
||||
|
||||
If the item type was determined to be "any" it can change to a more specific
|
||||
type. E.g. when a list of mixed types gets changed to a list of numbers: >
|
||||
var mylist = [1, 2.0, '3']
|
||||
# typename(mylist) == "list<any>"
|
||||
map(mylist, (i, v) => 'item ' .. i)
|
||||
# typename(mylist) == "list<string>", no error
|
||||
|
||||
Same for |extend()|, use |extendnew()| instead, and for |flatten()|, use
|
||||
|flattennew()| instead.
|
||||
|
||||
@ -1240,9 +1388,10 @@ Exporting an item can be written as: >
|
||||
export const someValue = ...
|
||||
export def MyFunc() ...
|
||||
export class MyClass ...
|
||||
export interface MyClass ...
|
||||
|
||||
As this suggests, only constants, variables, `:def` functions and classes can
|
||||
be exported. {not implemented yet: export class}
|
||||
be exported. {not implemented yet: class, interface}
|
||||
|
||||
*E1042*
|
||||
`:export` can only be used in Vim9 script, at the script level.
|
||||
@ -1273,6 +1422,9 @@ script file to avoid confusion.
|
||||
`:import` can also be used in legacy Vim script. The imported items still
|
||||
become script-local, even when the "s:" prefix is not given.
|
||||
|
||||
`:import` can not be used in a function. Imported items are intended to exist
|
||||
at the script level and only imported once.
|
||||
|
||||
The script name after `import` can be:
|
||||
- A relative path, starting "." or "..". This finds a file relative to the
|
||||
location of the script file itself. This is useful to split up a large
|
||||
@ -1282,6 +1434,7 @@ The script name after `import` can be:
|
||||
- A path not being relative or absolute. This will be found in the
|
||||
"import" subdirectories of 'runtimepath' entries. The name will usually be
|
||||
longer and unique, to avoid loading the wrong file.
|
||||
Note that "after/import" is not used.
|
||||
|
||||
Once a vim9 script file has been imported, the result is cached and used the
|
||||
next time the same script is imported. It will not be read again.
|
||||
@ -1342,27 +1495,46 @@ implementing classes is going to be a lot of work, it is left for the future.
|
||||
For now we'll just make sure classes can be added later.
|
||||
|
||||
Thoughts:
|
||||
- `class` / `endclass`, everything in one file
|
||||
- Class names are always CamelCase
|
||||
- Single constructor
|
||||
- `class` / `endclass`, the whole class must be in one file
|
||||
- Class names are always CamelCase (to avoid a name clash with builtin types)
|
||||
- A single constructor called "constructor"
|
||||
- Single inheritance with `class ThisClass extends BaseClass`
|
||||
- `abstract class`
|
||||
- `interface` (Abstract class without any implementation)
|
||||
- `abstract class` (class with incomplete implementation)
|
||||
- `interface` / `endinterface` (abstract class without any implementation)
|
||||
- `class SomeClass implements SomeInterface`
|
||||
- Generics for class: `class <Tkey, Tentry>`
|
||||
- Generics for function: `def <Tkey> GetLast(key: Tkey)`
|
||||
|
||||
Again, much of this is from TypeScript.
|
||||
Again, much of this is from TypeScript with a slightly different syntax.
|
||||
|
||||
Some things that look like good additions:
|
||||
- Use a class as an interface (like Dart)
|
||||
- Extend a class with methods, using an import (like Dart)
|
||||
- Mixins
|
||||
- For testing: Mock mechanism
|
||||
|
||||
An important class that will be provided is "Promise". Since Vim is single
|
||||
threaded, connecting asynchronous operations is a natural way of allowing
|
||||
plugins to do their work without blocking the user. It's a uniform way to
|
||||
invoke callbacks and handle timeouts and errors.
|
||||
|
||||
Some examples: >
|
||||
|
||||
abstract class Person
|
||||
static const prefix = 'xxx'
|
||||
var name: string
|
||||
|
||||
def constructor(name: string)
|
||||
this.name = name
|
||||
enddef
|
||||
|
||||
def display(): void
|
||||
echo name
|
||||
enddef
|
||||
|
||||
abstract def find(string): Person
|
||||
endclass
|
||||
|
||||
==============================================================================
|
||||
|
||||
9. Rationale *vim9-rationale*
|
||||
|
@ -1,17 +1,17 @@
|
||||
.TH VIMDIFF 1 "2001 March 30"
|
||||
.SH NAME
|
||||
vimdiff \- edit two, three or four versions of a file with Vim and show differences
|
||||
vimdiff \- edit between two and eight versions of a file with Vim and show differences
|
||||
.SH SYNOPSIS
|
||||
.br
|
||||
.B vimdiff
|
||||
[options] file1 file2 [file3 [file4]]
|
||||
[options] file1 file2 [file3 [file4 [file5 [file6 [file7 [file8]]]]]]
|
||||
.PP
|
||||
.B gvimdiff
|
||||
.SH DESCRIPTION
|
||||
.B Vimdiff
|
||||
starts
|
||||
.B Vim
|
||||
on two (or three or four) files.
|
||||
on two up to eight files.
|
||||
Each file gets its own window.
|
||||
The differences between the files are highlighted.
|
||||
This is a nice way to inspect changes and to move changes from one version
|
||||
|
@ -1,27 +1,28 @@
|
||||
VIMDIFF(1) VIMDIFF(1)
|
||||
VIMDIFF(1) General Commands Manual VIMDIFF(1)
|
||||
|
||||
|
||||
|
||||
NAME
|
||||
vimdiff - edit two, three or four versions of a file with Vim and show
|
||||
differences
|
||||
vimdiff - edit between two and eight versions of a file with Vim and
|
||||
show differences
|
||||
|
||||
SYNOPSIS
|
||||
vimdiff [options] file1 file2 [file3 [file4]]
|
||||
vimdiff [options] file1 file2 [file3 [file4 [file5 [file6 [file7
|
||||
[file8]]]]]]
|
||||
|
||||
gvimdiff
|
||||
|
||||
DESCRIPTION
|
||||
Vimdiff starts Vim on two (or three or four) files. Each file gets its
|
||||
own window. The differences between the files are highlighted. This
|
||||
is a nice way to inspect changes and to move changes from one version
|
||||
to another version of the same file.
|
||||
Vimdiff starts Vim on two up to eight files. Each file gets its own
|
||||
window. The differences between the files are highlighted. This is a
|
||||
nice way to inspect changes and to move changes from one version to an‐
|
||||
other version of the same file.
|
||||
|
||||
See vim(1) for details about Vim itself.
|
||||
|
||||
When started as gvimdiff the GUI will be started, if available.
|
||||
|
||||
In each window the 'diff' option will be set, which causes the differ-
|
||||
In each window the 'diff' option will be set, which causes the differ‐
|
||||
ences to be highlighted.
|
||||
The 'wrap' and 'scrollbind' options are set to make the text look good.
|
||||
The 'foldmethod' option is set to "diff", which puts ranges of lines
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Apr 17
|
||||
" Last Change: 2021 Jul 03
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@ -393,7 +393,7 @@ au BufNewFile,BufRead *.cfm,*.cfi,*.cfc setf cf
|
||||
" Configure scripts
|
||||
au BufNewFile,BufRead configure.in,configure.ac setf config
|
||||
|
||||
" CUDA Cumpute Unified Device Architecture
|
||||
" CUDA Compute Unified Device Architecture
|
||||
au BufNewFile,BufRead *.cu,*.cuh setf cuda
|
||||
|
||||
" Dockerfile; Podman uses the same syntax with name Containerfile
|
||||
@ -408,8 +408,15 @@ au BufNewFile,BufRead *enlightenment/*.cfg setf c
|
||||
" Eterm
|
||||
au BufNewFile,BufRead *Eterm/*.cfg setf eterm
|
||||
|
||||
" Elixir or Euphoria
|
||||
au BufNewFile,BufRead *.ex call dist#ft#ExCheck()
|
||||
|
||||
" Elixir
|
||||
au BufRead,BufNewFile mix.lock,*.exs setf elixir
|
||||
au BufRead,BufNewFile *.eex,*.leex setf eelixir
|
||||
|
||||
" Euphoria 3 or 4
|
||||
au BufNewFile,BufRead *.eu,*.ew,*.ex,*.exu,*.exw call dist#ft#EuphoriaCheck()
|
||||
au BufNewFile,BufRead *.eu,*.ew,*.exu,*.exw call dist#ft#EuphoriaCheck()
|
||||
if has("fname_case")
|
||||
au BufNewFile,BufRead *.EU,*.EW,*.EX,*.EXU,*.EXW call dist#ft#EuphoriaCheck()
|
||||
endif
|
||||
@ -643,6 +650,9 @@ au BufNewFile,BufRead *.mo,*.gdmo setf gdmo
|
||||
" Gedcom
|
||||
au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom
|
||||
|
||||
" Gemtext
|
||||
au BufNewFile,BufRead *.gmi,*.gemini setf gemtext
|
||||
|
||||
" Gift (Moodle)
|
||||
autocmd BufRead,BufNewFile *.gift setf gift
|
||||
|
||||
@ -855,6 +865,18 @@ au BufNewFile,BufRead *.jov,*.j73,*.jovial setf jovial
|
||||
" JSON
|
||||
au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest setf json
|
||||
|
||||
" JSON Patch (RFC 6902)
|
||||
au BufNewFile,BufRead *.json-patch setf json
|
||||
|
||||
" Jupyter Notebook is also json
|
||||
au BufNewFile,BufRead *.ipynb setf json
|
||||
|
||||
" JSONC
|
||||
au BufNewFile,BufRead *.jsonc setf jsonc
|
||||
|
||||
" Julia
|
||||
au BufNewFile,BufRead *.jl setf julia
|
||||
|
||||
" Kixtart
|
||||
au BufNewFile,BufRead *.kix setf kix
|
||||
|
||||
@ -1504,6 +1526,9 @@ au BufNewFile,BufRead *.sbt setf sbt
|
||||
" Scilab
|
||||
au BufNewFile,BufRead *.sci,*.sce setf scilab
|
||||
|
||||
" scdoc
|
||||
au BufNewFile,BufRead *.scd setf scdoc
|
||||
|
||||
" SCSS
|
||||
au BufNewFile,BufRead *.scss setf scss
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
" Last Change: 2018-03-05
|
||||
" Author: Evan Hanson <evhan@foldling.org>
|
||||
" Maintainer: Evan Hanson <evhan@foldling.org>
|
||||
" Repository: https://git.foldling.org/vim-scheme.git
|
||||
" URL: https://foldling.org/vim/ftplugin/chicken.vim
|
||||
" Notes: These are supplemental settings, to be loaded after the core
|
||||
" Scheme ftplugin file (ftplugin/scheme.vim). Enable it by setting
|
||||
|
@ -3,7 +3,7 @@
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2019 Jan 06
|
||||
" Last Change: 2020 Jun 28
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@ -118,7 +118,7 @@ endif
|
||||
" TODO: comments=
|
||||
setlocal commentstring=<%#%s%>
|
||||
|
||||
let b:undo_ftplugin = "setl cms< "
|
||||
let b:undo_ftplugin = "setl cms< " .
|
||||
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
|
27
runtime/ftplugin/jsonc.vim
Normal file
27
runtime/ftplugin/jsonc.vim
Normal file
@ -0,0 +1,27 @@
|
||||
" Vim filetype plugin
|
||||
" Language: JSONC (JSON with Comments)
|
||||
" Original Author: Izhak Jakov <izhak724@gmail.com>
|
||||
" Acknowledgement: Based off of vim-jsonc maintained by Kevin Locke <kevin@kevinlocke.name>
|
||||
" https://github.com/kevinoid/vim-jsonc
|
||||
" License: MIT
|
||||
" Last Change: 2021-07-01
|
||||
|
||||
runtime! ftplugin/json.vim
|
||||
|
||||
if exists('b:did_ftplugin_jsonc')
|
||||
finish
|
||||
else
|
||||
let b:did_ftplugin_jsonc = 1
|
||||
endif
|
||||
|
||||
" A list of commands that undo buffer local changes made below.
|
||||
let s:undo_ftplugin = []
|
||||
|
||||
" Set comment (formatting) related options. {{{1
|
||||
setlocal commentstring=//%s comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
|
||||
call add(s:undo_ftplugin, 'commentstring< comments<')
|
||||
|
||||
" Let Vim know how to disable the plug-in.
|
||||
call map(s:undo_ftplugin, "'execute ' . string(v:val)")
|
||||
let b:undo_ftplugin = join(s:undo_ftplugin, ' | ')
|
||||
unlet s:undo_ftplugin
|
92
runtime/ftplugin/julia.vim
Normal file
92
runtime/ftplugin/julia.vim
Normal file
@ -0,0 +1,92 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Julia
|
||||
" Maintainer: Carlo Baldassi <carlobaldassi@gmail.com>
|
||||
" Homepage: https://github.com/JuliaEditorSupport/julia-vim
|
||||
" Last Change: 2021 Aug 04
|
||||
" adapted from upstream 2021 Aug 4
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo-=C
|
||||
|
||||
setlocal include=^\\s*\\%(reload\\\|include\\)\\>
|
||||
setlocal suffixesadd=.jl
|
||||
setlocal comments=:#
|
||||
setlocal commentstring=#\ %s
|
||||
setlocal cinoptions+=#1
|
||||
setlocal define=^\\s*macro\\>
|
||||
setlocal fo-=t fo+=croql
|
||||
|
||||
let b:julia_vim_loaded = 1
|
||||
|
||||
let b:undo_ftplugin = "setlocal include< suffixesadd< comments< commentstring<"
|
||||
\ . " define< fo< shiftwidth< expandtab< indentexpr< indentkeys< cinoptions< completefunc<"
|
||||
\ . " | unlet! b:julia_vim_loaded"
|
||||
|
||||
" MatchIt plugin support
|
||||
if exists("loaded_matchit")
|
||||
let b:match_ignorecase = 0
|
||||
|
||||
" note: begin_keywords must contain all blocks, in order
|
||||
" for nested-structures-skipping to work properly
|
||||
" note: 'mutable struct' and 'struct' are defined separately because
|
||||
" using \? puts the cursor on 'struct' instead of 'mutable' for some reason
|
||||
let b:julia_begin_keywords = '\%(\.\s*\|@\)\@<!\<\%(function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@<!struct\|\%(abstract\|primitive\)\s\+type\|let\|do\|\%(bare\)\?module\|quote\|if\|for\|while\|try\)\>'
|
||||
" note: the following regex not only recognizes macros, but also local/global keywords.
|
||||
" the purpose is recognizing things like `@inline myfunction()`
|
||||
" or `global myfunction(...)` etc, for matchit and block movement functionality
|
||||
let s:macro_regex = '\%(@\%([#(]\@!\S\)\+\|\<\%(local\|global\)\)\s\+'
|
||||
let s:nomacro = '\%(' . s:macro_regex . '\)\@<!'
|
||||
let s:yesmacro = s:nomacro . '\%('. s:macro_regex . '\)\+'
|
||||
let b:julia_begin_keywordsm = '\%(' . s:yesmacro . b:julia_begin_keywords . '\)\|'
|
||||
\ . '\%(' . s:nomacro . b:julia_begin_keywords . '\)'
|
||||
let b:julia_end_keywords = '\<end\>'
|
||||
|
||||
" note: this function relies heavily on the syntax file
|
||||
function! JuliaGetMatchWords()
|
||||
let [l,c] = [line('.'),col('.')]
|
||||
let attr = synIDattr(synID(l, c, 1),"name")
|
||||
let c1 = c
|
||||
while attr == 'juliaMacro' || expand('<cword>') =~# '\<\%(global\|local\)\>'
|
||||
normal! W
|
||||
if line('.') > l || col('.') == c1
|
||||
call cursor(l, c)
|
||||
return ''
|
||||
endif
|
||||
let attr = synIDattr(synID(l, col('.'), 1),"name")
|
||||
let c1 = col('.')
|
||||
endwhile
|
||||
call cursor(l, c)
|
||||
if attr == 'juliaConditional'
|
||||
return b:julia_begin_keywordsm . ':\<\%(elseif\|else\)\>:' . b:julia_end_keywords
|
||||
elseif attr =~# '\<\%(juliaRepeat\|juliaRepKeyword\)\>'
|
||||
return b:julia_begin_keywordsm . ':\<\%(break\|continue\)\>:' . b:julia_end_keywords
|
||||
elseif attr == 'juliaBlKeyword'
|
||||
return b:julia_begin_keywordsm . ':' . b:julia_end_keywords
|
||||
elseif attr == 'juliaException'
|
||||
return b:julia_begin_keywordsm . ':\<\%(catch\|finally\)\>:' . b:julia_end_keywords
|
||||
endif
|
||||
return '\<\>:\<\>'
|
||||
endfunction
|
||||
|
||||
let b:match_words = 'JuliaGetMatchWords()'
|
||||
|
||||
" we need to skip everything within comments, strings and
|
||||
" the 'begin' and 'end' keywords when they are used as a range rather than as
|
||||
" the delimiter of a block
|
||||
let b:match_skip = 'synIDattr(synID(line("."),col("."),0),"name") =~# '
|
||||
\ . '"\\<julia\\%(Comprehension\\%(For\\|If\\)\\|RangeKeyword\\|Comment\\%([LM]\\|Delim\\)\\|\\%([bs]\\|Shell\\|Printf\\|Doc\\)\\?String\\|StringPrefixed\\|DocStringM\\(Raw\\)\\?\\|RegEx\\|SymbolS\\?\\|Dotted\\)\\>"'
|
||||
|
||||
let b:undo_ftplugin = b:undo_ftplugin
|
||||
\ . " | unlet! b:match_words b:match_skip b:match_ignorecase"
|
||||
\ . " | unlet! b:julia_begin_keywords b:julia_end_keywords"
|
||||
\ . " | delfunction JuliaGetMatchWords"
|
||||
|
||||
endif
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
@ -3,7 +3,7 @@
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2019 Nov 06
|
||||
" Last Change: 2020 Feb 13
|
||||
|
||||
if (exists("b:did_ftplugin"))
|
||||
finish
|
||||
@ -112,7 +112,7 @@ else
|
||||
if !exists('g:ruby_default_path')
|
||||
if has("ruby") && has("win32")
|
||||
ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) )
|
||||
elseif executable('ruby')
|
||||
elseif executable('ruby') && !empty($HOME)
|
||||
let g:ruby_default_path = s:query_path($HOME)
|
||||
else
|
||||
let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val')
|
||||
|
26
runtime/ftplugin/scdoc.vim
Normal file
26
runtime/ftplugin/scdoc.vim
Normal file
@ -0,0 +1,26 @@
|
||||
" scdoc filetype plugin
|
||||
" Maintainer: Gregory Anders <greg@gpanders.com>
|
||||
" Last Updated: 2021-08-04
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal comments=b:;
|
||||
setlocal commentstring=;%s
|
||||
setlocal formatoptions+=t
|
||||
setlocal noexpandtab
|
||||
setlocal shiftwidth=0
|
||||
setlocal softtabstop=0
|
||||
setlocal textwidth=80
|
||||
|
||||
let b:undo_ftplugin = 'setl com< cms< fo< et< sw< sts< tw<'
|
||||
|
||||
if has('conceal')
|
||||
setlocal conceallevel=2
|
||||
let b:undo_ftplugin .= ' cole<'
|
||||
endif
|
@ -1,9 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Scheme (R7RS)
|
||||
" Last Change: 2019 Nov 18
|
||||
" Last Change: 2019-11-19
|
||||
" Author: Evan Hanson <evhan@foldling.org>
|
||||
" Maintainer: Evan Hanson <evhan@foldling.org>
|
||||
" Previous Maintainer: Sergey Khorev <sergey.khorev@gmail.com>
|
||||
" Repository: https://git.foldling.org/vim-scheme.git
|
||||
" URL: https://foldling.org/vim/ftplugin/scheme.vim
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
@ -48,7 +49,7 @@ let b:undo_ftplugin = b:undo_ftplugin . ' lispwords<'
|
||||
let b:did_scheme_ftplugin = 1
|
||||
|
||||
if exists('b:is_chicken') || exists('g:is_chicken')
|
||||
exe 'ru! ftplugin/chicken.vim'
|
||||
runtime! ftplugin/chicken.vim
|
||||
endif
|
||||
|
||||
unlet b:did_scheme_ftplugin
|
||||
|
@ -5,6 +5,7 @@
|
||||
Name[de]=GVim
|
||||
Name[eo]=GVim
|
||||
Name[fr]=GVim
|
||||
Name[it]=GVim
|
||||
Name[ru]=GVim
|
||||
Name[sr]=GVim
|
||||
Name[tr]=GVim
|
||||
@ -13,6 +14,7 @@ Name=GVim
|
||||
GenericName[de]=Texteditor
|
||||
GenericName[eo]=Tekstoredaktilo
|
||||
GenericName[fr]=Éditeur de texte
|
||||
GenericName[it]=Editor di testi
|
||||
GenericName[ja]=テキストエディタ
|
||||
GenericName[ru]=Текстовый редактор
|
||||
GenericName[sr]=Едитор текст
|
||||
@ -22,6 +24,7 @@ GenericName=Text Editor
|
||||
Comment[de]=Textdateien bearbeiten
|
||||
Comment[eo]=Redakti tekstajn dosierojn
|
||||
Comment[fr]=Éditer des fichiers texte
|
||||
Comment[it]=Edita file di testo
|
||||
Comment[ja]=テキストファイルを編集します
|
||||
Comment[ru]=Редактирование текстовых файлов
|
||||
Comment[sr]=Уређујте текст фајлове
|
||||
@ -60,7 +63,6 @@ Comment[hr]=Uređivanje tekstualne datoteke
|
||||
Comment[hu]=Szövegfájlok szerkesztése
|
||||
Comment[id]=Edit file teks
|
||||
Comment[is]=Vinna með textaskrár
|
||||
Comment[it]=Modifica file di testo
|
||||
Comment[kn]=ಪಠ್ಯ ಕಡತಗಳನ್ನು ಸಂಪಾದಿಸು
|
||||
Comment[ko]=텍스트 파일을 편집합니다
|
||||
Comment[lt]=Redaguoti tekstines bylas
|
||||
@ -102,16 +104,13 @@ Type=Application
|
||||
Keywords[de]=Text;Editor;
|
||||
Keywords[eo]=Teksto;redaktilo;
|
||||
Keywords[fr]=Texte;éditeur;
|
||||
Keywords[it]=Testo;editor;
|
||||
Keywords[ja]=テキスト;エディタ;
|
||||
Keywords[ru]=текст;текстовый редактор;
|
||||
Keywords[sr]=Текст;едитор;
|
||||
Keywords[tr]=Metin;düzenleyici;
|
||||
Keywords=Text;editor;
|
||||
# Translators: This is the Icon file name. Do NOT translate
|
||||
Icon[de]=gvim
|
||||
Icon[eo]=gvim
|
||||
Icon[fr]=gvim
|
||||
Icon[ru]=gvim
|
||||
Icon=gvim
|
||||
Categories=Utility;TextEditor;
|
||||
StartupNotify=true
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: Bazel (http://bazel.io)
|
||||
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
|
||||
" Last Change: 2017 Jun 13
|
||||
" Last Change: 2021 Jul 08
|
||||
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
@ -41,30 +41,41 @@ function GetBzlIndent(lnum) abort
|
||||
if exists('g:pyindent_open_paren')
|
||||
let l:pyindent_open_paren = g:pyindent_open_paren
|
||||
endif
|
||||
let g:pyindent_nested_paren = 'shiftwidth() * 2'
|
||||
let g:pyindent_open_paren = 'shiftwidth() * 2'
|
||||
let g:pyindent_nested_paren = 'shiftwidth()'
|
||||
let g:pyindent_open_paren = 'shiftwidth()'
|
||||
endif
|
||||
|
||||
let l:indent = -1
|
||||
|
||||
" Indent inside parens.
|
||||
" Align with the open paren unless it is at the end of the line.
|
||||
" E.g.
|
||||
" open_paren_not_at_EOL(100,
|
||||
" (200,
|
||||
" 300),
|
||||
" 400)
|
||||
" open_paren_at_EOL(
|
||||
" 100, 200, 300, 400)
|
||||
call cursor(a:lnum, 1)
|
||||
let [l:par_line, l:par_col] = searchpairpos('(\|{\|\[', '', ')\|}\|\]', 'bW',
|
||||
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" .
|
||||
\ " synIDattr(synID(line('.'), col('.'), 1), 'name')" .
|
||||
\ " =~ '\\(Comment\\|String\\)$'")
|
||||
if l:par_line > 0
|
||||
call cursor(l:par_line, 1)
|
||||
if l:par_col != col('$') - 1
|
||||
let l:indent = l:par_col
|
||||
" Indent inside parens.
|
||||
if searchpair('(\|{\|\[', '', ')\|}\|\]', 'W',
|
||||
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" .
|
||||
\ " synIDattr(synID(line('.'), col('.'), 1), 'name')" .
|
||||
\ " =~ '\\(Comment\\|String\\)$'") && line('.') == a:lnum
|
||||
" If cursor is at close parens, match indent with open parens.
|
||||
" E.g.
|
||||
" foo(
|
||||
" )
|
||||
let l:indent = indent(l:par_line)
|
||||
else
|
||||
" Align with the open paren unless it is at the end of the line.
|
||||
" E.g.
|
||||
" open_paren_not_at_EOL(100,
|
||||
" (200,
|
||||
" 300),
|
||||
" 400)
|
||||
" open_paren_at_EOL(
|
||||
" 100, 200, 300, 400)
|
||||
call cursor(l:par_line, 1)
|
||||
if l:par_col != col('$') - 1
|
||||
let l:indent = l:par_col
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim indent script for HTML
|
||||
" Maintainer: Bram Moolenaar
|
||||
" Original Author: Andy Wokula <anwoku@yahoo.de>
|
||||
" Last Change: 2021 Jan 26
|
||||
" Last Change: 2021 Jun 13
|
||||
" Version: 1.0 "{{{
|
||||
" Description: HTML indent script with cached state for faster indenting on a
|
||||
" range of lines.
|
||||
@ -62,7 +62,7 @@ let s:tagname = '\w\+\(-\w\+\)*'
|
||||
" Prefer using buffer-local settings over global settings, so that there can
|
||||
" be defaults for all HTML files and exceptions for specific types of HTML
|
||||
" files.
|
||||
func! HtmlIndent_CheckUserSettings()
|
||||
func HtmlIndent_CheckUserSettings()
|
||||
"{{{
|
||||
let inctags = ''
|
||||
if exists("b:html_indent_inctags")
|
||||
@ -178,7 +178,7 @@ let s:endtags = [0,0,0,0,0,0,0] " long enough for the highest index
|
||||
"}}}
|
||||
|
||||
" Add a list of tag names for a pair of <tag> </tag> to "tags".
|
||||
func! s:AddITags(tags, taglist)
|
||||
func s:AddITags(tags, taglist)
|
||||
"{{{
|
||||
for itag in a:taglist
|
||||
let a:tags[itag] = 1
|
||||
@ -187,7 +187,7 @@ func! s:AddITags(tags, taglist)
|
||||
endfunc "}}}
|
||||
|
||||
" Take a list of tag name pairs that are not to be used as tag pairs.
|
||||
func! s:RemoveITags(tags, taglist)
|
||||
func s:RemoveITags(tags, taglist)
|
||||
"{{{
|
||||
for itag in a:taglist
|
||||
let a:tags[itag] = 1
|
||||
@ -196,7 +196,7 @@ func! s:RemoveITags(tags, taglist)
|
||||
endfunc "}}}
|
||||
|
||||
" Add a block tag, that is a tag with a different kind of indenting.
|
||||
func! s:AddBlockTag(tag, id, ...)
|
||||
func s:AddBlockTag(tag, id, ...)
|
||||
"{{{
|
||||
if !(a:id >= 2 && a:id < len(s:endtags))
|
||||
echoerr 'AddBlockTag ' . a:id
|
||||
@ -255,7 +255,7 @@ call s:AddBlockTag('<!--[', 6, '![endif]-->')
|
||||
" Return non-zero when "tagname" is an opening tag, not being a block tag, for
|
||||
" which there should be a closing tag. Can be used by scripts that include
|
||||
" HTML indenting.
|
||||
func! HtmlIndent_IsOpenTag(tagname)
|
||||
func HtmlIndent_IsOpenTag(tagname)
|
||||
"{{{
|
||||
if get(s:indent_tags, a:tagname) == 1
|
||||
return 1
|
||||
@ -264,7 +264,7 @@ func! HtmlIndent_IsOpenTag(tagname)
|
||||
endfunc "}}}
|
||||
|
||||
" Get the value for "tagname", taking care of buffer-local tags.
|
||||
func! s:get_tag(tagname)
|
||||
func s:get_tag(tagname)
|
||||
"{{{
|
||||
let i = get(s:indent_tags, a:tagname)
|
||||
if (i == 1 || i == -1) && get(b:hi_removed_tags, a:tagname) != 0
|
||||
@ -277,7 +277,7 @@ func! s:get_tag(tagname)
|
||||
endfunc "}}}
|
||||
|
||||
" Count the number of start and end tags in "text".
|
||||
func! s:CountITags(text)
|
||||
func s:CountITags(text)
|
||||
"{{{
|
||||
" Store the result in s:curind and s:nextrel.
|
||||
let s:curind = 0 " relative indent steps for current line [unit &sw]:
|
||||
@ -289,7 +289,7 @@ func! s:CountITags(text)
|
||||
endfunc "}}}
|
||||
|
||||
" Count the number of start and end tags in text.
|
||||
func! s:CountTagsAndState(text)
|
||||
func s:CountTagsAndState(text)
|
||||
"{{{
|
||||
" Store the result in s:curind and s:nextrel. Update b:hi_newstate.block.
|
||||
let s:curind = 0 " relative indent steps for current line [unit &sw]:
|
||||
@ -304,7 +304,7 @@ func! s:CountTagsAndState(text)
|
||||
endfunc "}}}
|
||||
|
||||
" Used by s:CountITags() and s:CountTagsAndState().
|
||||
func! s:CheckTag(itag)
|
||||
func s:CheckTag(itag)
|
||||
"{{{
|
||||
" Returns an empty string or "SCRIPT".
|
||||
" a:itag can be "tag" or "/tag" or "<!--" or "-->"
|
||||
@ -338,7 +338,7 @@ func! s:CheckTag(itag)
|
||||
endfunc "}}}
|
||||
|
||||
" Used by s:CheckTag(). Returns an empty string or "SCRIPT".
|
||||
func! s:CheckBlockTag(blocktag, ind)
|
||||
func s:CheckBlockTag(blocktag, ind)
|
||||
"{{{
|
||||
if a:ind > 0
|
||||
" a block starts here
|
||||
@ -366,7 +366,7 @@ func! s:CheckBlockTag(blocktag, ind)
|
||||
endfunc "}}}
|
||||
|
||||
" Used by s:CheckTag().
|
||||
func! s:CheckCustomTag(ctag)
|
||||
func s:CheckCustomTag(ctag)
|
||||
"{{{
|
||||
" Returns 1 if ctag is the tag for a custom element, 0 otherwise.
|
||||
" a:ctag can be "tag" or "/tag" or "<!--" or "-->"
|
||||
@ -396,7 +396,7 @@ func! s:CheckCustomTag(ctag)
|
||||
endfunc "}}}
|
||||
|
||||
" Return the <script> type: either "javascript" or ""
|
||||
func! s:GetScriptType(str)
|
||||
func s:GetScriptType(str)
|
||||
"{{{
|
||||
if a:str == "" || a:str =~ "java"
|
||||
return "javascript"
|
||||
@ -407,7 +407,7 @@ endfunc "}}}
|
||||
|
||||
" Look back in the file, starting at a:lnum - 1, to compute a state for the
|
||||
" start of line a:lnum. Return the new state.
|
||||
func! s:FreshState(lnum)
|
||||
func s:FreshState(lnum)
|
||||
"{{{
|
||||
" A state is to know ALL relevant details about the
|
||||
" lines 1..a:lnum-1, initial calculating (here!) can be slow, but updating is
|
||||
@ -568,24 +568,29 @@ func! s:FreshState(lnum)
|
||||
endfunc "}}}
|
||||
|
||||
" Indent inside a <pre> block: Keep indent as-is.
|
||||
func! s:Alien2()
|
||||
func s:Alien2()
|
||||
"{{{
|
||||
return -1
|
||||
endfunc "}}}
|
||||
|
||||
" Return the indent inside a <script> block for javascript.
|
||||
func! s:Alien3()
|
||||
func s:Alien3()
|
||||
"{{{
|
||||
let lnum = prevnonblank(v:lnum - 1)
|
||||
while lnum > 1 && getline(lnum) =~ '^\s*/[/*]'
|
||||
" Skip over comments to avoid that cindent() aligns with the <script> tag
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
endwhile
|
||||
if lnum < b:hi_indent.blocklnr
|
||||
" indent for <script> itself
|
||||
return b:hi_indent.blocktagind
|
||||
endif
|
||||
if lnum == b:hi_indent.blocklnr
|
||||
" indent for the first line after <script>
|
||||
return eval(b:hi_js1indent)
|
||||
endif
|
||||
if b:hi_indent.scripttype == "javascript"
|
||||
" indent for further lines
|
||||
return eval(b:hi_js1indent) + GetJavascriptIndent()
|
||||
else
|
||||
return -1
|
||||
@ -593,7 +598,7 @@ func! s:Alien3()
|
||||
endfunc "}}}
|
||||
|
||||
" Return the indent inside a <style> block.
|
||||
func! s:Alien4()
|
||||
func s:Alien4()
|
||||
"{{{
|
||||
if prevnonblank(v:lnum-1) == b:hi_indent.blocklnr
|
||||
" indent for first content line
|
||||
@ -603,7 +608,7 @@ func! s:Alien4()
|
||||
endfunc "}}}
|
||||
|
||||
" Indending inside a <style> block. Returns the indent.
|
||||
func! s:CSSIndent()
|
||||
func s:CSSIndent()
|
||||
"{{{
|
||||
" This handles standard CSS and also Closure stylesheets where special lines
|
||||
" start with @.
|
||||
@ -720,13 +725,13 @@ endfunc "}}}
|
||||
" tag: blah
|
||||
" tag: blah &&
|
||||
" tag: blah ||
|
||||
func! s:CssUnfinished(text)
|
||||
func s:CssUnfinished(text)
|
||||
"{{{
|
||||
return a:text =~ '\(||\|&&\|:\|\k\)\s*$'
|
||||
endfunc "}}}
|
||||
|
||||
" Search back for the first unfinished line above "lnum".
|
||||
func! s:CssFirstUnfinished(lnum, min_lnum)
|
||||
func s:CssFirstUnfinished(lnum, min_lnum)
|
||||
"{{{
|
||||
let align_lnum = a:lnum
|
||||
while align_lnum > a:min_lnum && s:CssUnfinished(getline(align_lnum - 1))
|
||||
@ -736,7 +741,7 @@ func! s:CssFirstUnfinished(lnum, min_lnum)
|
||||
endfunc "}}}
|
||||
|
||||
" Find the non-empty line at or before "lnum" that is not a comment.
|
||||
func! s:CssPrevNonComment(lnum, stopline)
|
||||
func s:CssPrevNonComment(lnum, stopline)
|
||||
"{{{
|
||||
" caller starts from a line a:lnum + 1 that is not a comment
|
||||
let lnum = prevnonblank(a:lnum)
|
||||
@ -761,7 +766,7 @@ func! s:CssPrevNonComment(lnum, stopline)
|
||||
endfunc "}}}
|
||||
|
||||
" Check the number of {} and () in line "lnum". Return a dict with the counts.
|
||||
func! HtmlIndent_CountBraces(lnum)
|
||||
func HtmlIndent_CountBraces(lnum)
|
||||
"{{{
|
||||
let brs = substitute(getline(a:lnum), '[''"].\{-}[''"]\|/\*.\{-}\*/\|/\*.*$\|[^{}()]', '', 'g')
|
||||
let c_open = 0
|
||||
@ -794,7 +799,7 @@ func! HtmlIndent_CountBraces(lnum)
|
||||
endfunc "}}}
|
||||
|
||||
" Return the indent for a comment: <!-- -->
|
||||
func! s:Alien5()
|
||||
func s:Alien5()
|
||||
"{{{
|
||||
let curtext = getline(v:lnum)
|
||||
if curtext =~ '^\s*\zs-->'
|
||||
@ -826,7 +831,7 @@ func! s:Alien5()
|
||||
endfunc "}}}
|
||||
|
||||
" Return the indent for conditional comment: <!--[ ![endif]-->
|
||||
func! s:Alien6()
|
||||
func s:Alien6()
|
||||
"{{{
|
||||
let curtext = getline(v:lnum)
|
||||
if curtext =~ '\s*\zs<!\[endif\]-->'
|
||||
@ -840,7 +845,7 @@ func! s:Alien6()
|
||||
endfunc "}}}
|
||||
|
||||
" When the "lnum" line ends in ">" find the line containing the matching "<".
|
||||
func! HtmlIndent_FindTagStart(lnum)
|
||||
func HtmlIndent_FindTagStart(lnum)
|
||||
"{{{
|
||||
" Avoids using the indent of a continuation line.
|
||||
" Moves the cursor.
|
||||
@ -863,7 +868,7 @@ func! HtmlIndent_FindTagStart(lnum)
|
||||
endfunc "}}}
|
||||
|
||||
" Find the unclosed start tag from the current cursor position.
|
||||
func! HtmlIndent_FindStartTag()
|
||||
func HtmlIndent_FindStartTag()
|
||||
"{{{
|
||||
" The cursor must be on or before a closing tag.
|
||||
" If found, positions the cursor at the match and returns the line number.
|
||||
@ -877,7 +882,7 @@ func! HtmlIndent_FindStartTag()
|
||||
endfunc "}}}
|
||||
|
||||
" Moves the cursor from a "<" to the matching ">".
|
||||
func! HtmlIndent_FindTagEnd()
|
||||
func HtmlIndent_FindTagEnd()
|
||||
"{{{
|
||||
" Call this with the cursor on the "<" of a start tag.
|
||||
" This will move the cursor to the ">" of the matching end tag or, when it's
|
||||
@ -897,7 +902,7 @@ func! HtmlIndent_FindTagEnd()
|
||||
endfunc "}}}
|
||||
|
||||
" Indenting inside a start tag. Return the correct indent or -1 if unknown.
|
||||
func! s:InsideTag(foundHtmlString)
|
||||
func s:InsideTag(foundHtmlString)
|
||||
"{{{
|
||||
if a:foundHtmlString
|
||||
" Inside an attribute string.
|
||||
@ -958,7 +963,7 @@ func! s:InsideTag(foundHtmlString)
|
||||
endfunc "}}}
|
||||
|
||||
" THE MAIN INDENT FUNCTION. Return the amount of indent for v:lnum.
|
||||
func! HtmlIndent()
|
||||
func HtmlIndent()
|
||||
"{{{
|
||||
if prevnonblank(v:lnum - 1) < 1
|
||||
" First non-blank line has no indent.
|
||||
|
189
runtime/indent/jsonc.vim
Normal file
189
runtime/indent/jsonc.vim
Normal file
@ -0,0 +1,189 @@
|
||||
" Vim indent file
|
||||
" Language: JSONC (JSON with Comments)
|
||||
" Original Author: Izhak Jakov <izhak724@gmail.com>
|
||||
" Acknowledgement: Based off of vim-json maintained by Eli Parra <eli@elzr.com>
|
||||
" https://github.com/elzr/vim-json
|
||||
" Last Change: 2021-07-01
|
||||
|
||||
" 0. Initialization {{{1
|
||||
" =================
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal nosmartindent
|
||||
|
||||
" Now, set up our indentation expression and keys that trigger it.
|
||||
setlocal indentexpr=GetJSONCIndent()
|
||||
setlocal indentkeys=0{,0},0),0[,0],!^F,o,O,e
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetJSONCIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" 1. Variables {{{1
|
||||
" ============
|
||||
|
||||
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
|
||||
" Regex that defines blocks.
|
||||
let s:block_regex = '\%({\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term
|
||||
|
||||
" 2. Auxiliary Functions {{{1
|
||||
" ======================
|
||||
|
||||
" Check if the character at lnum:col is inside a string.
|
||||
function s:IsInString(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') == 'jsonString'
|
||||
endfunction
|
||||
|
||||
" Find line above 'lnum' that isn't empty, or in a string.
|
||||
function s:PrevNonBlankNonString(lnum)
|
||||
let lnum = prevnonblank(a:lnum)
|
||||
while lnum > 0
|
||||
" If the line isn't empty or in a string, end search.
|
||||
let line = getline(lnum)
|
||||
if !(s:IsInString(lnum, 1) && s:IsInString(lnum, strlen(line)))
|
||||
break
|
||||
endif
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
endwhile
|
||||
return lnum
|
||||
endfunction
|
||||
|
||||
" Check if line 'lnum' has more opening brackets than closing ones.
|
||||
function s:LineHasOpeningBrackets(lnum)
|
||||
let open_0 = 0
|
||||
let open_2 = 0
|
||||
let open_4 = 0
|
||||
let line = getline(a:lnum)
|
||||
let pos = match(line, '[][(){}]', 0)
|
||||
while pos != -1
|
||||
let idx = stridx('(){}[]', line[pos])
|
||||
if idx % 2 == 0
|
||||
let open_{idx} = open_{idx} + 1
|
||||
else
|
||||
let open_{idx - 1} = open_{idx - 1} - 1
|
||||
endif
|
||||
let pos = match(line, '[][(){}]', pos + 1)
|
||||
endwhile
|
||||
return (open_0 > 0) . (open_2 > 0) . (open_4 > 0)
|
||||
endfunction
|
||||
|
||||
function s:Match(lnum, regex)
|
||||
let col = match(getline(a:lnum), a:regex) + 1
|
||||
return col > 0 && !s:IsInString(a:lnum, col) ? col : 0
|
||||
endfunction
|
||||
|
||||
" 3. GetJSONCIndent Function {{{1
|
||||
" =========================
|
||||
|
||||
function GetJSONCIndent()
|
||||
if !exists("s:inside_comment")
|
||||
let s:inside_comment = 0
|
||||
endif
|
||||
|
||||
" 3.1. Setup {{{2
|
||||
" ----------
|
||||
|
||||
" Set up variables for restoring position in file. Could use v:lnum here.
|
||||
let vcol = col('.')
|
||||
|
||||
" 3.2. Work on the current line {{{2
|
||||
" -----------------------------
|
||||
|
||||
|
||||
" Get the current line.
|
||||
let line = getline(v:lnum)
|
||||
let ind = -1
|
||||
if s:inside_comment == 0
|
||||
" TODO iterate through all the matches in a line
|
||||
let col = matchend(line, '\/\*')
|
||||
if col > 0 && !s:IsInString(v:lnum, col)
|
||||
let s:inside_comment = 1
|
||||
endif
|
||||
endif
|
||||
" If we're in the middle of a comment
|
||||
if s:inside_comment == 1
|
||||
let col = matchend(line, '\*\/')
|
||||
if col > 0 && !s:IsInString(v:lnum, col)
|
||||
let s:inside_comment = 0
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
if line =~ '^\s*//'
|
||||
return ind
|
||||
endif
|
||||
|
||||
" If we got a closing bracket on an empty line, find its match and indent
|
||||
" according to it.
|
||||
let col = matchend(line, '^\s*[]}]')
|
||||
|
||||
if col > 0 && !s:IsInString(v:lnum, col)
|
||||
call cursor(v:lnum, col)
|
||||
let bs = strpart('{}[]', stridx('}]', line[col - 1]) * 2, 2)
|
||||
|
||||
let pairstart = escape(bs[0], '[')
|
||||
let pairend = escape(bs[1], ']')
|
||||
let pairline = searchpair(pairstart, '', pairend, 'bW')
|
||||
|
||||
if pairline > 0
|
||||
let ind = indent(pairline)
|
||||
else
|
||||
let ind = virtcol('.') - 1
|
||||
endif
|
||||
|
||||
return ind
|
||||
endif
|
||||
|
||||
" If we are in a multi-line string, don't do anything to it.
|
||||
if s:IsInString(v:lnum, matchend(line, '^\s*') + 1)
|
||||
return indent('.')
|
||||
endif
|
||||
|
||||
" 3.3. Work on the previous line. {{{2
|
||||
" -------------------------------
|
||||
|
||||
let lnum = prevnonblank(v:lnum - 1)
|
||||
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
" Set up variables for current line.
|
||||
let line = getline(lnum)
|
||||
let ind = indent(lnum)
|
||||
|
||||
" If the previous line ended with a block opening, add a level of indent.
|
||||
" if s:Match(lnum, s:block_regex)
|
||||
" return indent(lnum) + shiftwidth()
|
||||
" endif
|
||||
|
||||
" If the previous line contained an opening bracket, and we are still in it,
|
||||
" add indent depending on the bracket type.
|
||||
if line =~ '[[({]'
|
||||
let counts = s:LineHasOpeningBrackets(lnum)
|
||||
if counts[0] == '1' || counts[1] == '1' || counts[2] == '1'
|
||||
return ind + shiftwidth()
|
||||
else
|
||||
call cursor(v:lnum, vcol)
|
||||
end
|
||||
endif
|
||||
|
||||
" }}}2
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim:set sw=2 sts=2 ts=8 noet:
|
491
runtime/indent/julia.vim
Normal file
491
runtime/indent/julia.vim
Normal file
@ -0,0 +1,491 @@
|
||||
" Vim indent file
|
||||
" Language: Julia
|
||||
" Maintainer: Carlo Baldassi <carlobaldassi@gmail.com>
|
||||
" Homepage: https://github.com/JuliaEditorSupport/julia-vim
|
||||
" Last Change: 2016 jun 16
|
||||
" Notes: originally based on Bram Molenaar's indent file for vim
|
||||
|
||||
setlocal autoindent
|
||||
|
||||
setlocal indentexpr=GetJuliaIndent()
|
||||
setlocal indentkeys+==end,=else,=catch,=finally,),],}
|
||||
setlocal indentkeys-=0#
|
||||
setlocal indentkeys-=:
|
||||
setlocal indentkeys-=0{
|
||||
setlocal indentkeys-=0}
|
||||
setlocal nosmartindent
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetJuliaIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:skipPatternsBasic = '\<julia\%(Comment\%([LM]\|Delim\)\)\>'
|
||||
let s:skipPatterns = '\<julia\%(Comprehension\%(For\|If\)\|RangeKeyword\|Comment\%([LM]\|Delim\)\|\%([bs]\|Shell\|Printf\|Doc\)\?String\|StringPrefixed\|DocStringM\(Raw\)\?\|RegEx\|SymbolS\?\|Macro\|Dotted\)\>'
|
||||
|
||||
function JuliaMatch(lnum, str, regex, st, ...)
|
||||
let s = a:st
|
||||
let e = a:0 > 0 ? a:1 : -1
|
||||
let basic_skip = a:0 > 1 ? a:2 : 'all'
|
||||
let skip = basic_skip ==# 'basic' ? s:skipPatternsBasic : s:skipPatterns
|
||||
while 1
|
||||
let f = match(a:str, '\C' . a:regex, s)
|
||||
if e >= 0 && f >= e
|
||||
return -1
|
||||
endif
|
||||
if f >= 0
|
||||
let attr = synIDattr(synID(a:lnum,f+1,1),"name")
|
||||
let attrT = synIDattr(synID(a:lnum,f+1,0),"name")
|
||||
if attr =~# skip || attrT =~# skip
|
||||
let s = f+1
|
||||
continue
|
||||
endif
|
||||
endif
|
||||
break
|
||||
endwhile
|
||||
return f
|
||||
endfunction
|
||||
|
||||
function GetJuliaNestingStruct(lnum, ...)
|
||||
" Auxiliary function to inspect the block structure of a line
|
||||
let line = getline(a:lnum)
|
||||
let s = a:0 > 0 ? a:1 : 0
|
||||
let e = a:0 > 1 ? a:2 : -1
|
||||
let blocks_stack = []
|
||||
let num_closed_blocks = 0
|
||||
while 1
|
||||
let fb = JuliaMatch(a:lnum, line, '\<\%(if\|else\%(if\)\?\|while\|for\|try\|catch\|finally\|\%(staged\)\?function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@<!struct\|\%(abstract\|primitive\)\s\+type\|let\|\%(bare\)\?module\|quote\|do\)\>', s, e)
|
||||
let fe = JuliaMatch(a:lnum, line, '\<end\>', s, e)
|
||||
|
||||
if fb < 0 && fe < 0
|
||||
" No blocks found
|
||||
break
|
||||
end
|
||||
|
||||
if fb >= 0 && (fb < fe || fe < 0)
|
||||
" The first occurrence is an opening block keyword
|
||||
" Note: some keywords (elseif,else,catch,finally) are both
|
||||
" closing blocks and opening new ones
|
||||
|
||||
let i = JuliaMatch(a:lnum, line, '\<if\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
call add(blocks_stack, 'if')
|
||||
continue
|
||||
endif
|
||||
let i = JuliaMatch(a:lnum, line, '\<elseif\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
if len(blocks_stack) > 0 && blocks_stack[-1] == 'if'
|
||||
let blocks_stack[-1] = 'elseif'
|
||||
elseif (len(blocks_stack) > 0 && blocks_stack[-1] != 'elseif') || len(blocks_stack) == 0
|
||||
call add(blocks_stack, 'elseif')
|
||||
let num_closed_blocks += 1
|
||||
endif
|
||||
continue
|
||||
endif
|
||||
let i = JuliaMatch(a:lnum, line, '\<else\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
if len(blocks_stack) > 0 && blocks_stack[-1] =~# '\<\%(else\)\=if\>'
|
||||
let blocks_stack[-1] = 'else'
|
||||
else
|
||||
call add(blocks_stack, 'else')
|
||||
let num_closed_blocks += 1
|
||||
endif
|
||||
continue
|
||||
endif
|
||||
|
||||
let i = JuliaMatch(a:lnum, line, '\<try\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
call add(blocks_stack, 'try')
|
||||
continue
|
||||
endif
|
||||
let i = JuliaMatch(a:lnum, line, '\<catch\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
if len(blocks_stack) > 0 && blocks_stack[-1] == 'try'
|
||||
let blocks_stack[-1] = 'catch'
|
||||
else
|
||||
call add(blocks_stack, 'catch')
|
||||
let num_closed_blocks += 1
|
||||
endif
|
||||
continue
|
||||
endif
|
||||
let i = JuliaMatch(a:lnum, line, '\<finally\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
if len(blocks_stack) > 0 && (blocks_stack[-1] == 'try' || blocks_stack[-1] == 'catch')
|
||||
let blocks_stack[-1] = 'finally'
|
||||
else
|
||||
call add(blocks_stack, 'finally')
|
||||
let num_closed_blocks += 1
|
||||
endif
|
||||
continue
|
||||
endif
|
||||
|
||||
let i = JuliaMatch(a:lnum, line, '\<\%(bare\)\?module\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
if i == 0
|
||||
call add(blocks_stack, 'col1module')
|
||||
else
|
||||
call add(blocks_stack, 'other')
|
||||
endif
|
||||
continue
|
||||
endif
|
||||
|
||||
let i = JuliaMatch(a:lnum, line, '\<\%(while\|for\|function\|macro\|begin\|\%(mutable\s\+\)\?struct\|\%(abstract\|primitive\)\s\+type\|let\|quote\|do\)\>', s)
|
||||
if i >= 0 && i == fb
|
||||
if match(line, '\C\<\%(mutable\|abstract\|primitive\)', i) != -1
|
||||
let s = i+11
|
||||
else
|
||||
let s = i+1
|
||||
endif
|
||||
call add(blocks_stack, 'other')
|
||||
continue
|
||||
endif
|
||||
|
||||
" Note: it should be impossible to get here
|
||||
break
|
||||
|
||||
else
|
||||
" The first occurrence is an 'end'
|
||||
|
||||
let s = fe+1
|
||||
if len(blocks_stack) == 0
|
||||
let num_closed_blocks += 1
|
||||
else
|
||||
call remove(blocks_stack, -1)
|
||||
endif
|
||||
continue
|
||||
|
||||
endif
|
||||
|
||||
" Note: it should be impossible to get here
|
||||
break
|
||||
endwhile
|
||||
let num_open_blocks = len(blocks_stack) - count(blocks_stack, 'col1module')
|
||||
return [num_open_blocks, num_closed_blocks]
|
||||
endfunction
|
||||
|
||||
function GetJuliaNestingBrackets(lnum, c)
|
||||
" Auxiliary function to inspect the brackets structure of a line
|
||||
let line = getline(a:lnum)[0 : (a:c - 1)]
|
||||
let s = 0
|
||||
let brackets_stack = []
|
||||
let last_closed_bracket = -1
|
||||
while 1
|
||||
let fb = JuliaMatch(a:lnum, line, '[([{]', s)
|
||||
let fe = JuliaMatch(a:lnum, line, '[])}]', s)
|
||||
|
||||
if fb < 0 && fe < 0
|
||||
" No brackets found
|
||||
break
|
||||
end
|
||||
|
||||
if fb >= 0 && (fb < fe || fe < 0)
|
||||
" The first occurrence is an opening bracket
|
||||
|
||||
let i = JuliaMatch(a:lnum, line, '(', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
call add(brackets_stack, ['par',i])
|
||||
continue
|
||||
endif
|
||||
|
||||
let i = JuliaMatch(a:lnum, line, '\[', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
call add(brackets_stack, ['sqbra',i])
|
||||
continue
|
||||
endif
|
||||
|
||||
let i = JuliaMatch(a:lnum, line, '{', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
call add(brackets_stack, ['curbra',i])
|
||||
continue
|
||||
endif
|
||||
|
||||
" Note: it should be impossible to get here
|
||||
break
|
||||
|
||||
else
|
||||
" The first occurrence is a closing bracket
|
||||
|
||||
let i = JuliaMatch(a:lnum, line, ')', s)
|
||||
if i >= 0 && i == fe
|
||||
let s = i+1
|
||||
if len(brackets_stack) > 0 && brackets_stack[-1][0] == 'par'
|
||||
call remove(brackets_stack, -1)
|
||||
else
|
||||
let last_closed_bracket = i + 1
|
||||
endif
|
||||
continue
|
||||
endif
|
||||
|
||||
let i = JuliaMatch(a:lnum, line, ']', s)
|
||||
if i >= 0 && i == fe
|
||||
let s = i+1
|
||||
if len(brackets_stack) > 0 && brackets_stack[-1][0] == 'sqbra'
|
||||
call remove(brackets_stack, -1)
|
||||
else
|
||||
let last_closed_bracket = i + 1
|
||||
endif
|
||||
continue
|
||||
endif
|
||||
|
||||
let i = JuliaMatch(a:lnum, line, '}', s)
|
||||
if i >= 0 && i == fe
|
||||
let s = i+1
|
||||
if len(brackets_stack) > 0 && brackets_stack[-1][0] == 'curbra'
|
||||
call remove(brackets_stack, -1)
|
||||
else
|
||||
let last_closed_bracket = i + 1
|
||||
endif
|
||||
continue
|
||||
endif
|
||||
|
||||
" Note: it should be impossible to get here
|
||||
break
|
||||
|
||||
endif
|
||||
|
||||
" Note: it should be impossible to get here
|
||||
break
|
||||
endwhile
|
||||
let first_open_bracket = -1
|
||||
let last_open_bracket = -1
|
||||
let infuncargs = 0
|
||||
if len(brackets_stack) > 0
|
||||
let first_open_bracket = brackets_stack[0][1]
|
||||
let last_open_bracket = brackets_stack[-1][1]
|
||||
if brackets_stack[-1][0] == 'par' && IsFunctionArgPar(a:lnum, last_open_bracket+1)
|
||||
let infuncargs = 1
|
||||
endif
|
||||
endif
|
||||
return [first_open_bracket, last_open_bracket, last_closed_bracket, infuncargs]
|
||||
endfunction
|
||||
|
||||
let s:bracketBlocks = '\<julia\%(\%(\%(Printf\)\?Par\|SqBra\%(Idx\)\?\|CurBra\)Block\|ParBlockInRange\|StringVars\%(Par\|SqBra\|CurBra\)\|Dollar\%(Par\|SqBra\)\|QuotedParBlockS\?\)\>'
|
||||
|
||||
function IsInBrackets(lnum, c)
|
||||
let stack = map(synstack(a:lnum, a:c), 'synIDattr(v:val, "name")')
|
||||
call filter(stack, 'v:val =~# s:bracketBlocks')
|
||||
return len(stack) > 0
|
||||
endfunction
|
||||
|
||||
function IsInDocString(lnum)
|
||||
let stack = map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")')
|
||||
call filter(stack, 'v:val =~# "\\<juliaDocString\\(Delim\\|M\\\(Raw\\)\\?\\)\\?\\>"')
|
||||
return len(stack) > 0
|
||||
endfunction
|
||||
|
||||
function IsInContinuationImportLine(lnum)
|
||||
let stack = map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")')
|
||||
call filter(stack, 'v:val =~# "\\<juliaImportLine\\>"')
|
||||
if len(stack) == 0
|
||||
return 0
|
||||
endif
|
||||
return JuliaMatch(a:lnum, getline(a:lnum), '\<\%(import\|using\|export\)\>', indent(a:lnum)) == -1
|
||||
endfunction
|
||||
|
||||
function IsFunctionArgPar(lnum, c)
|
||||
if a:c == 0
|
||||
return 0
|
||||
endif
|
||||
let stack = map(synstack(a:lnum, a:c-1), 'synIDattr(v:val, "name")')
|
||||
return len(stack) >= 2 && stack[-2] ==# 'juliaFunctionDef'
|
||||
endfunction
|
||||
|
||||
function JumpToMatch(lnum, last_closed_bracket)
|
||||
" we use the % command to skip back (tries to ues matchit if possible,
|
||||
" otherwise resorts to vim's default, which is buggy but better than
|
||||
" nothing)
|
||||
call cursor(a:lnum, a:last_closed_bracket)
|
||||
let percmap = maparg("%", "n")
|
||||
if exists("g:loaded_matchit") && percmap =~# 'Match\%(it\|_wrapper\)'
|
||||
normal %
|
||||
else
|
||||
normal! %
|
||||
end
|
||||
endfunction
|
||||
|
||||
" Auxiliary function to find a line which does not start in the middle of a
|
||||
" multiline bracketed expression, to be used as reference for block
|
||||
" indentation.
|
||||
function LastBlockIndent(lnum)
|
||||
let lnum = a:lnum
|
||||
let ind = 0
|
||||
while lnum > 0
|
||||
let ind = indent(lnum)
|
||||
if ind == 0
|
||||
return [lnum, 0]
|
||||
endif
|
||||
if !IsInBrackets(lnum, 1)
|
||||
break
|
||||
endif
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
endwhile
|
||||
return [max([lnum,1]), ind]
|
||||
endfunction
|
||||
|
||||
function GetJuliaIndent()
|
||||
" Do not alter doctrings indentation
|
||||
if IsInDocString(v:lnum)
|
||||
return -1
|
||||
endif
|
||||
|
||||
" Find a non-blank line above the current line.
|
||||
let lnum = prevnonblank(v:lnum - 1)
|
||||
|
||||
" At the start of the file use zero indent.
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ind = -1
|
||||
let st = -1
|
||||
let lim = -1
|
||||
|
||||
" Multiline bracketed expressions take precedence
|
||||
let align_brackets = get(g:, "julia_indent_align_brackets", 1)
|
||||
let align_funcargs = get(g:, "julia_indent_align_funcargs", 0)
|
||||
let c = len(getline(lnum)) + 1
|
||||
while IsInBrackets(lnum, c)
|
||||
let [first_open_bracket, last_open_bracket, last_closed_bracket, infuncargs] = GetJuliaNestingBrackets(lnum, c)
|
||||
|
||||
" First scenario: the previous line has a hanging open bracket:
|
||||
" set the indentation to match the opening bracket (plus an extra space)
|
||||
" unless we're in a function arguments list or alignment is disabled, in
|
||||
" which case we just add an extra indent
|
||||
if last_open_bracket != -1
|
||||
if (!infuncargs && align_brackets) || (infuncargs && align_funcargs)
|
||||
let st = last_open_bracket
|
||||
let ind = virtcol([lnum, st + 1])
|
||||
else
|
||||
let ind = indent(lnum) + shiftwidth()
|
||||
endif
|
||||
|
||||
" Second scenario: some multiline bracketed expression was closed in the
|
||||
" previous line. But since we know we are still in a bracketed expression,
|
||||
" we need to find the line where the bracket was opened
|
||||
elseif last_closed_bracket != -1
|
||||
call JumpToMatch(lnum, last_closed_bracket)
|
||||
if line(".") == lnum
|
||||
" something wrong here, give up
|
||||
let ind = indent(lnum)
|
||||
else
|
||||
let lnum = line(".")
|
||||
let c = col(".") - 1
|
||||
if c == 0
|
||||
" uhm, give up
|
||||
let ind = 0
|
||||
else
|
||||
" we skipped a bracket set, keep searching for an opening bracket
|
||||
let lim = c
|
||||
continue
|
||||
endif
|
||||
endif
|
||||
|
||||
" Third scenario: nothing special: keep the indentation
|
||||
else
|
||||
let ind = indent(lnum)
|
||||
endif
|
||||
|
||||
" Does the current line start with a closing bracket? Then depending on
|
||||
" the situation we align it with the opening one, or we let the rest of
|
||||
" the code figure it out (the case in which we're closing a function
|
||||
" argument list is special-cased)
|
||||
if JuliaMatch(v:lnum, getline(v:lnum), '[])}]', indent(v:lnum)) == indent(v:lnum) && ind > 0
|
||||
if !align_brackets && !align_funcargs
|
||||
call JumpToMatch(v:lnum, indent(v:lnum))
|
||||
return indent(line("."))
|
||||
elseif (align_brackets && getline(v:lnum)[indent(v:lnum)] != ')') || align_funcargs
|
||||
return ind - 1
|
||||
else " must be a ')' and align_brackets==1 and align_funcargs==0
|
||||
call JumpToMatch(v:lnum, indent(v:lnum))
|
||||
if IsFunctionArgPar(line("."), col("."))
|
||||
let ind = -1
|
||||
else
|
||||
return ind - 1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
break
|
||||
endwhile
|
||||
|
||||
if ind == -1
|
||||
" We are not in a multiline bracketed expression. Thus we look for a
|
||||
" previous line to use as a reference
|
||||
let [lnum,ind] = LastBlockIndent(lnum)
|
||||
let c = len(getline(lnum)) + 1
|
||||
if IsInBrackets(lnum, c)
|
||||
let [first_open_bracket, last_open_bracket, last_closed_bracket, infuncargs] = GetJuliaNestingBrackets(lnum, c)
|
||||
let lim = first_open_bracket
|
||||
endif
|
||||
end
|
||||
|
||||
" Analyse the reference line
|
||||
let [num_open_blocks, num_closed_blocks] = GetJuliaNestingStruct(lnum, st, lim)
|
||||
" Increase indentation for each newly opened block in the reference line
|
||||
let ind += shiftwidth() * num_open_blocks
|
||||
|
||||
" Analyse the current line
|
||||
let [num_open_blocks, num_closed_blocks] = GetJuliaNestingStruct(v:lnum)
|
||||
" Decrease indentation for each closed block in the current line
|
||||
let ind -= shiftwidth() * num_closed_blocks
|
||||
|
||||
" Additional special case: multiline import/using/export statements
|
||||
|
||||
let prevline = getline(lnum)
|
||||
" Are we in a multiline import/using/export statement, right below the
|
||||
" opening line?
|
||||
if IsInContinuationImportLine(v:lnum) && !IsInContinuationImportLine(lnum)
|
||||
if get(g:, 'julia_indent_align_import', 1)
|
||||
" if the opening line has a colon followed by non-comments, use it as
|
||||
" reference point
|
||||
let cind = JuliaMatch(lnum, prevline, ':', indent(lnum), lim)
|
||||
if cind >= 0
|
||||
let nonwhiteind = JuliaMatch(lnum, prevline, '\S', cind+1, -1, 'basic')
|
||||
if nonwhiteind >= 0
|
||||
" return match(prevline, '\S', cind+1) " a bit overkill...
|
||||
return cind + 2
|
||||
endif
|
||||
else
|
||||
" if the opening line is not a naked import/using/export statement, use
|
||||
" it as reference
|
||||
let iind = JuliaMatch(lnum, prevline, '\<import\|using\|export\>', indent(lnum), lim)
|
||||
if iind >= 0
|
||||
" assuming whitespace after using... so no `using(XYZ)` please!
|
||||
let nonwhiteind = JuliaMatch(lnum, prevline, '\S', iind+6, -1, 'basic')
|
||||
if nonwhiteind >= 0
|
||||
return match(prevline, '\S', iind+6)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
let ind += shiftwidth()
|
||||
|
||||
" Or did we just close a multiline import/using/export statement?
|
||||
elseif !IsInContinuationImportLine(v:lnum) && IsInContinuationImportLine(lnum)
|
||||
" find the starting line of the statement
|
||||
let ilnum = 0
|
||||
for iln in range(lnum-1, 1, -1)
|
||||
if !IsInContinuationImportLine(iln)
|
||||
let ilnum = iln
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if ilnum == 0
|
||||
" something went horribly wrong, give up
|
||||
let ind = indent(lnum)
|
||||
endif
|
||||
let ind = indent(ilnum)
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
@ -2,7 +2,7 @@
|
||||
" Language: Pascal
|
||||
" Maintainer: Neil Carter <n.carter@swansea.ac.uk>
|
||||
" Created: 2004 Jul 13
|
||||
" Last Change: 2017 Jun 13
|
||||
" Last Change: 2021 Jul 01
|
||||
"
|
||||
" This is version 2.0, a complete rewrite.
|
||||
"
|
||||
@ -20,6 +20,8 @@ setlocal indentkeys+==end;,==const,==type,==var,==begin,==repeat,==until,==for
|
||||
setlocal indentkeys+==program,==function,==procedure,==object,==private
|
||||
setlocal indentkeys+==record,==if,==else,==case
|
||||
|
||||
let b:undo_indent = "setl indentkeys< indentexpr<"
|
||||
|
||||
if exists("*GetPascalIndent")
|
||||
finish
|
||||
endif
|
||||
|
@ -4,6 +4,7 @@
|
||||
" Previous Maintainer: Nikolai Weibull <now at bitwi.se>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 Feb 03
|
||||
|
||||
" 0. Initialization {{{1
|
||||
" =================
|
||||
|
@ -15,7 +15,7 @@ text comment
|
||||
</tag1>
|
||||
<!--
|
||||
text comment
|
||||
end coment -->
|
||||
end comment -->
|
||||
</tag0>
|
||||
<!-- END_INDENT -->
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
</tag1>
|
||||
<!--
|
||||
text comment
|
||||
end coment -->
|
||||
end comment -->
|
||||
</tag0>
|
||||
<!-- END_INDENT -->
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
" Language: YAML
|
||||
" Maintainer: Nikolai Pavlov <zyx.vim@gmail.com>
|
||||
" Last Update: Lukas Reineke
|
||||
" Last Change: 2021 Jan 19
|
||||
" Last Change: 2021 Aug 13
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
|
@ -22,7 +22,7 @@ map F "hy2l
|
||||
map C "fp
|
||||
map e "fy2l
|
||||
map E "hp
|
||||
map F "hy2l
|
||||
map F "hy2l
|
||||
|
||||
" initialisations:
|
||||
" KM cleanup buffer
|
||||
|
@ -4,7 +4,7 @@ For instructions on installing this file, type
|
||||
`:help matchit-install`
|
||||
inside Vim.
|
||||
|
||||
For Vim version 8.1. Last change: 2020 Mar 01
|
||||
For Vim version 8.1. Last change: 2021 May 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Benji Fisher et al
|
||||
@ -320,7 +320,7 @@ should work (and have the same effect as "foobar:barfoo:endfoobar"), although
|
||||
this has not been thoroughly tested.
|
||||
|
||||
You can use |zero-width| patterns such as |\@<=| and |\zs|. (The latter has
|
||||
not been thouroughly tested in matchit.vim.) For example, if the keyword "if"
|
||||
not been thoroughly tested in matchit.vim.) For example, if the keyword "if"
|
||||
must occur at the start of the line, with optional white space, you might use
|
||||
the pattern "\(^\s*\)\@<=if" so that the cursor will end on the "i" instead of
|
||||
at the start of the line. For another example, if HTML had only one tag then
|
||||
|
@ -2,7 +2,7 @@
|
||||
"
|
||||
" Author: Bram Moolenaar
|
||||
" Copyright: Vim license applies, see ":help license"
|
||||
" Last Change: 2021 May 18
|
||||
" Last Change: 2021 Aug 06
|
||||
"
|
||||
" WORK IN PROGRESS - Only the basics work
|
||||
" Note: On MS-Windows you need a recent version of gdb. The one included with
|
||||
@ -121,6 +121,10 @@ func s:StartDebug_internal(dict)
|
||||
let s:pid = 0
|
||||
let s:asmwin = 0
|
||||
|
||||
if exists('#User#TermdebugStartPre')
|
||||
doauto <nomodeline> User TermdebugStartPre
|
||||
endif
|
||||
|
||||
" Uncomment this line to write logging in "debuglog".
|
||||
" call ch_logfile('debuglog', 'w')
|
||||
|
||||
@ -167,6 +171,10 @@ func s:StartDebug_internal(dict)
|
||||
call win_gotoid(curwinid)
|
||||
endif
|
||||
endif
|
||||
|
||||
if exists('#User#TermdebugStartPost')
|
||||
doauto <nomodeline> User TermdebugStartPost
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Use when debugger didn't start or ended.
|
||||
@ -596,7 +604,12 @@ func s:GetAsmAddr(msg)
|
||||
let addr = s:DecodeMessage(substitute(a:msg, '.*addr=', '', ''))
|
||||
return addr
|
||||
endfunc
|
||||
|
||||
func s:EndTermDebug(job, status)
|
||||
if exists('#User#TermdebugStopPre')
|
||||
doauto <nomodeline> User TermdebugStopPre
|
||||
endif
|
||||
|
||||
exe 'bwipe! ' . s:commbuf
|
||||
unlet s:gdbwin
|
||||
|
||||
@ -642,10 +655,18 @@ func s:EndDebugCommon()
|
||||
endif
|
||||
endif
|
||||
|
||||
if exists('#User#TermdebugStopPost')
|
||||
doauto <nomodeline> User TermdebugStopPost
|
||||
endif
|
||||
|
||||
au! TermDebug
|
||||
endfunc
|
||||
|
||||
func s:EndPromptDebug(job, status)
|
||||
if exists('#User#TermdebugStopPre')
|
||||
doauto <nomodeline> User TermdebugStopPre
|
||||
endif
|
||||
|
||||
let curwinid = win_getid(winnr())
|
||||
call win_gotoid(s:gdbwin)
|
||||
set nomodified
|
||||
|
@ -1,6 +1,6 @@
|
||||
" Vim plugin for using Vim as manpager.
|
||||
" Maintainer: Enno Nagel <ennonagel+vim@gmail.com>
|
||||
" Last Change: 2018 Feb 04
|
||||
" Last Change: 2020 Aug 05
|
||||
|
||||
command! -nargs=0 MANPAGER call s:ManPager() | delcommand MANPAGER
|
||||
|
||||
@ -16,7 +16,10 @@ function! s:ManPager()
|
||||
setlocal buftype=nofile bufhidden=hide iskeyword+=: modifiable
|
||||
|
||||
" Emulate 'col -b'
|
||||
silent keepj keepp %s/\v(.)\b\ze\1?//ge
|
||||
silent! keepj keepp %s/\v(.)\b\ze\1?//ge
|
||||
|
||||
" Remove ansi sequences
|
||||
silent! keepj keepp %s/\v\e\[%(%(\d;)?\d{1,2})?[mK]//ge
|
||||
|
||||
" Remove empty lines above the header
|
||||
call cursor(1, 1)
|
||||
|
@ -9,7 +9,7 @@
|
||||
SPELLDIR = ..
|
||||
FILES = tet_ID.aff tet_ID.dic
|
||||
|
||||
# I don't hava a Tetum locale, use the Dutch one instead.
|
||||
# I don't have a Tetum locale, use the Dutch one instead.
|
||||
all: $SPELLDIR/tet.latin1.spl $SPELLDIR/tet.utf-8.spl ../README_tet.txt
|
||||
|
||||
$SPELLDIR/tet.latin1.spl : $FILES
|
||||
|
@ -293,7 +293,7 @@ syn region eighthComment start="\zs\\" end="$" contains=eighthTodo
|
||||
" Define the default highlighting.
|
||||
if !exists("did_eighth_syntax_inits")
|
||||
let did_eighth_syntax_inits=1
|
||||
" The default methods for highlighting. Can be overriden later.
|
||||
" The default methods for highlighting. Can be overridden later.
|
||||
hi def link eighthTodo Todo
|
||||
hi def link eighthOperators Operator
|
||||
hi def link eighthMath Number
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: APT config file
|
||||
" Maintainer: Yann Amar <quidame@poivron.org>
|
||||
" Last Change: 2015 Dec 22
|
||||
" Last Change: 2021 Jul 12
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if !exists("main_syntax")
|
||||
@ -396,10 +396,13 @@ syn cluster aptconfSynaptic_ contains=aptconfSynaptic,
|
||||
" }}}
|
||||
" Unattended Upgrade: {{{
|
||||
syn keyword aptconfUnattendedUpgrade contained
|
||||
\ AutoFixInterruptedDpkg Automatic-Reboot Automatic-Reboot-Time
|
||||
\ Automatic-Reboot-WithUsers InstallOnShutdown Mail MailOnlyOnError
|
||||
\ MinimalSteps Origins-Pattern Package-Blacklist
|
||||
\ Remove-Unused-Dependencies
|
||||
\ Allow-APT-Mark-Fallback Allow-downgrade AutoFixInterruptedDpkg
|
||||
\ Automatic-Reboot Automatic-Reboot-Time Automatic-Reboot-WithUsers
|
||||
\ Debug InstallOnShutdown Mail MailOnlyOnError MailReport MinimalSteps
|
||||
\ OnlyOnACPower Origins-Pattern Package-Blacklist
|
||||
\ Remove-New-Unused-Dependencies Remove-Unused-Dependencies
|
||||
\ Remove-Unused-Kernel-Packages Skip-Updates-On-Metered-Connections
|
||||
\ SyslogEnable SyslogFacility Verbose
|
||||
|
||||
syn cluster aptconfUnattendedUpgrade_ contains=aptconfUnattendedUpgrade
|
||||
" }}}
|
||||
|
@ -1,8 +1,9 @@
|
||||
" Vim syntax file
|
||||
" Language: Scheme (CHICKEN)
|
||||
" Last Change: 2018-02-05
|
||||
" Last Change: 2021 Jul 30
|
||||
" Author: Evan Hanson <evhan@foldling.org>
|
||||
" Maintainer: Evan Hanson <evhan@foldling.org>
|
||||
" Repository: https://git.foldling.org/vim-scheme.git
|
||||
" URL: https://foldling.org/vim/syntax/chicken.vim
|
||||
" Notes: This is supplemental syntax, to be loaded after the core Scheme
|
||||
" syntax file (syntax/scheme.vim). Enable it by setting b:is_chicken=1
|
||||
@ -36,9 +37,23 @@ if len(s:c)
|
||||
syn region c matchgroup=schemeComment start=/#>/ end=/<#/ contains=@c
|
||||
endif
|
||||
|
||||
# SRFI 26
|
||||
syn match schemeSyntax /\(([ \t\n]*\)\@<=\(cut\|cute\)\>/
|
||||
|
||||
syn keyword schemeSyntax and-let*
|
||||
syn keyword schemeSyntax define-record
|
||||
syn keyword schemeSyntax set!-values
|
||||
syn keyword schemeSyntax fluid-let
|
||||
syn keyword schemeSyntax let-optionals
|
||||
syn keyword schemeSyntax let-optionals*
|
||||
syn keyword schemeSyntax letrec-values
|
||||
syn keyword schemeSyntax nth-value
|
||||
syn keyword schemeSyntax receive
|
||||
|
||||
syn keyword schemeLibrarySyntax declare
|
||||
syn keyword schemeLibrarySyntax define-interface
|
||||
syn keyword schemeLibrarySyntax functor
|
||||
syn keyword schemeLibrarySyntax include-relative
|
||||
syn keyword schemeLibrarySyntax module
|
||||
syn keyword schemeLibrarySyntax reexport
|
||||
syn keyword schemeLibrarySyntax require-library
|
||||
@ -52,10 +67,12 @@ syn keyword schemeTypeSyntax define-specialization
|
||||
syn keyword schemeTypeSyntax define-type
|
||||
syn keyword schemeTypeSyntax the
|
||||
|
||||
syn keyword schemeExtraSyntax and-let*
|
||||
syn keyword schemeExtraSyntax match
|
||||
syn keyword schemeExtraSyntax match-lambda
|
||||
syn keyword schemeExtraSyntax match-lambda*
|
||||
syn keyword schemeExtraSyntax match-let
|
||||
syn keyword schemeExtraSyntax match-let*
|
||||
syn keyword schemeExtraSyntax match-letrec
|
||||
|
||||
syn keyword schemeSpecialSyntax define-compiler-syntax
|
||||
syn keyword schemeSpecialSyntax define-constant
|
||||
|
@ -3,7 +3,7 @@
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
|
||||
" Wichert Akkerman <wakkerma@debian.org>
|
||||
" Last Change: 2020 Nov 28
|
||||
" Last Change: 2021 Aug 03
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debchangelog.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
@ -24,7 +24,7 @@ let s:supported = [
|
||||
\ 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm',
|
||||
\ 'trixie', 'sid', 'rc-buggy',
|
||||
\
|
||||
\ 'trusty', 'xenial', 'bionic', 'focal', 'groovy', 'hirsute', 'devel'
|
||||
\ 'trusty', 'xenial', 'bionic', 'focal', 'hirsute', 'impish', 'devel'
|
||||
\ ]
|
||||
let s:unsupported = [
|
||||
\ 'frozen', 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
|
||||
@ -34,7 +34,7 @@ let s:unsupported = [
|
||||
\ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
|
||||
\ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
|
||||
\ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic',
|
||||
\ 'disco', 'eoan'
|
||||
\ 'disco', 'eoan', 'groovy'
|
||||
\ ]
|
||||
let &cpo=s:cpo
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
" Language: Debian sources.list
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
|
||||
" Last Change: 2020 Nov 28
|
||||
" Last Change: 2021 Aug 03
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debsources.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
@ -26,7 +26,7 @@ let s:supported = [
|
||||
\ 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm',
|
||||
\ 'trixie', 'sid', 'rc-buggy',
|
||||
\
|
||||
\ 'trusty', 'xenial', 'bionic', 'focal', 'groovy', 'hirsute', 'devel'
|
||||
\ 'trusty', 'xenial', 'bionic', 'focal', 'hirsute', 'impish', 'devel'
|
||||
\ ]
|
||||
let s:unsupported = [
|
||||
\ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
|
||||
@ -36,7 +36,7 @@ let s:unsupported = [
|
||||
\ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
|
||||
\ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
|
||||
\ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic',
|
||||
\ 'disco', 'eoan'
|
||||
\ 'disco', 'eoan', 'groovy'
|
||||
\ ]
|
||||
let &cpo=s:cpo
|
||||
|
||||
|
@ -1,58 +1,109 @@
|
||||
" Vim syntax file
|
||||
" Language: Go
|
||||
" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
|
||||
" Last Change: 2014 Aug 16
|
||||
|
||||
" Options:
|
||||
" There are some options for customizing the highlighting; the recommended
|
||||
" settings are the default values, but you can write:
|
||||
" let OPTION_NAME = 0
|
||||
" in your ~/.vimrc file to disable particular options. You can also write:
|
||||
" let OPTION_NAME = 1
|
||||
" to enable particular options. At present, all options default to on.
|
||||
" Copyright 2009 The Go Authors. All rights reserved.
|
||||
" Use of this source code is governed by a BSD-style
|
||||
" license that can be found in the LICENSE file.
|
||||
"
|
||||
" - g:go_highlight_array_whitespace_error
|
||||
" Highlights white space after "[]".
|
||||
" - g:go_highlight_chan_whitespace_error
|
||||
" Highlights white space around the communications operator that don't
|
||||
" follow the standard style.
|
||||
" - g:go_highlight_extra_types
|
||||
" Highlights commonly used library types (io.Reader, etc.).
|
||||
" - g:go_highlight_space_tab_error
|
||||
" Highlights instances of tabs following spaces.
|
||||
" - g:go_highlight_trailing_whitespace_error
|
||||
" Highlights trailing white space.
|
||||
" go.vim: Vim syntax file for Go.
|
||||
" Language: Go
|
||||
" Maintainer: Billie Cleek <bhcleek@gmail.com>
|
||||
" Latest Revision: 2021-06-26
|
||||
" License: BSD-style. See LICENSE file in source repository.
|
||||
" Repository: https://github.com/fatih/vim-go
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists('b:current_syntax')
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists('g:go_highlight_array_whitespace_error')
|
||||
let g:go_highlight_array_whitespace_error = 1
|
||||
endif
|
||||
if !exists('g:go_highlight_chan_whitespace_error')
|
||||
let g:go_highlight_chan_whitespace_error = 1
|
||||
endif
|
||||
if !exists('g:go_highlight_extra_types')
|
||||
let g:go_highlight_extra_types = 1
|
||||
endif
|
||||
if !exists('g:go_highlight_space_tab_error')
|
||||
let g:go_highlight_space_tab_error = 1
|
||||
endif
|
||||
if !exists('g:go_highlight_trailing_whitespace_error')
|
||||
let g:go_highlight_trailing_whitespace_error = 1
|
||||
endif
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! s:FoldEnable(...) abort
|
||||
if a:0 > 0
|
||||
return index(s:FoldEnable(), a:1) > -1
|
||||
endif
|
||||
return get(g:, 'go_fold_enable', ['block', 'import', 'varconst', 'package_comment'])
|
||||
endfunction
|
||||
|
||||
function! s:HighlightArrayWhitespaceError() abort
|
||||
return get(g:, 'go_highlight_array_whitespace_error', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightChanWhitespaceError() abort
|
||||
return get(g:, 'go_highlight_chan_whitespace_error', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightExtraTypes() abort
|
||||
return get(g:, 'go_highlight_extra_types', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightSpaceTabError() abort
|
||||
return get(g:, 'go_highlight_space_tab_error', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightTrailingWhitespaceError() abort
|
||||
return get(g:, 'go_highlight_trailing_whitespace_error', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightOperators() abort
|
||||
return get(g:, 'go_highlight_operators', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightFunctions() abort
|
||||
return get(g:, 'go_highlight_functions', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightFunctionParameters() abort
|
||||
return get(g:, 'go_highlight_function_parameters', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightFunctionCalls() abort
|
||||
return get(g:, 'go_highlight_function_calls', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightFields() abort
|
||||
return get(g:, 'go_highlight_fields', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightTypes() abort
|
||||
return get(g:, 'go_highlight_types', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightBuildConstraints() abort
|
||||
return get(g:, 'go_highlight_build_constraints', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightStringSpellcheck() abort
|
||||
return get(g:, 'go_highlight_string_spellcheck', 1)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightFormatStrings() abort
|
||||
return get(g:, 'go_highlight_format_strings', 1)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightGenerateTags() abort
|
||||
return get(g:, 'go_highlight_generate_tags', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightVariableAssignments() abort
|
||||
return get(g:, 'go_highlight_variable_assignments', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightVariableDeclarations() abort
|
||||
return get(g:, 'go_highlight_variable_declarations', 0)
|
||||
endfunction
|
||||
|
||||
syn case match
|
||||
|
||||
syn keyword goDirective package import
|
||||
syn keyword goDeclaration var const type
|
||||
syn keyword goDeclType struct interface
|
||||
syn keyword goPackage package
|
||||
syn keyword goImport import contained
|
||||
syn keyword goVar var contained
|
||||
syn keyword goConst const contained
|
||||
|
||||
hi def link goDirective Statement
|
||||
hi def link goPackage Statement
|
||||
hi def link goImport Statement
|
||||
hi def link goVar Keyword
|
||||
hi def link goConst Keyword
|
||||
hi def link goDeclaration Keyword
|
||||
hi def link goDeclType Keyword
|
||||
|
||||
" Keywords within functions
|
||||
syn keyword goStatement defer go goto return break continue fallthrough
|
||||
@ -78,28 +129,38 @@ hi def link goUnsignedInts Type
|
||||
hi def link goFloats Type
|
||||
hi def link goComplexes Type
|
||||
|
||||
" Treat func specially: it's a declaration at the start of a line, but a type
|
||||
" elsewhere. Order matters here.
|
||||
syn match goType /\<func\>/
|
||||
syn match goDeclaration /^func\>/
|
||||
|
||||
" Predefined functions and values
|
||||
syn keyword goBuiltins append cap close complex copy delete imag len
|
||||
syn keyword goBuiltins make new panic print println real recover
|
||||
syn keyword goConstants iota true false nil
|
||||
syn keyword goBuiltins append cap close complex copy delete imag len
|
||||
syn keyword goBuiltins make new panic print println real recover
|
||||
syn keyword goBoolean true false
|
||||
syn keyword goPredefinedIdentifiers nil iota
|
||||
|
||||
hi def link goBuiltins Keyword
|
||||
hi def link goConstants Keyword
|
||||
hi def link goBuiltins Identifier
|
||||
hi def link goBoolean Boolean
|
||||
hi def link goPredefinedIdentifiers goBoolean
|
||||
|
||||
" Comments; their contents
|
||||
syn keyword goTodo contained TODO FIXME XXX BUG
|
||||
syn cluster goCommentGroup contains=goTodo
|
||||
syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell
|
||||
syn region goComment start="//" end="$" contains=@goCommentGroup,@Spell
|
||||
|
||||
syn region goComment start="//" end="$" contains=goGenerate,@goCommentGroup,@Spell
|
||||
if s:FoldEnable('comment')
|
||||
syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell fold
|
||||
syn match goComment "\v(^\s*//.*\n)+" contains=goGenerate,@goCommentGroup,@Spell fold
|
||||
else
|
||||
syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell
|
||||
endif
|
||||
|
||||
hi def link goComment Comment
|
||||
hi def link goTodo Todo
|
||||
|
||||
if s:HighlightGenerateTags()
|
||||
syn match goGenerateVariables contained /\%(\$GOARCH\|\$GOOS\|\$GOFILE\|\$GOLINE\|\$GOPACKAGE\|\$DOLLAR\)\>/
|
||||
syn region goGenerate start="^\s*//go:generate" end="$" contains=goGenerateVariables
|
||||
hi def link goGenerate PreProc
|
||||
hi def link goGenerateVariables Special
|
||||
endif
|
||||
|
||||
" Go escapes
|
||||
syn match goEscapeOctal display contained "\\[0-7]\{3}"
|
||||
syn match goEscapeC display contained +\\[abfnrtv\\'"]+
|
||||
@ -118,8 +179,30 @@ hi def link goEscapeError Error
|
||||
|
||||
" Strings and their contents
|
||||
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
|
||||
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
|
||||
syn region goRawString start=+`+ end=+`+
|
||||
if s:HighlightStringSpellcheck()
|
||||
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup,@Spell
|
||||
syn region goRawString start=+`+ end=+`+ contains=@Spell
|
||||
else
|
||||
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
|
||||
syn region goRawString start=+`+ end=+`+
|
||||
endif
|
||||
|
||||
if s:HighlightFormatStrings()
|
||||
" [n] notation is valid for specifying explicit argument indexes
|
||||
" 1. Match a literal % not preceded by a %.
|
||||
" 2. Match any number of -, #, 0, space, or +
|
||||
" 3. Match * or [n]* or any number or nothing before a .
|
||||
" 4. Match * or [n]* or any number or nothing after a .
|
||||
" 5. Match [n] or nothing before a verb
|
||||
" 6. Match a formatting verb
|
||||
syn match goFormatSpecifier /\
|
||||
\%([^%]\%(%%\)*\)\
|
||||
\@<=%[-#0 +]*\
|
||||
\%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\
|
||||
\%(\.\%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\)\=\
|
||||
\%(\[\d\+\]\)\=[vTtbcdoqxXUeEfFgGspw]/ contained containedin=goString,goRawString
|
||||
hi def link goFormatSpecifier goSpecialString
|
||||
endif
|
||||
|
||||
hi def link goString String
|
||||
hi def link goRawString String
|
||||
@ -131,71 +214,263 @@ syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=
|
||||
hi def link goCharacter Character
|
||||
|
||||
" Regions
|
||||
syn region goBlock start="{" end="}" transparent fold
|
||||
syn region goParen start='(' end=')' transparent
|
||||
if s:FoldEnable('block')
|
||||
syn region goBlock start="{" end="}" transparent fold
|
||||
else
|
||||
syn region goBlock start="{" end="}" transparent
|
||||
endif
|
||||
|
||||
" import
|
||||
if s:FoldEnable('import')
|
||||
syn region goImport start='import (' end=')' transparent fold contains=goImport,goString,goComment
|
||||
else
|
||||
syn region goImport start='import (' end=')' transparent contains=goImport,goString,goComment
|
||||
endif
|
||||
|
||||
" var, const
|
||||
if s:FoldEnable('varconst')
|
||||
syn region goVar start='var (' end='^\s*)$' transparent fold
|
||||
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
|
||||
syn region goConst start='const (' end='^\s*)$' transparent fold
|
||||
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
|
||||
else
|
||||
syn region goVar start='var (' end='^\s*)$' transparent
|
||||
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
|
||||
syn region goConst start='const (' end='^\s*)$' transparent
|
||||
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
|
||||
endif
|
||||
|
||||
" Single-line var, const, and import.
|
||||
syn match goSingleDecl /\%(import\|var\|const\) [^(]\@=/ contains=goImport,goVar,goConst
|
||||
|
||||
" Integers
|
||||
syn match goDecimalInt "\<\d\+\([Ee]\d\+\)\?\>"
|
||||
syn match goHexadecimalInt "\<0x\x\+\>"
|
||||
syn match goOctalInt "\<0\o\+\>"
|
||||
syn match goOctalError "\<0\o*[89]\d*\>"
|
||||
syn match goDecimalInt "\<-\=\(0\|[1-9]_\?\(\d\|\d\+_\?\d\+\)*\)\%([Ee][-+]\=\d\+\)\=\>"
|
||||
syn match goDecimalError "\<-\=\(_\(\d\+_*\)\+\|\([1-9]\d*_*\)\+__\(\d\+_*\)\+\|\([1-9]\d*_*\)\+_\+\)\%([Ee][-+]\=\d\+\)\=\>"
|
||||
syn match goHexadecimalInt "\<-\=0[xX]_\?\(\x\+_\?\)\+\>"
|
||||
syn match goHexadecimalError "\<-\=0[xX]_\?\(\x\+_\?\)*\(\([^ \t0-9A-Fa-f_)]\|__\)\S*\|_\)\>"
|
||||
syn match goOctalInt "\<-\=0[oO]\?_\?\(\o\+_\?\)\+\>"
|
||||
syn match goOctalError "\<-\=0[0-7oO_]*\(\([^ \t0-7oOxX_/)\]\}\:]\|[oO]\{2,\}\|__\)\S*\|_\|[oOxX]\)\>"
|
||||
syn match goBinaryInt "\<-\=0[bB]_\?\([01]\+_\?\)\+\>"
|
||||
syn match goBinaryError "\<-\=0[bB]_\?[01_]*\([^ \t01_)]\S*\|__\S*\|_\)\>"
|
||||
|
||||
hi def link goDecimalInt Integer
|
||||
hi def link goDecimalError Error
|
||||
hi def link goHexadecimalInt Integer
|
||||
hi def link goHexadecimalError Error
|
||||
hi def link goOctalInt Integer
|
||||
hi def link goOctalError Error
|
||||
hi def link goBinaryInt Integer
|
||||
hi def link goBinaryError Error
|
||||
hi def link Integer Number
|
||||
|
||||
" Floating point
|
||||
syn match goFloat "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>"
|
||||
syn match goFloat "\<\.\d\+\([Ee][-+]\d\+\)\?\>"
|
||||
syn match goFloat "\<\d\+[Ee][-+]\d\+\>"
|
||||
syn match goFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=\>"
|
||||
syn match goFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=\>"
|
||||
|
||||
hi def link goFloat Float
|
||||
|
||||
" Imaginary literals
|
||||
syn match goImaginary "\<\d\+i\>"
|
||||
syn match goImaginary "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>"
|
||||
syn match goImaginary "\<\.\d\+\([Ee][-+]\d\+\)\?i\>"
|
||||
syn match goImaginary "\<\d\+[Ee][-+]\d\+i\>"
|
||||
syn match goImaginary "\<-\=\d\+i\>"
|
||||
syn match goImaginary "\<-\=\d\+[Ee][-+]\=\d\+i\>"
|
||||
syn match goImaginaryFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=i\>"
|
||||
syn match goImaginaryFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=i\>"
|
||||
|
||||
hi def link goImaginary Number
|
||||
hi def link goImaginaryFloat Float
|
||||
|
||||
" Spaces after "[]"
|
||||
if go_highlight_array_whitespace_error != 0
|
||||
syn match goSpaceError display "\(\[\]\)\@<=\s\+"
|
||||
if s:HighlightArrayWhitespaceError()
|
||||
syn match goSpaceError display "\%(\[\]\)\@<=\s\+"
|
||||
endif
|
||||
|
||||
" Spacing errors around the 'chan' keyword
|
||||
if go_highlight_chan_whitespace_error != 0
|
||||
if s:HighlightChanWhitespaceError()
|
||||
" receive-only annotation on chan type
|
||||
syn match goSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@="
|
||||
"
|
||||
" \(\<chan\>\)\@<!<- (only pick arrow when it doesn't come after a chan)
|
||||
" this prevents picking up 'chan<- chan<-' but not '<- chan'
|
||||
syn match goSpaceError display "\%(\%(\<chan\>\)\@<!<-\)\@<=\s\+\%(\<chan\>\)\@="
|
||||
|
||||
" send-only annotation on chan type
|
||||
syn match goSpaceError display "\(\<chan\)\@<=\s\+\(<-\)\@="
|
||||
"
|
||||
" \(<-\)\@<!\<chan\> (only pick chan when it doesn't come after an arrow)
|
||||
" this prevents picking up '<-chan <-chan' but not 'chan <-'
|
||||
syn match goSpaceError display "\%(\%(<-\)\@<!\<chan\>\)\@<=\s\+\%(<-\)\@="
|
||||
|
||||
" value-ignoring receives in a few contexts
|
||||
syn match goSpaceError display "\(\(^\|[={(,;]\)\s*<-\)\@<=\s\+"
|
||||
syn match goSpaceError display "\%(\%(^\|[={(,;]\)\s*<-\)\@<=\s\+"
|
||||
endif
|
||||
|
||||
" Extra types commonly seen
|
||||
if go_highlight_extra_types != 0
|
||||
syn match goExtraType /\<bytes\.\(Buffer\)\>/
|
||||
syn match goExtraType /\<io\.\(Reader\|Writer\|ReadWriter\|ReadWriteCloser\)\>/
|
||||
syn match goExtraType /\<reflect\.\(Kind\|Type\|Value\)\>/
|
||||
if s:HighlightExtraTypes()
|
||||
syn match goExtraType /\<bytes\.\%(Buffer\)\>/
|
||||
syn match goExtraType /\<context\.\%(Context\)\>/
|
||||
syn match goExtraType /\<io\.\%(Reader\|ReadSeeker\|ReadWriter\|ReadCloser\|ReadWriteCloser\|Writer\|WriteCloser\|Seeker\)\>/
|
||||
syn match goExtraType /\<reflect\.\%(Kind\|Type\|Value\)\>/
|
||||
syn match goExtraType /\<unsafe\.Pointer\>/
|
||||
endif
|
||||
|
||||
" Space-tab error
|
||||
if go_highlight_space_tab_error != 0
|
||||
if s:HighlightSpaceTabError()
|
||||
syn match goSpaceError display " \+\t"me=e-1
|
||||
endif
|
||||
|
||||
" Trailing white space error
|
||||
if go_highlight_trailing_whitespace_error != 0
|
||||
if s:HighlightTrailingWhitespaceError()
|
||||
syn match goSpaceError display excludenl "\s\+$"
|
||||
endif
|
||||
|
||||
hi def link goExtraType Type
|
||||
hi def link goSpaceError Error
|
||||
|
||||
|
||||
|
||||
" included from: https://github.com/athom/more-colorful.vim/blob/master/after/syntax/go.vim
|
||||
"
|
||||
" Comments; their contents
|
||||
syn keyword goTodo contained NOTE
|
||||
hi def link goTodo Todo
|
||||
|
||||
syn match goVarArgs /\.\.\./
|
||||
|
||||
" Operators;
|
||||
if s:HighlightOperators()
|
||||
" match single-char operators: - + % < > ! & | ^ * =
|
||||
" and corresponding two-char operators: -= += %= <= >= != &= |= ^= *= ==
|
||||
syn match goOperator /[-+%<>!&|^*=]=\?/
|
||||
" match / and /=
|
||||
syn match goOperator /\/\%(=\|\ze[^/*]\)/
|
||||
" match two-char operators: << >> &^
|
||||
" and corresponding three-char operators: <<= >>= &^=
|
||||
syn match goOperator /\%(<<\|>>\|&^\)=\?/
|
||||
" match remaining two-char operators: := && || <- ++ --
|
||||
syn match goOperator /:=\|||\|<-\|++\|--/
|
||||
" match ...
|
||||
|
||||
hi def link goPointerOperator goOperator
|
||||
hi def link goVarArgs goOperator
|
||||
endif
|
||||
hi def link goOperator Operator
|
||||
|
||||
" Functions;
|
||||
if s:HighlightFunctions() || s:HighlightFunctionParameters()
|
||||
syn match goDeclaration /\<func\>/ nextgroup=goReceiver,goFunction,goSimpleParams skipwhite skipnl
|
||||
syn match goReceiverVar /\w\+\ze\s\+\%(\w\|\*\)/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained
|
||||
syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl
|
||||
syn match goFunction /\w\+/ nextgroup=goSimpleParams contained skipwhite skipnl
|
||||
syn match goReceiverType /\w\+/ contained
|
||||
if s:HighlightFunctionParameters()
|
||||
syn match goSimpleParams /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType nextgroup=goFunctionReturn skipwhite skipnl
|
||||
syn match goFunctionReturn /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType skipwhite skipnl
|
||||
syn match goParamName /\w\+\%(\s*,\s*\w\+\)*\ze\s\+\%(\w\|\.\|\*\|\[\)/ contained nextgroup=goParamType skipwhite skipnl
|
||||
syn match goParamType /\%([^,)]\|\_s\)\+,\?/ contained nextgroup=goParamName skipwhite skipnl
|
||||
\ contains=goVarArgs,goType,goSignedInts,goUnsignedInts,goFloats,goComplexes,goDeclType,goBlock
|
||||
hi def link goReceiverVar goParamName
|
||||
hi def link goParamName Identifier
|
||||
endif
|
||||
syn match goReceiver /(\s*\w\+\%(\s\+\*\?\s*\w\+\)\?\s*)\ze\s*\w/ contained nextgroup=goFunction contains=goReceiverVar skipwhite skipnl
|
||||
else
|
||||
syn keyword goDeclaration func
|
||||
endif
|
||||
hi def link goFunction Function
|
||||
|
||||
" Function calls;
|
||||
if s:HighlightFunctionCalls()
|
||||
syn match goFunctionCall /\w\+\ze(/ contains=goBuiltins,goDeclaration
|
||||
endif
|
||||
hi def link goFunctionCall Type
|
||||
|
||||
" Fields;
|
||||
if s:HighlightFields()
|
||||
" 1. Match a sequence of word characters coming after a '.'
|
||||
" 2. Require the following but dont match it: ( \@= see :h E59)
|
||||
" - The symbols: / - + * % OR
|
||||
" - The symbols: [] {} <> ) OR
|
||||
" - The symbols: \n \r space OR
|
||||
" - The symbols: , : .
|
||||
" 3. Have the start of highlight (hs) be the start of matched
|
||||
" pattern (s) offsetted one to the right (+1) (see :h E401)
|
||||
syn match goField /\.\w\+\
|
||||
\%(\%([\/\-\+*%]\)\|\
|
||||
\%([\[\]{}<\>\)]\)\|\
|
||||
\%([\!=\^|&]\)\|\
|
||||
\%([\n\r\ ]\)\|\
|
||||
\%([,\:.]\)\)\@=/hs=s+1
|
||||
endif
|
||||
hi def link goField Identifier
|
||||
|
||||
" Structs & Interfaces;
|
||||
if s:HighlightTypes()
|
||||
syn match goTypeConstructor /\<\w\+{\@=/
|
||||
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
|
||||
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
|
||||
syn match goDeclType /\<\%(interface\|struct\)\>/ skipwhite skipnl
|
||||
hi def link goReceiverType Type
|
||||
else
|
||||
syn keyword goDeclType struct interface
|
||||
syn keyword goDeclaration type
|
||||
endif
|
||||
hi def link goTypeConstructor Type
|
||||
hi def link goTypeName Type
|
||||
hi def link goTypeDecl Keyword
|
||||
hi def link goDeclType Keyword
|
||||
|
||||
" Variable Assignments
|
||||
if s:HighlightVariableAssignments()
|
||||
syn match goVarAssign /\v[_.[:alnum:]]+(,\s*[_.[:alnum:]]+)*\ze(\s*([-^+|^\/%&]|\*|\<\<|\>\>|\&\^)?\=[^=])/
|
||||
hi def link goVarAssign Special
|
||||
endif
|
||||
|
||||
" Variable Declarations
|
||||
if s:HighlightVariableDeclarations()
|
||||
syn match goVarDefs /\v\w+(,\s*\w+)*\ze(\s*:\=)/
|
||||
hi def link goVarDefs Special
|
||||
endif
|
||||
|
||||
" Build Constraints
|
||||
if s:HighlightBuildConstraints()
|
||||
syn match goBuildKeyword display contained "+build"
|
||||
" Highlight the known values of GOOS, GOARCH, and other +build options.
|
||||
syn keyword goBuildDirectives contained
|
||||
\ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9
|
||||
\ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64
|
||||
\ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc
|
||||
\ s390 s390x sparc sparc64 cgo ignore race
|
||||
|
||||
" Other words in the build directive are build tags not listed above, so
|
||||
" avoid highlighting them as comments by using a matchgroup just for the
|
||||
" start of the comment.
|
||||
" The rs=s+2 option lets the \s*+build portion be part of the inner region
|
||||
" instead of the matchgroup so it will be highlighted as a goBuildKeyword.
|
||||
syn region goBuildComment matchgroup=goBuildCommentStart
|
||||
\ start="//\s*+build\s"rs=s+2 end="$"
|
||||
\ contains=goBuildKeyword,goBuildDirectives
|
||||
hi def link goBuildCommentStart Comment
|
||||
hi def link goBuildDirectives Type
|
||||
hi def link goBuildKeyword PreProc
|
||||
endif
|
||||
|
||||
if s:HighlightBuildConstraints() || s:FoldEnable('package_comment')
|
||||
" One or more line comments that are followed immediately by a "package"
|
||||
" declaration are treated like package documentation, so these must be
|
||||
" matched as comments to avoid looking like working build constraints.
|
||||
" The he, me, and re options let the "package" itself be highlighted by
|
||||
" the usual rules.
|
||||
exe 'syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/'
|
||||
\ . ' end=/\v\n\s*package/he=e-7,me=e-7,re=e-7'
|
||||
\ . ' contains=@goCommentGroup,@Spell'
|
||||
\ . (s:FoldEnable('package_comment') ? ' fold' : '')
|
||||
exe 'syn region goPackageComment start=/\v^\s*\/\*.*\n(.*\n)*\s*\*\/\npackage/'
|
||||
\ . ' end=/\v\*\/\n\s*package/he=e-7,me=e-7,re=e-7'
|
||||
\ . ' contains=@goCommentGroup,@Spell'
|
||||
\ . (s:FoldEnable('package_comment') ? ' fold' : '')
|
||||
hi def link goPackageComment Comment
|
||||
endif
|
||||
|
||||
" :GoCoverage commands
|
||||
hi def link goCoverageNormalText Comment
|
||||
|
||||
" Search backwards for a global declaration to start processing the syntax.
|
||||
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
|
||||
|
||||
@ -203,6 +478,9 @@ hi def link goSpaceError Error
|
||||
" following as a more expensive/less precise workaround.
|
||||
syn sync minlines=500
|
||||
|
||||
let b:current_syntax = 'go'
|
||||
let b:current_syntax = "go"
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" vim: sw=2 sts=2 et
|
||||
|
85
runtime/syntax/gvpr.vim
Normal file
85
runtime/syntax/gvpr.vim
Normal file
@ -0,0 +1,85 @@
|
||||
" Vim syntax file
|
||||
" Language: Graphviz program
|
||||
" Maintainer: Matthew Fernandez <matthew.fernandez@gmail.com>
|
||||
" Last Change: Tue, 28 Jul 2020 17:20:44 -0700
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn keyword gvArg ARGC ARGV
|
||||
syn keyword gvBeg BEGIN BEG_G N E END END_G
|
||||
syn keyword gvFunc
|
||||
\ graph fstsubg isDirect isStrict isSubg nEdges nNodes nxtsubg subg
|
||||
\ degreeOf fstnode indegreeOf isNode isSubnode node nxtnode nxtnode_sg
|
||||
\ outDegreeOf subnode
|
||||
\ edge edge_sg fstedge fstedge_sg fstin fstin_sg fstout fstout_sg isEdge
|
||||
\ isEdge_sg isSubedge nxtedge nxtedge_sg nxtin nxtin_sg nxtout nxtout_sg opp
|
||||
\ subedge
|
||||
\ freadG fwriteG readG write[] writeG
|
||||
\ aget aset clone cloneG compOf copy[] copyA delete[] fstAttr getDflt hasAttr
|
||||
\ induce isAttr isIn kindOf lock[] nxtAttr setDflt
|
||||
\ canon gsub html index ishtml length llOf match[] rindex split[] sprintf
|
||||
\ sscanf strcmp sub substr tokens tolower toupper urOf xOf yOf
|
||||
\ closeF openF print[] printf scanf readL
|
||||
\ atan2 cos exp log MAX MIN pow sin[] sqrt
|
||||
\ in[] unset
|
||||
\ colorx exit[] rand srand system
|
||||
syn keyword gvCons
|
||||
\ NULL TV_bfs TV_dfs TV_en TV_flat TV_fwd TV_ne TV_prepostdfs TV_prepostfwd
|
||||
\ TV_prepostrev TV_postdfs TV_postfwd tv_postrev TV_rev
|
||||
syn keyword gvType char double float int long unsigned void
|
||||
\ string
|
||||
\ edge_t graph_t node_t obj_t
|
||||
syn match gvVar
|
||||
\ "\$\(\(F\|G\|NG\|O\|T\|tgtname\|tvedge\|tvnext\|tvroot\|tvtype\)\>\)\?\(\<\)\@!"
|
||||
syn keyword gvWord break continue else for forr if return switch while
|
||||
|
||||
" numbers adapted from c.vim's cNumbers and friends
|
||||
syn match gvNums transparent "\<\d\|\.\d" contains=gvNumber,gvFloat,gvOctal
|
||||
syn match gvNumber contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
|
||||
syn match gvNumber contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
|
||||
syn match gvOctal contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=gvOctalZero
|
||||
syn match gvOctalZero contained "\<0"
|
||||
syn match gvFloat contained "\d\+f"
|
||||
syn match gvFloat contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
|
||||
syn match gvFloat contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
|
||||
syn match gvFloat contained "\d\+e[-+]\=\d\+[fl]\=\>"
|
||||
|
||||
syn region gvString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=gvFormat,gvSpecial extend
|
||||
syn region gvString start="'" skip="\\\\\|\\'" end="'" contains=gvFormat,gvSpecial extend
|
||||
|
||||
" adapted from c.vim's cFormat for c_no_c99
|
||||
syn match gvFormat "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
||||
|
||||
syn match gvSpecial "\\." contained
|
||||
|
||||
syn region gvCComment start="//" skip="\\$" end="$" keepend
|
||||
syn region gvCPPComment start="#" skip="\\$" end="$" keepend
|
||||
syn region gvCXXComment start="/\*" end="\*/" fold
|
||||
|
||||
hi def link gvArg Identifier
|
||||
hi def link gvBeg Keyword
|
||||
hi def link gvFloat Number
|
||||
hi def link gvFunc Identifier
|
||||
hi def link gvCons Number
|
||||
hi def link gvNumber Number
|
||||
hi def link gvType Type
|
||||
hi def link gvVar Statement
|
||||
hi def link gvWord Keyword
|
||||
|
||||
hi def link gvString String
|
||||
hi def link gvFormat Special
|
||||
hi def link gvSpecial Special
|
||||
|
||||
hi def link gvCComment Comment
|
||||
hi def link gvCPPComment Comment
|
||||
hi def link gvCXXComment Comment
|
||||
|
||||
let b:current_syntax = "gvpr"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim help file
|
||||
" Maintainer: Bram Moolenaar (Bram@vim.org)
|
||||
" Last Change: 2020 Jul 28
|
||||
" Last Change: 2021 Jun 13
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@ -76,6 +76,7 @@ syn match helpSpecial "\[line]"
|
||||
syn match helpSpecial "\[count]"
|
||||
syn match helpSpecial "\[offset]"
|
||||
syn match helpSpecial "\[cmd]"
|
||||
syn match helpNormal "vim9\[cmd]"
|
||||
syn match helpSpecial "\[num]"
|
||||
syn match helpSpecial "\[+num]"
|
||||
syn match helpSpecial "\[-num]"
|
||||
|
44
runtime/syntax/jsonc.vim
Normal file
44
runtime/syntax/jsonc.vim
Normal file
@ -0,0 +1,44 @@
|
||||
" Vim syntax file
|
||||
" Language: JSONC (JSON with Comments)
|
||||
" Original Author: Izhak Jakov <izhak724@gmail.com>
|
||||
" Acknowledgement: Based off of vim-jsonc maintained by Kevin Locke <kevin@kevinlocke.name>
|
||||
" https://github.com/kevinoid/vim-jsonc
|
||||
" License: MIT
|
||||
" Last Change: 2021-07-01
|
||||
|
||||
" Ensure syntax is loaded once, unless nested inside another (main) syntax
|
||||
" For description of main_syntax, see https://stackoverflow.com/q/16164549
|
||||
if !exists('g:main_syntax')
|
||||
if exists('b:current_syntax') && b:current_syntax ==# 'jsonc'
|
||||
finish
|
||||
endif
|
||||
let g:main_syntax = 'jsonc'
|
||||
endif
|
||||
|
||||
" Based on vim-json syntax
|
||||
runtime! syntax/json.vim
|
||||
|
||||
" Remove syntax group for comments treated as errors
|
||||
if !exists("g:vim_json_warnings") || g:vim_json_warnings
|
||||
syn clear jsonCommentError
|
||||
endif
|
||||
|
||||
syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze\(\_s*\/\/.*\_s*\)*[}\]]/ contains=jsonString
|
||||
syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze\_s*\/\*\_.*\*\/\_s*[}\]]/ contains=jsonString
|
||||
syn match jsonTrailingCommaError /\(,\)\+\ze\(\_s*\/\/.*\_s*\)*[}\]]/
|
||||
syn match jsonTrailingCommaError /\(,\)\+\ze\_s*\/\*\_.*\*\/\_s*[}\]]/
|
||||
|
||||
" Define syntax matching comments and their contents
|
||||
syn keyword jsonCommentTodo FIXME NOTE TBD TODO XXX
|
||||
syn region jsonLineComment start=+\/\/+ end=+$+ contains=@Spell,jsonCommentTodo keepend
|
||||
syn region jsonComment start='/\*' end='\*/' contains=@Spell,jsonCommentTodo fold
|
||||
|
||||
" Link comment syntax comment to highlighting
|
||||
hi! def link jsonLineComment Comment
|
||||
hi! def link jsonComment Comment
|
||||
|
||||
" Set/Unset syntax to avoid duplicate inclusion and correctly handle nesting
|
||||
let b:current_syntax = 'jsonc'
|
||||
if g:main_syntax ==# 'jsonc'
|
||||
unlet g:main_syntax
|
||||
endif
|
550
runtime/syntax/julia.vim
Normal file
550
runtime/syntax/julia.vim
Normal file
@ -0,0 +1,550 @@
|
||||
" Vim syntax file
|
||||
" Language: julia
|
||||
" Maintainer: Carlo Baldassi <carlobaldassi@gmail.com>
|
||||
" Homepage: https://github.com/JuliaEditorSupport/julia-vim
|
||||
" Last Change: 2021 Aug 04
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if version < 704
|
||||
" this is used to disable regex syntax like `\@3<='
|
||||
" on older vim versions
|
||||
function! s:d(x)
|
||||
return ''
|
||||
endfunction
|
||||
else
|
||||
function! s:d(x)
|
||||
return string(a:x)
|
||||
endfunction
|
||||
endif
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
let s:julia_spellcheck_strings = get(g:, "julia_spellcheck_strings", 0)
|
||||
let s:julia_spellcheck_docstrings = get(g:, "julia_spellcheck_docstrings", 1)
|
||||
let s:julia_spellcheck_comments = get(g:, "julia_spellcheck_comments", 1)
|
||||
|
||||
let s:julia_highlight_operators = get(g:, "julia_highlight_operators", 1)
|
||||
|
||||
" List of characters, up to \UFF, which cannot be used in identifiers.
|
||||
" (It includes operator characters; we don't consider them identifiers.)
|
||||
" This is used mostly in lookbehinds with `\@<=`, e.g. when we need to check
|
||||
" that that we're not in the middle of an identifier.
|
||||
" It doesn't include a few characters (spaces and all closing parentheses)
|
||||
" because those may or may not be valid in the lookbehind on a case-by-case
|
||||
" basis.
|
||||
let s:nonid_chars = '\U00-\U08' . '\U0A-\U1F'
|
||||
\ . '\U21-\U28' . '\U2A-\U2F' . '\U3A-\U40' . '\U5B-\U5E' . '\U60' . '\U7B\U7C'
|
||||
\ . '\U7E-\UA1' . '\UA7\UA8' . '\UAB-\UAD' . '\UAF\UB1\UB4' . '\UB6-\UB8' . '\UBB\UBF' . '\UD7\UF7'
|
||||
|
||||
" The complete list
|
||||
let s:nonidS_chars = '[:space:])\U5D}' . s:nonid_chars
|
||||
|
||||
|
||||
" List of all valid operator chars up to \UFF (NOTE: they must all be included
|
||||
" in s:nonidS_chars, so that if we include that, then this is redundant)
|
||||
" It does not include '!' since it can be used in an identifier.
|
||||
" The list contains the following characters: '%&*+-/<=>\\^|~¬±×÷'
|
||||
let s:op_chars = '\U25\U26\U2A\U2B\U2D\U2F\U3C-\U3E\U5C\U5E\U7C\U7E\UAC\UB1\UD7\UF7'
|
||||
|
||||
" List of all valid operator chars above \UFF
|
||||
" Written with ranges for performance reasons
|
||||
" The list contains the following characters: '…⁝⅋←↑→↓↔↚↛↜↝↞↠↢↣↤↦↩↪↫↬↮↶↷↺↻↼↽⇀⇁⇄⇆⇇⇉⇋⇌⇍⇎⇏⇐⇒⇔⇚⇛⇜⇝⇠⇢⇴⇵⇶⇷⇸⇹⇺⇻⇼⇽⇾⇿∈∉∊∋∌∍∓∔∗∘∙√∛∜∝∤∥∦∧∨∩∪∷∸∺∻∽∾≀≁≂≃≄≅≆≇≈≉≊≋≌≍≎≏≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≠≡≢≣≤≥≦≧≨≩≪≫≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿⊀⊁⊂⊃⊄⊅⊆⊇⊈⊉⊊⊋⊍⊎⊏⊐⊑⊒⊓⊔⊕⊖⊗⊘⊙⊚⊛⊜⊞⊟⊠⊡⊢⊣⊩⊬⊮⊰⊱⊲⊳⊴⊵⊶⊷⊻⊼⊽⋄⋅⋆⋇⋉⋊⋋⋌⋍⋎⋏⋐⋑⋒⋓⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩⋪⋫⋬⋭⋮⋯⋰⋱⋲⋳⋴⋵⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿⌿▷⟂⟈⟉⟑⟒⟕⟖⟗⟰⟱⟵⟶⟷⟹⟺⟻⟼⟽⟾⟿⤀⤁⤂⤃⤄⤅⤆⤇⤈⤉⤊⤋⤌⤍⤎⤏⤐⤑⤒⤓⤔⤕⤖⤗⤘⤝⤞⤟⤠⥄⥅⥆⥇⥈⥉⥊⥋⥌⥍⥎⥏⥐⥑⥒⥓⥔⥕⥖⥗⥘⥙⥚⥛⥜⥝⥞⥟⥠⥡⥢⥣⥤⥥⥦⥧⥨⥩⥪⥫⥬⥭⥮⥯⥰⦷⦸⦼⦾⦿⧀⧁⧡⧣⧤⧥⧴⧶⧷⧺⧻⨇⨈⨝⨟⨢⨣⨤⨥⨦⨧⨨⨩⨪⨫⨬⨭⨮⨰⨱⨲⨳⨴⨵⨶⨷⨸⨹⨺⨻⨼⨽⩀⩁⩂⩃⩄⩅⩊⩋⩌⩍⩎⩏⩐⩑⩒⩓⩔⩕⩖⩗⩘⩚⩛⩜⩝⩞⩟⩠⩡⩢⩣⩦⩧⩪⩫⩬⩭⩮⩯⩰⩱⩲⩳⩴⩵⩶⩷⩸⩹⩺⩻⩼⩽⩾⩿⪀⪁⪂⪃⪄⪅⪆⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒⪓⪔⪕⪖⪗⪘⪙⪚⪛⪜⪝⪞⪟⪠⪡⪢⪣⪤⪥⪦⪧⪨⪩⪪⪫⪬⪭⪮⪯⪰⪱⪲⪳⪴⪵⪶⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂⫃⫄⫅⫆⫇⫈⫉⫊⫋⫌⫍⫎⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫛⫷⫸⫹⫺⬰⬱⬲⬳⬴⬵⬶⬷⬸⬹⬺⬻⬼⬽⬾⬿⭀⭁⭂⭃⭄⭇⭈⭉⭊⭋⭌←↑→↓'
|
||||
let s:op_chars_wc = '\U2026\U205D\U214B\U2190-\U2194\U219A-\U219E\U21A0\U21A2-\U21A4\U21A6\U21A9-\U21AC\U21AE\U21B6\U21B7\U21BA-\U21BD\U21C0\U21C1\U21C4\U21C6\U21C7\U21C9\U21CB-\U21D0\U21D2\U21D4\U21DA-\U21DD\U21E0\U21E2\U21F4-\U21FF\U2208-\U220D\U2213\U2214\U2217-\U221D\U2224-\U222A\U2237\U2238\U223A\U223B\U223D\U223E\U2240-\U228B\U228D-\U229C\U229E-\U22A3\U22A9\U22AC\U22AE\U22B0-\U22B7\U22BB-\U22BD\U22C4-\U22C7\U22C9-\U22D3\U22D5-\U22FF\U233F\U25B7\U27C2\U27C8\U27C9\U27D1\U27D2\U27D5-\U27D7\U27F0\U27F1\U27F5-\U27F7\U27F9-\U27FF\U2900-\U2918\U291D-\U2920\U2944-\U2970\U29B7\U29B8\U29BC\U29BE-\U29C1\U29E1\U29E3-\U29E5\U29F4\U29F6\U29F7\U29FA\U29FB\U2A07\U2A08\U2A1D\U2A1F\U2A22-\U2A2E\U2A30-\U2A3D\U2A40-\U2A45\U2A4A-\U2A58\U2A5A-\U2A63\U2A66\U2A67\U2A6A-\U2AD9\U2ADB\U2AF7-\U2AFA\U2B30-\U2B44\U2B47-\U2B4C\UFFE9-\UFFEC'
|
||||
|
||||
" Full operators regex
|
||||
let s:operators = '\%(' . '\.\%([-+*/^÷%|&⊻]\|//\|\\\|>>\|>>>\?\)\?=' .
|
||||
\ '\|' . '[:<>]=\|||\|&&\||>\|<|\|[<>:]:\|<<\|>>>\?\|//\|[-=]>\|\.\.\.\?' .
|
||||
\ '\|' . '\.\?[!' . s:op_chars . s:op_chars_wc . ']' .
|
||||
\ '\)'
|
||||
|
||||
|
||||
" Characters that can be used to start an identifier. Above \UBF we don't
|
||||
" bother checking. (If a UTF8 operator is used, it will take precedence anyway.)
|
||||
let s:id_charsH = '\%([A-Za-z_\UA2-\UA6\UA9\UAA\UAE\UB0\UB5\UBA]\|[^\U00-\UBF]\)'
|
||||
" Characters that can appear in an identifier, starting in 2nd position. Above
|
||||
" \UBF we check for operators since we need to stop the identifier if one
|
||||
" appears. We don't check for invalid characters though.
|
||||
let s:id_charsW = '\%([0-9A-Za-z_!\UA2-\UA6\UA9\UAA\UAE-\UB0\UB2-\UB5\UB8-\UBA\UBC-\UBE]\|[^\U00-\UBF]\@=[^' . s:op_chars_wc . ']\)'
|
||||
|
||||
" A valid julia identifier, more or less
|
||||
let s:idregex = '\%(' . s:id_charsH . s:id_charsW . '*\)'
|
||||
|
||||
|
||||
|
||||
syn case match
|
||||
|
||||
syntax cluster juliaExpressions contains=@juliaParItems,@juliaStringItems,@juliaKeywordItems,@juliaBlocksItems,@juliaTypesItems,@juliaConstItems,@juliaMacroItems,@juliaSymbolItems,@juliaOperatorItems,@juliaNumberItems,@juliaCommentItems,@juliaErrorItems,@juliaSyntaxRegions
|
||||
syntax cluster juliaExprsPrintf contains=@juliaExpressions,@juliaPrintfItems
|
||||
syntax cluster juliaExprsNodot contains=@juliaParItems,@juliaStringItems,@juliaMacroItems,@juliaSymbolItems,@juliaOperatorItems,@juliaCommentItems,juliaIdSymbol
|
||||
|
||||
syntax cluster juliaParItems contains=juliaParBlock,juliaSqBraIdxBlock,juliaSqBraBlock,juliaCurBraBlock,juliaQuotedParBlock,juliaQuotedQMarkPar
|
||||
syntax cluster juliaKeywordItems contains=juliaKeyword,juliaWhereKeyword,juliaImportLine,juliaInfixKeyword,juliaRepKeyword
|
||||
syntax cluster juliaBlocksItems contains=juliaConditionalBlock,juliaWhileBlock,juliaForBlock,juliaBeginBlock,juliaFunctionBlock,juliaMacroBlock,juliaQuoteBlock,juliaTypeBlock,juliaImmutableBlock,juliaExceptionBlock,juliaLetBlock,juliaDoBlock,juliaModuleBlock,juliaStructBlock,juliaMutableStructBlock,juliaAbstractBlock,juliaPrimitiveBlock
|
||||
syntax cluster juliaTypesItems contains=juliaBaseTypeBasic,juliaBaseTypeNum,juliaBaseTypeC,juliaBaseTypeError,juliaBaseTypeIter,juliaBaseTypeString,juliaBaseTypeArray,juliaBaseTypeDict,juliaBaseTypeSet,juliaBaseTypeIO,juliaBaseTypeProcess,juliaBaseTypeRange,juliaBaseTypeRegex,juliaBaseTypeFact,juliaBaseTypeFact,juliaBaseTypeSort,juliaBaseTypeRound,juliaBaseTypeSpecial,juliaBaseTypeRandom,juliaBaseTypeDisplay,juliaBaseTypeTime,juliaBaseTypeOther
|
||||
|
||||
syntax cluster juliaConstItems contains=juliaConstNum,juliaConstBool,juliaConstEnv,juliaConstMMap,juliaConstC,juliaConstGeneric,juliaConstIO,juliaPossibleEuler
|
||||
|
||||
syntax cluster juliaMacroItems contains=juliaPossibleMacro,juliaDollarVar,juliaDollarPar,juliaDollarSqBra
|
||||
syntax cluster juliaSymbolItems contains=juliaPossibleSymbol
|
||||
syntax cluster juliaNumberItems contains=juliaNumbers
|
||||
syntax cluster juliaStringItems contains=juliaChar,juliaString,juliabString,juliasString,juliaShellString,juliaDocString,juliaRegEx
|
||||
syntax cluster juliaPrintfItems contains=juliaPrintfParBlock,juliaPrintfString
|
||||
syntax cluster juliaOperatorItems contains=juliaOperator,juliaRangeOperator,juliaCTransOperator,juliaTernaryRegion,juliaColon,juliaSemicolon,juliaComma
|
||||
syntax cluster juliaCommentItems contains=juliaCommentL,juliaCommentM
|
||||
syntax cluster juliaErrorItems contains=juliaErrorPar,juliaErrorEnd,juliaErrorElse,juliaErrorCatch,juliaErrorFinally
|
||||
|
||||
syntax cluster juliaSyntaxRegions contains=juliaIdSymbol,juliaTypeOperatorR2,juliaTypeOperatorR3,juliaWhereR,juliaDotted
|
||||
|
||||
syntax cluster juliaSpellcheckStrings contains=@spell
|
||||
syntax cluster juliaSpellcheckDocStrings contains=@spell
|
||||
syntax cluster juliaSpellcheckComments contains=@spell
|
||||
|
||||
if !s:julia_spellcheck_docstrings
|
||||
syntax cluster juliaSpellcheckDocStrings remove=@spell
|
||||
endif
|
||||
if !s:julia_spellcheck_strings
|
||||
syntax cluster juliaSpellcheckStrings remove=@spell
|
||||
endif
|
||||
if !s:julia_spellcheck_comments
|
||||
syntax cluster juliaSpellcheckComments remove=@spell
|
||||
endif
|
||||
|
||||
syntax match juliaSemicolon display ";"
|
||||
syntax match juliaComma display ","
|
||||
syntax match juliaColon display ":"
|
||||
|
||||
" A dot can introduce a sort of 'environment' such that words after it are not
|
||||
" recognized as keywords. This has low precedence so that it can be overridden
|
||||
" by operators
|
||||
syntax match juliaDotted transparent "\.\s*[^])}.]" contains=@juliaExprsNodot
|
||||
syntax match juliaDottedT contained transparent "\.\s*[^])}.]" contains=@juliaExprsNodot,juliaType
|
||||
|
||||
syntax match juliaErrorPar display "[])}]"
|
||||
syntax match juliaErrorEnd display "\<end\>"
|
||||
syntax match juliaErrorElse display "\<\%(else\|elseif\)\>"
|
||||
syntax match juliaErrorCatch display "\<catch\>"
|
||||
syntax match juliaErrorFinally display "\<finally\>"
|
||||
syntax match juliaErrorSemicol display contained ";"
|
||||
|
||||
syntax region juliaParBlock matchgroup=juliaParDelim start="(" end=")" contains=@juliaExpressions,juliaComprehensionFor
|
||||
syntax region juliaParBlockInRange matchgroup=juliaParDelim contained start="(" end=")" contains=@juliaExpressions,juliaParBlockInRange,juliaRangeKeyword,juliaComprehensionFor
|
||||
syntax region juliaSqBraIdxBlock matchgroup=juliaParDelim start="\[" end="\]" contains=@juliaExpressions,juliaParBlockInRange,juliaRangeKeyword,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS
|
||||
exec 'syntax region juliaSqBraBlock matchgroup=juliaParDelim start="\%(^\|\s\|' . s:operators . '\)\@'.s:d(3).'<=\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS'
|
||||
syntax region juliaCurBraBlock matchgroup=juliaParDelim start="{" end="}" contains=juliaType,juliaDottedT,@juliaExpressions
|
||||
|
||||
exec 'syntax match juliaType contained "\%(' . s:idregex . '\.\)*\zs' . s:idregex . '"'
|
||||
|
||||
" This is a generic identifier followed by some symbol, either a type
|
||||
" operator (<: or >:), or an open parenthesis, or an open curly bracket.
|
||||
" It's used to recognize one of the contained regions looking for identifiers
|
||||
" only once. Once recognized, those regions no longer need to use the
|
||||
" expensive s:idregex.
|
||||
exec 'syntax match juliaIdSymbol transparent "' . s:idregex . '\%(\s*[<>]:\|\.\?(\|{\|\"\)\@=" contains=juliaFunctionCall,juliaParamType,juliaStringPrefixed,juliaTypeOperatorR1'
|
||||
|
||||
syntax match juliaFunctionCall contained "[^{([:space:]<>\"]\+(\@=" nextgroup=juliaParBlock
|
||||
|
||||
exec 'syntax match juliaFunctionDef contained transparent "\%(\<\%(function\|macro\)\)\@'.s:d(8).'<=\s\+\zs' . s:idregex . '\%(\.' . s:idregex . '\)*\ze\s*\%((\|\send\>\|$\)" contains=juliaFunctionName'
|
||||
exec 'syntax match juliaFunctionName contained "\%(\<\%(function\|macro\)\s\+\)\@'.s:d(20).'<=\%(' . s:idregex . '\.\)*\zs' . s:idregex . '"'
|
||||
|
||||
exec 'syntax match juliaStructR contained transparent "\%(\<\%(\%(mutable\s\+\)\?struct\|\%(abstract\|primitive\)\s\+type\)\s\+\)\@'.s:d(20).'<=\%(' . s:idregex . '\.\)*' . s:idregex . '\>\(\s*(\)\@!" contains=juliaType'
|
||||
|
||||
syntax match juliaKeyword display "\<\%(return\|local\|global\|const\)\>"
|
||||
syntax match juliaInfixKeyword display "\%(=\s*\)\@<!\<\%(in\|isa\)\>\S\@!\%(\s*=\)\@!"
|
||||
|
||||
" The import/export/using keywords introduce a sort of special parsing
|
||||
" environment with its own rules
|
||||
exec 'syntax region juliaImportLine matchgroup=juliaKeyword excludenl start="\<\%(import\|using\|export\)\>" skip="\%(\%(\<\%(import\|using\|export\)\>\)\|^\)\@'.s:d(6).'<=$" end="$" end="\%([])}]\)\@=" contains=@juliaExpressions,juliaAsKeyword,@juliaContinuationItems,juliaMacroName'
|
||||
syntax match juliaAsKeyword display contained "\<as\>"
|
||||
|
||||
syntax match juliaRepKeyword display "\<\%(break\|continue\)\>"
|
||||
syntax region juliaConditionalBlock matchgroup=juliaConditional start="\<if\>" end="\<end\>" contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock fold
|
||||
syntax region juliaConditionalEIBlock matchgroup=juliaConditional transparent contained start="\<elseif\>" end="\<\%(end\|else\|elseif\)\>"me=s-1 contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock
|
||||
syntax region juliaConditionalEBlock matchgroup=juliaConditional transparent contained start="\<else\>" end="\<end\>"me=s-1 contains=@juliaExpressions
|
||||
syntax region juliaWhileBlock matchgroup=juliaRepeat start="\<while\>" end="\<end\>" contains=@juliaExpressions fold
|
||||
syntax region juliaForBlock matchgroup=juliaRepeat start="\<for\>" end="\<end\>" contains=@juliaExpressions,juliaOuter fold
|
||||
syntax region juliaBeginBlock matchgroup=juliaBlKeyword start="\<begin\>" end="\<end\>" contains=@juliaExpressions fold
|
||||
syntax region juliaFunctionBlock matchgroup=juliaBlKeyword start="\<function\>" end="\<end\>" contains=@juliaExpressions,juliaFunctionDef fold
|
||||
syntax region juliaMacroBlock matchgroup=juliaBlKeyword start="\<macro\>" end="\<end\>" contains=@juliaExpressions,juliaFunctionDef fold
|
||||
syntax region juliaQuoteBlock matchgroup=juliaBlKeyword start="\<quote\>" end="\<end\>" contains=@juliaExpressions fold
|
||||
syntax region juliaStructBlock matchgroup=juliaBlKeyword start="\<struct\>" end="\<end\>" contains=@juliaExpressions,juliaStructR fold
|
||||
syntax region juliaMutableStructBlock matchgroup=juliaBlKeyword start="\<mutable\s\+struct\>" end="\<end\>" contains=@juliaExpressions,juliaStructR fold
|
||||
syntax region juliaLetBlock matchgroup=juliaBlKeyword start="\<let\>" end="\<end\>" contains=@juliaExpressions fold
|
||||
syntax region juliaDoBlock matchgroup=juliaBlKeyword start="\<do\>" end="\<end\>" contains=@juliaExpressions fold
|
||||
syntax region juliaModuleBlock matchgroup=juliaBlKeyword start="\<\%(bare\)\?module\>" end="\<end\>" contains=@juliaExpressions fold
|
||||
syntax region juliaExceptionBlock matchgroup=juliaException start="\<try\>" end="\<end\>" contains=@juliaExpressions,juliaCatchBlock,juliaFinallyBlock fold
|
||||
syntax region juliaCatchBlock matchgroup=juliaException transparent contained start="\<catch\>" end="\<end\>"me=s-1 contains=@juliaExpressions,juliaFinallyBlock
|
||||
syntax region juliaFinallyBlock matchgroup=juliaException transparent contained start="\<finally\>" end="\<end\>"me=s-1 contains=@juliaExpressions
|
||||
syntax region juliaAbstractBlock matchgroup=juliaBlKeyword start="\<abstract\s\+type\>" end="\<end\>" fold contains=@juliaExpressions,juliaStructR
|
||||
syntax region juliaPrimitiveBlock matchgroup=juliaBlKeyword start="\<primitive\s\+type\>" end="\<end\>" fold contains=@juliaExpressions,juliaStructR
|
||||
|
||||
exec 'syntax region juliaComprehensionFor matchgroup=juliaComprehensionFor transparent contained start="\%([^[:space:],;:({[]\_s*\)\@'.s:d(80).'<=\<for\>" end="\ze[]);]" contains=@juliaExpressions,juliaComprehensionIf,juliaComprehensionFor'
|
||||
syntax match juliaComprehensionIf contained "\<if\>"
|
||||
|
||||
exec 'syntax match juliaOuter contained "\<outer\ze\s\+' . s:idregex . '\>"'
|
||||
|
||||
syntax match juliaRangeKeyword contained "\<\%(begin\|end\)\>"
|
||||
|
||||
syntax match juliaBaseTypeBasic display "\<\%(\%(N\|Named\)\?Tuple\|Symbol\|Function\|Union\%(All\)\?\|Type\%(Name\|Var\)\?\|Any\|ANY\|Vararg\|Ptr\|Exception\|Module\|Expr\|DataType\|\%(LineNumber\|Quote\)Node\|\%(Weak\|Global\)\?Ref\|Method\|Pair\|Val\|Nothing\|Some\|Missing\)\>"
|
||||
syntax match juliaBaseTypeNum display "\<\%(U\?Int\%(8\|16\|32\|64\|128\)\?\|Float\%(16\|32\|64\)\|Complex\|Bool\|Char\|Number\|Signed\|Unsigned\|Integer\|AbstractFloat\|Real\|Rational\|\%(Abstract\)\?Irrational\|Enum\|BigInt\|BigFloat\|MathConst\|ComplexF\%(16\|32\|64\)\)\>"
|
||||
syntax match juliaBaseTypeC display "\<\%(FileOffset\|C\%(u\?\%(char\|short\|int\|long\(long\)\?\|w\?string\)\|float\|double\|\%(ptrdiff\|s\?size\|wchar\|off\|u\?intmax\)_t\|void\)\)\>"
|
||||
syntax match juliaBaseTypeError display "\<\%(\%(Bounds\|Divide\|Domain\|\%(Stack\)\?Overflow\|EOF\|Undef\%(Ref\|Var\)\|System\|Type\|Parse\|Argument\|Key\|Load\|Method\|Inexact\|OutOfMemory\|Init\|Assertion\|ReadOnlyMemory\|StringIndex\)Error\|\%(Interrupt\|Error\|ProcessExited\|Captured\|Composite\|InvalidState\|Missing\|\%(Process\|Task\)Failed\)Exception\|DimensionMismatch\|SegmentationFault\)\>"
|
||||
syntax match juliaBaseTypeIter display "\<\%(EachLine\|Enumerate\|Cartesian\%(Index\|Range\)\|LinSpace\|CartesianIndices\)\>"
|
||||
syntax match juliaBaseTypeString display "\<\%(DirectIndex\|Sub\|Rep\|Rev\|Abstract\|Substitution\)\?String\>"
|
||||
syntax match juliaBaseTypeArray display "\<\%(\%(Sub\)\?Array\|\%(Abstract\|Dense\|Strided\)\?\%(Array\|Matrix\|Vec\%(tor\|OrMat\)\)\|SparseMatrixCSC\|\%(AbstractSparse\|Bit\|Shared\)\%(Array\|Vector\|Matrix\)\|\%\(D\|Bid\|\%(Sym\)\?Trid\)iagonal\|Hermitian\|Symmetric\|UniformScaling\|\%(Lower\|Upper\)Triangular\|\%(Sparse\|Row\)Vector\|VecElement\|Conj\%(Array\|Matrix\|Vector\)\|Index\%(Cartesian\|Linear\|Style\)\|PermutedDimsArray\|Broadcasted\|Adjoint\|Transpose\|LinearIndices\)\>"
|
||||
syntax match juliaBaseTypeDict display "\<\%(WeakKey\|Id\|Abstract\)\?Dict\>"
|
||||
syntax match juliaBaseTypeSet display "\<\%(\%(Abstract\|Bit\)\?Set\)\>"
|
||||
syntax match juliaBaseTypeIO display "\<\%(IO\%(Stream\|Buffer\|Context\)\?\|RawFD\|StatStruct\|FileMonitor\|PollingFileWatcher\|Timer\|Base64\%(Decode\|Encode\)Pipe\|\%(UDP\|TCP\)Socket\|\%(Abstract\)\?Channel\|BufferStream\|ReentrantLock\|GenericIOBuffer\)\>"
|
||||
syntax match juliaBaseTypeProcess display "\<\%(Pipe\|Cmd\|PipeBuffer\)\>"
|
||||
syntax match juliaBaseTypeRange display "\<\%(Dims\|RangeIndex\|\%(Abstract\|Lin\|Ordinal\|Step\|\%(Abstract\)\?Unit\)Range\|Colon\|ExponentialBackOff\|StepRangeLen\)\>"
|
||||
syntax match juliaBaseTypeRegex display "\<Regex\%(Match\)\?\>"
|
||||
syntax match juliaBaseTypeFact display "\<\%(Factorization\|BunchKaufman\|\%(Cholesky\|QR\)\%(Pivoted\)\?\|\%(Generalized\)\?\%(Eigen\|SVD\|Schur\)\|Hessenberg\|LDLt\|LQ\|LU\)\>"
|
||||
syntax match juliaBaseTypeSort display "\<\%(Insertion\|\(Partial\)\?Quick\|Merge\)Sort\>"
|
||||
syntax match juliaBaseTypeRound display "\<Round\%(ingMode\|FromZero\|Down\|Nearest\%(Ties\%(Away\|Up\)\)\?\|ToZero\|Up\)\>"
|
||||
syntax match juliaBaseTypeSpecial display "\<\%(LocalProcess\|ClusterManager\)\>"
|
||||
syntax match juliaBaseTypeRandom display "\<\%(AbstractRNG\|MersenneTwister\|RandomDevice\)\>"
|
||||
syntax match juliaBaseTypeDisplay display "\<\%(Text\(Display\)\?\|\%(Abstract\)\?Display\|MIME\|HTML\)\>"
|
||||
syntax match juliaBaseTypeTime display "\<\%(Date\%(Time\)\?\|DateFormat\)\>"
|
||||
syntax match juliaBaseTypeOther display "\<\%(RemoteRef\|Task\|Condition\|VersionNumber\|IPv[46]\|SerializationState\|WorkerConfig\|Future\|RemoteChannel\|IPAddr\|Stack\%(Trace\|Frame\)\|\(Caching\|Worker\)Pool\|AbstractSerializer\)\>"
|
||||
|
||||
syntax match juliaConstNum display "\%(\<\%(\%(NaN\|Inf\)\%(16\|32\|64\)\?\|pi\|π\)\>\)"
|
||||
" Note: recognition of ℯ, which Vim does not consider a valid identifier, is
|
||||
" complicated. We detect possible uses by just looking for the character (for
|
||||
" performance) and then check that it's actually used by its own.
|
||||
" (This also tries to detect preceding number constants; it does so in a crude
|
||||
" way.)
|
||||
syntax match juliaPossibleEuler "ℯ" contains=juliaEuler
|
||||
exec 'syntax match juliaEuler contained "\%(\%(^\|[' . s:nonidS_chars . s:op_chars_wc . ']\)\%(.\?[0-9][.0-9eEf_]*\d\)\?\)\@'.s:d(80).'<=ℯ\ze[' . s:nonidS_chars . s:op_chars_wc . ']"'
|
||||
syntax match juliaConstBool display "\<\%(true\|false\)\>"
|
||||
syntax match juliaConstEnv display "\<\%(ARGS\|ENV\|ENDIAN_BOM\|LOAD_PATH\|VERSION\|PROGRAM_FILE\|DEPOT_PATH\)\>"
|
||||
syntax match juliaConstIO display "\<\%(std\%(out\|in\|err\)\|devnull\)\>"
|
||||
syntax match juliaConstC display "\<\%(C_NULL\)\>"
|
||||
syntax match juliaConstGeneric display "\<\%(nothing\|Main\|undef\|missing\)\>"
|
||||
|
||||
syntax match juliaParamType contained "[^{([:space:]<>\"]\+\ze{" nextgroup=juliaCurBraBlock
|
||||
|
||||
syntax match juliaPossibleMacro transparent "@" contains=juliaMacroCall,juliaMacroCallP,juliaPrintfMacro,juliaDocMacro,juliaDocMacroPre
|
||||
|
||||
exec 'syntax match juliaMacro contained "@' . s:idregex . '\%(\.' . s:idregex . '\)*"'
|
||||
syntax match juliaMacro contained "@[!.~$%^*/\\|<>+-]\ze[^0-9]"
|
||||
exec 'syntax region juliaMacroCall contained transparent start="\(@' . s:idregex . '\%(\.' . s:idregex . '\)*\)\@=\1\%([^(]\|$\)" end="\ze\%([])};#]\|$\|\<for\>\|\<end\>\)" contains=@juliaExpressions,juliaMacro,juliaSymbolS,juliaQuotedParBlockS'
|
||||
exec 'syntax region juliaMacroCall contained transparent start="\(@.\)\@=\1\%([^(]\|$\)" end="\ze\%([])};#]\|$\|\<for\>\|\<end\>\)" contains=@juliaExpressions,juliaMacro,juliaSymbolS,juliaQuotedParBlockS'
|
||||
exec 'syntax region juliaMacroCallP contained transparent start="@' . s:idregex . '\%(\.' . s:idregex . '\)*(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaParBlock'
|
||||
exec 'syntax region juliaMacroCallP contained transparent start="@.(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaParBlock'
|
||||
|
||||
exec 'syntax match juliaNumbers transparent "\%(^\|[' . s:nonidS_chars . s:op_chars_wc . ']\)\@'.s:d(1).'<=\d\|\.\d\|im\>" contains=juliaNumber,juliaFloat,juliaComplexUnit'
|
||||
|
||||
"integer regexes
|
||||
let s:dec_regex = '\d\%(_\?\d\)*\%(\>\|im\>\|\ze\D\)'
|
||||
let s:hex_regex = '0x\x\%(_\?\x\)*\%(\>\|im\>\|\ze\X\)'
|
||||
let s:bin_regex = '0b[01]\%(_\?[01]\)*\%(\>\|im\>\|\ze[^01]\)'
|
||||
let s:oct_regex = '0o\o\%(_\?\o\)*\%(\>\|im\>\|\ze\O\)'
|
||||
|
||||
let s:int_regex = '\%(' . s:hex_regex .
|
||||
\ '\|' . s:bin_regex .
|
||||
\ '\|' . s:oct_regex .
|
||||
\ '\|' . s:dec_regex .
|
||||
\ '\)'
|
||||
|
||||
"floating point regexes
|
||||
" starting with a dot, optional exponent
|
||||
let s:float_regex1 = '\.\d\%(_\?\d\)*\%([eEf][-+]\?\d\+\)\?\%(\>\|im\>\|\ze\D\)'
|
||||
" with dot, optional exponent
|
||||
let s:float_regex2 = '\d\%(_\?\d\)*\.\%(\d\%(_\?\d\)*\)\?\%([eEf][-+]\?\d\+\)\?\%(\>\|im\>\|\ze\D\)'
|
||||
" without dot, with exponent
|
||||
let s:float_regex3 = '\d\%(_\?\d\)*[eEf][-+]\?\d\+\%(\>\|im\>\|\ze\D\)'
|
||||
|
||||
"hex floating point numbers
|
||||
" starting with a dot
|
||||
let s:hexfloat_regex1 = '0x\.\%\(\x\%(_\?\x\)*\)\?[pP][-+]\?\d\+\%(\>\|im\>\|\ze\X\)'
|
||||
" starting with a digit
|
||||
let s:hexfloat_regex2 = '0x\x\%(_\?\x\)*\%\(\.\%\(\x\%(_\?\x\)*\)\?\)\?[pP][-+]\?\d\+\%(\>\|im\>\|\ze\X\)'
|
||||
|
||||
let s:float_regex = '\%(' . s:float_regex3 .
|
||||
\ '\|' . s:float_regex2 .
|
||||
\ '\|' . s:float_regex1 .
|
||||
\ '\|' . s:hexfloat_regex2 .
|
||||
\ '\|' . s:hexfloat_regex1 .
|
||||
\ '\)'
|
||||
|
||||
exec 'syntax match juliaNumber contained "' . s:int_regex . '" contains=juliaComplexUnit'
|
||||
exec 'syntax match juliaFloat contained "' . s:float_regex . '" contains=juliaComplexUnit'
|
||||
syntax match juliaComplexUnit display contained "\<im\>"
|
||||
|
||||
syntax match juliaRangeOperator display ":"
|
||||
exec 'syntax match juliaOperator "' . s:operators . '"'
|
||||
|
||||
exec 'syntax region juliaTernaryRegion matchgroup=juliaTernaryOperator start="\s\zs?\ze\s" skip="\%(:\(:\|[^:[:space:]'."'".'"({[]\+\s*\ze:\)\|\%(?\s*\)\@'.s:d(6).'<=:(\)" end=":" contains=@juliaExpressions,juliaErrorSemicol'
|
||||
|
||||
let s:interp_dollar = '\([' . s:nonidS_chars . s:op_chars_wc . '!]\|^\)\@'.s:d(1).'<=\$'
|
||||
|
||||
exec 'syntax match juliaDollarVar display contained "' . s:interp_dollar . s:idregex . '"'
|
||||
exec 'syntax region juliaDollarPar matchgroup=juliaDollarVar contained start="' .s:interp_dollar . '(" end=")" contains=@juliaExpressions'
|
||||
exec 'syntax region juliaDollarSqBra matchgroup=juliaDollarVar contained start="' .s:interp_dollar . '\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS'
|
||||
|
||||
syntax match juliaChar "'\\\?.'" contains=juliaSpecialChar
|
||||
syntax match juliaChar display "'\\\o\{3\}'" contains=juliaOctalEscapeChar
|
||||
syntax match juliaChar display "'\\x\x\{2\}'" contains=juliaHexEscapeChar
|
||||
syntax match juliaChar display "'\\u\x\{1,4\}'" contains=juliaUniCharSmall
|
||||
syntax match juliaChar display "'\\U\x\{1,8\}'" contains=juliaUniCharLarge
|
||||
|
||||
exec 'syntax match juliaCTransOperator "[[:space:]}' . s:nonid_chars . s:op_chars_wc . '!]\@'.s:d(1).'<!\.\?' . "'" . 'ᵀ\?"'
|
||||
|
||||
" TODO: some of these might be specialized; the rest could be just left to the
|
||||
" generic juliaStringPrefixed fallback
|
||||
syntax region juliaString matchgroup=juliaStringDelim start=+\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaStringVars,@juliaSpecialChars,@juliaSpellcheckStrings
|
||||
syntax region juliaStringPrefixed contained matchgroup=juliaStringDelim start=+[^{([:space:]<>"]\+\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpecialCharsRaw
|
||||
syntax region juliabString matchgroup=juliaStringDelim start=+\<b\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpecialChars
|
||||
syntax region juliasString matchgroup=juliaStringDelim start=+\<s\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpecialChars
|
||||
|
||||
syntax region juliaDocString matchgroup=juliaDocStringDelim fold start=+^"""+ skip=+\%(\\\\\)*\\"+ end=+"""+ contains=@juliaStringVars,@juliaSpecialChars,@juliaSpellcheckDocStrings
|
||||
|
||||
exec 'syntax region juliaPrintfMacro contained transparent start="@s\?printf(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaPrintfParBlock'
|
||||
syntax region juliaPrintfMacro contained transparent start="@s\?printf\s\+" end="\ze\%([])};#]\|$\|\<for\>\)" contains=@juliaExprsPrintf,juliaMacro,juliaSymbolS,juliaQuotedParBlockS
|
||||
syntax region juliaPrintfParBlock contained matchgroup=juliaParDelim start="(" end=")" contains=@juliaExprsPrintf
|
||||
syntax region juliaPrintfString contained matchgroup=juliaStringDelim start=+"+ skip=+\%(\\\\\)*\\"+ end=+"+ contains=@juliaSpecialChars,@juliaPrintfChars
|
||||
|
||||
exec 'syntax region juliaDocMacroPre contained transparent start=+@doc\s\+\%(' . s:idregex . '\%(\.' . s:idregex . '\)*\)\z("\%(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\(\z1\)\@'.s:d(3).'<=+ contains=juliaMacro,juliaDocStringMRaw'
|
||||
exec 'syntax region juliaDocMacro contained transparent start=+@doc\s\+\z("\%(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\(\z1\)\@'.s:d(3).'<=+ contains=juliaMacro,juliaDocStringM'
|
||||
syntax region juliaDocStringMRaw contained fold matchgroup=juliaDocStringDelim fold start=+\z\("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpellcheckDocStrings
|
||||
syntax region juliaDocStringM contained fold matchgroup=juliaDocStringDelim fold start=+\z\("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaStringVars,@juliaSpecialChars,@juliaSpellcheckDocStrings
|
||||
|
||||
syntax region juliaShellString matchgroup=juliaStringDelim start=+`+ skip=+\%(\\\\\)*\\`+ end=+`+ contains=@juliaStringVars,juliaSpecialChar
|
||||
|
||||
syntax cluster juliaStringVars contains=juliaStringVarsPar,juliaStringVarsSqBra,juliaStringVarsCurBra,juliaStringVarsPla
|
||||
syntax region juliaStringVarsPar contained matchgroup=juliaStringVarDelim start="$(" end=")" contains=@juliaExpressions
|
||||
syntax region juliaStringVarsSqBra contained matchgroup=juliaStringVarDelim start="$\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS
|
||||
syntax region juliaStringVarsCurBra contained matchgroup=juliaStringVarDelim start="${" end="}" contains=@juliaExpressions
|
||||
exec 'syntax match juliaStringVarsPla contained "\$' . s:idregex . '"'
|
||||
|
||||
" TODO improve RegEx
|
||||
syntax region juliaRegEx matchgroup=juliaStringDelim start=+\<r\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1[imsx]*+
|
||||
|
||||
syntax cluster juliaSpecialChars contains=juliaSpecialChar,juliaDoubleBackslash,juliaEscapedQuote,juliaOctalEscapeChar,juliaHexEscapeChar,juliaUniCharSmall,juliaUniCharLarge
|
||||
syntax match juliaSpecialChar display contained "\\."
|
||||
syntax match juliaOctalEscapeChar display contained "\\\o\{3\}"
|
||||
syntax match juliaHexEscapeChar display contained "\\x\x\{2\}"
|
||||
syntax match juliaUniCharSmall display contained "\\u\x\{1,4\}"
|
||||
syntax match juliaUniCharLarge display contained "\\U\x\{1,8\}"
|
||||
syntax cluster juliaSpecialCharsRaw contains=juliaDoubleBackslash,juliaEscapedQuote
|
||||
syntax match juliaDoubleBackslash contained "\\\\"
|
||||
syntax match juliaEscapedQuote contained "\\\""
|
||||
|
||||
syntax cluster juliaPrintfChars contains=juliaErrorPrintfFmt,juliaPrintfFmt
|
||||
syntax match juliaErrorPrintfFmt display contained "\\\?%."
|
||||
syntax match juliaPrintfFmt display contained "%\%(\d\+\$\)\=[-+' #0]*\%(\d*\|\*\|\*\d\+\$\)\%(\.\%(\d*\|\*\|\*\d\+\$\)\)\=\%([hlLjqzt]\|ll\|hh\)\=[aAbdiuoxXDOUfFeEgGcCsSpn]"
|
||||
syntax match juliaPrintfFmt display contained "%%"
|
||||
syntax match juliaPrintfFmt display contained "\\%\%(\d\+\$\)\=[-+' #0]*\%(\d*\|\*\|\*\d\+\$\)\%(\.\%(\d*\|\*\|\*\d\+\$\)\)\=\%([hlLjqzt]\|ll\|hh\)\=[aAbdiuoxXDOUfFeEgGcCsSpn]"hs=s+1
|
||||
syntax match juliaPrintfFmt display contained "\\%%"hs=s+1
|
||||
|
||||
" this is used to restrict the search for Symbols to when colons appear at all
|
||||
" (for performance reasons)
|
||||
syntax match juliaPossibleSymbol transparent ":\ze[^:]" contains=juliaSymbol,juliaQuotedParBlock,juliaQuotedQMarkPar,juliaColon
|
||||
|
||||
let s:quotable = '\%(' . s:idregex . '\|' . s:operators . '\|[?.]\|' . s:float_regex . '\|' . s:int_regex . '\)'
|
||||
let s:quoting_colon = '\%(\%(^\s*\|\s\{6,\}\|[' . s:nonid_chars . s:op_chars_wc . ']\s*\)\@'.s:d(6).'<=\|\%(\<\%(return\|if\|else\%(if\)\?\|while\|try\|begin\)\s\+\)\@'.s:d(9).'<=\)\zs:'
|
||||
let s:quoting_colonS = '\s\@'.s:d(1).'<=:'
|
||||
|
||||
" note: juliaSymbolS only works within whitespace-sensitive contexts,
|
||||
" such as in macro calls without parentheses, or within square brackets.
|
||||
" It is used to override the recognition of expressions like `a :b` as
|
||||
" ranges rather than symbols in those contexts.
|
||||
" (Note that such `a :b` expressions only allows at most 5 spaces between
|
||||
" the identifier and the colon anyway.)
|
||||
|
||||
exec 'syntax match juliaSymbol contained "' . s:quoting_colon . s:quotable . '"'
|
||||
exec 'syntax match juliaSymbolS contained "' . s:quoting_colonS . s:quotable . '"'
|
||||
|
||||
" same as above for quoted expressions such as :(expr)
|
||||
exec 'syntax region juliaQuotedParBlock matchgroup=juliaQParDelim start="' . s:quoting_colon . '(" end=")" contains=@juliaExpressions'
|
||||
exec 'syntax match juliaQuotedQMarkPar "' . s:quoting_colon . '(\s*?\s*)" contains=juliaQuotedQMark'
|
||||
exec 'syntax region juliaQuotedParBlockS matchgroup=juliaQParDelim contained start="' . s:quoting_colonS . '(" end=")" contains=@juliaExpressions'
|
||||
|
||||
|
||||
syntax match juliaTypeOperatorR1 contained "[^{([:space:]<>\"]\+\%(\s*[<>]:\)\@="
|
||||
|
||||
" force precedence over Symbols
|
||||
syntax match juliaTypeOperator contained "[<>:]:"
|
||||
exec 'syntax match juliaTypeOperatorR2 transparent "[<>:]:\s*\%(' . s:idregex . '\.\)*' . s:idregex . '" contains=juliaTypeOperator,juliaType,juliaDottedT,@juliaExpressions nextgroup=juliaTypeOperator'
|
||||
syntax match juliaIsaKeyword contained "\<isa\>"
|
||||
exec 'syntax match juliaTypeOperatorR3 transparent "\<isa\s\+\%(' . s:idregex . '\.\)*' . s:idregex . '" contains=juliaIsaKeyword,juliaType,juliaDottedT,@juliaExpressions nextgroup=juliaIsaKeyword'
|
||||
|
||||
syntax match juliaWhereKeyword "\<where\>"
|
||||
exec 'syntax match juliaWhereR transparent "\<where\s\+' . s:idregex . '" contains=juliaWhereKeyword,juliaType,juliaDottedT,juliaIdSymbol'
|
||||
|
||||
syntax region juliaCommentL matchgroup=juliaCommentDelim excludenl start="#\ze\%([^=]\|$\)" end="$" contains=juliaTodo,@juliaSpellcheckComments
|
||||
syntax region juliaCommentM matchgroup=juliaCommentDelim fold start="#=\ze\%([^#]\|$\)" end="=#" contains=juliaTodo,juliaCommentM,@juliaSpellcheckComments
|
||||
syntax keyword juliaTodo contained TODO FIXME XXX
|
||||
|
||||
" detect an end-of-line with only whitespace or comments before it
|
||||
let s:eol = '\s*\%(\%(\%(#=\%(=#\@!\|[^=]\|\n\)\{-}=#\)\s*\)\+\)\?\%(#=\@!.*\)\?\n'
|
||||
|
||||
" a trailing comma, or colon, or an empty line in an import/using/export
|
||||
" multi-line command. Used to recognize the as keyword, and for indentation
|
||||
" (this needs to take precedence over normal commas and colons, and comments)
|
||||
syntax cluster juliaContinuationItems contains=juliaContinuationComma,juliaContinuationColon,juliaContinuationNone
|
||||
exec 'syntax region juliaContinuationComma matchgroup=juliaComma contained start=",\ze'.s:eol.'" end="\n\+\ze." contains=@juliaCommentItems'
|
||||
exec 'syntax region juliaContinuationColon matchgroup=juliaColon contained start=":\ze'.s:eol.'" end="\n\+\ze." contains=@juliaCommentItems'
|
||||
exec 'syntax region juliaContinuationNone matchgroup=NONE contained start="\%(\<\%(import\|using\|export\)\>\|^\)\@'.s:d(6).'<=\ze'.s:eol.'" end="\n\+\ze." contains=@juliaCommentItems,juliaAsKeyword'
|
||||
exec 'syntax match juliaMacroName contained "@' . s:idregex . '\%(\.' . s:idregex . '\)*"'
|
||||
|
||||
" the following are disabled by default, but
|
||||
" can be enabled by entering e.g.
|
||||
" :hi link juliaParDelim Delimiter
|
||||
hi def link juliaParDelim juliaNone
|
||||
hi def link juliaSemicolon juliaNone
|
||||
hi def link juliaComma juliaNone
|
||||
hi def link juliaFunctionCall juliaNone
|
||||
|
||||
hi def link juliaColon juliaOperator
|
||||
|
||||
hi def link juliaFunctionName juliaFunction
|
||||
hi def link juliaFunctionName1 juliaFunction
|
||||
hi def link juliaMacroName juliaMacro
|
||||
|
||||
|
||||
hi def link juliaKeyword Keyword
|
||||
hi def link juliaWhereKeyword Keyword
|
||||
hi def link juliaInfixKeyword Keyword
|
||||
hi def link juliaIsaKeyword Keyword
|
||||
hi def link juliaAsKeyword Keyword
|
||||
hi def link juliaRepKeyword Keyword
|
||||
hi def link juliaBlKeyword Keyword
|
||||
hi def link juliaConditional Conditional
|
||||
hi def link juliaRepeat Repeat
|
||||
hi def link juliaException Exception
|
||||
hi def link juliaOuter Keyword
|
||||
hi def link juliaBaseTypeBasic Type
|
||||
hi def link juliaBaseTypeNum Type
|
||||
hi def link juliaBaseTypeC Type
|
||||
hi def link juliaBaseTypeError Type
|
||||
hi def link juliaBaseTypeIter Type
|
||||
hi def link juliaBaseTypeString Type
|
||||
hi def link juliaBaseTypeArray Type
|
||||
hi def link juliaBaseTypeDict Type
|
||||
hi def link juliaBaseTypeSet Type
|
||||
hi def link juliaBaseTypeIO Type
|
||||
hi def link juliaBaseTypeProcess Type
|
||||
hi def link juliaBaseTypeRange Type
|
||||
hi def link juliaBaseTypeRegex Type
|
||||
hi def link juliaBaseTypeFact Type
|
||||
hi def link juliaBaseTypeSort Type
|
||||
hi def link juliaBaseTypeRound Type
|
||||
hi def link juliaBaseTypeSpecial Type
|
||||
hi def link juliaBaseTypeRandom Type
|
||||
hi def link juliaBaseTypeDisplay Type
|
||||
hi def link juliaBaseTypeTime Type
|
||||
hi def link juliaBaseTypeOther Type
|
||||
|
||||
hi def link juliaType Type
|
||||
hi def link juliaParamType Type
|
||||
hi def link juliaTypeOperatorR1 Type
|
||||
|
||||
" NOTE: deprecated constants are not highlighted as such. For once,
|
||||
" one can still legitimately use them by importing Base.MathConstants.
|
||||
" Plus, one-letter variables like `e` and `γ` can be used with other
|
||||
" meanings.
|
||||
hi def link juliaConstNum Constant
|
||||
hi def link juliaEuler Constant
|
||||
|
||||
hi def link juliaConstEnv Constant
|
||||
hi def link juliaConstC Constant
|
||||
hi def link juliaConstLimits Constant
|
||||
hi def link juliaConstGeneric Constant
|
||||
hi def link juliaRangeKeyword Constant
|
||||
hi def link juliaConstBool Boolean
|
||||
hi def link juliaConstIO Boolean
|
||||
|
||||
hi def link juliaComprehensionFor Keyword
|
||||
hi def link juliaComprehensionIf Keyword
|
||||
|
||||
hi def link juliaDollarVar Identifier
|
||||
|
||||
hi def link juliaFunction Function
|
||||
hi def link juliaMacro Macro
|
||||
hi def link juliaSymbol Identifier
|
||||
hi def link juliaSymbolS Identifier
|
||||
hi def link juliaQParDelim Identifier
|
||||
hi def link juliaQuotedQMarkPar Identifier
|
||||
hi def link juliaQuotedQMark juliaOperatorHL
|
||||
|
||||
hi def link juliaNumber Number
|
||||
hi def link juliaFloat Float
|
||||
hi def link juliaComplexUnit Constant
|
||||
|
||||
hi def link juliaChar Character
|
||||
|
||||
hi def link juliaString String
|
||||
hi def link juliaStringPrefixed juliaString
|
||||
hi def link juliabString juliaString
|
||||
hi def link juliasString juliaString
|
||||
hi def link juliavString juliaString
|
||||
hi def link juliarString juliaString
|
||||
hi def link juliaipString juliaString
|
||||
hi def link juliabigString juliaString
|
||||
hi def link juliaMIMEString juliaString
|
||||
hi def link juliarawString juliaString
|
||||
hi def link juliatestString juliaString
|
||||
hi def link juliahtmlString juliaString
|
||||
hi def link juliaint128String juliaString
|
||||
hi def link juliaPrintfString juliaString
|
||||
hi def link juliaShellString juliaString
|
||||
hi def link juliaDocString juliaString
|
||||
hi def link juliaDocStringM juliaDocString
|
||||
hi def link juliaDocStringMRaw juliaDocString
|
||||
hi def link juliaStringDelim juliaString
|
||||
hi def link juliaDocStringDelim juliaDocString
|
||||
hi def link juliaStringVarsPla Identifier
|
||||
hi def link juliaStringVarDelim Identifier
|
||||
|
||||
hi def link juliaRegEx String
|
||||
|
||||
hi def link juliaSpecialChar SpecialChar
|
||||
hi def link juliaOctalEscapeChar SpecialChar
|
||||
hi def link juliaHexEscapeChar SpecialChar
|
||||
hi def link juliaUniCharSmall SpecialChar
|
||||
hi def link juliaUniCharLarge SpecialChar
|
||||
hi def link juliaDoubleBackslash SpecialChar
|
||||
hi def link juliaEscapedQuote SpecialChar
|
||||
|
||||
hi def link juliaPrintfFmt SpecialChar
|
||||
|
||||
if s:julia_highlight_operators
|
||||
hi! def link juliaOperatorHL Operator
|
||||
else
|
||||
hi! def link juliaOperatorHL juliaNone
|
||||
endif
|
||||
hi def link juliaOperator juliaOperatorHL
|
||||
hi def link juliaRangeOperator juliaOperatorHL
|
||||
hi def link juliaCTransOperator juliaOperatorHL
|
||||
hi def link juliaTernaryOperator juliaOperatorHL
|
||||
hi def link juliaTypeOperator juliaOperatorHL
|
||||
|
||||
hi def link juliaCommentL Comment
|
||||
hi def link juliaCommentM Comment
|
||||
hi def link juliaCommentDelim Comment
|
||||
hi def link juliaTodo Todo
|
||||
|
||||
hi def link juliaErrorPar juliaError
|
||||
hi def link juliaErrorEnd juliaError
|
||||
hi def link juliaErrorElse juliaError
|
||||
hi def link juliaErrorCatch juliaError
|
||||
hi def link juliaErrorFinally juliaError
|
||||
hi def link juliaErrorSemicol juliaError
|
||||
hi def link juliaErrorPrintfFmt juliaError
|
||||
|
||||
hi def link juliaError Error
|
||||
|
||||
syntax sync fromstart
|
||||
|
||||
let b:current_syntax = "julia"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
@ -3,7 +3,7 @@
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainers: Xavier Crégut <xavier.cregut@enseeiht.fr>
|
||||
" Mario Eusebio <bio@dq.fct.unl.pt>
|
||||
" Last Change: 2021 Apr 23
|
||||
" Last Change: 2021 May 20
|
||||
|
||||
" Contributors: Tim Chase <tchase@csc.com>,
|
||||
" Stas Grabois <stsi@vtrails.com>,
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: ReDIF
|
||||
" Maintainer: Axel Castellane <axel.castellane@polytechnique.edu>
|
||||
" Last Change: 2013 April 17
|
||||
" Last Change: 2021 Jul 28
|
||||
" Original Author: Axel Castellane
|
||||
" Source: http://openlib.org/acmes/root/docu/redif_1.html
|
||||
" File Extension: rdf
|
||||
@ -932,7 +932,7 @@ highlight redifFieldDeprecated term=undercurl cterm=undercurl gui=undercurl guis
|
||||
" Sync: The template-type (ReDIF-Paper, ReDIF-Archive, etc.) influences which
|
||||
" fields can follow. Thus sync must search backwards for it.
|
||||
"
|
||||
" I would like to simply ask VIM to search backward for the first occurence of
|
||||
" I would like to simply ask VIM to search backward for the first occurrence of
|
||||
" /^Template-Type:/, but it does not seem to be possible, so I have to start
|
||||
" from the beginning of the file... This might slow down a lot for files that
|
||||
" contain a lot of Template-Type statements.
|
||||
|
@ -3,7 +3,7 @@
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2019 Jul 13
|
||||
" Last Change: 2021 Jun 06
|
||||
" ----------------------------------------------------------------------------
|
||||
"
|
||||
" Previous Maintainer: Mirko Nasato
|
||||
@ -66,7 +66,7 @@ endfunction
|
||||
com! -nargs=* SynFold call s:run_syntax_fold(<q-args>)
|
||||
|
||||
" Not-Top Cluster {{{1
|
||||
syn cluster rubyNotTop contains=@rubyCommentNotTop,@rubyStringNotTop,@rubyRegexpSpecial,@rubyDeclaration,@rubyExceptionHandler,@rubyClassOperator,rubyConditional,rubyModuleName,rubyClassName,rubySymbolDelimiter,rubyParentheses
|
||||
syn cluster rubyNotTop contains=@rubyCommentNotTop,@rubyStringNotTop,@rubyRegexpSpecial,@rubyDeclaration,@rubyExceptionHandler,@rubyClassOperator,rubyConditional,rubyModuleName,rubyClassName,rubySymbolDelimiter,rubyParentheses,@Spell
|
||||
|
||||
" Whitespace Errors {{{1
|
||||
if exists("ruby_space_errors")
|
||||
@ -92,7 +92,7 @@ if exists("ruby_operators") || exists("ruby_pseudo_operators")
|
||||
syn match rubyBooleanOperator "\%(\w\|[^\x00-\x7F]\)\@1<!!\|&&\|||"
|
||||
syn match rubyRangeOperator "\.\.\.\="
|
||||
syn match rubyAssignmentOperator "=>\@!\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|||=\||=\|%=\|+=\|>>=\|<<=\|\^="
|
||||
syn match rubyAssignmentOperator "=>\@!" containedin=rubyBlockParameterList " TODO: this is inelegant
|
||||
syn match rubyAssignmentOperator "=>\@!" contained containedin=rubyBlockParameterList " TODO: this is inelegant
|
||||
syn match rubyEqualityOperator "===\|==\|!=\|!\~\|=\~"
|
||||
|
||||
syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\%(\w\|[^\x00-\x7F]\)[?!]\=\|[]})]\)\@2<=\[" end="]" contains=ALLBUT,@rubyNotTop
|
||||
@ -134,10 +134,10 @@ syn match rubyCurlyBraceEscape "\\[{}]" contained display
|
||||
syn match rubyAngleBracketEscape "\\[<>]" contained display
|
||||
syn match rubySquareBracketEscape "\\[[\]]" contained display
|
||||
|
||||
syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained
|
||||
syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained
|
||||
syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained
|
||||
syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained
|
||||
syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" end=")" transparent contained
|
||||
syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" end="}" transparent contained
|
||||
syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" end=">" transparent contained
|
||||
syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" end="\]" transparent contained
|
||||
|
||||
syn cluster rubySingleCharEscape contains=rubyBackslashEscape,rubyQuoteEscape,rubySpaceEscape,rubyParenthesisEscape,rubyCurlyBraceEscape,rubyAngleBracketEscape,rubySquareBracketEscape
|
||||
syn cluster rubyNestedBrackets contains=rubyNested.\+
|
||||
@ -193,7 +193,7 @@ SynFold ':' syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':
|
||||
|
||||
syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@="
|
||||
|
||||
syn region rubyParentheses start="(" end=")" contains=ALLBUT,@rubyNotTop containedin=rubyBlockParameterList
|
||||
syn region rubyParentheses start="(" end=")" contains=ALLBUT,@rubyNotTop contained containedin=rubyBlockParameterList
|
||||
syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\_s*\)\@32<=|" end="|" contains=ALLBUT,@rubyNotTop,@rubyProperOperator
|
||||
|
||||
if exists('ruby_global_variable_error')
|
||||
@ -332,7 +332,7 @@ SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([
|
||||
syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,@rubyGlobalVariable nextgroup=rubyAliasDeclaration2 skipwhite
|
||||
syn match rubyAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=rubySymbol,@rubyGlobalVariable
|
||||
syn match rubyMethodDeclaration "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable
|
||||
syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyClassName,rubyScopeOperator nextgroup=rubySuperClassOperator skipwhite skipnl
|
||||
syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyClassName,rubyScopeOperator nextgroup=rubySuperClassOperator skipwhite
|
||||
syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyModuleName,rubyScopeOperator
|
||||
|
||||
syn match rubyMethodName "\<\%([_[:alpha:]]\|[^\x00-\x7F]\)\%([_[:alnum:]]\|[^\x00-\x7F]\)*[?!=]\=\%([[:alnum:]_.:?!=]\|[^\x00-\x7F]\)\@!" contained containedin=rubyMethodDeclaration
|
||||
@ -462,7 +462,7 @@ endif
|
||||
syn match rubyDefinedOperator "\%#=1\<defined?" display
|
||||
|
||||
" 1.9-style Hash Keys and Keyword Parameters {{{1
|
||||
syn match rubySymbol "\%([{(|,]\_s*\)\@<=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[?!]\=::\@!"he=e-1
|
||||
syn match rubySymbol "\%(\w\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[?!]\=::\@!"he=e-1 contained containedin=rubyBlockParameterList,rubyCurlyBlock
|
||||
syn match rubySymbol "[]})\"':]\@1<!\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],;]\@="he=e-1
|
||||
syn match rubySymbol "[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],;]\@="hs=s+1,he=e-1
|
||||
|
||||
|
@ -3,7 +3,8 @@
|
||||
" Maintainer: Derek Wyatt
|
||||
" URL: https://github.com/derekwyatt/vim-scala
|
||||
" License: Same as Vim
|
||||
" Last Change: 20 May 2016
|
||||
" Last Change: 2021 Aug 11
|
||||
" by Jesse Atkinson, PR #8746
|
||||
" ----------------------------------------------------------------------------
|
||||
|
||||
if !exists('main_syntax')
|
||||
@ -66,7 +67,7 @@ syn match scalaChar /'\\u[A-Fa-f0-9]\{4}'/ contains=scalaUnicodeChar
|
||||
syn match scalaEscapedChar /\\[\\"'ntbrf]/
|
||||
syn match scalaUnicodeChar /\\u[A-Fa-f0-9]\{4}/
|
||||
hi link scalaChar Character
|
||||
hi link scalaEscapedChar Function
|
||||
hi link scalaEscapedChar Special
|
||||
hi link scalaUnicodeChar Special
|
||||
|
||||
syn match scalaOperator "||"
|
||||
|
52
runtime/syntax/scdoc.vim
Normal file
52
runtime/syntax/scdoc.vim
Normal file
@ -0,0 +1,52 @@
|
||||
" Syntax file for scdoc files
|
||||
" Maintainer: Gregory Anders <greg@gpanders.com>
|
||||
" Last Updated: 2021-08-04
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
let b:current_syntax = 'scdoc'
|
||||
|
||||
syntax match scdocFirstLineError "\%^.*$"
|
||||
syntax match scdocFirstLineValid "\%^\S\+(\d[0-9A-Za-z]*)\%(\s\+\"[^"]*\"\%(\s\+\"[^"]*\"\)\=\)\=$"
|
||||
|
||||
syntax region scdocCommentError start="^;\S" end="$" keepend
|
||||
syntax region scdocComment start="^; " end="$" keepend
|
||||
|
||||
syntax region scdocHeaderError start="^#\{3,}" end="$" keepend
|
||||
syntax region scdocHeader start="^#\{1,2}" end="$" keepend
|
||||
|
||||
syntax match scdocIndentError "^[ ]\+"
|
||||
|
||||
syntax match scdocLineBreak "++$"
|
||||
|
||||
syntax match scdocOrderedListMarker "^\s*\.\%(\s\+\S\)\@="
|
||||
syntax match scdocListMarker "^\s*-\%(\s\+\S\)\@="
|
||||
|
||||
syntax match scdocTableStartMarker "^[\[|\]][\[\-\]]"
|
||||
syntax match scdocTableMarker "^[|:][\[\-\] ]"
|
||||
|
||||
syntax region scdocBold concealends matchgroup=scdocBoldDelimiter start="\\\@<!\*" end="\\\@<!\*"
|
||||
syntax region scdocUnderline concealends matchgroup=scdocUnderlineDelimiter start="\<\\\@<!_" end="\\\@<!_\>"
|
||||
syntax region scdocPre matchgroup=scdocPreDelimiter start="^\t*```" end="^\t*```"
|
||||
|
||||
hi link scdocFirstLineValid Comment
|
||||
hi link scdocComment Comment
|
||||
hi link scdocHeader Title
|
||||
hi link scdocOrderedListMarker Statement
|
||||
hi link scdocListMarker scdocOrderedListMarker
|
||||
hi link scdocLineBreak Special
|
||||
hi link scdocTableMarker Statement
|
||||
hi link scdocTableStartMarker scdocTableMarker
|
||||
|
||||
hi link scdocFirstLineError Error
|
||||
hi link scdocCommentError Error
|
||||
hi link scdocHeaderError Error
|
||||
hi link scdocIndentError Error
|
||||
|
||||
hi link scdocPreDelimiter Delimiter
|
||||
|
||||
hi scdocBold term=bold cterm=bold gui=bold
|
||||
hi scdocUnderline term=underline cterm=underline gui=underline
|
||||
hi link scdocBoldDelimiter scdocBold
|
||||
hi link scdocUnderlineDelimiter scdocUnderline
|
@ -1,10 +1,11 @@
|
||||
" Vim syntax file
|
||||
" Language: Scheme (R7RS)
|
||||
" Last Change: 2018-01-06
|
||||
" Last Change: 2021-01-03
|
||||
" Author: Evan Hanson <evhan@foldling.org>
|
||||
" Maintainer: Evan Hanson <evhan@foldling.org>
|
||||
" Previous Author: Dirk van Deun <dirk@igwe.vub.ac.be>
|
||||
" Previous Maintainer: Sergey Khorev <sergey.khorev@gmail.com>
|
||||
" Repository: https://git.foldling.org/vim-scheme.git
|
||||
" URL: https://foldling.org/vim/syntax/scheme.vim
|
||||
|
||||
if exists('b:current_syntax')
|
||||
@ -14,6 +15,8 @@ endif
|
||||
let s:cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn spell notoplevel
|
||||
|
||||
syn match schemeParentheses "[^ '`\t\n()\[\]";]\+"
|
||||
syn match schemeParentheses "[)\]]"
|
||||
|
||||
@ -35,7 +38,7 @@ syn region schemeUnquote matchgroup=schemeParentheses start=/,@(/ end=/)/ contai
|
||||
syn region schemeQuoteForm matchgroup=schemeData start=/(/ end=/)/ contained contains=ALLBUT,schemeQuasiquote,schemeQuasiquoteForm,schemeUnquote,schemeForm,schemeDatumCommentForm,schemeImport,@schemeImportCluster,@schemeSyntaxCluster
|
||||
syn region schemeQuasiquoteForm matchgroup=schemeData start=/(/ end=/)/ contained contains=ALLBUT,schemeQuote,schemeForm,schemeDatumCommentForm,schemeImport,@schemeImportCluster,@schemeSyntaxCluster
|
||||
|
||||
syn region schemeString start=/\(\\\)\@<!"/ skip=/\\[\\"]/ end=/"/
|
||||
syn region schemeString start=/\(\\\)\@<!"/ skip=/\\[\\"]/ end=/"/ contains=@Spell
|
||||
syn region schemeSymbol start=/\(\\\)\@<!|/ skip=/\\[\\|]/ end=/|/
|
||||
|
||||
syn match schemeNumber /\(#[dbeio]\)*[+\-]*\([0-9]\+\|inf.0\|nan.0\)\(\/\|\.\)\?[0-9+\-@\ilns]*\>/
|
||||
@ -47,9 +50,9 @@ syn match schemeBoolean /#f\(alse\)\?/
|
||||
syn match schemeCharacter /#\\.[^ `'\t\n\[\]()]*/
|
||||
syn match schemeCharacter /#\\x[0-9a-fA-F]\+/
|
||||
|
||||
syn match schemeComment /;.*$/
|
||||
syn match schemeComment /;.*$/ contains=@Spell
|
||||
|
||||
syn region schemeMultilineComment start=/#|/ end=/|#/ contains=schemeMultilineComment
|
||||
syn region schemeMultilineComment start=/#|/ end=/|#/ contains=schemeMultilineComment,@Spell
|
||||
|
||||
syn region schemeForm matchgroup=schemeParentheses start="(" end=")" contains=ALLBUT,schemeUnquote,schemeDatumCommentForm,@schemeImportCluster
|
||||
syn region schemeForm matchgroup=schemeParentheses start="\[" end="\]" contains=ALLBUT,schemeUnquote,schemeDatumCommentForm,@schemeImportCluster
|
||||
@ -63,7 +66,7 @@ else
|
||||
syn region schemeImport matchgroup=schemeImport start="\(([ \t\n]*\)\@<=\(import\)\>" end=")"me=e-1 contained contains=schemeImportForm,schemeIdentifier,schemeComment,schemeDatumComment
|
||||
endif
|
||||
|
||||
syn match schemeImportKeyword "\(([ \t\n]*\)\@<=\(except\|only\|prefix\|rename\|srfi\)\>"
|
||||
syn match schemeImportKeyword "\(([ \t\n]*\)\@<=\(except\|only\|prefix\|rename\)\>"
|
||||
syn region schemeImportForm matchgroup=schemeParentheses start="(" end=")" contained contains=schemeIdentifier,schemeComment,schemeDatumComment,@schemeImportCluster
|
||||
syn cluster schemeImportCluster contains=schemeImportForm,schemeImportKeyword
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user