Compare commits
197 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97f0eb169b | ||
|
|
06618f94f1 | ||
|
|
d459020c62 | ||
|
|
851907a7ab | ||
|
|
4d31b48a11 | ||
|
|
46b54747c5 | ||
|
|
9bab7a0243 | ||
|
|
1a58e1d97c | ||
|
|
c9f5f73206 | ||
|
|
db77cb3c08 | ||
|
|
3ff71cda98 | ||
|
|
346823d3e5 | ||
|
|
7beaf6a720 | ||
|
|
0816f473ab | ||
|
|
f3ef026c98 | ||
|
|
d195598714 | ||
|
|
7500866182 | ||
|
|
18b3500b8c | ||
|
|
2cd0f27b75 | ||
|
|
caf05f504e | ||
|
|
351523f893 | ||
|
|
7904fa420e | ||
|
|
4ba5f1dab6 | ||
|
|
2f7e1b8b40 | ||
|
|
ec32c781a2 | ||
|
|
01c34e7d10 | ||
|
|
b6aab8f44b | ||
|
|
f269eabc6c | ||
|
|
eb47d6d20a | ||
|
|
0466d398a5 | ||
|
|
406b5d89e1 | ||
|
|
0a016671b9 | ||
|
|
13ece2ae1d | ||
|
|
6b2d4ff714 | ||
|
|
8df9748edb | ||
|
|
b1fd26d208 | ||
|
|
b34c4b7863 | ||
|
|
693729ae58 | ||
|
|
bbbda8fd81 | ||
|
|
f6196f4244 | ||
|
|
ff85d4a107 | ||
|
|
393f8d61f5 | ||
|
|
eda29c971c | ||
|
|
b393275ae9 | ||
|
|
3292a22940 | ||
|
|
a4e0b9785e | ||
|
|
b850c39676 | ||
|
|
87b4e5c5db | ||
|
|
145d1fd910 | ||
|
|
cfb4d4f312 | ||
|
|
a5d1a67bee | ||
|
|
d0121c63cf | ||
|
|
6586a01514 | ||
|
|
b152b6a40f | ||
|
|
7dd5a78b88 | ||
|
|
ac38ec7c7f | ||
|
|
fa1039760e | ||
|
|
9f573a8df0 | ||
|
|
fc06cda837 | ||
|
|
50faf02f43 | ||
|
|
572a4433c8 | ||
|
|
82418263fa | ||
|
|
1936c76536 | ||
|
|
371951d0c3 | ||
|
|
52df40eb04 | ||
|
|
ef976323e7 | ||
|
|
caa1d19da1 | ||
|
|
47da934844 | ||
|
|
70e672580b | ||
|
|
859ea4bc76 | ||
|
|
66000ff9af | ||
|
|
9fbdbb814f | ||
|
|
26f09ea54b | ||
|
|
f802767df7 | ||
|
|
524c853e5e | ||
|
|
439a2ba174 | ||
|
|
49c311c9b1 | ||
|
|
7c1cbb6cd4 | ||
|
|
7fc6c0e4da | ||
|
|
368aa69088 | ||
|
|
d324742292 | ||
|
|
cde0319385 | ||
|
|
8279af514c | ||
|
|
3bdef10dc1 | ||
|
|
7381c0ce3f | ||
|
|
1190139ed0 | ||
|
|
2cb4a89797 | ||
|
|
311df6bb0f | ||
|
|
838b746cce | ||
|
|
4569020538 | ||
|
|
ee09fcc9b6 | ||
|
|
b7e07dc103 | ||
|
|
4d2073b261 | ||
|
|
9882e9ddc9 | ||
|
|
124af71a28 | ||
|
|
6a879878f4 | ||
|
|
dc21552c9a | ||
|
|
b9725bc7f6 | ||
|
|
ec1238b406 | ||
|
|
d4566c14e7 | ||
|
|
1d61408af3 | ||
|
|
0ff01835a4 | ||
|
|
865bf2ed30 | ||
|
|
96b9bf8f74 | ||
|
|
b2209f213e | ||
|
|
78aed95c8d | ||
|
|
140f6d0eda | ||
|
|
81fd3b2b44 | ||
|
|
75f4bafabd | ||
|
|
f7e7302acb | ||
|
|
d3eafdd709 | ||
|
|
5939c35743 | ||
|
|
e9dcf13a30 | ||
|
|
87af60c915 | ||
|
|
9fd1583c83 | ||
|
|
dfa8be4944 | ||
|
|
0056ca7137 | ||
|
|
a9b0f8f7f3 | ||
|
|
35fdd9a67d | ||
|
|
3bcd0ddc2d | ||
|
|
b9093d5009 | ||
|
|
4ecf16bbf9 | ||
|
|
7f9a5a68fe | ||
|
|
259a741044 | ||
|
|
86fb3f8b99 | ||
|
|
20e58561ab | ||
|
|
f8addf1ca1 | ||
|
|
f5f4e85f01 | ||
|
|
69082916c8 | ||
|
|
f87eeb43fb | ||
|
|
62de54b48d | ||
|
|
5800c79838 | ||
|
|
f1c60d4bf1 | ||
|
|
6d313bec53 | ||
|
|
236ccbf6f8 | ||
|
|
daaa3d9965 | ||
|
|
fcba86c031 | ||
|
|
e24b5e0b0f | ||
|
|
f1d2ddcb9b | ||
|
|
ee7c8d999b | ||
|
|
6f98114e4a | ||
|
|
21d393a12b | ||
|
|
5c645a25bb | ||
|
|
4740394f23 | ||
|
|
6a434e93a9 | ||
|
|
e8e369a796 | ||
|
|
ec5e1483eb | ||
|
|
e49f9acecc | ||
|
|
14f91765c0 | ||
|
|
c20a41972c | ||
|
|
8ecfa2c56b | ||
|
|
8eaee1fa5c | ||
|
|
c3430cb583 | ||
|
|
2b1ddf19f8 | ||
|
|
f7c7aa3594 | ||
|
|
5917341f65 | ||
|
|
4cbdcbda2d | ||
|
|
2d2e25b3e3 | ||
|
|
f64b75b1d9 | ||
|
|
31724238c8 | ||
|
|
848db57e52 | ||
|
|
d7657e95b2 | ||
|
|
b84d565c62 | ||
|
|
320d910064 | ||
|
|
ccfaa07591 | ||
|
|
2fdc9b5419 | ||
|
|
a22c56a59a | ||
|
|
9781d9c005 | ||
|
|
c14bfc31d9 | ||
|
|
bdedd2bcce | ||
|
|
7c046ae99b | ||
|
|
500a1f9972 | ||
|
|
cd9fa256b5 | ||
|
|
bcd6924245 | ||
|
|
a2b91036d1 | ||
|
|
faf1d412f5 | ||
|
|
c9e4a6f191 | ||
|
|
65449bd1ee | ||
|
|
cc34181f99 | ||
|
|
18ee0feb5d | ||
|
|
b2f0ca820e | ||
|
|
566badc76b | ||
|
|
747f110420 | ||
|
|
9712ff1288 | ||
|
|
65ee49decf | ||
|
|
27b53be3a6 | ||
|
|
dbbb02bc77 | ||
|
|
96caa557f9 | ||
|
|
1e8009e34a | ||
|
|
312af65d1a | ||
|
|
73e28dcc61 | ||
|
|
1c3dd8ddcb | ||
|
|
fb593c5350 | ||
|
|
4c7fd4d68f | ||
|
|
acd6b9976b | ||
|
|
d5bc762dea | ||
|
|
0cdfb7ce46 |
@@ -7,7 +7,6 @@ environment:
|
||||
- FEATURE: HUGE
|
||||
# disabled
|
||||
# - FEATURE: TINY
|
||||
# - FEATURE: SMALL
|
||||
# - FEATURE: NORMAL
|
||||
# - FEATURE: BIG
|
||||
|
||||
@@ -15,9 +14,8 @@ matrix:
|
||||
fast_finish: true
|
||||
|
||||
before_build:
|
||||
# Use Windows SDK 7.1 (= MSVC 2010)
|
||||
- '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /release'
|
||||
- 'set INCLUDE=%INCLUDE%C:\Program Files (x86)\Windows Kits\8.1\Include\um'
|
||||
# Use Visual Studio 2015 compiler tools (default is 2012)
|
||||
- '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64'
|
||||
|
||||
build_script:
|
||||
- ci/appveyor.bat
|
||||
|
||||
20
.cirrus.yml
20
.cirrus.yml
@@ -11,7 +11,6 @@ freebsd_task:
|
||||
- name: FreeBSD 12.3
|
||||
freebsd_instance:
|
||||
image_family: freebsd-12-3
|
||||
only_if: $CIRRUS_TAG == ''
|
||||
timeout_in: 20m
|
||||
install_script:
|
||||
- pkg update -f
|
||||
@@ -26,3 +25,22 @@ freebsd_task:
|
||||
- pw useradd cirrus -m
|
||||
- chown -R cirrus:cirrus .
|
||||
- sudo -u cirrus make test
|
||||
|
||||
macos_task:
|
||||
name: macOS m1
|
||||
macos_instance:
|
||||
image: ghcr.io/cirruslabs/macos-ventura-xcode:latest
|
||||
env:
|
||||
# only run with clang, gcc is not real, it is a link to clang
|
||||
CC: clang
|
||||
timeout_in: 20m
|
||||
install_script:
|
||||
- brew update
|
||||
- brew install gettext libtool
|
||||
build_script:
|
||||
- NPROC=$(getconf _NPROCESSORS_ONLN)
|
||||
- ./configure --with-features=${FEATURES}
|
||||
- make -j${NPROC}
|
||||
test_script:
|
||||
- src/vim --version
|
||||
- make test
|
||||
|
||||
16
.github/CODEOWNERS
vendored
16
.github/CODEOWNERS
vendored
@@ -57,6 +57,7 @@ runtime/compiler/gawk.vim @dkearns
|
||||
runtime/compiler/gjs.vim @dkearns
|
||||
runtime/compiler/go.vim @dbarnett
|
||||
runtime/compiler/haml.vim @tpope
|
||||
runtime/compiler/hare.vim @rsaihe
|
||||
runtime/compiler/icon.vim @dkearns
|
||||
runtime/compiler/javac.vim @dkearns
|
||||
runtime/compiler/jest.vim @dkearns
|
||||
@@ -107,6 +108,7 @@ runtime/ftplugin/awk.vim @dkearns
|
||||
runtime/ftplugin/basic.vim @dkearns
|
||||
runtime/ftplugin/bst.vim @tpope
|
||||
runtime/ftplugin/cfg.vim @chrisbra
|
||||
runtime/ftplugin/chatito.vim @ObserverOfTime
|
||||
runtime/ftplugin/clojure.vim @axvr
|
||||
runtime/ftplugin/cs.vim @nickspoons
|
||||
runtime/ftplugin/csh.vim @dkearns
|
||||
@@ -116,9 +118,9 @@ runtime/ftplugin/desktop.vim @e-kwsm
|
||||
runtime/ftplugin/dosbatch.vim @mrdubya
|
||||
runtime/ftplugin/eiffel.vim @dkearns
|
||||
runtime/ftplugin/elixir.vim @mhanberg
|
||||
runtime/ftplugin/expect.vim @dkearns
|
||||
runtime/ftplugin/erlang.vim @hcs42
|
||||
runtime/ftplugin/eruby.vim @tpope @dkearns
|
||||
runtime/ftplugin/expect.vim @dkearns
|
||||
runtime/ftplugin/fennel.vim @gpanders
|
||||
runtime/ftplugin/fetchmail.vim @dkearns
|
||||
runtime/ftplugin/fpcmake.vim @dkearns
|
||||
@@ -134,9 +136,11 @@ runtime/ftplugin/gitconfig.vim @tpope
|
||||
runtime/ftplugin/gitignore.vim @ObserverOfTime
|
||||
runtime/ftplugin/gitrebase.vim @tpope
|
||||
runtime/ftplugin/gitsendemail.vim @tpope
|
||||
runtime/ftplugin/gyp.vim @ObserverOfTime
|
||||
runtime/ftplugin/go.vim @dbarnett
|
||||
runtime/ftplugin/gprof.vim @dpelle
|
||||
runtime/ftplugin/haml.vim @tpope
|
||||
runtime/ftplugin/hare.vim @rsaihe
|
||||
runtime/ftplugin/hgcommit.vim @k-takata
|
||||
runtime/ftplugin/html.vim @dkearns
|
||||
runtime/ftplugin/i3config.vim @hiqua
|
||||
@@ -198,6 +202,7 @@ runtime/ftplugin/toml.vim @averms
|
||||
runtime/ftplugin/tt2html.vim @petdance
|
||||
runtime/ftplugin/typescript.vim @dkearns
|
||||
runtime/ftplugin/typescriptreact.vim @dkearns
|
||||
runtime/ftplugin/vdf.vim @ObserverOfTime
|
||||
runtime/ftplugin/wast.vim @rhysd
|
||||
runtime/ftplugin/wget.vim @dkearns
|
||||
runtime/ftplugin/wget2.vim @dkearns
|
||||
@@ -207,6 +212,7 @@ runtime/ftplugin/zsh.vim @chrisbra
|
||||
runtime/indent/basic.vim @dkearns
|
||||
runtime/indent/bst.vim @tpope
|
||||
runtime/indent/cdl.vim @dkearns
|
||||
runtime/indent/chatito.vim @ObserverOfTime
|
||||
runtime/indent/clojure.vim @axvr
|
||||
runtime/indent/config.vim @dkearns
|
||||
runtime/indent/cs.vim @nickspoons
|
||||
@@ -228,7 +234,9 @@ runtime/indent/gdscript.vim @habamax
|
||||
runtime/indent/gitconfig.vim @tpope
|
||||
runtime/indent/gitolite.vim @sitaramc
|
||||
runtime/indent/go.vim @dbarnett
|
||||
runtime/indent/gyp.vim @ObserverOfTime
|
||||
runtime/indent/haml.vim @tpope
|
||||
runtime/indent/hare.vim @rsaihe
|
||||
runtime/indent/idlang.vim @dkearns
|
||||
runtime/indent/j.vim @glts
|
||||
runtime/indent/java.vim @xuhdev
|
||||
@@ -302,6 +310,7 @@ runtime/syntax/cabal.vim @coot
|
||||
runtime/syntax/cabalconfig.vim @coot
|
||||
runtime/syntax/cabalproject.vim @coot
|
||||
runtime/syntax/cf.vim @ernstvanderlinden
|
||||
runtime/syntax/chatito.vim @ObserverOfTime
|
||||
runtime/syntax/clojure.vim @axvr
|
||||
runtime/syntax/cs.vim @nickspoons
|
||||
runtime/syntax/csh.vim @cecamp
|
||||
@@ -344,7 +353,9 @@ runtime/syntax/go.vim @bhcleek
|
||||
runtime/syntax/godoc.vim @dbarnett
|
||||
runtime/syntax/gprof.vim @dpelle
|
||||
runtime/syntax/groff.vim @jmarshall
|
||||
runtime/syntax/gyp.vim @ObserverOfTime
|
||||
runtime/syntax/haml.vim @tpope
|
||||
runtime/syntax/hare.vim @rsaihe
|
||||
runtime/syntax/haskell.vim @coot
|
||||
runtime/syntax/hgcommit.vim @k-takata
|
||||
runtime/syntax/html.vim @dkearns
|
||||
@@ -361,6 +372,7 @@ runtime/syntax/less.vim @genoma
|
||||
runtime/syntax/lex.vim @cecamp
|
||||
runtime/syntax/liquid.vim @tpope
|
||||
runtime/syntax/lisp.vim @cecamp
|
||||
runtime/syntax/lyrics.vim @ObserverOfTime
|
||||
runtime/syntax/lynx.vim @dkearns
|
||||
runtime/syntax/m3build.vim @dkearns
|
||||
runtime/syntax/m3quake.vim @dkearns
|
||||
@@ -415,6 +427,7 @@ runtime/syntax/sdoc.vim @gpanders
|
||||
runtime/syntax/sh.vim @cecamp
|
||||
runtime/syntax/sm.vim @cecamp
|
||||
runtime/syntax/spec.vim @ignatenkobrain
|
||||
runtime/syntax/srt.vim @ObserverOfTime
|
||||
runtime/syntax/sqloracle.vim @chrisbra
|
||||
runtime/syntax/squirrel.vim @zenmatic
|
||||
runtime/syntax/sshconfig.vim @Jakuje
|
||||
@@ -437,6 +450,7 @@ runtime/syntax/tt2js.vim @petdance
|
||||
runtime/syntax/typescript.vim @HerringtonDarkholme
|
||||
runtime/syntax/typescriptcommon.vim @HerringtonDarkholme
|
||||
runtime/syntax/typescriptreact.vim @HerringtonDarkholme
|
||||
runtime/syntax/vdf.vim @ObserverOfTime
|
||||
runtime/syntax/vim.vim @cecamp
|
||||
runtime/syntax/vroom.vim @dbarnett
|
||||
runtime/syntax/wast.vim @rhysd
|
||||
|
||||
6
.github/dependabot.yml
vendored
Normal file
6
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
7
.github/workflows/ci.yml
vendored
7
.github/workflows/ci.yml
vendored
@@ -12,6 +12,9 @@ concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
runs-on: ubuntu-20.04
|
||||
@@ -250,7 +253,7 @@ jobs:
|
||||
|
||||
- name: Codecov
|
||||
if: matrix.coverage
|
||||
uses: codecov/codecov-action@v3.1.0
|
||||
uses: codecov/codecov-action@v3.1.1
|
||||
with:
|
||||
flags: linux,${{ matrix.features }}-${{ matrix.compiler }}-${{ matrix.extra }}
|
||||
|
||||
@@ -605,7 +608,7 @@ jobs:
|
||||
|
||||
- name: Codecov
|
||||
if: matrix.coverage
|
||||
uses: codecov/codecov-action@v3.1.0
|
||||
uses: codecov/codecov-action@v3.1.1
|
||||
with:
|
||||
directory: src
|
||||
flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}
|
||||
|
||||
7
.github/workflows/codeql-analysis.yml
vendored
7
.github/workflows/codeql-analysis.yml
vendored
@@ -21,8 +21,15 @@ concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
security-events: write # (github/codeql-action/autobuild)
|
||||
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
||||
3
.github/workflows/coverity.yml
vendored
3
.github/workflows/coverity.yml
vendored
@@ -4,6 +4,9 @@ on:
|
||||
- cron: '42 0 * * *' # Run once per day, to avoid Coverity's submission limits
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
jobs:
|
||||
scan:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
10
Filelist
10
Filelist
@@ -209,6 +209,7 @@ SRC_ALL = \
|
||||
src/testdir/python_before/*.py \
|
||||
src/testdir/pyxfile/*.py \
|
||||
src/testdir/dumps/*.dump \
|
||||
src/testdir/dumps/*.vim \
|
||||
src/testdir/samples/*.txt \
|
||||
src/testdir/samples/test000 \
|
||||
src/testdir/color_ramp.vim \
|
||||
@@ -538,9 +539,11 @@ SRC_DOS = \
|
||||
tools/rename.bat \
|
||||
src/bigvim.bat \
|
||||
src/bigvim64.bat \
|
||||
src/msvc2008.bat \
|
||||
src/msvc2010.bat \
|
||||
src/msvc-latest.bat \
|
||||
src/msvc2015.bat \
|
||||
src/msvc2017.bat \
|
||||
src/msvc2019.bat \
|
||||
src/msvc2022.bat \
|
||||
src/msys32.bat \
|
||||
src/msys64.bat \
|
||||
src/dlldata.c \
|
||||
@@ -553,7 +556,6 @@ SRC_DOS = \
|
||||
src/if_ole.cpp \
|
||||
src/if_ole.h \
|
||||
src/if_ole.idl \
|
||||
src/if_perl_msvc/stdbool.h \
|
||||
src/iscygpty.c \
|
||||
src/iscygpty.h \
|
||||
src/iid_ole.c \
|
||||
@@ -622,10 +624,8 @@ SRC_DOS_BIN = \
|
||||
src/xpm/include/*.h \
|
||||
src/xpm/x64/lib-vc14/libXpm.lib \
|
||||
src/xpm/x64/lib/libXpm.a \
|
||||
src/xpm/x64/lib/libXpm.lib \
|
||||
src/xpm/x86/lib-vc14/libXpm.lib \
|
||||
src/xpm/x86/lib/libXpm.a \
|
||||
src/xpm/x86/lib/libXpm.lib \
|
||||
runtime/bitmaps/vim.ico \
|
||||
nsis/icons.zip \
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ All commands are given with normal keyboard characters, so those who can type
|
||||
with ten fingers can work very fast. Additionally, function keys can be
|
||||
mapped to commands by the user, and the mouse can be used.
|
||||
|
||||
Vim runs under MS-Windows (XP, Vista, 7, 8, 10), macOS, Haiku, VMS and almost
|
||||
all flavours of UNIX. Porting to other systems should not be very difficult.
|
||||
Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me/NT/2000, Amiga DOS,
|
||||
Atari MiNT, BeOS, RISC OS and OS/2. These are no longer maintained.
|
||||
Vim runs under MS-Windows (7, 8, 10, 11), macOS, Haiku, VMS and almost all
|
||||
flavours of UNIX. Porting to other systems should not be very difficult.
|
||||
Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me/NT/2000/XP/Vista,
|
||||
Amiga DOS, Atari MiNT, BeOS, RISC OS and OS/2. These are no longer maintained.
|
||||
|
||||
For Vim9 script see [README_VIM9](README_VIM9.md).
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@ All commands are given with normal keyboard characters, so those who can type
|
||||
with ten fingers can work very fast. Additionally, function keys can be
|
||||
mapped to commands by the user, and the mouse can be used.
|
||||
|
||||
Vim runs under MS-Windows (XP, Vista, 7, 8, 10), macOS, VMS and almost all
|
||||
Vim runs under MS-Windows (7, 8, 10, 11), macOS, Haiku, VMS and almost all
|
||||
flavours of UNIX. Porting to other systems should not be very difficult.
|
||||
Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me/NT/2000, Amiga DOS,
|
||||
Atari MiNT, BeOS, RISC OS and OS/2. These are no longer maintained.
|
||||
Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me/NT/2000/XP/Vista,
|
||||
Amiga DOS, Atari MiNT, BeOS, RISC OS and OS/2. These are no longer maintained.
|
||||
|
||||
|
||||
DISTRIBUTION
|
||||
|
||||
@@ -3,13 +3,18 @@ vim9script
|
||||
# Language: ConTeXt typesetting engine
|
||||
# Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
# Former Maintainers: Nikolai Weibull <now@bitwi.se>
|
||||
# Latest Revision: 2022 Aug 12
|
||||
# Latest Revision: 2022 Sep 19
|
||||
|
||||
# Typesetting {{{
|
||||
import autoload './typeset.vim'
|
||||
|
||||
export def ConTeXtCmd(path: string): list<string>
|
||||
return ['mtxrun', '--script', 'context', '--nonstopmode', '--autogenerate', path]
|
||||
var cmd = ['mtxrun', '--script', 'context', '--nonstopmode', '--autogenerate']
|
||||
if !empty(get(g:, 'context_extra_options', ''))
|
||||
cmd += g:context_extra_options
|
||||
endif
|
||||
cmd->add(path)
|
||||
return cmd
|
||||
enddef
|
||||
|
||||
export def Typeset(bufname: string, env = {}, Cmd = ConTeXtCmd): bool
|
||||
|
||||
1200
runtime/autoload/dist/vimindent.vim
vendored
Normal file
1200
runtime/autoload/dist/vimindent.vim
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
||||
" Maintainer: Maxim Kim <habamax@gmail.com>
|
||||
" Website: https://www.github.com/vim/colorschemes
|
||||
" License: Vim License (see `:help license`)
|
||||
" Last Updated: Sat 03 Sep 2022 14:31:51 MSK
|
||||
" Last Updated: Fri 16 Sep 2022 13:15:33 MSK
|
||||
|
||||
" Generated by Colortemplate v2.2.0
|
||||
|
||||
@@ -26,12 +26,15 @@ hi! link fugitiveUnstagedModifier PreProc
|
||||
hi! link fugitiveHash Constant
|
||||
hi! link diffFile PreProc
|
||||
hi! link markdownHeadingDelimiter Special
|
||||
hi! link rstSectionDelimiter PreProc
|
||||
hi! link rstDirective Special
|
||||
hi! link rstSectionDelimiter Statement
|
||||
hi! link rstDirective PreProc
|
||||
hi! link rstHyperlinkReference Special
|
||||
hi! link rstFieldName Special
|
||||
hi! link rstFieldName Constant
|
||||
hi! link rstDelimiter Special
|
||||
hi! link rstInterpretedText Special
|
||||
hi! link rstCodeBlock Normal
|
||||
hi! link rstLiteralBlock rstCodeBlock
|
||||
hi! link markdownUrl String
|
||||
hi! link colortemplateKey Statement
|
||||
hi! link xmlTagName Statement
|
||||
hi! link javaScriptFunction Statement
|
||||
@@ -92,6 +95,20 @@ hi! link phpOperator Normal
|
||||
hi! link phpVarSelector Special
|
||||
hi! link phpMemberSelector Special
|
||||
hi! link phpDocCustomTags phpDocTags
|
||||
hi! link javaExternal Statement
|
||||
hi! link javaType Statement
|
||||
hi! link javaScopeDecl Statement
|
||||
hi! link javaClassDecl Statement
|
||||
hi! link javaStorageClass Statement
|
||||
hi! link javaDocParam PreProc
|
||||
hi! link csStorage Statement
|
||||
hi! link csAccessModifier Statement
|
||||
hi! link csClass Statement
|
||||
hi! link csModifier Statement
|
||||
hi! link csAsyncModifier Statement
|
||||
hi! link csLogicSymbols Normal
|
||||
hi! link csClassType Normal
|
||||
hi! link csType Statement
|
||||
hi! link Terminal Normal
|
||||
hi! link StatuslineTerm Statusline
|
||||
hi! link StatuslineTermNC StatuslineNC
|
||||
@@ -101,7 +118,7 @@ hi! link MessageWindow PMenu
|
||||
hi! link PopupNotification Todo
|
||||
if &background ==# 'dark'
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#000000', '#af5f5f', '#5faf5f', '#af875f', '#5f87af', '#d787af', '#5fafaf', '#c6c6c6', '#767676', '#ff5f5f', '#5fd75f', '#ffd787', '#87afd7', '#ffafd7', '#5fd7d7', '#ffffff']
|
||||
let g:terminal_ansi_colors = ['#000000', '#af5f5f', '#5faf5f', '#af875f', '#5f87af', '#d787d7', '#5fafaf', '#c6c6c6', '#767676', '#ff5f5f', '#5fd75f', '#ffd787', '#5fafff', '#ff87ff', '#5fd7d7', '#ffffff']
|
||||
endif
|
||||
hi Normal guifg=#c6c6c6 guibg=#000000 gui=NONE cterm=NONE
|
||||
hi Statusline guifg=#c6c6c6 guibg=#000000 gui=bold,reverse cterm=bold,reverse
|
||||
@@ -112,7 +129,7 @@ if &background ==# 'dark'
|
||||
hi TabLineSel guifg=#ffffff guibg=#000000 gui=bold cterm=bold
|
||||
hi ToolbarLine guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi ToolbarButton guifg=#000000 guibg=#ffffff gui=NONE cterm=NONE
|
||||
hi QuickFixLine guifg=#000000 guibg=#87afd7 gui=NONE cterm=NONE
|
||||
hi QuickFixLine guifg=#000000 guibg=#5fafff gui=NONE cterm=NONE
|
||||
hi CursorLineNr guifg=#ffffff guibg=NONE gui=bold cterm=bold
|
||||
hi LineNr guifg=#585858 guibg=NONE gui=NONE cterm=NONE
|
||||
hi NonText guifg=#585858 guibg=NONE gui=NONE cterm=NONE
|
||||
@@ -128,7 +145,7 @@ if &background ==# 'dark'
|
||||
hi ErrorMsg guifg=#ffffff guibg=#ff5f5f gui=NONE cterm=NONE
|
||||
hi ModeMsg guifg=#ffd787 guibg=NONE gui=reverse cterm=reverse
|
||||
hi MoreMsg guifg=#5fd75f guibg=NONE gui=NONE cterm=NONE
|
||||
hi Question guifg=#ffafd7 guibg=NONE gui=NONE cterm=NONE
|
||||
hi Question guifg=#ff87ff guibg=NONE gui=NONE cterm=NONE
|
||||
hi WarningMsg guifg=#ff5f5f guibg=NONE gui=NONE cterm=NONE
|
||||
hi Todo guifg=#5fd7d7 guibg=#000000 gui=reverse cterm=reverse
|
||||
hi Search guifg=#000000 guibg=#ffd787 gui=NONE cterm=NONE
|
||||
@@ -137,7 +154,7 @@ if &background ==# 'dark'
|
||||
hi WildMenu guifg=#000000 guibg=#ffd787 gui=bold cterm=bold
|
||||
hi debugPC guifg=#5f87af guibg=NONE gui=reverse cterm=reverse
|
||||
hi debugBreakpoint guifg=#5fafaf guibg=NONE gui=reverse cterm=reverse
|
||||
hi Cursor guifg=#ffffff guibg=#000000 gui=reverse cterm=reverse
|
||||
hi Cursor guifg=NONE guibg=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse
|
||||
hi lCursor guifg=#ff5fff guibg=#000000 gui=reverse cterm=reverse
|
||||
hi Visual guifg=#ffffff guibg=#005f87 gui=NONE cterm=NONE
|
||||
hi MatchParen guifg=#c5e7c5 guibg=#000000 gui=reverse cterm=reverse
|
||||
@@ -149,17 +166,18 @@ if &background ==# 'dark'
|
||||
hi SpellBad guifg=NONE guibg=NONE guisp=#ff5f5f gui=undercurl ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi SpellCap guifg=NONE guibg=NONE guisp=#5fafaf gui=undercurl ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi SpellLocal guifg=NONE guibg=NONE guisp=#5faf5f gui=undercurl ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi SpellRare guifg=NONE guibg=NONE guisp=#ffafd7 gui=undercurl ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Comment guifg=#87afd7 guibg=NONE gui=NONE cterm=NONE
|
||||
hi Constant guifg=#ffd787 guibg=NONE gui=NONE cterm=NONE
|
||||
hi SpellRare guifg=NONE guibg=NONE guisp=#ff87ff gui=undercurl ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Comment guifg=#5fafff guibg=NONE gui=NONE cterm=NONE
|
||||
hi Constant guifg=#ff87ff guibg=NONE gui=NONE cterm=NONE
|
||||
hi String guifg=#ffd787 guibg=NONE gui=NONE cterm=NONE
|
||||
hi Identifier guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Statement guifg=#eeeeee guibg=NONE gui=bold cterm=bold
|
||||
hi Type guifg=#5fd75f guibg=NONE gui=bold cterm=bold
|
||||
hi PreProc guifg=#af875f guibg=NONE gui=NONE cterm=NONE
|
||||
hi Statement guifg=#e4e4e4 guibg=NONE gui=bold cterm=bold
|
||||
hi Type guifg=#5fd75f guibg=NONE gui=NONE cterm=NONE
|
||||
hi PreProc guifg=#5fd7d7 guibg=NONE gui=NONE cterm=NONE
|
||||
hi Special guifg=#5fafaf guibg=NONE gui=NONE cterm=NONE
|
||||
hi Underlined guifg=NONE guibg=NONE gui=underline ctermfg=NONE ctermbg=NONE cterm=underline
|
||||
hi Title guifg=NONE guibg=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=bold
|
||||
hi Directory guifg=#5fd7d7 guibg=NONE gui=bold cterm=bold
|
||||
hi Directory guifg=#5fafff guibg=NONE gui=bold cterm=bold
|
||||
hi Conceal guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Ignore guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi DiffAdd guifg=#000000 guibg=#af87af gui=NONE cterm=NONE
|
||||
@@ -168,8 +186,8 @@ if &background ==# 'dark'
|
||||
hi DiffDelete guifg=#d78787 guibg=NONE gui=NONE cterm=NONE
|
||||
hi diffAdded guifg=#5fd75f guibg=NONE gui=NONE cterm=NONE
|
||||
hi diffRemoved guifg=#d78787 guibg=NONE gui=NONE cterm=NONE
|
||||
hi diffSubname guifg=#ffafd7 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirType guifg=#d787af guibg=NONE gui=NONE cterm=NONE
|
||||
hi diffSubname guifg=#ff87ff guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirType guifg=#d787d7 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirPermissionUser guifg=#5faf5f guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirPermissionGroup guifg=#af875f guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirPermissionOther guifg=#5fafaf guibg=NONE gui=NONE cterm=NONE
|
||||
@@ -177,7 +195,7 @@ if &background ==# 'dark'
|
||||
hi dirGroup guifg=#767676 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirTime guifg=#767676 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirSize guifg=#ffd787 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirSizeMod guifg=#d787af guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirSizeMod guifg=#d787d7 guibg=NONE gui=NONE cterm=NONE
|
||||
hi FilterMenuDirectorySubtle guifg=#878787 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirFilterMenuBookmarkPath guifg=#878787 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirFilterMenuHistoryPath guifg=#878787 guibg=NONE gui=NONE cterm=NONE
|
||||
@@ -186,7 +204,7 @@ if &background ==# 'dark'
|
||||
else
|
||||
" Light background
|
||||
if (has('termguicolors') && &termguicolors) || has('gui_running')
|
||||
let g:terminal_ansi_colors = ['#000000', '#870000', '#008700', '#875f00', '#005faf', '#870087', '#005f5f', '#808080', '#767676', '#d70000', '#87d787', '#d7d787', '#0087d7', '#af00af', '#00afaf', '#ffffff']
|
||||
let g:terminal_ansi_colors = ['#000000', '#af0000', '#008700', '#af5f00', '#005fd7', '#af00af', '#005f5f', '#808080', '#767676', '#d70000', '#87d787', '#ffd787', '#0087d7', '#ff00ff', '#008787', '#ffffff']
|
||||
endif
|
||||
hi Normal guifg=#000000 guibg=#ffffff gui=NONE cterm=NONE
|
||||
hi Statusline guifg=#ffffff guibg=#000000 gui=bold cterm=bold
|
||||
@@ -211,40 +229,41 @@ else
|
||||
hi SignColumn guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Error guifg=#ffffff guibg=#d70000 gui=NONE cterm=NONE
|
||||
hi ErrorMsg guifg=#ffffff guibg=#d70000 gui=NONE cterm=NONE
|
||||
hi ModeMsg guifg=#d7d787 guibg=#000000 gui=reverse cterm=reverse
|
||||
hi ModeMsg guifg=#ffd787 guibg=#000000 gui=reverse cterm=reverse
|
||||
hi MoreMsg guifg=#008700 guibg=NONE gui=bold cterm=bold
|
||||
hi Question guifg=#870087 guibg=NONE gui=bold cterm=bold
|
||||
hi Question guifg=#af00af guibg=NONE gui=bold cterm=bold
|
||||
hi WarningMsg guifg=#d70000 guibg=NONE gui=bold cterm=bold
|
||||
hi Todo guifg=#005f5f guibg=#ffffff gui=reverse cterm=reverse
|
||||
hi Search guifg=#000000 guibg=#d7d787 gui=NONE cterm=NONE
|
||||
hi Todo guifg=#008787 guibg=#ffffff gui=reverse cterm=reverse
|
||||
hi Search guifg=#000000 guibg=#ffd787 gui=NONE cterm=NONE
|
||||
hi IncSearch guifg=#000000 guibg=#87d787 gui=NONE cterm=NONE
|
||||
hi CurSearch guifg=#000000 guibg=#87d787 gui=NONE cterm=NONE
|
||||
hi WildMenu guifg=#000000 guibg=#d7d787 gui=bold cterm=bold
|
||||
hi debugPC guifg=#005faf guibg=NONE gui=reverse cterm=reverse
|
||||
hi WildMenu guifg=#000000 guibg=#ffd787 gui=bold cterm=bold
|
||||
hi debugPC guifg=#005fd7 guibg=NONE gui=reverse cterm=reverse
|
||||
hi debugBreakpoint guifg=#005f5f guibg=NONE gui=reverse cterm=reverse
|
||||
hi Cursor guifg=#000000 guibg=#ffffff gui=reverse cterm=reverse
|
||||
hi Cursor guifg=NONE guibg=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse
|
||||
hi lCursor guifg=#ff00ff guibg=#000000 gui=reverse cterm=reverse
|
||||
hi Visual guifg=#ffffff guibg=#5f87af gui=NONE cterm=NONE
|
||||
hi MatchParen guifg=NONE guibg=#c5e7c5 gui=NONE cterm=NONE
|
||||
hi VisualNOS guifg=#ffffff guibg=#00afaf gui=NONE cterm=NONE
|
||||
hi VisualNOS guifg=#ffffff guibg=#008787 gui=NONE cterm=NONE
|
||||
hi CursorLine guifg=NONE guibg=#e4e4e4 gui=NONE cterm=NONE
|
||||
hi CursorColumn guifg=NONE guibg=#e4e4e4 gui=NONE cterm=NONE
|
||||
hi Folded guifg=#767676 guibg=#eeeeee gui=NONE cterm=NONE
|
||||
hi ColorColumn guifg=NONE guibg=#eeeeee gui=NONE cterm=NONE
|
||||
hi SpellBad guifg=NONE guibg=NONE guisp=#870000 gui=undercurl ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi SpellBad guifg=NONE guibg=NONE guisp=#af0000 gui=undercurl ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi SpellCap guifg=NONE guibg=NONE guisp=#005f5f gui=undercurl ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi SpellLocal guifg=NONE guibg=NONE guisp=#008700 gui=undercurl ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi SpellRare guifg=NONE guibg=NONE guisp=#af00af gui=undercurl ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Comment guifg=#005faf guibg=NONE gui=NONE cterm=NONE
|
||||
hi Constant guifg=#870000 guibg=NONE gui=NONE cterm=NONE
|
||||
hi SpellRare guifg=NONE guibg=NONE guisp=#ff00ff gui=undercurl ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Comment guifg=#005fd7 guibg=NONE gui=NONE cterm=NONE
|
||||
hi Constant guifg=#af00af guibg=NONE gui=NONE cterm=NONE
|
||||
hi String guifg=#af5f00 guibg=NONE gui=NONE cterm=NONE
|
||||
hi Identifier guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Statement guifg=#000000 guibg=NONE gui=bold cterm=bold
|
||||
hi Type guifg=#008700 guibg=NONE gui=bold cterm=bold
|
||||
hi PreProc guifg=#875f00 guibg=NONE gui=NONE cterm=NONE
|
||||
hi Special guifg=#005f5f guibg=NONE gui=NONE cterm=NONE
|
||||
hi Type guifg=#008700 guibg=NONE gui=NONE cterm=NONE
|
||||
hi PreProc guifg=#005f5f guibg=NONE gui=NONE cterm=NONE
|
||||
hi Special guifg=#008787 guibg=NONE gui=NONE cterm=NONE
|
||||
hi Underlined guifg=NONE guibg=NONE gui=underline ctermfg=NONE ctermbg=NONE cterm=underline
|
||||
hi Title guifg=NONE guibg=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=bold
|
||||
hi Directory guifg=#005faf guibg=NONE gui=bold cterm=bold
|
||||
hi Directory guifg=#005fd7 guibg=NONE gui=bold cterm=bold
|
||||
hi Conceal guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Ignore guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi DiffAdd guifg=#000000 guibg=#d7afd7 gui=NONE cterm=NONE
|
||||
@@ -253,22 +272,22 @@ else
|
||||
hi DiffDelete guifg=#870000 guibg=NONE gui=NONE cterm=NONE
|
||||
hi diffAdded guifg=#008700 guibg=NONE gui=NONE cterm=NONE
|
||||
hi diffRemoved guifg=#d70000 guibg=NONE gui=NONE cterm=NONE
|
||||
hi diffSubname guifg=#870087 guibg=NONE gui=NONE cterm=NONE
|
||||
hi diffSubname guifg=#af00af guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirType guifg=#005f5f guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirPermissionUser guifg=#875f00 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirPermissionUser guifg=#af5f00 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirPermissionGroup guifg=#008700 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirPermissionOther guifg=#870087 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirPermissionOther guifg=#af00af guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirOwner guifg=#808080 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirGroup guifg=#808080 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirTime guifg=#808080 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirSize guifg=#870000 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirSize guifg=#af0000 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirSizeMod guifg=#005f5f guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirLink guifg=#008700 guibg=NONE gui=bold cterm=bold
|
||||
hi dirFilterMenuBookmarkPath guifg=#626262 guibg=NONE gui=NONE cterm=NONE
|
||||
hi dirFilterMenuHistoryPath guifg=#626262 guibg=NONE gui=NONE cterm=NONE
|
||||
hi FilterMenuDirectorySubtle guifg=#626262 guibg=NONE gui=NONE cterm=NONE
|
||||
hi FilterMenuLineNr guifg=#626262 guibg=NONE gui=NONE cterm=NONE
|
||||
hi CocSearch guifg=#870000 guibg=NONE gui=NONE cterm=NONE
|
||||
hi CocSearch guifg=#af0000 guibg=NONE gui=NONE cterm=NONE
|
||||
endif
|
||||
|
||||
if s:t_Co >= 256
|
||||
@@ -285,12 +304,15 @@ if s:t_Co >= 256
|
||||
hi! link fugitiveHash Constant
|
||||
hi! link diffFile PreProc
|
||||
hi! link markdownHeadingDelimiter Special
|
||||
hi! link rstSectionDelimiter PreProc
|
||||
hi! link rstDirective Special
|
||||
hi! link rstSectionDelimiter Statement
|
||||
hi! link rstDirective PreProc
|
||||
hi! link rstHyperlinkReference Special
|
||||
hi! link rstFieldName Special
|
||||
hi! link rstFieldName Constant
|
||||
hi! link rstDelimiter Special
|
||||
hi! link rstInterpretedText Special
|
||||
hi! link rstCodeBlock Normal
|
||||
hi! link rstLiteralBlock rstCodeBlock
|
||||
hi! link markdownUrl String
|
||||
hi! link colortemplateKey Statement
|
||||
hi! link xmlTagName Statement
|
||||
hi! link javaScriptFunction Statement
|
||||
@@ -351,6 +373,20 @@ if s:t_Co >= 256
|
||||
hi! link phpVarSelector Special
|
||||
hi! link phpMemberSelector Special
|
||||
hi! link phpDocCustomTags phpDocTags
|
||||
hi! link javaExternal Statement
|
||||
hi! link javaType Statement
|
||||
hi! link javaScopeDecl Statement
|
||||
hi! link javaClassDecl Statement
|
||||
hi! link javaStorageClass Statement
|
||||
hi! link javaDocParam PreProc
|
||||
hi! link csStorage Statement
|
||||
hi! link csAccessModifier Statement
|
||||
hi! link csClass Statement
|
||||
hi! link csModifier Statement
|
||||
hi! link csAsyncModifier Statement
|
||||
hi! link csLogicSymbols Normal
|
||||
hi! link csClassType Normal
|
||||
hi! link csType Statement
|
||||
hi! link Terminal Normal
|
||||
hi! link StatuslineTerm Statusline
|
||||
hi! link StatuslineTermNC StatuslineNC
|
||||
@@ -368,7 +404,7 @@ if s:t_Co >= 256
|
||||
hi TabLineSel ctermfg=231 ctermbg=16 cterm=bold
|
||||
hi ToolbarLine ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi ToolbarButton ctermfg=16 ctermbg=231 cterm=NONE
|
||||
hi QuickFixLine ctermfg=16 ctermbg=110 cterm=NONE
|
||||
hi QuickFixLine ctermfg=16 ctermbg=75 cterm=NONE
|
||||
hi CursorLineNr ctermfg=231 ctermbg=NONE cterm=bold
|
||||
hi LineNr ctermfg=240 ctermbg=NONE cterm=NONE
|
||||
hi NonText ctermfg=240 ctermbg=NONE cterm=NONE
|
||||
@@ -384,7 +420,7 @@ if s:t_Co >= 256
|
||||
hi ErrorMsg ctermfg=231 ctermbg=203 cterm=NONE
|
||||
hi ModeMsg ctermfg=222 ctermbg=NONE cterm=reverse
|
||||
hi MoreMsg ctermfg=77 ctermbg=NONE cterm=NONE
|
||||
hi Question ctermfg=218 ctermbg=NONE cterm=NONE
|
||||
hi Question ctermfg=213 ctermbg=NONE cterm=NONE
|
||||
hi WarningMsg ctermfg=203 ctermbg=NONE cterm=NONE
|
||||
hi Todo ctermfg=116 ctermbg=16 cterm=reverse
|
||||
hi Search ctermfg=16 ctermbg=222 cterm=NONE
|
||||
@@ -403,17 +439,18 @@ if s:t_Co >= 256
|
||||
hi SpellBad ctermfg=203 ctermbg=NONE cterm=underline
|
||||
hi SpellCap ctermfg=73 ctermbg=NONE cterm=underline
|
||||
hi SpellLocal ctermfg=77 ctermbg=NONE cterm=underline
|
||||
hi SpellRare ctermfg=218 ctermbg=NONE cterm=underline
|
||||
hi Comment ctermfg=110 ctermbg=NONE cterm=NONE
|
||||
hi Constant ctermfg=222 ctermbg=NONE cterm=NONE
|
||||
hi SpellRare ctermfg=213 ctermbg=NONE cterm=underline
|
||||
hi Comment ctermfg=75 ctermbg=NONE cterm=NONE
|
||||
hi Constant ctermfg=213 ctermbg=NONE cterm=NONE
|
||||
hi String ctermfg=222 ctermbg=NONE cterm=NONE
|
||||
hi Identifier ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Statement ctermfg=255 ctermbg=NONE cterm=bold
|
||||
hi Type ctermfg=77 ctermbg=NONE cterm=bold
|
||||
hi PreProc ctermfg=137 ctermbg=NONE cterm=NONE
|
||||
hi Statement ctermfg=254 ctermbg=NONE cterm=bold
|
||||
hi Type ctermfg=77 ctermbg=NONE cterm=NONE
|
||||
hi PreProc ctermfg=116 ctermbg=NONE cterm=NONE
|
||||
hi Special ctermfg=73 ctermbg=NONE cterm=NONE
|
||||
hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline
|
||||
hi Title ctermfg=NONE ctermbg=NONE cterm=bold
|
||||
hi Directory ctermfg=116 ctermbg=NONE cterm=bold
|
||||
hi Directory ctermfg=75 ctermbg=NONE cterm=bold
|
||||
hi Conceal ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi DiffAdd ctermfg=16 ctermbg=139 cterm=NONE
|
||||
@@ -422,8 +459,8 @@ if s:t_Co >= 256
|
||||
hi DiffDelete ctermfg=174 ctermbg=NONE cterm=NONE
|
||||
hi diffAdded ctermfg=77 ctermbg=NONE cterm=NONE
|
||||
hi diffRemoved ctermfg=174 ctermbg=NONE cterm=NONE
|
||||
hi diffSubname ctermfg=218 ctermbg=NONE cterm=NONE
|
||||
hi dirType ctermfg=175 ctermbg=NONE cterm=NONE
|
||||
hi diffSubname ctermfg=213 ctermbg=NONE cterm=NONE
|
||||
hi dirType ctermfg=176 ctermbg=NONE cterm=NONE
|
||||
hi dirPermissionUser ctermfg=71 ctermbg=NONE cterm=NONE
|
||||
hi dirPermissionGroup ctermfg=137 ctermbg=NONE cterm=NONE
|
||||
hi dirPermissionOther ctermfg=73 ctermbg=NONE cterm=NONE
|
||||
@@ -431,7 +468,7 @@ if s:t_Co >= 256
|
||||
hi dirGroup ctermfg=243 ctermbg=NONE cterm=NONE
|
||||
hi dirTime ctermfg=243 ctermbg=NONE cterm=NONE
|
||||
hi dirSize ctermfg=222 ctermbg=NONE cterm=NONE
|
||||
hi dirSizeMod ctermfg=175 ctermbg=NONE cterm=NONE
|
||||
hi dirSizeMod ctermfg=176 ctermbg=NONE cterm=NONE
|
||||
hi FilterMenuDirectorySubtle ctermfg=102 ctermbg=NONE cterm=NONE
|
||||
hi dirFilterMenuBookmarkPath ctermfg=102 ctermbg=NONE cterm=NONE
|
||||
hi dirFilterMenuHistoryPath ctermfg=102 ctermbg=NONE cterm=NONE
|
||||
@@ -462,38 +499,39 @@ if s:t_Co >= 256
|
||||
hi SignColumn ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Error ctermfg=231 ctermbg=160 cterm=NONE
|
||||
hi ErrorMsg ctermfg=231 ctermbg=160 cterm=NONE
|
||||
hi ModeMsg ctermfg=186 ctermbg=16 cterm=reverse
|
||||
hi ModeMsg ctermfg=222 ctermbg=16 cterm=reverse
|
||||
hi MoreMsg ctermfg=28 ctermbg=NONE cterm=bold
|
||||
hi Question ctermfg=90 ctermbg=NONE cterm=bold
|
||||
hi Question ctermfg=127 ctermbg=NONE cterm=bold
|
||||
hi WarningMsg ctermfg=160 ctermbg=NONE cterm=bold
|
||||
hi Todo ctermfg=23 ctermbg=231 cterm=reverse
|
||||
hi Search ctermfg=16 ctermbg=186 cterm=NONE
|
||||
hi Todo ctermfg=30 ctermbg=231 cterm=reverse
|
||||
hi Search ctermfg=16 ctermbg=222 cterm=NONE
|
||||
hi IncSearch ctermfg=16 ctermbg=114 cterm=NONE
|
||||
hi CurSearch ctermfg=16 ctermbg=114 cterm=NONE
|
||||
hi WildMenu ctermfg=16 ctermbg=186 cterm=bold
|
||||
hi debugPC ctermfg=25 ctermbg=NONE cterm=reverse
|
||||
hi WildMenu ctermfg=16 ctermbg=222 cterm=bold
|
||||
hi debugPC ctermfg=26 ctermbg=NONE cterm=reverse
|
||||
hi debugBreakpoint ctermfg=23 ctermbg=NONE cterm=reverse
|
||||
hi Visual ctermfg=231 ctermbg=67 cterm=NONE
|
||||
hi MatchParen ctermfg=30 ctermbg=231 cterm=reverse
|
||||
hi VisualNOS ctermfg=231 ctermbg=37 cterm=NONE
|
||||
hi VisualNOS ctermfg=231 ctermbg=30 cterm=NONE
|
||||
hi CursorLine ctermfg=NONE ctermbg=254 cterm=NONE
|
||||
hi CursorColumn ctermfg=NONE ctermbg=254 cterm=NONE
|
||||
hi Folded ctermfg=243 ctermbg=255 cterm=NONE
|
||||
hi ColorColumn ctermfg=NONE ctermbg=255 cterm=NONE
|
||||
hi SpellBad ctermfg=88 ctermbg=NONE cterm=underline
|
||||
hi SpellBad ctermfg=124 ctermbg=NONE cterm=underline
|
||||
hi SpellCap ctermfg=23 ctermbg=NONE cterm=underline
|
||||
hi SpellLocal ctermfg=28 ctermbg=NONE cterm=underline
|
||||
hi SpellRare ctermfg=133 ctermbg=NONE cterm=underline
|
||||
hi Comment ctermfg=25 ctermbg=NONE cterm=NONE
|
||||
hi Constant ctermfg=88 ctermbg=NONE cterm=NONE
|
||||
hi Comment ctermfg=26 ctermbg=NONE cterm=NONE
|
||||
hi Constant ctermfg=127 ctermbg=NONE cterm=NONE
|
||||
hi String ctermfg=130 ctermbg=NONE cterm=NONE
|
||||
hi Identifier ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Statement ctermfg=16 ctermbg=NONE cterm=bold
|
||||
hi Type ctermfg=28 ctermbg=NONE cterm=bold
|
||||
hi PreProc ctermfg=94 ctermbg=NONE cterm=NONE
|
||||
hi Special ctermfg=23 ctermbg=NONE cterm=NONE
|
||||
hi Type ctermfg=28 ctermbg=NONE cterm=NONE
|
||||
hi PreProc ctermfg=23 ctermbg=NONE cterm=NONE
|
||||
hi Special ctermfg=30 ctermbg=NONE cterm=NONE
|
||||
hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline
|
||||
hi Title ctermfg=NONE ctermbg=NONE cterm=bold
|
||||
hi Directory ctermfg=25 ctermbg=NONE cterm=bold
|
||||
hi Directory ctermfg=26 ctermbg=NONE cterm=bold
|
||||
hi Conceal ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi DiffAdd ctermfg=16 ctermbg=182 cterm=NONE
|
||||
@@ -502,22 +540,22 @@ if s:t_Co >= 256
|
||||
hi DiffDelete ctermfg=88 ctermbg=NONE cterm=NONE
|
||||
hi diffAdded ctermfg=28 ctermbg=NONE cterm=NONE
|
||||
hi diffRemoved ctermfg=160 ctermbg=NONE cterm=NONE
|
||||
hi diffSubname ctermfg=90 ctermbg=NONE cterm=NONE
|
||||
hi diffSubname ctermfg=127 ctermbg=NONE cterm=NONE
|
||||
hi dirType ctermfg=23 ctermbg=NONE cterm=NONE
|
||||
hi dirPermissionUser ctermfg=94 ctermbg=NONE cterm=NONE
|
||||
hi dirPermissionUser ctermfg=130 ctermbg=NONE cterm=NONE
|
||||
hi dirPermissionGroup ctermfg=28 ctermbg=NONE cterm=NONE
|
||||
hi dirPermissionOther ctermfg=90 ctermbg=NONE cterm=NONE
|
||||
hi dirPermissionOther ctermfg=127 ctermbg=NONE cterm=NONE
|
||||
hi dirOwner ctermfg=244 ctermbg=NONE cterm=NONE
|
||||
hi dirGroup ctermfg=244 ctermbg=NONE cterm=NONE
|
||||
hi dirTime ctermfg=244 ctermbg=NONE cterm=NONE
|
||||
hi dirSize ctermfg=88 ctermbg=NONE cterm=NONE
|
||||
hi dirSize ctermfg=124 ctermbg=NONE cterm=NONE
|
||||
hi dirSizeMod ctermfg=23 ctermbg=NONE cterm=NONE
|
||||
hi dirLink ctermfg=28 ctermbg=NONE cterm=bold
|
||||
hi dirFilterMenuBookmarkPath ctermfg=241 ctermbg=NONE cterm=NONE
|
||||
hi dirFilterMenuHistoryPath ctermfg=241 ctermbg=NONE cterm=NONE
|
||||
hi FilterMenuDirectorySubtle ctermfg=241 ctermbg=NONE cterm=NONE
|
||||
hi FilterMenuLineNr ctermfg=241 ctermbg=NONE cterm=NONE
|
||||
hi CocSearch ctermfg=88 ctermbg=NONE cterm=NONE
|
||||
hi CocSearch ctermfg=124 ctermbg=NONE cterm=NONE
|
||||
endif
|
||||
unlet s:t_Co
|
||||
finish
|
||||
@@ -571,15 +609,16 @@ if s:t_Co >= 16
|
||||
hi SpellLocal ctermfg=green ctermbg=NONE cterm=underline
|
||||
hi SpellRare ctermfg=magenta ctermbg=NONE cterm=underline
|
||||
hi Comment ctermfg=blue ctermbg=NONE cterm=NONE
|
||||
hi Constant ctermfg=yellow ctermbg=NONE cterm=NONE
|
||||
hi Constant ctermfg=magenta ctermbg=NONE cterm=NONE
|
||||
hi String ctermfg=yellow ctermbg=NONE cterm=NONE
|
||||
hi Identifier ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Statement ctermfg=grey ctermbg=NONE cterm=bold
|
||||
hi Type ctermfg=green ctermbg=NONE cterm=bold
|
||||
hi PreProc ctermfg=darkyellow ctermbg=NONE cterm=NONE
|
||||
hi Type ctermfg=green ctermbg=NONE cterm=NONE
|
||||
hi PreProc ctermfg=cyan ctermbg=NONE cterm=NONE
|
||||
hi Special ctermfg=darkcyan ctermbg=NONE cterm=NONE
|
||||
hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline
|
||||
hi Title ctermfg=NONE ctermbg=NONE cterm=bold
|
||||
hi Directory ctermfg=cyan ctermbg=NONE cterm=bold
|
||||
hi Directory ctermfg=blue ctermbg=NONE cterm=bold
|
||||
hi Conceal ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi DiffAdd ctermfg=black ctermbg=darkmagenta cterm=NONE
|
||||
@@ -632,7 +671,7 @@ if s:t_Co >= 16
|
||||
hi MoreMsg ctermfg=darkgreen ctermbg=NONE cterm=bold
|
||||
hi Question ctermfg=darkmagenta ctermbg=NONE cterm=bold
|
||||
hi WarningMsg ctermfg=red ctermbg=NONE cterm=bold
|
||||
hi Todo ctermfg=darkcyan ctermbg=white cterm=reverse
|
||||
hi Todo ctermfg=cyan ctermbg=white cterm=reverse
|
||||
hi Search ctermfg=black ctermbg=yellow cterm=NONE
|
||||
hi IncSearch ctermfg=black ctermbg=green cterm=NONE
|
||||
hi CurSearch ctermfg=black ctermbg=green cterm=NONE
|
||||
@@ -651,12 +690,13 @@ if s:t_Co >= 16
|
||||
hi SpellLocal ctermfg=darkgreen ctermbg=NONE cterm=underline
|
||||
hi SpellRare ctermfg=magenta ctermbg=NONE cterm=underline
|
||||
hi Comment ctermfg=darkblue ctermbg=NONE cterm=NONE
|
||||
hi Constant ctermfg=darkred ctermbg=NONE cterm=NONE
|
||||
hi Constant ctermfg=darkmagenta ctermbg=NONE cterm=NONE
|
||||
hi String ctermfg=darkyellow ctermbg=NONE cterm=NONE
|
||||
hi Identifier ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Statement ctermfg=black ctermbg=NONE cterm=bold
|
||||
hi Type ctermfg=darkgreen ctermbg=NONE cterm=bold
|
||||
hi PreProc ctermfg=darkyellow ctermbg=NONE cterm=NONE
|
||||
hi Special ctermfg=darkcyan ctermbg=NONE cterm=NONE
|
||||
hi Type ctermfg=darkgreen ctermbg=NONE cterm=NONE
|
||||
hi PreProc ctermfg=darkcyan ctermbg=NONE cterm=NONE
|
||||
hi Special ctermfg=cyan ctermbg=NONE cterm=NONE
|
||||
hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline
|
||||
hi Title ctermfg=NONE ctermbg=NONE cterm=bold
|
||||
hi Directory ctermfg=darkblue ctermbg=NONE cterm=bold
|
||||
@@ -707,7 +747,7 @@ if s:t_Co >= 8
|
||||
hi FoldColumn ctermfg=black ctermbg=NONE cterm=NONE
|
||||
hi EndOfBuffer ctermfg=black ctermbg=NONE cterm=NONE
|
||||
hi SpecialKey ctermfg=black ctermbg=NONE cterm=NONE
|
||||
hi Pmenu ctermfg=black ctermbg=grey cterm=NONE
|
||||
hi Pmenu ctermfg=NONE ctermbg=grey cterm=NONE
|
||||
hi PmenuThumb ctermfg=NONE ctermbg=darkgreen cterm=NONE
|
||||
hi PmenuSbar ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi PmenuSel ctermfg=black ctermbg=darkcyan cterm=NONE
|
||||
@@ -725,7 +765,7 @@ if s:t_Co >= 8
|
||||
hi WildMenu ctermfg=black ctermbg=darkyellow cterm=bold
|
||||
hi debugPC ctermfg=darkblue ctermbg=NONE cterm=reverse
|
||||
hi debugBreakpoint ctermfg=darkcyan ctermbg=NONE cterm=reverse
|
||||
hi Visual ctermfg=black ctermbg=darkblue cterm=NONE
|
||||
hi Visual ctermfg=NONE ctermbg=NONE cterm=reverse
|
||||
hi MatchParen ctermfg=darkcyan ctermbg=black cterm=reverse
|
||||
hi VisualNOS ctermfg=black ctermbg=darkcyan cterm=NONE
|
||||
hi CursorLine ctermfg=NONE ctermbg=NONE cterm=underline
|
||||
@@ -740,12 +780,12 @@ if s:t_Co >= 8
|
||||
hi Constant ctermfg=darkred ctermbg=NONE cterm=NONE
|
||||
hi Identifier ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Statement ctermfg=grey ctermbg=NONE cterm=bold
|
||||
hi Type ctermfg=darkgreen ctermbg=NONE cterm=bold
|
||||
hi PreProc ctermfg=darkyellow ctermbg=NONE cterm=NONE
|
||||
hi Type ctermfg=darkgreen ctermbg=NONE cterm=NONE
|
||||
hi PreProc ctermfg=darkcyan ctermbg=NONE cterm=NONE
|
||||
hi Special ctermfg=darkcyan ctermbg=NONE cterm=NONE
|
||||
hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline
|
||||
hi Title ctermfg=NONE ctermbg=NONE cterm=bold
|
||||
hi Directory ctermfg=darkcyan ctermbg=NONE cterm=bold
|
||||
hi Directory ctermfg=darkblue ctermbg=NONE cterm=bold
|
||||
hi Conceal ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi DiffAdd ctermfg=black ctermbg=darkmagenta cterm=NONE
|
||||
@@ -770,10 +810,10 @@ if s:t_Co >= 8
|
||||
hi FoldColumn ctermfg=black ctermbg=NONE cterm=NONE
|
||||
hi EndOfBuffer ctermfg=black ctermbg=NONE cterm=NONE
|
||||
hi SpecialKey ctermfg=black ctermbg=NONE cterm=NONE
|
||||
hi Pmenu ctermfg=grey ctermbg=black cterm=NONE
|
||||
hi Pmenu ctermfg=NONE ctermbg=black cterm=NONE
|
||||
hi PmenuThumb ctermfg=NONE ctermbg=darkgreen cterm=NONE
|
||||
hi PmenuSbar ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi PmenuSel ctermfg=black ctermbg=darkcyan cterm=NONE
|
||||
hi PmenuSel ctermfg=NONE ctermbg=darkcyan cterm=NONE
|
||||
hi SignColumn ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Error ctermfg=grey ctermbg=darkred cterm=NONE
|
||||
hi ErrorMsg ctermfg=grey ctermbg=darkred cterm=NONE
|
||||
@@ -788,7 +828,7 @@ if s:t_Co >= 8
|
||||
hi WildMenu ctermfg=black ctermbg=darkyellow cterm=bold
|
||||
hi debugPC ctermfg=darkblue ctermbg=NONE cterm=reverse
|
||||
hi debugBreakpoint ctermfg=darkcyan ctermbg=NONE cterm=reverse
|
||||
hi Visual ctermfg=grey ctermbg=darkblue cterm=NONE
|
||||
hi Visual ctermfg=NONE ctermbg=NONE cterm=reverse
|
||||
hi MatchParen ctermfg=darkcyan ctermbg=grey cterm=reverse
|
||||
hi VisualNOS ctermfg=black ctermbg=darkcyan cterm=NONE
|
||||
hi CursorLine ctermfg=NONE ctermbg=NONE cterm=underline
|
||||
@@ -803,12 +843,12 @@ if s:t_Co >= 8
|
||||
hi Constant ctermfg=darkred ctermbg=NONE cterm=NONE
|
||||
hi Identifier ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Statement ctermfg=black ctermbg=NONE cterm=bold
|
||||
hi Type ctermfg=darkgreen ctermbg=NONE cterm=bold
|
||||
hi PreProc ctermfg=darkyellow ctermbg=NONE cterm=NONE
|
||||
hi Type ctermfg=darkgreen ctermbg=NONE cterm=NONE
|
||||
hi PreProc ctermfg=darkcyan ctermbg=NONE cterm=NONE
|
||||
hi Special ctermfg=darkcyan ctermbg=NONE cterm=NONE
|
||||
hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline
|
||||
hi Title ctermfg=black ctermbg=NONE cterm=bold
|
||||
hi Directory ctermfg=darkcyan ctermbg=NONE cterm=bold
|
||||
hi Directory ctermfg=darkblue ctermbg=NONE cterm=bold
|
||||
hi Conceal ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi DiffAdd ctermfg=black ctermbg=darkmagenta cterm=NONE
|
||||
@@ -899,14 +939,14 @@ endif
|
||||
" Color: color03 #AF875F 137 darkyellow
|
||||
" Color: color11 #FFD787 222 yellow
|
||||
" Color: color04 #5F87AF 67 darkblue
|
||||
" Color: color12 #87AFD7 110 blue
|
||||
" Color: color05 #D787AF 175 darkmagenta
|
||||
" Color: color13 #FFAFD7 218 magenta
|
||||
" Color: color12 #5FAFFF 75 blue
|
||||
" Color: color05 #D787D7 176 darkmagenta
|
||||
" Color: color13 #FF87FF 213 magenta
|
||||
" Color: color06 #5FAFAF 73 darkcyan
|
||||
" Color: color14 #5FD7D7 116 cyan
|
||||
" Color: color07 #C6C6C6 251 grey
|
||||
" Color: color15 #FFFFFF 231 white
|
||||
" Color: colorDimWhite #EEEEEE 255 grey
|
||||
" Color: colorDimWhite #E4E4E4 254 grey
|
||||
" Color: colorLine #262626 235 darkgrey
|
||||
" Color: colorB #1C1C1C 234 darkgrey
|
||||
" Color: colorNonT #585858 240 grey
|
||||
@@ -927,18 +967,18 @@ endif
|
||||
" Background: light
|
||||
" Color: color00 #000000 16 black
|
||||
" Color: color08 #767676 243 darkgrey
|
||||
" Color: color01 #870000 88 darkred
|
||||
" Color: color01 #AF0000 124 darkred
|
||||
" Color: color09 #D70000 160 red
|
||||
" Color: color02 #008700 28 darkgreen
|
||||
" Color: color10 #87D787 114 green
|
||||
" Color: color03 #875F00 94 darkyellow
|
||||
" Color: color11 #D7D787 186 yellow
|
||||
" Color: color04 #005FAF 25 darkblue
|
||||
" Color: color03 #AF5F00 130 darkyellow
|
||||
" Color: color11 #FFD787 222 yellow
|
||||
" Color: color04 #005FD7 26 darkblue
|
||||
" Color: color12 #0087D7 32 blue
|
||||
" Color: color05 #870087 90 darkmagenta
|
||||
" Color: color13 #AF00AF 133 magenta
|
||||
" Color: color05 #AF00AF 127 darkmagenta
|
||||
" Color: color13 #FF00FF 133 magenta
|
||||
" Color: color06 #005F5F 23 darkcyan
|
||||
" Color: color14 #00AFAF 37 cyan
|
||||
" Color: color14 #008787 30 cyan
|
||||
" Color: color07 #808080 244 grey
|
||||
" Color: color15 #FFFFFF 231 white
|
||||
" Color: colorLine #E4E4E4 254 grey
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Original maintainerRon Aaron <ron@ronware.org>
|
||||
" Website: https://github.com/vim/colorschemes
|
||||
" License: Same as Vim
|
||||
" Last Updated: Sun 04 Sep 2022 09:53:40 MSK
|
||||
" Last Updated: Wed 14 Sep 2022 19:05:27 MSK
|
||||
|
||||
" Generated by Colortemplate v2.2.0
|
||||
|
||||
@@ -280,7 +280,6 @@ if s:t_Co >= 8
|
||||
hi SpellLocal ctermfg=darkmagenta ctermbg=darkyellow cterm=reverse
|
||||
hi SpellRare ctermfg=darkgreen ctermbg=NONE cterm=reverse
|
||||
hi Comment ctermfg=grey ctermbg=NONE cterm=bold
|
||||
hi Comment ctermfg=darkgrey ctermbg=NONE cterm=NONE
|
||||
hi Constant ctermfg=darkcyan ctermbg=NONE cterm=bold
|
||||
hi Identifier ctermfg=darkcyan ctermbg=NONE cterm=NONE
|
||||
hi Statement ctermfg=darkyellow ctermbg=NONE cterm=bold
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
" Maintainer: neutaaaaan <neutaaaaan-gh@protonmail.com>
|
||||
" Website: https://github.com/vim/colorschemes
|
||||
" License: Vim License (see `:help license`)`
|
||||
" Last Updated: Fri 02 Sep 2022 09:55:30 MSK
|
||||
" Last Updated: Fri 16 Sep 2022 09:52:50 MSK
|
||||
|
||||
" Generated by Colortemplate v2.2.0
|
||||
|
||||
@@ -61,8 +61,8 @@ if &background ==# 'dark'
|
||||
hi DiffChange guifg=#87afd7 guibg=#080808 gui=reverse cterm=reverse
|
||||
hi DiffDelete guifg=#d75f5f guibg=#080808 gui=reverse cterm=reverse
|
||||
hi DiffText guifg=#d787d7 guibg=#080808 gui=reverse cterm=reverse
|
||||
hi Directory guifg=#dadada guibg=#080808 gui=NONE cterm=NONE
|
||||
hi EndOfBuffer guifg=#dadada guibg=#080808 gui=NONE cterm=NONE
|
||||
hi Directory guifg=#dadada guibg=NONE gui=NONE cterm=NONE
|
||||
hi EndOfBuffer guifg=#dadada guibg=NONE gui=NONE cterm=NONE
|
||||
hi ErrorMsg guifg=#dadada guibg=#080808 gui=reverse cterm=reverse
|
||||
hi FoldColumn guifg=#707070 guibg=NONE gui=NONE cterm=NONE
|
||||
hi Folded guifg=#707070 guibg=#080808 gui=NONE cterm=NONE
|
||||
@@ -86,13 +86,13 @@ if &background ==# 'dark'
|
||||
hi SpellLocal guifg=#d787d7 guibg=NONE guisp=#d787d7 gui=undercurl cterm=underline
|
||||
hi SpellRare guifg=#00afaf guibg=NONE guisp=#00afaf gui=undercurl cterm=underline
|
||||
hi StatusLine guifg=#080808 guibg=#dadada gui=bold cterm=bold
|
||||
hi StatusLineNC guifg=#707070 guibg=#080808 gui=underline cterm=underline
|
||||
hi TabLine guifg=#707070 guibg=#080808 gui=underline cterm=underline
|
||||
hi StatusLineNC guifg=#707070 guibg=#080808 gui=reverse cterm=reverse
|
||||
hi TabLine guifg=#707070 guibg=#080808 gui=reverse cterm=reverse
|
||||
hi TabLineFill guifg=#dadada guibg=NONE gui=NONE cterm=NONE
|
||||
hi TabLineSel guifg=#080808 guibg=#dadada gui=bold cterm=bold
|
||||
hi Title guifg=#dadada guibg=NONE gui=NONE cterm=NONE
|
||||
hi Title guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi VertSplit guifg=#707070 guibg=#080808 gui=NONE cterm=NONE
|
||||
hi Visual guifg=NONE guibg=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse
|
||||
hi Visual guifg=#ffaf00 guibg=#080808 gui=reverse cterm=reverse
|
||||
hi VisualNOS guifg=NONE guibg=#303030 gui=NONE cterm=NONE
|
||||
hi WarningMsg guifg=#dadada guibg=NONE gui=NONE cterm=NONE
|
||||
hi WildMenu guifg=#00afff guibg=#080808 gui=bold cterm=bold
|
||||
@@ -155,9 +155,9 @@ else
|
||||
hi TabLine guifg=#080808 guibg=#a8a8a8 gui=NONE cterm=NONE
|
||||
hi TabLineFill guifg=#080808 guibg=#d7d7d7 gui=NONE cterm=NONE
|
||||
hi TabLineSel guifg=#eeeeee guibg=#080808 gui=bold cterm=bold
|
||||
hi Title guifg=#080808 guibg=NONE gui=NONE cterm=NONE
|
||||
hi Title guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi VertSplit guifg=#626262 guibg=#d7d7d7 gui=NONE cterm=NONE
|
||||
hi Visual guifg=NONE guibg=NONE gui=reverse ctermfg=NONE ctermbg=NONE cterm=reverse
|
||||
hi Visual guifg=#ffaf00 guibg=#080808 gui=reverse cterm=reverse
|
||||
hi VisualNOS guifg=NONE guibg=#eeeeee gui=NONE cterm=NONE
|
||||
hi WarningMsg guifg=#080808 guibg=NONE gui=NONE cterm=NONE
|
||||
hi WildMenu guifg=#080808 guibg=#eeeeee gui=bold cterm=bold
|
||||
@@ -190,8 +190,8 @@ if s:t_Co >= 256
|
||||
hi DiffChange ctermfg=110 ctermbg=232 cterm=reverse
|
||||
hi DiffDelete ctermfg=167 ctermbg=232 cterm=reverse
|
||||
hi DiffText ctermfg=176 ctermbg=232 cterm=reverse
|
||||
hi Directory ctermfg=253 ctermbg=232 cterm=NONE
|
||||
hi EndOfBuffer ctermfg=253 ctermbg=232 cterm=NONE
|
||||
hi Directory ctermfg=253 ctermbg=NONE cterm=NONE
|
||||
hi EndOfBuffer ctermfg=253 ctermbg=NONE cterm=NONE
|
||||
hi ErrorMsg ctermfg=253 ctermbg=232 cterm=reverse
|
||||
hi FoldColumn ctermfg=242 ctermbg=NONE cterm=NONE
|
||||
hi Folded ctermfg=242 ctermbg=232 cterm=NONE
|
||||
@@ -215,13 +215,13 @@ if s:t_Co >= 256
|
||||
hi SpellLocal ctermfg=176 ctermbg=NONE cterm=underline
|
||||
hi SpellRare ctermfg=37 ctermbg=NONE cterm=underline
|
||||
hi StatusLine ctermfg=232 ctermbg=253 cterm=bold
|
||||
hi StatusLineNC ctermfg=242 ctermbg=232 cterm=underline
|
||||
hi TabLine ctermfg=242 ctermbg=232 cterm=underline
|
||||
hi StatusLineNC ctermfg=242 ctermbg=232 cterm=reverse
|
||||
hi TabLine ctermfg=242 ctermbg=232 cterm=reverse
|
||||
hi TabLineFill ctermfg=253 ctermbg=NONE cterm=NONE
|
||||
hi TabLineSel ctermfg=232 ctermbg=253 cterm=bold
|
||||
hi Title ctermfg=253 ctermbg=NONE cterm=NONE
|
||||
hi Title ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi VertSplit ctermfg=242 ctermbg=232 cterm=NONE
|
||||
hi Visual ctermfg=NONE ctermbg=NONE cterm=reverse
|
||||
hi Visual ctermfg=214 ctermbg=232 cterm=reverse
|
||||
hi VisualNOS ctermfg=NONE ctermbg=236 cterm=NONE
|
||||
hi WarningMsg ctermfg=253 ctermbg=NONE cterm=NONE
|
||||
hi WildMenu ctermfg=39 ctermbg=232 cterm=bold
|
||||
@@ -281,9 +281,9 @@ if s:t_Co >= 256
|
||||
hi TabLine ctermfg=232 ctermbg=248 cterm=NONE
|
||||
hi TabLineFill ctermfg=232 ctermbg=188 cterm=NONE
|
||||
hi TabLineSel ctermfg=255 ctermbg=232 cterm=bold
|
||||
hi Title ctermfg=232 ctermbg=NONE cterm=NONE
|
||||
hi Title ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi VertSplit ctermfg=241 ctermbg=188 cterm=NONE
|
||||
hi Visual ctermfg=NONE ctermbg=NONE cterm=reverse
|
||||
hi Visual ctermfg=214 ctermbg=232 cterm=reverse
|
||||
hi VisualNOS ctermfg=NONE ctermbg=255 cterm=NONE
|
||||
hi WarningMsg ctermfg=232 ctermbg=NONE cterm=NONE
|
||||
hi WildMenu ctermfg=232 ctermbg=255 cterm=bold
|
||||
@@ -350,7 +350,7 @@ if s:t_Co >= 16
|
||||
hi TabLineSel ctermfg=NONE ctermbg=NONE cterm=bold,reverse
|
||||
hi Title ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi VertSplit ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Visual ctermfg=NONE ctermbg=NONE cterm=reverse
|
||||
hi Visual ctermfg=darkyellow ctermbg=black cterm=reverse
|
||||
hi VisualNOS ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi WarningMsg ctermfg=NONE ctermbg=NONE cterm=standout
|
||||
hi WildMenu ctermfg=NONE ctermbg=NONE cterm=bold
|
||||
@@ -412,7 +412,7 @@ if s:t_Co >= 16
|
||||
hi TabLineSel ctermfg=NONE ctermbg=NONE cterm=bold,reverse
|
||||
hi Title ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi VertSplit ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Visual ctermfg=NONE ctermbg=NONE cterm=reverse
|
||||
hi Visual ctermfg=darkyellow ctermbg=black cterm=reverse
|
||||
hi VisualNOS ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi WarningMsg ctermfg=NONE ctermbg=NONE cterm=standout
|
||||
hi WildMenu ctermfg=NONE ctermbg=NONE cterm=bold
|
||||
@@ -479,7 +479,7 @@ if s:t_Co >= 8
|
||||
hi TabLineSel ctermfg=NONE ctermbg=NONE cterm=bold,reverse
|
||||
hi Title ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi VertSplit ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Visual ctermfg=NONE ctermbg=NONE cterm=reverse
|
||||
hi Visual ctermfg=darkyellow ctermbg=black cterm=reverse
|
||||
hi VisualNOS ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi WarningMsg ctermfg=NONE ctermbg=NONE cterm=standout
|
||||
hi WildMenu ctermfg=NONE ctermbg=NONE cterm=bold
|
||||
@@ -541,7 +541,7 @@ if s:t_Co >= 8
|
||||
hi TabLineSel ctermfg=NONE ctermbg=NONE cterm=bold,reverse
|
||||
hi Title ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi VertSplit ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi Visual ctermfg=NONE ctermbg=NONE cterm=reverse
|
||||
hi Visual ctermfg=darkyellow ctermbg=black cterm=reverse
|
||||
hi VisualNOS ctermfg=NONE ctermbg=NONE cterm=NONE
|
||||
hi WarningMsg ctermfg=NONE ctermbg=NONE cterm=standout
|
||||
hi WildMenu ctermfg=NONE ctermbg=NONE cterm=bold
|
||||
@@ -652,7 +652,7 @@ endif
|
||||
" Color: diffred #d75f5f 167 darkred
|
||||
" Color: diffgreen #00af00 34 darkgreen
|
||||
" Color: diffblue #87afd7 110 darkblue
|
||||
" Color: diffpink #d787d7 176 darkmagenta
|
||||
" Color: diffpink #d787d7 176 darkmagenta
|
||||
" Color: uipink #ff00af 199 magenta
|
||||
" Color: uilime #afff00 154 green
|
||||
" Color: uiteal #00ffaf 49 green
|
||||
|
||||
31
runtime/compiler/hare.vim
Normal file
31
runtime/compiler/hare.vim
Normal file
@@ -0,0 +1,31 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Hare Compiler
|
||||
" Maintainer: Amelia Clarke <me@rsaihe.dev>
|
||||
" Last Change: 2022-09-21
|
||||
|
||||
if exists("g:current_compiler")
|
||||
finish
|
||||
endif
|
||||
let g:current_compiler = "hare"
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists(':CompilerSet') != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
if filereadable("Makefile") || filereadable("makefile")
|
||||
CompilerSet makeprg=make
|
||||
else
|
||||
CompilerSet makeprg=hare\ build
|
||||
endif
|
||||
|
||||
CompilerSet errorformat=
|
||||
\Error\ %f:%l:%c:\ %m,
|
||||
\Syntax\ error:\ %.%#\ at\ %f:%l:%c\\,\ %m,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
" vim: tabstop=2 shiftwidth=2 expandtab
|
||||
@@ -1,4 +1,4 @@
|
||||
*builtin.txt* For Vim version 9.0. Last change: 2022 Sep 10
|
||||
*builtin.txt* For Vim version 9.0. Last change: 2022 Sep 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -6,9 +6,10 @@
|
||||
|
||||
Builtin functions *builtin-functions*
|
||||
|
||||
Note: Expression evaluation can be disabled at compile time. If this has been
|
||||
done, the builtin functions are not available. See |+eval| and
|
||||
|no-eval-feature|.
|
||||
Note: Expression evaluation can be disabled at compile time, the builtin
|
||||
functions are not available then. See |+eval| and |no-eval-feature|.
|
||||
|
||||
For functions grouped by what they are used for see |function-list|.
|
||||
|
||||
1. Overview |builtin-function-list|
|
||||
2. Details |builtin-function-details|
|
||||
@@ -753,8 +754,6 @@ abs({expr}) *abs()*
|
||||
Can also be used as a |method|: >
|
||||
Compute()->abs()
|
||||
|
||||
< {only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
acos({expr}) *acos()*
|
||||
Return the arc cosine of {expr} measured in radians, as a
|
||||
@@ -770,8 +769,6 @@ acos({expr}) *acos()*
|
||||
Can also be used as a |method|: >
|
||||
Compute()->acos()
|
||||
|
||||
< {only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
add({object}, {expr}) *add()*
|
||||
Append the item {expr} to |List| or |Blob| {object}. Returns
|
||||
@@ -904,8 +901,6 @@ asin({expr}) *asin()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->asin()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
assert_ functions are documented here: |assert-functions-details|
|
||||
@@ -925,8 +920,6 @@ atan({expr}) *atan()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->atan()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
atan2({expr1}, {expr2}) *atan2()*
|
||||
@@ -943,8 +936,6 @@ atan2({expr1}, {expr2}) *atan2()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->atan2(1)
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
autocmd_add({acmds}) *autocmd_add()*
|
||||
@@ -1428,8 +1419,6 @@ ceil({expr}) *ceil()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->ceil()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
ch_ functions are documented here: |channel-functions-details|
|
||||
@@ -1801,8 +1790,6 @@ cos({expr}) *cos()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->cos()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
cosh({expr}) *cosh()*
|
||||
@@ -1818,8 +1805,6 @@ cosh({expr}) *cosh()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->cosh()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
count({comp}, {expr} [, {ic} [, {start}]]) *count()*
|
||||
@@ -2405,8 +2390,6 @@ exp({expr}) *exp()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->exp()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
expand({string} [, {nosuf} [, {list}]]) *expand()*
|
||||
@@ -2807,8 +2790,6 @@ float2nr({expr}) *float2nr()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->float2nr()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
floor({expr}) *floor()*
|
||||
@@ -2826,8 +2807,6 @@ floor({expr}) *floor()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->floor()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
fmod({expr1}, {expr2}) *fmod()*
|
||||
@@ -2848,8 +2827,6 @@ fmod({expr1}, {expr2}) *fmod()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->fmod(1.22)
|
||||
<
|
||||
{only available when compiled with |+float| feature}
|
||||
|
||||
|
||||
fnameescape({string}) *fnameescape()*
|
||||
@@ -5050,8 +5027,6 @@ isinf({expr}) *isinf()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->isinf()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
islocked({expr}) *islocked()* *E786*
|
||||
The result is a Number, which is |TRUE| when {expr} is the
|
||||
@@ -5080,8 +5055,6 @@ isnan({expr}) *isnan()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->isnan()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
items({dict}) *items()*
|
||||
Return a |List| with all the key-value pairs of {dict}. Each
|
||||
@@ -5510,8 +5483,6 @@ log({expr}) *log()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->log()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
log10({expr}) *log10()*
|
||||
@@ -5526,8 +5497,6 @@ log10({expr}) *log10()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->log10()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
luaeval({expr} [, {expr}]) *luaeval()*
|
||||
Evaluate Lua expression {expr} and return its result converted
|
||||
@@ -5535,8 +5504,7 @@ luaeval({expr} [, {expr}]) *luaeval()*
|
||||
argument accessible as _A inside first {expr}.
|
||||
Strings are returned as they are.
|
||||
Boolean objects are converted to numbers.
|
||||
Numbers are converted to |Float| values if vim was compiled
|
||||
with |+float| and to numbers otherwise.
|
||||
Numbers are converted to |Float| values.
|
||||
Dictionaries and lists obtained by vim.eval() are returned
|
||||
as-is.
|
||||
Other objects are returned as zero without any errors.
|
||||
@@ -5897,7 +5865,7 @@ matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]])
|
||||
respectively. 3 is reserved for use by the |matchparen|
|
||||
plugin.
|
||||
If the {id} argument is not specified or -1, |matchadd()|
|
||||
automatically chooses a free ID.
|
||||
automatically chooses a free ID, which is at least 1000.
|
||||
|
||||
The optional {dict} argument allows for further custom
|
||||
values. Currently this is used to specify a match specific
|
||||
@@ -5951,8 +5919,6 @@ matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]])
|
||||
- A list with three numbers, e.g., [23, 11, 3]. As above, but
|
||||
the third number gives the length of the highlight in bytes.
|
||||
|
||||
The maximum number of positions in {pos} is 8.
|
||||
|
||||
Returns -1 on error.
|
||||
|
||||
Example: >
|
||||
@@ -6483,8 +6449,6 @@ pow({x}, {y}) *pow()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->pow(3)
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
prevnonblank({lnum}) *prevnonblank()*
|
||||
Return the line number of the first line at or above {lnum}
|
||||
@@ -7072,13 +7036,19 @@ reg_recording() *reg_recording()*
|
||||
Returns the single letter name of the register being recorded.
|
||||
Returns an empty string when not recording. See |q|.
|
||||
|
||||
reltime([{start} [, {end}]]) *reltime()*
|
||||
reltime()
|
||||
reltime({start})
|
||||
reltime({start}, {end}) *reltime()*
|
||||
Return an item that represents a time value. The item is a
|
||||
list with items that depend on the system. In Vim 9 script
|
||||
list<any> can be used.
|
||||
The item can be passed to |reltimestr()| to convert it to a
|
||||
string or |reltimefloat()| to convert to a Float.
|
||||
|
||||
string or |reltimefloat()| to convert to a Float. For
|
||||
example, to see the time spent in function Work(): >
|
||||
var startTime = reltime()
|
||||
Work()
|
||||
echo startTime->reltime()->reltimestr()
|
||||
<
|
||||
Without an argument reltime() returns the current time (the
|
||||
representation is system-dependent, it can not be used as the
|
||||
wall-clock time, see |localtime()| for that).
|
||||
@@ -7199,8 +7169,8 @@ remote_peek({serverid} [, {retvar}]) *remote_peek()*
|
||||
This function is not available in the |sandbox|.
|
||||
{only available when compiled with the |+clientserver| feature}
|
||||
Examples: >
|
||||
:let repl = ""
|
||||
:echo "PEEK: " .. remote_peek(id, "repl") .. ": " .. repl
|
||||
:let repl = ""
|
||||
:echo "PEEK: " .. remote_peek(id, "repl") .. ": " .. repl
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
ServerId()->remote_peek()
|
||||
@@ -7260,7 +7230,8 @@ remote_startserver({name})
|
||||
|
||||
< {only available when compiled with the |+clientserver| feature}
|
||||
|
||||
remove({list}, {idx} [, {end}]) *remove()*
|
||||
remove({list}, {idx})
|
||||
remove({list}, {idx}, {end}) *remove()*
|
||||
Without {end}: Remove the item at {idx} from |List| {list} and
|
||||
return the item.
|
||||
With {end}: Remove items from {idx} to {end} (inclusive) and
|
||||
@@ -7278,7 +7249,8 @@ remove({list}, {idx} [, {end}]) *remove()*
|
||||
Can also be used as a |method|: >
|
||||
mylist->remove(idx)
|
||||
|
||||
remove({blob}, {idx} [, {end}])
|
||||
remove({blob}, {idx})
|
||||
remove({blob}, {idx}, {end})
|
||||
Without {end}: Remove the byte at {idx} from |Blob| {blob} and
|
||||
return the byte.
|
||||
With {end}: Remove bytes from {idx} to {end} (inclusive) and
|
||||
@@ -7366,8 +7338,6 @@ round({expr}) *round()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->round()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
rubyeval({expr}) *rubyeval()*
|
||||
Evaluate Ruby expression {expr} and return its result
|
||||
@@ -8536,8 +8506,6 @@ sin({expr}) *sin()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->sin()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
sinh({expr}) *sinh()*
|
||||
@@ -8553,8 +8521,6 @@ sinh({expr}) *sinh()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->sinh()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
slice({expr}, {start} [, {end}]) *slice()*
|
||||
@@ -8821,8 +8787,6 @@ sqrt({expr}) *sqrt()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->sqrt()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
srand([{expr}]) *srand()*
|
||||
@@ -8896,8 +8860,6 @@ str2float({string} [, {quoted}]) *str2float()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
let f = text->substitute(',', '', 'g')->str2float()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
str2list({string} [, {utf8}]) *str2list()*
|
||||
Return a list containing the number values which represent
|
||||
@@ -9643,8 +9605,6 @@ tan({expr}) *tan()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->tan()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
tanh({expr}) *tanh()*
|
||||
@@ -9660,8 +9620,6 @@ tanh({expr}) *tanh()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
Compute()->tanh()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
tempname() *tempname()* *temp-file-name*
|
||||
@@ -9897,8 +9855,6 @@ trunc({expr}) *trunc()*
|
||||
Can also be used as a |method|: >
|
||||
Compute()->trunc()
|
||||
<
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
*type()*
|
||||
type({expr}) The result is a Number representing the type of {expr}.
|
||||
Instead of using the number directly, it is better to use the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 9.0. Last change: 2022 May 26
|
||||
*change.txt* For Vim version 9.0. Last change: 2022 Sep 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1188,11 +1188,20 @@ used. If you do need it you can use |p| with another register. E.g., yank
|
||||
the text to copy, Visually select the text to replace and use "0p . You can
|
||||
repeat this as many times as you like, and the unnamed register will be
|
||||
changed each time.
|
||||
|
||||
When you use a blockwise Visual mode command and yank only a single line into
|
||||
a register, a paste on a visual selected area will paste that single line on
|
||||
each of the selected lines (thus replacing the blockwise selected region by a
|
||||
block of the pasted line).
|
||||
*blockwise-put*
|
||||
When a register contains text from one line (characterwise), using a
|
||||
blockwise Visual selection, putting that register will paste that text
|
||||
repeatedly in each of the selected lines, thus replacing the blockwise
|
||||
selected region by multiple copies of the register text. For example:
|
||||
- yank the word "TEXT" into a register with `yw`
|
||||
- select a visual block, marked with "v" in this text:
|
||||
aaavvaaa
|
||||
bbbvvbbb
|
||||
cccvvccc
|
||||
- press `p`, results in:
|
||||
aaaTEXTaaa
|
||||
bbbTEXTbbb
|
||||
cccTEXTccc
|
||||
|
||||
*blockwise-register*
|
||||
If you use a blockwise Visual mode command to get the text into the register,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 9.0. Last change: 2022 Jun 16
|
||||
*cmdline.txt* For Vim version 9.0. Last change: 2022 Sep 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -806,7 +806,7 @@ Count and Range *N:*
|
||||
|
||||
When giving a count before entering ":", this is translated into:
|
||||
:.,.+(count - 1)
|
||||
In words: The 'count' lines at and after the cursor. Example: To delete
|
||||
In words: The "count" lines at and after the cursor. Example: To delete
|
||||
three lines: >
|
||||
3:d<CR> is translated into: .,.+2d<CR>
|
||||
<
|
||||
@@ -1124,7 +1124,6 @@ Also see |`=|.
|
||||
In the command-line window the command line can be edited just like editing
|
||||
text in any window. It is a special kind of window, because you cannot leave
|
||||
it in a normal way.
|
||||
{not available when compiled without the |+cmdwin| feature}
|
||||
|
||||
|
||||
OPEN *c_CTRL-F* *q:* *q/* *q?*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*develop.txt* For Vim version 9.0. Last change: 2020 Aug 15
|
||||
*develop.txt* For Vim version 9.0. Last change: 2022 Sep 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -188,8 +188,8 @@ C COMPILER *style-compiler* *ANSI-C* *C89* *C99*
|
||||
|
||||
The minimal C compiler version supported is C89, also known as ANSI C.
|
||||
Later standards, such as C99, are not widely supported, or at least not 100%
|
||||
supported. Therefore we use only some of the C99 features and disallow some
|
||||
(at least for now).
|
||||
supported. Therefore we use only some of the C99 features and explicitly
|
||||
disallow some (this will gradually be adjusted over time).
|
||||
|
||||
Please don't make changes everywhere to use the C99 features, it causes merge
|
||||
problems for existing patches. Only use them for new and changed code.
|
||||
@@ -215,12 +215,21 @@ Types ~
|
||||
"long long" is allowed and can be expected to be 64 bits. Use %lld in printf
|
||||
formats. Also "long long unsigned" with %llu.
|
||||
|
||||
Declarations ~
|
||||
|
||||
Now that the minimal supported compiler is MSVC 2015 declarations do not need
|
||||
to be at the start of a block. However, it is often a good idea to do this
|
||||
anyway.
|
||||
|
||||
Declaration of the for loop variable inside the loop is recommended:
|
||||
for (int i = 0; i < len; ++i)
|
||||
Since this is clearly an advantage we'll use this more often.
|
||||
|
||||
|
||||
Not to be used ~
|
||||
|
||||
These C99 features are not to be used, because not enough compilers support
|
||||
them:
|
||||
- Declaration after Statements (MSVC 2012 does not support it). All
|
||||
declarations need to be at the start of the block.
|
||||
- Variable length arrays (even in C11 this is an optional feature).
|
||||
- _Bool and _Complex types.
|
||||
- "inline" (it's hardly ever needed, let the optimizer do its work)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*diff.txt* For Vim version 9.0. Last change: 2022 Jan 22
|
||||
*diff.txt* For Vim version 9.0. Last change: 2022 Oct 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -376,6 +376,9 @@ Additionally, 'diffexpr' should take care of "icase" and "iwhite" in the
|
||||
'diffopt' option. 'diffexpr' cannot change the value of 'lines' and
|
||||
'columns'.
|
||||
|
||||
The advantage of using a function call without arguments is that it is faster,
|
||||
see |expr-option-function|.
|
||||
|
||||
Example (this does almost the same as 'diffexpr' being empty): >
|
||||
|
||||
set diffexpr=MyDiff()
|
||||
@@ -441,6 +444,9 @@ will have the same effect. These variables are set to the file names used:
|
||||
v:fname_diff patch file
|
||||
v:fname_out resulting patched file
|
||||
|
||||
The advantage of using a function call without arguments is that it is faster,
|
||||
see |expr-option-function|.
|
||||
|
||||
Example (this does the same as 'patchexpr' being empty): >
|
||||
|
||||
set patchexpr=MyPatch()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 9.0. Last change: 2022 Sep 09
|
||||
*eval.txt* For Vim version 9.0. Last change: 2022 Sep 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -54,7 +54,6 @@ Number A 32 or 64 bit signed number. |expr-number|
|
||||
Examples: -123 0x10 0177 0o177 0b1011
|
||||
|
||||
Float A floating point number. |floating-point-format| *Float*
|
||||
{only when compiled with the |+float| feature} *E1076*
|
||||
Examples: 123.456 1.15e-6 -1.1e3
|
||||
|
||||
String A NUL terminated string of 8-bit unsigned characters (bytes).
|
||||
@@ -1441,7 +1440,6 @@ digits are ignored.
|
||||
{exp} is the exponent, power of 10.
|
||||
Only a decimal point is accepted, not a comma. No matter what the current
|
||||
locale is.
|
||||
{only when compiled with the |+float| feature}
|
||||
|
||||
Examples:
|
||||
123.456
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*fold.txt* For Vim version 9.0. Last change: 2022 Jan 22
|
||||
*fold.txt* For Vim version 9.0. Last change: 2022 Oct 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -74,8 +74,6 @@ method. The value of the 'foldexpr' option is evaluated to get the foldlevel
|
||||
of a line. Examples:
|
||||
This will create a fold for all consecutive lines that start with a tab: >
|
||||
:set foldexpr=getline(v:lnum)[0]==\"\\t\"
|
||||
This will call a function to compute the fold level: >
|
||||
:set foldexpr=MyFoldLevel(v:lnum)
|
||||
This will make a fold out of paragraphs separated by blank lines: >
|
||||
:set foldexpr=getline(v:lnum)=~'^\\s*$'&&getline(v:lnum+1)=~'\\S'?'<1':1
|
||||
This does the same: >
|
||||
@@ -84,6 +82,10 @@ This does the same: >
|
||||
Note that backslashes must be used to escape characters that ":set" handles
|
||||
differently (space, backslash, double quote, etc., see |option-backslash|).
|
||||
|
||||
The most efficient is to call a compiled function without arguments: >
|
||||
:set foldexpr=MyFoldLevel()
|
||||
The function must use v:lnum. See |expr-option-function|.
|
||||
|
||||
These are the conditions with which the expression is evaluated:
|
||||
- The current buffer and window are set for the line.
|
||||
- The variable "v:lnum" is set to the line number.
|
||||
@@ -501,7 +503,7 @@ is evaluated to obtain the text displayed for a closed fold. Example: >
|
||||
|
||||
This shows the first line of the fold, with "/*", "*/" and "{{{" removed.
|
||||
Note the use of backslashes to avoid some characters to be interpreted by the
|
||||
":set" command. It's simpler to define a function and call that: >
|
||||
":set" command. It is much simpler to define a function and call it: >
|
||||
|
||||
:set foldtext=MyFoldText()
|
||||
:function MyFoldText()
|
||||
@@ -510,6 +512,9 @@ Note the use of backslashes to avoid some characters to be interpreted by the
|
||||
: return v:folddashes .. sub
|
||||
:endfunction
|
||||
|
||||
The advantage of using a function call without arguments is that it is faster,
|
||||
see |expr-option-function|.
|
||||
|
||||
Evaluating 'foldtext' is done in the |sandbox|. The current window is set to
|
||||
the window that displays the line. The context is set to the script where the
|
||||
option was last set.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*ft_context.txt* For Vim version 9.0. Last change: 2022 Aug 12
|
||||
*ft_context.txt* For Vim version 9.0. Last change: 2022 Sep 27
|
||||
|
||||
This is the documentation for the ConTeXt filetype plugin.
|
||||
|
||||
@@ -23,13 +23,12 @@ ConTeXt, similarly to LaTeX, is a macro-based typesetting system built on TeX:
|
||||
<
|
||||
The ConTeXt plugin provides syntax highlighting, completion and support for
|
||||
typesetting ConTeXt documents. The recommended way to typeset a document is to
|
||||
use |:ConTeXt|. This will invoke the `mtxrun` script that is found in $PATH.
|
||||
use |:ConTeXt|. This will invoke the `mtxrun` script that is found in `$PATH`.
|
||||
|
||||
For more fine grained control over the command and its environment, you may
|
||||
invoke `context.Typeset()` directly (or `context#Typeset()` from legacy Vim
|
||||
script). For instance, if you have installed a version of ConTeXt in
|
||||
`~/context`, you may define a function to use it (you may put the following
|
||||
code in `~/.vim/after/ftplugin/context.vim`) similar to the following:
|
||||
For more fine grained control over the command and its environment,
|
||||
`context.Typeset()` can be used directly (or `context#Typeset()` from legacy
|
||||
Vim script). For instance, if a version of ConTeXt is installed in
|
||||
`~/context`, you may define a function to use it similar to the following:
|
||||
>
|
||||
import autoload 'context.vim'
|
||||
|
||||
@@ -38,14 +37,15 @@ code in `~/.vim/after/ftplugin/context.vim`) similar to the following:
|
||||
printf("%s/context/tex/texmf-<os>-<arch>/bin:%s", $HOME, $PATH)}
|
||||
context.Typeset("%", env)
|
||||
enddef
|
||||
<
|
||||
and perhaps use it with a mapping:
|
||||
|
||||
This code may go in `~/.vim/after/ftplugin/context.vim`. A mapping can then be
|
||||
defined to invoke the custom command:
|
||||
>
|
||||
nnoremap <silent><buffer><leader>t <scriptcmd>MyConTeXt()<cr>
|
||||
<
|
||||
`context.Typeset()` accepts a third optional argument to specify a custom
|
||||
typesetting command. Such argument must be a function that takes a path and
|
||||
returns the command as a List. For example:
|
||||
typesetting command. That must be a function that takes a path and returns the
|
||||
command as a List. For example:
|
||||
>
|
||||
def ConTeXtCustomCommand(path: string): list<string>
|
||||
return ['mtxrun', '--script', 'context', '--nonstopmode, path]
|
||||
@@ -103,14 +103,20 @@ Stop all the ConTeXt jobs currently running in the background.
|
||||
Settings ~
|
||||
*'b:context_ignore_makefile'*
|
||||
*'g:context_ignore_makefile'*
|
||||
`make` can be used to (synchronously) typeset a document. If a Makefile exists
|
||||
`:make` can be used to (synchronously) typeset a document. If a Makefile exists
|
||||
and this option is not set, standard `make` is used. If this option is set,
|
||||
`mtxrun` is invoked instead, even if a Makefile exists.
|
||||
>
|
||||
g:context_ignore_makefile = 0
|
||||
<
|
||||
NOTE: before using `make`, set the working directory of the buffer to the
|
||||
NOTE: before using `:make`, set the working directory of the buffer to the
|
||||
directory of the file to be typeset.
|
||||
|
||||
*'g:context_extra_options'*
|
||||
A list of additional options to pass to `mtxrun`.
|
||||
>
|
||||
g:context_extra_options = []
|
||||
<
|
||||
*'b:context_include'*
|
||||
*'g:context_include'*
|
||||
Dictionary of filetype/GROUP pairs for which syntax highlighting should be
|
||||
|
||||
@@ -106,8 +106,7 @@ when you have got a new version):
|
||||
You can also install Vim in the "Send To" menu:
|
||||
1. Start a Windows Explorer
|
||||
2. Navigate to your sendto directory:
|
||||
Windows XP: C:\Documents and Settings\%user%\SendTo
|
||||
Windows Vista: C:\Users\%user%\AppData\Roaming\Microsoft\Windows\SendTo .
|
||||
C:\Users\%user%\AppData\Roaming\Microsoft\Windows\SendTo .
|
||||
3. Right-click in the file pane and select New->Shortcut
|
||||
4. Follow the shortcut wizard, using the full path to VIM/GVIM.
|
||||
|
||||
|
||||
@@ -1227,13 +1227,31 @@ comments will be indented according to the correctly indented code.
|
||||
|
||||
|
||||
VIM *ft-vim-indent*
|
||||
*g:vim_indent*
|
||||
Vim scripts indentation can be configured with the `g:vim_indent` dictionary
|
||||
variable. It supports 3 keys, `line_continuation`, `more_in_bracket_block`,
|
||||
and `searchpair_timeout`.
|
||||
`line_continuation` expects a number which will be added to the indent level of
|
||||
a continuation line starting with a backslash, and defaults to
|
||||
`shiftwidth() * 3`. It also accepts a string, which is evaluated at runtime.
|
||||
`more_in_bracket_block` expects a boolean value; when on, an extra
|
||||
`shiftwidth()` is added inside blocks surrounded with brackets. It defaults to
|
||||
`v:false`.
|
||||
`searchpair_timeout` expects a number which will be passed to `searchpair()` as
|
||||
a timeout. Increasing the value might give more accurate results, but also
|
||||
causes the indentation to take more time. It defaults to 100 (milliseconds).
|
||||
|
||||
Example of configuration:
|
||||
|
||||
let g:vim_indent = #{
|
||||
\ line_continuation: shiftwidth() * 3,
|
||||
\ more_in_bracket_block: v:false,
|
||||
\ searchpair_timeout: 100,
|
||||
\ }
|
||||
|
||||
*g:vim_indent_cont*
|
||||
For indenting Vim scripts there is one variable that specifies the amount of
|
||||
indent for a continuation line, a line that starts with a backslash: >
|
||||
|
||||
:let g:vim_indent_cont = shiftwidth() * 3
|
||||
|
||||
Three times shiftwidth is the default value.
|
||||
This variable is equivalent to `g:vim_indent.line_continuation`.
|
||||
It's supported for backward compatibility.
|
||||
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 9.0. Last change: 2022 Apr 06
|
||||
*insert.txt* For Vim version 9.0. Last change: 2022 Sep 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -667,7 +667,7 @@ When the popup menu is displayed there are a few more special keys, see
|
||||
|popupmenu-keys|.
|
||||
|
||||
Note: The keys that are valid in CTRL-X mode are not mapped. This allows for
|
||||
":map ^F ^X^F" to work (where ^F is CTRL-F and ^X is CTRL-X). The key that
|
||||
`:map <C-F> <C-X><C-F>` to work (assuming "<" is not in 'cpo'). The key that
|
||||
ends CTRL-X mode (any key that is not a valid CTRL-X mode command) is mapped.
|
||||
Also, when doing completion with 'complete' mappings apply as usual.
|
||||
|
||||
@@ -677,11 +677,12 @@ buffer text cannot be changed. Mappings that somehow invoke ":normal i.."
|
||||
will generate an E565 error.
|
||||
|
||||
The following mappings are suggested to make typing the completion commands
|
||||
a bit easier (although they will hide other commands): >
|
||||
:inoremap ^] ^X^]
|
||||
:inoremap ^F ^X^F
|
||||
:inoremap ^D ^X^D
|
||||
:inoremap ^L ^X^L
|
||||
a bit easier (although they will hide other commands; this requires "<" is not
|
||||
in 'cpo'): >
|
||||
:inoremap <C-]> <C-X><C-]>
|
||||
:inoremap <C-F> <C-X><C-F>
|
||||
:inoremap <C-D> <C-X><C-D>
|
||||
:inoremap <C-L> <C-X><C-L>
|
||||
|
||||
As a special case, typing CTRL-R to perform register insertion (see
|
||||
|i_CTRL-R|) will not exit CTRL-X mode. This is primarily to allow the use of
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*intro.txt* For Vim version 9.0. Last change: 2022 Apr 03
|
||||
*intro.txt* For Vim version 9.0. Last change: 2022 Sep 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -533,6 +533,10 @@ examples and use them directly. Or type them literally, including the '<' and
|
||||
'>' characters. This does NOT work for other commands, like ":set" and
|
||||
":autocmd"!
|
||||
|
||||
The notation can be used in a double quoted strings, using "\<" at the start,
|
||||
e.g. "\<C-Space>". This results in a special key code. To convert this back
|
||||
to readable text use `keytrans()`.
|
||||
|
||||
==============================================================================
|
||||
5. Modes, introduction *vim-modes-intro* *vim-modes*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 9.0. Last change: 2022 Jun 18
|
||||
*map.txt* For Vim version 9.0. Last change: 2022 Sep 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1583,7 +1583,7 @@ completion candidates as the return value.
|
||||
|
||||
For the "custom" argument, the function should return the completion
|
||||
candidates one per line in a newline separated string.
|
||||
|
||||
*E1303*
|
||||
For the "customlist" argument, the function should return the completion
|
||||
candidates as a Vim List. Non-string items in the list are ignored.
|
||||
|
||||
@@ -1761,7 +1761,8 @@ The valid escape sequences are
|
||||
If the first two characters of an escape sequence are "q-" (for example,
|
||||
<q-args>) then the value is quoted in such a way as to make it a valid value
|
||||
for use in an expression. This uses the argument as one single value.
|
||||
When there is no argument <q-args> is an empty string.
|
||||
When there is no argument <q-args> is an empty string. See the
|
||||
|q-args-example| below.
|
||||
*<f-args>*
|
||||
To allow commands to pass their arguments on to a user-defined function, there
|
||||
is a special form <f-args> ("function args"). This splits the command
|
||||
@@ -1771,7 +1772,7 @@ See the Mycmd example below. If no arguments are given <f-args> is removed.
|
||||
To embed whitespace into an argument of <f-args>, prepend a backslash.
|
||||
<f-args> replaces every pair of backslashes (\\) with one backslash. A
|
||||
backslash followed by a character other than white space or a backslash
|
||||
remains unmodified. Overview:
|
||||
remains unmodified. Also see |f-args-example| below. Overview:
|
||||
|
||||
command <f-args> ~
|
||||
XX ab 'ab'
|
||||
@@ -1785,7 +1786,8 @@ remains unmodified. Overview:
|
||||
XX a\\\\b 'a\\b'
|
||||
XX a\\\\ b 'a\\', 'b'
|
||||
|
||||
Examples >
|
||||
|
||||
Examples for user commands: >
|
||||
|
||||
" Delete everything after here to the end
|
||||
:com Ddel +,$d
|
||||
@@ -1801,7 +1803,8 @@ Examples >
|
||||
" Count the number of lines in the range
|
||||
:com! -range -nargs=0 Lines echo <line2> - <line1> + 1 "lines"
|
||||
|
||||
" Call a user function (example of <f-args>)
|
||||
< *f-args-example*
|
||||
Call a user function (example of <f-args>) >
|
||||
:com -nargs=* Mycmd call Myfunc(<f-args>)
|
||||
|
||||
When executed as: >
|
||||
@@ -1809,7 +1812,8 @@ When executed as: >
|
||||
This will invoke: >
|
||||
:call Myfunc("arg1","arg2")
|
||||
|
||||
:" A more substantial example
|
||||
< *q-args-example*
|
||||
A more substantial example: >
|
||||
:function Allargs(command)
|
||||
: let i = 0
|
||||
: while i < argc()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*mlang.txt* For Vim version 9.0. Last change: 2020 Aug 15
|
||||
*mlang.txt* For Vim version 9.0. Last change: 2022 Sep 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -82,9 +82,9 @@ use of "-" and "_".
|
||||
characters. This sets $LC_COLLATE.
|
||||
Without an argument all are set, and additionally
|
||||
$LANG is set.
|
||||
When compiled with the |+float| feature the LC_NUMERIC
|
||||
value will always be set to "C", so that floating
|
||||
point numbers use '.' as the decimal point.
|
||||
If available the LC_NUMERIC value will always be set
|
||||
to "C", so that floating point numbers use '.' as the
|
||||
decimal point.
|
||||
This will make a difference for items that depend on
|
||||
the language (some messages, time and date format).
|
||||
Not fully supported on all systems
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*motion.txt* For Vim version 9.0. Last change: 2022 Apr 18
|
||||
*motion.txt* For Vim version 9.0. Last change: 2022 Sep 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1145,7 +1145,7 @@ g; Go to [count] older position in change list.
|
||||
(not a motion command)
|
||||
|
||||
*g,* *E663*
|
||||
g, Go to [count] newer cursor position in change list.
|
||||
g, Go to [count] newer position in change list.
|
||||
Just like |g;| but in the opposite direction.
|
||||
(not a motion command)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 9.0. Last change: 2022 Sep 09
|
||||
*options.txt* For Vim version 9.0. Last change: 2022 Oct 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1626,6 +1626,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Note that v:charconvert_from and v:charconvert_to may be different
|
||||
from 'encoding'. Vim internally uses UTF-8 instead of UCS-2 or UCS-4.
|
||||
|
||||
The advantage of using a function call without arguments is that it is
|
||||
faster, see |expr-option-function|.
|
||||
|
||||
Encryption is not done by Vim when using 'charconvert'. If you want
|
||||
to encrypt the file after conversion, 'charconvert' should take care
|
||||
of this.
|
||||
@@ -1702,7 +1705,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
after that. Therefore do not append an item with += but use ^= to
|
||||
prepend, e.g.: >
|
||||
set clipboard^=unnamed
|
||||
< These names are recognized:
|
||||
< When using the GUI see |'go-A'|.
|
||||
These names are recognized:
|
||||
|
||||
*clipboard-unnamed*
|
||||
unnamed When included, Vim will use the clipboard register '*'
|
||||
@@ -2938,7 +2942,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'display' 'dy' string (default "", set to "truncate" in
|
||||
|defaults.vim|)
|
||||
global
|
||||
Change the way text is displayed. This is comma-separated list of
|
||||
Change the way text is displayed. This is a comma-separated list of
|
||||
flags:
|
||||
lastline When included, as much as possible of the last line
|
||||
in a window will be displayed. "@@@" is put in the
|
||||
@@ -2952,6 +2956,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When neither "lastline" nor "truncate" is included, a last line that
|
||||
doesn't fit is replaced with "@" lines.
|
||||
|
||||
The "@" character can be changed by setting the "lastline" item in
|
||||
'fillchars'. The character is highlighted with |hl-NonText|.
|
||||
|
||||
*'eadirection'* *'ead'*
|
||||
'eadirection' 'ead' string (default "both")
|
||||
global
|
||||
@@ -3416,6 +3423,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
foldsep '|' open fold middle character
|
||||
diff '-' deleted lines of the 'diff' option
|
||||
eob '~' empty lines below the end of a buffer
|
||||
lastline '@' 'display' contains lastline/truncate
|
||||
|
||||
Any one that is omitted will fall back to the default. For "stl" and
|
||||
"stlnc" the space will be used when there is highlighting, '^' or '='
|
||||
@@ -3438,6 +3446,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
fold Folded |hl-Folded|
|
||||
diff DiffDelete |hl-DiffDelete|
|
||||
eob EndOfBuffer |hl-EndOfBuffer|
|
||||
lastline NonText |hl-NonText|
|
||||
|
||||
*'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
|
||||
'fixendofline' 'fixeol' boolean (default on)
|
||||
@@ -3663,6 +3672,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
< This will invoke the mylang#Format() function in the
|
||||
autoload/mylang.vim file in 'runtimepath'. |autoload|
|
||||
|
||||
The advantage of using a function call without arguments is that it is
|
||||
faster, see |expr-option-function|.
|
||||
|
||||
The expression is also evaluated when 'textwidth' is set and adding
|
||||
text beyond that limit. This happens under the same conditions as
|
||||
when internal formatting is used. Make sure the cursor is kept in the
|
||||
@@ -3978,6 +3990,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
"A" - yes
|
||||
"aA" yes yes
|
||||
|
||||
When using a terminal see the 'clipboard' option.
|
||||
|
||||
*'go-c'*
|
||||
'c' Use console dialogs instead of popup dialogs for simple
|
||||
choices.
|
||||
@@ -4531,11 +4545,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
If the expression starts with s: or |<SID>|, then it is replaced with
|
||||
the script ID (|local-function|). Example: >
|
||||
set includeexpr=s:MyIncludeExpr(v:fname)
|
||||
set includeexpr=<SID>SomeIncludeExpr(v:fname)
|
||||
set includeexpr=s:MyIncludeExpr()
|
||||
set includeexpr=<SID>SomeIncludeExpr()
|
||||
< Otherwise, the expression is evaluated in the context of the script
|
||||
where the option was set, thus script-local items are available.
|
||||
|
||||
It is more efficient if the value is just a function call without
|
||||
arguments, see |expr-option-function|.
|
||||
|
||||
The expression will be evaluated in the |sandbox| when set from a
|
||||
modeline, see |sandbox-option|.
|
||||
This option cannot be set in a modeline when 'modelineexpr' is off.
|
||||
@@ -4617,6 +4634,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
< Otherwise, the expression is evaluated in the context of the script
|
||||
where the option was set, thus script-local items are available.
|
||||
|
||||
The advantage of using a function call without arguments is that it is
|
||||
faster, see |expr-option-function|.
|
||||
|
||||
The expression must return the number of spaces worth of indent. It
|
||||
can return "-1" to keep the current indent (this means 'autoindent' is
|
||||
used for the indent).
|
||||
@@ -7287,6 +7307,16 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
reset.
|
||||
NOTE: This option is reset when 'compatible' is set.
|
||||
|
||||
*'smoothscroll'* *'sms'* *'nosmoothscroll'* *'nosms'*
|
||||
'smoothscroll' 'sms' boolean (default off)
|
||||
local to window
|
||||
Scrolling works with screen lines. When 'wrap' is set and the first
|
||||
line in the window wraps part of it may not be visible, as if it is
|
||||
above the window. "<<<" is displayed at the start of the first line,
|
||||
highlighted with |hl-NonText|.
|
||||
NOTE: only partly implemented, currently works with CTRL-E, CTRL-Y
|
||||
and scrolling with the mouse.
|
||||
|
||||
*'softtabstop'* *'sts'*
|
||||
'softtabstop' 'sts' number (default 0)
|
||||
local to buffer
|
||||
@@ -7467,9 +7497,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The file is used for all languages.
|
||||
|
||||
expr:{expr} Evaluate expression {expr}. Use a function to avoid
|
||||
trouble with spaces. |v:val| holds the badly spelled
|
||||
word. The expression must evaluate to a List of
|
||||
Lists, each with a suggestion and a score.
|
||||
trouble with spaces. Best is to call a function
|
||||
without arguments, see |expr-option-function|.
|
||||
|v:val| holds the badly spelled word. The expression
|
||||
must evaluate to a List of Lists, each with a
|
||||
suggestion and a score.
|
||||
Example:
|
||||
[['the', 33], ['that', 44]] ~
|
||||
Set 'verbose' and use |z=| to see the scores that the
|
||||
@@ -7493,24 +7525,28 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When on, splitting a window will put the new window below the current
|
||||
one. |:split|
|
||||
|
||||
*'splitkeep'* *'spk'
|
||||
'splitkeep' 'spk' string (default "cursor")
|
||||
global
|
||||
The value of this option determines the scroll behavior when opening,
|
||||
closing or resizing horizontal splits.
|
||||
|
||||
Possible values are:
|
||||
cursor Keep the same relative cursor position.
|
||||
screen Keep the text on the same screen line.
|
||||
topline Keep the topline the same.
|
||||
|
||||
For the "screen" and "topline" values, the cursor position will be
|
||||
changed when necessary. In this case, the jumplist will be populated
|
||||
with the previous cursor position. For "screen", the text cannot always
|
||||
be kept on the same screen line when 'wrap' is enabled.
|
||||
|
||||
*'splitright'* *'spr'* *'nosplitright'* *'nospr'*
|
||||
'splitright' 'spr' boolean (default off)
|
||||
global
|
||||
When on, splitting a window will put the new window right of the
|
||||
current one. |:vsplit|
|
||||
|
||||
*'splitscroll'* *'spsc'* *'nosplitscroll'* *'nospsc'*
|
||||
'splitscroll' 'spsc' boolean (default on)
|
||||
global
|
||||
The value of this option determines the scroll behavior when opening,
|
||||
closing or resizing horizontal splits. When "on", splitting a window
|
||||
horizontally will keep the same relative cursor position in the old and
|
||||
new window, as well windows that are resized. When "off", scrolling
|
||||
will be avoided to stabilize the window content. Instead, the cursor
|
||||
position will be changed when necessary. In this case, the jumplist
|
||||
will be populated with the previous cursor position. Scrolling cannot
|
||||
be guaranteed to be avoided when 'wrap' is enabled.
|
||||
|
||||
*'startofline'* *'sol'* *'nostartofline'* *'nosol'*
|
||||
'startofline' 'sol' boolean (default on)
|
||||
global
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*os_vms.txt* For Vim version 9.0. Last change: 2021 Jan 04
|
||||
*os_vms.txt* For Vim version 9.0. Last change: 2022 Sep 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL
|
||||
@@ -331,10 +331,10 @@ features, it is worth to choose non GUI executables.
|
||||
8.1 Backspace/delete
|
||||
|
||||
There are backspace/delete key inconsistencies with VMS.
|
||||
:fixdel doesn't do the trick, but the solution is: >
|
||||
:fixdel doesn't do the trick, but the solution is (without "<" in 'cpo'): >
|
||||
|
||||
:inoremap ^? ^H " for terminal mode
|
||||
:inoremap <Del> ^H " for gui mode
|
||||
:inoremap <C-?> <C-H> " for terminal mode
|
||||
:inoremap <Del> <C-H> " for gui mode
|
||||
|
||||
Read more in ch: 8.6 (Terminal problems).
|
||||
(Bruce Hunsaker <BNHunsaker@chq.byu.edu> Vim 5.3)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*os_win32.txt* For Vim version 9.0. Last change: 2022 May 24
|
||||
*os_win32.txt* For Vim version 9.0. Last change: 2022 Sep 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by George Reilly
|
||||
@@ -7,8 +7,11 @@
|
||||
*win32* *Win32* *MS-Windows*
|
||||
This file documents the idiosyncrasies of the Win32 version of Vim.
|
||||
|
||||
The Win32 version of Vim works on Windows XP, Vista, 7, 8, 10 and 11. There are
|
||||
both console and GUI versions.
|
||||
The Win32 version of Vim works on Windows 7, 8, 10 and 11. There are both
|
||||
console and GUI versions.
|
||||
|
||||
If you have Windows XP or Vista then Vim 9.0 up to patch level 495 can be
|
||||
used.
|
||||
|
||||
The 32 bit version also runs on 64 bit MS-Windows systems.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*pattern.txt* For Vim version 9.0. Last change: 2022 Mar 04
|
||||
*pattern.txt* For Vim version 9.0. Last change: 2022 Sep 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -134,6 +134,11 @@ gD Goto global Declaration. When the cursor is on a
|
||||
CTRL-C Interrupt current (search) command. Use CTRL-Break on
|
||||
MS-Windows |dos-CTRL-Break|.
|
||||
In Normal mode, any pending command is aborted.
|
||||
When Vim was started with output redirected and there
|
||||
are no changed buffers CTRL-C exits Vim. That is to
|
||||
help users who use "vim file | grep word" and don't
|
||||
know how to get out (blindly typing :qa<CR> would
|
||||
work).
|
||||
|
||||
*:noh* *:nohlsearch*
|
||||
:noh[lsearch] Stop the highlighting for the 'hlsearch' option. It
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*print.txt* For Vim version 9.0. Last change: 2022 Jan 23
|
||||
*print.txt* For Vim version 9.0. Last change: 2022 Oct 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -158,13 +158,16 @@ currently specified printdevice: >
|
||||
If you change this option, using a function is an easy way to avoid having to
|
||||
escape all the spaces. Example: >
|
||||
|
||||
:set printexpr=PrintFile(v:fname_in)
|
||||
:function PrintFile(fname)
|
||||
: call system("ghostview " .. a:fname)
|
||||
: call delete(a:fname)
|
||||
:set printexpr=PrintFile()
|
||||
:function PrintFile()
|
||||
: call system("ghostview " .. v:fname_in)
|
||||
: call delete(v:fname_in)
|
||||
: return v:shell_error
|
||||
:endfunc
|
||||
|
||||
It is more efficient if the option is set to just a function call,
|
||||
see |expr-option-function|.
|
||||
|
||||
Be aware that some print programs return control before they have read the
|
||||
file. If you delete the file too soon it will not be printed. These programs
|
||||
usually offer an option to have them remove the file when printing is done.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickfix.txt* For Vim version 9.0. Last change: 2022 Feb 22
|
||||
*quickfix.txt* For Vim version 9.0. Last change: 2022 Sep 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -478,7 +478,7 @@ You can parse a list of lines using 'errorformat' without creating or
|
||||
modifying a quickfix list using the |getqflist()| function. Examples: >
|
||||
echo getqflist({'lines' : ["F1:10:Line10", "F2:20:Line20"]})
|
||||
echo getqflist({'lines' : systemlist('grep -Hn quickfix *')})
|
||||
This returns a dictionary where the 'items' key contains the list of quickfix
|
||||
This returns a dictionary where the "items" key contains the list of quickfix
|
||||
entries parsed from lines. The following shows how to use a custom
|
||||
'errorformat' to parse the lines without modifying the 'errorformat' option: >
|
||||
echo getqflist({'efm' : '%f#%l#%m', 'lines' : ['F1#10#Line']})
|
||||
@@ -597,7 +597,7 @@ can go back to the unfiltered list using the |:colder|/|:lolder| command.
|
||||
quickfix command or function, the |b:changedtick|
|
||||
variable is incremented. You can get the number of
|
||||
this buffer using the getqflist() and getloclist()
|
||||
functions by passing the 'qfbufnr' item. For a
|
||||
functions by passing the "qfbufnr" item. For a
|
||||
location list, this buffer is wiped out when the
|
||||
location list is removed.
|
||||
|
||||
@@ -2011,7 +2011,7 @@ The function should return a single line of text to display in the quickfix
|
||||
window for each entry from start_idx to end_idx. The function can obtain
|
||||
information about the entries using the |getqflist()| function and specifying
|
||||
the quickfix list identifier "id". For a location list, getloclist() function
|
||||
can be used with the 'winid' argument. If an empty list is returned, then the
|
||||
can be used with the "winid" argument. If an empty list is returned, then the
|
||||
default format is used to display all the entries. If an item in the returned
|
||||
list is an empty string, then the default format is used to display the
|
||||
corresponding entry.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 9.0. Last change: 2022 May 05
|
||||
*quickref.txt* For Vim version 9.0. Last change: 2022 Oct 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -910,6 +910,7 @@ Short explanation of each option: *option-list*
|
||||
'smartcase' 'scs' no ignore case when pattern has uppercase
|
||||
'smartindent' 'si' smart autoindenting for C programs
|
||||
'smarttab' 'sta' use 'shiftwidth' when inserting <Tab>
|
||||
'smoothscroll' 'sms' scroll by screen lines when 'wrap' is set
|
||||
'softtabstop' 'sts' number of spaces that <Tab> uses while editing
|
||||
'spell' enable spell checking
|
||||
'spellcapcheck' 'spc' pattern to locate end of a sentence
|
||||
@@ -918,8 +919,8 @@ Short explanation of each option: *option-list*
|
||||
'spelloptions' 'spo' options for spell checking
|
||||
'spellsuggest' 'sps' method(s) used to suggest spelling corrections
|
||||
'splitbelow' 'sb' new window from split is below the current one
|
||||
'splitkeep' 'spk' determines scroll behavior for split windows
|
||||
'splitright' 'spr' new window is put right of the current one
|
||||
'splitscroll' 'spsc' determines scroll behavior when splitting windows
|
||||
'startofline' 'sol' commands move cursor to first non-blank in line
|
||||
'statusline' 'stl' custom format for the status line
|
||||
'suffixes' 'su' suffixes that are ignored with multiple match
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 9.0. Last change: 2022 Jun 18
|
||||
*repeat.txt* For Vim version 9.0. Last change: 2022 Sep 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -92,7 +92,8 @@ pattern and do not match another pattern: >
|
||||
This first finds all lines containing "found", but only executes {cmd} when
|
||||
there is no match for "notfound".
|
||||
|
||||
To execute a non-Ex command, you can use the `:normal` command: >
|
||||
Any Ex command can be used, see |ex-cmd-index|. To execute a Normal mode
|
||||
command, you can use the `:normal` command: >
|
||||
:g/pat/normal {commands}
|
||||
Make sure that {commands} ends with a whole command, otherwise Vim will wait
|
||||
for you to type the rest of the command for each match. The screen will not
|
||||
@@ -200,7 +201,8 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
*:source-range*
|
||||
:[range]so[urce] [++clear]
|
||||
Read Ex commands from the [range] of lines in the
|
||||
current buffer.
|
||||
current buffer. When [range] is omitted read all
|
||||
lines.
|
||||
|
||||
When sourcing commands from the current buffer, the
|
||||
same script-ID |<SID>| is used even if the buffer is
|
||||
@@ -904,6 +906,11 @@ 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.
|
||||
|
||||
In a :def function variables that haven't been declared yet cannot be
|
||||
inspected. Variables that have been declared can be inspected, also when the
|
||||
block they were declared in has finished. In commands this would not be
|
||||
possible, thus is slightly misleading (but can be useful).
|
||||
|
||||
The backtrace shows the hierarchy of function calls, e.g.:
|
||||
>bt ~
|
||||
3 function One[3] ~
|
||||
|
||||
@@ -1600,7 +1600,7 @@ CHECKCOMPOUNDTRIPLE (Hunspell) *spell-CHECKCOMPOUNDTRIPLE*
|
||||
Forbid three identical characters when compounding. Not
|
||||
supported.
|
||||
|
||||
CHECKSHARPS (Hunspell)) *spell-CHECKSHARPS*
|
||||
CHECKSHARPS (Hunspell) *spell-CHECKSHARPS*
|
||||
SS letter pair in uppercased (German) words may be upper case
|
||||
sharp s (ß). Not supported.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 9.0. Last change: 2022 Jun 10
|
||||
*syntax.txt* For Vim version 9.0. Last change: 2022 Oct 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -3153,7 +3153,7 @@ The default is to use the twice sh_minlines. Set it to a smaller number to
|
||||
speed up displaying. The disadvantage is that highlight errors may appear.
|
||||
|
||||
syntax/sh.vim tries to flag certain problems as errors; usually things like
|
||||
extra ']'s, 'done's, 'fi's, etc. If you find the error handling problematic
|
||||
unmatched "]", "done", "fi", etc. If you find the error handling problematic
|
||||
for your purposes, you may suppress such error highlighting by putting
|
||||
the following line in your .vimrc: >
|
||||
|
||||
@@ -5376,10 +5376,11 @@ ModeMsg 'showmode' message (e.g., "-- INSERT --").
|
||||
*hl-MoreMsg*
|
||||
MoreMsg |more-prompt|
|
||||
*hl-NonText*
|
||||
NonText '@' at the end of the window, characters from 'showbreak'
|
||||
and other characters that do not really exist in the text
|
||||
(e.g., ">" displayed when a double-wide character doesn't
|
||||
fit at the end of the line).
|
||||
NonText '@' at the end of the window, "<<<" at the start of the window
|
||||
for 'smoothscroll', characters from 'showbreak' and other
|
||||
characters that do not really exist in the text, such as the
|
||||
">" displayed when a double-wide character doesn't fit at the
|
||||
end of the line.
|
||||
*hl-Normal*
|
||||
Normal Normal text.
|
||||
*hl-Pmenu*
|
||||
|
||||
@@ -302,6 +302,7 @@ $quote eval.txt /*$quote*
|
||||
'fs' options.txt /*'fs'*
|
||||
'fsync' options.txt /*'fsync'*
|
||||
'ft' options.txt /*'ft'*
|
||||
'g:context_extra_options' ft_context.txt /*'g:context_extra_options'*
|
||||
'g:context_ignore_makefile' ft_context.txt /*'g:context_ignore_makefile'*
|
||||
'g:context_include' ft_context.txt /*'g:context_include'*
|
||||
'g:mf_other_macros' ft_mp.txt /*'g:mf_other_macros'*
|
||||
@@ -713,6 +714,8 @@ $quote eval.txt /*$quote*
|
||||
'nosmartindent' options.txt /*'nosmartindent'*
|
||||
'nosmarttab' options.txt /*'nosmarttab'*
|
||||
'nosmd' options.txt /*'nosmd'*
|
||||
'nosmoothscroll' options.txt /*'nosmoothscroll'*
|
||||
'nosms' options.txt /*'nosms'*
|
||||
'nosn' options.txt /*'nosn'*
|
||||
'nosol' options.txt /*'nosol'*
|
||||
'nospell' options.txt /*'nospell'*
|
||||
@@ -935,6 +938,8 @@ $quote eval.txt /*$quote*
|
||||
'smarttab' options.txt /*'smarttab'*
|
||||
'smc' options.txt /*'smc'*
|
||||
'smd' options.txt /*'smd'*
|
||||
'smoothscroll' options.txt /*'smoothscroll'*
|
||||
'sms' options.txt /*'sms'*
|
||||
'sn' options.txt /*'sn'*
|
||||
'so' options.txt /*'so'*
|
||||
'softtabstop' options.txt /*'softtabstop'*
|
||||
@@ -951,6 +956,7 @@ $quote eval.txt /*$quote*
|
||||
'spf' options.txt /*'spf'*
|
||||
'spl' options.txt /*'spl'*
|
||||
'splitbelow' options.txt /*'splitbelow'*
|
||||
'splitkeep' options.txt /*'splitkeep'*
|
||||
'splitright' options.txt /*'splitright'*
|
||||
'spo' options.txt /*'spo'*
|
||||
'spr' options.txt /*'spr'*
|
||||
@@ -4087,7 +4093,6 @@ E1072 eval.txt /*E1072*
|
||||
E1073 vim9.txt /*E1073*
|
||||
E1074 vim9.txt /*E1074*
|
||||
E1075 vim9.txt /*E1075*
|
||||
E1076 eval.txt /*E1076*
|
||||
E1077 vim9.txt /*E1077*
|
||||
E1078 autocmd.txt /*E1078*
|
||||
E1079 vim9.txt /*E1079*
|
||||
@@ -4335,7 +4340,13 @@ E1298 vim9.txt /*E1298*
|
||||
E1299 tagsrch.txt /*E1299*
|
||||
E13 message.txt /*E13*
|
||||
E1300 userfunc.txt /*E1300*
|
||||
E1301 vim9.txt /*E1301*
|
||||
E1302 eval.txt /*E1302*
|
||||
E1303 map.txt /*E1303*
|
||||
E1304 vim9.txt /*E1304*
|
||||
E1305 textprop.txt /*E1305*
|
||||
E1306 vim9.txt /*E1306*
|
||||
E1307 vim9.txt /*E1307*
|
||||
E131 userfunc.txt /*E131*
|
||||
E132 userfunc.txt /*E132*
|
||||
E133 userfunc.txt /*E133*
|
||||
@@ -5922,6 +5933,7 @@ blob-modification eval.txt /*blob-modification*
|
||||
blob2list() builtin.txt /*blob2list()*
|
||||
blockwise-examples visual.txt /*blockwise-examples*
|
||||
blockwise-operators visual.txt /*blockwise-operators*
|
||||
blockwise-put change.txt /*blockwise-put*
|
||||
blockwise-register change.txt /*blockwise-register*
|
||||
blockwise-visual visual.txt /*blockwise-visual*
|
||||
blowfish options.txt /*blowfish*
|
||||
@@ -6767,6 +6779,7 @@ expr-lambda eval.txt /*expr-lambda*
|
||||
expr-nesting eval.txt /*expr-nesting*
|
||||
expr-number eval.txt /*expr-number*
|
||||
expr-option eval.txt /*expr-option*
|
||||
expr-option-function vim9.txt /*expr-option-function*
|
||||
expr-quote eval.txt /*expr-quote*
|
||||
expr-register eval.txt /*expr-register*
|
||||
expr-star eval.txt /*expr-star*
|
||||
@@ -6794,6 +6807,7 @@ extendnew() builtin.txt /*extendnew()*
|
||||
extension-removal cmdline.txt /*extension-removal*
|
||||
extensions-improvements todo.txt /*extensions-improvements*
|
||||
f motion.txt /*f*
|
||||
f-args-example map.txt /*f-args-example*
|
||||
false vim9.txt /*false*
|
||||
false-variable eval.txt /*false-variable*
|
||||
falsy eval.txt /*falsy*
|
||||
@@ -7391,6 +7405,7 @@ g:tex_subscripts syntax.txt /*g:tex_subscripts*
|
||||
g:tex_superscripts syntax.txt /*g:tex_superscripts*
|
||||
g:tex_verbspell syntax.txt /*g:tex_verbspell*
|
||||
g:var eval.txt /*g:var*
|
||||
g:vim_indent indent.txt /*g:vim_indent*
|
||||
g:vim_indent_cont indent.txt /*g:vim_indent_cont*
|
||||
g:vimball_home pi_vimball.txt /*g:vimball_home*
|
||||
g:vimball_mkdir pi_vimball.txt /*g:vimball_mkdir*
|
||||
@@ -8122,6 +8137,7 @@ keypad-page-up intro.txt /*keypad-page-up*
|
||||
keypad-plus intro.txt /*keypad-plus*
|
||||
keypad-point intro.txt /*keypad-point*
|
||||
keys() builtin.txt /*keys()*
|
||||
keytrans() builtin.txt /*keytrans()*
|
||||
known-bugs todo.txt /*known-bugs*
|
||||
l motion.txt /*l*
|
||||
l: eval.txt /*l:*
|
||||
@@ -9164,6 +9180,7 @@ pythonx if_pyth.txt /*pythonx*
|
||||
pythonx-directory if_pyth.txt /*pythonx-directory*
|
||||
pyxeval() builtin.txt /*pyxeval()*
|
||||
q repeat.txt /*q*
|
||||
q-args-example map.txt /*q-args-example*
|
||||
q/ cmdline.txt /*q\/*
|
||||
q: cmdline.txt /*q:*
|
||||
q? cmdline.txt /*q?*
|
||||
@@ -10714,6 +10731,7 @@ vim9-literal-dict vim9.txt /*vim9-literal-dict*
|
||||
vim9-mix vim9.txt /*vim9-mix*
|
||||
vim9-namespace vim9.txt /*vim9-namespace*
|
||||
vim9-no-dict-function vim9.txt /*vim9-no-dict-function*
|
||||
vim9-no-shorten vim9.txt /*vim9-no-shorten*
|
||||
vim9-rationale vim9.txt /*vim9-rationale*
|
||||
vim9-reload vim9.txt /*vim9-reload*
|
||||
vim9-s-namespace vim9.txt /*vim9-s-namespace*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*textprop.txt* For Vim version 9.0. Last change: 2021 Nov 23
|
||||
*textprop.txt* For Vim version 9.0. Last change: 2022 Sep 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -142,9 +142,12 @@ prop_add({lnum}, {col}, {props})
|
||||
then "id" must not be present and will be set
|
||||
automatically to a negative number; otherwise
|
||||
zero is used
|
||||
text text to be displayed before {col}, or after the
|
||||
line if {col} is zero; prepend and/or append
|
||||
spaces for padding with highlighting
|
||||
*E1305*
|
||||
text text to be displayed before {col}, or
|
||||
above/below the line if {col} is zero; prepend
|
||||
and/or append spaces for padding with
|
||||
highlighting; cannot be used with "length",
|
||||
"end_lnum" and "end_col" |virtual-text|
|
||||
*E1294*
|
||||
text_align when "text" is present and {col} is zero;
|
||||
specifies where to display the text:
|
||||
@@ -156,7 +159,7 @@ prop_add({lnum}, {col}, {props})
|
||||
above just above the line
|
||||
When omitted "after" is used. Only one
|
||||
"right" property can fit in each line, if
|
||||
there are two ore more these will go in a
|
||||
there are two or more these will go in a
|
||||
separate line (still right aligned).
|
||||
text_padding_left *E1296*
|
||||
used when "text" is present and {col} is zero;
|
||||
@@ -189,12 +192,23 @@ prop_add({lnum}, {col}, {props})
|
||||
If not found an error is given.
|
||||
*virtual-text*
|
||||
When "text" is used and the column is non-zero then this text
|
||||
will be displayed at the start location of the text property
|
||||
after the text. The text of the buffer line will be shifted
|
||||
to make room. This is called "virtual text".
|
||||
When the column is zero the virtual text will appear after the
|
||||
buffer text. The "text_align" and "text_wrap" arguments
|
||||
determine how it is displayed.
|
||||
will be displayed at the specified start location of the text
|
||||
property. The text of the buffer line will be shifted to make
|
||||
room. This is called "virtual text".
|
||||
When the column is zero the virtual text will appear above,
|
||||
after or below the buffer text. The "text_align" and
|
||||
"text_wrap" arguments determine how it is displayed.
|
||||
To separate the virtual text from the buffer text prepend
|
||||
and/or append spaces to the "text" field or use the
|
||||
"text_padding_left" value.
|
||||
|
||||
Make sure to use a highlight that makes clear to the user that
|
||||
this is virtual text, otherwise it will be very confusing that
|
||||
the text cannot be edited. When using "above" you need to
|
||||
make clear this text belongs to the text line below it, when
|
||||
using "below" you need to make sure it belongs to the text
|
||||
line above it.
|
||||
|
||||
The text will be displayed but it is not part of the actual
|
||||
buffer line, the cursor cannot be placed on it. A mouse click
|
||||
in the text will move the cursor to the first character after
|
||||
@@ -206,11 +220,6 @@ prop_add({lnum}, {col}, {props})
|
||||
property with "text" has been added for a buffer then using a
|
||||
negative "id" for any other property will give an error:
|
||||
*E1293*
|
||||
Make sure to use a highlight that makes clear to the user that
|
||||
this is virtual text, otherwise it will be very confusing that
|
||||
the text cannot be edited.
|
||||
To separate the virtual text from the buffer text prepend
|
||||
and/or append spaces to the "text" field.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetLnum()->prop_add(col, props)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 9.0. Last change: 2022 Sep 10
|
||||
*todo.txt* For Vim version 9.0. Last change: 2022 Oct 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -38,50 +38,40 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
'smoothscroll':
|
||||
- computing 'scrolloff' position row use w_skipcol
|
||||
|
||||
Add a string to the 'display' option ("smoothscroll" ?) to make CTRL-E and
|
||||
CTRL-Y scroll one screen line, also if this means the first line doesn't start
|
||||
with the first character (like what happens with a last line that doesn't
|
||||
fit). Display "<<<" at the start of the first visible line (like "@@@" is
|
||||
displayed in the last line). (Arseny Nasokin, #5154)
|
||||
Neovim PR: https://github.com/neovim/neovim/pull/11014
|
||||
|
||||
Use :defer command:
|
||||
- Use "D" flag of writefile() and mkdir() in tests.
|
||||
(testdir/test_c*.vim done)
|
||||
(testdir/test_p*.vim done)
|
||||
|
||||
When using :echomessage do use msg_row and msg_col, but save and restore.
|
||||
How to test any failure? If nothing fails perhaps it's OK alrady.
|
||||
Fix for powershell: #11257
|
||||
|
||||
Change boolean 'splitscroll' into string 'splitkeep'. #11258
|
||||
|
||||
Drop Windows XP? #11089
|
||||
|
||||
Further Vim9 improvements, possibly after launch:
|
||||
- Use Vim9 for more runtime files.
|
||||
- Check performance with callgrind and kcachegrind.
|
||||
getline()/substitute()/setline() in #5632
|
||||
- Better implementation for partial and tests for that.
|
||||
- when using "const" mark the variable type as const with TTFLAG_CONST, so
|
||||
that an error is given at compile time when trying to change it. E.g. for a
|
||||
const list and trying to call add().
|
||||
- Compile options that are an expression, e.g. "expr:" in 'spellsuggest',
|
||||
'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
|
||||
- implement :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.
|
||||
- Inline call to map() and filter(), better type checking.
|
||||
- Make accessing varargs faster: arg[expr]
|
||||
EVAL expr
|
||||
LOADVARARG (varargs idx)
|
||||
- When evaluating constants for script variables, some functions could work:
|
||||
has(featureName), len(someString)
|
||||
- Implement as part of an expression: ++expr, --expr, expr++, expr--.
|
||||
|
||||
Popup windows:
|
||||
- Preview popup not properly updated when it overlaps with completion menu.
|
||||
(Yegappan Lakshmanan, 2021 May 22)
|
||||
- Scrollbar thumb sometimes not visible #10492
|
||||
- Add a function to redraw a specific popup window. Esp. to be used when
|
||||
editing the command line, when screen updating doesn't happen. (Shougo)
|
||||
#10210 Probably need to update all popup windows (they may overlap)
|
||||
If the display is scrolled need to redraw everything later.
|
||||
- Add a flag to make a popup window focusable?
|
||||
CTRL-W P cycle over any preview window or focusable popup, end up back in
|
||||
current window.
|
||||
@@ -108,8 +98,6 @@ Popup windows:
|
||||
- put popup menu also in popup_mask?
|
||||
- Match does not have right BG color if line length equals popup width.
|
||||
(#5658)
|
||||
- Any other commands to disable in a popup window?
|
||||
Use ERROR_IF_POPUP_WINDOW for these.
|
||||
- Figure out the size and position better if wrapping inserts indent
|
||||
|
||||
'incsearch' with :s:
|
||||
@@ -185,8 +173,6 @@ Terminal emulator window:
|
||||
- When 'encoding' is not utf-8, or the job is using another encoding, setup
|
||||
conversions.
|
||||
|
||||
Add 'splitscroll' #10682 Anything remaining
|
||||
|
||||
Autoconf: must use autoconf 2.69, later version generates lots of warnings
|
||||
- try using autoconf 2.71 and fix all "obsolete" warnings
|
||||
|
||||
@@ -197,6 +183,9 @@ reduced?
|
||||
|
||||
Add BufDeletePost. #11041
|
||||
|
||||
Test property disappears when using CR twice in a row. OK when some text was
|
||||
entered. (#11151)
|
||||
|
||||
NFA regexp does not handle composing characters well: #10286
|
||||
[ɔ̃] matches both ɔ and ɔ̃
|
||||
\(ɔ\|ɔ̃\) matches ɔ and not ɔ̃
|
||||
@@ -274,7 +263,9 @@ Adding "10" to 'spellsuggest' causes spell suggestions to become very slow.
|
||||
Also, z= in German on a long word can take a very long time, but CTRL-C to
|
||||
interrupt does not work. Where to add ui_breakcheck()?
|
||||
New English spell files also have very slow suggestions.
|
||||
|
||||
French spell files don't work correctly. #4916
|
||||
Make Vim understand the format somehow?
|
||||
|
||||
Make "g>" and "g<" in Visual mode move the text right or left.
|
||||
Also for a block selection. #8558
|
||||
@@ -556,12 +547,6 @@ Bug: script written with "-W scriptout" contains Key codes, while the script
|
||||
read with "-s scriptin" expects escape codes. Probably "scriptout" needs to
|
||||
be adjusted. (Daniel Steinberg, 2019 Feb 24, #4041)
|
||||
|
||||
Add a string to the 'display' option ("smoothscroll" ?) to make CTRL-E and
|
||||
CTRL-Y scroll one screen line, also if this means the first line doesn't start
|
||||
with the first character (like what happens with a last line that doesn't
|
||||
fit). Display "<<<" at the start of the first visible line (like "@@@" is
|
||||
displayed in the last line). (Arseny Nasokin, #5154)
|
||||
|
||||
Window size changes after closing a tab. (#4741)
|
||||
|
||||
Problem with colors in terminal window. (Jason Franklin, 2019 May 12)
|
||||
@@ -672,9 +657,6 @@ when possible. (Dylan Lloyd, #3973)
|
||||
Make ":interactive !cmd" stop termcap mode, also when used in an autocommand.
|
||||
(#3692)
|
||||
|
||||
matchaddpos() gets slow with many matches. Proposal by Rick Howe, 2018 Jul
|
||||
19.
|
||||
|
||||
Add something like 'fillchars' local to window, but allow for specifying a
|
||||
highlight name. Esp. for the statusline.
|
||||
And "extends" and "precedes" are also useful without 'list' set. Also in
|
||||
|
||||
@@ -15,7 +15,7 @@ This is introduced in section |41.7| of the user manual.
|
||||
|
||||
==============================================================================
|
||||
|
||||
1. Defining a fuction ~
|
||||
1. Defining a function ~
|
||||
*define-function*
|
||||
New functions can be defined. These can be called just like builtin
|
||||
functions. The function executes a sequence of Ex commands. Normal mode
|
||||
@@ -308,7 +308,7 @@ This function can then be called with: >
|
||||
<
|
||||
==============================================================================
|
||||
|
||||
2. Calling a fuction ~
|
||||
2. Calling a function ~
|
||||
*:cal* *:call* *E107*
|
||||
:[range]cal[l] {name}([arguments])
|
||||
Call a function. The name of the function and its arguments
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 9.0. Last change: 2022 Jun 25
|
||||
*various.txt* For Vim version 9.0. Last change: 2022 Sep 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -29,6 +29,8 @@ CTRL-L Clear and redraw the screen. The redraw may happen
|
||||
Useful to update the status line(s) when 'statusline'
|
||||
includes an item that doesn't cause automatic
|
||||
updating.
|
||||
If the command line is being edited the redraw is
|
||||
postponed until later.
|
||||
|
||||
*:redrawt* *:redrawtabline*
|
||||
:redrawt[abline] Redraw the tabline. Useful to update the tabline when
|
||||
@@ -347,14 +349,14 @@ T *++builtin_terms* maximal terminals builtin |builtin-terms| Always
|
||||
N *+byte_offset* support for 'o' flag in 'statusline' option, "go"
|
||||
and ":goto" commands.
|
||||
m *+channel* inter process communication |channel|
|
||||
6 *+cindent* |'cindent'|, C indenting
|
||||
T *+cindent* |'cindent'|, C indenting; Always enabled
|
||||
N *+clientserver* Unix and Win32: Remote invocation |clientserver|
|
||||
*+clipboard* |clipboard| support compiled-in
|
||||
*+clipboard_working* |clipboard| support compiled-in and working
|
||||
T *+cmdline_compl* command line completion |cmdline-completion|
|
||||
T *+cmdline_hist* command line history |cmdline-history|
|
||||
N *+cmdline_info* |'showcmd'| and |'ruler'|
|
||||
S *+cmdwin* |cmdline-window| support
|
||||
T *+cmdwin* |cmdline-window| support; Always enabled since 9.0.0657
|
||||
T *+comments* |'comments'| support
|
||||
B *+conceal* "conceal" support, see |conceal| |:syn-conceal| etc.
|
||||
N *+cryptv* encryption support |encryption|
|
||||
@@ -381,7 +383,7 @@ N *+find_in_path* include file searches: |[I|, |:isearch|,
|
||||
N *+folding* |folding|
|
||||
*+footer* |gui-footer|
|
||||
*+fork* Unix only: |fork| shell commands
|
||||
*+float* Floating point support
|
||||
T *+float* Floating point support Always enabled since 9.0.0491
|
||||
N *+gettext* message translations |multi-lang|
|
||||
- *+GUI_Athena* Unix only: Athena |GUI|
|
||||
*+GUI_neXtaw* Unix only: neXtaw |GUI|
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*vim9.txt* For Vim version 9.0. Last change: 2022 Sep 10
|
||||
*vim9.txt* For Vim version 9.0. Last change: 2022 Oct 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -107,7 +107,7 @@ script and `:def` functions; details are below:
|
||||
`:t`
|
||||
`:xit`
|
||||
- Some commands, especially those used for flow control, cannot be shortened.
|
||||
E.g., `:throw` cannot be written as `:th`.
|
||||
E.g., `:throw` cannot be written as `:th`. *vim9-no-shorten*
|
||||
- You cannot use curly-braces names.
|
||||
- A range before a command must be prefixed with a colon: >
|
||||
:%s/this/that
|
||||
@@ -502,7 +502,7 @@ How constants work varies between languages. Some consider a variable that
|
||||
can't be assigned another value a constant. JavaScript is an example. Others
|
||||
also make the value immutable, thus when a constant uses a list, the list
|
||||
cannot be changed. In Vim9 we can use both.
|
||||
*E1021*
|
||||
*E1021* *E1307*
|
||||
`:const` is used for making both the variable and the value a constant. Use
|
||||
this for composite structures that you want to make sure will not be modified.
|
||||
Example: >
|
||||
@@ -962,6 +962,8 @@ In compiled Vim9 script you get:
|
||||
3
|
||||
Generally, you should not change the list that is iterated over. Make a copy
|
||||
first if needed.
|
||||
*E1306*
|
||||
The depth of loops, :for and :while loops added together, cannot exceed 10.
|
||||
|
||||
|
||||
Conditions and expressions ~
|
||||
@@ -1336,16 +1338,15 @@ This will generate error |E1302|: >
|
||||
})
|
||||
endfor
|
||||
|
||||
You need to create a closure to store the current value of "n", so that it is
|
||||
evaluated at the time the closure is created: >
|
||||
def GetClosure(nr: number): func
|
||||
return (_) => {
|
||||
echowindow nr
|
||||
}
|
||||
enddef
|
||||
|
||||
You need to use a block and define a variable there, and use that one in the
|
||||
closure: >
|
||||
for n in range(4)
|
||||
timer_start(500 * n, GetClosure(n))
|
||||
{
|
||||
var nr = n
|
||||
timer_start(500 * n, (_) => {
|
||||
echowin nr
|
||||
})
|
||||
}
|
||||
endfor
|
||||
|
||||
Using `echowindow` is useful in a timer, the messages go into a popup and will
|
||||
@@ -1409,6 +1410,21 @@ to a Vim9 function:
|
||||
'three'
|
||||
]
|
||||
|
||||
|
||||
Calling a function in an expr option ~
|
||||
*expr-option-function*
|
||||
The value of a few options, such as 'foldexpr', is an expression that is
|
||||
evaluated to get a value. The evaluation can have quite a bit of overhead.
|
||||
One way to minimize the overhead, and also to keep the option value very
|
||||
simple, is to define a compiled function and set the option to call it
|
||||
without arguments. Example: >
|
||||
vim9script
|
||||
def MyFoldFunc(): any
|
||||
... compute fold level for line v:lnum
|
||||
return level
|
||||
enddef
|
||||
set foldexpr=s:MyFoldFunc()
|
||||
|
||||
==============================================================================
|
||||
|
||||
4. Types *vim9-types*
|
||||
@@ -1684,7 +1700,7 @@ deleted.
|
||||
|
||||
In Vim9 script the global "g:" namespace can still be used as before. And the
|
||||
"w:", "b:" and "t:" namespaces. These have in common that variables are not
|
||||
declared and they can be deleted.
|
||||
declared, have no specific type and they can be deleted. *E1304*
|
||||
|
||||
A side effect of `:vim9script` is that the 'cpoptions' option is set to the
|
||||
Vim default value, like with: >
|
||||
@@ -1825,7 +1841,7 @@ And using the "as name" form: >
|
||||
import "otherfile.vim9script" as that
|
||||
call s:that.OtherFunc()
|
||||
|
||||
However, the namespace cannot be resolved on it's own: >
|
||||
However, the namespace cannot be resolved on its own: >
|
||||
import "that.vim"
|
||||
echo s:that
|
||||
" ERROR: E1060: Expected dot after name: s:that
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2022 Sep 09
|
||||
" Last Change: 2022 Sep 27
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -299,6 +299,9 @@ au BufNewFile,BufRead cfengine.conf setf cfengine
|
||||
" ChaiScript
|
||||
au BufRead,BufNewFile *.chai setf chaiscript
|
||||
|
||||
" Chatito
|
||||
au BufNewFile,BufRead *.chatito setf chatito
|
||||
|
||||
" Comshare Dimension Definition Language
|
||||
au BufNewFile,BufRead *.cdl setf cdl
|
||||
|
||||
@@ -448,6 +451,9 @@ endif
|
||||
" Lynx config files
|
||||
au BufNewFile,BufRead lynx.cfg setf lynx
|
||||
|
||||
" LyRiCs
|
||||
au BufNewFile,BufRead *.lrc setf lyrics
|
||||
|
||||
" Modula-3 configuration language (must be before *.cfg and *makefile)
|
||||
au BufNewFile,BufRead *.quake,cm3.cfg setf m3quake
|
||||
au BufNewFile,BufRead m3makefile,m3overrides setf m3build
|
||||
@@ -764,8 +770,8 @@ au BufNewFile,BufRead gitolite.conf setf gitolite
|
||||
au BufNewFile,BufRead {,.}gitolite.rc,example.gitolite.rc setf perl
|
||||
|
||||
" Glimmer-flavored TypeScript and JavaScript
|
||||
au BufNewFile,BufRead *.gts setf typescript.glimmer
|
||||
au BufNewFile,BufRead *.gjs setf javascript.glimmer
|
||||
au BufNewFile,BufRead *.gts setf typescript.glimmer
|
||||
au BufNewFile,BufRead *.gjs setf javascript.glimmer
|
||||
|
||||
" Gnuplot scripts
|
||||
au BufNewFile,BufRead *.gpi,.gnuplot setf gnuplot
|
||||
@@ -796,6 +802,9 @@ au BufNewFile,BufRead */etc/group,*/etc/group-,*/etc/group.edit,*/etc/gshadow,*/
|
||||
" GTK RC
|
||||
au BufNewFile,BufRead .gtkrc,gtkrc setf gtkrc
|
||||
|
||||
" GYP
|
||||
au BufNewFile,BufRead *.gyp,*.gypi setf gyp
|
||||
|
||||
" Hack
|
||||
au BufRead,BufNewFile *.hack,*.hackpartial setf hack
|
||||
|
||||
@@ -838,6 +847,9 @@ au BufNewFile,BufRead *.hex,*.h32 setf hex
|
||||
" Hjson
|
||||
au BufNewFile,BufRead *.hjson setf hjson
|
||||
|
||||
" HLS Playlist (or another form of playlist)
|
||||
au BufNewFile,BufRead *.m3u,*.m3u8 setf hlsplaylist
|
||||
|
||||
" Hollywood
|
||||
au BufRead,BufNewFile *.hws setf hollywood
|
||||
|
||||
@@ -1017,6 +1029,9 @@ au BufNewFile,BufRead Kconfig,Kconfig.debug setf kconfig
|
||||
" Lace (ISE)
|
||||
au BufNewFile,BufRead *.ace,*.ACE setf lace
|
||||
|
||||
" Latexmkrc
|
||||
au BufNewFile,BufRead .latexmkrc,latexmkrc setf perl
|
||||
|
||||
" Latte
|
||||
au BufNewFile,BufRead *.latte,*.lte setf latte
|
||||
|
||||
@@ -1097,6 +1112,9 @@ au BufNewFile,BufRead *.lou,*.lout setf lout
|
||||
" Lua
|
||||
au BufNewFile,BufRead *.lua setf lua
|
||||
|
||||
" Luacheck
|
||||
au BufNewFile,BufRead .luacheckrc setf lua
|
||||
|
||||
" Luarocks
|
||||
au BufNewFile,BufRead *.rockspec setf lua
|
||||
|
||||
@@ -1269,6 +1287,9 @@ au BufNewFile,BufRead .netrc setf netrc
|
||||
" Nginx
|
||||
au BufNewFile,BufRead *.nginx,nginx*.conf,*nginx.conf,*/etc/nginx/*,*/usr/local/nginx/conf/*,*/nginx/*.conf setf nginx
|
||||
|
||||
" Nim file
|
||||
au BufNewFile,BufRead *.nim,*.nims,*.nimble setf nim
|
||||
|
||||
" Ninja file
|
||||
au BufNewFile,BufRead *.ninja setf ninja
|
||||
|
||||
@@ -2068,7 +2089,7 @@ au BufNewFile,BufRead *.tsv setf tsv
|
||||
" TWIG files
|
||||
au BufNewFile,BufReadPost *.twig setf twig
|
||||
|
||||
" Typescript or Qt translation file (which is XML)
|
||||
" TypeScript or Qt translation file (which is XML)
|
||||
au BufNewFile,BufReadPost *.ts
|
||||
\ if getline(1) =~ '<?xml' |
|
||||
\ setf xml |
|
||||
@@ -2076,6 +2097,9 @@ au BufNewFile,BufReadPost *.ts
|
||||
\ setf typescript |
|
||||
\ endif
|
||||
|
||||
" TypeScript module and common
|
||||
au BufNewFile,BufRead *.mts,*.cts setf typescript
|
||||
|
||||
" TypeScript with React
|
||||
au BufNewFile,BufRead *.tsx setf typescriptreact
|
||||
|
||||
@@ -2267,7 +2291,7 @@ au BufNewFile,BufRead *.fsproj,*.fsproj.user setf xml
|
||||
au BufNewFile,BufRead *.vbproj,*.vbproj.user setf xml
|
||||
|
||||
" Qt Linguist translation source and Qt User Interface Files are XML
|
||||
" However, for .ts Typescript is more common.
|
||||
" However, for .ts TypeScript is more common.
|
||||
au BufNewFile,BufRead *.ui setf xml
|
||||
|
||||
" TPM's are RDF-based descriptions of TeX packages (Nikolai Weibull)
|
||||
|
||||
15
runtime/ftplugin/chatito.vim
Normal file
15
runtime/ftplugin/chatito.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Chatito
|
||||
" Maintainer: ObserverOfTime <chronobserver@disroot.org>
|
||||
" Last Change: 2022 Sep 19
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal comments=:#,:// commentstring=#\ %s
|
||||
" indent of 4 spaces is mandated by the spec
|
||||
setlocal expandtab softtabstop=4 shiftwidth=4
|
||||
|
||||
let b:undo_ftplugin = 'setl com< cms< et< sts< sw<'
|
||||
16
runtime/ftplugin/crontab.vim
Normal file
16
runtime/ftplugin/crontab.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
" Vim filetype plugin
|
||||
" Language: crontab
|
||||
" Maintainer: Keith Smiley <keithbsmiley@gmail.com>
|
||||
" Last Change: 2022 Sep 11
|
||||
|
||||
" 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
|
||||
|
||||
let b:undo_ftplugin = "setl commentstring<"
|
||||
|
||||
setlocal commentstring=#\ %s
|
||||
@@ -1,7 +1,7 @@
|
||||
" Elixir filetype plugin
|
||||
" Language: Elixir
|
||||
" Maintainer: Mitchell Hanberg <vimNOSPAM@mitchellhanberg.com>
|
||||
" Last Change: 2022 August 10
|
||||
" Last Change: 2022 Sep 20
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -23,7 +23,11 @@ if exists('loaded_matchit') && !exists('b:match_words')
|
||||
\ ',{:},\[:\],(:)'
|
||||
endif
|
||||
|
||||
setlocal shiftwidth=2 softtabstop=2 expandtab iskeyword+=!,?
|
||||
setlocal comments=:#
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms<'
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
" Contributors: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||
" Eduardo Lopez (http://github.com/tapichu)
|
||||
" Arvid Bjurklint (http://github.com/slarwise)
|
||||
" Last Update: 2021-Jan-08
|
||||
" Last Update: 2021-Nov-22
|
||||
" License: Vim license
|
||||
" URL: https://github.com/vim-erlang/vim-erlang-runtime
|
||||
|
||||
@@ -30,6 +30,28 @@ setlocal commentstring=%%s
|
||||
|
||||
setlocal formatoptions+=ro
|
||||
|
||||
if get(g:, 'erlang_extend_path', 1)
|
||||
" typical erlang.mk paths
|
||||
let &l:path = join([
|
||||
\ 'deps/*/include',
|
||||
\ 'deps/*/src',
|
||||
\ 'deps/*/test',
|
||||
\ 'deps/*/apps/*/include',
|
||||
\ 'deps/*/apps/*/src',
|
||||
\ &g:path], ',')
|
||||
" typical rebar3 paths
|
||||
let &l:path = join([
|
||||
\ 'apps/*/include',
|
||||
\ 'apps/*/src',
|
||||
\ '_build/default/lib/*/src',
|
||||
\ '_build/default/*/include',
|
||||
\ &l:path], ',')
|
||||
" typical erlang paths
|
||||
let &l:path = join(['include', 'src', 'test', &l:path], ',')
|
||||
|
||||
set wildignore+=*/.erlang.mk/*,*.beam
|
||||
endif
|
||||
|
||||
setlocal suffixesadd=.erl,.hrl
|
||||
|
||||
let &l:include = '^\s*-\%(include\|include_lib\)\s*("\zs\f*\ze")'
|
||||
|
||||
@@ -41,14 +41,19 @@ def GDScriptFoldLevel(): string
|
||||
enddef
|
||||
|
||||
|
||||
# Next/Previous section
|
||||
def NextSection(back: bool, cnt: number)
|
||||
for n in range(cnt)
|
||||
search('^\s*func\s', back ? 'bW' : 'W')
|
||||
endfor
|
||||
enddef
|
||||
if !exists("g:no_plugin_maps")
|
||||
# Next/Previous section
|
||||
def NextSection(back: bool, cnt: number)
|
||||
for n in range(cnt)
|
||||
search('^\s*func\s', back ? 'bW' : 'W')
|
||||
endfor
|
||||
enddef
|
||||
|
||||
nnoremap <silent><buffer> ]] <scriptcmd>NextSection(false, v:count1)<CR>
|
||||
nnoremap <silent><buffer> [[ <scriptcmd>NextSection(true, v:count1)<CR>
|
||||
xmap <buffer><expr> ]] $'<C-\><C-N>{v:count1}]]m>gv'
|
||||
xmap <buffer><expr> [[ $'<C-\><C-N>{v:count1}[[m>gv'
|
||||
nnoremap <silent><buffer> ]] <scriptcmd>NextSection(false, v:count1)<CR>
|
||||
nnoremap <silent><buffer> [[ <scriptcmd>NextSection(true, v:count1)<CR>
|
||||
xmap <buffer><expr> ]] $'<C-\><C-N>{v:count1}]]m>gv'
|
||||
xmap <buffer><expr> [[ $'<C-\><C-N>{v:count1}[[m>gv'
|
||||
b:undo_ftplugin ..=
|
||||
\ " | silent exe 'unmap <buffer> [['"
|
||||
\ .. " | silent exe 'unmap <buffer> ]]'"
|
||||
endif
|
||||
|
||||
@@ -3,6 +3,7 @@ vim9script
|
||||
# Vim filetype plugin file
|
||||
# Language: Godot shading language
|
||||
# Maintainer: Maxim Kim <habamax@gmail.com>
|
||||
# Website: https://github.com/habamax/vim-gdscript
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
b:did_ftplugin = 1
|
||||
|
||||
14
runtime/ftplugin/gyp.vim
Normal file
14
runtime/ftplugin/gyp.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
" Vim filetype plugin
|
||||
" Language: GYP
|
||||
" Maintainer: ObserverOfTime <chronobserver@disroot.org>
|
||||
" Last Change: 2022 Sep 27
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal formatoptions-=t
|
||||
setlocal commentstring=#\ %s comments=b:#,fb:-
|
||||
|
||||
let b:undo_ftplugin = 'setlocal fo< cms< com<'
|
||||
27
runtime/ftplugin/hare.vim
Normal file
27
runtime/ftplugin/hare.vim
Normal file
@@ -0,0 +1,27 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Hare
|
||||
" Maintainer: Amelia Clarke <me@rsaihe.dev>
|
||||
" Previous Maintainer: Drew DeVault <sir@cmpwn.com>
|
||||
" Last Updated: 2022-09-21
|
||||
|
||||
" 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 noexpandtab
|
||||
setlocal tabstop=8
|
||||
setlocal shiftwidth=0
|
||||
setlocal softtabstop=0
|
||||
setlocal textwidth=80
|
||||
setlocal commentstring=//\ %s
|
||||
|
||||
" Set 'formatoptions' to break comment lines but not other lines,
|
||||
" and insert the comment leader when hitting <CR> or using "o".
|
||||
setlocal fo-=t fo+=croql
|
||||
|
||||
compiler hare
|
||||
" vim: tabstop=2 shiftwidth=2 expandtab
|
||||
16
runtime/ftplugin/heex.vim
Normal file
16
runtime/ftplugin/heex.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
" Elixir filetype plugin
|
||||
" Language: HEEx
|
||||
" Maintainer: Mitchell Hanberg <vimNOSPAM@mitchellhanberg.com>
|
||||
" Last Change: 2022 Sep 21
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal shiftwidth=2 softtabstop=2 expandtab
|
||||
|
||||
setlocal comments=:<%!--
|
||||
setlocal commentstring=<%!--\ %s\ --%>
|
||||
|
||||
let b:undo_ftplugin = 'set sw< sts< et< com< cms<'
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Jason Franklin <vim@justemail.net>
|
||||
" Maintainer: SungHyun Nam <goweol@gmail.com>
|
||||
" Autoload Split: Bram Moolenaar
|
||||
" Last Change: 2022 Jun 18
|
||||
" Last Change: 2022 Sep 30
|
||||
|
||||
" To make the ":Man" command available before editing a manual page, source
|
||||
" this script from your startup vimrc file.
|
||||
@@ -23,8 +23,9 @@ let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
if &filetype == "man"
|
||||
" allow dot and dash in manual page name.
|
||||
setlocal iskeyword+=\.,-
|
||||
" Allow hyphen, plus, colon, dot, and commercial at in manual page name.
|
||||
" Allow parentheses for references.
|
||||
setlocal iskeyword=48-57,_,a-z,A-Z,-,+,:,.,@-@,(,)
|
||||
let b:undo_ftplugin = "setlocal iskeyword<"
|
||||
|
||||
" Add mappings, unless the user didn't want this.
|
||||
|
||||
14
runtime/ftplugin/vdf.vim
Normal file
14
runtime/ftplugin/vdf.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Valve Data Format
|
||||
" Maintainer: ObserverOfTime <chronobserver@disroot.org>
|
||||
" Last Change: 2022 Sep 15
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setl comments=:// commentstring=//\ %s
|
||||
setl foldmethod=syntax
|
||||
|
||||
let b:undo_ftplugin = 'setl com< cms< fdm<'
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Vim
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2022 Sep 09
|
||||
" Last Change: 2022 Sep 20
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -74,14 +74,14 @@ if !exists("no_plugin_maps") && !exists("no_vim_maps")
|
||||
let b:did_add_maps = 1
|
||||
|
||||
" Move around functions.
|
||||
nnoremap <silent><buffer> [[ m':call search('^\s*\(fu\%[nction]\\|def\)\>', "bW")<CR>
|
||||
vnoremap <silent><buffer> [[ m':<C-U>exe "normal! gv"<Bar>call search('^\s*\(fu\%[nction]\\|def\)\>', "bW")<CR>
|
||||
nnoremap <silent><buffer> ]] m':call search('^\s*\(fu\%[nction]\\|def\)\>', "W")<CR>
|
||||
vnoremap <silent><buffer> ]] m':<C-U>exe "normal! gv"<Bar>call search('^\s*\(fu\%[nction]\\|def\)\>', "W")<CR>
|
||||
nnoremap <silent><buffer> [] m':call search('^\s*end\(f\%[unction]\\|def\)\>', "bW")<CR>
|
||||
vnoremap <silent><buffer> [] m':<C-U>exe "normal! gv"<Bar>call search('^\s*end\(f\%[unction]\\|def\)\>', "bW")<CR>
|
||||
nnoremap <silent><buffer> ][ m':call search('^\s*end\(f\%[unction]\\|def\)\>', "W")<CR>
|
||||
vnoremap <silent><buffer> ][ m':<C-U>exe "normal! gv"<Bar>call search('^\s*end\(f\%[unction]\\|def\)\>', "W")<CR>
|
||||
nnoremap <silent><buffer> [[ m':call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "bW")<CR>
|
||||
vnoremap <silent><buffer> [[ m':<C-U>exe "normal! gv"<Bar>call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "bW")<CR>
|
||||
nnoremap <silent><buffer> ]] m':call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "W")<CR>
|
||||
vnoremap <silent><buffer> ]] m':<C-U>exe "normal! gv"<Bar>call search('^\s*\(fu\%[nction]\\|\(export\s\+\)\?def\)\>', "W")<CR>
|
||||
nnoremap <silent><buffer> [] m':call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "bW")<CR>
|
||||
vnoremap <silent><buffer> [] m':<C-U>exe "normal! gv"<Bar>call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "bW")<CR>
|
||||
nnoremap <silent><buffer> ][ m':call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "W")<CR>
|
||||
vnoremap <silent><buffer> ][ m':<C-U>exe "normal! gv"<Bar>call search('^\s*end\(f\%[unction]\\|\(export\s\+\)\?def\)\>', "W")<CR>
|
||||
|
||||
" Move around comments
|
||||
nnoremap <silent><buffer> ]" :call search('^\(\s*".*\n\)\@<!\(\s*"\)', "W")<CR>
|
||||
|
||||
32
runtime/indent/chatito.vim
Normal file
32
runtime/indent/chatito.vim
Normal file
@@ -0,0 +1,32 @@
|
||||
" Vim indent file
|
||||
" Language: Chatito
|
||||
" Maintainer: ObserverOfTime <chronobserver@disroot.org>
|
||||
" Last Change: 2022 Sep 20
|
||||
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetChatitoIndent()
|
||||
setlocal indentkeys=o,O,*<Return>,0#,!^F
|
||||
|
||||
let b:undo_indent = 'setl inde< indk<'
|
||||
|
||||
if exists('*GetChatitoIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
function GetChatitoIndent()
|
||||
let l:prev = v:lnum - 1
|
||||
if getline(prevnonblank(l:prev)) =~# '^[~%@]\['
|
||||
" shift indent after definitions
|
||||
return shiftwidth()
|
||||
elseif getline(l:prev) !~# '^\s*$'
|
||||
" maintain indent in sentences
|
||||
return indent(l:prev)
|
||||
else
|
||||
" reset indent after a blank line
|
||||
return 0
|
||||
end
|
||||
endfunction
|
||||
@@ -4,7 +4,7 @@
|
||||
" Contributors: Edwin Fine <efine145_nospam01 at usa dot net>
|
||||
" Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
|
||||
" Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||
" Last Update: 2020-Jun-11
|
||||
" Last Update: 2022-Sep-06
|
||||
" License: Vim license
|
||||
" URL: https://github.com/vim-erlang/vim-erlang-runtime
|
||||
|
||||
@@ -30,7 +30,9 @@ else
|
||||
endif
|
||||
|
||||
setlocal indentexpr=ErlangIndent()
|
||||
setlocal indentkeys+=0=end,0=of,0=catch,0=after,0=when,0=),0=],0=},0=>>
|
||||
setlocal indentkeys+=0=end,0=of,0=catch,0=after,0=else,0=when,0=),0=],0=},0=>>
|
||||
|
||||
let b:undo_indent = "setl inde< indk<"
|
||||
|
||||
" Only define the functions once
|
||||
if exists("*ErlangIndent")
|
||||
@@ -235,8 +237,8 @@ function! s:GetTokensFromLine(line, string_continuation, atom_continuation,
|
||||
|
||||
" Two-character tokens
|
||||
elseif i + 1 < linelen &&
|
||||
\ index(['->', '<<', '>>', '||', '==', '/=', '=<', '>=', '++', '--',
|
||||
\ '::'],
|
||||
\ index(['->', '<<', '>>', '||', '==', '/=', '=<', '>=', '?=', '++',
|
||||
\ '--', '::'],
|
||||
\ a:line[i : i + 1]) != -1
|
||||
call add(indtokens, [a:line[i : i + 1], vcol, i])
|
||||
let next_i = i + 2
|
||||
@@ -558,8 +560,8 @@ function! s:IsCatchStandalone(lnum, i)
|
||||
let is_standalone = 0
|
||||
elseif prev_token =~# '[a-z]'
|
||||
if index(['after', 'and', 'andalso', 'band', 'begin', 'bnot', 'bor', 'bsl',
|
||||
\ 'bsr', 'bxor', 'case', 'catch', 'div', 'not', 'or', 'orelse',
|
||||
\ 'rem', 'try', 'xor'], prev_token) != -1
|
||||
\ 'bsr', 'bxor', 'case', 'catch', 'div', 'maybe', 'not', 'or',
|
||||
\ 'orelse', 'rem', 'try', 'xor'], prev_token) != -1
|
||||
" If catch is after these keywords, it is standalone
|
||||
let is_standalone = 1
|
||||
else
|
||||
@@ -568,7 +570,7 @@ function! s:IsCatchStandalone(lnum, i)
|
||||
"
|
||||
" Keywords:
|
||||
" - may precede 'catch': end
|
||||
" - may not precede 'catch': fun if of receive when
|
||||
" - may not precede 'catch': else fun if of receive when
|
||||
" - unused: cond let query
|
||||
let is_standalone = 0
|
||||
endif
|
||||
@@ -577,7 +579,7 @@ function! s:IsCatchStandalone(lnum, i)
|
||||
let is_standalone = 0
|
||||
else
|
||||
" This 'else' branch includes the following tokens:
|
||||
" -> == /= =< < >= > =:= =/= + - * / ++ -- :: < > ; ( [ { ? = ! . |
|
||||
" -> == /= =< < >= > ?= =:= =/= + - * / ++ -- :: < > ; ( [ { ? = ! . |
|
||||
let is_standalone = 1
|
||||
endif
|
||||
|
||||
@@ -590,6 +592,7 @@ endfunction
|
||||
" Purpose:
|
||||
" This function is called when a begin-type element ('begin', 'case',
|
||||
" '[', '<<', etc.) is found. It asks the caller to return if the stack
|
||||
" if already empty.
|
||||
" Parameters:
|
||||
" stack: [token]
|
||||
" token: string
|
||||
@@ -758,7 +761,7 @@ endfunction
|
||||
function! s:SearchEndPair(lnum, curr_col)
|
||||
return s:SearchPair(
|
||||
\ a:lnum, a:curr_col,
|
||||
\ '\C\<\%(case\|try\|begin\|receive\|if\)\>\|' .
|
||||
\ '\C\<\%(case\|try\|begin\|receive\|if\|maybe\)\>\|' .
|
||||
\ '\<fun\>\%(\s\|\n\|%.*$\|[A-Z_@][a-zA-Z_@]*\)*(',
|
||||
\ '',
|
||||
\ '\<end\>')
|
||||
@@ -847,6 +850,7 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
if ret | return res | endif
|
||||
|
||||
" case EXPR of BRANCHES end
|
||||
" if BRANCHES end
|
||||
" try EXPR catch BRANCHES end
|
||||
" try EXPR after BODY end
|
||||
" try EXPR catch BRANCHES after BODY end
|
||||
@@ -855,15 +859,17 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" try EXPR of BRANCHES catch BRANCHES after BODY end
|
||||
" receive BRANCHES end
|
||||
" receive BRANCHES after BRANCHES end
|
||||
" maybe EXPR end
|
||||
" maybe EXPR else BRANCHES end
|
||||
|
||||
" This branch is not Emacs-compatible
|
||||
elseif (index(['of', 'receive', 'after', 'if'], token) != -1 ||
|
||||
elseif (index(['of', 'receive', 'after', 'if', 'else'], token) != -1 ||
|
||||
\ (token ==# 'catch' && !s:IsCatchStandalone(lnum, i))) &&
|
||||
\ !last_token_of_line &&
|
||||
\ (empty(stack) || stack ==# ['when'] || stack ==# ['->'] ||
|
||||
\ stack ==# ['->', ';'])
|
||||
|
||||
" If we are after of/receive, but these are not the last
|
||||
" If we are after of/receive/etc, but these are not the last
|
||||
" tokens of the line, we want to indent like this:
|
||||
"
|
||||
" % stack == []
|
||||
@@ -889,21 +895,21 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" stack = ['when'] => LTI is a guard
|
||||
if empty(stack) || stack == ['->', ';']
|
||||
call s:Log(' LTI is in a condition after ' .
|
||||
\'"of/receive/after/if/catch" -> return')
|
||||
\'"of/receive/after/if/else/catch" -> return')
|
||||
return stored_vcol
|
||||
elseif stack == ['->']
|
||||
call s:Log(' LTI is in a branch after ' .
|
||||
\'"of/receive/after/if/catch" -> return')
|
||||
\'"of/receive/after/if/else/catch" -> return')
|
||||
return stored_vcol + shiftwidth()
|
||||
elseif stack == ['when']
|
||||
call s:Log(' LTI is in a guard after ' .
|
||||
\'"of/receive/after/if/catch" -> return')
|
||||
\'"of/receive/after/if/else/catch" -> return')
|
||||
return stored_vcol + shiftwidth()
|
||||
else
|
||||
return s:UnexpectedToken(token, stack)
|
||||
endif
|
||||
|
||||
elseif index(['case', 'if', 'try', 'receive'], token) != -1
|
||||
elseif index(['case', 'if', 'try', 'receive', 'maybe'], token) != -1
|
||||
|
||||
" stack = [] => LTI is a condition
|
||||
" stack = ['->'] => LTI is a branch
|
||||
@@ -913,45 +919,47 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" pass
|
||||
elseif (token ==# 'case' && stack[0] ==# 'of') ||
|
||||
\ (token ==# 'if') ||
|
||||
\ (token ==# 'maybe' && stack[0] ==# 'else') ||
|
||||
\ (token ==# 'try' && (stack[0] ==# 'of' ||
|
||||
\ stack[0] ==# 'catch' ||
|
||||
\ stack[0] ==# 'after')) ||
|
||||
\ (token ==# 'receive')
|
||||
|
||||
" From the indentation point of view, the keyword
|
||||
" (of/catch/after/end) before the LTI is what counts, so
|
||||
" (of/catch/after/else/end) before the LTI is what counts, so
|
||||
" when we reached these tokens, and the stack already had
|
||||
" a catch/after/end, we didn't modify it.
|
||||
" a catch/after/else/end, we didn't modify it.
|
||||
"
|
||||
" This way when we reach case/try/receive (i.e. now),
|
||||
" there is at most one of/catch/after/end token in the
|
||||
" This way when we reach case/try/receive/maybe (i.e. now),
|
||||
" there is at most one of/catch/after/else/end token in the
|
||||
" stack.
|
||||
if token ==# 'case' || token ==# 'try' ||
|
||||
\ (token ==# 'receive' && stack[0] ==# 'after')
|
||||
\ (token ==# 'receive' && stack[0] ==# 'after') ||
|
||||
\ (token ==# 'maybe' && stack[0] ==# 'else')
|
||||
call s:Pop(stack)
|
||||
endif
|
||||
|
||||
if empty(stack)
|
||||
call s:Log(' LTI is in a condition; matching ' .
|
||||
\'"case/if/try/receive" found')
|
||||
\'"case/if/try/receive/maybe" found')
|
||||
let stored_vcol = curr_vcol + shiftwidth()
|
||||
elseif stack[0] ==# 'align_to_begin_element'
|
||||
call s:Pop(stack)
|
||||
let stored_vcol = curr_vcol
|
||||
elseif len(stack) > 1 && stack[0] ==# '->' && stack[1] ==# ';'
|
||||
call s:Log(' LTI is in a condition; matching ' .
|
||||
\'"case/if/try/receive" found')
|
||||
\'"case/if/try/receive/maybe" found')
|
||||
call s:Pop(stack)
|
||||
call s:Pop(stack)
|
||||
let stored_vcol = curr_vcol + shiftwidth()
|
||||
elseif stack[0] ==# '->'
|
||||
call s:Log(' LTI is in a branch; matching ' .
|
||||
\'"case/if/try/receive" found')
|
||||
\'"case/if/try/receive/maybe" found')
|
||||
call s:Pop(stack)
|
||||
let stored_vcol = curr_vcol + 2 * shiftwidth()
|
||||
elseif stack[0] ==# 'when'
|
||||
call s:Log(' LTI is in a guard; matching ' .
|
||||
\'"case/if/try/receive" found')
|
||||
\'"case/if/try/receive/maybe" found')
|
||||
call s:Pop(stack)
|
||||
let stored_vcol = curr_vcol + 2 * shiftwidth() + 2
|
||||
endif
|
||||
@@ -1213,7 +1221,7 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
|
||||
if empty(stack)
|
||||
call s:Push(stack, ';')
|
||||
elseif index([';', '->', 'when', 'end', 'after', 'catch'],
|
||||
elseif index([';', '->', 'when', 'end', 'after', 'catch', 'else'],
|
||||
\stack[0]) != -1
|
||||
" Pass:
|
||||
"
|
||||
@@ -1223,10 +1231,10 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" should keep that, because they signify the type of the
|
||||
" LTI (branch, condition or guard).
|
||||
" - From the indentation point of view, the keyword
|
||||
" (of/catch/after/end) before the LTI is what counts, so
|
||||
" if the stack already has a catch/after/end, we don't
|
||||
" modify it. This way when we reach case/try/receive,
|
||||
" there will be at most one of/catch/after/end token in
|
||||
" (of/catch/after/else/end) before the LTI is what counts, so
|
||||
" if the stack already has a catch/after/else/end, we don't
|
||||
" modify it. This way when we reach case/try/receive/maybe,
|
||||
" there will be at most one of/catch/after/else/end token in
|
||||
" the stack.
|
||||
else
|
||||
return s:UnexpectedToken(token, stack)
|
||||
@@ -1242,7 +1250,8 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" stack = ['->'] -> LTI is a condition
|
||||
" stack = ['->', ';'] -> LTI is a branch
|
||||
call s:Push(stack, '->')
|
||||
elseif index(['->', 'when', 'end', 'after', 'catch'], stack[0]) != -1
|
||||
elseif index(['->', 'when', 'end', 'after', 'catch', 'else'],
|
||||
\stack[0]) != -1
|
||||
" Pass:
|
||||
"
|
||||
" - If the stack top is another '->', then one '->' is
|
||||
@@ -1250,10 +1259,10 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" - If the stack top is a 'when', then we should keep
|
||||
" that, because this signifies that LTI is a in a guard.
|
||||
" - From the indentation point of view, the keyword
|
||||
" (of/catch/after/end) before the LTI is what counts, so
|
||||
" if the stack already has a catch/after/end, we don't
|
||||
" modify it. This way when we reach case/try/receive,
|
||||
" there will be at most one of/catch/after/end token in
|
||||
" (of/catch/after/else/end) before the LTI is what counts, so
|
||||
" if the stack already has a catch/after/else/end, we don't
|
||||
" modify it. This way when we reach case/try/receive/maybe,
|
||||
" there will be at most one of/catch/after/else/end token in
|
||||
" the stack.
|
||||
else
|
||||
return s:UnexpectedToken(token, stack)
|
||||
@@ -1283,7 +1292,8 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" LTI
|
||||
call s:Push(stack, token)
|
||||
endif
|
||||
elseif index(['->', 'when', 'end', 'after', 'catch'], stack[0]) != -1
|
||||
elseif index(['->', 'when', 'end', 'after', 'catch', 'else'],
|
||||
\stack[0]) != -1
|
||||
" Pass:
|
||||
" - If the stack top is another 'when', then one 'when' is
|
||||
" enough.
|
||||
@@ -1291,21 +1301,63 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" should keep that, because they signify the type of the
|
||||
" LTI (branch, condition or guard).
|
||||
" - From the indentation point of view, the keyword
|
||||
" (of/catch/after/end) before the LTI is what counts, so
|
||||
" if the stack already has a catch/after/end, we don't
|
||||
" modify it. This way when we reach case/try/receive,
|
||||
" there will be at most one of/catch/after/end token in
|
||||
" (of/catch/after/else/end) before the LTI is what counts, so
|
||||
" if the stack already has a catch/after/else/end, we don't
|
||||
" modify it. This way when we reach case/try/receive/maybe,
|
||||
" there will be at most one of/catch/after/else/end token in
|
||||
" the stack.
|
||||
else
|
||||
return s:UnexpectedToken(token, stack)
|
||||
endif
|
||||
|
||||
elseif token ==# 'of' || token ==# 'after' ||
|
||||
elseif token ==# 'of' || token ==# 'after' || token ==# 'else' ||
|
||||
\ (token ==# 'catch' && !s:IsCatchStandalone(lnum, i))
|
||||
|
||||
if token ==# 'after'
|
||||
" If LTI is between an 'after' and the corresponding
|
||||
" 'end', then let's return
|
||||
if token ==# 'after' || token ==# 'else'
|
||||
" If LTI is between an after/else and the corresponding 'end', then
|
||||
" let's return because calculating the indentation based on
|
||||
" after/else is enough.
|
||||
"
|
||||
" Example:
|
||||
" receive A after
|
||||
" LTI
|
||||
" maybe A else
|
||||
" LTI
|
||||
"
|
||||
" Note about Emacs compabitility {{{
|
||||
"
|
||||
" It would be fine to indent the examples above the following way:
|
||||
"
|
||||
" receive A after
|
||||
" LTI
|
||||
" maybe A else
|
||||
" LTI
|
||||
"
|
||||
" We intend it the way above because that is how Emacs does it.
|
||||
" Also, this is a bit faster.
|
||||
"
|
||||
" We are still not 100% Emacs compatible because of placing the
|
||||
" 'end' after the indented blocks.
|
||||
"
|
||||
" Emacs example:
|
||||
"
|
||||
" receive A after
|
||||
" LTI
|
||||
" end,
|
||||
" maybe A else
|
||||
" LTI
|
||||
" end % Yes, it's here (in OTP 25.0, might change
|
||||
" % later)
|
||||
"
|
||||
" vim-erlang example:
|
||||
"
|
||||
" receive A after
|
||||
" LTI
|
||||
" end,
|
||||
" maybe A else
|
||||
" LTI
|
||||
" end
|
||||
" }}}
|
||||
let [ret, res] = s:BeginElementFoundIfEmpty(stack, token, curr_vcol,
|
||||
\stored_vcol, shiftwidth())
|
||||
if ret | return res | endif
|
||||
@@ -1313,7 +1365,8 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
|
||||
if empty(stack) || stack[0] ==# '->' || stack[0] ==# 'when'
|
||||
call s:Push(stack, token)
|
||||
elseif stack[0] ==# 'catch' || stack[0] ==# 'after' || stack[0] ==# 'end'
|
||||
elseif stack[0] ==# 'catch' || stack[0] ==# 'after' ||
|
||||
\stack[0] ==# 'else' || stack[0] ==# 'end'
|
||||
" Pass: From the indentation point of view, the keyword
|
||||
" (of/catch/after/end) before the LTI is what counts, so
|
||||
" if the stack already has a catch/after/end, we don't
|
||||
@@ -1403,7 +1456,7 @@ function! ErlangIndent()
|
||||
endif
|
||||
|
||||
let ml = matchlist(currline,
|
||||
\'^\(\s*\)\(\%(end\|of\|catch\|after\)\>\|[)\]}]\|>>\)')
|
||||
\'^\(\s*\)\(\%(end\|of\|catch\|after\|else\)\>\|[)\]}]\|>>\)')
|
||||
|
||||
" If the line has a special beginning, but not a standalone catch
|
||||
if !empty(ml) && !(ml[2] ==# 'catch' && s:IsCatchStandalone(v:lnum, 0))
|
||||
|
||||
7
runtime/indent/gyp.vim
Normal file
7
runtime/indent/gyp.vim
Normal file
@@ -0,0 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: GYP
|
||||
" Maintainer: ObserverOfTime <chronobserver@disroot.org>
|
||||
" Last Change: 2022 Sep 27
|
||||
|
||||
" JSON indent works well
|
||||
runtime! indent/json.vim
|
||||
138
runtime/indent/hare.vim
Normal file
138
runtime/indent/hare.vim
Normal file
@@ -0,0 +1,138 @@
|
||||
" Vim indent file
|
||||
" Language: Hare
|
||||
" Maintainer: Amelia Clarke <me@rsaihe.dev>
|
||||
" Last Change: 2022 Sep 22
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
if !has("cindent") || !has("eval")
|
||||
finish
|
||||
endif
|
||||
|
||||
setlocal cindent
|
||||
|
||||
" L0 -> don't deindent labels
|
||||
" (s -> use one indent after a trailing (
|
||||
" m1 -> if ) starts a line, indent it the same as its matching (
|
||||
" ks -> add an extra indent to extra lines in an if expression or for expression
|
||||
" j1 -> indent code inside {} one level when in parentheses
|
||||
" J1 -> see j1
|
||||
" *0 -> don't search for unclosed block comments
|
||||
" #1 -> don't deindent lines that begin with #
|
||||
setlocal cinoptions=L0,(s,m1,ks,j1,J1,*0,#1
|
||||
|
||||
" Controls which keys reindent the current line.
|
||||
" 0{ -> { at beginning of line
|
||||
" 0} -> } at beginning of line
|
||||
" 0) -> ) at beginning of line
|
||||
" 0] -> ] at beginning of line
|
||||
" !^F -> <C-f> (not inserted)
|
||||
" o -> <CR> or `o` command
|
||||
" O -> `O` command
|
||||
" e -> else
|
||||
" 0=case -> case
|
||||
setlocal indentkeys=0{,0},0),0],!^F,o,O,e,0=case
|
||||
|
||||
setlocal cinwords=if,else,for,switch,match
|
||||
|
||||
setlocal indentexpr=GetHareIndent()
|
||||
|
||||
function! FloorCindent(lnum)
|
||||
return cindent(a:lnum) / shiftwidth() * shiftwidth()
|
||||
endfunction
|
||||
|
||||
function! GetHareIndent()
|
||||
let line = getline(v:lnum)
|
||||
let prevlnum = prevnonblank(v:lnum - 1)
|
||||
let prevline = getline(prevlnum)
|
||||
let prevprevline = getline(prevnonblank(prevlnum - 1))
|
||||
|
||||
" This is all very hacky and imperfect, but it's tough to do much better when
|
||||
" working with regex-based indenting rules.
|
||||
|
||||
" If the previous line ended with =, indent by one shiftwidth.
|
||||
if prevline =~# '\v\=\s*(//.*)?$'
|
||||
return indent(prevlnum) + shiftwidth()
|
||||
endif
|
||||
|
||||
" If the previous line ended in a semicolon and the line before that ended
|
||||
" with =, deindent by one shiftwidth.
|
||||
if prevline =~# '\v;\s*(//.*)?$' && prevprevline =~# '\v\=\s*(//.*)?$'
|
||||
return indent(prevlnum) - shiftwidth()
|
||||
endif
|
||||
|
||||
" TODO: The following edge-case is still indented incorrectly:
|
||||
" case =>
|
||||
" if (foo) {
|
||||
" bar;
|
||||
" };
|
||||
" | // cursor is incorrectly deindented by one shiftwidth.
|
||||
"
|
||||
" This only happens if the {} block is the first statement in the case body.
|
||||
" If `case` is typed, the case will also be incorrectly deindented by one
|
||||
" shiftwidth. Are you having fun yet?
|
||||
|
||||
" Deindent cases.
|
||||
if line =~# '\v^\s*case'
|
||||
" If the previous line was also a case, don't do any special indenting.
|
||||
if prevline =~# '\v^\s*case'
|
||||
return indent(prevlnum)
|
||||
end
|
||||
|
||||
" If the previous line was a multiline case, deindent by one shiftwidth.
|
||||
if prevline =~# '\v\=\>\s*(//.*)?$'
|
||||
return indent(prevlnum) - shiftwidth()
|
||||
endif
|
||||
|
||||
" If the previous line started a block, deindent by one shiftwidth.
|
||||
" This handles the first case in a switch/match block.
|
||||
if prevline =~# '\v\{\s*(//.*)?$'
|
||||
return FloorCindent(v:lnum) - shiftwidth()
|
||||
end
|
||||
|
||||
" If the previous line ended in a semicolon and the line before that wasn't
|
||||
" a case, deindent by one shiftwidth.
|
||||
if prevline =~# '\v;\s*(//.*)?$' && prevprevline !~# '\v\=\>\s*(//.*)?$'
|
||||
return FloorCindent(v:lnum) - shiftwidth()
|
||||
end
|
||||
|
||||
let l:indent = FloorCindent(v:lnum)
|
||||
|
||||
" If a normal cindent would indent the same amount as the previous line,
|
||||
" deindent by one shiftwidth. This fixes some issues with `case let` blocks.
|
||||
if l:indent == indent(prevlnum)
|
||||
return l:indent - shiftwidth()
|
||||
endif
|
||||
|
||||
" Otherwise, do a normal cindent.
|
||||
return l:indent
|
||||
endif
|
||||
|
||||
" Don't indent an extra shiftwidth for cases which span multiple lines.
|
||||
if prevline =~# '\v\=\>\s*(//.*)?$' && prevline !~# '\v^\s*case\W'
|
||||
return indent(prevlnum)
|
||||
endif
|
||||
|
||||
" Indent the body of a case.
|
||||
" If the previous line ended in a semicolon and the line before that was a
|
||||
" case, don't do any special indenting.
|
||||
if prevline =~# '\v;\s*(//.*)?$' && prevprevline =~# '\v\=\>\s*(//.*)?$' && line !~# '\v^\s*}'
|
||||
return indent(prevlnum)
|
||||
endif
|
||||
|
||||
let l:indent = FloorCindent(v:lnum)
|
||||
|
||||
" If the previous line was a case and a normal cindent wouldn't indent, indent
|
||||
" an extra shiftwidth.
|
||||
if prevline =~# '\v\=\>\s*(//.*)?$' && l:indent == indent(prevlnum)
|
||||
return l:indent + shiftwidth()
|
||||
endif
|
||||
|
||||
" If everything above is false, do a normal cindent.
|
||||
return l:indent
|
||||
endfunction
|
||||
|
||||
" vim: tabstop=2 shiftwidth=2 expandtab
|
||||
@@ -3,6 +3,7 @@
|
||||
" Maintainer: Marcus Aurelius Farias <marcus.cf 'at' bol.com.br>
|
||||
" First Author: Max Ischenko <mfi 'at' ukr.net>
|
||||
" Last Change: 2017 Jun 13
|
||||
" 2022 Sep 07: b:undo_indent added by Doug Kearns
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
@@ -18,6 +19,8 @@ setlocal indentkeys+=0=end,0=until
|
||||
|
||||
setlocal autoindent
|
||||
|
||||
let b:undo_indent = "setlocal autoindent< indentexpr< indentkeys<"
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetLuaIndent")
|
||||
finish
|
||||
|
||||
442
runtime/indent/solidity.vim
Normal file
442
runtime/indent/solidity.vim
Normal file
@@ -0,0 +1,442 @@
|
||||
" Vim indent file
|
||||
" Language: Solidity
|
||||
" Acknowledgement: Based off of vim-javascript
|
||||
" Maintainer: Cothi (jiungdev@gmail.com)
|
||||
" Original Author: tomlion (https://github.com/tomlion/vim-solidity)
|
||||
" Last Changed: 2022 Sep 27
|
||||
"
|
||||
" 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=GetSolidityIndent()
|
||||
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetSolidityIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" 1. Variables {{{1
|
||||
" ============
|
||||
|
||||
let s:js_keywords = '^\s*\(break\|case\|catch\|continue\|debugger\|default\|delete\|do\|else\|finally\|for\|function\|if\|in\|instanceof\|new\|return\|switch\|this\|throw\|try\|typeof\|var\|void\|while\|with\)'
|
||||
|
||||
" Regex of syntax group names that are or delimit string or are comments.
|
||||
let s:syng_strcom = 'string\|regex\|comment\c'
|
||||
|
||||
" Regex of syntax group names that are strings.
|
||||
let s:syng_string = 'regex\c'
|
||||
|
||||
" Regex of syntax group names that are strings or documentation.
|
||||
let s:syng_multiline = 'comment\c'
|
||||
|
||||
" Regex of syntax group names that are line comment.
|
||||
let s:syng_linecom = 'linecomment\c'
|
||||
|
||||
" Expression used to check whether we should skip a match with searchpair().
|
||||
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'"
|
||||
|
||||
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
|
||||
|
||||
" Regex that defines continuation lines, not including (, {, or [.
|
||||
let s:continuation_regex = '\%([\\*+/.:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)' . s:line_term
|
||||
|
||||
" Regex that defines continuation lines.
|
||||
" TODO: this needs to deal with if ...: and so on
|
||||
let s:msl_regex = '\%([\\*+/.:([]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)' . s:line_term
|
||||
|
||||
let s:one_line_scope_regex = '\<\%(if\|else\|for\|while\)\>[^{;]*' . s:line_term
|
||||
|
||||
" Regex that defines blocks.
|
||||
let s:block_regex = '\%([{[]\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term
|
||||
|
||||
let s:var_stmt = '^\s*var'
|
||||
|
||||
let s:comma_first = '^\s*,'
|
||||
let s:comma_last = ',\s*$'
|
||||
|
||||
let s:ternary = '^\s\+[?|:]'
|
||||
let s:ternary_q = '^\s\+?'
|
||||
|
||||
" 2. Auxiliary Functions {{{1
|
||||
" ======================
|
||||
|
||||
" Check if the character at lnum:col is inside a string, comment, or is ascii.
|
||||
function s:IsInStringOrComment(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_strcom
|
||||
endfunction
|
||||
|
||||
" 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') =~ s:syng_string
|
||||
endfunction
|
||||
|
||||
" Check if the character at lnum:col is inside a multi-line comment.
|
||||
function s:IsInMultilineComment(lnum, col)
|
||||
return !s:IsLineComment(a:lnum, a:col) && synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_multiline
|
||||
endfunction
|
||||
|
||||
" Check if the character at lnum:col is a line comment.
|
||||
function s:IsLineComment(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_linecom
|
||||
endfunction
|
||||
|
||||
" Find line above 'lnum' that isn't empty, in a comment, or in a string.
|
||||
function s:PrevNonBlankNonString(lnum)
|
||||
let in_block = 0
|
||||
let lnum = prevnonblank(a:lnum)
|
||||
while lnum > 0
|
||||
" Go in and out of blocks comments as necessary.
|
||||
" If the line isn't empty (with opt. comment) or in a string, end search.
|
||||
let line = getline(lnum)
|
||||
if line =~ '/\*'
|
||||
if in_block
|
||||
let in_block = 0
|
||||
else
|
||||
break
|
||||
endif
|
||||
elseif !in_block && line =~ '\*/'
|
||||
let in_block = 1
|
||||
elseif !in_block && line !~ '^\s*\%(//\).*$' && !(s:IsInStringOrComment(lnum, 1) && s:IsInStringOrComment(lnum, strlen(line)))
|
||||
break
|
||||
endif
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
endwhile
|
||||
return lnum
|
||||
endfunction
|
||||
|
||||
" Find line above 'lnum' that started the continuation 'lnum' may be part of.
|
||||
function s:GetMSL(lnum, in_one_line_scope)
|
||||
" Start on the line we're at and use its indent.
|
||||
let msl = a:lnum
|
||||
let lnum = s:PrevNonBlankNonString(a:lnum - 1)
|
||||
while lnum > 0
|
||||
" If we have a continuation line, or we're in a string, use line as MSL.
|
||||
" Otherwise, terminate search as we have found our MSL already.
|
||||
let line = getline(lnum)
|
||||
let col = match(line, s:msl_regex) + 1
|
||||
if (col > 0 && !s:IsInStringOrComment(lnum, col)) || s:IsInString(lnum, strlen(line))
|
||||
let msl = lnum
|
||||
else
|
||||
" Don't use lines that are part of a one line scope as msl unless the
|
||||
" flag in_one_line_scope is set to 1
|
||||
"
|
||||
if a:in_one_line_scope
|
||||
break
|
||||
end
|
||||
let msl_one_line = s:Match(lnum, s:one_line_scope_regex)
|
||||
if msl_one_line == 0
|
||||
break
|
||||
endif
|
||||
endif
|
||||
let lnum = s:PrevNonBlankNonString(lnum - 1)
|
||||
endwhile
|
||||
return msl
|
||||
endfunction
|
||||
|
||||
function s:RemoveTrailingComments(content)
|
||||
let single = '\/\/\(.*\)\s*$'
|
||||
let multi = '\/\*\(.*\)\*\/\s*$'
|
||||
return substitute(substitute(a:content, single, '', ''), multi, '', '')
|
||||
endfunction
|
||||
|
||||
" Find if the string is inside var statement (but not the first string)
|
||||
function s:InMultiVarStatement(lnum)
|
||||
let lnum = s:PrevNonBlankNonString(a:lnum - 1)
|
||||
|
||||
" let type = synIDattr(synID(lnum, indent(lnum) + 1, 0), 'name')
|
||||
|
||||
" loop through previous expressions to find a var statement
|
||||
while lnum > 0
|
||||
let line = getline(lnum)
|
||||
|
||||
" if the line is a js keyword
|
||||
if (line =~ s:js_keywords)
|
||||
" check if the line is a var stmt
|
||||
" if the line has a comma first or comma last then we can assume that we
|
||||
" are in a multiple var statement
|
||||
if (line =~ s:var_stmt)
|
||||
return lnum
|
||||
endif
|
||||
|
||||
" other js keywords, not a var
|
||||
return 0
|
||||
endif
|
||||
|
||||
let lnum = s:PrevNonBlankNonString(lnum - 1)
|
||||
endwhile
|
||||
|
||||
" beginning of program, not a var
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" Find line above with beginning of the var statement or returns 0 if it's not
|
||||
" this statement
|
||||
function s:GetVarIndent(lnum)
|
||||
let lvar = s:InMultiVarStatement(a:lnum)
|
||||
let prev_lnum = s:PrevNonBlankNonString(a:lnum - 1)
|
||||
|
||||
if lvar
|
||||
let line = s:RemoveTrailingComments(getline(prev_lnum))
|
||||
|
||||
" if the previous line doesn't end in a comma, return to regular indent
|
||||
if (line !~ s:comma_last)
|
||||
return indent(prev_lnum) - &sw
|
||||
else
|
||||
return indent(lvar) + &sw
|
||||
endif
|
||||
endif
|
||||
|
||||
return -1
|
||||
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
|
||||
if !s:IsInStringOrComment(a:lnum, 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
|
||||
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:IsInStringOrComment(a:lnum, col) ? col : 0
|
||||
endfunction
|
||||
|
||||
function s:IndentWithContinuation(lnum, ind, width)
|
||||
" Set up variables to use and search for MSL to the previous line.
|
||||
let p_lnum = a:lnum
|
||||
let lnum = s:GetMSL(a:lnum, 1)
|
||||
let line = getline(lnum)
|
||||
|
||||
" If the previous line wasn't a MSL and is continuation return its indent.
|
||||
" TODO: the || s:IsInString() thing worries me a bit.
|
||||
if p_lnum != lnum
|
||||
if s:Match(p_lnum,s:continuation_regex)||s:IsInString(p_lnum,strlen(line))
|
||||
return a:ind
|
||||
endif
|
||||
endif
|
||||
|
||||
" Set up more variables now that we know we aren't continuation bound.
|
||||
let msl_ind = indent(lnum)
|
||||
|
||||
" If the previous line ended with [*+/.-=], start a continuation that
|
||||
" indents an extra level.
|
||||
if s:Match(lnum, s:continuation_regex)
|
||||
if lnum == p_lnum
|
||||
return msl_ind + a:width
|
||||
else
|
||||
return msl_ind
|
||||
endif
|
||||
endif
|
||||
|
||||
return a:ind
|
||||
endfunction
|
||||
|
||||
function s:InOneLineScope(lnum)
|
||||
let msl = s:GetMSL(a:lnum, 1)
|
||||
if msl > 0 && s:Match(msl, s:one_line_scope_regex)
|
||||
return msl
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function s:ExitingOneLineScope(lnum)
|
||||
let msl = s:GetMSL(a:lnum, 1)
|
||||
if msl > 0
|
||||
" if the current line is in a one line scope ..
|
||||
if s:Match(msl, s:one_line_scope_regex)
|
||||
return 0
|
||||
else
|
||||
let prev_msl = s:GetMSL(msl - 1, 1)
|
||||
if s:Match(prev_msl, s:one_line_scope_regex)
|
||||
return prev_msl
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" 3. GetSolidityIndent Function {{{1
|
||||
" =========================
|
||||
|
||||
function GetSolidityIndent()
|
||||
" 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
|
||||
" -----------------------------
|
||||
|
||||
let ind = -1
|
||||
" Get the current line.
|
||||
let line = getline(v:lnum)
|
||||
" previous nonblank line number
|
||||
let prevline = prevnonblank(v:lnum - 1)
|
||||
|
||||
" If we got a closing bracket on an empty line, find its match and indent
|
||||
" according to it. For parentheses we indent to its column - 1, for the
|
||||
" others we indent to the containing line's MSL's level. Return -1 if fail.
|
||||
let col = matchend(line, '^\s*[],})]')
|
||||
if col > 0 && !s:IsInStringOrComment(v:lnum, col)
|
||||
call cursor(v:lnum, col)
|
||||
|
||||
let lvar = s:InMultiVarStatement(v:lnum)
|
||||
if lvar
|
||||
let prevline_contents = s:RemoveTrailingComments(getline(prevline))
|
||||
|
||||
" check for comma first
|
||||
if (line[col - 1] =~ ',')
|
||||
" if the previous line ends in comma or semicolon don't indent
|
||||
if (prevline_contents =~ '[;,]\s*$')
|
||||
return indent(s:GetMSL(line('.'), 0))
|
||||
" get previous line indent, if it's comma first return prevline indent
|
||||
elseif (prevline_contents =~ s:comma_first)
|
||||
return indent(prevline)
|
||||
" otherwise we indent 1 level
|
||||
else
|
||||
return indent(lvar) + &sw
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
let bs = strpart('(){}[]', stridx(')}]', line[col - 1]) * 2, 2)
|
||||
if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0
|
||||
if line[col-1]==')' && col('.') != col('$') - 1
|
||||
let ind = virtcol('.')-1
|
||||
else
|
||||
let ind = indent(s:GetMSL(line('.'), 0))
|
||||
endif
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
|
||||
" If the line is comma first, dedent 1 level
|
||||
if (getline(prevline) =~ s:comma_first)
|
||||
return indent(prevline) - &sw
|
||||
endif
|
||||
|
||||
if (line =~ s:ternary)
|
||||
if (getline(prevline) =~ s:ternary_q)
|
||||
return indent(prevline)
|
||||
else
|
||||
return indent(prevline) + &sw
|
||||
endif
|
||||
endif
|
||||
|
||||
" If we are in a multi-line comment, cindent does the right thing.
|
||||
if s:IsInMultilineComment(v:lnum, 1) && !s:IsLineComment(v:lnum, 1)
|
||||
return cindent(v:lnum)
|
||||
endif
|
||||
|
||||
" Check for multiple var assignments
|
||||
" let var_indent = s:GetVarIndent(v:lnum)
|
||||
" if var_indent >= 0
|
||||
" return var_indent
|
||||
" endif
|
||||
|
||||
" 3.3. Work on the previous line. {{{2
|
||||
" -------------------------------
|
||||
|
||||
" If the line is empty and the previous nonblank line was a multi-line
|
||||
" comment, use that comment's indent. Deduct one char to account for the
|
||||
" space in ' */'.
|
||||
if line =~ '^\s*$' && s:IsInMultilineComment(prevline, 1)
|
||||
return indent(prevline) - 1
|
||||
endif
|
||||
|
||||
" Find a non-blank, non-multi-line string line above the current line.
|
||||
let lnum = s:PrevNonBlankNonString(v:lnum - 1)
|
||||
|
||||
" If the line is empty and inside a string, use the previous line.
|
||||
if line =~ '^\s*$' && lnum != prevline
|
||||
return indent(prevnonblank(v:lnum))
|
||||
endif
|
||||
|
||||
" At the start of the file use zero indent.
|
||||
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(s:GetMSL(lnum, 0)) + &sw
|
||||
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' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
|
||||
if col('.') + 1 == col('$')
|
||||
return ind + &sw
|
||||
else
|
||||
return virtcol('.')
|
||||
endif
|
||||
elseif counts[1] == '1' || counts[2] == '1'
|
||||
return ind + &sw
|
||||
else
|
||||
call cursor(v:lnum, vcol)
|
||||
end
|
||||
endif
|
||||
|
||||
" 3.4. Work on the MSL line. {{{2
|
||||
" --------------------------
|
||||
|
||||
let ind_con = ind
|
||||
let ind = s:IndentWithContinuation(lnum, ind_con, &sw)
|
||||
|
||||
" }}}2
|
||||
"
|
||||
"
|
||||
let ols = s:InOneLineScope(lnum)
|
||||
if ols > 0
|
||||
let ind = ind + &sw
|
||||
else
|
||||
let ols = s:ExitingOneLineScope(lnum)
|
||||
while ols > 0 && ind > 0
|
||||
let ind = ind - &sw
|
||||
let ols = s:InOneLineScope(ols - 1)
|
||||
endwhile
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,7 +1,6 @@
|
||||
" vim: set ft=vim sw=4 :
|
||||
|
||||
" START_INDENT
|
||||
|
||||
func Some()
|
||||
let x = 1
|
||||
endfunc
|
||||
@@ -15,15 +14,6 @@ let x = [
|
||||
\ ]
|
||||
endif
|
||||
|
||||
" TODO: add searchpair() to find matching {
|
||||
"for x in [
|
||||
"{
|
||||
"key: 'value'
|
||||
"},
|
||||
"]
|
||||
"eval 0
|
||||
"endfor
|
||||
|
||||
for x in [
|
||||
{key: 'value'},
|
||||
]
|
||||
@@ -37,12 +27,11 @@ let t = [
|
||||
\ ]
|
||||
|
||||
def Func()
|
||||
var d = dd
|
||||
->extend({
|
||||
})
|
||||
eval 0
|
||||
var d = dd
|
||||
->extend({
|
||||
})
|
||||
eval 0
|
||||
enddef
|
||||
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
@@ -84,7 +73,7 @@ endfunc
|
||||
" START_INDENT
|
||||
" INDENT_NEXT next-line
|
||||
func Some()
|
||||
" next-line
|
||||
" next-line
|
||||
let f = x
|
||||
endfunc
|
||||
" END_INDENT
|
||||
@@ -103,6 +92,12 @@ nothing
|
||||
END
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
let a =<< trim END
|
||||
nothing
|
||||
END
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
" INDENT_AT this-line
|
||||
let a=<< trim END
|
||||
@@ -111,3 +106,766 @@ let a=<< trim END
|
||||
blah this-line
|
||||
END
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if v:true
|
||||
echo 0
|
||||
end
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var result = Func(
|
||||
arg1,
|
||||
arg2
|
||||
)
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var result = Func(arg1,
|
||||
arg2)
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
filter(list, (k, v) =>
|
||||
v > 0)
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
filter(list, (k, v) => {
|
||||
const x = get(list, k, 0)
|
||||
return x > 0
|
||||
})
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if x > 0
|
||||
filter(list, (k, v) => {
|
||||
const x = get(list, k, 1)
|
||||
return x > 0
|
||||
})
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
{
|
||||
var temp = 'temp'
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var text = lead
|
||||
.. middle
|
||||
.. end
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var text = lead ..
|
||||
middle ..
|
||||
end
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var total = start +
|
||||
end -
|
||||
correction
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var result = start
|
||||
:+ print
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var result = positive
|
||||
? PosFunc(arg)
|
||||
: NegFunc(arg)
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var result = GetBuilder()
|
||||
->BuilderSetWidth(333)
|
||||
->BuilderSetHeight(777)
|
||||
->BuilderBuild()
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var result = MyDict
|
||||
.member
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
autocmd BufNewFile *.match if condition
|
||||
| echo 'match'
|
||||
| endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
set cpo+=C
|
||||
var lines =<< trim END
|
||||
| this works
|
||||
END
|
||||
set cpo-=C
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
syn region Text
|
||||
\ start='foo'
|
||||
#\ comment
|
||||
\ end='bar'
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
au CursorHold * echom 'BEFORE bar'
|
||||
#\ some comment
|
||||
| echom 'AFTER bar'
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def MyFunc(text: string,
|
||||
separator = '-'
|
||||
): string
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def MyFunc(
|
||||
text: string,
|
||||
separator = '-'
|
||||
): string
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
[var1, var2] =
|
||||
Func()
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
const list = ['one',
|
||||
'two']
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
const list = [
|
||||
'one',
|
||||
'two',
|
||||
]
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
const dict = {one: 1,
|
||||
two: 2
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
const dict = {
|
||||
one: 1,
|
||||
two: 2
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
const dict =
|
||||
{
|
||||
one: 1,
|
||||
two: 2
|
||||
}
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func()
|
||||
return {
|
||||
one: 1
|
||||
}
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
echo {
|
||||
a: 0,
|
||||
# b
|
||||
# c
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
echo search(
|
||||
# comment
|
||||
'1'
|
||||
.. '2'
|
||||
)
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
var v = ( # trailing "(" starts line continuation
|
||||
3 + 4 # nothing special
|
||||
) # end of expression indicates continued line
|
||||
var x: number # needs to align with previous "var"
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func() # {{{
|
||||
# comment
|
||||
if true
|
||||
return
|
||||
endif
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
echo {
|
||||
key:
|
||||
'value',
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var id = time
|
||||
->timer_start((_) => {
|
||||
n = 0
|
||||
})
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
augroup Name
|
||||
autocmd!
|
||||
augroup END
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var n =
|
||||
# comment
|
||||
1
|
||||
+ 2
|
||||
|
||||
var s = ''
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var keys = {
|
||||
J: 'j',
|
||||
"\<Home>": '1G',
|
||||
"\<End>": 'G',
|
||||
z: 'zz'
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
export def Func(
|
||||
n: number,
|
||||
s: string,
|
||||
...l: list<bool>
|
||||
)
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var heredoc =<< trim ENDD
|
||||
var nested_heredoc =<< trim END
|
||||
END
|
||||
ENDD
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
else " comment
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true | echo 'one' | endif
|
||||
if true | echo 'two' | endif
|
||||
if true | echo 'three' | endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
:'<-1 mark <
|
||||
else
|
||||
echo ''
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
substitute/pat /rep /
|
||||
echo
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
try
|
||||
echo 1
|
||||
catch /pat / # comment
|
||||
echo 2
|
||||
endtry
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func()
|
||||
Cmd %
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if end == 'xxx' || end == 'yyy'
|
||||
echo
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
popup_move(id, {col: 1,
|
||||
line: 2})
|
||||
endif
|
||||
setwinvar(id, 'name', 3)
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var d = [
|
||||
{a: 'x',
|
||||
b: 'y'},
|
||||
FuncA(),
|
||||
FuncB(),
|
||||
]
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var ll = [[
|
||||
1,
|
||||
2,
|
||||
3], [
|
||||
4,
|
||||
5,
|
||||
6], [
|
||||
7,
|
||||
8,
|
||||
9]]
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var ld = [{
|
||||
a: 'xxx',
|
||||
b: 'yyy'}, {
|
||||
c: 'xxx',
|
||||
d: 'yyy'}, {
|
||||
e: 'xxx',
|
||||
f: 'yyy'}, {
|
||||
}]
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var d = {
|
||||
a: {
|
||||
b: {
|
||||
c: [{
|
||||
d: 'e',
|
||||
f: 'g',
|
||||
h: 'i'
|
||||
}],
|
||||
j: 'k',
|
||||
},
|
||||
},
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
var end: any
|
||||
if true
|
||||
end = 0
|
||||
elseif true
|
||||
echo
|
||||
endif
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
nunmap <buffer> (
|
||||
nunmap <buffer> )
|
||||
inoremap [ {
|
||||
inoremap ] }
|
||||
silent! xunmap i{
|
||||
silent! xunmap a{
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func(
|
||||
s: string,
|
||||
n = 1,
|
||||
m = 2
|
||||
)
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var h =<< END
|
||||
text
|
||||
END
|
||||
|
||||
def Func()
|
||||
echo
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func()
|
||||
var h =<< END
|
||||
text
|
||||
END
|
||||
echo 'test'
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Foo()
|
||||
lcd -
|
||||
enddef
|
||||
def Bar()
|
||||
echo
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
n = Func(1, 2,
|
||||
3)
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func(s: string,
|
||||
n: number): bool
|
||||
if true
|
||||
return false
|
||||
endif
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func(
|
||||
n: number)
|
||||
#
|
||||
echo
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
" INDENT_AT this-line
|
||||
def Func(
|
||||
n: number)
|
||||
#
|
||||
echo # this-line
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
if true
|
||||
normal! ==
|
||||
endif
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var d = {
|
||||
a: () => true,
|
||||
b: () => true
|
||||
&& true
|
||||
&& Foo(),
|
||||
c: () => Bar(),
|
||||
e: () => Baz(),
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any))
|
||||
return (Emit: func(any)) => {
|
||||
Cont((t: any) => {
|
||||
if Pred(t)
|
||||
Emit(t)
|
||||
endif
|
||||
})
|
||||
}
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
" INDENT_EXE let g:vim_indent = {'more_in_bracket_block': v:true}
|
||||
def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any))
|
||||
return (Emit: func(any)) => {
|
||||
Cont((t: any) => {
|
||||
if Pred(t)
|
||||
Emit(t)
|
||||
endif
|
||||
})
|
||||
}
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
" INDENT_EXE unlet! g:vim_indent
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
g:lightline = {
|
||||
'active': {
|
||||
'left': [ [ 'mode', 'paste' ], [ 'readonly', 'relativepath', 'modified' ] ],
|
||||
},
|
||||
'inactive': {
|
||||
'left': [ [ 'readonly', 'relativepath', 'modified' ] ],
|
||||
}
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if getline(1, 10)
|
||||
->map((_, v: string): number => strcharlen(v))
|
||||
->max() > 1'000
|
||||
&l:breakindent = false
|
||||
&l:linebreak = false
|
||||
else
|
||||
&l:breakindent = true
|
||||
&l:linebreak = true
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var ext2cmd: dict<string> = {
|
||||
doc: $'antiword {fname}',
|
||||
docx: $'pandoc --from=docx --to=markdown {fname}',
|
||||
epub: $'pandoc --from=epub --to=markdown {fname}',
|
||||
odp: $'odt2txt {fname}',
|
||||
odt: $'odt2txt {fname}',
|
||||
pdf: $'pdftotext -nopgbrk -layout -q -eol unix {fname} -',
|
||||
rtf: 'unrtf --text',
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
const ptybuf: number = term_start(&shell, {
|
||||
hidden: true,
|
||||
exit_cb: (_, _) => {
|
||||
if true
|
||||
close
|
||||
else
|
||||
help
|
||||
endif
|
||||
}
|
||||
})
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var d = {
|
||||
a: 0,
|
||||
# a ' quote {{{
|
||||
#}}}
|
||||
b: 0,
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
echo printf('%s () %s',
|
||||
1,
|
||||
2
|
||||
)
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
prop_add(1, col('.'), {
|
||||
length: 2,
|
||||
type: 'test'
|
||||
})
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
echo (() => " string starting with space")()
|
||||
echo
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var variables = deepcopy(g:)
|
||||
->filter((k: string, _): bool =>
|
||||
k =~ '\c\V' .. keyword->escape('\')
|
||||
&& k !~ '\%(loaded\|did_plugin_\)')
|
||||
->items()
|
||||
->map((_, v): string => v[0] .. ' = ' .. string(v[1]))
|
||||
new
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var d = freq
|
||||
->map((_, v) =>
|
||||
v * (
|
||||
1
|
||||
+ 2
|
||||
))
|
||||
for item in d
|
||||
->items()
|
||||
->sort((a, b) => b[1] - a[1])
|
||||
echo
|
||||
endfor
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
make_job = job_start([&shell, &shellcmdflag, make_cmd], {
|
||||
callback: function(MakeProcessOutput, [qfid]),
|
||||
close_cb: function(MakeCloseCb, [qfid]),
|
||||
exit_cb: MakeCompleted,
|
||||
in_io: 'null'
|
||||
})
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var matching_abbrev: list<dict<string>> = copy(ABBREV)
|
||||
->filter((_, v: dict<string>): bool =>
|
||||
stridx(v.lhs, word_to_complete) == 0)
|
||||
->map((_, v: dict<string>) => ({
|
||||
word: v.lhs,
|
||||
menu: AbbrevRhs(v.rhs)->stridx('expand_') >= 0
|
||||
? AbbrevRhs(v.rhs)->matchstr('.*,\s*''\zs.*\ze'')')
|
||||
: AbbrevRhs(v.rhs)
|
||||
}))
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func()
|
||||
if true
|
||||
vimgrep /^\C\s*\%(fu\%[nction]\|def\)\s\+/ file
|
||||
endif
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
setlocal iskeyword+=[
|
||||
cword = expand('<cword>')
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
silent if true
|
||||
echo
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func()
|
||||
sort :^.*[\/]:
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func()
|
||||
d = {
|
||||
}
|
||||
hd =<< trim END
|
||||
['
|
||||
]'
|
||||
END
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func()
|
||||
if true
|
||||
var hd =<< trim END
|
||||
if get(b:, 'current_syntax', '')
|
||||
endif
|
||||
END
|
||||
elseif true
|
||||
echo
|
||||
endif
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
# test for control-flow keyword followed by commented fold marker {{{
|
||||
if true
|
||||
echo
|
||||
endif #}}}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if winsz == 0|let winsz= ""|endif
|
||||
exe "noswapfile ".winsz."wincmd s"
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
if true
|
||||
windo if true | echo | endif
|
||||
augroup Name
|
||||
autocmd WinLeave * if true | eval 1 + 2 | endif
|
||||
augroup END
|
||||
endif
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
echo ' =<< trim END'
|
||||
->len()
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
function Func()
|
||||
if true
|
||||
if true
|
||||
if true | echo com | endif
|
||||
if true | echo com | endif
|
||||
endif
|
||||
else
|
||||
endif
|
||||
endfunction
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
function Func()
|
||||
if v:true
|
||||
+
|
||||
echo
|
||||
-
|
||||
endif
|
||||
endfunction
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var matchpairs: string = &matchpairs
|
||||
var pairs: dict<list<string>>
|
||||
for [opening: string, closing: string]
|
||||
in matchpairs
|
||||
->split(',')
|
||||
->map((_, v: string): list<string> => split(v, ':'))
|
||||
pairs[opening] = [escape(opening, '[]'), escape(closing, '[]'), 'nW', 'w$']
|
||||
pairs[closing] = [escape(opening, '[]'), escape(closing, '[]'), 'bnW', 'w0']
|
||||
endfor
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
{
|
||||
echo []
|
||||
+ []
|
||||
+ [{a: 1,
|
||||
b: 2}]
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
silent! argdel *
|
||||
edit file
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Foo()
|
||||
Bar(1,
|
||||
[]->filter((_, v) => {
|
||||
return true
|
||||
}),
|
||||
() => {
|
||||
echo
|
||||
})
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
" vim: set ft=vim sw=4 :
|
||||
|
||||
" START_INDENT
|
||||
|
||||
func Some()
|
||||
let x = 1
|
||||
endfunc
|
||||
@@ -15,15 +14,6 @@ if 1
|
||||
\ ]
|
||||
endif
|
||||
|
||||
" TODO: add searchpair() to find matching {
|
||||
"for x in [
|
||||
"{
|
||||
"key: 'value'
|
||||
"},
|
||||
"]
|
||||
"eval 0
|
||||
"endfor
|
||||
|
||||
for x in [
|
||||
{key: 'value'},
|
||||
]
|
||||
@@ -38,11 +28,10 @@ let t = [
|
||||
|
||||
def Func()
|
||||
var d = dd
|
||||
->extend({
|
||||
})
|
||||
->extend({
|
||||
})
|
||||
eval 0
|
||||
enddef
|
||||
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
@@ -69,7 +58,7 @@ let list = [
|
||||
let list = [
|
||||
'one',
|
||||
'two',
|
||||
]
|
||||
]
|
||||
echo
|
||||
|
||||
" END_INDENT
|
||||
@@ -84,8 +73,8 @@ endfunc
|
||||
" START_INDENT
|
||||
" INDENT_NEXT next-line
|
||||
func Some()
|
||||
" next-line
|
||||
let f = x
|
||||
" next-line
|
||||
let f = x
|
||||
endfunc
|
||||
" END_INDENT
|
||||
|
||||
@@ -99,6 +88,12 @@ endfunc
|
||||
|
||||
" START_INDENT
|
||||
let a =<< END
|
||||
nothing
|
||||
END
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
let a =<< trim END
|
||||
nothing
|
||||
END
|
||||
" END_INDENT
|
||||
@@ -111,3 +106,766 @@ let a=<< trim END
|
||||
blah this-line
|
||||
END
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if v:true
|
||||
echo 0
|
||||
end
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var result = Func(
|
||||
arg1,
|
||||
arg2
|
||||
)
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var result = Func(arg1,
|
||||
arg2)
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
filter(list, (k, v) =>
|
||||
v > 0)
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
filter(list, (k, v) => {
|
||||
const x = get(list, k, 0)
|
||||
return x > 0
|
||||
})
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if x > 0
|
||||
filter(list, (k, v) => {
|
||||
const x = get(list, k, 1)
|
||||
return x > 0
|
||||
})
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
{
|
||||
var temp = 'temp'
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var text = lead
|
||||
.. middle
|
||||
.. end
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var text = lead ..
|
||||
middle ..
|
||||
end
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var total = start +
|
||||
end -
|
||||
correction
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var result = start
|
||||
:+ print
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var result = positive
|
||||
? PosFunc(arg)
|
||||
: NegFunc(arg)
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var result = GetBuilder()
|
||||
->BuilderSetWidth(333)
|
||||
->BuilderSetHeight(777)
|
||||
->BuilderBuild()
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var result = MyDict
|
||||
.member
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
autocmd BufNewFile *.match if condition
|
||||
| echo 'match'
|
||||
| endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
set cpo+=C
|
||||
var lines =<< trim END
|
||||
| this works
|
||||
END
|
||||
set cpo-=C
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
syn region Text
|
||||
\ start='foo'
|
||||
#\ comment
|
||||
\ end='bar'
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
au CursorHold * echom 'BEFORE bar'
|
||||
#\ some comment
|
||||
| echom 'AFTER bar'
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def MyFunc(text: string,
|
||||
separator = '-'
|
||||
): string
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def MyFunc(
|
||||
text: string,
|
||||
separator = '-'
|
||||
): string
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
[var1, var2] =
|
||||
Func()
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
const list = ['one',
|
||||
'two']
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
const list = [
|
||||
'one',
|
||||
'two',
|
||||
]
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
const dict = {one: 1,
|
||||
two: 2
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
const dict = {
|
||||
one: 1,
|
||||
two: 2
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
const dict =
|
||||
{
|
||||
one: 1,
|
||||
two: 2
|
||||
}
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func()
|
||||
return {
|
||||
one: 1
|
||||
}
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
echo {
|
||||
a: 0,
|
||||
# b
|
||||
# c
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
echo search(
|
||||
# comment
|
||||
'1'
|
||||
.. '2'
|
||||
)
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
var v = ( # trailing "(" starts line continuation
|
||||
3 + 4 # nothing special
|
||||
) # end of expression indicates continued line
|
||||
var x: number # needs to align with previous "var"
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func() # {{{
|
||||
# comment
|
||||
if true
|
||||
return
|
||||
endif
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
echo {
|
||||
key:
|
||||
'value',
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var id = time
|
||||
->timer_start((_) => {
|
||||
n = 0
|
||||
})
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
augroup Name
|
||||
autocmd!
|
||||
augroup END
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var n =
|
||||
# comment
|
||||
1
|
||||
+ 2
|
||||
|
||||
var s = ''
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var keys = {
|
||||
J: 'j',
|
||||
"\<Home>": '1G',
|
||||
"\<End>": 'G',
|
||||
z: 'zz'
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
export def Func(
|
||||
n: number,
|
||||
s: string,
|
||||
...l: list<bool>
|
||||
)
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var heredoc =<< trim ENDD
|
||||
var nested_heredoc =<< trim END
|
||||
END
|
||||
ENDD
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
else " comment
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true | echo 'one' | endif
|
||||
if true | echo 'two' | endif
|
||||
if true | echo 'three' | endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
:'<-1 mark <
|
||||
else
|
||||
echo ''
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
substitute/pat /rep /
|
||||
echo
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
try
|
||||
echo 1
|
||||
catch /pat / # comment
|
||||
echo 2
|
||||
endtry
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func()
|
||||
Cmd %
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if end == 'xxx' || end == 'yyy'
|
||||
echo
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
popup_move(id, {col: 1,
|
||||
line: 2})
|
||||
endif
|
||||
setwinvar(id, 'name', 3)
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var d = [
|
||||
{a: 'x',
|
||||
b: 'y'},
|
||||
FuncA(),
|
||||
FuncB(),
|
||||
]
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var ll = [[
|
||||
1,
|
||||
2,
|
||||
3], [
|
||||
4,
|
||||
5,
|
||||
6], [
|
||||
7,
|
||||
8,
|
||||
9]]
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var ld = [{
|
||||
a: 'xxx',
|
||||
b: 'yyy'}, {
|
||||
c: 'xxx',
|
||||
d: 'yyy'}, {
|
||||
e: 'xxx',
|
||||
f: 'yyy'}, {
|
||||
}]
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var d = {
|
||||
a: {
|
||||
b: {
|
||||
c: [{
|
||||
d: 'e',
|
||||
f: 'g',
|
||||
h: 'i'
|
||||
}],
|
||||
j: 'k',
|
||||
},
|
||||
},
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
var end: any
|
||||
if true
|
||||
end = 0
|
||||
elseif true
|
||||
echo
|
||||
endif
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
nunmap <buffer> (
|
||||
nunmap <buffer> )
|
||||
inoremap [ {
|
||||
inoremap ] }
|
||||
silent! xunmap i{
|
||||
silent! xunmap a{
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func(
|
||||
s: string,
|
||||
n = 1,
|
||||
m = 2
|
||||
)
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var h =<< END
|
||||
text
|
||||
END
|
||||
|
||||
def Func()
|
||||
echo
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func()
|
||||
var h =<< END
|
||||
text
|
||||
END
|
||||
echo 'test'
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Foo()
|
||||
lcd -
|
||||
enddef
|
||||
def Bar()
|
||||
echo
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
n = Func(1, 2,
|
||||
3)
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func(s: string,
|
||||
n: number): bool
|
||||
if true
|
||||
return false
|
||||
endif
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func(
|
||||
n: number)
|
||||
#
|
||||
echo
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
" INDENT_AT this-line
|
||||
def Func(
|
||||
n: number)
|
||||
#
|
||||
echo # this-line
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
if true
|
||||
normal! ==
|
||||
endif
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var d = {
|
||||
a: () => true,
|
||||
b: () => true
|
||||
&& true
|
||||
&& Foo(),
|
||||
c: () => Bar(),
|
||||
e: () => Baz(),
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any))
|
||||
return (Emit: func(any)) => {
|
||||
Cont((t: any) => {
|
||||
if Pred(t)
|
||||
Emit(t)
|
||||
endif
|
||||
})
|
||||
}
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
" INDENT_EXE let g:vim_indent = {'more_in_bracket_block': v:true}
|
||||
def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any))
|
||||
return (Emit: func(any)) => {
|
||||
Cont((t: any) => {
|
||||
if Pred(t)
|
||||
Emit(t)
|
||||
endif
|
||||
})
|
||||
}
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
" INDENT_EXE unlet! g:vim_indent
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
g:lightline = {
|
||||
'active': {
|
||||
'left': [ [ 'mode', 'paste' ], [ 'readonly', 'relativepath', 'modified' ] ],
|
||||
},
|
||||
'inactive': {
|
||||
'left': [ [ 'readonly', 'relativepath', 'modified' ] ],
|
||||
}
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if getline(1, 10)
|
||||
->map((_, v: string): number => strcharlen(v))
|
||||
->max() > 1'000
|
||||
&l:breakindent = false
|
||||
&l:linebreak = false
|
||||
else
|
||||
&l:breakindent = true
|
||||
&l:linebreak = true
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var ext2cmd: dict<string> = {
|
||||
doc: $'antiword {fname}',
|
||||
docx: $'pandoc --from=docx --to=markdown {fname}',
|
||||
epub: $'pandoc --from=epub --to=markdown {fname}',
|
||||
odp: $'odt2txt {fname}',
|
||||
odt: $'odt2txt {fname}',
|
||||
pdf: $'pdftotext -nopgbrk -layout -q -eol unix {fname} -',
|
||||
rtf: 'unrtf --text',
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
const ptybuf: number = term_start(&shell, {
|
||||
hidden: true,
|
||||
exit_cb: (_, _) => {
|
||||
if true
|
||||
close
|
||||
else
|
||||
help
|
||||
endif
|
||||
}
|
||||
})
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var d = {
|
||||
a: 0,
|
||||
# a ' quote {{{
|
||||
#}}}
|
||||
b: 0,
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
echo printf('%s () %s',
|
||||
1,
|
||||
2
|
||||
)
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
prop_add(1, col('.'), {
|
||||
length: 2,
|
||||
type: 'test'
|
||||
})
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
echo (() => " string starting with space")()
|
||||
echo
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var variables = deepcopy(g:)
|
||||
->filter((k: string, _): bool =>
|
||||
k =~ '\c\V' .. keyword->escape('\')
|
||||
&& k !~ '\%(loaded\|did_plugin_\)')
|
||||
->items()
|
||||
->map((_, v): string => v[0] .. ' = ' .. string(v[1]))
|
||||
new
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var d = freq
|
||||
->map((_, v) =>
|
||||
v * (
|
||||
1
|
||||
+ 2
|
||||
))
|
||||
for item in d
|
||||
->items()
|
||||
->sort((a, b) => b[1] - a[1])
|
||||
echo
|
||||
endfor
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
make_job = job_start([&shell, &shellcmdflag, make_cmd], {
|
||||
callback: function(MakeProcessOutput, [qfid]),
|
||||
close_cb: function(MakeCloseCb, [qfid]),
|
||||
exit_cb: MakeCompleted,
|
||||
in_io: 'null'
|
||||
})
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var matching_abbrev: list<dict<string>> = copy(ABBREV)
|
||||
->filter((_, v: dict<string>): bool =>
|
||||
stridx(v.lhs, word_to_complete) == 0)
|
||||
->map((_, v: dict<string>) => ({
|
||||
word: v.lhs,
|
||||
menu: AbbrevRhs(v.rhs)->stridx('expand_') >= 0
|
||||
? AbbrevRhs(v.rhs)->matchstr('.*,\s*''\zs.*\ze'')')
|
||||
: AbbrevRhs(v.rhs)
|
||||
}))
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func()
|
||||
if true
|
||||
vimgrep /^\C\s*\%(fu\%[nction]\|def\)\s\+/ file
|
||||
endif
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
setlocal iskeyword+=[
|
||||
cword = expand('<cword>')
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
silent if true
|
||||
echo
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func()
|
||||
sort :^.*[\/]:
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func()
|
||||
d = {
|
||||
}
|
||||
hd =<< trim END
|
||||
['
|
||||
]'
|
||||
END
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Func()
|
||||
if true
|
||||
var hd =<< trim END
|
||||
if get(b:, 'current_syntax', '')
|
||||
endif
|
||||
END
|
||||
elseif true
|
||||
echo
|
||||
endif
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
# test for control-flow keyword followed by commented fold marker {{{
|
||||
if true
|
||||
echo
|
||||
endif #}}}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if winsz == 0|let winsz= ""|endif
|
||||
exe "noswapfile ".winsz."wincmd s"
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
if true
|
||||
windo if true | echo | endif
|
||||
augroup Name
|
||||
autocmd WinLeave * if true | eval 1 + 2 | endif
|
||||
augroup END
|
||||
endif
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
if true
|
||||
echo ' =<< trim END'
|
||||
->len()
|
||||
endif
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
function Func()
|
||||
if true
|
||||
if true
|
||||
if true | echo com | endif
|
||||
if true | echo com | endif
|
||||
endif
|
||||
else
|
||||
endif
|
||||
endfunction
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
function Func()
|
||||
if v:true
|
||||
+
|
||||
echo
|
||||
-
|
||||
endif
|
||||
endfunction
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
var matchpairs: string = &matchpairs
|
||||
var pairs: dict<list<string>>
|
||||
for [opening: string, closing: string]
|
||||
in matchpairs
|
||||
->split(',')
|
||||
->map((_, v: string): list<string> => split(v, ':'))
|
||||
pairs[opening] = [escape(opening, '[]'), escape(closing, '[]'), 'nW', 'w$']
|
||||
pairs[closing] = [escape(opening, '[]'), escape(closing, '[]'), 'bnW', 'w0']
|
||||
endfor
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
{
|
||||
echo []
|
||||
+ []
|
||||
+ [{a: 1,
|
||||
b: 2}]
|
||||
}
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
silent! argdel *
|
||||
edit file
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
def Foo()
|
||||
Bar(1,
|
||||
[]->filter((_, v) => {
|
||||
return true
|
||||
}),
|
||||
() => {
|
||||
echo
|
||||
})
|
||||
enddef
|
||||
" END_INDENT
|
||||
|
||||
@@ -1,214 +1,22 @@
|
||||
" Vim indent file
|
||||
" Language: Vim script
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2022 Jun 24
|
||||
vim9script
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
# Vim indent file
|
||||
# Language: Vim script
|
||||
# Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
# Last Change: 2022 Sep 27
|
||||
|
||||
# Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetVimIndent()
|
||||
setlocal indentkeys+==endif,=enddef,=endfu,=endfor,=endwh,=endtry,=},=else,=cat,=finall,=END,0\\,0=\"\\\
|
||||
b:did_indent = true
|
||||
b:undo_indent = 'setlocal indentkeys< indentexpr<'
|
||||
|
||||
import autoload '../autoload/dist/vimindent.vim'
|
||||
|
||||
setlocal indentexpr=vimindent.Expr(v:lnum)
|
||||
setlocal indentkeys+==endif,=enddef,=endfu,=endfor,=endwh,=endtry,=},=else,=cat,=finall,=END,0\\
|
||||
execute('setlocal indentkeys+=0=\"\\\ ,0=#\\\ ')
|
||||
setlocal indentkeys-=0#
|
||||
setlocal indentkeys-=:
|
||||
|
||||
let b:undo_indent = "setl indentkeys< indentexpr<"
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetVimIndent")
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
function GetVimIndent()
|
||||
let ignorecase_save = &ignorecase
|
||||
try
|
||||
let &ignorecase = 0
|
||||
return GetVimIndentIntern()
|
||||
finally
|
||||
let &ignorecase = ignorecase_save
|
||||
endtry
|
||||
endfunc
|
||||
|
||||
" Legacy script line continuation and Vim9 script operators that must mean an
|
||||
" expression that continues from the previous line.
|
||||
let s:lineContPat = '^\s*\(\\\|"\\ \|->\)'
|
||||
|
||||
function GetVimIndentIntern()
|
||||
" If the current line has line continuation and the previous one too, use
|
||||
" the same indent. This does not skip empty lines.
|
||||
let cur_text = getline(v:lnum)
|
||||
let cur_has_linecont = cur_text =~ s:lineContPat
|
||||
if cur_has_linecont && v:lnum > 1 && getline(v:lnum - 1) =~ s:lineContPat
|
||||
return indent(v:lnum - 1)
|
||||
endif
|
||||
|
||||
" Find a non-blank line above the current line.
|
||||
let lnum = prevnonblank(v:lnum - 1)
|
||||
|
||||
" The previous line, ignoring line continuation
|
||||
let prev_text_end = lnum > 0 ? getline(lnum) : ''
|
||||
|
||||
" If the current line doesn't start with '\' or '"\ ' and below a line that
|
||||
" starts with '\' or '"\ ', use the indent of the line above it.
|
||||
if !cur_has_linecont
|
||||
while lnum > 0 && getline(lnum) =~ s:lineContPat
|
||||
let lnum = lnum - 1
|
||||
endwhile
|
||||
endif
|
||||
|
||||
" At the start of the file use zero indent.
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
" the start of the previous line, skipping over line continuation
|
||||
let prev_text = getline(lnum)
|
||||
let found_cont = 0
|
||||
|
||||
" Add a 'shiftwidth' after :if, :while, :try, :catch, :finally, :function
|
||||
" and :else. Add it three times for a line that starts with '\' or '"\ '
|
||||
" after a line that doesn't (or g:vim_indent_cont if it exists).
|
||||
let ind = indent(lnum)
|
||||
|
||||
" In heredoc indenting works completely differently.
|
||||
if has('syntax_items')
|
||||
let syn_here = synIDattr(synID(v:lnum, 1, 1), "name")
|
||||
if syn_here =~ 'vimLetHereDocStop'
|
||||
" End of heredoc: use indent of matching start line
|
||||
let lnum = v:lnum - 1
|
||||
while lnum > 0
|
||||
let attr = synIDattr(synID(lnum, 1, 1), "name")
|
||||
if attr != '' && attr !~ 'vimLetHereDoc'
|
||||
return indent(lnum)
|
||||
endif
|
||||
let lnum -= 1
|
||||
endwhile
|
||||
return 0
|
||||
endif
|
||||
if syn_here =~ 'vimLetHereDoc'
|
||||
if synIDattr(synID(lnum, 1, 1), "name") !~ 'vimLetHereDoc'
|
||||
" First line in heredoc: increase indent
|
||||
return ind + shiftwidth()
|
||||
endif
|
||||
" Heredoc continues: no change in indent
|
||||
return ind
|
||||
endif
|
||||
endif
|
||||
|
||||
if cur_text =~ s:lineContPat && v:lnum > 1 && prev_text !~ s:lineContPat
|
||||
let found_cont = 1
|
||||
if exists("g:vim_indent_cont")
|
||||
let ind = ind + g:vim_indent_cont
|
||||
else
|
||||
let ind = ind + shiftwidth() * 3
|
||||
endif
|
||||
elseif prev_text =~ '^\s*aug\%[roup]\s\+' && prev_text !~ '^\s*aug\%[roup]\s\+[eE][nN][dD]\>'
|
||||
let ind = ind + shiftwidth()
|
||||
else
|
||||
" A line starting with :au does not increment/decrement indent.
|
||||
" A { may start a block or a dict. Assume that when a } follows it's a
|
||||
" terminated dict.
|
||||
" ":function" starts a block but "function(" doesn't.
|
||||
if prev_text !~ '^\s*au\%[tocmd]' && prev_text !~ '^\s*{.*}'
|
||||
let i = match(prev_text, '\(^\||\)\s*\(export\s\+\)\?\({\|\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\|finall\%[y]\|def\|el\%[seif]\)\>\|fu\%[nction][! ]\)')
|
||||
if i >= 0
|
||||
let ind += shiftwidth()
|
||||
if strpart(prev_text, i, 1) == '|' && has('syntax_items')
|
||||
\ && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\|PatSep\)$'
|
||||
let ind -= shiftwidth()
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
" If the previous line contains an "end" after a pipe, but not in an ":au"
|
||||
" command. And not when there is a backslash before the pipe.
|
||||
" And when syntax HL is enabled avoid a match inside a string.
|
||||
let i = match(prev_text, '[^\\]|\s*\(ene\@!\)')
|
||||
if i > 0 && prev_text !~ '^\s*au\%[tocmd]'
|
||||
if !has('syntax_items') || synIDattr(synID(lnum, i + 2, 1), "name") !~ '\(Comment\|String\)$'
|
||||
let ind = ind - shiftwidth()
|
||||
endif
|
||||
endif
|
||||
|
||||
" For a line starting with "}" find the matching "{". Align with that line,
|
||||
" it is either the matching block start or dictionary start.
|
||||
" Use the mapped "%" from matchit to find the match, otherwise we may match
|
||||
" a { inside a comment or string.
|
||||
if cur_text =~ '^\s*}'
|
||||
if maparg('%') != ''
|
||||
exe v:lnum
|
||||
silent! normal %
|
||||
if line('.') < v:lnum
|
||||
let ind = indent('.')
|
||||
endif
|
||||
else
|
||||
" todo: use searchpair() to find a match
|
||||
endif
|
||||
endif
|
||||
|
||||
" Look back for a line to align with
|
||||
while lnum > 1
|
||||
" Below a line starting with "}" find the matching "{".
|
||||
if prev_text =~ '^\s*}'
|
||||
if maparg('%') != ''
|
||||
exe lnum
|
||||
silent! normal %
|
||||
if line('.') < lnum
|
||||
let lnum = line('.')
|
||||
let ind = indent(lnum)
|
||||
let prev_text = getline(lnum)
|
||||
else
|
||||
break
|
||||
endif
|
||||
else
|
||||
" todo: use searchpair() to find a match
|
||||
break
|
||||
endif
|
||||
elseif prev_text =~ s:lineContPat
|
||||
" looks like a continuation like, go back one line
|
||||
let lnum = lnum - 1
|
||||
let ind = indent(lnum)
|
||||
let prev_text = getline(lnum)
|
||||
else
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" Below a line starting with "]" we must be below the end of a list.
|
||||
" Include a "}" and "},} in case a dictionary ends too.
|
||||
if prev_text_end =~ '^\s*\(},\=\s*\)\=]'
|
||||
let ind = ind - shiftwidth()
|
||||
endif
|
||||
|
||||
let ends_in_comment = has('syntax_items')
|
||||
\ && synIDattr(synID(lnum, len(getline(lnum)), 1), "name") =~ '\(Comment\|String\)$'
|
||||
|
||||
" A line ending in "{" or "[" is most likely the start of a dict/list literal,
|
||||
" indent the next line more. Not for a continuation line or {{{.
|
||||
if !ends_in_comment && prev_text_end =~ '\s[{[]\s*$' && !found_cont
|
||||
let ind = ind + shiftwidth()
|
||||
endif
|
||||
|
||||
" Subtract a 'shiftwidth' on a :endif, :endwhile, :endfor, :catch, :finally,
|
||||
" :endtry, :endfun, :enddef, :else and :augroup END.
|
||||
" Although ":en" would be enough only match short command names as in
|
||||
" 'indentkeys'.
|
||||
if cur_text =~ '^\s*\(endif\|endwh\|endfor\|endtry\|endfu\|enddef\|cat\|finall\|else\|aug\%[roup]\s\+[eE][nN][dD]\)'
|
||||
let ind = ind - shiftwidth()
|
||||
if ind < 0
|
||||
let ind = 0
|
||||
endif
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" vim:sw=2
|
||||
|
||||
12
runtime/indent/vue.vim
Normal file
12
runtime/indent/vue.vim
Normal file
@@ -0,0 +1,12 @@
|
||||
" Vim indent file placeholder
|
||||
" Language: Vue
|
||||
" Maintainer: None, please volunteer if you have a real Vue indent script
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
" Html comes closest
|
||||
runtime! indent/html.vim
|
||||
@@ -1,7 +1,7 @@
|
||||
" These commands create the option window.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2022 Apr 07
|
||||
" Last Change: 2022 Oct 02
|
||||
|
||||
" If there already is an option window, jump to that one.
|
||||
let buf = bufnr('option-window')
|
||||
@@ -343,6 +343,9 @@ call <SID>Header(gettext("displaying text"))
|
||||
call <SID>AddOption("scroll", gettext("number of lines to scroll for CTRL-U and CTRL-D"))
|
||||
call append("$", "\t" .. s:local_to_window)
|
||||
call <SID>OptionL("scr")
|
||||
call <SID>AddOption("smoothscroll", gettext("scroll by screen line"))
|
||||
call append("$", "\t" .. s:local_to_window)
|
||||
call <SID>BinOptionL("sms")
|
||||
call <SID>AddOption("scrolloff", gettext("number of screen lines to show around the cursor"))
|
||||
call append("$", " \tset so=" . &so)
|
||||
call <SID>AddOption("wrap", gettext("long lines wrap"))
|
||||
@@ -513,10 +516,10 @@ call <SID>AddOption("switchbuf", gettext("\"useopen\" and/or \"split\"; which wi
|
||||
call <SID>OptionG("swb", &swb)
|
||||
call <SID>AddOption("splitbelow", gettext("a new window is put below the current one"))
|
||||
call <SID>BinOptionG("sb", &sb)
|
||||
call <SID>AddOption("splitkeep", gettext("determines scroll behavior for split windows"))
|
||||
call <SID>BinOptionG("spk", &spk)
|
||||
call <SID>AddOption("splitright", gettext("a new window is put right of the current one"))
|
||||
call <SID>BinOptionG("spr", &spr)
|
||||
call <SID>AddOption("splitscroll", gettext("determines scroll behavior for split windows"))
|
||||
call <SID>BinOptionG("spsc", &spsc)
|
||||
call <SID>AddOption("scrollbind", gettext("this window scrolls together with other bound windows"))
|
||||
call append("$", "\t" .. s:local_to_window)
|
||||
call <SID>BinOptionL("scb")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim plugin for using Vim as manpager.
|
||||
" Maintainer: Enno Nagel <ennonagel+vim@gmail.com>
|
||||
" Last Change: 2022 Jun 17
|
||||
" Last Change: 2022 Sep 30
|
||||
|
||||
" Set up the current buffer (likely read from stdin) as a manpage
|
||||
command MANPAGER call s:ManPager()
|
||||
@@ -18,9 +18,6 @@ function s:ManPager()
|
||||
" Make this an unlisted, readonly scratch buffer
|
||||
setlocal buftype=nofile noswapfile bufhidden=hide nobuflisted readonly
|
||||
|
||||
" Is this useful? Should allow for using K on word with a colon.
|
||||
setlocal iskeyword+=:
|
||||
|
||||
" Ensure text width matches window width
|
||||
setlocal foldcolumn& nofoldenable nonumber norelativenumber
|
||||
|
||||
@@ -44,6 +41,6 @@ function s:ManPager()
|
||||
setlocal nomodified nomodifiable
|
||||
|
||||
" Set filetype to man even if ftplugin is disabled
|
||||
setlocal iskeyword+=: filetype=man
|
||||
setlocal filetype=man
|
||||
runtime ftplugin/man.vim
|
||||
endfunction
|
||||
|
||||
@@ -14,7 +14,7 @@ def SetSyn(name: string)
|
||||
filetype = "fvwm"
|
||||
endif
|
||||
if name == "whitespace"
|
||||
" do not replace the filetype but add whitespace on top
|
||||
# do not replace the filetype but add whitespace on top
|
||||
filetype = &ft .. ".whitespace"
|
||||
endif
|
||||
if !exists("s:syntax_menu_synonly")
|
||||
|
||||
62
runtime/syntax/chatito.vim
Normal file
62
runtime/syntax/chatito.vim
Normal file
@@ -0,0 +1,62 @@
|
||||
" Vim syntax file
|
||||
" Language: Chatito
|
||||
" Maintainer: ObserverOfTime <chronobserver@disroot.org>
|
||||
" Filenames: *.chatito
|
||||
" Last Change: 2022 Sep 19
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Comment
|
||||
syn keyword chatitoTodo contained TODO FIXME XXX
|
||||
syn match chatitoComment /^#.*/ contains=chatitoTodo,@Spell
|
||||
syn match chatitoComment +^//.*+ contains=chatitoTodo,@Spell
|
||||
|
||||
" Import
|
||||
syn match chatitoImport /^import \+.*$/ transparent contains=chatitoImportKeyword,chatitoImportFile
|
||||
syn keyword chatitoImportKeyword import contained nextgroup=chatitoImportFile
|
||||
syn match chatitoImportFile /.*$/ contained skipwhite
|
||||
|
||||
" Intent
|
||||
syn match chatitoIntent /^%\[[^\]?]\+\]\((.\+)\)\=$/ contains=chatitoArgs
|
||||
|
||||
" Slot
|
||||
syn match chatitoSlot /^@\[[^\]?#]\+\(#[^\]?#]\+\)\=\]\((.\+)\)\=$/ contains=chatitoArgs,chatitoVariation
|
||||
syn match chatitoSlot /@\[[^\]?#]\+\(#[^\]?#]\+\)\=?\=\]/ contained contains=chatitoOpt,chatitoVariation
|
||||
|
||||
" Alias
|
||||
syn match chatitoAlias /^\~\[[^\]?]\+\]\=$/
|
||||
syn match chatitoAlias /\~\[[^\]?]\+?\=\]/ contained contains=chatitoOpt
|
||||
|
||||
" Probability
|
||||
syn match chatitoProbability /\*\[\d\+\(\.\d\+\)\=%\=\]/ contained
|
||||
|
||||
" Optional
|
||||
syn match chatitoOpt '?' contained
|
||||
|
||||
" Arguments
|
||||
syn match chatitoArgs /(.\+)/ contained
|
||||
|
||||
" Variation
|
||||
syn match chatitoVariation /#[^\]?#]\+/ contained
|
||||
|
||||
" Value
|
||||
syn match chatitoValue /^ \{4\}\zs.\+$/ contains=chatitoProbability,chatitoSlot,chatitoAlias,@Spell
|
||||
|
||||
" Errors
|
||||
syn match chatitoError /^\t/
|
||||
|
||||
hi def link chatitoAlias String
|
||||
hi def link chatitoArgs Special
|
||||
hi def link chatitoComment Comment
|
||||
hi def link chatitoError Error
|
||||
hi def link chatitoImportKeyword Include
|
||||
hi def link chatitoIntent Statement
|
||||
hi def link chatitoOpt SpecialChar
|
||||
hi def link chatitoProbability Number
|
||||
hi def link chatitoSlot Identifier
|
||||
hi def link chatitoTodo Todo
|
||||
hi def link chatitoVariation Special
|
||||
|
||||
let b:current_syntax = 'chatito'
|
||||
@@ -3,7 +3,7 @@
|
||||
" Filenames: *.desktop, *.directory
|
||||
" Maintainer: Eisuke Kawashima ( e.kawaschima+vim AT gmail.com )
|
||||
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2020-06-11
|
||||
" Last Change: 2022 Sep 22
|
||||
" Version Info: desktop.vim 1.5
|
||||
" References:
|
||||
" - https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.5.html (2020-04-27)
|
||||
@@ -60,10 +60,10 @@ syn match dtLocaleSuffix
|
||||
|
||||
" Boolean Value {{{2
|
||||
syn match dtBoolean
|
||||
\ /^\%(DBusActivatable\|Hidden\|NoDisplay\|PrefersNonDefaultGPU\|StartupNotify\|Terminal\)\s*=\s*\%(true\|false\)/
|
||||
\ /^\%(DBusActivatable\|Hidden\|NoDisplay\|PrefersNonDefaultGPU\|SingleMainWindow\|StartupNotify\|Terminal\)\s*=\s*\%(true\|false\)/
|
||||
\ contains=dtBooleanKey,dtDelim,dtBooleanValue transparent
|
||||
syn keyword dtBooleanKey
|
||||
\ DBusActivatable Hidden NoDisplay PrefersNonDefaultGPU StartupNotify Terminal
|
||||
\ DBusActivatable Hidden NoDisplay PrefersNonDefaultGPU SingleMainWindow StartupNotify Terminal
|
||||
\ contained nextgroup=dtDelim
|
||||
|
||||
if s:desktop_enable_kde
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: Erlang (http://www.erlang.org)
|
||||
" Maintainer: Csaba Hoch <csaba.hoch@gmail.com>
|
||||
" Contributor: Adam Rutkowski <hq@mtod.org>
|
||||
" Last Update: 2020-May-26
|
||||
" Last Update: 2022-Sep-06
|
||||
" License: Vim license
|
||||
" URL: https://github.com/vim-erlang/vim-erlang-runtime
|
||||
|
||||
@@ -61,7 +61,8 @@ syn match erlangQuotedAtomModifier '\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' con
|
||||
syn match erlangModifier '\$\%([^\\]\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\)'
|
||||
|
||||
" Operators, separators
|
||||
syn match erlangOperator '==\|=:=\|/=\|=/=\|<\|=<\|>\|>=\|=>\|:=\|++\|--\|=\|!\|<-\|+\|-\|\*\|\/'
|
||||
syn match erlangOperator '==\|=:=\|/=\|=/=\|<\|=<\|>\|>=\|=>\|:=\|?=\|++\|--\|=\|!\|<-\|+\|-\|\*\|\/'
|
||||
syn match erlangEqualsBinary '=<<\%(<\)\@!'
|
||||
syn keyword erlangOperator div rem or xor bor bxor bsl bsr and band not bnot andalso orelse
|
||||
syn match erlangBracket '{\|}\|\[\|]\||\|||'
|
||||
syn match erlangPipe '|'
|
||||
@@ -76,7 +77,8 @@ syn match erlangGlobalFuncCall '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\
|
||||
syn match erlangGlobalFuncRef '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@=' contains=erlangComment,erlangVariable
|
||||
|
||||
" Variables, macros, records, maps
|
||||
syn match erlangVariable '\<[A-Z_][[:alnum:]_@]*'
|
||||
syn match erlangVariable '\<[A-Z][[:alnum:]_@]*'
|
||||
syn match erlangAnonymousVariable '\<_[[:alnum:]_@]*'
|
||||
syn match erlangMacro '??\=[[:alnum:]_@]\+'
|
||||
syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+'
|
||||
syn region erlangQuotedMacro start=/??\=\s*'/ end=/'/ contains=erlangQuotedAtomModifier
|
||||
@@ -92,7 +94,7 @@ syn match erlangBitType '\%(\/\%(\s\|\n\|%.*\n\)*\)\@<=\%(integer\|float\|binary
|
||||
|
||||
" Constants and Directives
|
||||
syn match erlangUnknownAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\l[[:alnum:]_@]*' contains=erlangComment
|
||||
syn match erlangAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\(_type\)\=\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\|optional_callbacks\)\>' contains=erlangComment
|
||||
syn match erlangAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\(_type\)\=\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\|optional_callbacks\|feature\)\>' contains=erlangComment
|
||||
syn match erlangInclude '^\s*-\%(\s\|\n\|%.*\n\)*\%(include\|include_lib\)\>' contains=erlangComment
|
||||
syn match erlangRecordDef '^\s*-\%(\s\|\n\|%.*\n\)*record\>' contains=erlangComment
|
||||
syn match erlangDefine '^\s*-\%(\s\|\n\|%.*\n\)*\%(define\|undef\)\>' contains=erlangComment
|
||||
@@ -100,8 +102,8 @@ syn match erlangPreCondit '^\s*-\%(\s\|\n\|%.*\n\)*\%(ifdef\|ifndef\|else\|endif
|
||||
syn match erlangType '^\s*-\%(\s\|\n\|%.*\n\)*\%(spec\|type\|opaque\|callback\)\>' contains=erlangComment
|
||||
|
||||
" Keywords
|
||||
syn keyword erlangKeyword after begin case catch cond end fun if let of
|
||||
syn keyword erlangKeyword receive when try
|
||||
syn keyword erlangKeyword after begin case catch cond end fun if let of else
|
||||
syn keyword erlangKeyword receive when try maybe
|
||||
|
||||
" Build-in-functions (BIFs)
|
||||
syn keyword erlangBIF abs alive apply atom_to_binary atom_to_list contained
|
||||
@@ -174,6 +176,7 @@ hi def link erlangModifier Special
|
||||
|
||||
" Operators, separators
|
||||
hi def link erlangOperator Operator
|
||||
hi def link erlangEqualsBinary ErrorMsg
|
||||
hi def link erlangRightArrow Operator
|
||||
if s:old_style
|
||||
hi def link erlangBracket Normal
|
||||
@@ -191,6 +194,7 @@ hi def link erlangLocalFuncRef Normal
|
||||
hi def link erlangGlobalFuncCall Function
|
||||
hi def link erlangGlobalFuncRef Function
|
||||
hi def link erlangVariable Normal
|
||||
hi def link erlangAnonymousVariable erlangVariable
|
||||
hi def link erlangMacro Normal
|
||||
hi def link erlangQuotedMacro Normal
|
||||
hi def link erlangRecord Normal
|
||||
@@ -203,6 +207,7 @@ hi def link erlangLocalFuncRef Normal
|
||||
hi def link erlangGlobalFuncCall Normal
|
||||
hi def link erlangGlobalFuncRef Normal
|
||||
hi def link erlangVariable Identifier
|
||||
hi def link erlangAnonymousVariable erlangVariable
|
||||
hi def link erlangMacro Macro
|
||||
hi def link erlangQuotedMacro Macro
|
||||
hi def link erlangRecord Structure
|
||||
|
||||
@@ -18,8 +18,6 @@ syn keyword gdscriptRepeat for while break continue
|
||||
|
||||
syn keyword gdscriptOperator is as not and or in
|
||||
|
||||
syn match gdscriptClass "\v<\u\w+>"
|
||||
syn match gdscriptConstant "\<[_A-Z]\+[0-9_A-Z]*\>"
|
||||
syn match gdscriptBlockStart ":\s*$"
|
||||
|
||||
syn keyword gdscriptKeyword null self owner parent tool
|
||||
@@ -33,14 +31,16 @@ syn keyword gdscriptStatement onready
|
||||
syn keyword gdscriptStatement class_name extends
|
||||
|
||||
syn keyword gdscriptType void bool int float String contained
|
||||
syn match gdscriptType ":\s*\zs\h\w*" contained
|
||||
syn match gdscriptType "->\s*\zs\h\w*" contained
|
||||
|
||||
syn keyword gdscriptStatement var nextgroup=gdscriptTypeDecl skipwhite
|
||||
syn keyword gdscriptStatement const nextgroup=gdscriptTypeDecl skipwhite
|
||||
syn match gdscriptTypeDecl "\h\w*\s*:\s*\h\w*" contains=gdscriptOperator,gdscriptType,gdscriptClass contained skipwhite
|
||||
syn match gdscriptTypeDecl "->\s*\h\w*" contains=gdscriptOperator,gdscriptType,gdscriptClass skipwhite
|
||||
syn match gdscriptTypeDecl "\h\w*\s*:\s*\h\w*" contains=gdscriptType contained skipwhite
|
||||
syn match gdscriptTypeDecl "->\s*\h\w*" contains=gdscriptType skipwhite
|
||||
|
||||
syn keyword gdscriptStatement export nextgroup=gdscriptExportTypeDecl skipwhite
|
||||
syn match gdscriptExportTypeDecl "(.\{-}[,)]" contains=gdscriptOperator,gdscriptType,gdscriptClass contained skipwhite
|
||||
syn match gdscriptExportTypeDecl "(.\{-}[,)]" contains=gdscriptOperator,gdscriptType contained skipwhite
|
||||
|
||||
syn keyword gdscriptStatement setget nextgroup=gdscriptSetGet,gdscriptSetGetSeparator skipwhite
|
||||
syn match gdscriptSetGet "\h\w*" nextgroup=gdscriptSetGetSeparator display contained skipwhite
|
||||
@@ -84,8 +84,6 @@ hi def link gdscriptOperator Operator
|
||||
hi def link gdscriptRepeat Repeat
|
||||
hi def link gdscriptSetGet Function
|
||||
hi def link gdscriptFunctionName Function
|
||||
hi def link gdscriptClass Type
|
||||
hi def link gdscriptConstant Constant
|
||||
hi def link gdscriptBuiltinStruct Typedef
|
||||
hi def link gdscriptComment Comment
|
||||
hi def link gdscriptString String
|
||||
|
||||
49
runtime/syntax/gyp.vim
Normal file
49
runtime/syntax/gyp.vim
Normal file
@@ -0,0 +1,49 @@
|
||||
" Vim syntax file
|
||||
" Language: GYP
|
||||
" Maintainer: ObserverOfTime <chronobserver@disroot.org>
|
||||
" Filenames: *.gyp,*.gypi
|
||||
" Last Change: 2022 Sep 27
|
||||
|
||||
if !exists('g:main_syntax')
|
||||
if exists('b:current_syntax') && b:current_syntax ==# 'gyp'
|
||||
finish
|
||||
endif
|
||||
let g:main_syntax = 'gyp'
|
||||
endif
|
||||
|
||||
" Based on JSON syntax
|
||||
runtime! syntax/json.vim
|
||||
|
||||
" Single quotes are allowed
|
||||
syn clear jsonStringSQError
|
||||
|
||||
syn match jsonKeywordMatch /'\([^']\|\\\'\)\+'[[:blank:]\r\n]*\:/ contains=jsonKeyword
|
||||
if has('conceal') && (!exists('g:vim_json_conceal') || g:vim_json_conceal==1)
|
||||
syn region jsonKeyword matchgroup=jsonQuote start=/'/ end=/'\ze[[:blank:]\r\n]*\:/ concealends contained
|
||||
else
|
||||
syn region jsonKeyword matchgroup=jsonQuote start=/'/ end=/'\ze[[:blank:]\r\n]*\:/ contained
|
||||
endif
|
||||
|
||||
syn match jsonStringMatch /'\([^']\|\\\'\)\+'\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString
|
||||
if has('conceal') && (!exists('g:vim_json_conceal') || g:vim_json_conceal==1)
|
||||
syn region jsonString oneline matchgroup=jsonQuote start=/'/ skip=/\\\\\|\\'/ end=/'/ concealends contains=jsonEscape contained
|
||||
else
|
||||
syn region jsonString oneline matchgroup=jsonQuote start=/'/ skip=/\\\\\|\\'/ end=/'/ contains=jsonEscape contained
|
||||
endif
|
||||
|
||||
" Trailing commas are allowed
|
||||
if !exists('g:vim_json_warnings') || g:vim_json_warnings==1
|
||||
syn clear jsonTrailingCommaError
|
||||
endif
|
||||
|
||||
" Python-style comments are allowed
|
||||
syn match jsonComment /#.*$/ contains=jsonTodo,@Spell
|
||||
syn keyword jsonTodo FIXME NOTE TODO XXX TBD contained
|
||||
|
||||
hi def link jsonComment Comment
|
||||
hi def link jsonTodo Todo
|
||||
|
||||
let b:current_syntax = 'gyp'
|
||||
if g:main_syntax ==# 'gyp'
|
||||
unlet g:main_syntax
|
||||
endif
|
||||
133
runtime/syntax/hare.vim
Normal file
133
runtime/syntax/hare.vim
Normal file
@@ -0,0 +1,133 @@
|
||||
" PRELUDE {{{1
|
||||
" Vim syntax file
|
||||
" Language: Hare
|
||||
" Maintainer: Amelia Clarke <me@rsaihe.dev>
|
||||
" Last Change: 2022-09-21
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
let b:current_syntax = "hare"
|
||||
|
||||
" SYNTAX {{{1
|
||||
syn case match
|
||||
|
||||
" KEYWORDS {{{2
|
||||
syn keyword hareConditional if else match switch
|
||||
syn keyword hareKeyword break continue return yield
|
||||
syn keyword hareKeyword defer
|
||||
syn keyword hareKeyword fn
|
||||
syn keyword hareKeyword let
|
||||
syn keyword hareLabel case
|
||||
syn keyword hareOperator as is
|
||||
syn keyword hareRepeat for
|
||||
syn keyword hareStorageClass const def export nullable static
|
||||
syn keyword hareStructure enum struct union
|
||||
syn keyword hareTypedef type
|
||||
|
||||
" C ABI.
|
||||
syn keyword hareKeyword vastart vaarg vaend
|
||||
|
||||
" BUILTINS {{{2
|
||||
syn keyword hareBuiltin abort
|
||||
syn keyword hareBuiltin alloc free
|
||||
syn keyword hareBuiltin append delete insert
|
||||
syn keyword hareBuiltin assert
|
||||
syn keyword hareBuiltin len offset
|
||||
|
||||
" TYPES {{{2
|
||||
syn keyword hareType bool
|
||||
syn keyword hareType char str
|
||||
syn keyword hareType f32 f64
|
||||
syn keyword hareType u8 u16 u32 u64 i8 i16 i32 i64
|
||||
syn keyword hareType uint int
|
||||
syn keyword hareType rune
|
||||
syn keyword hareType uintptr
|
||||
syn keyword hareType void
|
||||
|
||||
" C ABI.
|
||||
syn keyword hareType valist
|
||||
|
||||
" LITERALS {{{2
|
||||
syn keyword hareBoolean true false
|
||||
syn keyword hareNull null
|
||||
|
||||
" Number literals.
|
||||
syn match hareNumber "\v(\.@1<!|\.\.)\zs<\d+([Ee][+-]?\d+)?(z|[iu](8|16|32|64)?)?>" display
|
||||
syn match hareNumber "\v(\.@1<!|\.\.)\zs<0b[01]+(z|[iu](8|16|32|64)?)?>" display
|
||||
syn match hareNumber "\v(\.@1<!|\.\.)\zs<0o\o+(z|[iu](8|16|32|64)?)?>" display
|
||||
syn match hareNumber "\v(\.@1<!|\.\.)\zs<0x\x+(z|[iu](8|16|32|64)?)?>" display
|
||||
|
||||
" Floating-point number literals.
|
||||
syn match hareFloat "\v<\d+\.\d+([Ee][+-]?\d+)?(f32|f64)?>" display
|
||||
syn match hareFloat "\v<\d+([Ee][+-]?\d+)?(f32|f64)>" display
|
||||
|
||||
" String and rune literals.
|
||||
syn match hareEscape "\\[\\'"0abfnrtv]" contained display
|
||||
syn match hareEscape "\v\\(x\x{2}|u\x{4}|U\x{8})" contained display
|
||||
syn match hareFormat "\v\{\d*(\%\d*|(:[ 0+-]?\d*(\.\d+)?[Xbox]?))?}" contained display
|
||||
syn match hareFormat "\({{\|}}\)" contained display
|
||||
syn region hareRune start="'" end="'\|$" skip="\\'" contains=hareEscape display extend
|
||||
syn region hareString start=+"+ end=+"\|$+ skip=+\\"+ contains=hareEscape,hareFormat display extend
|
||||
syn region hareString start="`" end="`\|$" contains=hareFormat display
|
||||
|
||||
" MISCELLANEOUS {{{2
|
||||
syn keyword hareTodo FIXME TODO XXX contained
|
||||
|
||||
" Attributes.
|
||||
syn match hareAttribute "@[a-z]*"
|
||||
|
||||
" Blocks.
|
||||
syn region hareBlock start="{" end="}" fold transparent
|
||||
|
||||
" Comments.
|
||||
syn region hareComment start="//" end="$" contains=hareCommentDoc,hareTodo,@Spell display keepend
|
||||
syn region hareCommentDoc start="\[\[" end="]]\|\ze\_s" contained display
|
||||
|
||||
" The size keyword can be either a builtin or a type.
|
||||
syn match hareBuiltin "\v<size>\ze(\_s*//.*\_$)*\_s*\(" contains=hareComment
|
||||
syn match hareType "\v<size>((\_s*//.*\_$)*\_s*\()@!" contains=hareComment
|
||||
|
||||
" Trailing whitespace.
|
||||
syn match hareSpaceError "\v\s+$" display excludenl
|
||||
syn match hareSpaceError "\v\zs +\ze\t" display
|
||||
|
||||
" Use statement.
|
||||
syn region hareUse start="\v^\s*\zsuse>" end=";" contains=hareComment display
|
||||
|
||||
syn match hareErrorAssertion "\v(^([^/]|//@!)*\)\_s*)@<=!\=@!"
|
||||
syn match hareQuestionMark "?"
|
||||
|
||||
" DEFAULT HIGHLIGHTING {{{1
|
||||
hi def link hareAttribute Keyword
|
||||
hi def link hareBoolean Boolean
|
||||
hi def link hareBuiltin Function
|
||||
hi def link hareComment Comment
|
||||
hi def link hareCommentDoc SpecialComment
|
||||
hi def link hareConditional Conditional
|
||||
hi def link hareEscape SpecialChar
|
||||
hi def link hareFloat Float
|
||||
hi def link hareFormat SpecialChar
|
||||
hi def link hareKeyword Keyword
|
||||
hi def link hareLabel Label
|
||||
hi def link hareNull Constant
|
||||
hi def link hareNumber Number
|
||||
hi def link hareOperator Operator
|
||||
hi def link hareQuestionMark Special
|
||||
hi def link hareRepeat Repeat
|
||||
hi def link hareRune Character
|
||||
hi def link hareStorageClass StorageClass
|
||||
hi def link hareString String
|
||||
hi def link hareStructure Structure
|
||||
hi def link hareTodo Todo
|
||||
hi def link hareType Type
|
||||
hi def link hareTypedef Typedef
|
||||
hi def link hareUse PreProc
|
||||
|
||||
hi def link hareSpaceError Error
|
||||
autocmd InsertEnter * hi link hareSpaceError NONE
|
||||
autocmd InsertLeave * hi link hareSpaceError Error
|
||||
|
||||
hi def hareErrorAssertion ctermfg=red cterm=bold guifg=red gui=bold
|
||||
|
||||
" vim: tabstop=8 shiftwidth=2 expandtab
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim help file
|
||||
" Maintainer: Bram Moolenaar (Bram@vim.org)
|
||||
" Last Change: 2022 May 15
|
||||
" Last Change: 2022 Sep 26
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -44,6 +44,7 @@ syn match helpVim "\<Vim version [0-9][0-9.a-z]*"
|
||||
syn match helpVim "VIM REFERENCE.*"
|
||||
syn match helpOption "'[a-z]\{2,\}'"
|
||||
syn match helpOption "'t_..'"
|
||||
syn match helpNormal "'ab'"
|
||||
syn match helpCommand "`[^` \t]\+`"hs=s+1,he=e-1 contains=helpBacktick
|
||||
syn match helpCommand "\(^\|[^a-z"[]\)\zs`[^`]\+`\ze\([^a-z\t."']\|$\)"hs=s+1,he=e-1 contains=helpBacktick
|
||||
syn match helpHeader "\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore
|
||||
|
||||
120
runtime/syntax/hlsplaylist.vim
Normal file
120
runtime/syntax/hlsplaylist.vim
Normal file
@@ -0,0 +1,120 @@
|
||||
" Vim syntax file
|
||||
" Language: HLS Playlist
|
||||
" Maintainer: Benoît Ryder <benoit@ryder.fr>
|
||||
" Latest Revision: 2022-09-23
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Comment line
|
||||
syn match hlsplaylistComment "^#\(EXT\)\@!.*$"
|
||||
" Segment URL
|
||||
syn match hlsplaylistUrl "^[^#].*$"
|
||||
|
||||
" Unknown tags, assume an attribute list or nothing
|
||||
syn match hlsplaylistTagUnknown "^#EXT[^:]*$"
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagUnknown start="^#EXT[^:]*\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
|
||||
" Basic Tags
|
||||
syn match hlsplaylistTagHeader "^#EXTM3U$"
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagHeader start="^#EXT-X-VERSION\ze:" end="$" keepend contains=hlsplaylistValueInt
|
||||
|
||||
" Media or Multivariant Playlist Tags
|
||||
syn match hlsplaylistTagHeader "^#EXT-X-INDEPENDENT-SEGMENTS$"
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagDelimiter start="^#EXT-X-START\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStandard start="^#EXT-X-DEFINE\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
|
||||
" Media Playlist Tags
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagHeader start="^#EXT-X-TARGETDURATION\ze:" end="$" keepend contains=hlsplaylistValueFloat
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagHeader start="^#EXT-X-MEDIA-SEQUENCE\ze:" end="$" keepend contains=hlsplaylistValueInt
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagHeader start="^#EXT-X-DISCONTINUITY-SEQUENCE\ze:" end="$" keepend contains=hlsplaylistValueInt
|
||||
syn match hlsplaylistTagDelimiter "^#EXT-X-ENDLIST$"
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagHeader start="^#EXT-X-PLAYLIST-TYPE\ze:" end="$" keepend contains=hlsplaylistAttributeEnum
|
||||
syn match hlsplaylistTagStandard "^#EXT-X-I-FRAME-ONLY$"
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagHeader start="^#EXT-X-PART-INF\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagHeader start="^#EXT-X-SERVER-CONTROL\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
|
||||
" Media Segment Tags
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStatement start="^#EXTINF\ze:" end="$" keepend contains=hlsplaylistValueFloat,hlsplaylistExtInfDesc
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStandard start="^#EXT-X-BYTERANGE\ze:" end="$" keepend contains=hlsplaylistValueInt
|
||||
syn match hlsplaylistTagDelimiter "^#EXT-X-DISCONTINUITY$"
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStandard start="^#EXT-X-KEY\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStandard start="^#EXT-X-MAP\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStandard start="^#EXT-X-PROGRAM-DATE-TIME\ze:" end="$" keepend contains=hlsplaylistValueDateTime
|
||||
syn match hlsplaylistTagDelimiter "^#EXT-X-GAP$"
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStandard start="^#EXT-X-BITRATE\ze:" end="$" keepend contains=hlsplaylistValueFloat
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStatement start="^#EXT-X-PART\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
|
||||
" Media Metadata Tags
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStandard start="^#EXT-X-DATERANGE\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStandard start="^#EXT-X-SKIP\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStatement start="^#EXT-X-PRELOAD-HINT\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStatement start="^#EXT-X-RENDITION-REPORT\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
|
||||
" Multivariant Playlist Tags
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStandard start="^#EXT-X-MEDIA\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStatement start="^#EXT-X-STREAM-INF\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStatement start="^#EXT-X-I-FRAME-STREAM-INF\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStandard start="^#EXT-X-SESSION-DATA\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStandard start="^#EXT-X-SESSION-KEY\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
syn region hlsplaylistTagLine matchgroup=hlsplaylistTagStandard start="^#EXT-X-CONTENT-STEERING\ze:" end="$" keepend contains=hlsplaylistAttributeList
|
||||
|
||||
" Attributes
|
||||
syn region hlsplaylistAttributeList start=":" end="$" keepend contained
|
||||
\ contains=hlsplaylistAttributeName,hlsplaylistAttributeInt,hlsplaylistAttributeHex,hlsplaylistAttributeFloat,hlsplaylistAttributeString,hlsplaylistAttributeEnum,hlsplaylistAttributeResolution,hlsplaylistAttributeUri
|
||||
" Common attributes
|
||||
syn match hlsplaylistAttributeName "[A-Za-z-]\+\ze=" contained
|
||||
syn match hlsplaylistAttributeEnum "=\zs[A-Za-z][A-Za-z0-9-_]*" contained
|
||||
syn match hlsplaylistAttributeString +=\zs"[^"]*"+ contained
|
||||
syn match hlsplaylistAttributeInt "=\zs\d\+" contained
|
||||
syn match hlsplaylistAttributeFloat "=\zs-\?\d*\.\d*" contained
|
||||
syn match hlsplaylistAttributeHex "=\zs0[xX]\d*" contained
|
||||
syn match hlsplaylistAttributeResolution "=\zs\d\+x\d\+" contained
|
||||
" Allow different highligting for URI attributes
|
||||
syn region hlsplaylistAttributeUri matchgroup=hlsplaylistAttributeName start="\zsURI\ze" end="\(,\|$\)" contained contains=hlsplaylistUriQuotes
|
||||
syn region hlsplaylistUriQuotes matchgroup=hlsplaylistAttributeString start=+"+ end=+"+ keepend contained contains=hlsplaylistUriValue
|
||||
syn match hlsplaylistUriValue /[^" ]\+/ contained
|
||||
" Individual values
|
||||
syn match hlsplaylistValueInt "[0-9]\+" contained
|
||||
syn match hlsplaylistValueFloat "\(\d\+\|\d*\.\d*\)" contained
|
||||
syn match hlsplaylistExtInfDesc ",\zs.*$" contained
|
||||
syn match hlsplaylistValueDateTime "\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\(\.\d*\)\?\(Z\|\d\d:\?\d\d\)$" contained
|
||||
|
||||
|
||||
" Define default highlighting
|
||||
|
||||
hi def link hlsplaylistComment Comment
|
||||
hi def link hlsplaylistUrl NONE
|
||||
|
||||
hi def link hlsplaylistTagHeader Special
|
||||
hi def link hlsplaylistTagStandard Define
|
||||
hi def link hlsplaylistTagDelimiter Delimiter
|
||||
hi def link hlsplaylistTagStatement Statement
|
||||
hi def link hlsplaylistTagUnknown Special
|
||||
|
||||
hi def link hlsplaylistUriQuotes String
|
||||
hi def link hlsplaylistUriValue Underlined
|
||||
hi def link hlsplaylistAttributeQuotes String
|
||||
hi def link hlsplaylistAttributeName Identifier
|
||||
hi def link hlsplaylistAttributeInt Number
|
||||
hi def link hlsplaylistAttributeHex Number
|
||||
hi def link hlsplaylistAttributeFloat Float
|
||||
hi def link hlsplaylistAttributeString String
|
||||
hi def link hlsplaylistAttributeEnum Constant
|
||||
hi def link hlsplaylistAttributeResolution Constant
|
||||
hi def link hlsplaylistValueInt Number
|
||||
hi def link hlsplaylistValueFloat Float
|
||||
hi def link hlsplaylistExtInfDesc String
|
||||
hi def link hlsplaylistValueDateTime Constant
|
||||
|
||||
|
||||
let b:current_syntax = "hlsplaylist"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: sts=2 sw=2 et
|
||||
@@ -1,11 +1,12 @@
|
||||
" Vim syntax file
|
||||
" Language: Lua 4.0, Lua 5.0, Lua 5.1 and Lua 5.2
|
||||
" Language: Lua 4.0, Lua 5.0, Lua 5.1, Lua 5.2 and Lua 5.3
|
||||
" Maintainer: Marcus Aurelius Farias <masserahguard-lua 'at' yahoo com>
|
||||
" First Author: Carlos Augusto Teixeira Mendes <cmendes 'at' inf puc-rio br>
|
||||
" Last Change: 2022 Mar 31
|
||||
" Last Change: 2022 Sep 07
|
||||
" Options: lua_version = 4 or 5
|
||||
" lua_subversion = 0 (4.0, 5.0) or 1 (5.1) or 2 (5.2)
|
||||
" default 5.2
|
||||
" lua_subversion = 0 (for 4.0 or 5.0)
|
||||
" or 1, 2, 3 (for 5.1, 5.2 or 5.3)
|
||||
" the default is 5.3
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -16,20 +17,98 @@ let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists("lua_version")
|
||||
" Default is lua 5.2
|
||||
" Default is lua 5.3
|
||||
let lua_version = 5
|
||||
let lua_subversion = 2
|
||||
let lua_subversion = 3
|
||||
elseif !exists("lua_subversion")
|
||||
" lua_version exists, but lua_subversion doesn't. So, set it to 0
|
||||
" lua_version exists, but lua_subversion doesn't. In this case set it to 0
|
||||
let lua_subversion = 0
|
||||
endif
|
||||
|
||||
syn case match
|
||||
|
||||
" syncing method
|
||||
syn sync minlines=100
|
||||
syn sync minlines=1000
|
||||
|
||||
" Comments
|
||||
if lua_version >= 5
|
||||
syn keyword luaMetaMethod __add __sub __mul __div __pow __unm __concat
|
||||
syn keyword luaMetaMethod __eq __lt __le
|
||||
syn keyword luaMetaMethod __index __newindex __call
|
||||
syn keyword luaMetaMethod __metatable __mode __gc __tostring
|
||||
endif
|
||||
|
||||
if lua_version > 5 || (lua_version == 5 && lua_subversion >= 1)
|
||||
syn keyword luaMetaMethod __mod __len
|
||||
endif
|
||||
|
||||
if lua_version > 5 || (lua_version == 5 && lua_subversion >= 2)
|
||||
syn keyword luaMetaMethod __pairs
|
||||
endif
|
||||
|
||||
if lua_version > 5 || (lua_version == 5 && lua_subversion >= 3)
|
||||
syn keyword luaMetaMethod __idiv __name
|
||||
syn keyword luaMetaMethod __band __bor __bxor __bnot __shl __shr
|
||||
endif
|
||||
|
||||
if lua_version > 5 || (lua_version == 5 && lua_subversion >= 4)
|
||||
syn keyword luaMetaMethod __close
|
||||
endif
|
||||
|
||||
" catch errors caused by wrong parenthesis and wrong curly brackets or
|
||||
" keywords placed outside their respective blocks
|
||||
|
||||
syn region luaParen transparent start='(' end=')' contains=TOP,luaParenError
|
||||
syn match luaParenError ")"
|
||||
syn match luaError "}"
|
||||
syn match luaError "\<\%(end\|else\|elseif\|then\|until\|in\)\>"
|
||||
|
||||
" Function declaration
|
||||
syn region luaFunctionBlock transparent matchgroup=luaFunction start="\<function\>" end="\<end\>" contains=TOP
|
||||
|
||||
" else
|
||||
syn keyword luaCondElse matchgroup=luaCond contained containedin=luaCondEnd else
|
||||
|
||||
" then ... end
|
||||
syn region luaCondEnd contained transparent matchgroup=luaCond start="\<then\>" end="\<end\>" contains=TOP
|
||||
|
||||
" elseif ... then
|
||||
syn region luaCondElseif contained containedin=luaCondEnd transparent matchgroup=luaCond start="\<elseif\>" end="\<then\>" contains=TOP
|
||||
|
||||
" if ... then
|
||||
syn region luaCondStart transparent matchgroup=luaCond start="\<if\>" end="\<then\>"me=e-4 contains=TOP nextgroup=luaCondEnd skipwhite skipempty
|
||||
|
||||
" do ... end
|
||||
syn region luaBlock transparent matchgroup=luaStatement start="\<do\>" end="\<end\>" contains=TOP
|
||||
" repeat ... until
|
||||
syn region luaRepeatBlock transparent matchgroup=luaRepeat start="\<repeat\>" end="\<until\>" contains=TOP
|
||||
|
||||
" while ... do
|
||||
syn region luaWhile transparent matchgroup=luaRepeat start="\<while\>" end="\<do\>"me=e-2 contains=TOP nextgroup=luaBlock skipwhite skipempty
|
||||
|
||||
" for ... do and for ... in ... do
|
||||
syn region luaFor transparent matchgroup=luaRepeat start="\<for\>" end="\<do\>"me=e-2 contains=TOP nextgroup=luaBlock skipwhite skipempty
|
||||
|
||||
syn keyword luaFor contained containedin=luaFor in
|
||||
|
||||
" other keywords
|
||||
syn keyword luaStatement return local break
|
||||
if lua_version > 5 || (lua_version == 5 && lua_subversion >= 2)
|
||||
syn keyword luaStatement goto
|
||||
syn match luaLabel "::\I\i*::"
|
||||
endif
|
||||
|
||||
" operators
|
||||
syn keyword luaOperator and or not
|
||||
|
||||
if (lua_version == 5 && lua_subversion >= 3) || lua_version > 5
|
||||
syn match luaSymbolOperator "[#<>=~^&|*/%+-]\|\.\{2,3}"
|
||||
elseif lua_version == 5 && (lua_subversion == 1 || lua_subversion == 2)
|
||||
syn match luaSymbolOperator "[#<>=~^*/%+-]\|\.\{2,3}"
|
||||
else
|
||||
syn match luaSymbolOperator "[<>=~^*/+-]\|\.\{2,3}"
|
||||
endif
|
||||
|
||||
" comments
|
||||
syn keyword luaTodo contained TODO FIXME XXX
|
||||
syn match luaComment "--.*$" contains=luaTodo,@Spell
|
||||
if lua_version == 5 && lua_subversion == 0
|
||||
@@ -40,71 +119,25 @@ elseif lua_version > 5 || (lua_version == 5 && lua_subversion >= 1)
|
||||
syn region luaComment matchgroup=luaCommentDelimiter start="--\[\z(=*\)\[" end="\]\z1\]" contains=luaTodo,@Spell
|
||||
endif
|
||||
|
||||
" First line may start with #!
|
||||
" first line may start with #!
|
||||
syn match luaComment "\%^#!.*"
|
||||
|
||||
" catch errors caused by wrong parenthesis and wrong curly brackets or
|
||||
" keywords placed outside their respective blocks
|
||||
syn region luaParen transparent start='(' end=')' contains=ALLBUT,luaParenError,luaTodo,luaSpecial,luaIfThen,luaElseifThen,luaElse,luaThenEnd,luaBlock,luaLoopBlock,luaIn,luaStatement
|
||||
syn region luaTableBlock transparent matchgroup=luaTable start="{" end="}" contains=ALLBUT,luaBraceError,luaTodo,luaSpecial,luaIfThen,luaElseifThen,luaElse,luaThenEnd,luaBlock,luaLoopBlock,luaIn,luaStatement
|
||||
|
||||
syn match luaParenError ")"
|
||||
syn match luaBraceError "}"
|
||||
syn match luaError "\<\%(end\|else\|elseif\|then\|until\|in\)\>"
|
||||
|
||||
" function ... end
|
||||
syn region luaFunctionBlock transparent matchgroup=luaFunction start="\<function\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaThenEnd,luaIn
|
||||
|
||||
" if ... then
|
||||
syn region luaIfThen transparent matchgroup=luaCond start="\<if\>" end="\<then\>"me=e-4 contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaIn nextgroup=luaThenEnd skipwhite skipempty
|
||||
|
||||
" then ... end
|
||||
syn region luaThenEnd contained transparent matchgroup=luaCond start="\<then\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaThenEnd,luaIn
|
||||
|
||||
" elseif ... then
|
||||
syn region luaElseifThen contained transparent matchgroup=luaCond start="\<elseif\>" end="\<then\>" contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaThenEnd,luaIn
|
||||
|
||||
" else
|
||||
syn keyword luaElse contained else
|
||||
|
||||
" do ... end
|
||||
syn region luaBlock transparent matchgroup=luaStatement start="\<do\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaThenEnd,luaIn
|
||||
|
||||
" repeat ... until
|
||||
syn region luaLoopBlock transparent matchgroup=luaRepeat start="\<repeat\>" end="\<until\>" contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaThenEnd,luaIn
|
||||
|
||||
" while ... do
|
||||
syn region luaLoopBlock transparent matchgroup=luaRepeat start="\<while\>" end="\<do\>"me=e-2 contains=ALLBUT,luaTodo,luaSpecial,luaIfThen,luaElseifThen,luaElse,luaThenEnd,luaIn nextgroup=luaBlock skipwhite skipempty
|
||||
|
||||
" for ... do and for ... in ... do
|
||||
syn region luaLoopBlock transparent matchgroup=luaRepeat start="\<for\>" end="\<do\>"me=e-2 contains=ALLBUT,luaTodo,luaSpecial,luaIfThen,luaElseifThen,luaElse,luaThenEnd nextgroup=luaBlock skipwhite skipempty
|
||||
|
||||
syn keyword luaIn contained in
|
||||
|
||||
" other keywords
|
||||
syn keyword luaStatement return local break
|
||||
if lua_version > 5 || (lua_version == 5 && lua_subversion >= 2)
|
||||
syn keyword luaStatement goto
|
||||
syn match luaLabel "::\I\i*::"
|
||||
endif
|
||||
syn keyword luaOperator and or not
|
||||
syn keyword luaConstant nil
|
||||
if lua_version > 4
|
||||
syn keyword luaConstant true false
|
||||
endif
|
||||
|
||||
" Strings
|
||||
if lua_version < 5
|
||||
syn match luaSpecial contained "\\[\\abfnrtv\'\"]\|\\[[:digit:]]\{,3}"
|
||||
elseif lua_version == 5
|
||||
" strings
|
||||
syn match luaSpecial contained #\\[\\abfnrtv'"[\]]\|\\[[:digit:]]\{,3}#
|
||||
if lua_version == 5
|
||||
if lua_subversion == 0
|
||||
syn match luaSpecial contained #\\[\\abfnrtv'"[\]]\|\\[[:digit:]]\{,3}#
|
||||
syn region luaString2 matchgroup=luaStringDelimiter start=+\[\[+ end=+\]\]+ contains=luaString2,@Spell
|
||||
else
|
||||
if lua_subversion == 1
|
||||
syn match luaSpecial contained #\\[\\abfnrtv'"]\|\\[[:digit:]]\{,3}#
|
||||
else " Lua 5.2
|
||||
syn match luaSpecial contained #\\[\\abfnrtvz'"]\|\\x[[:xdigit:]]\{2}\|\\[[:digit:]]\{,3}#
|
||||
if lua_subversion >= 2
|
||||
syn match luaSpecial contained #\\z\|\\x[[:xdigit:]]\{2}#
|
||||
endif
|
||||
if lua_subversion >= 3
|
||||
syn match luaSpecial contained #\\u{[[:xdigit:]]\+}#
|
||||
endif
|
||||
syn region luaString2 matchgroup=luaStringDelimiter start="\[\z(=*\)\[" end="\]\z1\]" contains=@Spell
|
||||
endif
|
||||
@@ -115,7 +148,7 @@ syn region luaString matchgroup=luaStringDelimiter start=+"+ end=+"+ skip=+\\\\\
|
||||
" integer number
|
||||
syn match luaNumber "\<\d\+\>"
|
||||
" floating point number, with dot, optional exponent
|
||||
syn match luaNumber "\<\d\+\.\d*\%([eE][-+]\=\d\+\)\=\>"
|
||||
syn match luaNumber "\<\d\+\.\d*\%([eE][-+]\=\d\+\)\="
|
||||
" floating point number, starting with a dot, optional exponent
|
||||
syn match luaNumber "\.\d\+\%([eE][-+]\=\d\+\)\=\>"
|
||||
" floating point number, without dot, with exponent
|
||||
@@ -130,8 +163,15 @@ if lua_version >= 5
|
||||
endif
|
||||
endif
|
||||
|
||||
" tables
|
||||
syn region luaTableBlock transparent matchgroup=luaTable start="{" end="}" contains=TOP,luaStatement
|
||||
|
||||
" methods
|
||||
syntax match luaFunc ":\@<=\k\+"
|
||||
|
||||
" built-in functions
|
||||
syn keyword luaFunc assert collectgarbage dofile error next
|
||||
syn keyword luaFunc print rawget rawset tonumber tostring type _VERSION
|
||||
syn keyword luaFunc print rawget rawset self tonumber tostring type _VERSION
|
||||
|
||||
if lua_version == 4
|
||||
syn keyword luaFunc _ALERT _ERRORMESSAGE gcinfo
|
||||
@@ -168,30 +208,26 @@ elseif lua_version == 5
|
||||
syn match luaFunc /\<package\.loaded\>/
|
||||
syn match luaFunc /\<package\.loadlib\>/
|
||||
syn match luaFunc /\<package\.path\>/
|
||||
syn match luaFunc /\<package\.preload\>/
|
||||
if lua_subversion == 1
|
||||
syn keyword luaFunc getfenv setfenv
|
||||
syn keyword luaFunc loadstring module unpack
|
||||
syn match luaFunc /\<package\.loaders\>/
|
||||
syn match luaFunc /\<package\.preload\>/
|
||||
syn match luaFunc /\<package\.seeall\>/
|
||||
elseif lua_subversion == 2
|
||||
elseif lua_subversion >= 2
|
||||
syn keyword luaFunc _ENV rawlen
|
||||
syn match luaFunc /\<package\.config\>/
|
||||
syn match luaFunc /\<package\.preload\>/
|
||||
syn match luaFunc /\<package\.searchers\>/
|
||||
syn match luaFunc /\<package\.searchpath\>/
|
||||
syn match luaFunc /\<bit32\.arshift\>/
|
||||
syn match luaFunc /\<bit32\.band\>/
|
||||
syn match luaFunc /\<bit32\.bnot\>/
|
||||
syn match luaFunc /\<bit32\.bor\>/
|
||||
syn match luaFunc /\<bit32\.btest\>/
|
||||
syn match luaFunc /\<bit32\.bxor\>/
|
||||
syn match luaFunc /\<bit32\.extract\>/
|
||||
syn match luaFunc /\<bit32\.lrotate\>/
|
||||
syn match luaFunc /\<bit32\.lshift\>/
|
||||
syn match luaFunc /\<bit32\.replace\>/
|
||||
syn match luaFunc /\<bit32\.rrotate\>/
|
||||
syn match luaFunc /\<bit32\.rshift\>/
|
||||
endif
|
||||
|
||||
if lua_subversion >= 3
|
||||
syn match luaFunc /\<coroutine\.isyieldable\>/
|
||||
endif
|
||||
if lua_subversion >= 4
|
||||
syn keyword luaFunc warn
|
||||
syn match luaFunc /\<coroutine\.close\>/
|
||||
endif
|
||||
syn match luaFunc /\<coroutine\.running\>/
|
||||
endif
|
||||
@@ -200,6 +236,7 @@ elseif lua_version == 5
|
||||
syn match luaFunc /\<coroutine\.status\>/
|
||||
syn match luaFunc /\<coroutine\.wrap\>/
|
||||
syn match luaFunc /\<coroutine\.yield\>/
|
||||
|
||||
syn match luaFunc /\<string\.byte\>/
|
||||
syn match luaFunc /\<string\.char\>/
|
||||
syn match luaFunc /\<string\.dump\>/
|
||||
@@ -218,6 +255,18 @@ elseif lua_version == 5
|
||||
syn match luaFunc /\<string\.match\>/
|
||||
syn match luaFunc /\<string\.reverse\>/
|
||||
endif
|
||||
if lua_subversion >= 3
|
||||
syn match luaFunc /\<string\.pack\>/
|
||||
syn match luaFunc /\<string\.packsize\>/
|
||||
syn match luaFunc /\<string\.unpack\>/
|
||||
syn match luaFunc /\<utf8\.char\>/
|
||||
syn match luaFunc /\<utf8\.charpattern\>/
|
||||
syn match luaFunc /\<utf8\.codes\>/
|
||||
syn match luaFunc /\<utf8\.codepoint\>/
|
||||
syn match luaFunc /\<utf8\.len\>/
|
||||
syn match luaFunc /\<utf8\.offset\>/
|
||||
endif
|
||||
|
||||
if lua_subversion == 0
|
||||
syn match luaFunc /\<table\.getn\>/
|
||||
syn match luaFunc /\<table\.setn\>/
|
||||
@@ -225,19 +274,40 @@ elseif lua_version == 5
|
||||
syn match luaFunc /\<table\.foreachi\>/
|
||||
elseif lua_subversion == 1
|
||||
syn match luaFunc /\<table\.maxn\>/
|
||||
elseif lua_subversion == 2
|
||||
elseif lua_subversion >= 2
|
||||
syn match luaFunc /\<table\.pack\>/
|
||||
syn match luaFunc /\<table\.unpack\>/
|
||||
if lua_subversion >= 3
|
||||
syn match luaFunc /\<table\.move\>/
|
||||
endif
|
||||
endif
|
||||
syn match luaFunc /\<table\.concat\>/
|
||||
syn match luaFunc /\<table\.sort\>/
|
||||
syn match luaFunc /\<table\.insert\>/
|
||||
syn match luaFunc /\<table\.sort\>/
|
||||
syn match luaFunc /\<table\.remove\>/
|
||||
|
||||
if lua_subversion == 2
|
||||
syn match luaFunc /\<bit32\.arshift\>/
|
||||
syn match luaFunc /\<bit32\.band\>/
|
||||
syn match luaFunc /\<bit32\.bnot\>/
|
||||
syn match luaFunc /\<bit32\.bor\>/
|
||||
syn match luaFunc /\<bit32\.btest\>/
|
||||
syn match luaFunc /\<bit32\.bxor\>/
|
||||
syn match luaFunc /\<bit32\.extract\>/
|
||||
syn match luaFunc /\<bit32\.lrotate\>/
|
||||
syn match luaFunc /\<bit32\.lshift\>/
|
||||
syn match luaFunc /\<bit32\.replace\>/
|
||||
syn match luaFunc /\<bit32\.rrotate\>/
|
||||
syn match luaFunc /\<bit32\.rshift\>/
|
||||
endif
|
||||
|
||||
syn match luaFunc /\<math\.abs\>/
|
||||
syn match luaFunc /\<math\.acos\>/
|
||||
syn match luaFunc /\<math\.asin\>/
|
||||
syn match luaFunc /\<math\.atan\>/
|
||||
syn match luaFunc /\<math\.atan2\>/
|
||||
if lua_subversion < 3
|
||||
syn match luaFunc /\<math\.atan2\>/
|
||||
endif
|
||||
syn match luaFunc /\<math\.ceil\>/
|
||||
syn match luaFunc /\<math\.sin\>/
|
||||
syn match luaFunc /\<math\.cos\>/
|
||||
@@ -251,25 +321,36 @@ elseif lua_version == 5
|
||||
if lua_subversion == 0
|
||||
syn match luaFunc /\<math\.mod\>/
|
||||
syn match luaFunc /\<math\.log10\>/
|
||||
else
|
||||
if lua_subversion == 1
|
||||
syn match luaFunc /\<math\.log10\>/
|
||||
endif
|
||||
elseif lua_subversion == 1
|
||||
syn match luaFunc /\<math\.log10\>/
|
||||
endif
|
||||
if lua_subversion >= 1
|
||||
syn match luaFunc /\<math\.huge\>/
|
||||
syn match luaFunc /\<math\.fmod\>/
|
||||
syn match luaFunc /\<math\.modf\>/
|
||||
syn match luaFunc /\<math\.cosh\>/
|
||||
syn match luaFunc /\<math\.sinh\>/
|
||||
syn match luaFunc /\<math\.tanh\>/
|
||||
if lua_subversion == 1 || lua_subversion == 2
|
||||
syn match luaFunc /\<math\.cosh\>/
|
||||
syn match luaFunc /\<math\.sinh\>/
|
||||
syn match luaFunc /\<math\.tanh\>/
|
||||
endif
|
||||
endif
|
||||
syn match luaFunc /\<math\.pow\>/
|
||||
syn match luaFunc /\<math\.rad\>/
|
||||
syn match luaFunc /\<math\.sqrt\>/
|
||||
syn match luaFunc /\<math\.frexp\>/
|
||||
syn match luaFunc /\<math\.ldexp\>/
|
||||
if lua_subversion < 3
|
||||
syn match luaFunc /\<math\.pow\>/
|
||||
syn match luaFunc /\<math\.frexp\>/
|
||||
syn match luaFunc /\<math\.ldexp\>/
|
||||
else
|
||||
syn match luaFunc /\<math\.maxinteger\>/
|
||||
syn match luaFunc /\<math\.mininteger\>/
|
||||
syn match luaFunc /\<math\.tointeger\>/
|
||||
syn match luaFunc /\<math\.type\>/
|
||||
syn match luaFunc /\<math\.ult\>/
|
||||
endif
|
||||
syn match luaFunc /\<math\.random\>/
|
||||
syn match luaFunc /\<math\.randomseed\>/
|
||||
syn match luaFunc /\<math\.pi\>/
|
||||
|
||||
syn match luaFunc /\<io\.close\>/
|
||||
syn match luaFunc /\<io\.flush\>/
|
||||
syn match luaFunc /\<io\.input\>/
|
||||
@@ -284,6 +365,7 @@ elseif lua_version == 5
|
||||
syn match luaFunc /\<io\.tmpfile\>/
|
||||
syn match luaFunc /\<io\.type\>/
|
||||
syn match luaFunc /\<io\.write\>/
|
||||
|
||||
syn match luaFunc /\<os\.clock\>/
|
||||
syn match luaFunc /\<os\.date\>/
|
||||
syn match luaFunc /\<os\.difftime\>/
|
||||
@@ -295,6 +377,7 @@ elseif lua_version == 5
|
||||
syn match luaFunc /\<os\.setlocale\>/
|
||||
syn match luaFunc /\<os\.time\>/
|
||||
syn match luaFunc /\<os\.tmpname\>/
|
||||
|
||||
syn match luaFunc /\<debug\.debug\>/
|
||||
syn match luaFunc /\<debug\.gethook\>/
|
||||
syn match luaFunc /\<debug\.getinfo\>/
|
||||
@@ -307,26 +390,20 @@ elseif lua_version == 5
|
||||
if lua_subversion == 1
|
||||
syn match luaFunc /\<debug\.getfenv\>/
|
||||
syn match luaFunc /\<debug\.setfenv\>/
|
||||
syn match luaFunc /\<debug\.getmetatable\>/
|
||||
syn match luaFunc /\<debug\.setmetatable\>/
|
||||
syn match luaFunc /\<debug\.getregistry\>/
|
||||
elseif lua_subversion == 2
|
||||
syn match luaFunc /\<debug\.getmetatable\>/
|
||||
syn match luaFunc /\<debug\.setmetatable\>/
|
||||
syn match luaFunc /\<debug\.getregistry\>/
|
||||
syn match luaFunc /\<debug\.getuservalue\>/
|
||||
syn match luaFunc /\<debug\.setuservalue\>/
|
||||
syn match luaFunc /\<debug\.upvalueid\>/
|
||||
syn match luaFunc /\<debug\.upvaluejoin\>/
|
||||
endif
|
||||
if lua_subversion >= 3
|
||||
"https://www.lua.org/manual/5.3/manual.html#6.5
|
||||
syn match luaFunc /\<utf8\.char\>/
|
||||
syn match luaFunc /\<utf8\.charpattern\>/
|
||||
syn match luaFunc /\<utf8\.codes\>/
|
||||
syn match luaFunc /\<utf8\.codepoint\>/
|
||||
syn match luaFunc /\<utf8\.len\>/
|
||||
syn match luaFunc /\<utf8\.offset\>/
|
||||
if lua_subversion >= 1
|
||||
syn match luaFunc /\<debug\.getmetatable\>/
|
||||
syn match luaFunc /\<debug\.setmetatable\>/
|
||||
syn match luaFunc /\<debug\.getregistry\>/
|
||||
if lua_subversion >= 2
|
||||
syn match luaFunc /\<debug\.getuservalue\>/
|
||||
syn match luaFunc /\<debug\.setuservalue\>/
|
||||
syn match luaFunc /\<debug\.upvalueid\>/
|
||||
syn match luaFunc /\<debug\.upvaluejoin\>/
|
||||
endif
|
||||
if lua_subversion >= 4
|
||||
syn match luaFunc /\<debug.setcstacklimit\>/
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -341,18 +418,18 @@ hi def link luaString2 String
|
||||
hi def link luaStringDelimiter luaString
|
||||
hi def link luaNumber Number
|
||||
hi def link luaOperator Operator
|
||||
hi def link luaIn Operator
|
||||
hi def link luaSymbolOperator luaOperator
|
||||
hi def link luaConstant Constant
|
||||
hi def link luaCond Conditional
|
||||
hi def link luaElse Conditional
|
||||
hi def link luaCondElse Conditional
|
||||
hi def link luaFunction Function
|
||||
hi def link luaMetaMethod Function
|
||||
hi def link luaComment Comment
|
||||
hi def link luaCommentDelimiter luaComment
|
||||
hi def link luaTodo Todo
|
||||
hi def link luaTable Structure
|
||||
hi def link luaError Error
|
||||
hi def link luaParenError Error
|
||||
hi def link luaBraceError Error
|
||||
hi def link luaSpecial SpecialChar
|
||||
hi def link luaFunc Identifier
|
||||
hi def link luaLabel Label
|
||||
|
||||
43
runtime/syntax/lyrics.vim
Normal file
43
runtime/syntax/lyrics.vim
Normal file
@@ -0,0 +1,43 @@
|
||||
" Vim syntax file
|
||||
" Language: LyRiCs
|
||||
" Maintainer: ObserverOfTime <chronobserver@disroot.org>
|
||||
" Filenames: *.lrc
|
||||
" Last Change: 2022 Sep 18
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
syn case ignore
|
||||
|
||||
" Errors
|
||||
syn match lrcError /^.\+$/
|
||||
|
||||
" ID tags
|
||||
syn match lrcTag /^\s*\[\a\+:.\+\]\s*$/ contains=lrcTagName,lrcTagValue
|
||||
syn match lrcTagName contained nextgroup=lrcTagValue
|
||||
\ /\[\zs\(al\|ar\|au\|by\|encoding\|la\|id\|length\|offset\|re\|ti\|ve\)\ze:/
|
||||
syn match lrcTagValue /:\zs.\+\ze\]/ contained
|
||||
|
||||
" Lyrics
|
||||
syn match lrcLyricTime /^\s*\[\d\d:\d\d\.\d\d\]/
|
||||
\ contains=lrcNumber nextgroup=lrcLyricLine
|
||||
syn match lrcLyricLine /.*$/ contained contains=lrcWordTime,@Spell
|
||||
syn match lrcWordTime /<\d\d:\d\d\.\d\d>/ contained contains=lrcNumber,@NoSpell
|
||||
syn match lrcNumber /[+-]\=\d\+/ contained
|
||||
|
||||
hi def link lrcLyricTime Label
|
||||
hi def link lrcNumber Number
|
||||
hi def link lrcTag PreProc
|
||||
hi def link lrcTagName Identifier
|
||||
hi def link lrcTagValue String
|
||||
hi def link lrcWordTime Special
|
||||
hi def link lrcError Error
|
||||
|
||||
let b:current_syntax = 'lyrics'
|
||||
|
||||
let &cpoptions = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -4,8 +4,11 @@
|
||||
" Previous Maintainer: Jeff Lanzarotta (jefflanzarotta at yahoo dot com)
|
||||
" Previous Maintainer: C. Laurence Gonsalves (clgonsal@kami.com)
|
||||
" URL: https://github.com/lee-lindley/vim_plsql_syntax
|
||||
" Last Change: Aug 21, 2022
|
||||
" History Lee Lindley (lee dot lindley at gmail dot com)
|
||||
" Last Change: Sep 19, 2022
|
||||
" History Carsten Czarski (carsten dot czarski at oracle com)
|
||||
" add handling for typical SQL*Plus commands (rem, start, host, set, etc)
|
||||
" add error highlight for non-breaking space
|
||||
" Lee Lindley (lee dot lindley at gmail dot com)
|
||||
" use get with default 0 instead of exists per Bram suggestion
|
||||
" make procedure folding optional
|
||||
" updated to 19c keywords. refined quoting.
|
||||
@@ -54,8 +57,13 @@ syn case ignore
|
||||
|
||||
syn match plsqlGarbage "[^ \t()]"
|
||||
syn match plsqlIdentifier "[a-z][a-z0-9$_#]*"
|
||||
syn match plsqlSqlPlusDefine "&&\?[a-z][a-z0-9$_#]*\.\?"
|
||||
syn match plsqlHostIdentifier ":[a-z][a-z0-9$_#]*"
|
||||
|
||||
" The Non-Breaking is often accidentally typed (Mac User: Opt+Space, after typing the "|", Opt+7);
|
||||
" error highlight for these avoids running into annoying compiler errors.
|
||||
syn match plsqlIllegalSpace "[\xa0]"
|
||||
|
||||
" When wanted, highlight the trailing whitespace.
|
||||
if get(g:,"plsql_space_errors",0) == 1
|
||||
if get(g:,"plsql_no_trail_space_error",0) == 0
|
||||
@@ -79,7 +87,6 @@ syn match plsqlOperator "\<IS\\_s\+\(NOT\_s\+\)\?NULL\>"
|
||||
"
|
||||
" conditional compilation Preprocessor directives and sqlplus define sigil
|
||||
syn match plsqlPseudo "$[$a-z][a-z0-9$_#]*"
|
||||
syn match plsqlPseudo "&"
|
||||
|
||||
syn match plsqlReserved "\<\(CREATE\|THEN\|UPDATE\|INSERT\|SET\)\>"
|
||||
syn match plsqlKeyword "\<\(REPLACE\|PACKAGE\|FUNCTION\|PROCEDURE\|TYPE|BODY\|WHEN\|MATCHED\)\>"
|
||||
@@ -150,7 +157,7 @@ syn keyword plsqlKeyword DATA_SECURITY_REWRITE_LIMIT DATA_VALIDATE DATE_MODE DAY
|
||||
syn keyword plsqlKeyword DBMS_STATS DBSTR2UTF8 DBTIMEZONE DB_ROLE_CHANGE DB_UNIQUE_NAME DB_VERSION
|
||||
syn keyword plsqlKeyword DDL DEALLOCATE DEBUG DEBUGGER DECLARE DECODE DECOMPOSE DECOMPRESS DECORRELATE
|
||||
syn keyword plsqlKeyword DECR DECREMENT DECRYPT DEDUPLICATE DEFAULTS DEFAULT_COLLATION DEFAULT_PDB_HINT
|
||||
syn keyword plsqlKeyword DEFERRABLE DEFERRED DEFINE DEFINED DEFINER DEFINITION DEGREE DELAY DELEGATE
|
||||
syn keyword plsqlKeyword DEFERRABLE DEFERRED DEFINED DEFINER DEFINITION DEGREE DELAY DELEGATE
|
||||
syn keyword plsqlKeyword DELETEXML DELETE_ALL DEMAND DENORM_AV DENSE_RANK DENSE_RANKM DEPENDENT DEPTH
|
||||
syn keyword plsqlKeyword DEQUEUE DEREF DEREF_NO_REWRITE DESCENDANT DESCRIPTION DESTROY DETACHED DETERMINED
|
||||
syn keyword plsqlKeyword DETERMINES DETERMINISTIC DG_GATHER_STATS DIAGNOSTICS DICTIONARY DIGEST DIMENSION
|
||||
@@ -189,7 +196,7 @@ syn keyword plsqlKeyword HELP HEXTORAW HEXTOREF HIDDEN HIDE HIERARCHICAL HIERARC
|
||||
syn keyword plsqlKeyword HIER_CAPTION HIER_CHILDREN HIER_CHILD_COUNT HIER_COLUMN HIER_CONDITION HIER_DEPTH
|
||||
syn keyword plsqlKeyword HIER_DESCRIPTION HIER_HAS_CHILDREN HIER_LAG HIER_LEAD HIER_LEVEL HIER_MEMBER_NAME
|
||||
syn keyword plsqlKeyword HIER_MEMBER_UNIQUE_NAME HIER_ORDER HIER_PARENT HIER_WINDOW HIGH HINTSET_BEGIN
|
||||
syn keyword plsqlKeyword HINTSET_END HOST HOT HOUR HOURS HTTP HWM_BROKERED HYBRID ID IDENTIFIER IDENTITY
|
||||
syn keyword plsqlKeyword HINTSET_END HOT HOUR HOURS HTTP HWM_BROKERED HYBRID ID IDENTIFIER IDENTITY
|
||||
syn keyword plsqlKeyword IDGENERATORS IDLE IDLE_TIME IGNORE IGNORE_OPTIM_EMBEDDED_HINTS IGNORE_ROW_ON_DUPKEY_INDEX
|
||||
syn keyword plsqlKeyword IGNORE_WHERE_CLAUSE ILM IMMEDIATE IMMUTABLE IMPACT IMPORT INACTIVE INACTIVE_ACCOUNT_TIME
|
||||
syn keyword plsqlKeyword INCLUDE INCLUDES INCLUDE_VERSION INCLUDING INCOMING INCR INCREMENT INCREMENTAL
|
||||
@@ -342,7 +349,7 @@ syn keyword plsqlKeyword SELF SEMIJOIN SEMIJOIN_DRIVER SEMI_TO_INNER SENSITIVE S
|
||||
syn keyword plsqlKeyword SERIAL SERIALIZABLE SERVERERROR SERVICE SERVICES SERVICE_NAME_CONVERT SESSION
|
||||
syn keyword plsqlKeyword SESSIONS_PER_USER SESSIONTIMEZONE SESSIONTZNAME SESSION_CACHED_CURSORS SETS
|
||||
syn keyword plsqlKeyword SETTINGS SET_GBY_PUSHDOWN SET_TO_JOIN SEVERE SHARD SHARDED SHARDS SHARDSPACE
|
||||
syn keyword plsqlKeyword SHARD_CHUNK_ID SHARED SHARED_POOL SHARE_OF SHARING SHD$COL$MAP SHELFLIFE SHOW
|
||||
syn keyword plsqlKeyword SHARD_CHUNK_ID SHARED SHARED_POOL SHARE_OF SHARING SHD$COL$MAP SHELFLIFE
|
||||
syn keyword plsqlKeyword SHRINK SHUTDOWN SIBLING SIBLINGS SID SIGN SIGNAL_COMPONENT SIGNAL_FUNCTION
|
||||
syn keyword plsqlKeyword SIGNATURE SIMPLE SIN SINGLE SINGLETASK SINH SITE SKEWNESS_POP SKEWNESS_SAMP
|
||||
syn keyword plsqlKeyword SKIP SKIP_EXT_OPTIMIZER SKIP_PROXY SKIP_UNQ_UNUSABLE_IDX SKIP_UNUSABLE_INDEXES
|
||||
@@ -445,7 +452,7 @@ syn keyword plsqlKeyword VECTOR_READ_TRACE VECTOR_TRANSFORM VECTOR_TRANSFORM_DIM
|
||||
syn keyword plsqlKeyword VERIFIER VERIFY VERSION VERSIONING VERSIONS VERSIONS_ENDSCN VERSIONS_ENDTIME
|
||||
syn keyword plsqlKeyword VERSIONS_OPERATION VERSIONS_STARTSCN VERSIONS_STARTTIME VERSIONS_XID VIEWS
|
||||
syn keyword plsqlKeyword VIOLATION VIRTUAL VISIBILITY VISIBLE VOLUME VSIZE WAIT WALLET WEEK WEEKS WELLFORMED
|
||||
syn keyword plsqlKeyword WHENEVER WHITESPACE WIDTH_BUCKET WINDOW WITHIN WITHOUT WITH_EXPRESSION
|
||||
syn keyword plsqlKeyword WHITESPACE WIDTH_BUCKET WINDOW WITHIN WITHOUT WITH_EXPRESSION
|
||||
syn keyword plsqlKeyword WITH_PLSQL WORK WRAPPED WRAPPER WRITE XDB_FASTPATH_INSERT XID XML XML2OBJECT
|
||||
syn keyword plsqlKeyword XMLATTRIBUTES XMLCAST XMLCDATA XMLCOLATTVAL XMLCOMMENT XMLCONCAT XMLDIFF XMLELEMENT
|
||||
syn keyword plsqlKeyword XMLEXISTS XMLEXISTS2 XMLFOREST XMLINDEX_REWRITE XMLINDEX_REWRITE_IN_SELECT
|
||||
@@ -468,13 +475,13 @@ syn keyword plsqlReserved MINUS MODE NOCOMPRESS NOWAIT NUMBER_BASE OCICOLL OCIDA
|
||||
syn keyword plsqlReserved OCIDURATION OCIINTERVAL OCILOBLOCATOR OCINUMBER OCIRAW OCIREF OCIREFCURSOR
|
||||
syn keyword plsqlReserved OCIROWID OCISTRING OCITYPE OF ON OPTION ORACLE ORADATA ORDER ORLANY ORLVARY
|
||||
syn keyword plsqlReserved OUT OVERRIDING PARALLEL_ENABLE PARAMETER PASCAL PCTFREE PIPE PIPELINED POLYMORPHIC
|
||||
syn keyword plsqlReserved PRAGMA PRIOR PUBLIC RAISE RECORD RELIES_ON REM RENAME RESOURCE RESULT REVOKE ROWID
|
||||
syn keyword plsqlReserved PRAGMA PRIOR PUBLIC RAISE RECORD RELIES_ON RENAME RESOURCE RESULT REVOKE ROWID
|
||||
syn keyword plsqlReserved SB1 SB2
|
||||
syn match plsqlReserved "\<SELECT\>"
|
||||
syn keyword plsqlReserved SEPARATE SHARE SHORT SIZE SIZE_T SPARSE SQLCODE SQLDATA
|
||||
syn keyword plsqlReserved SQLNAME SQLSTATE STANDARD START STORED STRUCT STYLE SYNONYM TABLE TDO
|
||||
syn keyword plsqlReserved TRANSACTIONAL TRIGGER UB1 UB4 UNION UNIQUE UNSIGNED UNTRUSTED VALIST
|
||||
syn keyword plsqlReserved VALUES VARIABLE VIEW VOID WHERE WITH
|
||||
syn keyword plsqlReserved VALUES VIEW VOID WHERE WITH
|
||||
|
||||
" PL/SQL and SQL functions.
|
||||
syn keyword plsqlFunction ABS ACOS ADD_MONTHS APPROX_COUNT APPROX_COUNT_DISTINCT APPROX_COUNT_DISTINCT_AGG
|
||||
@@ -584,18 +591,18 @@ syn match plsqlEND "\<END\>"
|
||||
syn match plsqlISAS "\<\(IS\|AS\)\>"
|
||||
|
||||
" Various types of comments.
|
||||
syntax region plsqlCommentL start="--" skip="\\$" end="$" keepend extend contains=@plsqlCommentGroup,plsqlSpaceError
|
||||
syntax region plsqlCommentL start="--" skip="\\$" end="$" keepend extend contains=@plsqlCommentGroup,plsqlSpaceError,plsqlIllegalSpace,plsqlSqlplusDefine
|
||||
if get(g:,"plsql_fold",0) == 1
|
||||
syntax region plsqlComment
|
||||
\ start="/\*" end="\*/"
|
||||
\ extend
|
||||
\ contains=@plsqlCommentGroup,plsqlSpaceError
|
||||
\ contains=@plsqlCommentGroup,plsqlSpaceError,plsqlIllegalSpace,plsqlSqlplusDefine
|
||||
\ fold
|
||||
else
|
||||
syntax region plsqlComment
|
||||
\ start="/\*" end="\*/"
|
||||
\ extend
|
||||
\ contains=@plsqlCommentGroup,plsqlSpaceError
|
||||
\ contains=@plsqlCommentGroup,plsqlSpaceError,plsqlIllegalSpace,plsqlSqlplusDefine
|
||||
endif
|
||||
syn cluster plsqlCommentAll contains=plsqlCommentL,plsqlComment
|
||||
|
||||
@@ -618,23 +625,23 @@ syn match plsqlFloatLiteral contained "\.\(\d\+\([eE][+-]\?\d\+\)\?\)[fd]\?"
|
||||
" double quoted strings in SQL are database object names. Should be a subgroup of Normal.
|
||||
" We will use Character group as a proxy for that so color can be chosen close to Normal
|
||||
syn region plsqlQuotedIdentifier matchgroup=plsqlOperator start=+n\?"+ end=+"+ keepend extend
|
||||
syn cluster plsqlIdentifiers contains=plsqlIdentifier,plsqlQuotedIdentifier
|
||||
syn cluster plsqlIdentifiers contains=plsqlIdentifier,plsqlQuotedIdentifier,plsqlSqlPlusDefine
|
||||
|
||||
" quoted string literals
|
||||
if get(g:,"plsql_fold",0) == 1
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?'+ skip=+''+ end=+'+ fold keepend extend
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'\z([^[(<{]\)+ end=+\z1'+ fold keepend extend
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'<+ end=+>'+ fold keepend extend
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'{+ end=+}'+ fold keepend extend
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'(+ end=+)'+ fold keepend extend
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'\[+ end=+]'+ fold keepend extend
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?'+ skip=+''+ end=+'+ contains=plsqlSqlplusDefine fold keepend extend
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'\z([^[(<{]\)+ end=+\z1'+ contains=plsqlSqlplusDefine fold keepend extend
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'<+ end=+>'+ contains=plsqlSqlplusDefine fold keepend extend
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'{+ end=+}'+ contains=plsqlSqlplusDefine fold keepend extend
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'(+ end=+)'+ contains=plsqlSqlplusDefine fold keepend extend
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'\[+ end=+]'+ contains=plsqlSqlplusDefine fold keepend extend
|
||||
else
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?'+ skip=+''+ end=+'+
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'\z([^[(<{]\)+ end=+\z1'+
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'<+ end=+>'+
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'{+ end=+}'+
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'(+ end=+)'+
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'\[+ end=+]'+
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?'+ skip=+''+ end=+'+ contains=plsqlSqlplusDefine
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'\z([^[(<{]\)+ end=+\z1'+ contains=plsqlSqlplusDefine
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'<+ end=+>'+ contains=plsqlSqlplusDefine
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'{+ end=+}'+ contains=plsqlSqlplusDefine
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'(+ end=+)'+ contains=plsqlSqlplusDefine
|
||||
syn region plsqlStringLiteral matchgroup=plsqlOperator start=+n\?q'\[+ end=+]'+ contains=plsqlSqlplusDefine
|
||||
endif
|
||||
|
||||
syn keyword plsqlBooleanLiteral TRUE FALSE
|
||||
@@ -682,6 +689,10 @@ syn match plsqlConditional "\<END\>\_s\+\<IF\>"
|
||||
syn match plsqlCase "\<END\>\_s\+\<CASE\>"
|
||||
syn match plsqlCase "\<CASE\>"
|
||||
|
||||
syn region plsqlSqlPlusCommentL start="^\(REM\)\( \|$\)" skip="\\$" end="$" keepend extend contains=@plsqlCommentGroup,plsqlSpaceError,plsqlIllegalSpace
|
||||
syn region plsqlSqlPlusCommand start="^\(SET\|DEFINE\|PROMPT\|ACCEPT\|EXEC\|HOST\|SHOW\|VAR\|VARIABLE\|COL\|WHENEVER\|TIMING\)\( \|$\)" skip="\\$" end="$" keepend extend
|
||||
syn region plsqlSqlPlusRunFile start="^\(@\|@@\)" skip="\\$" end="$" keepend extend
|
||||
|
||||
if get(g:,"plsql_fold",0) == 1
|
||||
setlocal foldmethod=syntax
|
||||
syn sync fromstart
|
||||
@@ -826,6 +837,13 @@ hi def link plsqlComment2String String
|
||||
hi def link plsqlTrigger Function
|
||||
hi def link plsqlTypeAttribute StorageClass
|
||||
hi def link plsqlTodo Todo
|
||||
|
||||
hi def link plsqlIllegalSpace Error
|
||||
hi def link plsqlSqlPlusDefine PreProc
|
||||
hi def link plsqlSqlPlusCommand PreProc
|
||||
hi def link plsqlSqlPlusRunFile Include
|
||||
hi def link plsqlSqlPlusCommentL Comment
|
||||
|
||||
" to be able to change them after loading, need override whether defined or not
|
||||
if get(g:,"plsql_legacy_sql_keywords",0) == 1
|
||||
hi link plsqlSQLKeyword Function
|
||||
|
||||
173
runtime/syntax/solidity.vim
Normal file
173
runtime/syntax/solidity.vim
Normal file
@@ -0,0 +1,173 @@
|
||||
" Vim syntax file
|
||||
" Language: Solidity
|
||||
" Maintainer: Cothi (jiungdev@gmail.com)
|
||||
" Original Author: tomlion (https://github.com/tomlion/vim-solidity/blob/master/syntax/solidity.vim)
|
||||
" Last Changed: 2022 Sep 27
|
||||
"
|
||||
" Additional contributors:
|
||||
" Modified by thesis (https://github.com/thesis/vim-solidity/blob/main/indent/solidity.vim)
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" keyword
|
||||
syn keyword solKeyword abstract anonymous as break calldata case catch constant constructor continue default switch revert require
|
||||
syn keyword solKeyword ecrecover addmod mulmod keccak256
|
||||
syn keyword solKeyword delete do else emit enum external final for function if immutable import in indexed inline
|
||||
syn keyword solKeyword interface internal is let match memory modifier new of payable pragma private public pure override virtual
|
||||
syn keyword solKeyword relocatable return returns static storage struct throw try type typeof using
|
||||
syn keyword solKeyword var view while
|
||||
|
||||
syn keyword solConstant true false wei szabo finney ether seconds minutes hours days weeks years now
|
||||
syn keyword solConstant abi block blockhash msg tx this super selfdestruct
|
||||
|
||||
syn keyword solBuiltinType mapping address bool
|
||||
syn keyword solBuiltinType int int8 int16 int24 int32 int40 int48 int56 int64 int72 int80 int88 int96 int104 int112 int120 int128 int136 int144 int152 int160 int168 int178 int184 int192 int200 int208 int216 int224 int232 int240 int248 int256
|
||||
syn keyword solBuiltinType uint uint8 uint16 uint24 uint32 uint40 uint48 uint56 uint64 uint72 uint80 uint88 uint96 uint104 uint112 uint120 uint128 uint136 uint144 uint152 uint160 uint168 uint178 uint184 uint192 uint200 uint208 uint216 uint224 uint232 uint240 uint248 uint256
|
||||
syn keyword solBuiltinType fixed
|
||||
syn keyword solBuiltinType fixed0x8 fixed0x16 fixed0x24 fixed0x32 fixed0x40 fixed0x48 fixed0x56 fixed0x64 fixed0x72 fixed0x80 fixed0x88 fixed0x96 fixed0x104 fixed0x112 fixed0x120 fixed0x128 fixed0x136 fixed0x144 fixed0x152 fixed0x160 fixed0x168 fixed0x178 fixed0x184 fixed0x192 fixed0x200 fixed0x208 fixed0x216 fixed0x224 fixed0x232 fixed0x240 fixed0x248 fixed0x256
|
||||
syn keyword solBuiltinType fixed8x8 fixed8x16 fixed8x24 fixed8x32 fixed8x40 fixed8x48 fixed8x56 fixed8x64 fixed8x72 fixed8x80 fixed8x88 fixed8x96 fixed8x104 fixed8x112 fixed8x120 fixed8x128 fixed8x136 fixed8x144 fixed8x152 fixed8x160 fixed8x168 fixed8x178 fixed8x184 fixed8x192 fixed8x200 fixed8x208 fixed8x216 fixed8x224 fixed8x232 fixed8x240 fixed8x248
|
||||
syn keyword solBuiltinType fixed16x8 fixed16x16 fixed16x24 fixed16x32 fixed16x40 fixed16x48 fixed16x56 fixed16x64 fixed16x72 fixed16x80 fixed16x88 fixed16x96 fixed16x104 fixed16x112 fixed16x120 fixed16x128 fixed16x136 fixed16x144 fixed16x152 fixed16x160 fixed16x168 fixed16x178 fixed16x184 fixed16x192 fixed16x200 fixed16x208 fixed16x216 fixed16x224 fixed16x232 fixed16x240
|
||||
syn keyword solBuiltinType fixed24x8 fixed24x16 fixed24x24 fixed24x32 fixed24x40 fixed24x48 fixed24x56 fixed24x64 fixed24x72 fixed24x80 fixed24x88 fixed24x96 fixed24x104 fixed24x112 fixed24x120 fixed24x128 fixed24x136 fixed24x144 fixed24x152 fixed24x160 fixed24x168 fixed24x178 fixed24x184 fixed24x192 fixed24x200 fixed24x208 fixed24x216 fixed24x224 fixed24x232
|
||||
syn keyword solBuiltinType fixed32x8 fixed32x16 fixed32x24 fixed32x32 fixed32x40 fixed32x48 fixed32x56 fixed32x64 fixed32x72 fixed32x80 fixed32x88 fixed32x96 fixed32x104 fixed32x112 fixed32x120 fixed32x128 fixed32x136 fixed32x144 fixed32x152 fixed32x160 fixed32x168 fixed32x178 fixed32x184 fixed32x192 fixed32x200 fixed32x208 fixed32x216 fixed32x224
|
||||
syn keyword solBuiltinType fixed40x8 fixed40x16 fixed40x24 fixed40x32 fixed40x40 fixed40x48 fixed40x56 fixed40x64 fixed40x72 fixed40x80 fixed40x88 fixed40x96 fixed40x104 fixed40x112 fixed40x120 fixed40x128 fixed40x136 fixed40x144 fixed40x152 fixed40x160 fixed40x168 fixed40x178 fixed40x184 fixed40x192 fixed40x200 fixed40x208 fixed40x216
|
||||
syn keyword solBuiltinType fixed48x8 fixed48x16 fixed48x24 fixed48x32 fixed48x40 fixed48x48 fixed48x56 fixed48x64 fixed48x72 fixed48x80 fixed48x88 fixed48x96 fixed48x104 fixed48x112 fixed48x120 fixed48x128 fixed48x136 fixed48x144 fixed48x152 fixed48x160 fixed48x168 fixed48x178 fixed48x184 fixed48x192 fixed48x200 fixed48x208
|
||||
syn keyword solBuiltinType fixed56x8 fixed56x16 fixed56x24 fixed56x32 fixed56x40 fixed56x48 fixed56x56 fixed56x64 fixed56x72 fixed56x80 fixed56x88 fixed56x96 fixed56x104 fixed56x112 fixed56x120 fixed56x128 fixed56x136 fixed56x144 fixed56x152 fixed56x160 fixed56x168 fixed56x178 fixed56x184 fixed56x192 fixed56x200
|
||||
syn keyword solBuiltinType fixed64x8 fixed64x16 fixed64x24 fixed64x32 fixed64x40 fixed64x48 fixed64x56 fixed64x64 fixed64x72 fixed64x80 fixed64x88 fixed64x96 fixed64x104 fixed64x112 fixed64x120 fixed64x128 fixed64x136 fixed64x144 fixed64x152 fixed64x160 fixed64x168 fixed64x178 fixed64x184 fixed64x192
|
||||
syn keyword solBuiltinType fixed72x8 fixed72x16 fixed72x24 fixed72x32 fixed72x40 fixed72x48 fixed72x56 fixed72x64 fixed72x72 fixed72x80 fixed72x88 fixed72x96 fixed72x104 fixed72x112 fixed72x120 fixed72x128 fixed72x136 fixed72x144 fixed72x152 fixed72x160 fixed72x168 fixed72x178 fixed72x184
|
||||
syn keyword solBuiltinType fixed80x8 fixed80x16 fixed80x24 fixed80x32 fixed80x40 fixed80x48 fixed80x56 fixed80x64 fixed80x72 fixed80x80 fixed80x88 fixed80x96 fixed80x104 fixed80x112 fixed80x120 fixed80x128 fixed80x136 fixed80x144 fixed80x152 fixed80x160 fixed80x168 fixed80x178
|
||||
syn keyword solBuiltinType fixed88x8 fixed88x16 fixed88x24 fixed88x32 fixed88x40 fixed88x48 fixed88x56 fixed88x64 fixed88x72 fixed88x80 fixed88x88 fixed88x96 fixed88x104 fixed88x112 fixed88x120 fixed88x128 fixed88x136 fixed88x144 fixed88x152 fixed88x160 fixed88x168
|
||||
syn keyword solBuiltinType fixed96x8 fixed96x16 fixed96x24 fixed96x32 fixed96x40 fixed96x48 fixed96x56 fixed96x64 fixed96x72 fixed96x80 fixed96x88 fixed96x96 fixed96x104 fixed96x112 fixed96x120 fixed96x128 fixed96x136 fixed96x144 fixed96x152 fixed96x160
|
||||
syn keyword solBuiltinType fixed104x8 fixed104x16 fixed104x24 fixed104x32 fixed104x40 fixed104x48 fixed104x56 fixed104x64 fixed104x72 fixed104x80 fixed104x88 fixed104x96 fixed104x104 fixed104x112 fixed104x120 fixed104x128 fixed104x136 fixed104x144 fixed104x152
|
||||
syn keyword solBuiltinType fixed112x8 fixed112x16 fixed112x24 fixed112x32 fixed112x40 fixed112x48 fixed112x56 fixed112x64 fixed112x72 fixed112x80 fixed112x88 fixed112x96 fixed112x104 fixed112x112 fixed112x120 fixed112x128 fixed112x136 fixed112x144
|
||||
syn keyword solBuiltinType fixed120x8 fixed120x16 fixed120x24 fixed120x32 fixed120x40 fixed120x48 fixed120x56 fixed120x64 fixed120x72 fixed120x80 fixed120x88 fixed120x96 fixed120x104 fixed120x112 fixed120x120 fixed120x128 fixed120x136
|
||||
syn keyword solBuiltinType fixed128x8 fixed128x16 fixed128x24 fixed128x32 fixed128x40 fixed128x48 fixed128x56 fixed128x64 fixed128x72 fixed128x80 fixed128x88 fixed128x96 fixed128x104 fixed128x112 fixed128x120 fixed128x128
|
||||
syn keyword solBuiltinType fixed136x8 fixed136x16 fixed136x24 fixed136x32 fixed136x40 fixed136x48 fixed136x56 fixed136x64 fixed136x72 fixed136x80 fixed136x88 fixed136x96 fixed136x104 fixed136x112 fixed136x120
|
||||
syn keyword solBuiltinType fixed144x8 fixed144x16 fixed144x24 fixed144x32 fixed144x40 fixed144x48 fixed144x56 fixed144x64 fixed144x72 fixed144x80 fixed144x88 fixed144x96 fixed144x104 fixed144x112
|
||||
syn keyword solBuiltinType fixed152x8 fixed152x16 fixed152x24 fixed152x32 fixed152x40 fixed152x48 fixed152x56 fixed152x64 fixed152x72 fixed152x80 fixed152x88 fixed152x96 fixed152x104
|
||||
syn keyword solBuiltinType fixed160x8 fixed160x16 fixed160x24 fixed160x32 fixed160x40 fixed160x48 fixed160x56 fixed160x64 fixed160x72 fixed160x80 fixed160x88 fixed160x96
|
||||
syn keyword solBuiltinType fixed168x8 fixed168x16 fixed168x24 fixed168x32 fixed168x40 fixed168x48 fixed168x56 fixed168x64 fixed168x72 fixed168x80 fixed168x88
|
||||
syn keyword solBuiltinType fixed176x8 fixed176x16 fixed176x24 fixed176x32 fixed176x40 fixed176x48 fixed176x56 fixed176x64 fixed176x72 fixed176x80
|
||||
syn keyword solBuiltinType fixed184x8 fixed184x16 fixed184x24 fixed184x32 fixed184x40 fixed184x48 fixed184x56 fixed184x64 fixed184x72
|
||||
syn keyword solBuiltinType fixed192x8 fixed192x16 fixed192x24 fixed192x32 fixed192x40 fixed192x48 fixed192x56 fixed192x64
|
||||
syn keyword solBuiltinType fixed200x8 fixed200x16 fixed200x24 fixed200x32 fixed200x40 fixed200x48 fixed200x56
|
||||
syn keyword solBuiltinType fixed208x8 fixed208x16 fixed208x24 fixed208x32 fixed208x40 fixed208x48
|
||||
syn keyword solBuiltinType fixed216x8 fixed216x16 fixed216x24 fixed216x32 fixed216x40
|
||||
syn keyword solBuiltinType fixed224x8 fixed224x16 fixed224x24 fixed224x32
|
||||
syn keyword solBuiltinType fixed232x8 fixed232x16 fixed232x24
|
||||
syn keyword solBuiltinType fixed240x8 fixed240x16
|
||||
syn keyword solBuiltinType fixed248x8
|
||||
syn keyword solBuiltinType ufixed
|
||||
syn keyword solBuiltinType ufixed0x8 ufixed0x16 ufixed0x24 ufixed0x32 ufixed0x40 ufixed0x48 ufixed0x56 ufixed0x64 ufixed0x72 ufixed0x80 ufixed0x88 ufixed0x96 ufixed0x104 ufixed0x112 ufixed0x120 ufixed0x128 ufixed0x136 ufixed0x144 ufixed0x152 ufixed0x160 ufixed0x168 ufixed0x178 ufixed0x184 ufixed0x192 ufixed0x200 ufixed0x208 ufixed0x216 ufixed0x224 ufixed0x232 ufixed0x240 ufixed0x248 ufixed0x256
|
||||
syn keyword solBuiltinType ufixed8x8 ufixed8x16 ufixed8x24 ufixed8x32 ufixed8x40 ufixed8x48 ufixed8x56 ufixed8x64 ufixed8x72 ufixed8x80 ufixed8x88 ufixed8x96 ufixed8x104 ufixed8x112 ufixed8x120 ufixed8x128 ufixed8x136 ufixed8x144 ufixed8x152 ufixed8x160 ufixed8x168 ufixed8x178 ufixed8x184 ufixed8x192 ufixed8x200 ufixed8x208 ufixed8x216 ufixed8x224 ufixed8x232 ufixed8x240 ufixed8x248
|
||||
syn keyword solBuiltinType ufixed16x8 ufixed16x16 ufixed16x24 ufixed16x32 ufixed16x40 ufixed16x48 ufixed16x56 ufixed16x64 ufixed16x72 ufixed16x80 ufixed16x88 ufixed16x96 ufixed16x104 ufixed16x112 ufixed16x120 ufixed16x128 ufixed16x136 ufixed16x144 ufixed16x152 ufixed16x160 ufixed16x168 ufixed16x178 ufixed16x184 ufixed16x192 ufixed16x200 ufixed16x208 ufixed16x216 ufixed16x224 ufixed16x232 ufixed16x240
|
||||
syn keyword solBuiltinType ufixed24x8 ufixed24x16 ufixed24x24 ufixed24x32 ufixed24x40 ufixed24x48 ufixed24x56 ufixed24x64 ufixed24x72 ufixed24x80 ufixed24x88 ufixed24x96 ufixed24x104 ufixed24x112 ufixed24x120 ufixed24x128 ufixed24x136 ufixed24x144 ufixed24x152 ufixed24x160 ufixed24x168 ufixed24x178 ufixed24x184 ufixed24x192 ufixed24x200 ufixed24x208 ufixed24x216 ufixed24x224 ufixed24x232
|
||||
syn keyword solBuiltinType ufixed32x8 ufixed32x16 ufixed32x24 ufixed32x32 ufixed32x40 ufixed32x48 ufixed32x56 ufixed32x64 ufixed32x72 ufixed32x80 ufixed32x88 ufixed32x96 ufixed32x104 ufixed32x112 ufixed32x120 ufixed32x128 ufixed32x136 ufixed32x144 ufixed32x152 ufixed32x160 ufixed32x168 ufixed32x178 ufixed32x184 ufixed32x192 ufixed32x200 ufixed32x208 ufixed32x216 ufixed32x224
|
||||
syn keyword solBuiltinType ufixed40x8 ufixed40x16 ufixed40x24 ufixed40x32 ufixed40x40 ufixed40x48 ufixed40x56 ufixed40x64 ufixed40x72 ufixed40x80 ufixed40x88 ufixed40x96 ufixed40x104 ufixed40x112 ufixed40x120 ufixed40x128 ufixed40x136 ufixed40x144 ufixed40x152 ufixed40x160 ufixed40x168 ufixed40x178 ufixed40x184 ufixed40x192 ufixed40x200 ufixed40x208 ufixed40x216
|
||||
syn keyword solBuiltinType ufixed48x8 ufixed48x16 ufixed48x24 ufixed48x32 ufixed48x40 ufixed48x48 ufixed48x56 ufixed48x64 ufixed48x72 ufixed48x80 ufixed48x88 ufixed48x96 ufixed48x104 ufixed48x112 ufixed48x120 ufixed48x128 ufixed48x136 ufixed48x144 ufixed48x152 ufixed48x160 ufixed48x168 ufixed48x178 ufixed48x184 ufixed48x192 ufixed48x200 ufixed48x208
|
||||
syn keyword solBuiltinType ufixed56x8 ufixed56x16 ufixed56x24 ufixed56x32 ufixed56x40 ufixed56x48 ufixed56x56 ufixed56x64 ufixed56x72 ufixed56x80 ufixed56x88 ufixed56x96 ufixed56x104 ufixed56x112 ufixed56x120 ufixed56x128 ufixed56x136 ufixed56x144 ufixed56x152 ufixed56x160 ufixed56x168 ufixed56x178 ufixed56x184 ufixed56x192 ufixed56x200
|
||||
syn keyword solBuiltinType ufixed64x8 ufixed64x16 ufixed64x24 ufixed64x32 ufixed64x40 ufixed64x48 ufixed64x56 ufixed64x64 ufixed64x72 ufixed64x80 ufixed64x88 ufixed64x96 ufixed64x104 ufixed64x112 ufixed64x120 ufixed64x128 ufixed64x136 ufixed64x144 ufixed64x152 ufixed64x160 ufixed64x168 ufixed64x178 ufixed64x184 ufixed64x192
|
||||
syn keyword solBuiltinType ufixed72x8 ufixed72x16 ufixed72x24 ufixed72x32 ufixed72x40 ufixed72x48 ufixed72x56 ufixed72x64 ufixed72x72 ufixed72x80 ufixed72x88 ufixed72x96 ufixed72x104 ufixed72x112 ufixed72x120 ufixed72x128 ufixed72x136 ufixed72x144 ufixed72x152 ufixed72x160 ufixed72x168 ufixed72x178 ufixed72x184
|
||||
syn keyword solBuiltinType ufixed80x8 ufixed80x16 ufixed80x24 ufixed80x32 ufixed80x40 ufixed80x48 ufixed80x56 ufixed80x64 ufixed80x72 ufixed80x80 ufixed80x88 ufixed80x96 ufixed80x104 ufixed80x112 ufixed80x120 ufixed80x128 ufixed80x136 ufixed80x144 ufixed80x152 ufixed80x160 ufixed80x168 ufixed80x178
|
||||
syn keyword solBuiltinType ufixed88x8 ufixed88x16 ufixed88x24 ufixed88x32 ufixed88x40 ufixed88x48 ufixed88x56 ufixed88x64 ufixed88x72 ufixed88x80 ufixed88x88 ufixed88x96 ufixed88x104 ufixed88x112 ufixed88x120 ufixed88x128 ufixed88x136 ufixed88x144 ufixed88x152 ufixed88x160 ufixed88x168
|
||||
syn keyword solBuiltinType ufixed96x8 ufixed96x16 ufixed96x24 ufixed96x32 ufixed96x40 ufixed96x48 ufixed96x56 ufixed96x64 ufixed96x72 ufixed96x80 ufixed96x88 ufixed96x96 ufixed96x104 ufixed96x112 ufixed96x120 ufixed96x128 ufixed96x136 ufixed96x144 ufixed96x152 ufixed96x160
|
||||
syn keyword solBuiltinType ufixed104x8 ufixed104x16 ufixed104x24 ufixed104x32 ufixed104x40 ufixed104x48 ufixed104x56 ufixed104x64 ufixed104x72 ufixed104x80 ufixed104x88 ufixed104x96 ufixed104x104 ufixed104x112 ufixed104x120 ufixed104x128 ufixed104x136 ufixed104x144 ufixed104x152
|
||||
syn keyword solBuiltinType ufixed112x8 ufixed112x16 ufixed112x24 ufixed112x32 ufixed112x40 ufixed112x48 ufixed112x56 ufixed112x64 ufixed112x72 ufixed112x80 ufixed112x88 ufixed112x96 ufixed112x104 ufixed112x112 ufixed112x120 ufixed112x128 ufixed112x136 ufixed112x144
|
||||
syn keyword solBuiltinType ufixed120x8 ufixed120x16 ufixed120x24 ufixed120x32 ufixed120x40 ufixed120x48 ufixed120x56 ufixed120x64 ufixed120x72 ufixed120x80 ufixed120x88 ufixed120x96 ufixed120x104 ufixed120x112 ufixed120x120 ufixed120x128 ufixed120x136
|
||||
syn keyword solBuiltinType ufixed128x8 ufixed128x16 ufixed128x24 ufixed128x32 ufixed128x40 ufixed128x48 ufixed128x56 ufixed128x64 ufixed128x72 ufixed128x80 ufixed128x88 ufixed128x96 ufixed128x104 ufixed128x112 ufixed128x120 ufixed128x128
|
||||
syn keyword solBuiltinType ufixed136x8 ufixed136x16 ufixed136x24 ufixed136x32 ufixed136x40 ufixed136x48 ufixed136x56 ufixed136x64 ufixed136x72 ufixed136x80 ufixed136x88 ufixed136x96 ufixed136x104 ufixed136x112 ufixed136x120
|
||||
syn keyword solBuiltinType ufixed144x8 ufixed144x16 ufixed144x24 ufixed144x32 ufixed144x40 ufixed144x48 ufixed144x56 ufixed144x64 ufixed144x72 ufixed144x80 ufixed144x88 ufixed144x96 ufixed144x104 ufixed144x112
|
||||
syn keyword solBuiltinType ufixed152x8 ufixed152x16 ufixed152x24 ufixed152x32 ufixed152x40 ufixed152x48 ufixed152x56 ufixed152x64 ufixed152x72 ufixed152x80 ufixed152x88 ufixed152x96 ufixed152x104
|
||||
syn keyword solBuiltinType ufixed160x8 ufixed160x16 ufixed160x24 ufixed160x32 ufixed160x40 ufixed160x48 ufixed160x56 ufixed160x64 ufixed160x72 ufixed160x80 ufixed160x88 ufixed160x96
|
||||
syn keyword solBuiltinType ufixed168x8 ufixed168x16 ufixed168x24 ufixed168x32 ufixed168x40 ufixed168x48 ufixed168x56 ufixed168x64 ufixed168x72 ufixed168x80 ufixed168x88
|
||||
syn keyword solBuiltinType ufixed176x8 ufixed176x16 ufixed176x24 ufixed176x32 ufixed176x40 ufixed176x48 ufixed176x56 ufixed176x64 ufixed176x72 ufixed176x80
|
||||
syn keyword solBuiltinType ufixed184x8 ufixed184x16 ufixed184x24 ufixed184x32 ufixed184x40 ufixed184x48 ufixed184x56 ufixed184x64 ufixed184x72
|
||||
syn keyword solBuiltinType ufixed192x8 ufixed192x16 ufixed192x24 ufixed192x32 ufixed192x40 ufixed192x48 ufixed192x56 ufixed192x64
|
||||
syn keyword solBuiltinType ufixed200x8 ufixed200x16 ufixed200x24 ufixed200x32 ufixed200x40 ufixed200x48 ufixed200x56
|
||||
syn keyword solBuiltinType ufixed208x8 ufixed208x16 ufixed208x24 ufixed208x32 ufixed208x40 ufixed208x48
|
||||
syn keyword solBuiltinType ufixed216x8 ufixed216x16 ufixed216x24 ufixed216x32 ufixed216x40
|
||||
syn keyword solBuiltinType ufixed224x8 ufixed224x16 ufixed224x24 ufixed224x32
|
||||
syn keyword solBuiltinType ufixed232x8 ufixed232x16 ufixed232x24
|
||||
syn keyword solBuiltinType ufixed240x8 ufixed240x16
|
||||
syn keyword solBuiltinType ufixed248x8
|
||||
syn keyword solBuiltinType string string1 string2 string3 string4 string5 string6 string7 string8 string9 string10 string11 string12 string13 string14 string15 string16 string17 string18 string19 string20 string21 string22 string23 string24 string25 string26 string27 string28 string29 string30 string31 string32
|
||||
syn keyword solBuiltinType byte bytes bytes1 bytes2 bytes3 bytes4 bytes5 bytes6 bytes7 bytes8 bytes9 bytes10 bytes11 bytes12 bytes13 bytes14 bytes15 bytes16 bytes17 bytes18 bytes19 bytes20 bytes21 bytes22 bytes23 bytes24 bytes25 bytes26 bytes27 bytes28 bytes29 bytes30 bytes31 bytes32
|
||||
|
||||
hi def link solKeyword Keyword
|
||||
hi def link solConstant Constant
|
||||
hi def link solBuiltinType Type
|
||||
hi def link solBuiltinFunction Keyword
|
||||
|
||||
syn match solOperator /\(!\||\|&\|+\|-\|<\|>\|=\|%\|\/\|*\|\~\|\^\)/
|
||||
syn match solNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
|
||||
syn match solFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
|
||||
|
||||
syn region solString start=+"+ skip=+\\\\\|\\$"\|\\"+ end=+"+
|
||||
syn region solString start=+'+ skip=+\\\\\|\\$'\|\\'+ end=+'+
|
||||
|
||||
hi def link solOperator Operator
|
||||
hi def link solNumber Number
|
||||
hi def link solFloat Float
|
||||
hi def link solString String
|
||||
|
||||
" Function
|
||||
syn match solFunction /\<function\>/ nextgroup=solFuncName,solFuncArgs skipwhite
|
||||
syn match solFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=solFuncArgs skipwhite
|
||||
|
||||
syn region solFuncArgs contained matchgroup=solFuncParens start='(' end=')' contains=solFuncArgCommas,solBuiltinType nextgroup=solModifierName,solFuncReturns,solFuncBody keepend skipwhite skipempty
|
||||
syn match solModifierName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=solModifierArgs,solModifierName skipwhite
|
||||
syn region solModifierArgs contained matchgroup=solFuncParens start='(' end=')' contains=solFuncArgCommas nextgroup=solModifierName,solFuncReturns,solFuncBody skipwhite
|
||||
syn region solFuncReturns contained matchgroup=solFuncParens nextgroup=solFuncBody start='(' end=')' contains=solFuncArgCommas,solBuiltinType skipwhite
|
||||
|
||||
syn match solFuncArgCommas contained ','
|
||||
syn region solFuncBody start="{" end="}" fold transparent
|
||||
|
||||
hi def link solFunction Type
|
||||
hi def link solFuncName Function
|
||||
hi def link solModifierName Function
|
||||
|
||||
" Yul blocks
|
||||
syn match yul /\<assembly\>/ skipwhite skipempty nextgroup=yulBody
|
||||
syn region yulBody contained start='{' end='}' fold contains=yulAssemblyOp,solNumber,yulVarDeclaration,solLineComment,solComment skipwhite skipempty
|
||||
syn keyword yulAssemblyOp contained stop add sub mul div sdiv mod smod exp not lt gt slt sgt eq iszero and or xor byte shl shr sar addmod mulmod signextend keccak256 pc pop mload mstore mstore8 sload sstore msize gas address balance selfbalance caller callvalue calldataload calldatasize calldatacopy codesize codecopy extcodesize extcodecopy returndatasize returndatacopy extcodehash create create2 call callcode delegatecall staticcall return revert selfdestruct invalid log0 log1 log2 log3 log4 chainid basefee origin gasprice blockhash coinbase timestamp number difficulty gaslimit
|
||||
syn keyword yulVarDeclaration contained let
|
||||
|
||||
hi def link yul Keyword
|
||||
hi def link yulVarDeclaration Keyword
|
||||
hi def link yulAssemblyOp Keyword
|
||||
|
||||
" Contract
|
||||
syn match solContract /\<\%(contract\|library\|interface\)\>/ nextgroup=solContractName skipwhite
|
||||
syn match solContractName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=solContractParent skipwhite
|
||||
syn region solContractParent contained start='is' end='{' contains=solContractName,solContractNoise,solContractCommas skipwhite skipempty
|
||||
syn match solContractNoise contained 'is' containedin=solContractParent
|
||||
syn match solContractCommas contained ','
|
||||
|
||||
hi def link solContract Type
|
||||
hi def link solContractName Function
|
||||
|
||||
" Event
|
||||
syn match solEvent /\<event\>/ nextgroup=solEventName,solEventArgs skipwhite
|
||||
syn match solEventName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=solEventArgs skipwhite
|
||||
syn region solEventArgs contained matchgroup=solFuncParens start='(' end=')' contains=solEventArgCommas,solBuiltinType,solEventArgSpecial skipwhite skipempty
|
||||
syn match solEventArgCommas contained ','
|
||||
syn match solEventArgSpecial contained 'indexed'
|
||||
|
||||
hi def link solEvent Type
|
||||
hi def link solEventName Function
|
||||
hi def link solEventArgSpecial Label
|
||||
|
||||
" Comment
|
||||
syn keyword solCommentTodo TODO FIXME XXX TBD contained
|
||||
syn match solNatSpec contained /@title\|@author\|@notice\|@dev\|@param\|@inheritdoc\|@return/
|
||||
syn region solLineComment start=+\/\/+ end=+$+ contains=solCommentTodo,solNatSpec,@Spell
|
||||
syn region solLineComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ contains=solCommentTodo,solNatSpec,@Spell fold
|
||||
syn region solComment start="/\*" end="\*/" contains=solCommentTodo,solNatSpec,@Spell fold
|
||||
|
||||
hi def link solCommentTodo Todo
|
||||
hi def link solNatSpec Label
|
||||
hi def link solLineComment Comment
|
||||
hi def link solComment Comment
|
||||
|
||||
let b:current_syntax = "solidity"
|
||||
62
runtime/syntax/srt.vim
Normal file
62
runtime/syntax/srt.vim
Normal file
@@ -0,0 +1,62 @@
|
||||
" Vim syntax file
|
||||
" Language: SubRip
|
||||
" Maintainer: ObserverOfTime <chronobserver@disroot.org>
|
||||
" Filenames: *.srt
|
||||
" Last Change: 2022 Sep 12
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
syn spell toplevel
|
||||
|
||||
syn cluster srtSpecial contains=srtBold,srtItalics,srtStrikethrough,srtUnderline,srtFont,srtTag,srtEscape
|
||||
|
||||
" Number
|
||||
syn match srtNumber /^\d\+$/ contains=@NoSpell
|
||||
|
||||
" Range
|
||||
syn match srtRange /\d\d:\d\d:\d\d[,.]\d\d\d --> \d\d:\d\d:\d\d[,.]\d\d\d/ skipwhite contains=srtArrow,srtTime nextgroup=srtCoordinates
|
||||
syn match srtArrow /-->/ contained contains=@NoSpell
|
||||
syn match srtTime /\d\d:\d\d:\d\d[,.]\d\d\d/ contained contains=@NoSpell
|
||||
syn match srtCoordinates /X1:\d\+ X2:\d\+ Y1:\d\+ Y2:\d\+/ contained contains=@NoSpell
|
||||
|
||||
" Bold
|
||||
syn region srtBold matchgroup=srtFormat start=+<b>+ end=+</b>+ contains=@srtSpecial
|
||||
syn region srtBold matchgroup=srtFormat start=+{b}+ end=+{/b}+ contains=@srtSpecial
|
||||
|
||||
" Italics
|
||||
syn region srtItalics matchgroup=srtFormat start=+<i>+ end=+</i>+ contains=@srtSpecial
|
||||
syn region srtItalics matchgroup=srtFormat start=+{i}+ end=+{/i}+ contains=@srtSpecial
|
||||
|
||||
" Strikethrough
|
||||
syn region srtStrikethrough matchgroup=srtFormat start=+<s>+ end=+</s>+ contains=@srtSpecial
|
||||
syn region srtStrikethrough matchgroup=srtFormat start=+{s}+ end=+{/s}+ contains=@srtSpecial
|
||||
|
||||
" Underline
|
||||
syn region srtUnderline matchgroup=srtFormat start=+<u>+ end=+</u>+ contains=@srtSpecial
|
||||
syn region srtUnderline matchgroup=srtFormat start=+{u}+ end=+{/u}+ contains=@srtSpecial
|
||||
|
||||
" Font
|
||||
syn region srtFont matchgroup=srtFormat start=+<font[^>]\{-}>+ end=+</font>+ contains=@srtSpecial
|
||||
|
||||
" ASS tags
|
||||
syn match srtTag /{\\[^}]\{1,}}/ contains=@NoSpell
|
||||
|
||||
" Special characters
|
||||
syn match srtEscape /\\[nNh]/ contains=@NoSpell
|
||||
|
||||
hi def link srtArrow Delimiter
|
||||
hi def link srtCoordinates Label
|
||||
hi def link srtEscape SpecialChar
|
||||
hi def link srtFormat Special
|
||||
hi def link srtNumber Number
|
||||
hi def link srtTag PreProc
|
||||
hi def link srtTime String
|
||||
|
||||
hi srtBold cterm=bold gui=bold
|
||||
hi srtItalics cterm=italic gui=italic
|
||||
hi srtStrikethrough cterm=strikethrough gui=strikethrough
|
||||
hi srtUnderline cterm=underline gui=underline
|
||||
|
||||
let b:current_syntax = 'srt'
|
||||
54
runtime/syntax/vdf.vim
Normal file
54
runtime/syntax/vdf.vim
Normal file
@@ -0,0 +1,54 @@
|
||||
" Vim syntax file
|
||||
" Language: Valve Data Format
|
||||
" Maintainer: ObserverOfTime <chronobserver@disroot.org>
|
||||
" Filenames: *.vdf
|
||||
" Last Change: 2022 Sep 15
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
" Comment
|
||||
syn keyword vdfTodo contained TODO FIXME XXX
|
||||
syn match vdfComment +//.*+ contains=vdfTodo
|
||||
|
||||
" Macro
|
||||
syn match vdfMacro /^\s*#.*/
|
||||
|
||||
" Tag
|
||||
syn region vdfTag start=/"/ skip=/\\"/ end=/"/
|
||||
\ nextgroup=vdfValue skipwhite oneline
|
||||
|
||||
" Section
|
||||
syn region vdfSection matchgroup=vdfBrace
|
||||
\ start=/{/ end=/}/ transparent fold
|
||||
\ contains=vdfTag,vdfSection,vdfComment,vdfConditional
|
||||
|
||||
" Conditional
|
||||
syn match vdfConditional /\[\$\w\{1,1021}\]/ nextgroup=vdfTag
|
||||
|
||||
" Value
|
||||
syn region vdfValue start=/"/ skip=/\\"/ end=/"/
|
||||
\ oneline contained contains=vdfVariable,vdfNumber,vdfEscape
|
||||
syn region vdfVariable start=/%/ skip=/\\%/ end=/%/ oneline contained
|
||||
syn match vdfEscape /\\[nt\\"]/ contained
|
||||
syn match vdfNumber /"-\?\d\+"/ contained
|
||||
|
||||
hi def link vdfBrace Delimiter
|
||||
hi def link vdfComment Comment
|
||||
hi def link vdfConditional Constant
|
||||
hi def link vdfEscape SpecialChar
|
||||
hi def link vdfMacro Macro
|
||||
hi def link vdfNumber Number
|
||||
hi def link vdfTag Keyword
|
||||
hi def link vdfTodo Todo
|
||||
hi def link vdfValue String
|
||||
hi def link vdfVariable Identifier
|
||||
|
||||
let b:current_syntax = 'vdf'
|
||||
|
||||
let &cpoptions = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim 9.0 script
|
||||
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" Last Change: September 09, 2022
|
||||
" Version: 9.0-04
|
||||
" Last Change: October 03, 2022
|
||||
" Version: 9.0-07
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
|
||||
" Automatically generated keyword lists: {{{1
|
||||
|
||||
@@ -30,24 +30,24 @@ syn match vimCommand contained "\<z[-+^.=]\=\>"
|
||||
syn keyword vimStdPlugin contained Arguments Asm Break Cfilter Clear Continue DiffOrig Evaluate Finish Gdb Lfilter Man N[ext] Over P[rint] Program Run S Source Step Stop Termdebug TermdebugCommand TOhtml Until Winbar XMLent XMLns
|
||||
|
||||
" vimOptions are caught only when contained in a vimSet {{{2
|
||||
syn keyword vimOption contained acd ambw arshape aw backupskip beval bk bri bufhidden cdh ci cinsd cms commentstring conceallevel cpt cscopetagorder csto cursorlineopt dg dir ed enc errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault gp guifontwide helpheight history hlsearch imaf ims includeexpr infercase iskeyword keywordprg laststatus lispwords lrm magic maxfuncdepth menuitems mm modifiable mousemev mps nu opendevice paste pex pmbfn printencoding pt pythonhome quoteescape renderoptions rlc ruf scb scrolloff selectmode shellquote shiftwidth showmode sj sn spellfile spo st su swf ta taglength tbis termguicolors textmode thesaurusfunc titlestring tpm ttimeoutlen ttyscroll tx undolevels vartabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write
|
||||
syn keyword vimOption contained ai anti asd awa balloondelay bevalterm bkc briopt buflisted cdhome cin cinw co compatible confirm crb cscopeverbose csverb cwh dict directory edcompatible encoding errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepformat guiheadroom helplang hk ic imak imsearch incsearch insertmode isp km lazyredraw list ls makeef maxmapdepth mfd mmd modified mousemodel msm number operatorfunc pastetoggle pexpr popt printexpr pumheight pythonthreedll rdt report rnu ruler scf scrollopt sessionoptions shellredir shm showtabline slm so spelllang spr sta sua switchbuf tabline tagrelative tbs termwinkey textwidth tildeop tl tr ttm ttytype uc undoreload vb vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany
|
||||
syn keyword vimOption contained akm antialias autochdir background ballooneval bex bl brk buftype cdpath cindent cinwords cocu complete copyindent cryptmethod csl cuc debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn grepprg guiligatures hf hkmap icon imc imsf inde is isprint kmp lbr listchars lsp makeencoding maxmem mh mmp more mousemoveevent mzq numberwidth opfunc patchexpr pfn pp printfont pumwidth pythonthreehome re restorescreen ro rulerformat scl scs sft shellslash shortmess shq sm softtabstop spelloptions sps stal suffixes sws tabpagemax tags tc termwinscroll tf timeout tm ts tty tw udf updatecount vbs viewdir vop wc wh wildignore wincolor winptydll wmw writebackup
|
||||
syn keyword vimOption contained al ar autoindent backspace balloonevalterm bexpr bo browsedir casemap cedit cink clipboard cole completefunc cot cscopepathcomp cspc cul deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtl guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kp lcs lm luadll makeprg maxmempattern mis mmt mouse mouses mzquantum nuw osfiletype patchmode ph preserveindent printheader pvh pyx readonly revins rop runtimepath scr sect sh shelltemp shortname si smartcase sol spellsuggest sr startofline suffixesadd sxe tabstop tagstack tcldll termwinsize tfu timeoutlen to tsl ttybuiltin twk udir updatetime vdir viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay
|
||||
syn keyword vimOption contained aleph arab autoread backup balloonexpr bg bomb bs cb cf cinkeys cm colorcolumn completeopt cp cscopeprg csprg culopt def diffexpr ea ei ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw gtt guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js langmap linebreak lmap lw mat maxmemtot mkspellmem mod mousef mouseshape mzschemedll odev pa path pheader previewheight printmbcharset pvp pyxversion redrawtime ri rs sb scroll sections shcf shelltype showbreak sidescroll smartindent sp spf srr statusline sw sxq tag tal tenc termwintype tgc title toolbar tsr ttyfast tws ul ur ve vif vts wcr wi wildmenu winfixheight wiv wrap ws
|
||||
syn keyword vimOption contained allowrevins arabic autoshelldir backupcopy bdir bh breakat bsdir cc cfu cino cmdheight columns completepopup cpo cscopequickfix csqf cursorbind define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guicursor guitablabel hid hl im imdisable imstyle indk isi key langmenu lines lnr lz matchpairs mco ml modeline mousefocus mouset mzschemegcdll oft packpath pdev pi previewpopup printmbfont pvw qe regexpengine rightleft rtp sbo scrollbind secure shell shellxescape showcmd sidescrolloff smarttab spc spl ss stl swapfile syn tagbsearch tb term terse tgst titlelen toolbariconsize tsrfu ttym twsl undodir ut verbose viminfo wa wd wic wildmode winfixwidth wiw wrapmargin ww
|
||||
syn keyword vimOption contained altkeymap arabicshape autowrite backupdir bdlay bin breakindent bsk ccv ch cinoptions cmdwinheight com completeslash cpoptions cscoperelative csre cursorcolumn delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr gli guifont guitabtooltip hidden hlg imactivatefunc imi inc inex isident keymap langnoremap linespace loadplugins ma matchtime mef mle modelineexpr mousehide mousetime nf ofu para penc pm previewwindow printoptions pw qftf relativenumber rightleftcmd ru sbr scrollfocus sel shellcmdflag shellxquote showfulltag signcolumn smc spell splitbelow ssl stmp swapsync synmaxcol tagcase tbi termbidi textauto thesaurus titleold top ttimeout ttymouse twt undofile varsofttabstop verbosefile viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan xtermcodes
|
||||
syn keyword vimOption contained ambiwidth ari autowriteall backupext belloff binary breakindentopt bt cd charconvert cinscopedecls cmp comments concealcursor cpp cscopetag cst cursorline dex dip eb emoji errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd go guifontset helpfile highlight hls imactivatekey iminsert include inf isk keymodel langremap lisp lpl macatsui maxcombine menc mls modelines mousem mp nrformats omnifunc paragraphs perldll pmbcs printdevice prompt pythondll quickfixtextfunc remap rl rubydll sc scrolljump selection shellpipe shiftround showmatch siso smd spellcapcheck splitright ssop sts swb syntax tagfunc tbidi termencoding
|
||||
syn keyword vimOption contained acd ambw arshape aw backupskip beval bk bri bufhidden cdh ci cinsd cms commentstring conceallevel cpt cscopetagorder csto cursorlineopt dg dir ed enc errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault gp guifontwide helpheight history hlsearch imaf ims includeexpr infercase iskeyword keywordprg laststatus lispwords lrm magic maxfuncdepth menuitems mm modifiable mousemev mps nu opendevice paste pex pmbfn printencoding pt pythonhome quoteescape renderoptions rlc ruf scb scrolloff selectmode shellquote shiftwidth showmode sj smoothscroll spell spl srr statusline sw sxq tag tal tenc termwintype tgst titleold tpm ttimeoutlen ttyscroll tx undolevels vartabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write
|
||||
syn keyword vimOption contained ai anti asd awa balloondelay bevalterm bkc briopt buflisted cdhome cin cinw co compatible confirm crb cscopeverbose csverb cwh dict directory edcompatible encoding errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepformat guiheadroom helplang hk ic imak imsearch incsearch insertmode isp km lazyredraw list ls makeef maxmapdepth mfd mmd modified mousemodel msm number operatorfunc pastetoggle pexpr popt printexpr pumheight pythonthreedll rdt report rnu ruler scf scrollopt sessionoptions shellredir shm showtabline slm sms spellcapcheck splitbelow ss stl swapfile syn tagbsearch tb term terse thesaurus titlestring tr ttm ttytype uc undoreload vb vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany
|
||||
syn keyword vimOption contained akm antialias autochdir background ballooneval bex bl brk buftype cdpath cindent cinwords cocu complete copyindent cryptmethod csl cuc debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn grepprg guiligatures hf hkmap icon imc imsf inde is isprint kmp lbr listchars lsp makeencoding maxmem mh mmp more mousemoveevent mzq numberwidth opfunc patchexpr pfn pp printfont pumwidth pythonthreehome re restorescreen ro rulerformat scl scs sft shellslash shortmess shq sm sn spellfile splitkeep ssl stmp swapsync synmaxcol tagcase tbi termbidi textauto thesaurusfunc tl ts tty tw udf updatecount vbs viewdir vop wc wh wildignore wincolor winptydll wmw writebackup
|
||||
syn keyword vimOption contained al ar autoindent backspace balloonevalterm bexpr bo browsedir casemap cedit cink clipboard cole completefunc cot cscopepathcomp cspc cul deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtl guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kp lcs lm luadll makeprg maxmempattern mis mmt mouse mouses mzquantum nuw osfiletype patchmode ph preserveindent printheader pvh pyx readonly revins rop runtimepath scr sect sh shelltemp shortname si smartcase so spelllang splitright ssop sts swb syntax tagfunc tbidi termencoding textmode tildeop tm tsl ttybuiltin twk udir updatetime vdir viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay
|
||||
syn keyword vimOption contained aleph arab autoread backup balloonexpr bg bomb bs cb cf cinkeys cm colorcolumn completeopt cp cscopeprg csprg culopt def diffexpr ea ei ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw gtt guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js langmap linebreak lmap lw mat maxmemtot mkspellmem mod mousef mouseshape mzschemedll odev pa path pheader previewheight printmbcharset pvp pyxversion redrawtime ri rs sb scroll sections shcf shelltype showbreak sidescroll smartindent softtabstop spelloptions spo st su swf ta taglength tbis termguicolors textwidth timeout to tsr ttyfast tws ul ur ve vif vts wcr wi wildmenu winfixheight wiv wrap ws
|
||||
syn keyword vimOption contained allowrevins arabic autoshelldir backupcopy bdir bh breakat bsdir cc cfu cino cmdheight columns completepopup cpo cscopequickfix csqf cursorbind define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guicursor guitablabel hid hl im imdisable imstyle indk isi key langmenu lines lnr lz matchpairs mco ml modeline mousefocus mouset mzschemegcdll oft packpath pdev pi previewpopup printmbfont pvw qe regexpengine rightleft rtp sbo scrollbind secure shell shellxescape showcmd sidescrolloff smarttab sol spellsuggest spr sta sua switchbuf tabline tagrelative tbs termwinkey tf timeoutlen toolbar tsrfu ttym twsl undodir ut verbose viminfo wa wd wic wildmode winfixwidth wiw wrapmargin ww
|
||||
syn keyword vimOption contained altkeymap arabicshape autowrite backupdir bdlay bin breakindent bsk ccv ch cinoptions cmdwinheight com completeslash cpoptions cscoperelative csre cursorcolumn delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr gli guifont guitabtooltip hidden hlg imactivatefunc imi inc inex isident keymap langnoremap linespace loadplugins ma matchtime mef mle modelineexpr mousehide mousetime nf ofu para penc pm previewwindow printoptions pw qftf relativenumber rightleftcmd ru sbr scrollfocus sel shellcmdflag shellxquote showfulltag signcolumn smc sp spf sps stal suffixes sws tabpagemax tags tc termwinscroll tfu title toolbariconsize ttimeout ttymouse twt undofile varsofttabstop verbosefile viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan xtermcodes
|
||||
syn keyword vimOption contained ambiwidth ari autowriteall backupext belloff binary breakindentopt bt cd charconvert cinscopedecls cmp comments concealcursor cpp cscopetag cst cursorline dex dip eb emoji errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd go guifontset helpfile highlight hls imactivatekey iminsert include inf isk keymodel langremap lisp lpl macatsui maxcombine menc mls modelines mousem mp nrformats omnifunc paragraphs perldll pmbcs printdevice prompt pythondll quickfixtextfunc remap rl rubydll sc scrolljump selection shellpipe shiftround showmatch siso smd spc spk sr startofline suffixesadd sxe tabstop tagstack tcldll termwinsize tgc titlelen top
|
||||
|
||||
" vimOptions: These are the turn-off setting variants {{{2
|
||||
syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoindent noautowrite noawa noballoonevalterm nobin nobl nobri noci nocompatible nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noemoji noequalalways noet noexrc nofileignorecase nofk nofs nogdefault nohidden nohkmapp nohlsearch noignorecase noimcmdline noincsearch noinsertmode nojs nolazyredraw nolisp noloadplugins nolz nomagic nomle nomodelineexpr nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscf noscrollfocus nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows
|
||||
syn keyword vimOption contained noai noaltkeymap noar noarabicshape noasd noautoread noautowriteall nobackup nobeval nobinary nobomb nobuflisted nocin noconfirm nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noendofline noerrorbells noex nofen nofixendofline nofkmap nofsync noguipty nohk nohkp noic noim noimd noinf nois nolangnoremap nolbr nolist nolpl noma nomh nomod nomodifiable nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscrollbind noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup noxtermcodes
|
||||
syn keyword vimOption contained noakm noanti noarab noari noautochdir noautoshelldir noaw noballooneval nobevalterm nobk nobreakindent nocf nocindent nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noemo noeol noesckeys noexpandtab nofic nofixeol nofoldenable nogd nohid nohkmap nohls noicon noimc noimdisable noinfercase nojoinspaces nolangremap nolinebreak nolnr nolrm nomacatsui noml nomodeline nomodified
|
||||
syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoindent noautowrite noawa noballoonevalterm nobin nobl nobri noci nocompatible nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noemoji noequalalways noet noexrc nofileignorecase nofk nofs nogdefault nohidden nohkmapp nohlsearch noignorecase noimcmdline noincsearch noinsertmode nojs nolazyredraw nolisp noloadplugins nolz nomagic nomle nomodelineexpr nomore nomousehide noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscf noscrollfocus nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosmoothscroll nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows
|
||||
syn keyword vimOption contained noai noaltkeymap noar noarabicshape noasd noautoread noautowriteall nobackup nobeval nobinary nobomb nobuflisted nocin noconfirm nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noendofline noerrorbells noex nofen nofixendofline nofkmap nofsync noguipty nohk nohkp noic noim noimd noinf nois nolangnoremap nolbr nolist nolpl noma nomh nomod nomodifiable nomousef nonu noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscrollbind noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosms nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup noxtermcodes
|
||||
syn keyword vimOption contained noakm noanti noarab noari noautochdir noautoshelldir noaw noballooneval nobevalterm nobk nobreakindent nocf nocindent nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noemo noeol noesckeys noexpandtab nofic nofixeol nofoldenable nogd nohid nohkmap nohls noicon noimc noimdisable noinfercase nojoinspaces nolangremap nolinebreak nolnr nolrm nomacatsui noml nomodeline nomodified nomousefocus nonumber
|
||||
|
||||
" vimOptions: These are the invertible variants {{{2
|
||||
syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoindent invautowrite invawa invballoonevalterm invbin invbl invbri invci invcompatible invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible invemoji invequalalways invet invexrc invfileignorecase invfk invfs invgdefault invhidden invhkmapp invhlsearch invignorecase invimcmdline invincsearch invinsertmode invjs invlazyredraw invlisp invloadplugins invlz invmagic invmle invmodelineexpr invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscf invscrollfocus invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws
|
||||
syn keyword vimOption contained invai invaltkeymap invar invarabicshape invasd invautoread invautowriteall invbackup invbeval invbinary invbomb invbuflisted invcin invconfirm invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invendofline inverrorbells invex invfen invfixendofline invfkmap invfsync invguipty invhk invhkp invic invim invimd invinf invis invlangnoremap invlbr invlist invlpl invma invmh invmod invmodifiable invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscrollbind invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup invxtermcodes
|
||||
syn keyword vimOption contained invakm invanti invarab invari invautochdir invautoshelldir invaw invballooneval invbevalterm invbk invbreakindent invcf invcindent invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invemo inveol invesckeys invexpandtab invfic invfixeol invfoldenable invgd invhid invhkmap invhls invicon invimc invimdisable invinfercase invjoinspaces invlangremap invlinebreak invlnr invlrm invmacatsui invml invmodeline invmodified
|
||||
syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoindent invautowrite invawa invballoonevalterm invbin invbl invbri invci invcompatible invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible invemoji invequalalways invet invexrc invfileignorecase invfk invfs invgdefault invhidden invhkmapp invhlsearch invignorecase invimcmdline invincsearch invinsertmode invjs invlazyredraw invlisp invloadplugins invlz invmagic invmle invmodelineexpr invmore invmousehide invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscf invscrollfocus invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsmoothscroll invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws
|
||||
syn keyword vimOption contained invai invaltkeymap invar invarabicshape invasd invautoread invautowriteall invbackup invbeval invbinary invbomb invbuflisted invcin invconfirm invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invendofline inverrorbells invex invfen invfixendofline invfkmap invfsync invguipty invhk invhkp invic invim invimd invinf invis invlangnoremap invlbr invlist invlpl invma invmh invmod invmodifiable invmousef invnu invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscrollbind invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsms invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup invxtermcodes
|
||||
syn keyword vimOption contained invakm invanti invarab invari invautochdir invautoshelldir invaw invballooneval invbevalterm invbk invbreakindent invcf invcindent invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invemo inveol invesckeys invexpandtab invfic invfixeol invfoldenable invgd invhid invhkmap invhls invicon invimc invimdisable invinfercase invjoinspaces invlangremap invlinebreak invlnr invlrm invmacatsui invml invmodeline invmodified invmousefocus invnumber
|
||||
|
||||
" termcap codes (which can also be set) {{{2
|
||||
syn keyword vimOption contained t_8b t_8u t_AF t_AL t_bc t_BE t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_Ds t_EI t_F2 t_F4 t_F6 t_F8 t_fd t_fs t_IE t_k1 t_k2 t_K3 t_K4 t_K5 t_K6 t_K7 t_K8 t_K9 t_kb t_KB t_kd t_KD t_KE t_KG t_KH t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_PE t_PS t_RB t_RC t_RF t_Ri t_RI t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_Si t_SI t_so t_sr t_SR t_ST t_te t_Te t_TE t_ti t_TI t_ts t_Ts t_u7 t_ue t_us t_Us t_ut t_vb t_ve t_vi t_vs t_VS t_WP t_WS t_xn t_xs t_ZH t_ZR
|
||||
@@ -79,12 +79,12 @@ syn match vimHLGroup contained "Conceal"
|
||||
syn case match
|
||||
|
||||
" Function Names {{{2
|
||||
syn keyword vimFuncName contained abs argc assert_equal assert_match atan balloon_show bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline digraph_set eval exists_compiled extendnew findfile fnameescape foldtextresult get getcharmod getcmdpos getcursorcharpos getftime getmarklist getreg gettabwinvar getwinposy has_key histnr iconv inputlist invert items job_stop keys lispindent listener_remove map mapset matchdelete matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prompt_setprompt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_channel test_null_partial test_setmouse timer_info tolower type values winbufnr win_getid win_id2win winnr win_splitmove
|
||||
syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 balloon_split buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype digraph_setlist eventhandler exp feedkeys flatten fnamemodify foreground getbufinfo getcharpos getcmdscreenpos getcwd getftype getmatches getreginfo gettagstack getwinvar haslocaldir hlexists indent inputrestore isabsolutepath job_getchannel join len list2blob localtime maparg match matchend matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_add prop_remove prop_type_list pyxeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setcharsearch setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_dict test_null_string test_settime timer_pause toupper typename virtcol wincol win_gettype winlayout winrestcmd winwidth
|
||||
syn keyword vimFuncName contained add arglistid assert_exception assert_notequal autocmd_add blob2list bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler echoraw executable expand filereadable flattennew foldclosed fullcommand getbufline getcharsearch getcmdtype getenv getimstatus getmousepos getregtype gettext glob hasmapto hlget index inputsave isdirectory job_info js_decode libcall list2str log mapcheck matchadd matchfuzzy max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_getprompt prop_add_list prop_type_add pum_getpos rand readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setcmdline setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_gui_event test_null_function test_option_not_set test_srand_seed timer_start tr undofile virtcol2col windowsversion win_gotoid winline winrestview wordcount
|
||||
syn keyword vimFuncName contained and argv assert_fails assert_notmatch autocmd_delete browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID empty execute expandcmd filewritable float2nr foldclosedend funcref getbufvar getcharstr getcmdwintype getfontname getjumplist getpid getscriptinfo getwininfo glob2regpat histadd hlID indexof inputsecret isinf job_setoptions js_encode libcallnr listener_add log10 maplist matchaddpos matchfuzzypos menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setcallback prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_ignore_error test_null_job test_override test_unknown timer_stop trim undotree visualmode win_execute winheight win_move_separator winsaveview writefile
|
||||
syn keyword vimFuncName contained append asin assert_false assert_report autocmd_get browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy digraph_get environ exepath expr10 filter floor foldlevel function getchangelist getcmdcompltype getcompletion getfperm getline getpos gettabinfo getwinpos globpath histdel hlset input insert islocked job_start json_decode line listener_flush luaeval mapnew matcharg matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setinterrupt prop_find prop_type_delete py3eval readblob reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcellwidths setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_null_blob test_null_list test_refcount test_void timer_stopall trunc uniq wildmenumode win_findbuf win_id2tabwin win_move_statusline win_screenpos xor
|
||||
syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true balloon_gettext bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete digraph_getlist escape exists extend finddir fmod foldtext garbagecollect getchar getcmdline getcurpos getfsize getloclist getqflist gettabvar getwinposx has histget hostname inputdialog interrupt isnan job_status json_encode line2byte
|
||||
syn keyword vimFuncName contained abs argc assert_equal assert_match atan balloon_show bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline digraph_set eval exists_compiled extendnew findfile fnameescape foldtextresult get getcharmod getcmdpos getcursorcharpos getftime getmarklist getreg gettabwinvar getwinposy has_key histnr iconv inputlist invert items job_stop keys line2byte listener_remove map mapset matchdelete matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prompt_setprompt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_channel test_null_partial test_setmouse timer_info tolower type values winbufnr win_getid win_id2win winnr win_splitmove
|
||||
syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 balloon_split buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype digraph_setlist eventhandler exp feedkeys flatten fnamemodify foreground getbufinfo getcharpos getcmdscreenpos getcwd getftype getmatches getreginfo gettagstack getwinvar haslocaldir hlexists indent inputrestore isabsolutepath job_getchannel join keytrans lispindent localtime maparg match matchend matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_add prop_remove prop_type_list pyxeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setcharsearch setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_dict test_null_string test_settime timer_pause toupper typename virtcol wincol win_gettype winlayout winrestcmd winwidth
|
||||
syn keyword vimFuncName contained add arglistid assert_exception assert_notequal autocmd_add blob2list bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler echoraw executable expand filereadable flattennew foldclosed fullcommand getbufline getcharsearch getcmdtype getenv getimstatus getmousepos getregtype gettext glob hasmapto hlget index inputsave isdirectory job_info js_decode len list2blob log mapcheck matchadd matchfuzzy max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_getprompt prop_add_list prop_type_add pum_getpos rand readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setcmdline setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_gui_event test_null_function test_option_not_set test_srand_seed timer_start tr undofile virtcol2col windowsversion win_gotoid winline winrestview wordcount
|
||||
syn keyword vimFuncName contained and argv assert_fails assert_notmatch autocmd_delete browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID empty execute expandcmd filewritable float2nr foldclosedend funcref getbufvar getcharstr getcmdwintype getfontname getjumplist getpid getscriptinfo getwininfo glob2regpat histadd hlID indexof inputsecret isinf job_setoptions js_encode libcall list2str log10 maplist matchaddpos matchfuzzypos menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setcallback prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_ignore_error test_null_job test_override test_unknown timer_stop trim undotree visualmode win_execute winheight win_move_separator winsaveview writefile
|
||||
syn keyword vimFuncName contained append asin assert_false assert_report autocmd_get browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy digraph_get environ exepath expr10 filter floor foldlevel function getchangelist getcmdcompltype getcompletion getfperm getline getpos gettabinfo getwinpos globpath histdel hlset input insert islocked job_start json_decode libcallnr listener_add luaeval mapnew matcharg matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setinterrupt prop_find prop_type_delete py3eval readblob reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcellwidths setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_null_blob test_null_list test_refcount test_void timer_stopall trunc uniq wildmenumode win_findbuf win_id2tabwin win_move_statusline win_screenpos xor
|
||||
syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true balloon_gettext bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete digraph_getlist escape exists extend finddir fmod foldtext garbagecollect getchar getcmdline getcurpos getfsize getloclist getqflist gettabvar getwinposx has histget hostname inputdialog interrupt isnan job_status json_encode line listener_flush
|
||||
|
||||
"--- syntax here and above generated by mkvimvim ---
|
||||
" Special Vim Highlighting (not automatic) {{{1
|
||||
@@ -401,7 +401,7 @@ syn match vimSetMod contained "&vim\=\|[!&?<]\|all&"
|
||||
" Let: {{{2
|
||||
" ===
|
||||
syn keyword vimLet let unl[et] skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc
|
||||
VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s\+\%(trim\|eval\>\)\=\s*\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$'
|
||||
VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s\+\%(trim\s\+\)\=\%(eval\s\+\)\=\s*\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$'
|
||||
|
||||
" Abbreviations: {{{2
|
||||
" =============
|
||||
@@ -649,7 +649,7 @@ syn match vimCtrlChar "[--]"
|
||||
|
||||
" Beginners - Patterns that involve ^ {{{2
|
||||
" =========
|
||||
syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
|
||||
syn match vimLineComment +^[ \t:]*"\("[^"]*"\|[^"]\)*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
|
||||
syn match vim9LineComment +^[ \t:]\+#.*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
|
||||
syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup
|
||||
syn match vimContinue "^\s*\\"
|
||||
|
||||
@@ -158,7 +158,8 @@ func! BuildCombiningTable()
|
||||
let end = -1
|
||||
let ranges = []
|
||||
for p in s:dataprops
|
||||
if p[2] == 'Mn' || p[2] == 'Mc' || p[2] == 'Me'
|
||||
" The 'Mc' property was removed, it does take up space.
|
||||
if p[2] == 'Mn' || p[2] == 'Me'
|
||||
let n = ('0x' . p[0]) + 0
|
||||
if start >= 0 && end + 1 == n
|
||||
" continue with same range.
|
||||
@@ -462,8 +463,9 @@ let s:ambitable = []
|
||||
call BuildWidthTable('A', 'ambiguous')
|
||||
|
||||
" Edit the emoji text file. Requires the netrw plugin.
|
||||
edit https://unicode.org/Public/emoji/12.1/emoji-data.txt
|
||||
|
||||
" Build the emoji table. Ver. 1.0 - 6.0
|
||||
" Must come after the "ambiguous" and "doublewidth" tables
|
||||
call BuildEmojiTable()
|
||||
" commented out, because it drops too many characters
|
||||
"edit https://unicode.org/Public/15.0.0/ucd/emoji/emoji-data.txt
|
||||
"
|
||||
"" Build the emoji table. Ver. 1.0 - 6.0
|
||||
"" Must come after the "ambiguous" and "doublewidth" tables
|
||||
"call BuildEmojiTable()
|
||||
|
||||
@@ -12,7 +12,7 @@ this, then you will get the default behavior as is documented, which should
|
||||
be fine for most people.
|
||||
|
||||
This document assumes that you are building Vim for Win32 or later (Windows
|
||||
XP/2003/Vista/7/8/10). There are also instructions for pre-XP systems, but
|
||||
7/8/10/11). There are also instructions for pre-Vista and pre-XP systems, but
|
||||
they might no longer work.
|
||||
|
||||
The recommended way is to build a 32 bit Vim, also on 64 bit systems. You can
|
||||
@@ -42,9 +42,9 @@ Contents:
|
||||
|
||||
|
||||
The currently recommended way (that means it has been verified to work) is
|
||||
using the "Visual Studio Community 2015" installation. This includes the SDK
|
||||
needed to target Windows XP. But not older Windows versions (95, 98), see
|
||||
"OLDER VERSIONS" below for that.
|
||||
using the "Visual Studio Community 2015" installation. This doesn't include
|
||||
the SDK for older Windows versions (95, 98), see "OLDER VERSIONS" below for
|
||||
that.
|
||||
|
||||
|
||||
1. Microsoft Visual C++
|
||||
@@ -57,20 +57,30 @@ execute the installer from it.
|
||||
|
||||
When installing "Visual Studio Community 2015 with Update 3" or "Visual C++
|
||||
Build Tools for Visual Studio 2015 with Update 3" make sure to
|
||||
select "custom" and check "Windows XP Support for C++" and all checkboxes
|
||||
under "Universal Windows App Development Tools". Or whatever they are called
|
||||
now.
|
||||
select "custom" and check all checkboxes under "Universal Windows App
|
||||
Development Tools". Or whatever they are called now.
|
||||
(If you still want to target Windows XP, check also "Windows XP Support for
|
||||
C++". Note that with the current source code this is no longer supported, you
|
||||
will have to check out an older version).
|
||||
|
||||
|
||||
Visual Studio
|
||||
-------------
|
||||
|
||||
Building with Visual Studio (VS2010, VS2012, VS2013, VS2015, VS2017 and VS2019)
|
||||
is straightforward.
|
||||
Building with Visual Studio (VS2015, VS2017, VS2019 and VS2022) is
|
||||
straightforward. Older versions probably don't work.
|
||||
|
||||
Visual Studio installed a batch file called vcvarsall.bat, which you must
|
||||
run to set up paths for nmake and MSVC. We provide a batch file
|
||||
"msvc2015.bat" for this. You may need to edit it if you didn't instal Visual
|
||||
Studio in the standard location.
|
||||
If you use VS2017 or later, you can use "msvc-latest.bat" (or "msvc2017.bat"
|
||||
and so on for the specific version). You must specify the architecture (e.g.
|
||||
"x86", "x64", etc.) as the first argument when you use this. If you use VS2017
|
||||
Express, you must use "x86_amd64" instead of "x64" for targeting the x64
|
||||
platform.
|
||||
|
||||
To build Vim from the command line with MSVC, use Make_mvc.mak.
|
||||
Visual Studio installed a batch file called vcvars32.bat, which you must
|
||||
run to set up paths for nmake and MSVC.
|
||||
|
||||
nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++
|
||||
nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++
|
||||
@@ -87,23 +97,15 @@ to the parameters you pass to Make_mvc.mak.
|
||||
See the specific files for comments and options.
|
||||
|
||||
These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and
|
||||
Ron Aaron; they have been tested.
|
||||
Ron Aaron; they have been tested. But several things changed after that...
|
||||
|
||||
|
||||
Visual C++ 2010 Express Edition *msvc-2010-express*
|
||||
-------------------------------
|
||||
|
||||
Visual C++ 2010 Express Edition can be downloaded for free from:
|
||||
http://www.microsoft.com/express/vc/Default.aspx
|
||||
This includes the IDE and the debugger.
|
||||
|
||||
To set the environment execute the msvc2010.bat script. You can then build
|
||||
Vim with Make_mvc.mak.
|
||||
|
||||
|
||||
Targeting Windows XP with MSVC 2012 and later *new-msvc-windows-xp*
|
||||
Targeting Windows XP with MSVC 2015 and later *new-msvc-windows-xp*
|
||||
---------------------------------------------
|
||||
|
||||
(The support for pre-Vista was removed in patch 9.0.0496. If you want to
|
||||
target Windows XP, use the source code before that.)
|
||||
|
||||
Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE
|
||||
so that it targets Windows 6.0 (Vista) by default. In order to override
|
||||
this, the target Windows version number needs to be passed to LINK like
|
||||
@@ -141,9 +143,6 @@ compiler by using the "x64" option:
|
||||
The following Visual C++ team blog can serve as a reference page:
|
||||
http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
|
||||
|
||||
VC 2019 dropped support for targeting Windows XP. If you want a binary that
|
||||
targeting Windows XP, use VC 2017 or earlier.
|
||||
|
||||
|
||||
Cross compile support for Windows on ARM64
|
||||
------------------------------------------
|
||||
@@ -156,42 +155,13 @@ The ARM64 support was provided by Leendert van Doorn.
|
||||
|
||||
OLDER VERSIONS
|
||||
|
||||
The minimal supported version is Windows XP. Building with older compilers
|
||||
might still work, but these instructions might be outdated.
|
||||
The minimal supported version is Windows 7. Building with compilers
|
||||
older than 2015 most likely doesn't work. Since MSVC 2015 can be obtained for
|
||||
free there is no point in supporting older versions.
|
||||
|
||||
If you need the executable to run on Windows 98 or ME, use the 2005 one
|
||||
|msvc-2005-express|, and use the source code before 8.0.0029.
|
||||
|
||||
|
||||
Visual C++ 2005 Express Edition *msvc-2005-express*
|
||||
-------------------------------
|
||||
|
||||
NOTE: this most likely does not work
|
||||
|
||||
Visual C++ 2005 Express Edition can be downloaded for free from:
|
||||
http://msdn.microsoft.com/vstudio/express/visualC/default.aspx
|
||||
This includes the IDE and the debugger. You will also need
|
||||
|ms-platform-sdk|. You can build Vim with Make_mvc.mak.
|
||||
|
||||
Instructions for integrating the Platform SDK into VC Express:
|
||||
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
|
||||
|
||||
|
||||
Visual C++ 2008 Express Edition *msvc-2008-express*
|
||||
-------------------------------
|
||||
|
||||
NOTE: this most likely does not work
|
||||
|
||||
Visual C++ 2008 Express Edition can be downloaded for free from:
|
||||
http://www.microsoft.com/express/downloads/
|
||||
This includes the IDE and the debugger.
|
||||
|
||||
To set the environment execute the msvc2008.bat script. You can then build
|
||||
Vim with Make_mvc.mak.
|
||||
|
||||
For building 64 bit binaries you also need to install the SDK:
|
||||
"Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1"
|
||||
You don't need the examples and documentation.
|
||||
|msvc-2005-express|, and use the source code before 8.0.0029. See the
|
||||
src/INSTALLpc.txt file for instructions.
|
||||
|
||||
|
||||
2. MSYS2 with MinGW
|
||||
@@ -716,7 +686,6 @@ Ruby version vs. Ruby API version:
|
||||
|
||||
Ruby ver. | Ruby API ver.
|
||||
=========================
|
||||
1.8.X | 1.8
|
||||
1.9.[1-3] | 1.9.1
|
||||
2.0.0 | 2.0.0
|
||||
2.X.Y | 2.X.0
|
||||
@@ -774,12 +743,12 @@ config.h and Ruby's DLL name. Here are the steps for working around them:
|
||||
nmake -f Make_mvc.mak
|
||||
RUBY=C:\Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
|
||||
RUBY_MSVCRT_NAME=msvcrt
|
||||
WINVER=0x501
|
||||
WINVER=0x601
|
||||
|
||||
For 64-bit version, replace RUBY=C:\Ruby24 with RUBY=C:\Ruby24-x64.
|
||||
|
||||
If you set WINVER explicitly, it must be set to >=0x500, when building
|
||||
with Ruby 2.1 or later. (Default is 0x501.)
|
||||
with Ruby 2.1 or later. (Default is 0x601.)
|
||||
When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt
|
||||
which is used for the Ruby's DLL name.
|
||||
|
||||
@@ -790,11 +759,11 @@ After you install RubyInstaller, just type this (as one line):
|
||||
|
||||
mingw32-make -f Make_ming.mak
|
||||
RUBY=C:/Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
|
||||
WINVER=0x600
|
||||
WINVER=0x601
|
||||
|
||||
For 64-bit version, replace RUBY=C:/Ruby24 with RUBY=C:/Ruby24-x64.
|
||||
If you set WINVER explicitly, it must be set to >=0x500, when building with
|
||||
Ruby 2.1 or later. (Default is 0x600.)
|
||||
Ruby 2.1 or later. (Default is 0x601.)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -77,9 +77,7 @@ from CVS mirror ftp://ftp.polarhome.com/pub/cvs/SOURCE/
|
||||
|
||||
Parameter name : MODEL
|
||||
Description : Build model selection
|
||||
Options: : TINY - Almost no features enabled, not even
|
||||
multiple windows
|
||||
SMALL - Few features enabled, as basic as possible
|
||||
Options: : TINY - No optional features enabled
|
||||
NORMAL - A default selection of features enabled
|
||||
BIG - Many features enabled, as rich as possible.
|
||||
(OpenVMS default)
|
||||
|
||||
@@ -45,9 +45,9 @@ CFLAGS +=\
|
||||
-DFEAT_NORMAL
|
||||
else
|
||||
|
||||
# Vim 'small' build
|
||||
# Vim 'small' build - now an alias for 'tiny'
|
||||
ifeq ($(BUILD),small)
|
||||
CFLAGS += -DFEAT_SMALL
|
||||
CFLAGS += -DFEAT_TINY
|
||||
else
|
||||
|
||||
# Vim 'tiny' build
|
||||
@@ -68,7 +68,8 @@ ifeq ($(UNM),AROS)
|
||||
LDFLAGS = -DHAVE_FSYNC -ldebug
|
||||
else
|
||||
ifeq ($(UNM),MorphOS)
|
||||
LDFLAGS = -ldebug -noixemul
|
||||
CFLAGS += -noixemul
|
||||
LDFLAGS = -ldebug -lm -noixemul
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
# Updated 2014 Oct 13.
|
||||
|
||||
#>>>>> choose options:
|
||||
# FEATURES=[TINY | SMALL | NORMAL | BIG | HUGE]
|
||||
# Set to TINY to make minimal version (few features).
|
||||
# FEATURES=[TINY | NORMAL | BIG | HUGE]
|
||||
# Set to TINY to make a minimal version (no optional features).
|
||||
FEATURES=HUGE
|
||||
|
||||
# Set to yes for a debug build.
|
||||
@@ -87,10 +87,9 @@ POSTSCRIPT=no
|
||||
# Set to yes to enable OLE support.
|
||||
OLE=no
|
||||
|
||||
# Set the default $(WINVER). Use 0x0501 to make it work with WinXP.
|
||||
# Set the default $(WINVER). Use 0x0601 to make it work with Windows 7.
|
||||
ifndef WINVER
|
||||
# WINVER = 0x0501
|
||||
WINVER = 0x0600
|
||||
WINVER = 0x0601
|
||||
endif
|
||||
|
||||
# Set to yes to enable Cscope support.
|
||||
@@ -442,7 +441,7 @@ endif
|
||||
# RUBY=[Path to Ruby directory] (Set inside Make_cyg.mak or Make_ming.mak)
|
||||
# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically, "no" for static)
|
||||
# RUBY_VER=[Ruby version, eg 19, 22] (default is 22)
|
||||
# RUBY_API_VER_LONG=[Ruby API version, eg 1.8, 1.9.1, 2.2.0]
|
||||
# RUBY_API_VER_LONG=[Ruby API version, eg 1.9.1, 2.2.0]
|
||||
# (default is 2.2.0)
|
||||
# You must set RUBY_API_VER_LONG when changing RUBY_VER.
|
||||
# Note: If you use Ruby 1.9.3, set as follows:
|
||||
@@ -467,9 +466,7 @@ RUBY_API_VER = $(subst .,,$(RUBY_API_VER_LONG))
|
||||
endif
|
||||
|
||||
ifndef RUBY_PLATFORM
|
||||
ifeq ($(RUBY_VER), 16)
|
||||
RUBY_PLATFORM = i586-mswin32
|
||||
else ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/i386-mingw32),)
|
||||
ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/i386-mingw32),)
|
||||
RUBY_PLATFORM = i386-mingw32
|
||||
else ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/x64-mingw32),)
|
||||
RUBY_PLATFORM = x64-mingw32
|
||||
@@ -481,32 +478,20 @@ RUBY_PLATFORM = i386-mswin32
|
||||
endif
|
||||
|
||||
ifndef RUBY_INSTALL_NAME
|
||||
ifeq ($(RUBY_VER), 16)
|
||||
RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
|
||||
else
|
||||
ifndef RUBY_MSVCRT_NAME
|
||||
ifndef RUBY_MSVCRT_NAME
|
||||
# Base name of msvcrXX.dll which is used by ruby's dll.
|
||||
RUBY_MSVCRT_NAME = msvcrt
|
||||
endif
|
||||
ifeq ($(RUBY_PLATFORM),x64-mingw-ucrt)
|
||||
endif
|
||||
ifeq ($(RUBY_PLATFORM),x64-mingw-ucrt)
|
||||
RUBY_INSTALL_NAME = x64-ucrt-ruby$(RUBY_API_VER)
|
||||
else ifeq ($(ARCH),x86-64)
|
||||
else ifeq ($(ARCH),x86-64)
|
||||
RUBY_INSTALL_NAME = x64-$(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER)
|
||||
else
|
||||
else
|
||||
RUBY_INSTALL_NAME = $(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq (19, $(word 1,$(sort 19 $(RUBY_VER))))
|
||||
RUBY_19_OR_LATER = 1
|
||||
endif
|
||||
|
||||
ifdef RUBY_19_OR_LATER
|
||||
RUBYINC = -I $(RUBY)/include/ruby-$(RUBY_API_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_API_VER_LONG)/$(RUBY_PLATFORM)
|
||||
else
|
||||
RUBYINC = -I $(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/$(RUBY_PLATFORM)
|
||||
endif
|
||||
ifeq (no, $(DYNAMIC_RUBY))
|
||||
RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME)
|
||||
endif
|
||||
@@ -1321,7 +1306,7 @@ ifeq (16, $(RUBY))
|
||||
endif
|
||||
|
||||
$(OUTDIR)/iscygpty.o: iscygpty.c $(CUI_INCL)
|
||||
$(CC) -c $(CFLAGS) iscygpty.c -o $(OUTDIR)/iscygpty.o -U_WIN32_WINNT -D_WIN32_WINNT=0x0600 -DUSE_DYNFILEID -DENABLE_STUB_IMPL
|
||||
$(CC) -c $(CFLAGS) iscygpty.c -o $@
|
||||
|
||||
$(OUTDIR)/main.o: main.c $(INCL) $(CUI_INCL)
|
||||
$(CC) -c $(CFLAGS) main.c -o $@
|
||||
|
||||
230
src/Make_mvc.mak
230
src/Make_mvc.mak
@@ -1,7 +1,6 @@
|
||||
# Makefile for Vim on Win32 (Windows XP/2003/Vista/7/8/10) and Win64,
|
||||
# using the Microsoft Visual C++ compilers. Known to work with VC10 (VS2010),
|
||||
# VC11 (VS2012), VC12 (VS2013), VC14 (VS2015), VC14.1 (VS2017) and
|
||||
# VC14.2 (VS2019).
|
||||
# Makefile for Vim on Win32 (Windows 7/8/10/11) and Win64, using the Microsoft
|
||||
# Visual C++ compilers. Known to work with VC14 (VS2015), VC14.1 (VS2017),
|
||||
# VC14.2 (VS2019) and VC14.3 (VS2022).
|
||||
#
|
||||
# To build using other Windows compilers, see INSTALLpc.txt
|
||||
#
|
||||
@@ -17,7 +16,7 @@
|
||||
#
|
||||
# !!!! After changing any features do "nmake clean" first !!!!
|
||||
#
|
||||
# Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, HUGE] (default is HUGE)
|
||||
# Feature Set: FEATURES=[TINY, NORMAL, BIG, HUGE] (default is HUGE)
|
||||
#
|
||||
# Name to add to the version: MODIFIED_BY=[name of modifier]
|
||||
#
|
||||
@@ -87,7 +86,7 @@
|
||||
# RUBY=[Path to Ruby directory]
|
||||
# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
|
||||
# RUBY_VER=[Ruby version, eg 19, 22] (default is 22)
|
||||
# RUBY_API_VER_LONG=[Ruby API version, eg 1.8, 1.9.1, 2.2.0]
|
||||
# RUBY_API_VER_LONG=[Ruby API version, eg 1.9.1, 2.2.0]
|
||||
# (default is 2.2.0)
|
||||
# You must set RUBY_API_VER_LONG when change RUBY_VER.
|
||||
# Note: If you use Ruby 1.9.3, set as follows:
|
||||
@@ -128,13 +127,13 @@
|
||||
#
|
||||
# Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
|
||||
#
|
||||
# Processor Version: CPUNR=[any, i586, i686, sse, sse2, avx, avx2] (default is
|
||||
# any)
|
||||
# Processor Version: CPUNR=[any, i686, sse, sse2, avx, avx2] (default is
|
||||
# sse2)
|
||||
# avx is available on Visual C++ 2010 and after.
|
||||
# avx2 is available on Visual C++ 2013 Update 2 and after.
|
||||
#
|
||||
# Version Support: WINVER=[0x0501, 0x0502, 0x0600, 0x0601, 0x0602,
|
||||
# 0x0603, 0x0A00] (default is 0x0501)
|
||||
# Version Support: WINVER=[0x0601, 0x0602, 0x0603, 0x0A00] (default is
|
||||
# 0x0601)
|
||||
# Supported versions depends on your target SDK, check SDKDDKVer.h
|
||||
# See https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt
|
||||
#
|
||||
@@ -267,12 +266,14 @@ LINK = link
|
||||
!endif
|
||||
|
||||
!if $(MSVCVER) < 1900
|
||||
MSVC_MAJOR = ($(MSVCVER) / 100 - 6)
|
||||
MSVCRT_VER = ($(MSVCVER) / 10 - 60)
|
||||
!else
|
||||
! message *** ERROR
|
||||
! message Unsupported MSVC version.
|
||||
! message Please use Visual C++ 2015 or later.
|
||||
! error Make aborted.
|
||||
!endif
|
||||
|
||||
MSVC_MAJOR = ($(MSVCVER) / 100 - 5)
|
||||
MSVCRT_VER = ($(MSVCVER) / 100 * 10 - 50)
|
||||
!endif
|
||||
|
||||
# Calculate MSVC_FULL.
|
||||
!if [echo MSVC_FULL=_MSC_FULL_VER> msvcfullver.c && $(CC) /EP msvcfullver.c > msvcfullver.~ 2> nul]
|
||||
@@ -294,28 +295,17 @@ MSVCRT_VER = ($(MSVCVER) / 100 * 10 - 50)
|
||||
! endif
|
||||
!endif
|
||||
|
||||
# Base name of the msvcrXX.dll
|
||||
!if $(MSVCRT_VER) <= 60
|
||||
MSVCRT_NAME = msvcrt
|
||||
!elseif $(MSVCRT_VER) <= 130
|
||||
MSVCRT_NAME = msvcr$(MSVCRT_VER)
|
||||
!else
|
||||
# Base name of the msvcrXX.dll (vcruntimeXXX.dll)
|
||||
MSVCRT_NAME = vcruntime$(MSVCRT_VER)
|
||||
!endif
|
||||
|
||||
### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
|
||||
### Set the default $(WINVER) to make it work with Windows 7
|
||||
!ifndef WINVER
|
||||
WINVER = 0x0501
|
||||
WINVER = 0x0601
|
||||
!endif
|
||||
|
||||
# Use multiprocess build
|
||||
USE_MP = yes
|
||||
|
||||
#>>>>> path of the compiler and linker; name of include and lib directories
|
||||
# PATH = c:\msvc20\bin;$(PATH)
|
||||
# INCLUDE = c:\msvc20\include
|
||||
# LIB = c:\msvc20\lib
|
||||
|
||||
!if "$(FEATURES)"==""
|
||||
FEATURES = HUGE
|
||||
!endif
|
||||
@@ -462,13 +452,7 @@ XPM = no
|
||||
# See the xpm directory for more information.
|
||||
XPM_OBJ = $(OBJDIR)/xpm_w32.obj
|
||||
XPM_DEFS = -DFEAT_XPM_W32
|
||||
! if $(MSVC_MAJOR) >= 14
|
||||
# VC14 cannot use a library built by VC12 or earlier, because VC14 uses
|
||||
# Universal CRT.
|
||||
XPM_LIB = $(XPM)\lib-vc14\libXpm.lib
|
||||
! else
|
||||
XPM_LIB = $(XPM)\lib\libXpm.lib
|
||||
! endif
|
||||
XPM_INC = -I $(XPM)\include -I $(XPM)\..\include
|
||||
! endif
|
||||
!endif # GUI
|
||||
@@ -483,10 +467,7 @@ SOUND_LIB = winmm.lib
|
||||
!if "$(CHANNEL)" == "yes"
|
||||
CHANNEL_PRO = proto/job.pro proto/channel.pro
|
||||
CHANNEL_OBJ = $(OBJDIR)/job.obj $(OBJDIR)/channel.obj
|
||||
CHANNEL_DEFS = -DFEAT_JOB_CHANNEL -DFEAT_IPV6
|
||||
! if $(WINVER) >= 0x600
|
||||
CHANNEL_DEFS = $(CHANNEL_DEFS) -DHAVE_INET_NTOP
|
||||
! endif
|
||||
CHANNEL_DEFS = -DFEAT_JOB_CHANNEL -DFEAT_IPV6 -DHAVE_INET_NTOP
|
||||
|
||||
NETBEANS_LIB = WSock32.lib Ws2_32.lib
|
||||
!endif
|
||||
@@ -508,10 +489,11 @@ CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
|
||||
#VIMRCLOC = somewhere
|
||||
#VIMRUNTIMEDIR = somewhere
|
||||
|
||||
CFLAGS = -c /W3 /GF /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
|
||||
CFLAGS = -c /W3 /GF /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DHAVE_STDINT_H \
|
||||
$(CSCOPE_DEFS) $(TERM_DEFS) $(SOUND_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \
|
||||
$(NBDEBUG_DEFS) $(XPM_DEFS) $(SOD_DEFS) $(SOD_INC) \
|
||||
$(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
|
||||
$(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
|
||||
/source-charset:utf-8
|
||||
|
||||
#>>>>> end of choices
|
||||
###########################################################################
|
||||
@@ -523,70 +505,36 @@ OUTDIR=$(OBJDIR)
|
||||
|
||||
### Validate CPUNR
|
||||
!ifndef CPUNR
|
||||
# default to untargeted code
|
||||
CPUNR = any
|
||||
!elseif "$(CPUNR)" == "i386" || "$(CPUNR)" == "i486"
|
||||
# alias i386 and i486 to i586
|
||||
# default to SSE2
|
||||
CPUNR = sse2
|
||||
!elseif "$(CPUNR)" == "i386" || "$(CPUNR)" == "i486" || "$(CPUNR)" == "i586"
|
||||
# alias i386, i486 and i586 to i686
|
||||
! message *** WARNING CPUNR=$(CPUNR) is not a valid target architecture.
|
||||
! message Windows XP is the minimum target OS, with a minimum target
|
||||
! message architecture of i586.
|
||||
! message Retargeting to i586
|
||||
CPUNR = i586
|
||||
! message Windows 7 is the minimum target OS, with a minimum target
|
||||
! message architecture of i686.
|
||||
! message Retargeting to i686
|
||||
CPUNR = i686
|
||||
!elseif "$(CPUNR)" == "pentium4"
|
||||
# alias pentium4 to sse2
|
||||
! message *** WARNING CPUNR=pentium4 is deprecated in favour of sse2.
|
||||
! message Retargeting to sse2.
|
||||
CPUNR = sse2
|
||||
!elseif "$(CPUNR)" != "any" && "$(CPUNR)" != "i586" && "$(CPUNR)" != "i686" && "$(CPUNR)" != "sse" && "$(CPUNR)" != "sse2" && "$(CPUNR)" != "avx" && "$(CPUNR)" != "avx2"
|
||||
!elseif "$(CPUNR)" != "any" && "$(CPUNR)" != "i686" && "$(CPUNR)" != "sse" && "$(CPUNR)" != "sse2" && "$(CPUNR)" != "avx" && "$(CPUNR)" != "avx2"
|
||||
! error *** ERROR Unknown target architecture "$(CPUNR)". Make aborted.
|
||||
!endif
|
||||
|
||||
# Convert processor ID to MVC-compatible number
|
||||
# IA32/SSE/SSE2 are only supported on x86
|
||||
!if "$(ASSEMBLY_ARCHITECTURE)" == "i386" && ("$(CPUNR)" == "i586" || "$(CPUNR)" == "i686" || "$(CPUNR)" == "any")
|
||||
# VC<11 generates fp87 code by default
|
||||
! if $(MSVC_MAJOR) < 11
|
||||
CPUARG =
|
||||
# VC>=11 needs explicit instructions to generate fp87 code
|
||||
! else
|
||||
!if "$(ASSEMBLY_ARCHITECTURE)" == "i386" && ("$(CPUNR)" == "i686" || "$(CPUNR)" == "any")
|
||||
CPUARG = /arch:IA32
|
||||
! endif
|
||||
!elseif "$(ASSEMBLY_ARCHITECTURE)" == "i386" && "$(CPUNR)" == "sse"
|
||||
CPUARG = /arch:SSE
|
||||
!elseif "$(ASSEMBLY_ARCHITECTURE)" == "i386" && "$(CPUNR)" == "sse2"
|
||||
CPUARG = /arch:SSE2
|
||||
!elseif "$(CPUNR)" == "avx"
|
||||
# AVX is only supported by VC 10 and up
|
||||
! if $(MSVC_MAJOR) < 10
|
||||
! message AVX Instruction Set is not supported by Visual C++ v$(MSVC_MAJOR)
|
||||
! if "$(ASSEMBLY_ARCHITECTURE)" == "i386"
|
||||
! message Falling back to SSE2
|
||||
CPUARG = /arch:SSE2
|
||||
! else
|
||||
CPUARG =
|
||||
! endif
|
||||
! else
|
||||
CPUARG = /arch:AVX
|
||||
! endif
|
||||
!elseif "$(CPUNR)" == "avx2"
|
||||
# AVX is only supported by VC 10 and up
|
||||
! if $(MSVC_MAJOR) < 10
|
||||
! message AVX2 Instruction Set is not supported by Visual C++ v$(MSVC_MAJOR)
|
||||
! if "$(ASSEMBLY_ARCHITECTURE)" == "i386"
|
||||
! message Falling back to SSE2
|
||||
CPUARG = /arch:SSE2
|
||||
! else
|
||||
CPUARG =
|
||||
! endif
|
||||
# AVX2 is only supported by VC 12U2 and up
|
||||
# 180030501 is the full version number for Visual Studio 2013/VC 12 Update 2
|
||||
! elseif $(MSVC_FULL) < 180030501
|
||||
! message AVX2 Instruction Set is not supported by Visual C++ v$(MSVC_MAJOR)-$(MSVC_FULL)
|
||||
! message Falling back to AVX
|
||||
CPUARG = /arch:AVX
|
||||
! else
|
||||
CPUARG = /arch:AVX2
|
||||
! endif
|
||||
!endif
|
||||
|
||||
# Pass CPUARG to GvimExt, to avoid using version-dependent defaults
|
||||
@@ -607,38 +555,19 @@ VIMDLLBASE = $(VIMDLLBASE)d
|
||||
LIBC =
|
||||
DEBUGINFO = /Zi
|
||||
|
||||
# Don't use /nodefaultlib on MSVC 14
|
||||
!if $(MSVC_MAJOR) >= 14
|
||||
NODEFAULTLIB =
|
||||
!else
|
||||
NODEFAULTLIB = /nodefaultlib
|
||||
!endif
|
||||
|
||||
# Specify source code charset to suppress warning C4819 on non-English
|
||||
# environment. Only available from MSVC 14.
|
||||
!if $(MSVC_MAJOR) >= 14
|
||||
CFLAGS = $(CFLAGS) /source-charset:utf-8
|
||||
!endif
|
||||
|
||||
# Use multiprocess build on MSVC 10
|
||||
!if ("$(USE_MP)" == "yes") && ($(MSVC_MAJOR) >= 10)
|
||||
# Use multiprocess build.
|
||||
!if "$(USE_MP)" == "yes"
|
||||
CFLAGS = $(CFLAGS) /MP
|
||||
!endif
|
||||
|
||||
# VC10 or later has stdint.h.
|
||||
!if $(MSVC_MAJOR) >= 10
|
||||
CFLAGS = $(CFLAGS) -DHAVE_STDINT_H
|
||||
!endif
|
||||
|
||||
# Static code analysis generally available starting with VS2012 (VC11) or
|
||||
# Windows SDK 7.1 (VC10)
|
||||
!if ("$(ANALYZE)" == "yes") && ($(MSVC_MAJOR) >= 10)
|
||||
# Use static code analysis
|
||||
!if "$(ANALYZE)" == "yes"
|
||||
CFLAGS = $(CFLAGS) /analyze
|
||||
!endif
|
||||
|
||||
# Address Sanitizer (ASAN) generally available starting with VS2019 version
|
||||
# 16.9
|
||||
!if ("$(ASAN)" == "yes") && ($(MSVC_MAJOR) >= 14)
|
||||
!if ("$(ASAN)" == "yes") && ($(MSVC_FULL) >= 192829913)
|
||||
CFLAGS = $(CFLAGS) /fsanitize=address
|
||||
!endif
|
||||
|
||||
@@ -688,10 +617,6 @@ LIBC = $(LIBC) libcmtd.lib
|
||||
|
||||
!endif # DEBUG
|
||||
|
||||
!if "$(CL)" == "/D_USING_V110_SDK71_"
|
||||
RCFLAGS = $(RCFLAGS) /D_USING_V110_SDK71_
|
||||
!endif
|
||||
|
||||
# Visual Studio 2005 has 'deprecated' many of the standard CRT functions
|
||||
CFLAGS_DEPR = /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
|
||||
CFLAGS = $(CFLAGS) $(CFLAGS_DEPR)
|
||||
@@ -1093,13 +1018,7 @@ PERL_VER = 524
|
||||
! endif
|
||||
! message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
|
||||
! if "$(DYNAMIC_PERL)" == "yes"
|
||||
! if $(PERL_VER) >= 56
|
||||
! message Perl DLL will be loaded dynamically
|
||||
! else
|
||||
! message Dynamic loading is not supported for Perl versions earlier than 5.6.0
|
||||
! message Reverting to static loading...
|
||||
! undef DYNAMIC_PERL
|
||||
! endif
|
||||
! message Perl DLL will be loaded dynamically
|
||||
! endif
|
||||
|
||||
# Is Perl installed in architecture-specific directories?
|
||||
@@ -1110,16 +1029,12 @@ PERL_ARCH = \MSWin32-x86
|
||||
PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
|
||||
|
||||
# Version-dependent stuff
|
||||
! if $(PERL_VER) == 55
|
||||
PERL_LIB = $(PERL_INCDIR)\perl.lib
|
||||
! else
|
||||
PERL_DLL = perl$(PERL_VER).dll
|
||||
! if exist($(PERL_INCDIR)\perl$(PERL_VER).lib)
|
||||
! if exist($(PERL_INCDIR)\perl$(PERL_VER).lib)
|
||||
PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
|
||||
! else
|
||||
! else
|
||||
# For ActivePerl 5.18 and later
|
||||
PERL_LIB = $(PERL_INCDIR)\libperl$(PERL_VER).a
|
||||
! endif
|
||||
! endif
|
||||
|
||||
CFLAGS = $(CFLAGS) -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
|
||||
@@ -1132,11 +1047,6 @@ CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
|
||||
|
||||
PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
|
||||
PERL_INC = /I $(PERL_INCDIR)
|
||||
! if $(MSVC_MAJOR) <= 11
|
||||
# ActivePerl 5.20+ requires stdbool.h but VC2012 or earlier doesn't have it.
|
||||
# Use a stub stdbool.h.
|
||||
PERL_INC = $(PERL_INC) /I if_perl_msvc
|
||||
! endif
|
||||
PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
|
||||
XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
|
||||
! if exist($(XSUBPP))
|
||||
@@ -1166,54 +1076,35 @@ RUBY_API_VER_LONG = $(RUBY_VER_LONG)
|
||||
RUBY_API_VER = $(RUBY_API_VER_LONG:.=)
|
||||
! endif
|
||||
|
||||
! if $(RUBY_VER) >= 18
|
||||
|
||||
! ifndef RUBY_PLATFORM
|
||||
! if "$(CPU)" == "i386"
|
||||
! ifndef RUBY_PLATFORM
|
||||
! if "$(CPU)" == "i386"
|
||||
RUBY_PLATFORM = i386-mswin32
|
||||
! else # CPU
|
||||
! else # CPU
|
||||
RUBY_PLATFORM = x64-mswin64
|
||||
! endif # CPU
|
||||
! if $(MSVCRT_VER) >= 70 && $(RUBY_VER) > 19
|
||||
! endif # CPU
|
||||
RUBY_PLATFORM = $(RUBY_PLATFORM)_$(MSVCRT_VER)
|
||||
! endif # MSVCRT_VER
|
||||
! endif # RUBY_PLATFORM
|
||||
! endif # RUBY_PLATFORM
|
||||
|
||||
! ifndef RUBY_INSTALL_NAME
|
||||
! ifndef RUBY_MSVCRT_NAME
|
||||
! ifndef RUBY_INSTALL_NAME
|
||||
! ifndef RUBY_MSVCRT_NAME
|
||||
# Base name of msvcrXX.dll which is used by ruby's dll.
|
||||
RUBY_MSVCRT_NAME = $(MSVCRT_NAME)
|
||||
! endif # RUBY_MSVCRT_NAME
|
||||
! if "$(CPU)" == "i386"
|
||||
! endif # RUBY_MSVCRT_NAME
|
||||
! if "$(CPU)" == "i386"
|
||||
RUBY_INSTALL_NAME = $(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER)
|
||||
! else # CPU
|
||||
! if EXIST($(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/x64-mingw-ucrt)
|
||||
! else # CPU
|
||||
! if EXIST($(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/x64-mingw-ucrt)
|
||||
RUBY_INSTALL_NAME = x64-ucrt-ruby$(RUBY_API_VER)
|
||||
! else
|
||||
! else
|
||||
RUBY_INSTALL_NAME = x64-$(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER)
|
||||
! endif
|
||||
! endif # CPU
|
||||
! endif # RUBY_INSTALL_NAME
|
||||
|
||||
! else # $(RUBY_VER) >= 18
|
||||
|
||||
! ifndef RUBY_PLATFORM
|
||||
RUBY_PLATFORM = i586-mswin32
|
||||
! endif
|
||||
! ifndef RUBY_INSTALL_NAME
|
||||
RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
|
||||
! endif
|
||||
|
||||
! endif # $(RUBY_VER) >= 18
|
||||
! endif
|
||||
! endif # CPU
|
||||
! endif # RUBY_INSTALL_NAME
|
||||
|
||||
! message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
|
||||
CFLAGS = $(CFLAGS) -DFEAT_RUBY
|
||||
RUBY_OBJ = $(OUTDIR)\if_ruby.obj
|
||||
! if $(RUBY_VER) >= 19
|
||||
RUBY_INC = /I "$(RUBY)\include\ruby-$(RUBY_API_VER_LONG)" /I "$(RUBY)\include\ruby-$(RUBY_API_VER_LONG)\$(RUBY_PLATFORM)"
|
||||
! else
|
||||
RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_API_VER_LONG)\$(RUBY_PLATFORM)"
|
||||
! endif
|
||||
RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
|
||||
# Do we want to load Ruby dynamically?
|
||||
! if "$(DYNAMIC_RUBY)" == "yes"
|
||||
@@ -1233,7 +1124,7 @@ CFLAGS = $(CFLAGS) -DMSWINPS
|
||||
!endif # POSTSCRIPT
|
||||
|
||||
#
|
||||
# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
|
||||
# FEATURES: TINY, NORMAL, BIG or HUGE
|
||||
#
|
||||
CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
|
||||
|
||||
@@ -1268,7 +1159,7 @@ CFLAGS_OUTDIR=$(CFLAGS) /Fo$(OUTDIR)/
|
||||
PATHDEF_SRC = $(OUTDIR)\pathdef.c
|
||||
|
||||
LINKARGS1 = /nologo
|
||||
LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) \
|
||||
LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) \
|
||||
$(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \
|
||||
$(TCL_LIB) $(SOUND_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(SOD_LIB) $(LINK_PDB)
|
||||
|
||||
@@ -1301,7 +1192,7 @@ LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
|
||||
! endif
|
||||
!endif
|
||||
|
||||
!if $(MSVC_MAJOR) >= 11 && "$(CPU)" == "AMD64" && "$(GUI)" == "yes"
|
||||
!if "$(CPU)" == "AMD64" && "$(GUI)" == "yes"
|
||||
# This option is required for VC2012 or later so that 64-bit gvim can
|
||||
# accept D&D from 32-bit applications. NOTE: This disables 64-bit ASLR,
|
||||
# therefore the security level becomes as same as VC2010.
|
||||
@@ -1344,11 +1235,9 @@ $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
|
||||
|
||||
$(GVIM).exe: $(OUTDIR) $(EXEOBJG) $(VIMDLLBASE).dll
|
||||
$(LINK) $(LINKARGS1) /subsystem:$(SUBSYSTEM) -out:$(GVIM).exe $(EXEOBJG) $(VIMDLLBASE).lib $(LIBC)
|
||||
if exist $(GVIM).exe.manifest mt.exe -nologo -manifest $(GVIM).exe.manifest -updateresource:$(GVIM).exe;1
|
||||
|
||||
$(VIM).exe: $(OUTDIR) $(EXEOBJC) $(VIMDLLBASE).dll
|
||||
$(LINK) $(LINKARGS1) /subsystem:$(SUBSYSTEM_CON) -out:$(VIM).exe $(EXEOBJC) $(VIMDLLBASE).lib $(LIBC)
|
||||
if exist $(VIM).exe.manifest mt.exe -nologo -manifest $(VIM).exe.manifest -updateresource:$(VIM).exe;1
|
||||
|
||||
!else
|
||||
|
||||
@@ -1363,7 +1252,6 @@ $(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ)
|
||||
$(TCL_OBJ) $(TERM_OBJ) $(SOUND_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ)
|
||||
$(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
|
||||
<<
|
||||
if exist $(VIM).exe.manifest mt.exe -nologo -manifest $(VIM).exe.manifest -updateresource:$(VIM).exe;1
|
||||
|
||||
!endif
|
||||
|
||||
@@ -1684,7 +1572,7 @@ $(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
|
||||
$(CC) $(CFLAGS_OUTDIR) $(TCL_INC) if_tcl.c
|
||||
|
||||
$(OUTDIR)/iscygpty.obj: $(OUTDIR) iscygpty.c $(CUI_INCL)
|
||||
$(CC) $(CFLAGS_OUTDIR) iscygpty.c -D_WIN32_WINNT=0x0600 -DUSE_DYNFILEID -DENABLE_STUB_IMPL
|
||||
$(CC) $(CFLAGS_OUTDIR) iscygpty.c
|
||||
|
||||
$(OUTDIR)/job.obj: $(OUTDIR) job.c $(INCL)
|
||||
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
DECC = YES
|
||||
|
||||
# Build model selection
|
||||
# TINY - Almost no features enabled, not even multiple windows
|
||||
# SMALL - Few features enabled, as basic as possible
|
||||
# TINY - No optional features enabled
|
||||
# NORMAL - A default selection of features enabled
|
||||
# BIG - Many features enabled, as rich as possible. (default)
|
||||
# HUGE - All possible features enabled.
|
||||
|
||||
12
src/Makefile
12
src/Makefile
@@ -386,7 +386,7 @@ CClink = $(CC)
|
||||
# "liblua5.4-dev".
|
||||
# Use --with-luajit if you want to use LuaJIT instead of Lua.
|
||||
# Set PATH environment variable to find lua or luajit executable.
|
||||
# This requires at least "normal" features, "tiny" and "small" don't work.
|
||||
# This requires at least "normal" features, "tiny" doesn't work.
|
||||
#CONF_OPT_LUA = --enable-luainterp
|
||||
#CONF_OPT_LUA = --enable-luainterp=dynamic
|
||||
#CONF_OPT_LUA = --enable-luainterp --with-luajit
|
||||
@@ -415,14 +415,14 @@ CClink = $(CC)
|
||||
# the next line.
|
||||
# When you get an error for a missing "perl.exp" file, try creating an empty
|
||||
# one: "touch perl.exp".
|
||||
# This requires at least "normal" features, "tiny" and "small" don't work.
|
||||
# This requires at least "normal" features, "tiny" doesn't work.
|
||||
#CONF_OPT_PERL = --enable-perlinterp
|
||||
#CONF_OPT_PERL = --enable-perlinterp=dynamic
|
||||
|
||||
# PYTHON
|
||||
# Uncomment lines here when you want to include the Python interface.
|
||||
# Debian package is "libpython3-dev".
|
||||
# This requires at least "normal" features, "tiny" and "small" don't work.
|
||||
# This requires at least "normal" features, "tiny" doesn't work.
|
||||
# Python 3 is preferred, Python 2 (often referred to as "Python") has been
|
||||
# deprecated for a long time.
|
||||
# NOTE: This may cause threading to be enabled, which has side effects (such
|
||||
@@ -444,7 +444,7 @@ CClink = $(CC)
|
||||
# Uncomment this when you want to include the Ruby interface.
|
||||
# First one for static linking, second one for loading when used.
|
||||
# Debian package is "ruby-dev".
|
||||
# This requires at least "normal" features, "tiny" and "small" don't work.
|
||||
# This requires at least "normal" features, "tiny" doesn't work.
|
||||
#CONF_OPT_RUBY = --enable-rubyinterp
|
||||
#CONF_OPT_RUBY = --enable-rubyinterp=dynamic
|
||||
#CONF_OPT_RUBY = --enable-rubyinterp --with-ruby-command=ruby1.9.1
|
||||
@@ -453,6 +453,7 @@ CClink = $(CC)
|
||||
# Uncomment this when you want to include the Tcl interface.
|
||||
# First one is for static linking, second one for dynamic loading.
|
||||
# Debian package is "tcl-dev".
|
||||
# This requires at least "normal" features, "tiny" doesn't work.
|
||||
#CONF_OPT_TCL = --enable-tclinterp
|
||||
#CONF_OPT_TCL = --enable-tclinterp=dynamic
|
||||
#CONF_OPT_TCL = --enable-tclinterp --with-tclsh=tclsh8.4
|
||||
@@ -530,7 +531,6 @@ CClink = $(CC)
|
||||
# Uncomment one of these lines when you want to include few to many features.
|
||||
# The default is "huge" for most systems.
|
||||
#CONF_OPT_FEAT = --with-features=tiny
|
||||
#CONF_OPT_FEAT = --with-features=small
|
||||
#CONF_OPT_FEAT = --with-features=normal
|
||||
#CONF_OPT_FEAT = --with-features=big
|
||||
#CONF_OPT_FEAT = --with-features=huge
|
||||
@@ -3578,7 +3578,7 @@ objects/xpatience.o: xdiff/xpatience.c $(XDIFF_INCL)
|
||||
|
||||
|
||||
Makefile:
|
||||
@echo The name of the makefile MUST be "Makefile" (with capital M)!!!!
|
||||
@echo 'The name of the makefile MUST be "Makefile" (with capital M)!'
|
||||
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -982,7 +982,8 @@ arg_all_close_unused_windows(arg_all_state_T *aall)
|
||||
{
|
||||
if (i < aall->alist->al_ga.ga_len
|
||||
&& (AARGLIST(aall->alist)[i].ae_fnum == buf->b_fnum
|
||||
|| fullpathcmp(alist_name(&AARGLIST(aall->alist)[i]),
|
||||
|| fullpathcmp(alist_name(
|
||||
&AARGLIST(aall->alist)[i]),
|
||||
buf->b_ffname, TRUE, TRUE) & FPC_SAME))
|
||||
{
|
||||
int weight = 1;
|
||||
@@ -1000,7 +1001,8 @@ arg_all_close_unused_windows(arg_all_state_T *aall)
|
||||
if (i == 0)
|
||||
{
|
||||
if (aall->new_curwin != NULL)
|
||||
aall->new_curwin->w_arg_idx = aall->opened_len;
|
||||
aall->new_curwin->w_arg_idx =
|
||||
aall->opened_len;
|
||||
aall->new_curwin = wp;
|
||||
aall->new_curtab = curtab;
|
||||
}
|
||||
@@ -1184,13 +1186,11 @@ do_arg_all(
|
||||
tabpage_T *last_curtab;
|
||||
int prev_arglist_locked = arglist_locked;
|
||||
|
||||
#ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
{
|
||||
emsg(_(e_invalid_in_cmdline_window));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ARGCOUNT <= 0)
|
||||
{
|
||||
// Don't give an error message. We don't want it when the ":all"
|
||||
|
||||
90
src/auto/configure
vendored
90
src/auto/configure
vendored
@@ -1523,7 +1523,7 @@ Optional Packages:
|
||||
--with-view-name=NAME what to call the View executable
|
||||
--with-global-runtime=DIR global runtime directory in 'runtimepath', comma-separated for multiple directories
|
||||
--with-modified-by=NAME name of who modified a release version
|
||||
--with-features=TYPE tiny, small, normal, big or huge (default: huge)
|
||||
--with-features=TYPE tiny, normal, big or huge (default: huge)
|
||||
--with-compiledby=NAME name to show in :version message
|
||||
--with-lua-prefix=PFX Prefix where Lua is installed.
|
||||
--with-luajit Link with LuaJIT instead of Lua.
|
||||
@@ -5219,12 +5219,14 @@ $as_echo "Defaulting to huge" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
case "$features" in
|
||||
small) features="tiny" ;;
|
||||
esac
|
||||
|
||||
dovimdiff=""
|
||||
dogvimdiff=""
|
||||
case "$features" in
|
||||
tiny) $as_echo "#define FEAT_TINY 1" >>confdefs.h
|
||||
;;
|
||||
small) $as_echo "#define FEAT_SMALL 1" >>confdefs.h
|
||||
;;
|
||||
normal) $as_echo "#define FEAT_NORMAL 1" >>confdefs.h
|
||||
dovimdiff="installvimdiff";
|
||||
@@ -5242,7 +5244,7 @@ esac
|
||||
|
||||
|
||||
|
||||
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
|
||||
if test "x$features" = "xtiny"; then
|
||||
has_eval=no
|
||||
else
|
||||
has_eval=yes
|
||||
@@ -5300,7 +5302,7 @@ fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking diff feature" >&5
|
||||
$as_echo_n "checking diff feature... " >&6; }
|
||||
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
|
||||
if test "x$features" = "xtiny"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled in $features version" >&5
|
||||
$as_echo "disabled in $features version" >&6; }
|
||||
else
|
||||
@@ -5326,7 +5328,7 @@ $as_echo "$enable_luainterp" >&6; }
|
||||
|
||||
if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
|
||||
if test "$has_eval" = "no"; then
|
||||
as_fn_error $? "cannot use Lua with tiny or small features" "$LINENO" 5
|
||||
as_fn_error $? "cannot use Lua with tiny features" "$LINENO" 5
|
||||
fi
|
||||
|
||||
|
||||
@@ -6096,7 +6098,7 @@ fi
|
||||
$as_echo "$enable_perlinterp" >&6; }
|
||||
if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
|
||||
if test "$has_eval" = "no"; then
|
||||
as_fn_error $? "cannot use Perl with tiny or small features" "$LINENO" 5
|
||||
as_fn_error $? "cannot use Perl with tiny features" "$LINENO" 5
|
||||
fi
|
||||
|
||||
# Extract the first word of "perl", so it can be a program name with args.
|
||||
@@ -6301,7 +6303,7 @@ fi
|
||||
$as_echo "$enable_pythoninterp" >&6; }
|
||||
if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then
|
||||
if test "$has_eval" = "no"; then
|
||||
as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5
|
||||
as_fn_error $? "cannot use Python with tiny features" "$LINENO" 5
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-python-command argument" >&5
|
||||
@@ -6652,7 +6654,7 @@ fi
|
||||
$as_echo "$enable_python3interp" >&6; }
|
||||
if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then
|
||||
if test "$has_eval" = "no"; then
|
||||
as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5
|
||||
as_fn_error $? "cannot use Python with tiny features" "$LINENO" 5
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-python3-command argument" >&5
|
||||
@@ -7580,7 +7582,7 @@ fi
|
||||
$as_echo "$enable_rubyinterp" >&6; }
|
||||
if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
|
||||
if test "$has_eval" = "no"; then
|
||||
as_fn_error $? "cannot use Ruby with tiny or small features" "$LINENO" 5
|
||||
as_fn_error $? "cannot use Ruby with tiny features" "$LINENO" 5
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-ruby-command argument" >&5
|
||||
@@ -7639,7 +7641,7 @@ fi
|
||||
if test "X$vi_cv_path_ruby" != "X"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Ruby version" >&5
|
||||
$as_echo_n "checking Ruby version... " >&6; }
|
||||
if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then
|
||||
if $vi_cv_path_ruby -e 'RUBY_VERSION >= "1.9.1" or exit 1' >/dev/null 2>/dev/null; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
|
||||
$as_echo "OK" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Ruby rbconfig" >&5
|
||||
@@ -7663,7 +7665,7 @@ $as_echo "$rubyhdrdir" >&6; }
|
||||
fi
|
||||
rubyversion=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['ruby_version'].gsub(/\./, '')[0,2]"`
|
||||
if test "X$rubyversion" = "X"; then
|
||||
rubyversion=`$vi_cv_path_ruby -e "print ((VERSION rescue RUBY_VERSION)).gsub(/\./, '')[0,2]"`
|
||||
rubyversion=`$vi_cv_path_ruby -e "print RUBY_VERSION.gsub(/\./, '')[0,2]"`
|
||||
fi
|
||||
RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion"
|
||||
rubylibs=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['LIBS']"`
|
||||
@@ -7715,8 +7717,8 @@ $as_echo "$rubyhdrdir" >&6; }
|
||||
$as_echo "not found; disabling Ruby" >&6; }
|
||||
fi
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: too old; need Ruby version 1.6.0 or later" >&5
|
||||
$as_echo "too old; need Ruby version 1.6.0 or later" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: too old; need Ruby version 1.9.1 or later" >&5
|
||||
$as_echo "too old; need Ruby version 1.9.1 or later" >&6; }
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -7758,8 +7760,8 @@ fi
|
||||
|
||||
if test "$enable_netbeans" = "yes"; then
|
||||
if test "$has_eval" = "no"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use NetBeans with tiny or small features" >&5
|
||||
$as_echo "cannot use NetBeans with tiny or small features" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use NetBeans with tiny features" >&5
|
||||
$as_echo "cannot use NetBeans with tiny features" >&6; }
|
||||
enable_netbeans="no"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
@@ -7781,8 +7783,8 @@ fi
|
||||
|
||||
if test "$enable_channel" = "yes"; then
|
||||
if test "$has_eval" = "no"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use channels with tiny or small features" >&5
|
||||
$as_echo "cannot use channels with tiny or small features" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use channels with tiny features" >&5
|
||||
$as_echo "cannot use channels with tiny features" >&6; }
|
||||
enable_channel="no"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
@@ -8085,8 +8087,8 @@ fi
|
||||
|
||||
if test "$enable_terminal" = "yes" || test "$enable_terminal" = "auto" -a "x$features" = "xhuge" ; then
|
||||
if test "$has_eval" = "no"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use terminal emulator with tiny or small features" >&5
|
||||
$as_echo "cannot use terminal emulator with tiny or small features" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use terminal emulator with tiny features" >&5
|
||||
$as_echo "cannot use terminal emulator with tiny features" >&6; }
|
||||
enable_terminal="no"
|
||||
else
|
||||
if test "$enable_terminal" = "auto"; then
|
||||
@@ -12892,8 +12894,8 @@ $as_echo "Defaulting to no" >&6; }
|
||||
fi
|
||||
else
|
||||
if test "$enable_canberra" = "yes" -a "$has_eval" = "no"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use sound with tiny or small features" >&5
|
||||
$as_echo "cannot use sound with tiny or small features" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use sound with tiny features" >&5
|
||||
$as_echo "cannot use sound with tiny features" >&6; }
|
||||
enable_canberra="no"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_canberra" >&5
|
||||
@@ -13379,48 +13381,6 @@ _ACEOF
|
||||
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strtod() and other floating point functions" >&5
|
||||
$as_echo_n "checking for strtod() and other floating point functions... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#ifdef HAVE_MATH_H
|
||||
# include <math.h>
|
||||
#endif
|
||||
#if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
char *s; double d;
|
||||
d = strtod("1.1", &s);
|
||||
d = fabs(1.11);
|
||||
d = ceil(1.11);
|
||||
d = floor(1.11);
|
||||
d = log10(1.11);
|
||||
d = pow(1.11, 2.22);
|
||||
d = sqrt(1.11);
|
||||
d = sin(1.11);
|
||||
d = cos(1.11);
|
||||
d = atan(1.11);
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }; $as_echo "#define HAVE_FLOAT_FUNCS 1" >>confdefs.h
|
||||
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf()" >&5
|
||||
$as_echo_n "checking for isinf()... " >&6; }
|
||||
@@ -14763,7 +14723,7 @@ rm -f core conftest.err conftest.$ac_objext \
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: msgfmt not found - disabled" >&5
|
||||
$as_echo "msgfmt not found - disabled" >&6; };
|
||||
fi
|
||||
if test $have_gettext = "yes" -a "x$features" != "xtiny" -a "x$features" != "xsmall"; then
|
||||
if test $have_gettext = "yes" -a "x$features" != "xtiny"; then
|
||||
$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h
|
||||
|
||||
MAKEMO=yes
|
||||
|
||||
257
src/autocmd.c
257
src/autocmd.c
@@ -320,26 +320,26 @@ show_autocmd(AutoPat *ap, event_T event)
|
||||
|
||||
for (ac = ap->cmds; ac != NULL; ac = ac->next)
|
||||
{
|
||||
if (ac->cmd != NULL) // skip removed commands
|
||||
{
|
||||
if (msg_col >= 14)
|
||||
msg_putchar('\n');
|
||||
msg_col = 14;
|
||||
if (got_int)
|
||||
return;
|
||||
msg_outtrans(ac->cmd);
|
||||
if (ac->cmd == NULL) // skip removed commands
|
||||
continue;
|
||||
|
||||
if (msg_col >= 14)
|
||||
msg_putchar('\n');
|
||||
msg_col = 14;
|
||||
if (got_int)
|
||||
return;
|
||||
msg_outtrans(ac->cmd);
|
||||
#ifdef FEAT_EVAL
|
||||
if (p_verbose > 0)
|
||||
last_set_msg(ac->script_ctx);
|
||||
if (p_verbose > 0)
|
||||
last_set_msg(ac->script_ctx);
|
||||
#endif
|
||||
if (got_int)
|
||||
return;
|
||||
if (ac->next != NULL)
|
||||
{
|
||||
msg_putchar('\n');
|
||||
if (got_int)
|
||||
return;
|
||||
if (ac->next != NULL)
|
||||
{
|
||||
msg_putchar('\n');
|
||||
if (got_int)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -492,21 +492,21 @@ au_new_group(char_u *name)
|
||||
int i;
|
||||
|
||||
i = au_find_group(name);
|
||||
if (i == AUGROUP_ERROR) // the group doesn't exist yet, add it
|
||||
{
|
||||
// First try using a free entry.
|
||||
for (i = 0; i < augroups.ga_len; ++i)
|
||||
if (AUGROUP_NAME(i) == NULL)
|
||||
break;
|
||||
if (i == augroups.ga_len && ga_grow(&augroups, 1) == FAIL)
|
||||
return AUGROUP_ERROR;
|
||||
if (i != AUGROUP_ERROR)
|
||||
return i;
|
||||
|
||||
AUGROUP_NAME(i) = vim_strsave(name);
|
||||
// the group doesn't exist yet, add it. First try using a free entry.
|
||||
for (i = 0; i < augroups.ga_len; ++i)
|
||||
if (AUGROUP_NAME(i) == NULL)
|
||||
return AUGROUP_ERROR;
|
||||
if (i == augroups.ga_len)
|
||||
++augroups.ga_len;
|
||||
}
|
||||
break;
|
||||
if (i == augroups.ga_len && ga_grow(&augroups, 1) == FAIL)
|
||||
return AUGROUP_ERROR;
|
||||
|
||||
AUGROUP_NAME(i) = vim_strsave(name);
|
||||
if (AUGROUP_NAME(i) == NULL)
|
||||
return AUGROUP_ERROR;
|
||||
if (i == augroups.ga_len)
|
||||
++augroups.ga_len;
|
||||
|
||||
return i;
|
||||
}
|
||||
@@ -514,37 +514,41 @@ au_new_group(char_u *name)
|
||||
static void
|
||||
au_del_group(char_u *name)
|
||||
{
|
||||
int i;
|
||||
int i;
|
||||
event_T event;
|
||||
AutoPat *ap;
|
||||
int in_use = FALSE;
|
||||
|
||||
|
||||
i = au_find_group(name);
|
||||
if (i == AUGROUP_ERROR) // the group doesn't exist
|
||||
semsg(_(e_no_such_group_str), name);
|
||||
else if (i == current_augroup)
|
||||
emsg(_(e_cannot_delete_current_group));
|
||||
else
|
||||
{
|
||||
event_T event;
|
||||
AutoPat *ap;
|
||||
int in_use = FALSE;
|
||||
|
||||
for (event = (event_T)0; (int)event < NUM_EVENTS;
|
||||
event = (event_T)((int)event + 1))
|
||||
{
|
||||
FOR_ALL_AUTOCMD_PATTERNS(event, ap)
|
||||
if (ap->group == i && ap->pat != NULL)
|
||||
{
|
||||
give_warning((char_u *)_("W19: Deleting augroup that is still in use"), TRUE);
|
||||
in_use = TRUE;
|
||||
event = NUM_EVENTS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
vim_free(AUGROUP_NAME(i));
|
||||
if (in_use)
|
||||
AUGROUP_NAME(i) = get_deleted_augroup();
|
||||
else
|
||||
AUGROUP_NAME(i) = NULL;
|
||||
semsg(_(e_no_such_group_str), name);
|
||||
return;
|
||||
}
|
||||
if (i == current_augroup)
|
||||
{
|
||||
emsg(_(e_cannot_delete_current_group));
|
||||
return;
|
||||
}
|
||||
|
||||
for (event = (event_T)0; (int)event < NUM_EVENTS;
|
||||
event = (event_T)((int)event + 1))
|
||||
{
|
||||
FOR_ALL_AUTOCMD_PATTERNS(event, ap)
|
||||
if (ap->group == i && ap->pat != NULL)
|
||||
{
|
||||
give_warning((char_u *)_("W19: Deleting augroup that is still in use"), TRUE);
|
||||
in_use = TRUE;
|
||||
event = NUM_EVENTS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
vim_free(AUGROUP_NAME(i));
|
||||
if (in_use)
|
||||
AUGROUP_NAME(i) = get_deleted_augroup();
|
||||
else
|
||||
AUGROUP_NAME(i) = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -768,20 +772,23 @@ au_event_disable(char *what)
|
||||
char_u *save_ei;
|
||||
|
||||
save_ei = vim_strsave(p_ei);
|
||||
if (save_ei != NULL)
|
||||
if (save_ei == NULL)
|
||||
return NULL;
|
||||
|
||||
new_ei = vim_strnsave(p_ei, STRLEN(p_ei) + STRLEN(what));
|
||||
if (new_ei == NULL)
|
||||
{
|
||||
new_ei = vim_strnsave(p_ei, STRLEN(p_ei) + STRLEN(what));
|
||||
if (new_ei != NULL)
|
||||
{
|
||||
if (*what == ',' && *p_ei == NUL)
|
||||
STRCPY(new_ei, what + 1);
|
||||
else
|
||||
STRCAT(new_ei, what);
|
||||
set_string_option_direct((char_u *)"ei", -1, new_ei,
|
||||
OPT_FREE, SID_NONE);
|
||||
vim_free(new_ei);
|
||||
}
|
||||
vim_free(save_ei);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (*what == ',' && *p_ei == NUL)
|
||||
STRCPY(new_ei, what + 1);
|
||||
else
|
||||
STRCAT(new_ei, what);
|
||||
set_string_option_direct((char_u *)"ei", -1, new_ei,
|
||||
OPT_FREE, SID_NONE);
|
||||
vim_free(new_ei);
|
||||
return save_ei;
|
||||
}
|
||||
|
||||
@@ -908,48 +915,48 @@ do_autocmd(exarg_T *eap, char_u *arg_in, int forceit)
|
||||
cmd = skipwhite(cmd);
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
if (*cmd != NUL)
|
||||
if (*cmd == NUL)
|
||||
continue;
|
||||
|
||||
// Check for "++once" flag.
|
||||
if (STRNCMP(cmd, "++once", 6) == 0 && VIM_ISWHITE(cmd[6]))
|
||||
{
|
||||
// Check for "++once" flag.
|
||||
if (STRNCMP(cmd, "++once", 6) == 0 && VIM_ISWHITE(cmd[6]))
|
||||
{
|
||||
if (once)
|
||||
semsg(_(e_duplicate_argument_str), "++once");
|
||||
once = TRUE;
|
||||
cmd = skipwhite(cmd + 6);
|
||||
}
|
||||
if (once)
|
||||
semsg(_(e_duplicate_argument_str), "++once");
|
||||
once = TRUE;
|
||||
cmd = skipwhite(cmd + 6);
|
||||
}
|
||||
|
||||
// Check for "++nested" flag.
|
||||
if ((STRNCMP(cmd, "++nested", 8) == 0 && VIM_ISWHITE(cmd[8])))
|
||||
// Check for "++nested" flag.
|
||||
if ((STRNCMP(cmd, "++nested", 8) == 0 && VIM_ISWHITE(cmd[8])))
|
||||
{
|
||||
if (nested)
|
||||
{
|
||||
if (nested)
|
||||
{
|
||||
semsg(_(e_duplicate_argument_str), "++nested");
|
||||
return;
|
||||
}
|
||||
nested = TRUE;
|
||||
cmd = skipwhite(cmd + 8);
|
||||
semsg(_(e_duplicate_argument_str), "++nested");
|
||||
return;
|
||||
}
|
||||
nested = TRUE;
|
||||
cmd = skipwhite(cmd + 8);
|
||||
}
|
||||
|
||||
// Check for the old "nested" flag in legacy script.
|
||||
if (STRNCMP(cmd, "nested", 6) == 0 && VIM_ISWHITE(cmd[6]))
|
||||
// Check for the old "nested" flag in legacy script.
|
||||
if (STRNCMP(cmd, "nested", 6) == 0 && VIM_ISWHITE(cmd[6]))
|
||||
{
|
||||
if (in_vim9script())
|
||||
{
|
||||
if (in_vim9script())
|
||||
{
|
||||
// If there ever is a :nested command this error should
|
||||
// be removed and "nested" accepted as the start of the
|
||||
// command.
|
||||
emsg(_(e_invalid_command_nested_did_you_mean_plusplus_nested));
|
||||
return;
|
||||
}
|
||||
if (nested)
|
||||
{
|
||||
semsg(_(e_duplicate_argument_str), "nested");
|
||||
return;
|
||||
}
|
||||
nested = TRUE;
|
||||
cmd = skipwhite(cmd + 6);
|
||||
// If there ever is a :nested command this error should
|
||||
// be removed and "nested" accepted as the start of the
|
||||
// command.
|
||||
emsg(_(e_invalid_command_nested_did_you_mean_plusplus_nested));
|
||||
return;
|
||||
}
|
||||
if (nested)
|
||||
{
|
||||
semsg(_(e_duplicate_argument_str), "nested");
|
||||
return;
|
||||
}
|
||||
nested = TRUE;
|
||||
cmd = skipwhite(cmd + 6);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1407,30 +1414,30 @@ ex_doautoall(exarg_T *eap)
|
||||
FOR_ALL_BUFFERS(buf)
|
||||
{
|
||||
// Only do loaded buffers and skip the current buffer, it's done last.
|
||||
if (buf->b_ml.ml_mfp != NULL && buf != curbuf)
|
||||
if (buf->b_ml.ml_mfp == NULL || buf == curbuf)
|
||||
continue;
|
||||
|
||||
// find a window for this buffer and save some values
|
||||
aucmd_prepbuf(&aco, buf);
|
||||
set_bufref(&bufref, buf);
|
||||
|
||||
// execute the autocommands for this buffer
|
||||
retval = do_doautocmd(arg, FALSE, &did_aucmd);
|
||||
|
||||
if (call_do_modelines && did_aucmd)
|
||||
// Execute the modeline settings, but don't set window-local
|
||||
// options if we are using the current window for another
|
||||
// buffer.
|
||||
do_modelines(curwin == aucmd_win ? OPT_NOWIN : 0);
|
||||
|
||||
// restore the current window
|
||||
aucmd_restbuf(&aco);
|
||||
|
||||
// stop if there is some error or buffer was deleted
|
||||
if (retval == FAIL || !bufref_valid(&bufref))
|
||||
{
|
||||
// find a window for this buffer and save some values
|
||||
aucmd_prepbuf(&aco, buf);
|
||||
set_bufref(&bufref, buf);
|
||||
|
||||
// execute the autocommands for this buffer
|
||||
retval = do_doautocmd(arg, FALSE, &did_aucmd);
|
||||
|
||||
if (call_do_modelines && did_aucmd)
|
||||
// Execute the modeline settings, but don't set window-local
|
||||
// options if we are using the current window for another
|
||||
// buffer.
|
||||
do_modelines(curwin == aucmd_win ? OPT_NOWIN : 0);
|
||||
|
||||
// restore the current window
|
||||
aucmd_restbuf(&aco);
|
||||
|
||||
// stop if there is some error or buffer was deleted
|
||||
if (retval == FAIL || !bufref_valid(&bufref))
|
||||
{
|
||||
retval = FAIL;
|
||||
break;
|
||||
}
|
||||
retval = FAIL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
321
src/beval.c
321
src/beval.c
@@ -39,94 +39,94 @@ find_word_under_cursor(
|
||||
|
||||
*textp = NULL;
|
||||
wp = mouse_find_win(&row, &col, FAIL_POPUP);
|
||||
if (wp != NULL && row >= 0 && row < wp->w_height && col < wp->w_width)
|
||||
if (wp == NULL || row < 0 || row >= wp->w_height || col >= wp->w_width)
|
||||
return FAIL;
|
||||
|
||||
// Found a window and the cursor is in the text. Now find the line
|
||||
// number.
|
||||
if (mouse_comp_pos(wp, &row, &col, &lnum, NULL))
|
||||
return FAIL; // position is below the last line
|
||||
|
||||
// Not past end of the file.
|
||||
lbuf = ml_get_buf(wp->w_buffer, lnum, FALSE);
|
||||
if (col > win_linetabsize(wp, lnum, lbuf, (colnr_T)MAXCOL))
|
||||
return FAIL; // past end of line
|
||||
|
||||
// Not past end of line.
|
||||
if (getword)
|
||||
{
|
||||
// Found a window and the cursor is in the text. Now find the line
|
||||
// number.
|
||||
if (!mouse_comp_pos(wp, &row, &col, &lnum, NULL))
|
||||
// For Netbeans we get the relevant part of the line
|
||||
// instead of the whole line.
|
||||
int len;
|
||||
pos_T *spos = NULL, *epos = NULL;
|
||||
|
||||
if (VIsual_active)
|
||||
{
|
||||
// Not past end of the file.
|
||||
lbuf = ml_get_buf(wp->w_buffer, lnum, FALSE);
|
||||
if (col <= win_linetabsize(wp, lnum, lbuf, (colnr_T)MAXCOL))
|
||||
if (LT_POS(VIsual, curwin->w_cursor))
|
||||
{
|
||||
// Not past end of line.
|
||||
if (getword)
|
||||
{
|
||||
// For Netbeans we get the relevant part of the line
|
||||
// instead of the whole line.
|
||||
int len;
|
||||
pos_T *spos = NULL, *epos = NULL;
|
||||
|
||||
if (VIsual_active)
|
||||
{
|
||||
if (LT_POS(VIsual, curwin->w_cursor))
|
||||
{
|
||||
spos = &VIsual;
|
||||
epos = &curwin->w_cursor;
|
||||
}
|
||||
else
|
||||
{
|
||||
spos = &curwin->w_cursor;
|
||||
epos = &VIsual;
|
||||
}
|
||||
}
|
||||
|
||||
col = vcol2col(wp, lnum, col);
|
||||
scol = col;
|
||||
|
||||
if (VIsual_active
|
||||
&& wp->w_buffer == curwin->w_buffer
|
||||
&& (lnum == spos->lnum
|
||||
? col >= (int)spos->col
|
||||
: lnum > spos->lnum)
|
||||
&& (lnum == epos->lnum
|
||||
? col <= (int)epos->col
|
||||
: lnum < epos->lnum))
|
||||
{
|
||||
// Visual mode and pointing to the line with the
|
||||
// Visual selection: return selected text, with a
|
||||
// maximum of one line.
|
||||
if (spos->lnum != epos->lnum || spos->col == epos->col)
|
||||
return FAIL;
|
||||
|
||||
lbuf = ml_get_buf(curwin->w_buffer, VIsual.lnum, FALSE);
|
||||
len = epos->col - spos->col;
|
||||
if (*p_sel != 'e')
|
||||
len += mb_ptr2len(lbuf + epos->col);
|
||||
lbuf = vim_strnsave(lbuf + spos->col, len);
|
||||
lnum = spos->lnum;
|
||||
col = spos->col;
|
||||
scol = col;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Find the word under the cursor.
|
||||
++emsg_off;
|
||||
len = find_ident_at_pos(wp, lnum, (colnr_T)col,
|
||||
&lbuf, &scol, flags);
|
||||
--emsg_off;
|
||||
if (len == 0)
|
||||
return FAIL;
|
||||
lbuf = vim_strnsave(lbuf, len);
|
||||
}
|
||||
}
|
||||
else
|
||||
scol = col;
|
||||
|
||||
if (winp != NULL)
|
||||
*winp = wp;
|
||||
if (lnump != NULL)
|
||||
*lnump = lnum;
|
||||
*textp = lbuf;
|
||||
if (colp != NULL)
|
||||
*colp = col;
|
||||
if (startcolp != NULL)
|
||||
*startcolp = scol;
|
||||
return OK;
|
||||
spos = &VIsual;
|
||||
epos = &curwin->w_cursor;
|
||||
}
|
||||
else
|
||||
{
|
||||
spos = &curwin->w_cursor;
|
||||
epos = &VIsual;
|
||||
}
|
||||
}
|
||||
|
||||
col = vcol2col(wp, lnum, col);
|
||||
scol = col;
|
||||
|
||||
if (VIsual_active
|
||||
&& wp->w_buffer == curwin->w_buffer
|
||||
&& (lnum == spos->lnum
|
||||
? col >= (int)spos->col
|
||||
: lnum > spos->lnum)
|
||||
&& (lnum == epos->lnum
|
||||
? col <= (int)epos->col
|
||||
: lnum < epos->lnum))
|
||||
{
|
||||
// Visual mode and pointing to the line with the
|
||||
// Visual selection: return selected text, with a
|
||||
// maximum of one line.
|
||||
if (spos->lnum != epos->lnum || spos->col == epos->col)
|
||||
return FAIL;
|
||||
|
||||
lbuf = ml_get_buf(curwin->w_buffer, VIsual.lnum, FALSE);
|
||||
len = epos->col - spos->col;
|
||||
if (*p_sel != 'e')
|
||||
len += mb_ptr2len(lbuf + epos->col);
|
||||
lbuf = vim_strnsave(lbuf + spos->col, len);
|
||||
lnum = spos->lnum;
|
||||
col = spos->col;
|
||||
scol = col;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Find the word under the cursor.
|
||||
++emsg_off;
|
||||
len = find_ident_at_pos(wp, lnum, (colnr_T)col,
|
||||
&lbuf, &scol, flags);
|
||||
--emsg_off;
|
||||
if (len == 0)
|
||||
return FAIL;
|
||||
lbuf = vim_strnsave(lbuf, len);
|
||||
}
|
||||
}
|
||||
return FAIL;
|
||||
else
|
||||
scol = col;
|
||||
|
||||
if (winp != NULL)
|
||||
*winp = wp;
|
||||
if (lnump != NULL)
|
||||
*lnump = lnum;
|
||||
*textp = lbuf;
|
||||
if (colp != NULL)
|
||||
*colp = col;
|
||||
if (startcolp != NULL)
|
||||
*startcolp = scol;
|
||||
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -220,6 +220,92 @@ can_use_beval(void)
|
||||
) && msg_scrolled == 0;
|
||||
}
|
||||
|
||||
# ifdef FEAT_EVAL
|
||||
/*
|
||||
* Evaluate the expression 'bexpr' and set the text in the balloon 'beval'.
|
||||
*/
|
||||
static void
|
||||
bexpr_eval(
|
||||
BalloonEval *beval,
|
||||
char_u *bexpr,
|
||||
win_T *wp,
|
||||
linenr_T lnum,
|
||||
int col,
|
||||
char_u *text)
|
||||
{
|
||||
win_T *cw;
|
||||
long winnr = 0;
|
||||
buf_T *save_curbuf;
|
||||
int use_sandbox;
|
||||
static char_u *result = NULL;
|
||||
size_t len;
|
||||
|
||||
sctx_T save_sctx = current_sctx;
|
||||
|
||||
// Convert window pointer to number.
|
||||
for (cw = firstwin; cw != wp; cw = cw->w_next)
|
||||
++winnr;
|
||||
|
||||
set_vim_var_nr(VV_BEVAL_BUFNR, (long)wp->w_buffer->b_fnum);
|
||||
set_vim_var_nr(VV_BEVAL_WINNR, winnr);
|
||||
set_vim_var_nr(VV_BEVAL_WINID, wp->w_id);
|
||||
set_vim_var_nr(VV_BEVAL_LNUM, (long)lnum);
|
||||
set_vim_var_nr(VV_BEVAL_COL, (long)(col + 1));
|
||||
set_vim_var_string(VV_BEVAL_TEXT, text, -1);
|
||||
vim_free(text);
|
||||
|
||||
/*
|
||||
* Temporarily change the curbuf, so that we can determine whether
|
||||
* the buffer-local balloonexpr option was set insecurely.
|
||||
*/
|
||||
save_curbuf = curbuf;
|
||||
curbuf = wp->w_buffer;
|
||||
use_sandbox = was_set_insecurely((char_u *)"balloonexpr",
|
||||
*curbuf->b_p_bexpr == NUL ? 0 : OPT_LOCAL);
|
||||
curbuf = save_curbuf;
|
||||
if (use_sandbox)
|
||||
++sandbox;
|
||||
++textlock;
|
||||
|
||||
if (bexpr == p_bexpr)
|
||||
{
|
||||
sctx_T *sp = get_option_sctx("balloonexpr");
|
||||
|
||||
if (sp != NULL)
|
||||
current_sctx = *sp;
|
||||
}
|
||||
else
|
||||
current_sctx = curbuf->b_p_script_ctx[BV_BEXPR];
|
||||
|
||||
vim_free(result);
|
||||
result = eval_to_string(bexpr, TRUE, TRUE);
|
||||
|
||||
// Remove one trailing newline, it is added when the result was a
|
||||
// list and it's hardly ever useful. If the user really wants a
|
||||
// trailing newline he can add two and one remains.
|
||||
if (result != NULL)
|
||||
{
|
||||
len = STRLEN(result);
|
||||
if (len > 0 && result[len - 1] == NL)
|
||||
result[len - 1] = NUL;
|
||||
}
|
||||
|
||||
if (use_sandbox)
|
||||
--sandbox;
|
||||
--textlock;
|
||||
current_sctx = save_sctx;
|
||||
|
||||
set_vim_var_string(VV_BEVAL_TEXT, NULL, -1);
|
||||
if (result != NULL && result[0] != NUL)
|
||||
post_balloon(beval, result, NULL);
|
||||
|
||||
// The 'balloonexpr' evaluation may show something on the screen
|
||||
// that requires a screen update.
|
||||
if (must_redraw)
|
||||
redraw_after_callback(FALSE, FALSE);
|
||||
}
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Common code, invoked when the mouse is resting for a moment.
|
||||
*/
|
||||
@@ -229,15 +315,9 @@ general_beval_cb(BalloonEval *beval, int state UNUSED)
|
||||
#ifdef FEAT_EVAL
|
||||
win_T *wp;
|
||||
int col;
|
||||
int use_sandbox;
|
||||
linenr_T lnum;
|
||||
char_u *text;
|
||||
static char_u *result = NULL;
|
||||
long winnr = 0;
|
||||
char_u *bexpr;
|
||||
buf_T *save_curbuf;
|
||||
size_t len;
|
||||
win_T *cw;
|
||||
#endif
|
||||
static int recursive = FALSE;
|
||||
|
||||
@@ -259,70 +339,7 @@ general_beval_cb(BalloonEval *beval, int state UNUSED)
|
||||
: wp->w_buffer->b_p_bexpr;
|
||||
if (*bexpr != NUL)
|
||||
{
|
||||
sctx_T save_sctx = current_sctx;
|
||||
|
||||
// Convert window pointer to number.
|
||||
for (cw = firstwin; cw != wp; cw = cw->w_next)
|
||||
++winnr;
|
||||
|
||||
set_vim_var_nr(VV_BEVAL_BUFNR, (long)wp->w_buffer->b_fnum);
|
||||
set_vim_var_nr(VV_BEVAL_WINNR, winnr);
|
||||
set_vim_var_nr(VV_BEVAL_WINID, wp->w_id);
|
||||
set_vim_var_nr(VV_BEVAL_LNUM, (long)lnum);
|
||||
set_vim_var_nr(VV_BEVAL_COL, (long)(col + 1));
|
||||
set_vim_var_string(VV_BEVAL_TEXT, text, -1);
|
||||
vim_free(text);
|
||||
|
||||
/*
|
||||
* Temporarily change the curbuf, so that we can determine whether
|
||||
* the buffer-local balloonexpr option was set insecurely.
|
||||
*/
|
||||
save_curbuf = curbuf;
|
||||
curbuf = wp->w_buffer;
|
||||
use_sandbox = was_set_insecurely((char_u *)"balloonexpr",
|
||||
*curbuf->b_p_bexpr == NUL ? 0 : OPT_LOCAL);
|
||||
curbuf = save_curbuf;
|
||||
if (use_sandbox)
|
||||
++sandbox;
|
||||
++textlock;
|
||||
|
||||
if (bexpr == p_bexpr)
|
||||
{
|
||||
sctx_T *sp = get_option_sctx("balloonexpr");
|
||||
|
||||
if (sp != NULL)
|
||||
current_sctx = *sp;
|
||||
}
|
||||
else
|
||||
current_sctx = curbuf->b_p_script_ctx[BV_BEXPR];
|
||||
|
||||
vim_free(result);
|
||||
result = eval_to_string(bexpr, TRUE);
|
||||
|
||||
// Remove one trailing newline, it is added when the result was a
|
||||
// list and it's hardly ever useful. If the user really wants a
|
||||
// trailing newline he can add two and one remains.
|
||||
if (result != NULL)
|
||||
{
|
||||
len = STRLEN(result);
|
||||
if (len > 0 && result[len - 1] == NL)
|
||||
result[len - 1] = NUL;
|
||||
}
|
||||
|
||||
if (use_sandbox)
|
||||
--sandbox;
|
||||
--textlock;
|
||||
current_sctx = save_sctx;
|
||||
|
||||
set_vim_var_string(VV_BEVAL_TEXT, NULL, -1);
|
||||
if (result != NULL && result[0] != NUL)
|
||||
post_balloon(beval, result, NULL);
|
||||
|
||||
// The 'balloonexpr' evaluation may show something on the screen
|
||||
// that requires a screen update.
|
||||
if (must_redraw)
|
||||
redraw_after_callback(FALSE, FALSE);
|
||||
|
||||
bexpr_eval(beval, bexpr, wp, lnum, col, text);
|
||||
recursive = FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user