mirror of
https://github.com/vim/vim
synced 2025-07-31 02:41:54 +00:00
Compare commits
322 Commits
Author | SHA1 | Date | |
---|---|---|---|
48f83c31d1 | |||
cf6662082f | |||
81da16b53f | |||
f8691004b0 | |||
56b84b1728 | |||
f2832ad965 | |||
f01a653ac5 | |||
f3507a517c | |||
1588bc8ebe | |||
ed0c62e7b1 | |||
673bcb10eb | |||
0b40d086b3 | |||
8acb9cc620 | |||
08238045e7 | |||
d8f8629b1b | |||
6ca883dd8a | |||
88dd6523fa | |||
936dc6014c | |||
127969cf98 | |||
d523c7be5c | |||
655b734ee8 | |||
9eccee0e85 | |||
525eba00ef | |||
9fb7b42935 | |||
b2175220da | |||
b29ae15977 | |||
df1bbea436 | |||
c12dc47b8f | |||
204852ae2a | |||
e1d1211799 | |||
330a388e18 | |||
f78ee2b49f | |||
24d9c0557e | |||
f07751457c | |||
196c3850db | |||
6aca4d3c2b | |||
d979d64fa2 | |||
21efafe4c2 | |||
0e1574c406 | |||
28bf649a57 | |||
1fc34225ac | |||
35d8c2010e | |||
fe9112e630 | |||
e4e1a1e1c8 | |||
2f87a99b6e | |||
b9c5108593 | |||
8ccbbeb620 | |||
7f687aaca9 | |||
8d5daf267e | |||
c6e9d7063d | |||
f6b0c79742 | |||
7a22224875 | |||
f01af9c4e6 | |||
3e7637bd26 | |||
1983f1aa31 | |||
5de4c4372d | |||
afd4ae35d6 | |||
5c52be40fb | |||
cbef12e60b | |||
6caeda2fce | |||
00333cb3b3 | |||
29ab6ce9f3 | |||
c51cf03298 | |||
e41c1dd889 | |||
4df5b33f20 | |||
5a2d4a3ecb | |||
416b5f4894 | |||
9383a3afb6 | |||
62628d97c4 | |||
ae49aa8434 | |||
05c1734c4f | |||
68afde4c9b | |||
0e71b7d4ce | |||
5c6edf41f9 | |||
5ec633b9b0 | |||
4d56b971cb | |||
38b85cb4d7 | |||
9c9be05b17 | |||
3c620b0c03 | |||
dea5ab0fc5 | |||
fa02616718 | |||
6e1a38745f | |||
33fc4a6307 | |||
dd2dfb3cb0 | |||
2007dd49f5 | |||
6a8b13614e | |||
4791fcd825 | |||
2dada73a4e | |||
9cd4c0fb98 | |||
2afeb40831 | |||
e843efcc35 | |||
b2c72359dc | |||
afa048f0d4 | |||
fe73255c92 | |||
29a9e69718 | |||
68eab67119 | |||
2457b2bbc2 | |||
70b9e4f4c3 | |||
16f6c8ac94 | |||
6456fae9ba | |||
1349bd712c | |||
ca0c1caa36 | |||
0f113e4f7b | |||
4e889f98e9 | |||
7842761bba | |||
16b51d26fe | |||
83e36c8606 | |||
592f625001 | |||
993faa3405 | |||
101979358f | |||
c2f17f7e64 | |||
0f6e28f686 | |||
944697ae19 | |||
ad6c45f625 | |||
c1e6c7bafe | |||
eddd4fc4f6 | |||
cdf717283c | |||
d56eb654f5 | |||
adbb383e0f | |||
20563e0f84 | |||
a42535340a | |||
a493b6506b | |||
5921aeb574 | |||
e89bfd212b | |||
1fca5f3e86 | |||
b8fb5bb68d | |||
97b231541d | |||
56acd1f8ed | |||
0257599036 | |||
8e5ba693ad | |||
0c7f2610de | |||
6296d1e60e | |||
ea5c898b5f | |||
e08be09a08 | |||
2438430863 | |||
8329ab79b2 | |||
cd1cda2f87 | |||
9437737833 | |||
ae6f1d8b14 | |||
d288eaad84 | |||
646bb7247a | |||
f9435e49ef | |||
b31aec3b93 | |||
34f8117dec | |||
f5288c5895 | |||
8b716f5f22 | |||
9fdde7992a | |||
6b43471da4 | |||
64d95cfc56 | |||
0e1f36fc59 | |||
e88c6b7a5d | |||
4556a2e868 | |||
7745f14ef3 | |||
e3846cf1eb | |||
8991be2ab4 | |||
b5d2039e00 | |||
bc51006402 | |||
7a3b802bab | |||
e4835bf340 | |||
0e76714e90 | |||
774e55702f | |||
55737c2a31 | |||
6dd7424c7e | |||
0cd3e94e2c | |||
9773db6f9b | |||
4b1d963972 | |||
0631bb4ed7 | |||
c87aa34dfd | |||
299d8e5eec | |||
75e27d78f5 | |||
cf6ad8ea8c | |||
f7fbeed0ac | |||
e131496ebf | |||
4525a57afb | |||
4d03d87000 | |||
cdf0485969 | |||
4549166078 | |||
8e38555ece | |||
33f3c59854 | |||
62b191c387 | |||
a749a42ed2 | |||
6e28703a8e | |||
90a57168a4 | |||
2a9b62dfa2 | |||
620d8edba0 | |||
0f7ff851cb | |||
d68b2fc034 | |||
18f7593e57 | |||
0c3cc2fec3 | |||
41ee5b1913 | |||
29c70f612f | |||
c9e3187d05 | |||
5b1d6e98c6 | |||
bd89d44063 | |||
481acb1141 | |||
f6246f51e3 | |||
14f23122bf | |||
8196e94a8b | |||
92f645bef7 | |||
bece72785d | |||
414acd342f | |||
949b35d83b | |||
560dff49c0 | |||
74a0a5b26d | |||
9da17d7c57 | |||
78a8404f8b | |||
769f5895eb | |||
28e8f73ae2 | |||
68cc2b8a37 | |||
b6a138eb33 | |||
dce2441a60 | |||
3a5988c025 | |||
779aeff5c3 | |||
e023d49937 | |||
73a16c22a4 | |||
e3537aec2f | |||
51ab7c7d0d | |||
3908ef5017 | |||
3787f26c2e | |||
f681cfb90b | |||
7aca5ca676 | |||
92368aad61 | |||
28f1a51bde | |||
4e713bafc0 | |||
54969f4ef5 | |||
63ff72aab9 | |||
b247e0622e | |||
6bf821e8ab | |||
8cbf249917 | |||
5f4ef5f5e5 | |||
107f7325f6 | |||
160afdb185 | |||
2626d6a71c | |||
fe1bfc9b26 | |||
8164f6ea3c | |||
0c1550d9e9 | |||
500761b1cf | |||
e5b7897585 | |||
00eb99528e | |||
cd53eed2c5 | |||
82e46e5d31 | |||
e0c2b2ceaa | |||
4fa1346bf4 | |||
46f3080e5c | |||
fc88df42f1 | |||
21ebb0899e | |||
83d0cec956 | |||
3e79c97c18 | |||
a2baa73d1d | |||
46950b225f | |||
972db23279 | |||
7676c15879 | |||
02a977ea5e | |||
5658ca343f | |||
a8ec4916ca | |||
5411910c77 | |||
6e1d31e9e3 | |||
2d3ac2e030 | |||
381692b6f1 | |||
a1c5195180 | |||
ab8f7c50cf | |||
73257149d7 | |||
adbb1bf21d | |||
9b4a80a665 | |||
eb4a9ba293 | |||
8133018f50 | |||
4e3b318230 | |||
68854a82fd | |||
9e0208f51c | |||
223a950a85 | |||
c570e9cf68 | |||
c4573eb12d | |||
424bcae1fb | |||
eb6c276595 | |||
1f47a287ee | |||
672776dbe8 | |||
48a604845e | |||
44d1f89c24 | |||
4c93aff20f | |||
5703310e64 | |||
6a05807092 | |||
d8fe6d34bb | |||
ec3637cbaf | |||
44a4d947bb | |||
679d66c2d2 | |||
848faddb87 | |||
06011e1a55 | |||
6970e1e36a | |||
f10911e5db | |||
62aec93bfd | |||
135e15251e | |||
d5cec1f1f0 | |||
f12b7815f6 | |||
37f47958b8 | |||
4dc0dd8699 | |||
97c554d514 | |||
24714a1916 | |||
585ee07cfe | |||
a0c4e2f2d7 | |||
06f15416bb | |||
e96eea7b6a | |||
652dee4486 | |||
14cbf77845 | |||
57ff2b7068 | |||
fb55207ed1 | |||
420fabcd4f | |||
fb80862e49 | |||
ddd815ba2a | |||
bd8168c770 | |||
fbf4f1ca15 | |||
166788c657 | |||
37cf413e3e | |||
b3d83980d2 | |||
a4bc2dd7cc | |||
98cd30383a | |||
35c807df1f | |||
94373c48e7 | |||
745b938a48 | |||
b0ad2d92fd | |||
e939f5ebba | |||
fc4c44836a | |||
70c43d84be |
6
.github/CODEOWNERS
vendored
6
.github/CODEOWNERS
vendored
@ -9,6 +9,7 @@
|
||||
# So if a pull request only touches javascript files, only these owners
|
||||
# will be requested to review.
|
||||
|
||||
runtime/autoload/freebasic.vim @dkearns
|
||||
runtime/autoload/getscript.vim @cecamp
|
||||
runtime/autoload/netrw.vim @cecamp
|
||||
runtime/autoload/netrwFileHandlers.vim @cecamp
|
||||
@ -111,6 +112,7 @@ runtime/ftplugin/pbtxt.vim @lakshayg
|
||||
runtime/ftplugin/pdf.vim @tpope
|
||||
runtime/ftplugin/ps1.vim @heaths
|
||||
runtime/ftplugin/ps1xml.vim @heaths
|
||||
runtime/ftplugin/qb64.vim @dkearns
|
||||
runtime/ftplugin/routeros.vim @zainin
|
||||
runtime/ftplugin/ruby.vim @tpope @dkearns
|
||||
runtime/ftplugin/sass.vim @tpope
|
||||
@ -126,6 +128,7 @@ runtime/ftplugin/typescript.vim @dkearns
|
||||
runtime/ftplugin/typescriptreact.vim @dkearns
|
||||
runtime/ftplugin/xml.vim @chrisbra
|
||||
runtime/ftplugin/zsh.vim @chrisbra
|
||||
runtime/indent/basic.vim @dkearns
|
||||
runtime/indent/bst.vim @tpope
|
||||
runtime/indent/cdl.vim @dkearns
|
||||
runtime/indent/clojure.vim @axvr
|
||||
@ -140,6 +143,7 @@ runtime/indent/elm.vim @andys8
|
||||
runtime/indent/eruby.vim @tpope @dkearns
|
||||
runtime/indent/eterm.vim @dkearns
|
||||
runtime/indent/framescript.vim @dkearns
|
||||
runtime/indent/freebasic.vim @dkearns
|
||||
runtime/indent/gitconfig.vim @tpope
|
||||
runtime/indent/haml.vim @tpope
|
||||
runtime/indent/idlang.vim @dkearns
|
||||
@ -154,6 +158,7 @@ runtime/indent/occam.vim @dkearns
|
||||
runtime/indent/postscr.vim @dkearns
|
||||
runtime/indent/prolog.vim @dkearns
|
||||
runtime/indent/ps1.vim @heaths
|
||||
runtime/indent/qb64.vim @dkearns
|
||||
runtime/indent/readline.vim @dkearns
|
||||
runtime/indent/ruby.vim @AndrewRadev @dkearns
|
||||
runtime/indent/sass.vim @tpope
|
||||
@ -239,6 +244,7 @@ runtime/syntax/prolog.vim @XVilka
|
||||
runtime/syntax/ps1.vim @heaths
|
||||
runtime/syntax/ps1xml.vim @heaths
|
||||
runtime/syntax/psl.vim @danielkho
|
||||
runtime/syntax/qb64.vim @dkearns
|
||||
runtime/syntax/rc.vim @chrisbra
|
||||
runtime/syntax/routeros.vim @zainin
|
||||
runtime/syntax/rpcgen.vim @cecamp
|
||||
|
95
.github/workflows/ci.yml
vendored
95
.github/workflows/ci.yml
vendored
@ -225,7 +225,7 @@ jobs:
|
||||
do_test make ${SHADOWOPT} ${TEST}
|
||||
|
||||
# - name: Coveralls
|
||||
# if: matrix.coverage && success() && github.event_name != 'pull_request'
|
||||
# if: matrix.coverage && github.event_name != 'pull_request'
|
||||
# env:
|
||||
# COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
||||
# COVERALLS_PARALLEL: true
|
||||
@ -238,21 +238,21 @@ jobs:
|
||||
# ~/.local/bin/coveralls -b "${SRCDIR}" -x .xs -e "${SRCDIR}"/if_perl.c -e "${SRCDIR}"/xxd -e "${SRCDIR}"/libvterm --encodings utf-8
|
||||
|
||||
- name: Generate gcov files
|
||||
if: matrix.coverage && success()
|
||||
if: matrix.coverage
|
||||
run: |
|
||||
cd "${SRCDIR}"
|
||||
find . -type f -name '*.gcno' -exec gcov -pb {} + || true
|
||||
|
||||
- name: Codecov
|
||||
if: matrix.coverage && success()
|
||||
if: matrix.coverage
|
||||
uses: codecov/codecov-action@v2
|
||||
with:
|
||||
flags: ${{ matrix.features }}-${{ matrix.compiler }}-${{ matrix.extra }}
|
||||
flags: linux,${{ matrix.features }}-${{ matrix.compiler }}-${{ matrix.extra }}
|
||||
|
||||
- name: ASan logs
|
||||
if: contains(matrix.extra, 'asan') && !cancelled()
|
||||
run: |
|
||||
for f in $(grep -lR '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "${LOG_DIR}"); do
|
||||
for f in $(grep -lR '#[[:digit:]]* *0x[[:xdigit:]]*' "${LOG_DIR}"); do
|
||||
asan_symbolize -l "$f"
|
||||
false # in order to fail a job
|
||||
done
|
||||
@ -344,15 +344,14 @@ jobs:
|
||||
make ${TEST}
|
||||
|
||||
windows:
|
||||
runs-on: windows-latest
|
||||
runs-on: windows-2019
|
||||
|
||||
env:
|
||||
VCVARSALL: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
|
||||
# Interfaces
|
||||
# Lua
|
||||
LUA_VER: 54
|
||||
LUA_VER_DOT: '5.4'
|
||||
LUA_RELEASE: 5.4.0
|
||||
LUA_RELEASE: 5.4.2
|
||||
LUA32_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win32_dllw6_lib.zip
|
||||
LUA64_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win64_dllw6_lib.zip
|
||||
LUA_DIR: D:\Lua
|
||||
@ -360,8 +359,8 @@ jobs:
|
||||
PYTHON_VER: 27
|
||||
PYTHON_VER_DOT: '2.7'
|
||||
# Python 3
|
||||
PYTHON3_VER: 38
|
||||
PYTHON3_VER_DOT: '3.8'
|
||||
PYTHON3_VER: 310
|
||||
PYTHON3_VER_DOT: '3.10'
|
||||
# Other dependencies
|
||||
# winpty
|
||||
WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip
|
||||
@ -392,6 +391,10 @@ jobs:
|
||||
msystem: MINGW32
|
||||
cygreg: registry32
|
||||
pyreg: "-32"
|
||||
- toolchain: mingw
|
||||
arch: x64
|
||||
features: HUGE
|
||||
coverage: yes
|
||||
exclude:
|
||||
- toolchain: msvc
|
||||
arch: x64
|
||||
@ -406,6 +409,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
git config --global core.autocrlf input
|
||||
echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV
|
||||
python_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON_VER_DOT}/InstallPath/@")
|
||||
python3_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}${{ matrix.pyreg }}/InstallPath/@")
|
||||
echo "PYTHON_DIR=$python_dir" >> $GITHUB_ENV
|
||||
@ -463,8 +467,7 @@ jobs:
|
||||
|
||||
- name: Copy src directory to src2
|
||||
shell: cmd
|
||||
run: |
|
||||
xcopy src src2\ /E > nul
|
||||
run: xcopy src src2\ /E > nul
|
||||
|
||||
- name: Build (MSVC)
|
||||
if: matrix.toolchain == 'msvc'
|
||||
@ -501,7 +504,7 @@ jobs:
|
||||
DYNAMIC_LUA=yes LUA=${LUA_DIR} \
|
||||
DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \
|
||||
DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \
|
||||
STATIC_STDCPLUS=yes
|
||||
STATIC_STDCPLUS=yes COVERAGE=${{ matrix.coverage }}
|
||||
else
|
||||
mingw32-make -f Make_ming.mak -j2 \
|
||||
FEATURES=${{ matrix.features }} \
|
||||
@ -509,6 +512,14 @@ jobs:
|
||||
STATIC_STDCPLUS=yes
|
||||
fi
|
||||
|
||||
- name: Check version
|
||||
shell: cmd
|
||||
run: |
|
||||
PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
|
||||
src\vim --version || exit 1
|
||||
src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
|
||||
src\vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
|
||||
|
||||
#- name: Prepare Artifact
|
||||
# shell: cmd
|
||||
# run: |
|
||||
@ -522,27 +533,34 @@ jobs:
|
||||
# name: vim${{ matrix.bits }}-${{ matrix.toolchain }}
|
||||
# path: ./artifacts
|
||||
|
||||
- name: Test
|
||||
- name: Copy gcov data files to src2
|
||||
if: matrix.coverage
|
||||
shell: msys2 {0}
|
||||
run: find src -name '*.gcno' | tar -c -T - | tar -x -C src2 --strip-components 1
|
||||
|
||||
- name: Test and show the result of testing gVim
|
||||
shell: cmd
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
|
||||
call "%VCVARSALL%" ${{ matrix.vcarch }}
|
||||
cd src
|
||||
echo.
|
||||
echo %COL_GREEN%vim version:%COL_RESET%
|
||||
.\vim --version || exit 1
|
||||
|
||||
echo %COL_GREEN%Start testing vim in background.%COL_RESET%
|
||||
start cmd /c "cd ..\src2\testdir & nmake -nologo -f Make_dos.mak VIMPROG=..\..\src\vim > nul & echo done>done.txt"
|
||||
echo %COL_GREEN%Start testing Vim in background.%COL_RESET%
|
||||
start cmd /c "cd src2\testdir & nmake -nologo -f Make_dos.mak VIMPROG=..\..\src\vim > nul & echo done>done.txt"
|
||||
|
||||
echo %COL_GREEN%Test gvim:%COL_RESET%
|
||||
cd testdir
|
||||
echo %COL_GREEN%Test gVim:%COL_RESET%
|
||||
cd src\testdir
|
||||
nmake -nologo -f Make_dos.mak VIMPROG=..\gvim || exit 1
|
||||
cd ..
|
||||
|
||||
echo %COL_GREEN%Wait for vim tests to finish.%COL_RESET%
|
||||
cd ..\src2\testdir
|
||||
- name: Show the result of testing Vim
|
||||
shell: cmd
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
|
||||
call "%VCVARSALL%" ${{ matrix.vcarch }}
|
||||
|
||||
echo %COL_GREEN%Wait for Vim tests to finish.%COL_RESET%
|
||||
cd src2\testdir
|
||||
:: Wait about 10 minutes.
|
||||
for /L %%i in (1,1,60) do (
|
||||
if exist done.txt goto exitloop
|
||||
@ -552,10 +570,35 @@ jobs:
|
||||
set timeout=1
|
||||
:exitloop
|
||||
|
||||
echo %COL_GREEN%Test results of vim:%COL_RESET%
|
||||
echo %COL_GREEN%The result of testing Vim:%COL_RESET%
|
||||
cd src2\testdir
|
||||
if exist messages type messages
|
||||
nmake -nologo -f Make_dos.mak report VIMPROG=..\..\src\vim || exit 1
|
||||
|
||||
if "%timeout%"=="1" (
|
||||
echo %COL_RED%Timed out.%COL_RESET%
|
||||
exit 1
|
||||
)
|
||||
|
||||
- name: Generate gcov files
|
||||
if: matrix.coverage
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
cd src
|
||||
find . -type f -name '*.gcno' -exec gcov -pb {} + || true
|
||||
cd ../src2
|
||||
find . -type f -name '*.gcno' -exec gcov -pb {} + || true
|
||||
|
||||
- name: Codecov (gVim)
|
||||
if: matrix.coverage
|
||||
uses: codecov/codecov-action@v2
|
||||
with:
|
||||
directory: src
|
||||
flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}-gui
|
||||
|
||||
- name: Codecov (Vim)
|
||||
if: matrix.coverage
|
||||
uses: codecov/codecov-action@v2
|
||||
with:
|
||||
directory: src2
|
||||
flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}
|
||||
|
7
.gitignore
vendored
7
.gitignore
vendored
@ -96,5 +96,10 @@ src/shadow-*
|
||||
src/runtime
|
||||
src/pixmaps
|
||||
|
||||
# other possible files build by tools
|
||||
# other files possibly created by tools
|
||||
src/cscope.out
|
||||
|
||||
# Linter/language server files
|
||||
/.cache/clangd/
|
||||
/.ccls-cache/
|
||||
/compile_commands.json
|
||||
|
10
Filelist
10
Filelist
@ -113,6 +113,8 @@ SRC_ALL = \
|
||||
src/nbdebug.h \
|
||||
src/netbeans.c \
|
||||
src/normal.c \
|
||||
src/nv_cmdidxs.h \
|
||||
src/nv_cmds.h \
|
||||
src/ops.c \
|
||||
src/option.c \
|
||||
src/option.h \
|
||||
@ -196,7 +198,6 @@ SRC_ALL = \
|
||||
src/testdir/view_util.vim \
|
||||
src/testdir/test[0-9]*.ok \
|
||||
src/testdir/test77a.ok \
|
||||
src/testdir/test83-tags? \
|
||||
src/testdir/test77a.com \
|
||||
src/testdir/test_*.vim \
|
||||
src/testdir/python2/*.py \
|
||||
@ -443,6 +444,8 @@ SRC_UNIX = \
|
||||
src/configure \
|
||||
src/configure.ac \
|
||||
src/create_cmdidxs.vim \
|
||||
src/create_nvcmdidxs.c \
|
||||
src/create_nvcmdidxs.vim \
|
||||
src/gui_at_fs.c \
|
||||
src/gui_at_sb.c \
|
||||
src/gui_at_sb.h \
|
||||
@ -659,10 +662,7 @@ SRC_HAIKU = \
|
||||
# source files for the Mac (also in the extra archive)
|
||||
SRC_MAC = \
|
||||
src/INSTALLmac.txt \
|
||||
src/dehqx.py \
|
||||
src/os_mac_rsrc/*.icns \
|
||||
src/os_mac.h \
|
||||
src/os_mac.rsr.hqx \
|
||||
src/os_mac_conv.c \
|
||||
src/os_macosx.m \
|
||||
src/proto/os_mac_conv.pro \
|
||||
@ -700,7 +700,6 @@ SRC_EXTRA = \
|
||||
$(SRC_QNX) \
|
||||
$(SRC_VMS) \
|
||||
README_os390.txt \
|
||||
src/infplist.xml \
|
||||
src/link.390 \
|
||||
src/os_vms_fix.com \
|
||||
src/toolbar.phi \
|
||||
@ -1000,6 +999,7 @@ LANG_GEN = \
|
||||
runtime/doc/*-tr.1 \
|
||||
runtime/doc/*-tr.UTF-8.1 \
|
||||
runtime/lang/README.txt \
|
||||
runtime/lang/Makefile \
|
||||
runtime/lang/menu_*.vim \
|
||||
runtime/keymap/README.txt \
|
||||
runtime/keymap/*.vim \
|
||||
|
@ -347,6 +347,9 @@ Section "$(str_section_exe)" id_section_exe
|
||||
File /oname=gvim.exe ${VIMSRC}\gvim_ole.exe
|
||||
!if /FileExists "${VIMSRC}\vim${BIT}.dll"
|
||||
File ${VIMSRC}\vim${BIT}.dll
|
||||
!endif
|
||||
!if /FileExists "${VIMRT}\libsodium.dll"
|
||||
File ${VIMRT}\libsodium.dll
|
||||
!endif
|
||||
File /oname=install.exe ${VIMSRC}\installw32.exe
|
||||
File /oname=uninstall.exe ${VIMSRC}\uninstallw32.exe
|
||||
|
@ -4,13 +4,13 @@ vim9script noclear
|
||||
# Language: C
|
||||
# Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
# Rewritten in Vim9 script by github user lacygoill
|
||||
# Last Change: 2021 Dec 27
|
||||
# Last Change: 2022 Jan 31
|
||||
|
||||
var prepended: string
|
||||
var grepCache: dict<list<dict<any>>>
|
||||
|
||||
# This function is used for the 'omnifunc' option.
|
||||
def ccomplete#Complete(findstart: bool, abase: string): any # {{{1
|
||||
export def Complete(findstart: bool, abase: string): any # {{{1
|
||||
if findstart
|
||||
# Locate the start of the item, including ".", "->" and "[...]".
|
||||
var line: string = getline('.')
|
||||
@ -202,7 +202,7 @@ def ccomplete#Complete(findstart: bool, abase: string): any # {{{1
|
||||
|| !v['static']
|
||||
|| bufnr('%') == bufnr(v['filename']))
|
||||
|
||||
res = extendnew(res, tags->map((_, v: dict<any>) => Tag2item(v)))
|
||||
res = res->extend(tags->map((_, v: dict<any>) => Tag2item(v)))
|
||||
endif
|
||||
|
||||
if len(res) == 0
|
||||
@ -216,9 +216,9 @@ def ccomplete#Complete(findstart: bool, abase: string): any # {{{1
|
||||
for i: number in len(diclist)->range()
|
||||
# New ctags has the "typeref" field. Patched version has "typename".
|
||||
if diclist[i]->has_key('typename')
|
||||
res = extendnew(res, diclist[i]['typename']->StructMembers(items[1 :], true))
|
||||
res = res->extend(diclist[i]['typename']->StructMembers(items[1 :], true))
|
||||
elseif diclist[i]->has_key('typeref')
|
||||
res = extendnew(res, diclist[i]['typeref']->StructMembers(items[1 :], true))
|
||||
res = res->extend(diclist[i]['typeref']->StructMembers(items[1 :], true))
|
||||
endif
|
||||
|
||||
# For a variable use the command, which must be a search pattern that
|
||||
@ -227,7 +227,7 @@ def ccomplete#Complete(findstart: bool, abase: string): any # {{{1
|
||||
var line: string = diclist[i]['cmd']
|
||||
if line[: 1] == '/^'
|
||||
var col: number = line->charidx(match(line, '\<' .. items[0] .. '\>'))
|
||||
res = extendnew(res, line[2 : col - 1]->Nextitem(items[1 :], 0, true))
|
||||
res = res->extend(line[2 : col - 1]->Nextitem(items[1 :], 0, true))
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
@ -256,11 +256,10 @@ def ccomplete#Complete(findstart: bool, abase: string): any # {{{1
|
||||
enddef
|
||||
|
||||
def GetAddition( # {{{1
|
||||
line: string,
|
||||
match: string,
|
||||
memarg: list<dict<any>>,
|
||||
bracket: bool
|
||||
): string
|
||||
line: string,
|
||||
match: string,
|
||||
memarg: list<dict<any>>,
|
||||
bracket: bool): string
|
||||
# Guess if the item is an array.
|
||||
if bracket && match(line, match .. '\s*\[') > 0
|
||||
return '['
|
||||
@ -403,10 +402,9 @@ def Tagline2item(val: dict<any>, brackets: string): dict<string> # {{{1
|
||||
enddef
|
||||
|
||||
def Tagcmd2extra( # {{{1
|
||||
cmd: string,
|
||||
name: string,
|
||||
fname: string
|
||||
): string
|
||||
cmd: string,
|
||||
name: string,
|
||||
fname: string): string
|
||||
# Turn a command from a tag line to something that is useful in the menu
|
||||
var x: string
|
||||
if cmd =~ '^/^'
|
||||
@ -427,11 +425,10 @@ def Tagcmd2extra( # {{{1
|
||||
enddef
|
||||
|
||||
def Nextitem( # {{{1
|
||||
lead: string,
|
||||
items: list<string>,
|
||||
depth: number,
|
||||
all: bool
|
||||
): list<dict<string>>
|
||||
lead: string,
|
||||
items: list<string>,
|
||||
depth: number,
|
||||
all: bool): list<dict<string>>
|
||||
# Find composing type in "lead" and match items[0] with it.
|
||||
# Repeat this recursively for items[1], if it's there.
|
||||
# When resolving typedefs "depth" is used to avoid infinite recursion.
|
||||
@ -473,11 +470,11 @@ def Nextitem( # {{{1
|
||||
|
||||
# New ctags has the "typeref" field. Patched version has "typename".
|
||||
if item->has_key('typeref')
|
||||
res = extendnew(res, item['typeref']->StructMembers(items, all))
|
||||
res = res->extend(item['typeref']->StructMembers(items, all))
|
||||
continue
|
||||
endif
|
||||
if item->has_key('typename')
|
||||
res = extendnew(res, item['typename']->StructMembers(items, all))
|
||||
res = res->extend(item['typename']->StructMembers(items, all))
|
||||
continue
|
||||
endif
|
||||
|
||||
@ -511,11 +508,11 @@ def Nextitem( # {{{1
|
||||
endif
|
||||
endfor
|
||||
if name != ''
|
||||
res = extendnew(res, StructMembers(cmdtokens[0] .. ':' .. name, items, all))
|
||||
res = res->extend(StructMembers(cmdtokens[0] .. ':' .. name, items, all))
|
||||
endif
|
||||
elseif depth < 10
|
||||
# Could be "typedef other_T some_T".
|
||||
res = extendnew(res, cmdtokens[0]->Nextitem(items, depth + 1, all))
|
||||
res = res->extend(cmdtokens[0]->Nextitem(items, depth + 1, all))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@ -529,10 +526,9 @@ def Nextitem( # {{{1
|
||||
enddef
|
||||
|
||||
def StructMembers( # {{{1
|
||||
atypename: string,
|
||||
items: list<string>,
|
||||
all: bool
|
||||
): list<dict<string>>
|
||||
atypename: string,
|
||||
items: list<string>,
|
||||
all: bool): list<dict<string>>
|
||||
|
||||
# Search for members of structure "typename" in tags files.
|
||||
# Return a list with resulting matches.
|
||||
@ -641,10 +637,9 @@ def StructMembers( # {{{1
|
||||
enddef
|
||||
|
||||
def SearchMembers( # {{{1
|
||||
matches: list<dict<any>>,
|
||||
items: list<string>,
|
||||
all: bool
|
||||
): list<dict<string>>
|
||||
matches: list<dict<any>>,
|
||||
items: list<string>,
|
||||
all: bool): list<dict<string>>
|
||||
|
||||
# For matching members, find matches for following items.
|
||||
# When "all" is true find all, otherwise just return 1 if there is any member.
|
||||
@ -674,7 +669,7 @@ def SearchMembers( # {{{1
|
||||
endif
|
||||
|
||||
if typename != ''
|
||||
res = extendnew(res, StructMembers(typename, items, all))
|
||||
res = res->extend(StructMembers(typename, items, all))
|
||||
else
|
||||
# Use the search command (the declaration itself).
|
||||
var sb: number = line->match('\t\zs/^')
|
||||
@ -683,7 +678,7 @@ def SearchMembers( # {{{1
|
||||
var e: number = line
|
||||
->charidx(match(line, '\<' .. matches[i]['match'] .. '\>', sb))
|
||||
if e > 0
|
||||
res = extendnew(res, line[s : e - 1]->Nextitem(items, 0, all))
|
||||
res = res->extend(line[s : e - 1]->Nextitem(items, 0, all))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
764
runtime/autoload/dist/ft.vim
vendored
764
runtime/autoload/dist/ft.vim
vendored
File diff suppressed because it is too large
Load Diff
426
runtime/autoload/dist/script.vim
vendored
Normal file
426
runtime/autoload/dist/script.vim
vendored
Normal file
@ -0,0 +1,426 @@
|
||||
vim9script
|
||||
|
||||
# Vim function for detecting a filetype from the file contents.
|
||||
# Invoked from "scripts.vim" in 'runtimepath'
|
||||
#
|
||||
# Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
# Last Change: 2022 Feb 13
|
||||
|
||||
export def DetectFiletype()
|
||||
var line1 = getline(1)
|
||||
if line1[0] == '#' && line1[1] == '!'
|
||||
# File that starts with "#!".
|
||||
DetectFromHashBang(line1)
|
||||
else
|
||||
# File does not start with "#!".
|
||||
DetectFromText(line1)
|
||||
endif
|
||||
enddef
|
||||
|
||||
# Called for a script that has "#!" in the first line.
|
||||
def DetectFromHashBang(firstline: string)
|
||||
var line1 = firstline
|
||||
|
||||
# Check for a line like "#!/usr/bin/env {options} bash". Turn it into
|
||||
# "#!/usr/bin/bash" to make matching easier.
|
||||
# Recognize only a few {options} that are commonly used.
|
||||
if line1 =~ '^#!\s*\S*\<env\s'
|
||||
line1 = substitute(line1, '\S\+=\S\+', '', 'g')
|
||||
line1 = substitute(line1, '\(-[iS]\|--ignore-environment\|--split-string\)', '', '')
|
||||
line1 = substitute(line1, '\<env\s\+', '', '')
|
||||
endif
|
||||
|
||||
# Get the program name.
|
||||
# Only accept spaces in PC style paths: "#!c:/program files/perl [args]".
|
||||
# If the word env is used, use the first word after the space:
|
||||
# "#!/usr/bin/env perl [path/args]"
|
||||
# If there is no path use the first word: "#!perl [path/args]".
|
||||
# Otherwise get the last word after a slash: "#!/usr/bin/perl [path/args]".
|
||||
var name: string
|
||||
if line1 =~ '^#!\s*\a:[/\\]'
|
||||
name = substitute(line1, '^#!.*[/\\]\(\i\+\).*', '\1', '')
|
||||
elseif line1 =~ '^#!.*\<env\>'
|
||||
name = substitute(line1, '^#!.*\<env\>\s\+\(\i\+\).*', '\1', '')
|
||||
elseif line1 =~ '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)'
|
||||
name = substitute(line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '')
|
||||
else
|
||||
name = substitute(line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '')
|
||||
endif
|
||||
|
||||
# tcl scripts may have #!/bin/sh in the first line and "exec wish" in the
|
||||
# third line. Suggested by Steven Atkinson.
|
||||
if getline(3) =~ '^exec wish'
|
||||
name = 'wish'
|
||||
endif
|
||||
|
||||
# Bourne-like shell scripts: bash bash2 ksh ksh93 sh
|
||||
if name =~ '^\(bash\d*\|\|ksh\d*\|sh\)\>'
|
||||
call dist#ft#SetFileTypeSH(line1)
|
||||
|
||||
# csh scripts
|
||||
elseif name =~ '^csh\>'
|
||||
if exists("g:filetype_csh")
|
||||
call dist#ft#SetFileTypeShell(g:filetype_csh)
|
||||
else
|
||||
call dist#ft#SetFileTypeShell("csh")
|
||||
endif
|
||||
|
||||
# tcsh scripts
|
||||
elseif name =~ '^tcsh\>'
|
||||
call dist#ft#SetFileTypeShell("tcsh")
|
||||
|
||||
# Z shell scripts
|
||||
elseif name =~ '^zsh\>'
|
||||
set ft=zsh
|
||||
|
||||
# TCL scripts
|
||||
elseif name =~ '^\(tclsh\|wish\|expectk\|itclsh\|itkwish\)\>'
|
||||
set ft=tcl
|
||||
|
||||
# Expect scripts
|
||||
elseif name =~ '^expect\>'
|
||||
set ft=expect
|
||||
|
||||
# Gnuplot scripts
|
||||
elseif name =~ '^gnuplot\>'
|
||||
set ft=gnuplot
|
||||
|
||||
# Makefiles
|
||||
elseif name =~ 'make\>'
|
||||
set ft=make
|
||||
|
||||
# Pike
|
||||
elseif name =~ '^pike\%(\>\|[0-9]\)'
|
||||
set ft=pike
|
||||
|
||||
# Lua
|
||||
elseif name =~ 'lua'
|
||||
set ft=lua
|
||||
|
||||
# Perl
|
||||
elseif name =~ 'perl'
|
||||
set ft=perl
|
||||
|
||||
# PHP
|
||||
elseif name =~ 'php'
|
||||
set ft=php
|
||||
|
||||
# Python
|
||||
elseif name =~ 'python'
|
||||
set ft=python
|
||||
|
||||
# Groovy
|
||||
elseif name =~ '^groovy\>'
|
||||
set ft=groovy
|
||||
|
||||
# Raku
|
||||
elseif name =~ 'raku'
|
||||
set ft=raku
|
||||
|
||||
# Ruby
|
||||
elseif name =~ 'ruby'
|
||||
set ft=ruby
|
||||
|
||||
# JavaScript
|
||||
elseif name =~ 'node\(js\)\=\>\|js\>' || name =~ 'rhino\>'
|
||||
set ft=javascript
|
||||
|
||||
# BC calculator
|
||||
elseif name =~ '^bc\>'
|
||||
set ft=bc
|
||||
|
||||
# sed
|
||||
elseif name =~ 'sed\>'
|
||||
set ft=sed
|
||||
|
||||
# OCaml-scripts
|
||||
elseif name =~ 'ocaml'
|
||||
set ft=ocaml
|
||||
|
||||
# Awk scripts; also finds "gawk"
|
||||
elseif name =~ 'awk\>'
|
||||
set ft=awk
|
||||
|
||||
# Website MetaLanguage
|
||||
elseif name =~ 'wml'
|
||||
set ft=wml
|
||||
|
||||
# Scheme scripts
|
||||
elseif name =~ 'scheme'
|
||||
set ft=scheme
|
||||
|
||||
# CFEngine scripts
|
||||
elseif name =~ 'cfengine'
|
||||
set ft=cfengine
|
||||
|
||||
# Erlang scripts
|
||||
elseif name =~ 'escript'
|
||||
set ft=erlang
|
||||
|
||||
# Haskell
|
||||
elseif name =~ 'haskell'
|
||||
set ft=haskell
|
||||
|
||||
# Scala
|
||||
elseif name =~ 'scala\>'
|
||||
set ft=scala
|
||||
|
||||
# Clojure
|
||||
elseif name =~ 'clojure'
|
||||
set ft=clojure
|
||||
|
||||
# Free Pascal
|
||||
elseif name =~ 'instantfpc\>'
|
||||
set ft=pascal
|
||||
|
||||
# Fennel
|
||||
elseif name =~ 'fennel\>'
|
||||
set ft=fennel
|
||||
|
||||
# MikroTik RouterOS script
|
||||
elseif name =~ 'rsc\>'
|
||||
set ft=routeros
|
||||
|
||||
# Fish shell
|
||||
elseif name =~ 'fish\>'
|
||||
set ft=fish
|
||||
|
||||
# Gforth
|
||||
elseif name =~ 'gforth\>'
|
||||
set ft=forth
|
||||
|
||||
endif
|
||||
enddef
|
||||
|
||||
|
||||
# Called for a script that does not have "#!" in the first line.
|
||||
def DetectFromText(line1: string)
|
||||
var line2 = getline(2)
|
||||
var line3 = getline(3)
|
||||
var line4 = getline(4)
|
||||
var line5 = getline(5)
|
||||
|
||||
# Bourne-like shell scripts: sh ksh bash bash2
|
||||
if line1 =~ '^:$'
|
||||
call dist#ft#SetFileTypeSH(line1)
|
||||
|
||||
# Z shell scripts
|
||||
elseif line1 =~ '^#compdef\>'
|
||||
|| line1 =~ '^#autoload\>'
|
||||
|| "\n" .. line1 .. "\n" .. line2 .. "\n" .. line3 ..
|
||||
"\n" .. line4 .. "\n" .. line5
|
||||
=~ '\n\s*emulate\s\+\%(-[LR]\s\+\)\=[ckz]\=sh\>'
|
||||
set ft=zsh
|
||||
|
||||
# ELM Mail files
|
||||
elseif line1 =~ '^From \([a-zA-Z][a-zA-Z_0-9\.=-]*\(@[^ ]*\)\=\|-\) .* \(19\|20\)\d\d$'
|
||||
set ft=mail
|
||||
|
||||
# Mason
|
||||
elseif line1 =~ '^<[%&].*>'
|
||||
set ft=mason
|
||||
|
||||
# Vim scripts (must have '" vim' as the first line to trigger this)
|
||||
elseif line1 =~ '^" *[vV]im$'
|
||||
set ft=vim
|
||||
|
||||
# libcxx and libstdc++ standard library headers like "iostream" do not have
|
||||
# an extension, recognize the Emacs file mode.
|
||||
elseif line1 =~? '-\*-.*C++.*-\*-'
|
||||
set ft=cpp
|
||||
|
||||
# MOO
|
||||
elseif line1 =~ '^\*\* LambdaMOO Database, Format Version \%([1-3]\>\)\@!\d\+ \*\*$'
|
||||
set ft=moo
|
||||
|
||||
# Diff file:
|
||||
# - "diff" in first line (context diff)
|
||||
# - "Only in " in first line
|
||||
# - "--- " in first line and "+++ " in second line (unified diff).
|
||||
# - "*** " in first line and "--- " in second line (context diff).
|
||||
# - "# It was generated by makepatch " in the second line (makepatch diff).
|
||||
# - "Index: <filename>" in the first line (CVS file)
|
||||
# - "=== ", line of "=", "---", "+++ " (SVK diff)
|
||||
# - "=== ", "--- ", "+++ " (bzr diff, common case)
|
||||
# - "=== (removed|added|renamed|modified)" (bzr diff, alternative)
|
||||
# - "# HG changeset patch" in first line (Mercurial export format)
|
||||
elseif line1 =~ '^\(diff\>\|Only in \|\d\+\(,\d\+\)\=[cda]\d\+\>\|# It was generated by makepatch \|Index:\s\+\f\+\r\=$\|===== \f\+ \d\+\.\d\+ vs edited\|==== //\f\+#\d\+\|# HG changeset patch\)'
|
||||
|| (line1 =~ '^--- ' && line2 =~ '^+++ ')
|
||||
|| (line1 =~ '^\* looking for ' && line2 =~ '^\* comparing to ')
|
||||
|| (line1 =~ '^\*\*\* ' && line2 =~ '^--- ')
|
||||
|| (line1 =~ '^=== ' && ((line2 =~ '^=\{66\}' && line3 =~ '^--- ' && line4 =~ '^+++') || (line2 =~ '^--- ' && line3 =~ '^+++ ')))
|
||||
|| (line1 =~ '^=== \(removed\|added\|renamed\|modified\)')
|
||||
set ft=diff
|
||||
|
||||
# PostScript Files (must have %!PS as the first line, like a2ps output)
|
||||
elseif line1 =~ '^%![ \t]*PS'
|
||||
set ft=postscr
|
||||
|
||||
# M4 scripts: Guess there is a line that starts with "dnl".
|
||||
elseif line1 =~ '^\s*dnl\>'
|
||||
|| line2 =~ '^\s*dnl\>'
|
||||
|| line3 =~ '^\s*dnl\>'
|
||||
|| line4 =~ '^\s*dnl\>'
|
||||
|| line5 =~ '^\s*dnl\>'
|
||||
set ft=m4
|
||||
|
||||
# AmigaDos scripts
|
||||
elseif $TERM == "amiga" && (line1 =~ "^;" || line1 =~? '^\.bra')
|
||||
set ft=amiga
|
||||
|
||||
# SiCAD scripts (must have procn or procd as the first line to trigger this)
|
||||
elseif line1 =~? '^ *proc[nd] *$'
|
||||
set ft=sicad
|
||||
|
||||
# Purify log files start with "**** Purify"
|
||||
elseif line1 =~ '^\*\*\*\* Purify'
|
||||
set ft=purifylog
|
||||
|
||||
# XML
|
||||
elseif line1 =~ '<?\s*xml.*?>'
|
||||
set ft=xml
|
||||
|
||||
# XHTML (e.g.: PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN")
|
||||
elseif line1 =~ '\<DTD\s\+XHTML\s'
|
||||
set ft=xhtml
|
||||
|
||||
# HTML (e.g.: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN")
|
||||
# Avoid "doctype html", used by slim.
|
||||
elseif line1 =~? '<!DOCTYPE\s\+html\>'
|
||||
set ft=html
|
||||
|
||||
# PDF
|
||||
elseif line1 =~ '^%PDF-'
|
||||
set ft=pdf
|
||||
|
||||
# XXD output
|
||||
elseif line1 =~ '^\x\{7}: \x\{2} \=\x\{2} \=\x\{2} \=\x\{2} '
|
||||
set ft=xxd
|
||||
|
||||
# RCS/CVS log output
|
||||
elseif line1 =~ '^RCS file:' || line2 =~ '^RCS file:'
|
||||
set ft=rcslog
|
||||
|
||||
# CVS commit
|
||||
elseif line2 =~ '^CVS:' || getline("$") =~ '^CVS: '
|
||||
set ft=cvs
|
||||
|
||||
# Prescribe
|
||||
elseif line1 =~ '^!R!'
|
||||
set ft=prescribe
|
||||
|
||||
# Send-pr
|
||||
elseif line1 =~ '^SEND-PR:'
|
||||
set ft=sendpr
|
||||
|
||||
# SNNS files
|
||||
elseif line1 =~ '^SNNS network definition file'
|
||||
set ft=snnsnet
|
||||
elseif line1 =~ '^SNNS pattern definition file'
|
||||
set ft=snnspat
|
||||
elseif line1 =~ '^SNNS result file'
|
||||
set ft=snnsres
|
||||
|
||||
# Virata
|
||||
elseif line1 =~ '^%.\{-}[Vv]irata'
|
||||
|| line2 =~ '^%.\{-}[Vv]irata'
|
||||
|| line3 =~ '^%.\{-}[Vv]irata'
|
||||
|| line4 =~ '^%.\{-}[Vv]irata'
|
||||
|| line5 =~ '^%.\{-}[Vv]irata'
|
||||
set ft=virata
|
||||
|
||||
# Strace
|
||||
elseif line1 =~ '[0-9:.]* *execve(' || line1 =~ '^__libc_start_main'
|
||||
set ft=strace
|
||||
|
||||
# VSE JCL
|
||||
elseif line1 =~ '^\* $$ JOB\>' || line1 =~ '^// *JOB\>'
|
||||
set ft=vsejcl
|
||||
|
||||
# TAK and SINDA
|
||||
elseif line4 =~ 'K & K Associates' || line2 =~ 'TAK 2000'
|
||||
set ft=takout
|
||||
elseif line3 =~ 'S Y S T E M S I M P R O V E D '
|
||||
set ft=sindaout
|
||||
elseif getline(6) =~ 'Run Date: '
|
||||
set ft=takcmp
|
||||
elseif getline(9) =~ 'Node File 1'
|
||||
set ft=sindacmp
|
||||
|
||||
# DNS zone files
|
||||
elseif line1 .. line2 .. line3 .. line4 =~ '^; <<>> DiG [0-9.]\+.* <<>>\|$ORIGIN\|$TTL\|IN\s\+SOA'
|
||||
set ft=bindzone
|
||||
|
||||
# BAAN
|
||||
elseif line1 =~ '|\*\{1,80}' && line2 =~ 'VRC '
|
||||
|| line2 =~ '|\*\{1,80}' && line3 =~ 'VRC '
|
||||
set ft=baan
|
||||
|
||||
# Valgrind
|
||||
elseif line1 =~ '^==\d\+== valgrind' || line3 =~ '^==\d\+== Using valgrind'
|
||||
set ft=valgrind
|
||||
|
||||
# Go docs
|
||||
elseif line1 =~ '^PACKAGE DOCUMENTATION$'
|
||||
set ft=godoc
|
||||
|
||||
# Renderman Interface Bytestream
|
||||
elseif line1 =~ '^##RenderMan'
|
||||
set ft=rib
|
||||
|
||||
# Scheme scripts
|
||||
elseif line1 =~ 'exec\s\+\S*scheme' || line2 =~ 'exec\s\+\S*scheme'
|
||||
set ft=scheme
|
||||
|
||||
# Git output
|
||||
elseif line1 =~ '^\(commit\|tree\|object\) \x\{40,\}\>\|^tag \S\+$'
|
||||
set ft=git
|
||||
|
||||
# Gprof (gnu profiler)
|
||||
elseif line1 == 'Flat profile:'
|
||||
&& line2 == ''
|
||||
&& line3 =~ '^Each sample counts as .* seconds.$'
|
||||
set ft=gprof
|
||||
|
||||
# Erlang terms
|
||||
# (See also: http://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html#Choosing-Modes)
|
||||
elseif line1 =~? '-\*-.*erlang.*-\*-'
|
||||
set ft=erlang
|
||||
|
||||
# YAML
|
||||
elseif line1 =~ '^%YAML'
|
||||
set ft=yaml
|
||||
|
||||
# MikroTik RouterOS script
|
||||
elseif line1 =~ '^#.*by RouterOS.*$'
|
||||
set ft=routeros
|
||||
|
||||
# Sed scripts
|
||||
# #ncomment is allowed but most likely a false positive so require a space
|
||||
# before any trailing comment text
|
||||
elseif line1 =~ '^#n\%($\|\s\)'
|
||||
set ft=sed
|
||||
|
||||
else
|
||||
var lnum = 1
|
||||
while getline(lnum) =~ "^? " && lnum < line("$")
|
||||
lnum += 1
|
||||
endwhile
|
||||
if getline(lnum) =~ '^Index:\s\+\f\+$'
|
||||
# CVS diff
|
||||
set ft=diff
|
||||
|
||||
# locale input files: Formal Definitions of Cultural Conventions
|
||||
# filename must be like en_US, fr_FR@euro or en_US.UTF-8
|
||||
elseif expand("%") =~ '\a\a_\a\a\($\|[.@]\)\|i18n$\|POSIX$\|translit_'
|
||||
lnum = 1
|
||||
while lnum < 100 && lnum < line("$")
|
||||
if getline(lnum) =~ '^LC_\(IDENTIFICATION\|CTYPE\|COLLATE\|MONETARY\|NUMERIC\|TIME\|MESSAGES\|PAPER\|TELEPHONE\|MEASUREMENT\|NAME\|ADDRESS\)$'
|
||||
setf fdcc
|
||||
break
|
||||
endif
|
||||
lnum += 1
|
||||
endwhile
|
||||
endif
|
||||
endif
|
||||
enddef
|
41
runtime/autoload/freebasic.vim
Normal file
41
runtime/autoload/freebasic.vim
Normal file
@ -0,0 +1,41 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: FreeBASIC
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 Mar 16
|
||||
|
||||
" Dialects can be one of fb, qb, fblite, or deprecated
|
||||
" Precedence is forcelang > #lang > lang
|
||||
function! freebasic#GetDialect() abort
|
||||
if exists("g:freebasic_forcelang")
|
||||
return g:freebasic_forcelang
|
||||
endif
|
||||
|
||||
if exists("g:freebasic_lang")
|
||||
let dialect = g:freebasic_lang
|
||||
else
|
||||
let dialect = "fb"
|
||||
endif
|
||||
|
||||
" override with #lang directive or metacommand
|
||||
|
||||
let skip = "has('syntax_items') && synIDattr(synID(line('.'), col('.'), 1), 'name') =~ 'Comment$'"
|
||||
let pat = '\c^\s*\%(#\s*lang\s\+\|''\s*$lang\s*:\s*\)"\([^"]*\)"'
|
||||
|
||||
let save_cursor = getcurpos()
|
||||
call cursor(1, 1)
|
||||
let lnum = search(pat, 'n', '', '', skip)
|
||||
call setpos('.', save_cursor)
|
||||
|
||||
if lnum
|
||||
let word = matchlist(getline(lnum), pat)[1]
|
||||
if word =~? '\%(fb\|deprecated\|fblite\|qb\)'
|
||||
let dialect = word
|
||||
else
|
||||
echomsg "freebasic#GetDialect: Invalid lang, found '" .. word .. "' at line " .. lnum .. " " .. getline(lnum)
|
||||
endif
|
||||
endif
|
||||
|
||||
return dialect
|
||||
endfunction
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
@ -1,7 +1,7 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Jest
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2018 May 15
|
||||
" Last Change: 2021 Nov 20
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@ -15,12 +15,14 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" CompilerSet makeprg=npx\ jest\ --no-colors
|
||||
" CompilerSet makeprg=npx\ --no-install\ jest\ --no-colors
|
||||
|
||||
CompilerSet makeprg=jest\ --no-colors
|
||||
CompilerSet errorformat=%E\ \ ●\ %m,
|
||||
CompilerSet errorformat=%-A\ \ ●\ Console,
|
||||
\%E\ \ ●\ %m,
|
||||
\%Z\ %\\{4}%.%#Error:\ %f:\ %m\ (%l:%c):%\\=,
|
||||
\%Z\ %\\{6}at\ %\\S%#\ (%f:%l:%c),
|
||||
\%Z\ %\\{6}at\ %\\S%#\ %f:%l:%c,
|
||||
\%+C\ %\\{4}%\\w%.%#,
|
||||
\%+C\ %\\{4}%[-+]%.%#,
|
||||
\%-C%.%#,
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim compiler file
|
||||
" Compiler: SML/NJ Compiler
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2020 Feb 10
|
||||
" Last Change: 2022 Feb 09
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@ -16,10 +16,10 @@ let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
CompilerSet makeprg=sml
|
||||
CompilerSet errorformat=%f:%l.%c-%\\d%\\+.%\\d%\\+\ %trror:\ %m,
|
||||
CompilerSet errorformat=%f:%l.%c-%e.%k\ %trror:\ %m,
|
||||
\%f:%l.%c\ %trror:\ %m,
|
||||
\%trror:\ %m
|
||||
\%f:%l.%c-%\\d%\\+.%\\d%\\+\ %tarning:\ %m,
|
||||
\%trror:\ %m,
|
||||
\%f:%l.%c-%e.%k\ %tarning:\ %m,
|
||||
\%f:%l.%c\ %tarning:\ %m,
|
||||
\%tarning:\ %m,
|
||||
\%-G%.%#
|
||||
|
@ -1,7 +1,7 @@
|
||||
" The default vimrc file.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last change: 2021 Nov 17
|
||||
" Last change: 2022 Mar 03
|
||||
"
|
||||
" This is loaded if no vimrc file was found.
|
||||
" Except when Vim is run with "-u NONE" or "-C".
|
||||
@ -64,9 +64,10 @@ if has('win32')
|
||||
set guioptions-=t
|
||||
endif
|
||||
|
||||
" Don't use Ex mode, use Q for formatting.
|
||||
" Don't use Q for Ex mode, use it for formatting. Except for Select mode.
|
||||
" Revert with ":unmap Q".
|
||||
map Q gq
|
||||
sunmap Q
|
||||
|
||||
" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
|
||||
" so that you can undo CTRL-U after inserting a line break.
|
||||
|
@ -153,6 +153,7 @@ DOCS = \
|
||||
version6.txt \
|
||||
version7.txt \
|
||||
version8.txt \
|
||||
version9.txt \
|
||||
vi_diff.txt \
|
||||
vim9.txt \
|
||||
visual.txt \
|
||||
@ -298,6 +299,7 @@ HTMLS = \
|
||||
version6.html \
|
||||
version7.html \
|
||||
version8.html \
|
||||
version9.html \
|
||||
vi_diff.html \
|
||||
vimindex.html \
|
||||
vim9.html \
|
||||
|
@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 8.2. Last change: 2022 Jan 21
|
||||
*autocmd.txt* For Vim version 8.2. Last change: 2022 Mar 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -63,7 +63,7 @@ effects. Be careful not to destroy your text.
|
||||
they were given.
|
||||
See |autocmd-nested| for [++nested]. "nested"
|
||||
(without the ++) can also be used, for backwards
|
||||
compatibility.
|
||||
compatibility, but not in |Vim9| script. *E1078*
|
||||
*autocmd-once*
|
||||
If [++once] is supplied the command is executed once,
|
||||
then removed ("one shot").
|
||||
@ -326,6 +326,7 @@ Name triggered by ~
|
||||
|FileChangedRO| before making the first change to a read-only file
|
||||
|
||||
|DiffUpdated| after diffs have been updated
|
||||
|DirChangedPre| before the working directory will change
|
||||
|DirChanged| after the working directory has changed
|
||||
|
||||
|ShellCmdPost| after executing a shell command
|
||||
@ -364,6 +365,7 @@ Name triggered by ~
|
||||
|InsertEnter| starting Insert mode
|
||||
|InsertChange| when typing <Insert> while in Insert or Replace mode
|
||||
|InsertLeave| when leaving Insert mode
|
||||
|InsertLeavePre| just before leaving Insert mode
|
||||
|InsertCharPre| when a character was typed in Insert mode, before
|
||||
inserting it
|
||||
|
||||
@ -738,6 +740,11 @@ DiffUpdated After diffs have been updated. Depending on
|
||||
what kind of diff is being used (internal or
|
||||
external) this can be triggered on every
|
||||
change or when doing |:diffupdate|.
|
||||
*DirChangedPre*
|
||||
DirChangedPre The working directory is going to be changed,
|
||||
as with |DirChanged|. The pattern is like
|
||||
with |DirChanged|. The new directory can be
|
||||
found in v:event.directory.
|
||||
*DirChanged*
|
||||
DirChanged The working directory has changed in response
|
||||
to the |:cd| or |:tcd| or |:lcd| commands, or
|
||||
@ -1633,7 +1640,7 @@ Examples for reading and writing compressed files: >
|
||||
: autocmd BufReadPre,FileReadPre *.gz set bin
|
||||
: autocmd BufReadPost,FileReadPost *.gz '[,']!gunzip
|
||||
: autocmd BufReadPost,FileReadPost *.gz set nobin
|
||||
: autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " . expand("%:r")
|
||||
: autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " .. expand("%:r")
|
||||
: autocmd BufWritePost,FileWritePost *.gz !mv <afile> <afile>:r
|
||||
: autocmd BufWritePost,FileWritePost *.gz !gzip <afile>:r
|
||||
|
||||
@ -1732,7 +1739,7 @@ To insert the current date and time in a *.html file when writing it: >
|
||||
: else
|
||||
: let l = line("$")
|
||||
: endif
|
||||
: exe "1," . l . "g/Last modified: /s/Last modified: .*/Last modified: " .
|
||||
: exe "1," .. l .. "g/Last modified: /s/Last modified: .*/Last modified: " ..
|
||||
: \ strftime("%Y %b %d")
|
||||
:endfun
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*builtin.txt* For Vim version 8.2. Last change: 2022 Jan 22
|
||||
*builtin.txt* For Vim version 8.2. Last change: 2022 Mar 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -539,8 +539,8 @@ sin({expr}) Float sine of {expr}
|
||||
sinh({expr}) Float hyperbolic sine of {expr}
|
||||
slice({expr}, {start} [, {end}]) String, List or Blob
|
||||
slice of a String, List or Blob
|
||||
sort({list} [, {func} [, {dict}]])
|
||||
List sort {list}, using {func} to compare
|
||||
sort({list} [, {how} [, {dict}]])
|
||||
List sort {list}, compare with {how}
|
||||
sound_clear() none stop playing all sounds
|
||||
sound_playevent({name} [, {callback}])
|
||||
Number play an event sound
|
||||
@ -641,10 +641,7 @@ test_feedinput({string}) none add key sequence to input buffer
|
||||
test_garbagecollect_now() none free memory right now for testing
|
||||
test_garbagecollect_soon() none free memory soon for testing
|
||||
test_getvalue({string}) any get value of an internal variable
|
||||
test_gui_drop_files({list}, {row}, {col}, {mods})
|
||||
none drop a list of files in a window
|
||||
test_gui_mouse_event({button}, {row}, {col}, {repeated}, {mods})
|
||||
none add a mouse event to the input buffer
|
||||
test_gui_event({event}, {args}) bool generate a GUI event for testing
|
||||
test_ignore_error({expr}) none ignore a specific error
|
||||
test_null_blob() Blob null value for testing
|
||||
test_null_channel() Channel null value for testing
|
||||
@ -657,8 +654,6 @@ test_null_string() String null value for testing
|
||||
test_option_not_set({name}) none reset flag indicating option was set
|
||||
test_override({expr}, {val}) none test with Vim internal overrides
|
||||
test_refcount({expr}) Number get the reference count of {expr}
|
||||
test_scrollbar({which}, {value}, {dragging})
|
||||
none scroll in the GUI for testing
|
||||
test_setmouse({row}, {col}) none set the mouse position for testing
|
||||
test_settime({expr}) none set current time for testing
|
||||
test_srand_seed([seed]) none set seed for testing srand()
|
||||
@ -859,7 +854,7 @@ argv([{nr} [, {winid}]])
|
||||
:let i = 0
|
||||
:while i < argc()
|
||||
: let f = escape(fnameescape(argv(i)), '.')
|
||||
: exe 'amenu Arg.' . f . ' :e ' . f . '<CR>'
|
||||
: exe 'amenu Arg.' .. f .. ' :e ' .. f .. '<CR>'
|
||||
: let i = i + 1
|
||||
:endwhile
|
||||
< Without the {nr} argument, or when {nr} is -1, a |List| with
|
||||
@ -1139,7 +1134,7 @@ bufwinid({buf}) *bufwinid()*
|
||||
see |bufname()| above. If buffer {buf} doesn't exist or
|
||||
there is no such window, -1 is returned. Example: >
|
||||
|
||||
echo "A window containing buffer 1 is " . (bufwinid(1))
|
||||
echo "A window containing buffer 1 is " .. (bufwinid(1))
|
||||
<
|
||||
Only deals with the current tab page.
|
||||
|
||||
@ -1152,7 +1147,7 @@ bufwinnr({buf}) *bufwinnr()*
|
||||
If buffer {buf} doesn't exist or there is no such window, -1
|
||||
is returned. Example: >
|
||||
|
||||
echo "A window containing buffer 1 is " . (bufwinnr(1))
|
||||
echo "A window containing buffer 1 is " .. (bufwinnr(1))
|
||||
|
||||
< The number can be used with |CTRL-W_w| and ":wincmd w"
|
||||
|:wincmd|.
|
||||
@ -1202,7 +1197,7 @@ byteidx({expr}, {nr}) *byteidx()*
|
||||
byteidxcomp({expr}, {nr}) *byteidxcomp()*
|
||||
Like byteidx(), except that a composing character is counted
|
||||
as a separate character. Example: >
|
||||
let s = 'e' . nr2char(0x301)
|
||||
let s = 'e' .. nr2char(0x301)
|
||||
echo byteidx(s, 1)
|
||||
echo byteidxcomp(s, 1)
|
||||
echo byteidxcomp(s, 2)
|
||||
@ -1397,7 +1392,7 @@ col({expr}) The result is a Number, which is the byte index of the column
|
||||
col(".") column of cursor
|
||||
col("$") length of cursor line plus one
|
||||
col("'t") column of mark t
|
||||
col("'" . markname) column of mark markname
|
||||
col("'" .. markname) column of mark markname
|
||||
< The first column is 1. 0 is returned for an error.
|
||||
For an uppercase mark the column may actually be in another
|
||||
buffer.
|
||||
@ -1406,7 +1401,7 @@ col({expr}) The result is a Number, which is the byte index of the column
|
||||
line. This can be used to obtain the column in Insert mode: >
|
||||
:imap <F2> <C-O>:let save_ve = &ve<CR>
|
||||
\<C-O>:set ve=all<CR>
|
||||
\<C-O>:echo col(".") . "\n" <Bar>
|
||||
\<C-O>:echo col(".") .. "\n" <Bar>
|
||||
\let &ve = save_ve<CR>
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
@ -1890,12 +1885,13 @@ digraph_getlist([{listall}]) *digraph_getlist()*
|
||||
display an error message.
|
||||
|
||||
|
||||
digraph_set({chars}, {digraph}) *digraph_set()* *E1205*
|
||||
digraph_set({chars}, {digraph}) *digraph_set()*
|
||||
Add digraph {chars} to the list. {chars} must be a string
|
||||
with two characters. {digraph} is a string with one UTF-8
|
||||
encoded character. Be careful, composing characters are NOT
|
||||
ignored. This function is similar to |:digraphs| command, but
|
||||
useful to add digraphs start with a white space.
|
||||
encoded character. *E1215*
|
||||
Be careful, composing characters are NOT ignored. This
|
||||
function is similar to |:digraphs| command, but useful to add
|
||||
digraphs start with a white space.
|
||||
|
||||
The function result is v:true if |digraph| is registered. If
|
||||
this fails an error message is given and v:false is returned.
|
||||
@ -1918,7 +1914,7 @@ digraph_setlist({digraphlist}) *digraph_setlist()*
|
||||
Similar to |digraph_set()| but this function can add multiple
|
||||
digraphs at once. {digraphlist} is a list composed of lists,
|
||||
where each list contains two strings with {chars} and
|
||||
{digraph} as in |digraph_set()|.
|
||||
{digraph} as in |digraph_set()|. *E1216*
|
||||
Example: >
|
||||
call digraph_setlist([['aa', 'あ'], ['ii', 'い']])
|
||||
<
|
||||
@ -2082,6 +2078,25 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
|
||||
For checking if a file exists use |filereadable()|.
|
||||
|
||||
The {expr} argument is a string, which contains one of these:
|
||||
varname internal variable (see
|
||||
dict.key |internal-variables|). Also works
|
||||
list[i] for |curly-braces-names|, |Dictionary|
|
||||
import.Func entries, |List| items, imported
|
||||
items, etc.
|
||||
Does not work for local variables in a
|
||||
compiled `:def` function.
|
||||
Also works for a function in |Vim9|
|
||||
script, since it can be used as a
|
||||
function reference.
|
||||
Beware that evaluating an index may
|
||||
cause an error message for an invalid
|
||||
expression. E.g.: >
|
||||
:let l = [1, 2, 3]
|
||||
:echo exists("l[5]")
|
||||
< 0 >
|
||||
:echo exists("l[xx]")
|
||||
< E121: Undefined variable: xx
|
||||
0
|
||||
&option-name Vim option (only checks if it exists,
|
||||
not if it really works)
|
||||
+option-name Vim option that works.
|
||||
@ -2096,21 +2111,6 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
|
||||
?funcname built-in function that could be
|
||||
implemented; to be used to check if
|
||||
"funcname" is valid
|
||||
varname internal variable (see
|
||||
|internal-variables|). Also works
|
||||
for |curly-braces-names|, |Dictionary|
|
||||
entries, |List| items, etc.
|
||||
Does not work for local variables in a
|
||||
compiled `:def` function.
|
||||
Beware that evaluating an index may
|
||||
cause an error message for an invalid
|
||||
expression. E.g.: >
|
||||
:let l = [1, 2, 3]
|
||||
:echo exists("l[5]")
|
||||
< 0 >
|
||||
:echo exists("l[xx]")
|
||||
< E121: Undefined variable: xx
|
||||
0
|
||||
:cmdname Ex command: built-in command, user
|
||||
command or command modifier |:command|.
|
||||
Returns:
|
||||
@ -2140,7 +2140,8 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
|
||||
exists("&shortname")
|
||||
exists("$HOSTNAME")
|
||||
exists("*strftime")
|
||||
exists("*s:MyFunc")
|
||||
exists("*s:MyFunc") " only for legacy script
|
||||
exists("*MyFunc")
|
||||
exists("bufcount")
|
||||
exists(":Make")
|
||||
exists("#CursorHold")
|
||||
@ -2246,12 +2247,12 @@ expand({string} [, {nosuf} [, {list}]]) *expand()*
|
||||
:e extension only
|
||||
|
||||
Example: >
|
||||
:let &tags = expand("%:p:h") . "/tags"
|
||||
:let &tags = expand("%:p:h") .. "/tags"
|
||||
< Note that when expanding a string that starts with '%', '#' or
|
||||
'<', any following text is ignored. This does NOT work: >
|
||||
:let doesntwork = expand("%:h.bak")
|
||||
< Use this: >
|
||||
:let doeswork = expand("%:h") . ".bak"
|
||||
:let doeswork = expand("%:h") .. ".bak"
|
||||
< Also note that expanding "<cfile>" and others only returns the
|
||||
referenced file name without further expansion. If "<cfile>"
|
||||
is "~/.cshrc", you need to do another expand() to have the
|
||||
@ -2632,7 +2633,7 @@ fnameescape({string}) *fnameescape()*
|
||||
and |:write|). And a "-" by itself (special after |:cd|).
|
||||
Example: >
|
||||
:let fname = '+some str%nge|name'
|
||||
:exe "edit " . fnameescape(fname)
|
||||
:exe "edit " .. fnameescape(fname)
|
||||
< results in executing: >
|
||||
edit \+some\ str\%nge\|name
|
||||
<
|
||||
@ -2813,7 +2814,7 @@ function({name} [, {arglist}] [, {dict}])
|
||||
< The Dictionary is only useful when calling a "dict" function.
|
||||
In that case the {dict} is passed in as "self". Example: >
|
||||
function Callback() dict
|
||||
echo "called for " . self.name
|
||||
echo "called for " .. self.name
|
||||
endfunction
|
||||
...
|
||||
let context = {"name": "example"}
|
||||
@ -3012,7 +3013,7 @@ getbufvar({buf}, {varname} [, {def}]) *getbufvar()*
|
||||
string is returned, there is no error message.
|
||||
Examples: >
|
||||
:let bufmodified = getbufvar(1, "&mod")
|
||||
:echo "todo myvar = " . getbufvar("todo", "myvar")
|
||||
:echo "todo myvar = " .. getbufvar("todo", "myvar")
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
GetBufnr()->getbufvar(varname)
|
||||
@ -3073,9 +3074,9 @@ getchar([expr]) *getchar()*
|
||||
This example positions the mouse as it would normally happen: >
|
||||
let c = getchar()
|
||||
if c == "\<LeftMouse>" && v:mouse_win > 0
|
||||
exe v:mouse_win . "wincmd w"
|
||||
exe v:mouse_win .. "wincmd w"
|
||||
exe v:mouse_lnum
|
||||
exe "normal " . v:mouse_col . "|"
|
||||
exe "normal " .. v:mouse_col .. "|"
|
||||
endif
|
||||
<
|
||||
When using bracketed paste only the first character is
|
||||
@ -3755,7 +3756,7 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()*
|
||||
:let cliptext = getreg('*')
|
||||
< When register {regname} was not set the result is an empty
|
||||
string.
|
||||
The {regname} argument must be a string.
|
||||
The {regname} argument must be a string. *E1162*
|
||||
|
||||
getreg('=') returns the last evaluated value of the expression
|
||||
register. (For use in maps.)
|
||||
@ -3872,7 +3873,7 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()*
|
||||
empty string is returned, there is no error message.
|
||||
Examples: >
|
||||
:let list_is_on = gettabwinvar(1, 2, '&list')
|
||||
:echo "myvar = " . gettabwinvar(3, 1, 'myvar')
|
||||
:echo "myvar = " .. gettabwinvar(3, 1, 'myvar')
|
||||
<
|
||||
To obtain all window-local variables use: >
|
||||
gettabwinvar({tabnr}, {winnr}, '&')
|
||||
@ -4005,7 +4006,7 @@ getwinvar({winnr}, {varname} [, {def}]) *getwinvar()*
|
||||
Like |gettabwinvar()| for the current tabpage.
|
||||
Examples: >
|
||||
:let list_is_on = getwinvar(2, '&list')
|
||||
:echo "myvar = " . getwinvar(1, 'myvar')
|
||||
:echo "myvar = " .. getwinvar(1, 'myvar')
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
GetWinnr()->getwinvar(varname)
|
||||
@ -4260,7 +4261,7 @@ histdel({history} [, {item}]) *histdel()*
|
||||
The following three are equivalent: >
|
||||
:call histdel("search", histnr("search"))
|
||||
:call histdel("search", -1)
|
||||
:call histdel("search", '^'.histget("search", -1).'$')
|
||||
:call histdel("search", '^' .. histget("search", -1) .. '$')
|
||||
<
|
||||
To delete the last search pattern and use the last-but-one for
|
||||
the "n" command and 'hlsearch': >
|
||||
@ -4279,7 +4280,7 @@ histget({history} [, {index}]) *histget()*
|
||||
|
||||
Examples:
|
||||
Redo the second last search from history. >
|
||||
:execute '/' . histget("search", -2)
|
||||
:execute '/' .. histget("search", -2)
|
||||
|
||||
< Define an Ex command ":H {num}" that supports re-execution of
|
||||
the {num}th entry from the output of |:history|. >
|
||||
@ -4525,7 +4526,7 @@ input({prompt} [, {text} [, {completion}]]) *input()*
|
||||
|:execute| or |:normal|.
|
||||
|
||||
Example with a mapping: >
|
||||
:nmap \x :call GetFoo()<CR>:exe "/" . Foo<CR>
|
||||
:nmap \x :call GetFoo()<CR>:exe "/" .. Foo<CR>
|
||||
:function GetFoo()
|
||||
: call inputsave()
|
||||
: let g:Foo = input("enter search pattern: ")
|
||||
@ -4673,9 +4674,11 @@ islocked({expr}) *islocked()* *E786*
|
||||
:echo islocked('alist') " 1
|
||||
:echo islocked('alist[1]') " 0
|
||||
|
||||
< When {expr} is a variable that does not exist you get an error
|
||||
message. Use |exists()| to check for existence.
|
||||
In Vim9 script it does not work for local variables.
|
||||
< When {expr} is a variable that does not exist -1 is returned.
|
||||
If {expr} uses a range, list or dict index that is out of
|
||||
range or does not exist you get an error message. Use
|
||||
|exists()| to check for existence.
|
||||
In Vim9 script it does not work for local function variables.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetName()->islocked()
|
||||
@ -4697,7 +4700,7 @@ items({dict}) *items()*
|
||||
order. Also see |keys()| and |values()|.
|
||||
Example: >
|
||||
for [key, value] in items(mydict)
|
||||
echo key . ': ' . value
|
||||
echo key .. ': ' .. value
|
||||
endfor
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
@ -4712,7 +4715,7 @@ join({list} [, {sep}]) *join()*
|
||||
{sep} is omitted a single space is used.
|
||||
Note that {sep} is not added at the end. You might want to
|
||||
add it there too: >
|
||||
let lines = join(mylist, "\n") . "\n"
|
||||
let lines = join(mylist, "\n") .. "\n"
|
||||
< String items are used as-is. |Lists| and |Dictionaries| are
|
||||
converted into a string like with |string()|.
|
||||
The opposite function is |split()|.
|
||||
@ -4787,7 +4790,7 @@ json_encode({expr}) *json_encode()*
|
||||
Encode {expr} as JSON and return this as a string.
|
||||
The encoding is specified in:
|
||||
https://tools.ietf.org/html/rfc7159.html
|
||||
Vim values are converted as follows:
|
||||
Vim values are converted as follows: *E1161*
|
||||
|Number| decimal number
|
||||
|Float| floating point number
|
||||
Float nan "NaN"
|
||||
@ -4901,7 +4904,7 @@ libcallnr({libname}, {funcname}, {argument})
|
||||
line({expr} [, {winid}]) *line()*
|
||||
The result is a Number, which is the line number of the file
|
||||
position given with {expr}. The {expr} argument is a string.
|
||||
The accepted positions are:
|
||||
The accepted positions are: *E1209*
|
||||
. the cursor position
|
||||
$ the last line in the current buffer
|
||||
'x position of mark x (if the mark is not set, 0 is
|
||||
@ -4924,7 +4927,7 @@ line({expr} [, {winid}]) *line()*
|
||||
line(".") line number of the cursor
|
||||
line(".", winid) idem, in window "winid"
|
||||
line("'t") line number of mark t
|
||||
line("'" . marker) line number of mark marker
|
||||
line("'" .. marker) line number of mark marker
|
||||
<
|
||||
To jump to the last known position when opening a file see
|
||||
|last-position-jump|.
|
||||
@ -5000,12 +5003,12 @@ listener_add({callback} [, {buf}]) *listener_add()*
|
||||
Returns a unique ID that can be passed to |listener_remove()|.
|
||||
|
||||
The {callback} is invoked with five arguments:
|
||||
a:bufnr the buffer that was changed
|
||||
a:start first changed line number
|
||||
a:end first line number below the change
|
||||
a:added number of lines added, negative if lines were
|
||||
bufnr the buffer that was changed
|
||||
start first changed line number
|
||||
end first line number below the change
|
||||
added number of lines added, negative if lines were
|
||||
deleted
|
||||
a:changes a List of items with details about the changes
|
||||
changes a List of items with details about the changes
|
||||
|
||||
Example: >
|
||||
func Listener(bufnr, start, end, added, changes)
|
||||
@ -5013,7 +5016,7 @@ listener_add({callback} [, {buf}]) *listener_add()*
|
||||
endfunc
|
||||
call listener_add('Listener', bufnr)
|
||||
|
||||
< The List cannot be changed. Each item in a:changes is a
|
||||
< The List cannot be changed. Each item in "changes" is a
|
||||
dictionary with these entries:
|
||||
lnum the first line number of the change
|
||||
end the first line below the change
|
||||
@ -5140,7 +5143,7 @@ luaeval({expr} [, {expr}]) *luaeval()*
|
||||
|
||||
map({expr1}, {expr2}) *map()*
|
||||
{expr1} must be a |List|, |String|, |Blob| or |Dictionary|.
|
||||
When {expr1} is a |List|| or |Dictionary|, replace each
|
||||
When {expr1} is a |List| or |Dictionary|, replace each
|
||||
item in {expr1} with the result of evaluating {expr2}.
|
||||
For a |Blob| each byte is replaced.
|
||||
For a |String|, each character, including composing
|
||||
@ -5158,7 +5161,7 @@ map({expr1}, {expr2}) *map()*
|
||||
current byte. For a |String| |v:key| has the index of the
|
||||
current character.
|
||||
Example: >
|
||||
:call map(mylist, '"> " . v:val . " <"')
|
||||
:call map(mylist, '"> " .. v:val .. " <"')
|
||||
< This puts "> " before and " <" after each item in "mylist".
|
||||
|
||||
Note that {expr2} is the result of an expression and is then
|
||||
@ -5172,19 +5175,19 @@ map({expr1}, {expr2}) *map()*
|
||||
The function must return the new value of the item. Example
|
||||
that changes each value by "key-value": >
|
||||
func KeyValue(key, val)
|
||||
return a:key . '-' . a:val
|
||||
return a:key .. '-' .. a:val
|
||||
endfunc
|
||||
call map(myDict, function('KeyValue'))
|
||||
< It is shorter when using a |lambda|: >
|
||||
call map(myDict, {key, val -> key . '-' . val})
|
||||
call map(myDict, {key, val -> key .. '-' .. val})
|
||||
< If you do not use "val" you can leave it out: >
|
||||
call map(myDict, {key -> 'item: ' . key})
|
||||
call map(myDict, {key -> 'item: ' .. key})
|
||||
< If you do not use "key" you can use a short name: >
|
||||
call map(myDict, {_, val -> 'item: ' . val})
|
||||
call map(myDict, {_, val -> 'item: ' .. val})
|
||||
<
|
||||
The operation is done in-place for a |List| and |Dictionary|.
|
||||
If you want it to remain unmodified make a copy first: >
|
||||
:let tlist = map(copy(mylist), ' v:val . "\t"')
|
||||
:let tlist = map(copy(mylist), ' v:val .. "\t"')
|
||||
|
||||
< Returns {expr1}, the |List| or |Dictionary| that was filtered,
|
||||
or a new |Blob| or |String|.
|
||||
@ -5260,7 +5263,7 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()*
|
||||
then the global mappings.
|
||||
This function can be used to map a key even when it's already
|
||||
mapped, and have it do the original mapping too. Sketch: >
|
||||
exe 'nnoremap <Tab> ==' . maparg('<Tab>', 'n')
|
||||
exe 'nnoremap <Tab> ==' .. maparg('<Tab>', 'n')
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
GetKey()->maparg('n')
|
||||
@ -5569,7 +5572,7 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()*
|
||||
empty list is returned. If length of {str} is greater than
|
||||
256, then returns an empty list.
|
||||
|
||||
Refer to |fuzzy-match| for more information about fuzzy
|
||||
Refer to |fuzzy-matching| for more information about fuzzy
|
||||
matching strings.
|
||||
|
||||
Example: >
|
||||
@ -5783,7 +5786,7 @@ mkdir({name} [, {path} [, {prot}]])
|
||||
{name}. Thus if you create /tmp/foo/bar then /tmp/foo will be
|
||||
created with 0o755.
|
||||
Example: >
|
||||
:call mkdir($HOME . "/tmp/foo/bar", "p", 0o700)
|
||||
:call mkdir($HOME .. "/tmp/foo/bar", "p", 0o700)
|
||||
|
||||
< This function is not available in the |sandbox|.
|
||||
|
||||
@ -6224,7 +6227,7 @@ prompt_setcallback({buf}, {expr}) *prompt_setcallback()*
|
||||
stopinsert
|
||||
close
|
||||
else
|
||||
call append(line('$') - 1, 'Entered: "' . a:text . '"')
|
||||
call append(line('$') - 1, 'Entered: "' .. a:text .. '"')
|
||||
" Reset 'modified' to allow the buffer to be closed.
|
||||
set nomodified
|
||||
endif
|
||||
@ -6421,7 +6424,7 @@ readdir({directory} [, {expr} [, {dict}]]) *readdir()*
|
||||
function! s:tree(dir)
|
||||
return {a:dir : map(readdir(a:dir),
|
||||
\ {_, x -> isdirectory(x) ?
|
||||
\ {x : s:tree(a:dir . '/' . x)} : x})}
|
||||
\ {x : s:tree(a:dir .. '/' .. x)} : x})}
|
||||
endfunction
|
||||
echo s:tree(".")
|
||||
<
|
||||
@ -6531,7 +6534,7 @@ reduce({object}, {func} [, {initial}]) *reduce()* *E998*
|
||||
{func} is called for every item in {object}, which can be a
|
||||
|String|, |List| or a |Blob|. {func} is called with two
|
||||
arguments: the result so far and current item. After
|
||||
processing all items the result is returned.
|
||||
processing all items the result is returned. *E1132*
|
||||
|
||||
{initial} is the initial result. When omitted, the first item
|
||||
in {object} is used and {func} is first called for the second
|
||||
@ -6618,16 +6621,22 @@ reltimestr({time}) *reltimestr()*
|
||||
|
||||
*remote_expr()* *E449*
|
||||
remote_expr({server}, {string} [, {idvar} [, {timeout}]])
|
||||
Send the {string} to {server}. The string is sent as an
|
||||
expression and the result is returned after evaluation.
|
||||
The result must be a String or a |List|. A |List| is turned
|
||||
into a String by joining the items with a line break in
|
||||
between (not at the end), like with join(expr, "\n").
|
||||
Send the {string} to {server}. The {server} argument is a
|
||||
string, also see |{server}|.
|
||||
|
||||
The string is sent as an expression and the result is returned
|
||||
after evaluation. The result must be a String or a |List|. A
|
||||
|List| is turned into a String by joining the items with a
|
||||
line break in between (not at the end), like with join(expr,
|
||||
"\n").
|
||||
|
||||
If {idvar} is present and not empty, it is taken as the name
|
||||
of a variable and a {serverid} for later use with
|
||||
|remote_read()| is stored there.
|
||||
|
||||
If {timeout} is given the read times out after this many
|
||||
seconds. Otherwise a timeout of 600 seconds is used.
|
||||
|
||||
See also |clientserver| |RemoteReply|.
|
||||
This function is not available in the |sandbox|.
|
||||
{only available when compiled with the |+clientserver| feature}
|
||||
@ -6648,7 +6657,7 @@ remote_expr({server}, {string} [, {idvar} [, {timeout}]])
|
||||
|
||||
remote_foreground({server}) *remote_foreground()*
|
||||
Move the Vim server with the name {server} to the foreground.
|
||||
The {server} argument is a string.
|
||||
The {server} argument is a string, also see |{server}|.
|
||||
This works like: >
|
||||
remote_expr({server}, "foreground()")
|
||||
< Except that on Win32 systems the client does the work, to work
|
||||
@ -6677,7 +6686,7 @@ remote_peek({serverid} [, {retvar}]) *remote_peek()*
|
||||
{only available when compiled with the |+clientserver| feature}
|
||||
Examples: >
|
||||
:let repl = ""
|
||||
:echo "PEEK: ".remote_peek(id, "repl").": ".repl
|
||||
:echo "PEEK: " .. remote_peek(id, "repl") .. ": " .. repl
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
ServerId()->remote_peek()
|
||||
@ -6697,12 +6706,17 @@ remote_read({serverid}, [{timeout}]) *remote_read()*
|
||||
<
|
||||
*remote_send()* *E241*
|
||||
remote_send({server}, {string} [, {idvar}])
|
||||
Send the {string} to {server}. The string is sent as input
|
||||
keys and the function returns immediately. At the Vim server
|
||||
the keys are not mapped |:map|.
|
||||
Send the {string} to {server}. The {server} argument is a
|
||||
string, also see |{server}|.
|
||||
|
||||
The string is sent as input keys and the function returns
|
||||
immediately. At the Vim server the keys are not mapped
|
||||
|:map|.
|
||||
|
||||
If {idvar} is present, it is taken as the name of a variable
|
||||
and a {serverid} for later use with remote_read() is stored
|
||||
there.
|
||||
|
||||
See also |clientserver| |RemoteReply|.
|
||||
This function is not available in the |sandbox|.
|
||||
{only available when compiled with the |+clientserver| feature}
|
||||
@ -6710,12 +6724,12 @@ remote_send({server}, {string} [, {idvar}])
|
||||
Note: Any errors will be reported in the server and may mess
|
||||
up the display.
|
||||
Examples: >
|
||||
:echo remote_send("gvim", ":DropAndReply ".file, "serverid").
|
||||
:echo remote_send("gvim", ":DropAndReply " .. file, "serverid") ..
|
||||
\ remote_read(serverid)
|
||||
|
||||
:autocmd NONE RemoteReply *
|
||||
\ echo remote_read(expand("<amatch>"))
|
||||
:echo remote_send("gvim", ":sleep 10 | echo ".
|
||||
:echo remote_send("gvim", ":sleep 10 | echo " ..
|
||||
\ 'server2client(expand("<client>"), "HELLO")<CR>')
|
||||
<
|
||||
Can also be used as a |method|: >
|
||||
@ -6740,7 +6754,7 @@ remove({list}, {idx} [, {end}]) *remove()*
|
||||
points to an item before {idx} this is an error.
|
||||
See |list-index| for possible values of {idx} and {end}.
|
||||
Example: >
|
||||
:echo "last item: " . remove(mylist, -1)
|
||||
:echo "last item: " .. remove(mylist, -1)
|
||||
:call remove(mylist, 0, 9)
|
||||
<
|
||||
Use |delete()| to remove a file.
|
||||
@ -6756,13 +6770,13 @@ remove({blob}, {idx} [, {end}])
|
||||
byte as {end} a |Blob| with one byte is returned. When {end}
|
||||
points to a byte before {idx} this is an error.
|
||||
Example: >
|
||||
:echo "last byte: " . remove(myblob, -1)
|
||||
:echo "last byte: " .. remove(myblob, -1)
|
||||
:call remove(mylist, 0, 9)
|
||||
|
||||
remove({dict}, {key})
|
||||
Remove the entry from {dict} with key {key} and return it.
|
||||
Example: >
|
||||
:echo "removed " . remove(dict, "one")
|
||||
:echo "removed " .. remove(dict, "one")
|
||||
< If there is no {key} in {dict} this is an error.
|
||||
|
||||
rename({from}, {to}) *rename()*
|
||||
@ -6893,7 +6907,7 @@ screencol() *screencol()*
|
||||
column inside the command line, which is 1 when the command is
|
||||
executed. To get the cursor position in the file use one of
|
||||
the following mappings: >
|
||||
nnoremap <expr> GG ":echom ".screencol()."\n"
|
||||
nnoremap <expr> GG ":echom " .. screencol() .. "\n"
|
||||
nnoremap <silent> GG :echom screencol()<CR>
|
||||
nnoremap GG <Cmd>echom screencol()<CR>
|
||||
<
|
||||
@ -6917,6 +6931,8 @@ screenpos({winid}, {lnum}, {col}) *screenpos()*
|
||||
as if 'conceallevel' is zero. You can set the cursor to the
|
||||
right position and use |screencol()| to get the value with
|
||||
|conceal| taken into account.
|
||||
If the position is in a closed fold the screen position of the
|
||||
first character is returned, {col} is not used.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetWinid()->screenpos(lnum, col)
|
||||
@ -7015,7 +7031,7 @@ search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])
|
||||
Example (goes over all files in the argument list): >
|
||||
:let n = 1
|
||||
:while n <= argc() " loop over all files in arglist
|
||||
: exe "argument " . n
|
||||
: exe "argument " .. n
|
||||
: " start at the last char in the file and wrap for the
|
||||
: " first search to find match at start of file
|
||||
: normal G$
|
||||
@ -7099,11 +7115,11 @@ searchcount([{options}]) *searchcount()*
|
||||
return printf(' /%s [%d/%d]', @/,
|
||||
\ result.current, result.total)
|
||||
endfunction
|
||||
let &statusline .= '%{LastSearchCount()}'
|
||||
let &statusline ..= '%{LastSearchCount()}'
|
||||
|
||||
" Or if you want to show the count only when
|
||||
" 'hlsearch' was on
|
||||
" let &statusline .=
|
||||
" let &statusline ..=
|
||||
" \ '%{v:hlsearch ? LastSearchCount() : ""}'
|
||||
<
|
||||
You can also update the search count, which can be useful in a
|
||||
@ -7390,7 +7406,7 @@ setcellwidths({list}) *setcellwidths()*
|
||||
setcellwidths([[0xad, 0xad, 1],
|
||||
\ [0x2194, 0x2199, 2]])
|
||||
|
||||
< *E1109* *E1110* *E1111* *E1112* *E1113*
|
||||
< *E1109* *E1110* *E1111* *E1112* *E1113* *E1114*
|
||||
The {list} argument is a list of lists with each three
|
||||
numbers. These three numbers are [low, high, width]. "low"
|
||||
and "high" can be the same, in which case this refers to one
|
||||
@ -7648,10 +7664,12 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
|
||||
module name of a module; if given it will be used in
|
||||
quickfix error window instead of the filename.
|
||||
lnum line number in the file
|
||||
end_lnum end of lines, if the item spans multiple lines
|
||||
pattern search pattern used to locate the error
|
||||
col column number
|
||||
vcol when non-zero: "col" is visual column
|
||||
when zero: "col" is byte index
|
||||
end_col end column, if the item spans multiple columns
|
||||
nr error number
|
||||
text description of the error
|
||||
type single-character error type, 'E', 'W', etc.
|
||||
@ -7896,7 +7914,7 @@ sha256({string}) *sha256()*
|
||||
shellescape({string} [, {special}]) *shellescape()*
|
||||
Escape {string} for use as a shell command argument.
|
||||
When the 'shell' contains powershell (MS-Windows) or pwsh
|
||||
(MS-Windows, Linux, and MacOS) then it will enclose {string}
|
||||
(MS-Windows, Linux, and macOS) then it will enclose {string}
|
||||
in single quotes and will double up all internal single
|
||||
quotes.
|
||||
On MS-Windows, when 'shellslash' is not set, it will enclose
|
||||
@ -7925,10 +7943,10 @@ shellescape({string} [, {special}]) *shellescape()*
|
||||
character inside single quotes.
|
||||
|
||||
Example of use with a |:!| command: >
|
||||
:exe '!dir ' . shellescape(expand('<cfile>'), 1)
|
||||
:exe '!dir ' .. shellescape(expand('<cfile>'), 1)
|
||||
< This results in a directory listing for the file under the
|
||||
cursor. Example of use with |system()|: >
|
||||
:call system("chmod +w -- " . shellescape(expand("%")))
|
||||
:call system("chmod +w -- " .. shellescape(expand("%")))
|
||||
< See also |::S|.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
@ -8015,21 +8033,22 @@ slice({expr}, {start} [, {end}]) *slice()*
|
||||
GetList()->slice(offset)
|
||||
|
||||
|
||||
sort({list} [, {func} [, {dict}]]) *sort()* *E702*
|
||||
sort({list} [, {how} [, {dict}]]) *sort()* *E702*
|
||||
Sort the items in {list} in-place. Returns {list}.
|
||||
|
||||
If you want a list to remain unmodified make a copy first: >
|
||||
:let sortedlist = sort(copy(mylist))
|
||||
|
||||
< When {func} is omitted, is empty or zero, then sort() uses the
|
||||
< When {how} is omitted or is an string, then sort() uses the
|
||||
string representation of each item to sort on. Numbers sort
|
||||
after Strings, |Lists| after Numbers. For sorting text in the
|
||||
current buffer use |:sort|.
|
||||
|
||||
When {func} is given and it is '1' or 'i' then case is
|
||||
ignored.
|
||||
When {how} is given and it is 'i' then case is ignored.
|
||||
In legacy script, for backwards compatibility, the value one
|
||||
can be used to ignore case. Zero means to not ignore case.
|
||||
|
||||
When {func} is given and it is 'l' then the current collation
|
||||
When {how} is given and it is 'l' then the current collation
|
||||
locale is used for ordering. Implementation details: strcoll()
|
||||
is used to compare strings. See |:language| check or set the
|
||||
collation locale. |v:collate| can also be used to check the
|
||||
@ -8046,19 +8065,19 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702*
|
||||
< ['n', 'o', 'O', 'p', 'z', 'ö'] ~
|
||||
This does not work properly on Mac.
|
||||
|
||||
When {func} is given and it is 'n' then all items will be
|
||||
When {how} is given and it is 'n' then all items will be
|
||||
sorted numerical (Implementation detail: this uses the
|
||||
strtod() function to parse numbers, Strings, Lists, Dicts and
|
||||
Funcrefs will be considered as being 0).
|
||||
|
||||
When {func} is given and it is 'N' then all items will be
|
||||
When {how} is given and it is 'N' then all items will be
|
||||
sorted numerical. This is like 'n' but a string containing
|
||||
digits will be used as the number they represent.
|
||||
|
||||
When {func} is given and it is 'f' then all items will be
|
||||
When {how} is given and it is 'f' then all items will be
|
||||
sorted numerical. All values must be a Number or a Float.
|
||||
|
||||
When {func} is a |Funcref| or a function name, this function
|
||||
When {how} is a |Funcref| or a function name, this function
|
||||
is called to compare items. The function is invoked with two
|
||||
items as argument and must return zero if they are equal, 1 or
|
||||
bigger if the first one sorts after the second one, -1 or
|
||||
@ -8141,8 +8160,7 @@ sound_playfile({path} [, {callback}])
|
||||
< Can also be used as a |method|: >
|
||||
GetSoundPath()->sound_playfile()
|
||||
|
||||
< There is no error *E538* , but can listen to 538.nl.
|
||||
{only available when compiled with the |+sound| feature}
|
||||
< {only available when compiled with the |+sound| feature}
|
||||
|
||||
|
||||
sound_stop({id}) *sound_stop()*
|
||||
@ -8700,7 +8718,7 @@ substitute({string}, {pat}, {sub}, {flags}) *substitute()*
|
||||
When {sub} starts with "\=", the remainder is interpreted as
|
||||
an expression. See |sub-replace-expression|. Example: >
|
||||
:echo substitute(s, '%\(\x\x\)',
|
||||
\ '\=nr2char("0x" . submatch(1))', 'g')
|
||||
\ '\=nr2char("0x" .. submatch(1))', 'g')
|
||||
|
||||
< When {sub} is a Funcref that function is called, with one
|
||||
optional argument. Example: >
|
||||
@ -8708,7 +8726,7 @@ substitute({string}, {pat}, {sub}, {flags}) *substitute()*
|
||||
< The optional argument is a list which contains the whole
|
||||
matched string and up to nine submatches, like what
|
||||
|submatch()| returns. Example: >
|
||||
:echo substitute(s, '%\(\x\x\)', {m -> '0x' . m[1]}, 'g')
|
||||
:echo substitute(s, '%\(\x\x\)', {m -> '0x' .. m[1]}, 'g')
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
GetString()->substitute(pat, sub, flags)
|
||||
@ -8897,8 +8915,8 @@ system({expr} [, {input}]) *system()* *E677*
|
||||
This is not to be used for interactive commands.
|
||||
|
||||
The result is a String. Example: >
|
||||
:let files = system("ls " . shellescape(expand('%:h')))
|
||||
:let files = system('ls ' . expand('%:h:S'))
|
||||
:let files = system('ls ' .. shellescape(expand('%:h')))
|
||||
:let files = system('ls ' .. expand('%:h:S'))
|
||||
|
||||
< To make the result more system-independent, the shell output
|
||||
is filtered to replace <CR> with <NL> for Macintosh, and
|
||||
@ -9079,7 +9097,7 @@ tempname() *tempname()* *temp-file-name*
|
||||
doesn't exist. It can be used for a temporary file. The name
|
||||
is different for at least 26 consecutive calls. Example: >
|
||||
:let tmpfile = tempname()
|
||||
:exe "redir > " . tmpfile
|
||||
:exe "redir > " .. tmpfile
|
||||
< For Unix, the file will be in a private directory |tempfile|.
|
||||
For MS-Windows forward slashes are used when the 'shellslash'
|
||||
option is set, or when 'shellcmdflag' starts with '-' and
|
||||
@ -9276,7 +9294,7 @@ trim({text} [, {mask} [, {dir}]]) *trim()*
|
||||
Examples: >
|
||||
echo trim(" some text ")
|
||||
< returns "some text" >
|
||||
echo trim(" \r\t\t\r RESERVE \t\n\x0B\xA0") . "_TAIL"
|
||||
echo trim(" \r\t\t\r RESERVE \t\n\x0B\xA0") .. "_TAIL"
|
||||
< returns "RESERVE_TAIL" >
|
||||
echo trim("rm<Xrm<>X>rrm", "rm<>")
|
||||
< returns "Xrm<>X" (characters in the middle are not removed) >
|
||||
@ -9467,7 +9485,7 @@ visualmode([{expr}]) *visualmode()*
|
||||
character-wise, line-wise, or block-wise Visual mode
|
||||
respectively.
|
||||
Example: >
|
||||
:exe "normal " . visualmode()
|
||||
:exe "normal " .. visualmode()
|
||||
< This enters the same Visual mode as before. It is also useful
|
||||
in scripts if you wish to act differently depending on the
|
||||
Visual mode that was used.
|
||||
@ -9671,7 +9689,7 @@ winheight({nr}) *winheight()*
|
||||
An existing window always has a height of zero or more.
|
||||
This excludes any window toolbar line.
|
||||
Examples: >
|
||||
:echo "The current window has " . winheight(0) . " lines."
|
||||
:echo "The current window has " .. winheight(0) .. " lines."
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
GetWinid()->winheight()
|
||||
@ -9812,7 +9830,7 @@ winwidth({nr}) *winwidth()*
|
||||
returned. When window {nr} doesn't exist, -1 is returned.
|
||||
An existing window always has a width of zero or more.
|
||||
Examples: >
|
||||
:echo "The current window has " . winwidth(0) . " columns."
|
||||
:echo "The current window has " .. winwidth(0) .. " columns."
|
||||
:if winwidth(0) <= 50
|
||||
: 50 wincmd |
|
||||
:endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 8.2. Last change: 2021 Dec 29
|
||||
*change.txt* For Vim version 8.2. Last change: 2022 Mar 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -778,11 +778,11 @@ matched pattern is deleted. The separator after {pattern} can also be left
|
||||
out then. Example: >
|
||||
:%s/TESTING
|
||||
This deletes "TESTING" from all lines, but only one per line.
|
||||
|
||||
For compatibility with Vi these two exceptions are allowed:
|
||||
*E1270*
|
||||
For compatibility with Vi these two exceptions are allowed in legacy script:
|
||||
"\/{string}/" and "\?{string}?" do the same as "//{string}/r".
|
||||
"\&{string}&" does the same as "//{string}/".
|
||||
*pattern-delimiter* *E146*
|
||||
*pattern-delimiter* *E146* *E1241* *E1242*
|
||||
Instead of the '/' which surrounds the pattern and replacement string, you can
|
||||
use another single-byte character. This is useful if you want to include a
|
||||
'/' in the search pattern or replacement string. Example: >
|
||||
@ -946,7 +946,7 @@ Consider using a character like "@" or ":". There is no problem if the result
|
||||
of the expression contains the separation character.
|
||||
|
||||
Examples: >
|
||||
:s@\n@\="\r" . expand("$HOME") . "\r"@
|
||||
:s@\n@\="\r" .. expand("$HOME") .. "\r"@
|
||||
This replaces an end-of-line with a new line containing the value of $HOME. >
|
||||
|
||||
s/E/\="\<Char-0x20ac>"/g
|
||||
@ -1076,7 +1076,7 @@ inside of strings can change! Also see 'softtabstop' option. >
|
||||
in [range] (default: current line |cmdline-ranges|),
|
||||
[into register x].
|
||||
|
||||
*p* *put* *E353*
|
||||
*p* *put* *E353* *E1240*
|
||||
["x]p Put the text [from register x] after the cursor
|
||||
[count] times.
|
||||
|
||||
@ -1123,7 +1123,7 @@ inside of strings can change! Also see 'softtabstop' option. >
|
||||
the command. You need to escape the '|' and '"'
|
||||
characters to prevent them from terminating the
|
||||
command. Example: >
|
||||
:put ='path' . \",/test\"
|
||||
:put ='path' .. \",/test\"
|
||||
< If there is no expression after '=', Vim uses the
|
||||
previous expression. You can see it with ":dis =".
|
||||
|
||||
@ -1176,10 +1176,13 @@ register. With blockwise selection it also depends on the size of the block
|
||||
and whether the corners are on an existing character. (Implementation detail:
|
||||
it actually works by first putting the register after the selection and then
|
||||
deleting the selection.)
|
||||
The previously selected text is put in the unnamed register. If you want to
|
||||
put the same text into a Visual selection several times you need to use
|
||||
With 'p' the previously selected text is put in the unnamed register. This is
|
||||
useful if you want to put that text somewhere else. But you cannot repeat the
|
||||
same change.
|
||||
With 'P' the unnamed register is not changed, you can repeat the same change.
|
||||
But the deleted text cannot be used. If you do need it you can use 'p' with
|
||||
another register. E.g., yank the text to copy, Visually select the text to
|
||||
replace and use "0p . You can repeat this as many times as you like, the
|
||||
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
|
||||
|
@ -1,4 +1,4 @@
|
||||
*channel.txt* For Vim version 8.2. Last change: 2021 Nov 28
|
||||
*channel.txt* For Vim version 8.2. Last change: 2022 Feb 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -91,7 +91,7 @@ And you should see the message in Vim. You can move the cursor a word forward:
|
||||
|
||||
To handle asynchronous communication a callback needs to be used: >
|
||||
func MyHandler(channel, msg)
|
||||
echo "from the handler: " . a:msg
|
||||
echo "from the handler: " .. a:msg
|
||||
endfunc
|
||||
call ch_sendexpr(channel, 'hello!', {'callback': "MyHandler"})
|
||||
Vim will not wait for a response. Now the server can send the response later
|
||||
@ -136,7 +136,7 @@ When using an IPv6 address, enclose it within square brackets. E.g.,
|
||||
gets two arguments: the channel and the received message.
|
||||
Example: >
|
||||
func Handle(channel, msg)
|
||||
echo 'Received: ' . a:msg
|
||||
echo 'Received: ' .. a:msg
|
||||
endfunc
|
||||
let channel = ch_open("localhost:8765", {"callback": "Handle"})
|
||||
<
|
||||
@ -1288,18 +1288,18 @@ prompt. >
|
||||
" Create a channel log so we can see what happens.
|
||||
call ch_logfile('logfile', 'w')
|
||||
|
||||
" Function handling a line of text has been typed.
|
||||
" Function handling a line of text that has been typed.
|
||||
func TextEntered(text)
|
||||
" Send the text to a shell with Enter appended.
|
||||
call ch_sendraw(g:shell_job, a:text .. "\n")
|
||||
endfunc
|
||||
|
||||
" Function handling output from the shell: Added above the prompt.
|
||||
" Function handling output from the shell: Add it above the prompt.
|
||||
func GotOutput(channel, msg)
|
||||
call append(line("$") - 1, "- " . a:msg)
|
||||
call append(line("$") - 1, "- " .. a:msg)
|
||||
endfunc
|
||||
|
||||
" Function handling the shell exist: close the window.
|
||||
" Function handling the shell exits: close the window.
|
||||
func JobExit(job, status)
|
||||
quit!
|
||||
endfunc
|
||||
@ -1310,7 +1310,6 @@ prompt. >
|
||||
\ err_cb: function('GotOutput'),
|
||||
\ exit_cb: function('JobExit'),
|
||||
\ })
|
||||
let shell_ch = job_getchannel(shell_job)
|
||||
|
||||
new
|
||||
set buftype=prompt
|
||||
@ -1321,6 +1320,46 @@ prompt. >
|
||||
" start accepting shell commands
|
||||
startinsert
|
||||
<
|
||||
The same in |Vim9| script: >
|
||||
|
||||
vim9script
|
||||
|
||||
# Create a channel log so we can see what happens.
|
||||
ch_logfile('logfile', 'w')
|
||||
|
||||
var shell_job: job
|
||||
|
||||
# Function handling a line of text that has been typed.
|
||||
def TextEntered(text: string)
|
||||
# Send the text to a shell with Enter appended.
|
||||
ch_sendraw(shell_job, text .. "\n")
|
||||
enddef
|
||||
|
||||
# Function handling output from the shell: Add it above the prompt.
|
||||
def GotOutput(channel: channel, msg: string)
|
||||
append(line("$") - 1, "- " .. msg)
|
||||
enddef
|
||||
|
||||
# Function handling the shell exits: close the window.
|
||||
def JobExit(job: job, status: number)
|
||||
quit!
|
||||
enddef
|
||||
|
||||
# Start a shell in the background.
|
||||
shell_job = job_start(["/bin/sh"], {
|
||||
out_cb: GotOutput,
|
||||
err_cb: GotOutput,
|
||||
exit_cb: JobExit,
|
||||
})
|
||||
|
||||
new
|
||||
set buftype=prompt
|
||||
var buf = bufnr('')
|
||||
prompt_setcallback(buf, TextEntered)
|
||||
prompt_setprompt(buf, "shell command: ")
|
||||
|
||||
# start accepting shell commands
|
||||
startinsert
|
||||
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 8.2. Last change: 2022 Jan 08
|
||||
*cmdline.txt* For Vim version 8.2. Last change: 2022 Feb 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -227,7 +227,7 @@ CTRL-\ e {expr} *c_CTRL-\_e*
|
||||
Example: >
|
||||
:cmap <F7> <C-\>eAppendSome()<CR>
|
||||
:func AppendSome()
|
||||
:let cmd = getcmdline() . " Some()"
|
||||
:let cmd = getcmdline() .. " Some()"
|
||||
:" place the cursor on the )
|
||||
:call setcmdpos(strlen(cmd))
|
||||
:return cmd
|
||||
@ -730,7 +730,7 @@ If more line specifiers are given than required for the command, the first
|
||||
one(s) will be ignored.
|
||||
|
||||
Line numbers may be specified with: *:range* *{address}*
|
||||
{number} an absolute line number
|
||||
{number} an absolute line number *E1247*
|
||||
. the current line *:.*
|
||||
$ the last line in the file *:$*
|
||||
% equal to 1,$ (the entire file) *:%*
|
||||
|
@ -382,13 +382,13 @@ Example (this does almost the same as 'diffexpr' being empty): >
|
||||
function MyDiff()
|
||||
let opt = ""
|
||||
if &diffopt =~ "icase"
|
||||
let opt = opt . "-i "
|
||||
let opt = opt .. "-i "
|
||||
endif
|
||||
if &diffopt =~ "iwhite"
|
||||
let opt = opt . "-b "
|
||||
let opt = opt .. "-b "
|
||||
endif
|
||||
silent execute "!diff -a --binary " . opt . v:fname_in . " " . v:fname_new .
|
||||
\ " > " . v:fname_out
|
||||
silent execute "!diff -a --binary " .. opt .. v:fname_in .. " " .. v:fname_new ..
|
||||
\ " > " .. v:fname_out
|
||||
redraw!
|
||||
endfunction
|
||||
|
||||
@ -445,8 +445,8 @@ Example (this does the same as 'patchexpr' being empty): >
|
||||
|
||||
set patchexpr=MyPatch()
|
||||
function MyPatch()
|
||||
:call system("patch -o " . v:fname_out . " " . v:fname_in .
|
||||
\ " < " . v:fname_diff)
|
||||
:call system("patch -o " .. v:fname_out .. " " .. v:fname_in ..
|
||||
\ " < " .. v:fname_diff)
|
||||
endfunction
|
||||
|
||||
Make sure that using the "patch" program doesn't have unwanted side effects.
|
||||
|
@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.2. Last change: 2022 Jan 21
|
||||
*editing.txt* For Vim version 8.2. Last change: 2022 Feb 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -222,7 +222,7 @@ If you want to keep the changed buffer without saving it, switch on the
|
||||
Edit {file} always. Discard any changes to the
|
||||
current buffer.
|
||||
Also see |++opt| and |+cmd|.
|
||||
|
||||
*:edit_#* *:e#*
|
||||
:e[dit] [++opt] [+cmd] #[count]
|
||||
Edit the [count]th buffer (as shown by |:files|).
|
||||
This command does the same as [count] CTRL-^. But ":e
|
||||
@ -389,7 +389,7 @@ as a wildcard when "[" is in the 'isfname' option. A simple way to avoid this
|
||||
is to use "path\[[]abc]", this matches the file "path\[abc]".
|
||||
|
||||
*starstar-wildcard*
|
||||
Expanding "**" is possible on Unix, Win32, Mac OS/X and a few other systems.
|
||||
Expanding "**" is possible on Unix, Win32, macOS and a few other systems.
|
||||
This allows searching a directory tree. This goes up to 100 directories deep.
|
||||
Note there are some commands where this works slightly differently, see
|
||||
|file-searching|.
|
||||
@ -444,9 +444,9 @@ does apply like to other wildcards.
|
||||
|
||||
Environment variables in the expression are expanded when evaluating the
|
||||
expression, thus this works: >
|
||||
:e `=$HOME . '/.vimrc'`
|
||||
:e `=$HOME .. '/.vimrc'`
|
||||
This does not work, $HOME is inside a string and used literally: >
|
||||
:e `='$HOME' . '/.vimrc'`
|
||||
:e `='$HOME' .. '/.vimrc'`
|
||||
|
||||
If the expression returns a string then names are to be separated with line
|
||||
breaks. When the result is a |List| then each item is used as a name. Line
|
||||
@ -633,7 +633,7 @@ list of the current window.
|
||||
Also see |++opt| and |+cmd|.
|
||||
|
||||
:[count]arga[dd] {name} .. *:arga* *:argadd* *E479*
|
||||
:[count]arga[dd]
|
||||
:[count]arga[dd] *E1156*
|
||||
Add the {name}s to the argument list. When {name} is
|
||||
omitted add the current buffer name to the argument
|
||||
list.
|
||||
@ -1650,6 +1650,11 @@ If you don't get warned often enough you can use the following command.
|
||||
if it exists now.
|
||||
Once a file has been checked the timestamp is reset,
|
||||
you will not be warned again.
|
||||
Syntax highlighting, marks, diff status,
|
||||
'fileencoding', 'fileformat' and 'binary' options
|
||||
are not changed. See |v:fcs_choice| to reload these
|
||||
too (for example, if a code formatting tools has
|
||||
changed the file).
|
||||
|
||||
:[N]checkt[ime] {filename}
|
||||
:[N]checkt[ime] [N]
|
||||
@ -1690,7 +1695,7 @@ which version of the file you want to keep.
|
||||
|
||||
The accuracy of the time check depends on the filesystem. On Unix it is
|
||||
usually sub-second. With old file sytems and on MS-Windows it is normally one
|
||||
second. Use has('nanotime') check if sub-second time stamp checks are
|
||||
second. Use `has('nanotime')` to check if sub-second time stamp checks are
|
||||
available.
|
||||
|
||||
There is one situation where you get the message while there is nothing wrong:
|
||||
@ -1772,10 +1777,8 @@ There are three different types of searching:
|
||||
/u/user_x/include
|
||||
|
||||
< Note: If your 'path' setting includes a non-existing directory, Vim will
|
||||
skip the non-existing directory, but continues searching in the parent of
|
||||
the non-existing directory if upwards searching is used. E.g. when
|
||||
searching "../include" and that doesn't exist, and upward searching is
|
||||
used, also searches in "..".
|
||||
skip the non-existing directory, and also does not search in the parent of
|
||||
the non-existing directory if upwards searching is used.
|
||||
|
||||
3) Combined up/downward search:
|
||||
If Vim's current path is /u/user_x/work/release and you do >
|
||||
|
@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.2. Last change: 2022 Jan 21
|
||||
*eval.txt* For Vim version 8.2. Last change: 2022 Mar 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -44,7 +44,8 @@ Profiling is documented at |profiling|.
|
||||
1. Variables *variables*
|
||||
|
||||
1.1 Variable types ~
|
||||
*E712* *E896* *E897* *E899*
|
||||
*E712* *E896* *E897* *E899* *E1098*
|
||||
*E1107* *E1135* *E1138*
|
||||
There are ten types of variables:
|
||||
|
||||
*Number* *Integer*
|
||||
@ -180,7 +181,7 @@ You will not get an error if you try to change the type of a variable.
|
||||
|
||||
|
||||
1.2 Function references ~
|
||||
*Funcref* *E695* *E718*
|
||||
*Funcref* *E695* *E718* *E1086* *E1192*
|
||||
A Funcref variable is obtained with the |function()| function, the |funcref()|
|
||||
function or created with the lambda expression |expr-lambda|. It can be used
|
||||
in an expression in the place of a function name, before the parenthesis
|
||||
@ -469,7 +470,7 @@ It is also possible to put remaining items in a List variable: >
|
||||
:for [i, j; rest] in listlist
|
||||
: call Doit(i, j)
|
||||
: if !empty(rest)
|
||||
: echo "remainder: " . string(rest)
|
||||
: echo "remainder: " .. string(rest)
|
||||
: endif
|
||||
:endfor
|
||||
|
||||
@ -497,11 +498,11 @@ Functions that are useful with a List: >
|
||||
:let list = split("a b c") " create list from items in a string
|
||||
:let string = join(list, ', ') " create string from list items
|
||||
:let s = string(list) " String representation of list
|
||||
:call map(list, '">> " . v:val') " prepend ">> " to each item
|
||||
:call map(list, '">> " .. v:val') " prepend ">> " to each item
|
||||
|
||||
Don't forget that a combination of features can make things simple. For
|
||||
example, to add up all the numbers in a list: >
|
||||
:exe 'let sum = ' . join(nrlist, '+')
|
||||
:exe 'let sum = ' .. join(nrlist, '+')
|
||||
|
||||
|
||||
1.4 Dictionaries ~
|
||||
@ -567,7 +568,7 @@ turn the Dictionary into a List and pass it to |:for|.
|
||||
|
||||
Most often you want to loop over the keys, using the |keys()| function: >
|
||||
:for key in keys(mydict)
|
||||
: echo key . ': ' . mydict[key]
|
||||
: echo key .. ': ' .. mydict[key]
|
||||
:endfor
|
||||
|
||||
The List of keys is unsorted. You may want to sort them first: >
|
||||
@ -575,13 +576,13 @@ The List of keys is unsorted. You may want to sort them first: >
|
||||
|
||||
To loop over the values use the |values()| function: >
|
||||
:for v in values(mydict)
|
||||
: echo "value: " . v
|
||||
: echo "value: " .. v
|
||||
:endfor
|
||||
|
||||
If you want both the key and the value use the |items()| function. It returns
|
||||
a List in which each item is a List with two items, the key and the value: >
|
||||
:for [key, value] in items(mydict)
|
||||
: echo key . ': ' . value
|
||||
: echo key .. ': ' .. value
|
||||
:endfor
|
||||
|
||||
|
||||
@ -676,7 +677,7 @@ Functions that can be used with a Dictionary: >
|
||||
:let small = min(dict) " minimum value in dict
|
||||
:let xs = count(dict, 'x') " count nr of times 'x' appears in dict
|
||||
:let s = string(dict) " String representation of dict
|
||||
:call map(dict, '">> " . v:val') " prepend ">> " to each item
|
||||
:call map(dict, '">> " .. v:val') " prepend ">> " to each item
|
||||
|
||||
|
||||
1.5 Blobs ~
|
||||
@ -764,7 +765,7 @@ length minus one is used: >
|
||||
|
||||
|
||||
Blob modification ~
|
||||
*blob-modification*
|
||||
*blob-modification* *E1182* *E1184*
|
||||
To change a specific byte of a blob use |:let| this way: >
|
||||
:let blob[4] = 0x44
|
||||
|
||||
@ -835,7 +836,7 @@ In legacy script it is possible to form a variable name with curly braces, see
|
||||
|
||||
==============================================================================
|
||||
2. Expression syntax *expression-syntax*
|
||||
|
||||
*E1143*
|
||||
Expression syntax summary, from least to most significant:
|
||||
|
||||
|expr1| expr2
|
||||
@ -916,14 +917,17 @@ Example: >
|
||||
|
||||
All expressions within one level are parsed from left to right.
|
||||
|
||||
Expression nesting is limited to 1000 levels deep (300 when build with MSVC)
|
||||
to avoid running out of stack and crashing. *E1169*
|
||||
|
||||
expr1 *expr1* *trinary* *falsy-operator* *??* *E109*
|
||||
|
||||
expr1 *expr1* *ternary* *falsy-operator* *??* *E109*
|
||||
-----
|
||||
|
||||
The trinary operator: expr2 ? expr1 : expr1
|
||||
The ternary operator: expr2 ? expr1 : expr1
|
||||
The falsy operator: expr2 ?? expr1
|
||||
|
||||
Trinary operator ~
|
||||
Ternary operator ~
|
||||
|
||||
In legacy script the expression before the '?' is evaluated to a number. If
|
||||
it evaluates to |TRUE|, the result is the value of the expression between the
|
||||
@ -1014,7 +1018,7 @@ This is valid whether "b" has been defined or not. The second clause will
|
||||
only be evaluated if "b" has been defined.
|
||||
|
||||
|
||||
expr4 *expr4*
|
||||
expr4 *expr4* *E1153*
|
||||
-----
|
||||
|
||||
expr5 {cmp} expr5
|
||||
@ -1172,6 +1176,7 @@ When dividing a Number by zero the result depends on the value:
|
||||
>0 / 0 = 0x7fffffff (like positive infinity)
|
||||
<0 / 0 = -0x7fffffff (like negative infinity)
|
||||
(before Vim 7.2 it was always 0x7fffffff)
|
||||
In |Vim9| script dividing a number by zero is an error. *E1154*
|
||||
|
||||
When 64-bit Number support is enabled:
|
||||
0 / 0 = -0x8000000000000000 (like NaN for Float)
|
||||
@ -1239,7 +1244,7 @@ recognize multibyte encodings, see `byteidx()` for an alternative, or use
|
||||
byte under the cursor: >
|
||||
:let c = getline(".")[col(".") - 1]
|
||||
|
||||
In |Vim9| script:
|
||||
In |Vim9| script: *E1147* *E1148*
|
||||
If expr9 is a String this results in a String that contains the expr1'th
|
||||
single character (including any composing characters) from expr9. To use byte
|
||||
indexes use |strpart()|.
|
||||
@ -1319,7 +1324,7 @@ for a sublist: >
|
||||
|
||||
|
||||
expr9.name entry in a |Dictionary| *expr-entry*
|
||||
|
||||
*E1203* *E1229*
|
||||
If expr9 is a |Dictionary| and it is followed by a dot, then the following
|
||||
name will be used as a key in the |Dictionary|. This is just like:
|
||||
expr9[name].
|
||||
@ -1339,14 +1344,14 @@ Note that the dot is also used for String concatenation. To avoid confusion
|
||||
always put spaces around the dot for String concatenation.
|
||||
|
||||
|
||||
expr9(expr1, ...) |Funcref| function call
|
||||
expr9(expr1, ...) |Funcref| function call *E1085*
|
||||
|
||||
When expr9 is a |Funcref| type variable, invoke the function it refers to.
|
||||
|
||||
|
||||
expr9->name([args]) method call *method* *->*
|
||||
expr9->{lambda}([args])
|
||||
*E260* *E276*
|
||||
*E260* *E276* *E1265*
|
||||
For methods that are also available as global functions this is the same as: >
|
||||
name(expr9 [, args])
|
||||
There can also be methods specifically for the type of "expr9".
|
||||
@ -1366,7 +1371,7 @@ And NOT: >
|
||||
-(1.234->string())
|
||||
|
||||
What comes after "->" can be a name, a simple expression (not containing any
|
||||
parenthesis), or any expression in parenthesis: >
|
||||
parenthesis), or any expression in parentheses: >
|
||||
base->name(args)
|
||||
base->some.name(args)
|
||||
base->alist[idx](args)
|
||||
@ -1525,7 +1530,7 @@ option *expr-option* *E112* *E113*
|
||||
&l:option local option value
|
||||
|
||||
Examples: >
|
||||
echo "tabstop is " . &tabstop
|
||||
echo "tabstop is " .. &tabstop
|
||||
if &insertmode
|
||||
|
||||
Any option name can be used here. See |options|. When using the local value
|
||||
@ -1546,7 +1551,7 @@ When using the '=' register you get the expression itself, not what it
|
||||
evaluates to. Use |eval()| to evaluate it.
|
||||
|
||||
|
||||
nesting *expr-nesting* *E110*
|
||||
nesting *expr-nesting* *E110*
|
||||
-------
|
||||
(expr1) nested expression
|
||||
|
||||
@ -1577,7 +1582,7 @@ The first one probably doesn't echo anything, the second echoes the $shell
|
||||
variable (if your shell supports it).
|
||||
|
||||
|
||||
internal variable *expr-variable* *E1015*
|
||||
internal variable *expr-variable* *E1015* *E1089*
|
||||
-----------------
|
||||
variable internal variable
|
||||
See below |internal-variables|.
|
||||
@ -1815,7 +1820,7 @@ maintain a counter: >
|
||||
echo "script executed for the first time"
|
||||
else
|
||||
let s:counter = s:counter + 1
|
||||
echo "script executed " . s:counter . " times now"
|
||||
echo "script executed " .. s:counter .. " times now"
|
||||
endif
|
||||
|
||||
Note that this means that filetype plugins don't get a different set of script
|
||||
@ -1829,6 +1834,7 @@ Some variables can be set by the user, but the type cannot be changed.
|
||||
*v:argv* *argv-variable*
|
||||
v:argv The command line arguments Vim was invoked with. This is a
|
||||
list of strings. The first item is the Vim command.
|
||||
See |v:progpath| for the command with full path.
|
||||
|
||||
*v:beval_col* *beval_col-variable*
|
||||
v:beval_col The number of the column, over which the mouse pointer is.
|
||||
@ -1950,7 +1956,7 @@ v:completed_item
|
||||
*v:count* *count-variable*
|
||||
v:count The count given for the last Normal mode command. Can be used
|
||||
to get the count before a mapping. Read-only. Example: >
|
||||
:map _x :<C-U>echo "the count is " . v:count<CR>
|
||||
:map _x :<C-U>echo "the count is " .. v:count<CR>
|
||||
< Note: The <C-U> is required to remove the line range that you
|
||||
get when typing ':' after a count.
|
||||
When there are two counts, as in "3d2w", they are multiplied,
|
||||
@ -2065,6 +2071,11 @@ v:fcs_choice What should happen after a |FileChangedShell| event was
|
||||
do with the affected buffer:
|
||||
reload Reload the buffer (does not work if
|
||||
the file was deleted).
|
||||
edit Reload the buffer and detect the
|
||||
values for options such as
|
||||
'fileformat', 'fileencoding', 'binary'
|
||||
(does not work if the file was
|
||||
deleted).
|
||||
ask Ask the user what to do, as if there
|
||||
was no autocommand. Except that when
|
||||
only the timestamp changed nothing
|
||||
@ -2172,7 +2183,8 @@ v:lnum Line number for the 'foldexpr' |fold-expr|, 'formatexpr' and
|
||||
|
||||
*v:maxcol* *maxcol-variable*
|
||||
v:maxcol Maximum line length. Depending on where it is used it can be
|
||||
screen columns, characters or bytes.
|
||||
screen columns, characters or bytes. The value currently is
|
||||
2147483647 on all systems.
|
||||
|
||||
*v:mouse_win* *mouse_win-variable*
|
||||
v:mouse_win Window number for a mouse click obtained with |getchar()|.
|
||||
@ -2204,6 +2216,8 @@ v:none An empty String. Used to put an empty item in JSON. See
|
||||
< v:none ~
|
||||
That is so that eval() can parse the string back to the same
|
||||
value. Read-only.
|
||||
Note that using `== v:none` and `!= v:none` will often give
|
||||
an error. Instead, use `is v:none` and `isnot v:none` .
|
||||
|
||||
*v:null* *null-variable*
|
||||
v:null An empty String. Used to put "null" in JSON. See
|
||||
@ -2214,7 +2228,10 @@ v:null An empty String. Used to put "null" in JSON. See
|
||||
< v:null ~
|
||||
That is so that eval() can parse the string back to the same
|
||||
value. Read-only.
|
||||
In |Vim9| script "null" can be used without "v:".
|
||||
In |Vim9| script `null` can be used without "v:".
|
||||
In some places `v:null` and `null` can be used for a List,
|
||||
Dict, Job, etc. that is not set. That is slightly different
|
||||
than an empty List, Dict, etc.
|
||||
|
||||
*v:numbermax* *numbermax-variable*
|
||||
v:numbermax Maximum value of a number.
|
||||
@ -2690,7 +2707,7 @@ See |:verbose-cmd| for more information.
|
||||
implies that the effect of |:nohlsearch| is undone
|
||||
when the function returns.
|
||||
|
||||
*:endf* *:endfunction* *E126* *E193* *W22*
|
||||
*:endf* *:endfunction* *E126* *E193* *W22* *E1151*
|
||||
:endf[unction] [argument]
|
||||
The end of a function definition. Best is to put it
|
||||
on a line by its own, without [argument].
|
||||
@ -2709,7 +2726,7 @@ See |:verbose-cmd| for more information.
|
||||
command, use line breaks instead of |:bar|: >
|
||||
:exe "func Foo()\necho 'foo'\nendfunc"
|
||||
<
|
||||
*:delf* *:delfunction* *E131* *E933*
|
||||
*:delf* *:delfunction* *E131* *E933* *E1084*
|
||||
:delf[unction][!] {name}
|
||||
Delete function {name}.
|
||||
{name} can also be a |Dictionary| entry that is a
|
||||
@ -2726,8 +2743,11 @@ See |:verbose-cmd| for more information.
|
||||
If "[expr]" is not given, the number 0 is returned.
|
||||
When a function ends without an explicit ":return",
|
||||
the number 0 is returned.
|
||||
Note that there is no check for unreachable lines,
|
||||
thus there is no warning if commands follow ":return".
|
||||
In a :def function *E1095* is given if unreachable
|
||||
code follows after the `:return`.
|
||||
In legacy script there is no check for unreachable
|
||||
lines, thus there is no warning if commands follow
|
||||
`:return`.
|
||||
|
||||
If the ":return" is used after a |:try| but before the
|
||||
matching |:finally| (if present), the commands
|
||||
@ -2746,7 +2766,7 @@ may optionally be following. In the function the extra arguments can be used
|
||||
as "a:1", "a:2", etc. "a:0" is set to the number of extra arguments (which
|
||||
can be 0). "a:000" is set to a |List| that contains these arguments. Note
|
||||
that "a:1" is the same as "a:000[0]".
|
||||
*E742*
|
||||
*E742* *E1090*
|
||||
The a: scope and the variables in it cannot be changed, they are fixed.
|
||||
However, if a composite type is used, such as |List| or |Dictionary| , you can
|
||||
change their contents. Thus you can pass a |List| to a function and have the
|
||||
@ -2815,9 +2835,9 @@ Example: >
|
||||
: echohl Title
|
||||
: echo a:title
|
||||
: echohl None
|
||||
: echo a:0 . " items:"
|
||||
: echo a:0 .. " items:"
|
||||
: for s in a:000
|
||||
: echon ' ' . s
|
||||
: echon ' ' .. s
|
||||
: endfor
|
||||
:endfunction
|
||||
|
||||
@ -2860,7 +2880,7 @@ This function can then be called with: >
|
||||
this works:
|
||||
*function-range-example* >
|
||||
:function Mynumber(arg)
|
||||
: echo line(".") . " " . a:arg
|
||||
: echo line(".") .. " " .. a:arg
|
||||
:endfunction
|
||||
:1,5call Mynumber(getline("."))
|
||||
<
|
||||
@ -2871,7 +2891,7 @@ This function can then be called with: >
|
||||
Example of a function that handles the range itself: >
|
||||
|
||||
:function Cont() range
|
||||
: execute (a:firstline + 1) . "," . a:lastline . 's/^/\t\\ '
|
||||
: execute (a:firstline + 1) .. "," .. a:lastline .. 's/^/\t\\ '
|
||||
:endfunction
|
||||
:4,8call Cont()
|
||||
<
|
||||
@ -2988,8 +3008,9 @@ Also note that if you have two script files, and one calls a function in the
|
||||
other and vice versa, before the used function is defined, it won't work.
|
||||
Avoid using the autoload functionality at the toplevel.
|
||||
|
||||
In |Vim9| script you will get error *E1263* if you use a function name with a
|
||||
"#" character when not in an autoload script.
|
||||
In |Vim9| script you will get error *E1263* if you define a function with
|
||||
a "#" character in the name. You should use a name without "#" and use
|
||||
`:export`.
|
||||
|
||||
Hint: If you distribute a bunch of scripts you can pack them together with the
|
||||
|vimball| utility. Also read the user manual |distribute-script|.
|
||||
@ -3054,7 +3075,7 @@ declarations and assignments do not use a command. |vim9-declaration|
|
||||
from the {expr}. If {var-name} didn't exist yet, it
|
||||
is created.
|
||||
|
||||
:let {var-name}[{idx}] = {expr1} *E689*
|
||||
:let {var-name}[{idx}] = {expr1} *E689* *E1141*
|
||||
Set a list item to the result of the expression
|
||||
{expr1}. {var-name} must refer to a list and {idx}
|
||||
must be a valid index in that list. For nested list
|
||||
@ -3062,12 +3083,12 @@ declarations and assignments do not use a command. |vim9-declaration|
|
||||
This cannot be used to add an item to a |List|.
|
||||
This cannot be used to set a byte in a String. You
|
||||
can do that like this: >
|
||||
:let var = var[0:2] . 'X' . var[4:]
|
||||
:let var = var[0:2] .. 'X' .. var[4:]
|
||||
< When {var-name} is a |Blob| then {idx} can be the
|
||||
length of the blob, in which case one byte is
|
||||
appended.
|
||||
|
||||
*E711* *E719*
|
||||
*E711* *E719* *E1165* *E1166* *E1183*
|
||||
:let {var-name}[{idx1}:{idx2}] = {expr1} *E708* *E709* *E710*
|
||||
Set a sequence of items in a |List| to the result of
|
||||
the expression {expr1}, which must be a list with the
|
||||
@ -3132,7 +3153,7 @@ declarations and assignments do not use a command. |vim9-declaration|
|
||||
is just like using the |:set| command: both the local
|
||||
value and the global value are changed.
|
||||
Example: >
|
||||
:let &path = &path . ',/usr/local/include'
|
||||
:let &path = &path .. ',/usr/local/include'
|
||||
< This also works for terminal codes in the form t_xx.
|
||||
But only for alphanumerical names. Example: >
|
||||
:let &t_k1 = "\<Esc>[234;"
|
||||
@ -3161,7 +3182,7 @@ declarations and assignments do not use a command. |vim9-declaration|
|
||||
:let &g:{option-name} -= {expr1}
|
||||
Like above, but only set the global value of an option
|
||||
(if there is one). Works like |:setglobal|.
|
||||
|
||||
*E1093*
|
||||
:let [{name1}, {name2}, ...] = {expr1} *:let-unpack* *E687* *E688*
|
||||
{expr1} must evaluate to a |List|. The first item in
|
||||
the list is assigned to {name1}, the second item to
|
||||
@ -3202,7 +3223,7 @@ declarations and assignments do not use a command. |vim9-declaration|
|
||||
|List| item.
|
||||
|
||||
*:let=<<* *:let-heredoc*
|
||||
*E990* *E991* *E172* *E221*
|
||||
*E990* *E991* *E172* *E221* *E1145*
|
||||
:let {var-name} =<< [trim] {endmarker}
|
||||
text...
|
||||
text...
|
||||
@ -3355,7 +3376,7 @@ text...
|
||||
:lockvar v
|
||||
:let v = 'asdf' " fails!
|
||||
:unlet v " works
|
||||
< *E741* *E940*
|
||||
< *E741* *E940* *E1118* *E1119* *E1120* *E1121* *E1122*
|
||||
If you try to change a locked variable you get an
|
||||
error message: "E741: Value is locked: {name}".
|
||||
If you try to lock or unlock a built-in variable you
|
||||
@ -3403,19 +3424,22 @@ text...
|
||||
See |deepcopy()|.
|
||||
|
||||
|
||||
:unlo[ckvar][!] [depth] {name} ... *:unlockvar* *:unlo*
|
||||
:unlo[ckvar][!] [depth] {name} ... *:unlockvar* *:unlo* *E1246*
|
||||
Unlock the internal variable {name}. Does the
|
||||
opposite of |:lockvar|.
|
||||
|
||||
:if {expr1} *:if* *:end* *:endif* *:en* *E171* *E579* *E580*
|
||||
:en[dif] Execute the commands until the next matching ":else"
|
||||
or ":endif" if {expr1} evaluates to non-zero.
|
||||
:en[dif] Execute the commands until the next matching `:else`
|
||||
or `:endif` if {expr1} evaluates to non-zero.
|
||||
Although the short forms work, it is recommended to
|
||||
always use `:endif` to avoid confusion and to make
|
||||
auto-indenting work properly.
|
||||
|
||||
From Vim version 4.5 until 5.0, every Ex command in
|
||||
between the ":if" and ":endif" is ignored. These two
|
||||
between the `:if` and `:endif` is ignored. These two
|
||||
commands were just to allow for future expansions in a
|
||||
backward compatible way. Nesting was allowed. Note
|
||||
that any ":else" or ":elseif" was ignored, the "else"
|
||||
that any `:else` or `:elseif` was ignored, the `else`
|
||||
part was not executed either.
|
||||
|
||||
You can use this to remain compatible with older
|
||||
@ -3424,32 +3448,38 @@ text...
|
||||
: version-5-specific-commands
|
||||
:endif
|
||||
< The commands still need to be parsed to find the
|
||||
"endif". Sometimes an older Vim has a problem with a
|
||||
new command. For example, ":silent" is recognized as
|
||||
a ":substitute" command. In that case ":execute" can
|
||||
`endif`. Sometimes an older Vim has a problem with a
|
||||
new command. For example, `:silent` is recognized as
|
||||
a `:substitute` command. In that case `:execute` can
|
||||
avoid problems: >
|
||||
:if version >= 600
|
||||
: execute "silent 1,$delete"
|
||||
:endif
|
||||
<
|
||||
NOTE: The ":append" and ":insert" commands don't work
|
||||
properly in between ":if" and ":endif".
|
||||
In |Vim9| script `:endif` cannot be shortened, to
|
||||
improve script readability.
|
||||
NOTE: The `:append` and `:insert` commands don't work
|
||||
properly in between `:if` and `:endif`.
|
||||
|
||||
*:else* *:el* *E581* *E583*
|
||||
:el[se] Execute the commands until the next matching ":else"
|
||||
or ":endif" if they previously were not being
|
||||
:el[se] Execute the commands until the next matching `:else`
|
||||
or `:endif` if they previously were not being
|
||||
executed.
|
||||
In |Vim9| script `:else` cannot be shortened, to
|
||||
improve script readability.
|
||||
|
||||
*:elseif* *:elsei* *E582* *E584*
|
||||
:elsei[f] {expr1} Short for ":else" ":if", with the addition that there
|
||||
is no extra ":endif".
|
||||
:elsei[f] {expr1} Short for `:else` `:if`, with the addition that there
|
||||
is no extra `:endif`.
|
||||
In |Vim9| script `:elseif` cannot be shortened, to
|
||||
improve script readability.
|
||||
|
||||
:wh[ile] {expr1} *:while* *:endwhile* *:wh* *:endw*
|
||||
*E170* *E585* *E588* *E733*
|
||||
:endw[hile] Repeat the commands between ":while" and ":endwhile",
|
||||
:endw[hile] Repeat the commands between `:while` and `:endwhile`,
|
||||
as long as {expr1} evaluates to non-zero.
|
||||
When an error is detected from a command inside the
|
||||
loop, execution continues after the "endwhile".
|
||||
loop, execution continues after the `endwhile`.
|
||||
Example: >
|
||||
:let lnum = 1
|
||||
:while lnum <= line("$")
|
||||
@ -3457,14 +3487,16 @@ text...
|
||||
:let lnum = lnum + 1
|
||||
:endwhile
|
||||
<
|
||||
NOTE: The ":append" and ":insert" commands don't work
|
||||
properly inside a ":while" and ":for" loop.
|
||||
In |Vim9| script `:while` and `:endwhile` cannot be
|
||||
shortened, to improve script readability.
|
||||
NOTE: The `:append` and `:insert` commands don't work
|
||||
properly inside a `:while` and `:for` loop.
|
||||
|
||||
:for {var} in {object} *:for* *E690* *E732*
|
||||
:endfo[r] *:endfo* *:endfor*
|
||||
Repeat the commands between ":for" and ":endfor" for
|
||||
Repeat the commands between `:for` and `:endfor` for
|
||||
each item in {object}. {object} can be a |List| or
|
||||
a |Blob|.
|
||||
a |Blob|. *E1177*
|
||||
|
||||
Variable {var} is set to the value of each item.
|
||||
In |Vim9| script the loop variable must not have been
|
||||
@ -3472,7 +3504,7 @@ text...
|
||||
global/window/tab/buffer variable.
|
||||
|
||||
When an error is detected for a command inside the
|
||||
loop, execution continues after the "endfor".
|
||||
loop, execution continues after the `endfor`.
|
||||
Changing {object} inside the loop affects what items
|
||||
are used. Make a copy if this is unwanted: >
|
||||
:for item in copy(mylist)
|
||||
@ -3497,9 +3529,12 @@ text...
|
||||
iterate over. Unlike with |List|, modifying the
|
||||
|Blob| does not affect the iteration.
|
||||
|
||||
In |Vim9| script `:endfor` cannot be shortened, to
|
||||
improve script readability.
|
||||
|
||||
:for [{var1}, {var2}, ...] in {listlist}
|
||||
:endfo[r]
|
||||
Like ":for" above, but each item in {listlist} must be
|
||||
:endfo[r] *E1140*
|
||||
Like `:for` above, but each item in {listlist} must be
|
||||
a list, of which each item is assigned to {var1},
|
||||
{var2}, etc. Example: >
|
||||
:for [lnum, col] in [[1, 3], [2, 5], [3, 8]]
|
||||
@ -3507,39 +3542,44 @@ text...
|
||||
:endfor
|
||||
<
|
||||
*:continue* *:con* *E586*
|
||||
:con[tinue] When used inside a ":while" or ":for" loop, jumps back
|
||||
:con[tinue] When used inside a `:while` or `:for` loop, jumps back
|
||||
to the start of the loop.
|
||||
If it is used after a |:try| inside the loop but
|
||||
before the matching |:finally| (if present), the
|
||||
commands following the ":finally" up to the matching
|
||||
|:endtry| are executed first. This process applies to
|
||||
all nested ":try"s inside the loop. The outermost
|
||||
":endtry" then jumps back to the start of the loop.
|
||||
If it is used after a `:try` inside the loop but
|
||||
before the matching `:finally` (if present), the
|
||||
commands following the `:finally` up to the matching
|
||||
`:endtry` are executed first. This process applies to
|
||||
all nested `:try`s inside the loop. The outermost
|
||||
`:endtry` then jumps back to the start of the loop.
|
||||
|
||||
In |Vim9| script `:cont` is the shortest form, to
|
||||
improve script readability.
|
||||
*:break* *:brea* *E587*
|
||||
:brea[k] When used inside a ":while" or ":for" loop, skips to
|
||||
the command after the matching ":endwhile" or
|
||||
":endfor".
|
||||
If it is used after a |:try| inside the loop but
|
||||
before the matching |:finally| (if present), the
|
||||
commands following the ":finally" up to the matching
|
||||
|:endtry| are executed first. This process applies to
|
||||
all nested ":try"s inside the loop. The outermost
|
||||
":endtry" then jumps to the command after the loop.
|
||||
:brea[k] When used inside a `:while` or `:for` loop, skips to
|
||||
the command after the matching `:endwhile` or
|
||||
`:endfor`.
|
||||
If it is used after a `:try` inside the loop but
|
||||
before the matching `:finally` (if present), the
|
||||
commands following the `:finally` up to the matching
|
||||
`:endtry` are executed first. This process applies to
|
||||
all nested `:try`s inside the loop. The outermost
|
||||
`:endtry` then jumps to the command after the loop.
|
||||
|
||||
In |Vim9| script `:break` cannot be shortened, to
|
||||
improve script readability.
|
||||
|
||||
:try *:try* *:endt* *:endtry*
|
||||
*E600* *E601* *E602* *E1032*
|
||||
:endt[ry] Change the error handling for the commands between
|
||||
":try" and ":endtry" including everything being
|
||||
executed across ":source" commands, function calls,
|
||||
`:try` and `:endtry` including everything being
|
||||
executed across `:source` commands, function calls,
|
||||
or autocommand invocations.
|
||||
|
||||
When an error or interrupt is detected and there is
|
||||
a |:finally| command following, execution continues
|
||||
after the ":finally". Otherwise, or when the
|
||||
":endtry" is reached thereafter, the next
|
||||
(dynamically) surrounding ":try" is checked for
|
||||
a corresponding ":finally" etc. Then the script
|
||||
a `:finally` command following, execution continues
|
||||
after the `:finally`. Otherwise, or when the
|
||||
`:endtry` is reached thereafter, the next
|
||||
(dynamically) surrounding `:try` is checked for
|
||||
a corresponding `:finally` etc. Then the script
|
||||
processing is terminated. Whether a function
|
||||
definition has an "abort" argument does not matter.
|
||||
Example: >
|
||||
@ -3547,9 +3587,9 @@ text...
|
||||
echomsg "not reached"
|
||||
<
|
||||
Moreover, an error or interrupt (dynamically) inside
|
||||
":try" and ":endtry" is converted to an exception. It
|
||||
can be caught as if it were thrown by a |:throw|
|
||||
command (see |:catch|). In this case, the script
|
||||
`:try` and `:endtry` is converted to an exception. It
|
||||
can be caught as if it were thrown by a `:throw`
|
||||
command (see `:catch`). In this case, the script
|
||||
processing is not terminated.
|
||||
|
||||
The value "Vim:Interrupt" is used for an interrupt
|
||||
@ -3564,13 +3604,16 @@ text...
|
||||
try | sleep 100 | catch /^Vim:Interrupt$/ | endtry
|
||||
try | edit | catch /^Vim(edit):E\d\+/ | echo "error" | endtry
|
||||
<
|
||||
In |Vim9| script `:endtry` cannot be shortened, to
|
||||
improve script readability.
|
||||
|
||||
*:cat* *:catch*
|
||||
*E603* *E604* *E605* *E654* *E1033*
|
||||
:cat[ch] /{pattern}/ The following commands until the next |:catch|,
|
||||
|:finally|, or |:endtry| that belongs to the same
|
||||
|:try| as the ":catch" are executed when an exception
|
||||
:cat[ch] /{pattern}/ The following commands until the next `:catch`,
|
||||
`:finally`, or `:endtry` that belongs to the same
|
||||
`:try` as the `:catch` are executed when an exception
|
||||
matching {pattern} is being thrown and has not yet
|
||||
been caught by a previous ":catch". Otherwise, these
|
||||
been caught by a previous `:catch`. Otherwise, these
|
||||
commands are skipped.
|
||||
When {pattern} is omitted all errors are caught.
|
||||
Examples: >
|
||||
@ -3592,29 +3635,35 @@ text...
|
||||
NOTE: It is not reliable to ":catch" the TEXT of
|
||||
an error message because it may vary in different
|
||||
locales.
|
||||
In |Vim9| script `:catch` cannot be shortened, to
|
||||
improve script readability.
|
||||
|
||||
*:fina* *:finally* *E606* *E607*
|
||||
:fina[lly] The following commands until the matching |:endtry|
|
||||
:fina[lly] The following commands until the matching `:endtry`
|
||||
are executed whenever the part between the matching
|
||||
|:try| and the ":finally" is left: either by falling
|
||||
through to the ":finally" or by a |:continue|,
|
||||
|:break|, |:finish|, or |:return|, or by an error or
|
||||
interrupt or exception (see |:throw|).
|
||||
`:try` and the `:finally` is left: either by falling
|
||||
through to the `:finally` or by a `:continue`,
|
||||
`:break`, `:finish`, or `:return`, or by an error or
|
||||
interrupt or exception (see `:throw`).
|
||||
|
||||
*:th* *:throw* *E608*
|
||||
In |Vim9| script `:finally` cannot be shortened, to
|
||||
improve script readability and avoid confusion with
|
||||
`:final`.
|
||||
|
||||
*:th* *:throw* *E608* *E1129*
|
||||
:th[row] {expr1} The {expr1} is evaluated and thrown as an exception.
|
||||
If the ":throw" is used after a |:try| but before the
|
||||
first corresponding |:catch|, commands are skipped
|
||||
until the first ":catch" matching {expr1} is reached.
|
||||
If there is no such ":catch" or if the ":throw" is
|
||||
used after a ":catch" but before the |:finally|, the
|
||||
commands following the ":finally" (if present) up to
|
||||
the matching |:endtry| are executed. If the ":throw"
|
||||
is after the ":finally", commands up to the ":endtry"
|
||||
If the ":throw" is used after a `:try` but before the
|
||||
first corresponding `:catch`, commands are skipped
|
||||
until the first `:catch` matching {expr1} is reached.
|
||||
If there is no such `:catch` or if the ":throw" is
|
||||
used after a `:catch` but before the `:finally`, the
|
||||
commands following the `:finally` (if present) up to
|
||||
the matching `:endtry` are executed. If the `:throw`
|
||||
is after the `:finally`, commands up to the `:endtry`
|
||||
are skipped. At the ":endtry", this process applies
|
||||
again for the next dynamically surrounding ":try"
|
||||
again for the next dynamically surrounding `:try`
|
||||
(which may be found in a calling function or sourcing
|
||||
script), until a matching ":catch" has been found.
|
||||
script), until a matching `:catch` has been found.
|
||||
If the exception is not caught, the command processing
|
||||
is terminated.
|
||||
Example: >
|
||||
@ -3623,13 +3672,16 @@ text...
|
||||
for when an error causes the parsing to skip the whole
|
||||
line and not see the "|" that separates the commands.
|
||||
|
||||
In |Vim9| script `:throw` cannot be shortened, to
|
||||
improve script readability.
|
||||
|
||||
*:ec* *:echo*
|
||||
:ec[ho] {expr1} .. Echoes each {expr1}, with a space in between. The
|
||||
first {expr1} starts on a new line.
|
||||
Also see |:comment|.
|
||||
Use "\n" to start a new line. Use "\r" to move the
|
||||
cursor to the first column.
|
||||
Uses the highlighting set by the |:echohl| command.
|
||||
Uses the highlighting set by the `:echohl` command.
|
||||
Cannot be followed by a comment.
|
||||
Example: >
|
||||
:echo "the value of 'shell' is" &shell
|
||||
@ -3638,21 +3690,21 @@ text...
|
||||
And since Vim mostly postpones redrawing until it's
|
||||
finished with a sequence of commands this happens
|
||||
quite often. To avoid that a command from before the
|
||||
":echo" causes a redraw afterwards (redraws are often
|
||||
`:echo` causes a redraw afterwards (redraws are often
|
||||
postponed until you type something), force a redraw
|
||||
with the |:redraw| command. Example: >
|
||||
with the `:redraw` command. Example: >
|
||||
:new | redraw | echo "there is a new window"
|
||||
<
|
||||
*:echon*
|
||||
:echon {expr1} .. Echoes each {expr1}, without anything added. Also see
|
||||
|:comment|.
|
||||
Uses the highlighting set by the |:echohl| command.
|
||||
Uses the highlighting set by the `:echohl` command.
|
||||
Cannot be followed by a comment.
|
||||
Example: >
|
||||
:echon "the value of 'shell' is " &shell
|
||||
<
|
||||
Note the difference between using ":echo", which is a
|
||||
Vim command, and ":!echo", which is an external shell
|
||||
Note the difference between using `:echo`, which is a
|
||||
Vim command, and `:!echo`, which is an external shell
|
||||
command: >
|
||||
:!echo % --> filename
|
||||
< The arguments of ":!" are expanded, see |:_%|. >
|
||||
@ -3668,8 +3720,8 @@ text...
|
||||
|
||||
*:echoh* *:echohl*
|
||||
:echoh[l] {name} Use the highlight group {name} for the following
|
||||
|:echo|, |:echon| and |:echomsg| commands. Also used
|
||||
for the |input()| prompt. Example: >
|
||||
`:echo`, `:echon` and `:echomsg` commands. Also used
|
||||
for the `input()` prompt. Example: >
|
||||
:echohl WarningMsg | echo "Don't panic!" | echohl None
|
||||
< Don't forget to set the group back to "None",
|
||||
otherwise all following echo's will be highlighted.
|
||||
@ -3678,14 +3730,14 @@ text...
|
||||
:echom[sg] {expr1} .. Echo the expression(s) as a true message, saving the
|
||||
message in the |message-history|.
|
||||
Spaces are placed between the arguments as with the
|
||||
|:echo| command. But unprintable characters are
|
||||
`:echo` command. But unprintable characters are
|
||||
displayed, not interpreted.
|
||||
The parsing works slightly different from |:echo|,
|
||||
more like |:execute|. All the expressions are first
|
||||
The parsing works slightly different from `:echo`,
|
||||
more like `:execute`. All the expressions are first
|
||||
evaluated and concatenated before echoing anything.
|
||||
If expressions does not evaluate to a Number or
|
||||
String, string() is used to turn it into a string.
|
||||
Uses the highlighting set by the |:echohl| command.
|
||||
Uses the highlighting set by the `:echohl` command.
|
||||
Example: >
|
||||
:echomsg "It's a Zizzer Zazzer Zuzz, as you can plainly see."
|
||||
< See |:echo-redraw| to avoid the message disappearing
|
||||
@ -3695,12 +3747,12 @@ text...
|
||||
message in the |message-history|. When used in a
|
||||
script or function the line number will be added.
|
||||
Spaces are placed between the arguments as with the
|
||||
|:echomsg| command. When used inside a try conditional,
|
||||
`:echomsg` command. When used inside a try conditional,
|
||||
the message is raised as an error exception instead
|
||||
(see |try-echoerr|).
|
||||
Example: >
|
||||
:echoerr "This script just failed!"
|
||||
< If you just want a highlighted message use |:echohl|.
|
||||
< If you just want a highlighted message use `:echohl`.
|
||||
And to get a beep: >
|
||||
:exe "normal \<Esc>"
|
||||
|
||||
@ -3718,6 +3770,9 @@ text...
|
||||
the `append()` call appends the List with text to the
|
||||
buffer. This is similar to `:call` but works with any
|
||||
expression.
|
||||
In |Vim9| script an expression without an effect will
|
||||
result in error *E1207* . This should help noticing
|
||||
mistakes.
|
||||
|
||||
The command can be shortened to `:ev` or `:eva`, but
|
||||
these are hard to recognize and therefore not to be
|
||||
@ -4010,7 +4065,7 @@ exception most recently caught as long it is not finished.
|
||||
|
||||
:function! Caught()
|
||||
: if v:exception != ""
|
||||
: echo 'Caught "' . v:exception . '" in ' . v:throwpoint
|
||||
: echo 'Caught "' . v:exception .. '" in ' .. v:throwpoint
|
||||
: else
|
||||
: echo 'Nothing caught'
|
||||
: endif
|
||||
@ -4413,8 +4468,8 @@ a script in order to catch unexpected things.
|
||||
:catch /^Vim:Interrupt$/
|
||||
: echo "Script interrupted"
|
||||
:catch /.*/
|
||||
: echo "Internal error (" . v:exception . ")"
|
||||
: echo " - occurred at " . v:throwpoint
|
||||
: echo "Internal error (" .. v:exception .. ")"
|
||||
: echo " - occurred at " .. v:throwpoint
|
||||
:endtry
|
||||
:" end of script
|
||||
|
||||
@ -4610,7 +4665,7 @@ parentheses can be cut out from |v:exception| with the ":substitute" command.
|
||||
|
||||
:function! CheckRange(a, func)
|
||||
: if a:a < 0
|
||||
: throw "EXCEPT:MATHERR:RANGE(" . a:func . ")"
|
||||
: throw "EXCEPT:MATHERR:RANGE(" .. a:func .. ")"
|
||||
: endif
|
||||
:endfunction
|
||||
:
|
||||
@ -4637,7 +4692,7 @@ parentheses can be cut out from |v:exception| with the ":substitute" command.
|
||||
: try
|
||||
: execute "write" fnameescape(a:file)
|
||||
: catch /^Vim(write):/
|
||||
: throw "EXCEPT:IO(" . getcwd() . ", " . a:file . "):WRITEERR"
|
||||
: throw "EXCEPT:IO(" .. getcwd() .. ", " .. a:file .. "):WRITEERR"
|
||||
: endtry
|
||||
:endfunction
|
||||
:
|
||||
@ -4656,9 +4711,9 @@ parentheses can be cut out from |v:exception| with the ":substitute" command.
|
||||
: let dir = substitute(v:exception, '.*(\(.\+\),\s*.\+).*', '\1', "")
|
||||
: let file = substitute(v:exception, '.*(.\+,\s*\(.\+\)).*', '\1', "")
|
||||
: if file !~ '^/'
|
||||
: let file = dir . "/" . file
|
||||
: let file = dir .. "/" .. file
|
||||
: endif
|
||||
: echo 'I/O error for "' . file . '"'
|
||||
: echo 'I/O error for "' .. file .. '"'
|
||||
:
|
||||
:catch /^EXCEPT/
|
||||
: echo "Unspecified error"
|
||||
@ -4726,7 +4781,7 @@ clauses, however, is executed.
|
||||
: echo "inner finally"
|
||||
: endtry
|
||||
:catch
|
||||
: echo 'outer catch-all caught "' . v:exception . '"'
|
||||
: echo 'outer catch-all caught "' .. v:exception .. '"'
|
||||
: finally
|
||||
: echo "outer finally"
|
||||
:endtry
|
||||
@ -4788,7 +4843,7 @@ Printing in Binary ~
|
||||
: let n = a:nr
|
||||
: let r = ""
|
||||
: while n
|
||||
: let r = '01'[n % 2] . r
|
||||
: let r = '01'[n % 2] .. r
|
||||
: let n = n / 2
|
||||
: endwhile
|
||||
: return r
|
||||
@ -4799,7 +4854,7 @@ Printing in Binary ~
|
||||
:func String2Bin(str)
|
||||
: let out = ''
|
||||
: for ix in range(strlen(a:str))
|
||||
: let out = out . '-' . Nr2Bin(char2nr(a:str[ix]))
|
||||
: let out = out .. '-' .. Nr2Bin(char2nr(a:str[ix]))
|
||||
: endfor
|
||||
: return out[1:]
|
||||
:endfunc
|
||||
@ -4885,6 +4940,9 @@ explicit the |:scriptversion| command can be used. When a Vim script is not
|
||||
compatible with older versions of Vim this will give an explicit error,
|
||||
instead of failing in mysterious ways.
|
||||
|
||||
When using a legacy function, defined with `:function`, in |Vim9| script then
|
||||
scriptversion 4 is used.
|
||||
|
||||
*scriptversion-1* >
|
||||
:scriptversion 1
|
||||
< This is the original Vim script, same as not using a |:scriptversion|
|
||||
|
@ -142,7 +142,8 @@ variables can be used to overrule the filetype used for certain extensions:
|
||||
*.asm g:asmsyntax |ft-asm-syntax|
|
||||
*.asp g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax|
|
||||
*.bas g:filetype_bas |ft-basic-syntax|
|
||||
*.fs g:filetype_fs |ft-forth-syntax|
|
||||
*.frm g:filetype_frm |ft-form-syntax|
|
||||
*.fs g:filetype_fs |ft-forth-syntax|
|
||||
*.i g:filetype_i |ft-progress-syntax|
|
||||
*.inc g:filetype_inc
|
||||
*.m g:filetype_m |ft-mathematica-syntax|
|
||||
|
@ -507,7 +507,7 @@ Note the use of backslashes to avoid some characters to be interpreted by the
|
||||
:function MyFoldText()
|
||||
: let line = getline(v:foldstart)
|
||||
: let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
|
||||
: return v:folddashes . sub
|
||||
: return v:folddashes .. sub
|
||||
:endfunction
|
||||
|
||||
Evaluating 'foldtext' is done in the |sandbox|. The current window is set to
|
||||
|
@ -47,20 +47,20 @@ Numbers, subscripts and superscripts are available with 's' and 'S':
|
||||
|
||||
But some don't come defined by default. Those are digraph definitions you can
|
||||
add in your ~/.vimrc file. >
|
||||
exec 'digraph \\ '.char2nr('∖')
|
||||
exec 'digraph \< '.char2nr('≼')
|
||||
exec 'digraph \> '.char2nr('≽')
|
||||
exec 'digraph (L '.char2nr('⊈')
|
||||
exec 'digraph )L '.char2nr('⊉')
|
||||
exec 'digraph (/ '.char2nr('⊄')
|
||||
exec 'digraph )/ '.char2nr('⊅')
|
||||
exec 'digraph )/ '.char2nr('⊅')
|
||||
exec 'digraph U+ '.char2nr('⊎')
|
||||
exec 'digraph 0- '.char2nr('⊖')
|
||||
exec 'digraph \\ ' .. char2nr('∖')
|
||||
exec 'digraph \< ' .. char2nr('≼')
|
||||
exec 'digraph \> ' .. char2nr('≽')
|
||||
exec 'digraph (L ' .. char2nr('⊈')
|
||||
exec 'digraph )L ' .. char2nr('⊉')
|
||||
exec 'digraph (/ ' .. char2nr('⊄')
|
||||
exec 'digraph )/ ' .. char2nr('⊅')
|
||||
exec 'digraph )/ ' .. char2nr('⊅')
|
||||
exec 'digraph U+ ' .. char2nr('⊎')
|
||||
exec 'digraph 0- ' .. char2nr('⊖')
|
||||
" Euler's constant
|
||||
exec 'digraph ne '.char2nr('𝑒')
|
||||
exec 'digraph ne ' .. char2nr('𝑒')
|
||||
" Raku's atomic operations marker
|
||||
exec 'digraph @@ '.char2nr('⚛')
|
||||
exec 'digraph @@ ' .. char2nr('⚛')
|
||||
|
||||
Alternatively, you can write Insert mode abbreviations that convert ASCII-
|
||||
based operators into their single-character Unicode equivalent. >
|
||||
|
@ -26,7 +26,7 @@ behavior of the plugin.
|
||||
g:rustc_path~
|
||||
Set this option to the path to rustc for use in the |:RustRun| and
|
||||
|:RustExpand| commands. If unset, "rustc" will be located in $PATH: >
|
||||
let g:rustc_path = $HOME."/bin/rustc"
|
||||
let g:rustc_path = $HOME .. "/bin/rustc"
|
||||
<
|
||||
|
||||
*g:rustc_makeprg_no_percent*
|
||||
@ -87,7 +87,7 @@ g:rust_bang_comment_leader~
|
||||
g:ftplugin_rust_source_path~
|
||||
Set this option to a path that should be prepended to 'path' for Rust
|
||||
source files: >
|
||||
let g:ftplugin_rust_source_path = $HOME.'/dev/rust'
|
||||
let g:ftplugin_rust_source_path = $HOME .. '/dev/rust'
|
||||
<
|
||||
|
||||
*g:rustfmt_command*
|
||||
|
@ -109,8 +109,8 @@ must be configurable. The filetype plugin attempts to define many of the
|
||||
standard objects, plus many additional ones. In order to make this as
|
||||
flexible as possible, you can override the list of objects from within your
|
||||
|vimrc| with the following: >
|
||||
let g:ftplugin_sql_objects = 'function,procedure,event,table,trigger' .
|
||||
\ ',schema,service,publication,database,datatype,domain' .
|
||||
let g:ftplugin_sql_objects = 'function,procedure,event,table,trigger' ..
|
||||
\ ',schema,service,publication,database,datatype,domain' ..
|
||||
\ ',index,subscription,synchronization,view,variable'
|
||||
|
||||
The following |Normal| mode and |Visual| mode maps have been created which use
|
||||
@ -131,10 +131,10 @@ Repeatedly pressing ]} will cycle through each of these create statements: >
|
||||
create index i1 on t1 (c1);
|
||||
|
||||
The default setting for g:ftplugin_sql_objects is: >
|
||||
let g:ftplugin_sql_objects = 'function,procedure,event,' .
|
||||
\ '\\(existing\\\\|global\\s\\+temporary\\s\\+\\)\\\{,1}' .
|
||||
\ 'table,trigger' .
|
||||
\ ',schema,service,publication,database,datatype,domain' .
|
||||
let g:ftplugin_sql_objects = 'function,procedure,event,' ..
|
||||
\ '\\(existing\\\\|global\\s\\+temporary\\s\\+\\)\\\{,1}' ..
|
||||
\ 'table,trigger' ..
|
||||
\ ',schema,service,publication,database,datatype,domain' ..
|
||||
\ ',index,subscription,synchronization,view,variable'
|
||||
|
||||
The above will also handle these cases: >
|
||||
|
@ -1,4 +1,4 @@
|
||||
*gui.txt* For Vim version 8.2. Last change: 2021 Jun 27
|
||||
*gui.txt* For Vim version 8.2. Last change: 2022 Mar 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -147,7 +147,8 @@ task bar with the 'guiheadroom' option.
|
||||
*:win* *:winsize* *E465*
|
||||
:win[size] {width} {height}
|
||||
Set the window height to {width} by {height} characters.
|
||||
Obsolete, use ":set lines=11 columns=22".
|
||||
It is recommended to use `:set lines=11 columns=22` instead,
|
||||
since it's easy to see what the numbers mean.
|
||||
If you get less lines than expected, check the 'guiheadroom'
|
||||
option.
|
||||
|
||||
@ -155,8 +156,8 @@ If you are running the X Window System, you can get information about the
|
||||
window Vim is running in with these commands: >
|
||||
:!xwininfo -id $WINDOWID
|
||||
:!xprop -id $WINDOWID
|
||||
:execute '!xwininfo -id ' . v:windowid
|
||||
:execute '!xprop -id ' . v:windowid
|
||||
:execute '!xwininfo -id ' .. v:windowid
|
||||
:execute '!xprop -id ' .. v:windowid
|
||||
<
|
||||
*gui-IME* *iBus*
|
||||
Input methods for international characters in X that rely on the XIM
|
||||
|
@ -1,4 +1,4 @@
|
||||
*help.txt* For Vim version 8.2. Last change: 2021 Dec 27
|
||||
*help.txt* For Vim version 8.2. Last change: 2022 Feb 26
|
||||
|
||||
VIM - main help file
|
||||
k
|
||||
@ -197,6 +197,7 @@ Versions ~
|
||||
|version6.txt| Differences between Vim version 5.7 and 6.x
|
||||
|version7.txt| Differences between Vim version 6.4 and 7.x
|
||||
|version8.txt| Differences between Vim version 7.4 and 8.x
|
||||
|version9.txt| Differences between Vim version 8.2 and 9.0
|
||||
*sys-file-list*
|
||||
Remarks about specific systems ~
|
||||
|os_390.txt| OS/390 Unix
|
||||
|
@ -1,4 +1,4 @@
|
||||
*if_perl.txt* For Vim version 8.2. Last change: 2022 Jan 08
|
||||
*if_perl.txt* For Vim version 8.2. Last change: 2022 Jan 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Sven Verdoolaege
|
||||
@ -103,7 +103,7 @@ Here are some things you can try: >
|
||||
:perldo $_ = reverse($_);1
|
||||
:perl VIM::Msg("hello")
|
||||
:perl $line = $curbuf->Get(42)
|
||||
<
|
||||
< *E299*
|
||||
Executing Perl commands in the |sandbox| is limited. ":perldo" will not be
|
||||
possible at all. ":perl" will be evaluated in the Safe environment, if
|
||||
possible.
|
||||
|
@ -1,4 +1,4 @@
|
||||
*if_pyth.txt* For Vim version 8.2. Last change: 2021 Nov 12
|
||||
*if_pyth.txt* For Vim version 8.2. Last change: 2022 Feb 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Paul Moore
|
||||
@ -25,6 +25,10 @@ The Python 3 interface is available only when Vim was compiled with the
|
||||
|+python3| feature.
|
||||
Both can be available at the same time, but read |python-2-and-3|.
|
||||
|
||||
NOTE: Python 2 is old and no longer being developed. Using Python 3 is highly
|
||||
recommended. Python 2 support will be dropped when it does not work properly
|
||||
anymore.
|
||||
|
||||
==============================================================================
|
||||
1. Commands *python-commands*
|
||||
|
||||
@ -65,7 +69,7 @@ There is no need to import sys, it's done by default.
|
||||
|
||||
*python-environment*
|
||||
Environment variables set in Vim are not always available in Python. This
|
||||
depends on how Vim and Python were build. Also see
|
||||
depends on how Vim and Python were built. Also see
|
||||
https://docs.python.org/3/library/os.html#os.environ
|
||||
|
||||
Note: Python is very sensitive to the indenting. Make sure the "class" line
|
||||
@ -834,6 +838,19 @@ To work around such problems there are these options:
|
||||
Raising SystemExit exception in python isn't endorsed way to quit vim, use: >
|
||||
:py vim.command("qall!")
|
||||
<
|
||||
*E1266*
|
||||
This error can occur when python 3 cannot load the required modules. This
|
||||
means that your python 3 is not correctly installed or there are some mistakes
|
||||
in your settings. Please check the following items:
|
||||
1. Make sure that python 3 is correctly installed. Also check the version of
|
||||
python.
|
||||
2. Check the 'pythonthreedll' option.
|
||||
3. Check the 'pythonthreehome' option.
|
||||
4. Check the PATH environment variable if you don't set 'pythonthreedll'.
|
||||
On MS-Windows, you can use where.exe to check which dll will be loaded.
|
||||
E.g. >
|
||||
where.exe python310.dll
|
||||
5. Check the PYTHONPATH and PYTHONHOME environment variables.
|
||||
|
||||
*has-python*
|
||||
You can test what Python version is available with: >
|
||||
@ -910,7 +927,7 @@ The `:pyxdo` command works similar to `:pydo`.
|
||||
*has-pythonx*
|
||||
You can test if pyx* commands are available with: >
|
||||
if has('pythonx')
|
||||
echo 'pyx* commands are available. (Python ' . &pyx . ')'
|
||||
echo 'pyx* commands are available. (Python ' .. &pyx .. ')'
|
||||
endif
|
||||
|
||||
When compiled with only one of |+python| or |+python3|, the has() returns 1.
|
||||
|
@ -1,4 +1,4 @@
|
||||
*indent.txt* For Vim version 8.2. Last change: 2019 Dec 07
|
||||
*indent.txt* For Vim version 8.2. Last change: 2022 Jan 31
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -778,6 +778,15 @@ You can set the indent for the first line after <script> and <style>
|
||||
"auto" auto indent (same indent as the blocktag)
|
||||
"inc" auto indent + one indent step
|
||||
|
||||
You can set the indent for attributes after an open <tag line: >
|
||||
|
||||
:let g:html_indent_attribute = 1
|
||||
<
|
||||
VALUE MEANING ~
|
||||
1 auto indent, one indent step more than <tag
|
||||
2 auto indent, two indent steps (default)
|
||||
> 2 auto indent, more indent steps
|
||||
|
||||
Many tags increase the indent for what follows per default (see "Add Indent
|
||||
Tags" in the script). You can add further tags with: >
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 8.2. Last change: 2021 Aug 31
|
||||
*index.txt* For Vim version 8.2. Last change: 2022 Mar 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -937,7 +937,9 @@ tag command note action in Visual mode ~
|
||||
before the highlighted area
|
||||
|v_J| J 2 join the highlighted lines
|
||||
|v_K| K run 'keywordprg' on the highlighted area
|
||||
|v_O| O Move horizontally to other corner of area.
|
||||
|v_O| O move horizontally to other corner of area
|
||||
|v_P| P replace highlighted area with register
|
||||
contents; unnamed register is unchanged
|
||||
Q does not start Ex mode
|
||||
|v_R| R 2 delete the highlighted lines and start
|
||||
insert
|
||||
@ -1000,6 +1002,8 @@ tag command note action in Visual mode ~
|
||||
|v_i{| i{ same as iB
|
||||
|v_i}| i} same as iB
|
||||
|v_o| o move cursor to other corner of area
|
||||
|v_p| p replace highlighted area with register
|
||||
contents; deleted text in unnamed register
|
||||
|v_r| r 2 replace highlighted area with a character
|
||||
|v_s| s 2 delete highlighted area and start insert
|
||||
|v_u| u 2 make highlighted area lowercase
|
||||
@ -1148,7 +1152,7 @@ tag command action ~
|
||||
|:&| :& repeat last ":substitute"
|
||||
|:star| :* execute contents of a register
|
||||
|:<| :< shift lines one 'shiftwidth' left
|
||||
|:=| := print the cursor line number
|
||||
|:=| := print the last line number
|
||||
|:>| :> shift lines one 'shiftwidth' right
|
||||
|:@| :@ execute contents of a register
|
||||
|:@@| :@@ repeat the previous ":@"
|
||||
@ -1166,7 +1170,7 @@ tag command action ~
|
||||
be remapped
|
||||
|:args| :ar[gs] print the argument list
|
||||
|:argadd| :arga[dd] add items to the argument list
|
||||
:argdedupe :argdedupe remove duplicates from the argument list
|
||||
|:argdedupe| :argded[upe] remove duplicates from the argument list
|
||||
|:argdelete| :argd[elete] delete items from the argument list
|
||||
|:argedit| :arge[dit] add item to the argument list and edit it
|
||||
|:argdo| :argdo do a command on all items in the argument list
|
||||
|
@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 8.2. Last change: 2021 Dec 29
|
||||
*insert.txt* For Vim version 8.2. Last change: 2022 Mar 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -283,8 +283,8 @@ start allow backspacing over the start position of insert; CTRL-W and
|
||||
When 'backspace' is empty, Vi compatible backspacing is used. You cannot
|
||||
backspace over autoindent, before column 1 or before where insert started.
|
||||
|
||||
For backwards compatibility the values "0", "1" and "2" are also allowed, see
|
||||
|'backspace'|.
|
||||
For backwards compatibility the values "0", "1", "2" and "3" are also allowed,
|
||||
see |'backspace'|.
|
||||
|
||||
If the 'backspace' option does contain "eol" and the cursor is in column 1
|
||||
when one of the three keys is used, the current line is joined with the
|
||||
@ -818,6 +818,7 @@ CTRL-X CTRL-K Search the files given with the 'dictionary' option
|
||||
the 'dictionary' option is empty.
|
||||
For suggestions where to find a list of words, see the
|
||||
'dictionary' option.
|
||||
'ignorecase', 'smartcase' and 'infercase' apply.
|
||||
|
||||
CTRL-K or
|
||||
CTRL-N Search forward for next matching keyword. This
|
||||
@ -879,9 +880,9 @@ Groß): >
|
||||
endif
|
||||
let res = []
|
||||
let h = ''
|
||||
for l in systemlist('aiksaurus '.shellescape(a:base))
|
||||
for l in systemlist('aiksaurus ' .. shellescape(a:base))
|
||||
if l[:3] == '=== '
|
||||
let h = '('.substitute(l[4:], ' =*$', ')', '')
|
||||
let h = '(' .. substitute(l[4:], ' =*$', ')', '')
|
||||
elseif l ==# 'Alphabetically similar known words are: '
|
||||
let h = "\U0001f52e"
|
||||
elseif l[0] =~ '\a' || (h ==# "\U0001f52e" && l[0] ==# "\t")
|
||||
@ -1266,7 +1267,7 @@ An example that completes the names of the months: >
|
||||
" find months matching with "a:base"
|
||||
let res = []
|
||||
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
|
||||
if m =~ '^' . a:base
|
||||
if m =~ '^' .. a:base
|
||||
call add(res, m)
|
||||
endif
|
||||
endfor
|
||||
@ -1288,7 +1289,7 @@ The same, but now pretending searching for matches is slow: >
|
||||
else
|
||||
" find months matching with "a:base"
|
||||
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
|
||||
if m =~ '^' . a:base
|
||||
if m =~ '^' .. a:base
|
||||
call complete_add(m)
|
||||
endif
|
||||
sleep 300m " simulate searching for next match
|
||||
|
@ -1,4 +1,4 @@
|
||||
*intro.txt* For Vim version 8.2. Last change: 2021 Sep 29
|
||||
*intro.txt* For Vim version 8.2. Last change: 2022 Mar 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -701,7 +701,8 @@ Q Switch to "Ex" mode. This is a bit like typing ":"
|
||||
Use the ":vi" command |:visual| to exit "Ex" mode.
|
||||
Note: In older versions of Vim "Q" formatted text,
|
||||
that is now done with |gq|. But if you use the
|
||||
|vimrc_example.vim| script "Q" works like "gq".
|
||||
|vimrc_example.vim| script or |defaults.vim|, "Q"
|
||||
works like "gq". Except for Select mode.
|
||||
|
||||
*gQ*
|
||||
gQ Switch to "Ex" mode like with "Q", but really behave
|
||||
|
@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 8.2. Last change: 2022 Jan 23
|
||||
*map.txt* For Vim version 8.2. Last change: 2022 Mar 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -80,6 +80,8 @@ modes.
|
||||
where the map command applies. Disallow mapping of
|
||||
{rhs}, to avoid nested and recursive mappings. Often
|
||||
used to redefine a command.
|
||||
Note: When <Plug> appears in the {rhs} this part is
|
||||
always applied even if remapping is disallowed.
|
||||
|
||||
|
||||
:unm[ap] {lhs} |mapmode-nvo| *:unm* *:unmap*
|
||||
@ -314,7 +316,7 @@ Here is an example that inserts a list number that increases: >
|
||||
|
||||
func ListItem()
|
||||
let g:counter += 1
|
||||
return g:counter . '. '
|
||||
return g:counter .. '. '
|
||||
endfunc
|
||||
|
||||
func ListReset()
|
||||
@ -387,7 +389,7 @@ contain special characters like function keys.
|
||||
1.3 MAPPING AND MODES *:map-modes*
|
||||
*mapmode-nvo* *mapmode-n* *mapmode-v* *mapmode-o*
|
||||
|
||||
There are six sets of mappings
|
||||
There are seven sets of mappings
|
||||
- For Normal mode: When typing commands.
|
||||
- For Visual mode: When typing commands while the Visual area is highlighted.
|
||||
- For Select mode: like Visual mode but typing text replaces the selection.
|
||||
@ -395,6 +397,7 @@ There are six sets of mappings
|
||||
etc.). See below: |omap-info|.
|
||||
- For Insert mode. These are also used in Replace mode.
|
||||
- For Command-line mode: When entering a ":" or "/" command.
|
||||
- For Terminal mode: When typing in a |:terminal| buffer.
|
||||
|
||||
Special case: While typing a count for a command in Normal mode, mapping zero
|
||||
is disabled. This makes it possible to map zero without making it impossible
|
||||
@ -1444,7 +1447,7 @@ See |:verbose-cmd| for more information.
|
||||
|
||||
|
||||
Command attributes ~
|
||||
|
||||
*command-attributes*
|
||||
User-defined commands are treated by Vim just like any other Ex commands. They
|
||||
can have arguments, or have a range specified. Arguments are subject to
|
||||
completion as filenames, buffers, etc. Exactly how this works depends upon the
|
||||
@ -1561,9 +1564,11 @@ The function arguments are:
|
||||
The function may use these for determining context. For the "custom"
|
||||
argument, it is not necessary to filter candidates against the (implicit
|
||||
pattern in) ArgLead. Vim will filter the candidates with its regexp engine
|
||||
after function return, and this is probably more efficient in most cases. For
|
||||
the "customlist" argument, Vim will not filter the returned completion
|
||||
candidates and the user supplied function should filter the candidates.
|
||||
after function return, and this is probably more efficient in most cases. If
|
||||
'wildoptions' contains "fuzzy", then the candidates will be filtered using
|
||||
|fuzzy-matching|. For the "customlist" argument, Vim will not
|
||||
filter the returned completion candidates and the user supplied function
|
||||
should filter the candidates.
|
||||
|
||||
The following example lists user names to a Finger command >
|
||||
:com -complete=custom,ListUsers -nargs=1 Finger !finger <args>
|
||||
@ -1697,12 +1702,12 @@ The valid escape sequences are
|
||||
Examples: >
|
||||
command! -nargs=+ -complete=file MyEdit
|
||||
\ for f in expand(<q-args>, 0, 1) |
|
||||
\ exe '<mods> split ' . f |
|
||||
\ exe '<mods> split ' .. f |
|
||||
\ endfor
|
||||
|
||||
function! SpecialEdit(files, mods)
|
||||
for f in expand(a:files, 0, 1)
|
||||
exe a:mods . ' split ' . f
|
||||
exe a:mods .. ' split ' .. f
|
||||
endfor
|
||||
endfunction
|
||||
command! -nargs=+ -complete=file Sedit
|
||||
@ -1778,7 +1783,7 @@ This will invoke: >
|
||||
: let i = 0
|
||||
: while i < argc()
|
||||
: if filereadable(argv(i))
|
||||
: execute "e " . argv(i)
|
||||
: execute "e " .. argv(i)
|
||||
: execute a:command
|
||||
: endif
|
||||
: let i = i + 1
|
||||
|
@ -1,4 +1,4 @@
|
||||
*message.txt* For Vim version 8.2. Last change: 2022 Jan 19
|
||||
*message.txt* For Vim version 8.2. Last change: 2022 Jan 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -82,7 +82,6 @@ LIST OF MESSAGES
|
||||
Add to read buffer ~
|
||||
makemap: Illegal mode ~
|
||||
Cannot create BalloonEval with both message and callback ~
|
||||
Hangul automata ERROR ~
|
||||
block was not locked ~
|
||||
Didn't get block nr {N}? ~
|
||||
ml_upd_block0(): Didn't get block 0?? ~
|
||||
@ -92,12 +91,12 @@ LIST OF MESSAGES
|
||||
u_undo: line numbers wrong ~
|
||||
undo list corrupt ~
|
||||
undo line missing ~
|
||||
ml_get: cannot find line {N} ~
|
||||
cannot find line {N} ~
|
||||
ml_get: cannot find line {N} in buffer {nr} {name} ~
|
||||
line number out of range: {N} past the end ~
|
||||
line count wrong in block {N} ~
|
||||
Internal error ~
|
||||
Internal error: lalloc(0, ) ~
|
||||
Internal error: {function} ~
|
||||
Internal error in regexp ~
|
||||
fatal error in cs_manage_matches ~
|
||||
Invalid count for del_bytes(): {N} ~
|
||||
|
||||
@ -728,6 +727,7 @@ specified.
|
||||
|
||||
*E488*
|
||||
Trailing characters ~
|
||||
Trailing characters: {text} ~
|
||||
|
||||
An argument has been added to an Ex command that does not permit one.
|
||||
Or the argument has invalid characters and has not been recognized.
|
||||
@ -798,7 +798,7 @@ This is an (incomplete) overview of various messages that Vim gives:
|
||||
*hit-enter* *press-enter* *hit-return*
|
||||
*press-return* *hit-enter-prompt*
|
||||
|
||||
Press ENTER or type command to continue
|
||||
Press ENTER or type command to continue ~
|
||||
|
||||
This message is given when there is something on the screen for you to read,
|
||||
and the screen is about to be redrawn:
|
||||
|
@ -1019,7 +1019,7 @@ These commands are not marks themselves, but jump to a mark:
|
||||
:let lnum = line(".")
|
||||
:keepjumps normal gg
|
||||
:call SetLastChange()
|
||||
:keepjumps exe "normal " . lnum . "G"
|
||||
:keepjumps exe "normal " .. lnum .. "G"
|
||||
<
|
||||
Note that ":keepjumps" must be used for every command.
|
||||
When invoking a function the commands in that function
|
||||
|
@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.2. Last change: 2022 Jan 22
|
||||
*options.txt* For Vim version 8.2. Last change: 2022 Feb 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -383,12 +383,22 @@ lambda it will be converted to the name, e.g. "<lambda>123". Examples:
|
||||
set opfunc=function('MyOpFunc')
|
||||
set opfunc=funcref('MyOpFunc')
|
||||
set opfunc={a\ ->\ MyOpFunc(a)}
|
||||
" set using a funcref variable
|
||||
|
||||
Set to a script-local function: >
|
||||
set opfunc=s:MyLocalFunc
|
||||
set opfunc=<SID>MyLocalFunc
|
||||
In |Vim9| script the "s:" and "<SID>" can be omitted if the function exists in
|
||||
the script: >
|
||||
set opfunc=MyLocalFunc
|
||||
|
||||
Set using a funcref variable: >
|
||||
let Fn = function('MyTagFunc')
|
||||
let &tagfunc = Fn
|
||||
" set using a lambda expression
|
||||
|
||||
Set using a lambda expression: >
|
||||
let &tagfunc = {t -> MyTagFunc(t)}
|
||||
" set using a variable with lambda expression
|
||||
|
||||
Set using a variable with lambda expression: >
|
||||
let L = {a, b, c -> MyTagFunc(a, b , c)}
|
||||
let &tagfunc = L
|
||||
|
||||
@ -800,6 +810,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
need proper setting-up, so whenever the shell's pwd changes an OSC 7
|
||||
escape sequence will be emitted. For example, on Linux, you can source
|
||||
/etc/profile.d/vte.sh in your shell profile if you use bash or zsh.
|
||||
When the parsing of the OSC sequence fails you get *E1179* .
|
||||
|
||||
*'arabic'* *'arab'* *'noarabic'* *'noarab'*
|
||||
'arabic' 'arab' boolean (default off)
|
||||
@ -1131,7 +1142,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
If you like to keep a lot of backups, you could use a BufWritePre
|
||||
autocommand to change 'backupext' just before writing the file to
|
||||
include a timestamp. >
|
||||
:au BufWritePre * let &bex = '-' . strftime("%Y%b%d%X") . '~'
|
||||
:au BufWritePre * let &bex = '-' .. strftime("%Y%b%d%X") .. '~'
|
||||
< Use 'backupdir' to put the backup in a different directory.
|
||||
|
||||
*'backupskip'* *'bsk'*
|
||||
@ -1156,7 +1167,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
Note that environment variables are not expanded. If you want to use
|
||||
$HOME you must expand it explicitly, e.g.: >
|
||||
:let &backupskip = escape(expand('$HOME'), '\') . '/tmp/*'
|
||||
:let &backupskip = escape(expand('$HOME'), '\') .. '/tmp/*'
|
||||
|
||||
< Note that the default also makes sure that "crontab -e" works (when a
|
||||
backup would be made by renaming the original file crontab won't see
|
||||
@ -1207,10 +1218,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The evaluation of the expression must not have side effects!
|
||||
Example: >
|
||||
function MyBalloonExpr()
|
||||
return 'Cursor is at line ' . v:beval_lnum .
|
||||
\', column ' . v:beval_col .
|
||||
\ ' of file ' . bufname(v:beval_bufnr) .
|
||||
\ ' on word "' . v:beval_text . '"'
|
||||
return 'Cursor is at line ' .. v:beval_lnum ..
|
||||
\ ', column ' .. v:beval_col ..
|
||||
\ ' of file ' .. bufname(v:beval_bufnr) ..
|
||||
\ ' on word "' .. v:beval_text .. '"'
|
||||
endfunction
|
||||
set bexpr=MyBalloonExpr()
|
||||
set ballooneval
|
||||
@ -1526,7 +1537,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
If the default value taken from $CDPATH is not what you want, include
|
||||
a modified version of the following command in your vimrc file to
|
||||
override it: >
|
||||
:let &cdpath = ',' . substitute(substitute($CDPATH, '[, ]', '\\\0', 'g'), ':', ',', 'g')
|
||||
:let &cdpath = ',' .. substitute(substitute($CDPATH, '[, ]', '\\\0', 'g'), ':', ',', 'g')
|
||||
< This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
(parts of 'cdpath' can be passed to the shell to expand file names).
|
||||
@ -1558,8 +1569,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
preferred, because it is much faster.
|
||||
'charconvert' is not used when reading stdin |--|, because there is no
|
||||
file to convert from. You will have to save the text in a file first.
|
||||
The expression must return zero or an empty string for success,
|
||||
non-zero for failure.
|
||||
The expression must return zero, false or an empty string for success,
|
||||
non-zero or true for failure.
|
||||
The possible encoding names encountered are in 'encoding'.
|
||||
Additionally, names given in 'fileencodings' and 'fileencoding' are
|
||||
used.
|
||||
@ -1571,8 +1582,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
set charconvert=CharConvert()
|
||||
fun CharConvert()
|
||||
system("recode "
|
||||
\ . v:charconvert_from . ".." . v:charconvert_to
|
||||
\ . " <" . v:fname_in . " >" v:fname_out)
|
||||
\ .. v:charconvert_from .. ".." .. v:charconvert_to
|
||||
\ .. " <" .. v:fname_in .. " >" .. v:fname_out)
|
||||
return v:shell_error
|
||||
endfun
|
||||
< The related Vim variables are:
|
||||
@ -1583,9 +1594,18 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Note that v:fname_in and v:fname_out will never be the same.
|
||||
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.
|
||||
|
||||
Encryption is not done by Vim when using 'charconvert'. If you want
|
||||
to encrypt the file after conversion, 'charconvert' should take care
|
||||
of this.
|
||||
|
||||
If the 'charconvert' expression starts with s: or |<SID>|, then it is
|
||||
replaced with the script ID (|local-function|). Example: >
|
||||
set charconvert=s:MyConvert()
|
||||
set charconvert=<SID>SomeConvert()
|
||||
< Otherwise the expression is evaluated in the context of the script
|
||||
where the option was set, thus script-local items are available.
|
||||
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
@ -2467,7 +2487,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
you write the file the encrypted bytes will be
|
||||
different. The whole undo file is encrypted, not just
|
||||
the pieces of text.
|
||||
*E1193* *E1194* *E1195* *E1196*
|
||||
*E1193* *E1194* *E1195* *E1196* *E1230*
|
||||
*E1197* *E1198* *E1199* *E1200* *E1201*
|
||||
xchacha20 XChaCha20 Cipher with Poly1305 Message Authentication
|
||||
Code. Medium strong till strong encryption.
|
||||
@ -4018,7 +4038,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'guitablabel' 'gtl' string (default empty)
|
||||
global
|
||||
{only available when compiled with GUI enabled}
|
||||
When nonempty describes the text to use in a label of the GUI tab
|
||||
When non-empty describes the text to use in a label of the GUI tab
|
||||
pages line. When empty and when the result is empty Vim will use a
|
||||
default label. See |setting-guitablabel| for more info.
|
||||
|
||||
@ -4036,7 +4056,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'guitabtooltip' 'gtt' string (default empty)
|
||||
global
|
||||
{only available when compiled with GUI enabled}
|
||||
When nonempty describes the text to use in a tooltip for the GUI tab
|
||||
When non-empty describes the text to use in a tooltip for the GUI tab
|
||||
pages line. When empty Vim will use a default tooltip.
|
||||
This option is otherwise just like 'guitablabel' above.
|
||||
You can include a line break. Simplest method is to use |:let|: >
|
||||
@ -4867,7 +4887,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|+multi_lang| features}
|
||||
Language to use for menu translation. Tells which file is loaded
|
||||
from the "lang" directory in 'runtimepath': >
|
||||
"lang/menu_" . &langmenu . ".vim"
|
||||
"lang/menu_" .. &langmenu .. ".vim"
|
||||
< (without the spaces). For example, to always use the Dutch menus, no
|
||||
matter what $LANG is set to: >
|
||||
:set langmenu=nl_NL.ISO_8859-1
|
||||
@ -5881,7 +5901,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
< To use an environment variable, you probably need to replace the
|
||||
separator. Here is an example to append $INCL, in which directory
|
||||
names are separated with a semi-colon: >
|
||||
:let &path = &path . "," . substitute($INCL, ';', ',', 'g')
|
||||
:let &path = &path .. "," .. substitute($INCL, ';', ',', 'g')
|
||||
< Replace the ';' with a ':' or whatever separator is used. Note that
|
||||
this doesn't work when $INCL contains a comma or white space.
|
||||
|
||||
@ -6714,6 +6734,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
See |option-backslash| about including spaces and backslashes.
|
||||
Environment variables are expanded |:set_env|.
|
||||
|
||||
In |restricted-mode| shell commands will not be possible. This mode
|
||||
is used if the value of $SHELL ends in "false" or "nologin".
|
||||
|
||||
If the name of the shell contains a space, you need to enclose it in
|
||||
quotes and escape the space. Example with quotes: >
|
||||
:set shell=\"c:\program\ files\unix\sh.exe\"\ -f
|
||||
@ -7363,6 +7386,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
suggestions is never more than the value of 'lines'
|
||||
minus two.
|
||||
|
||||
timeout:{millisec} Limit the time searching for suggestions to
|
||||
{millisec} milli seconds. Applies to the following
|
||||
methods. When omitted the limit is 5000. When
|
||||
negative there is no limit. {only works when built
|
||||
with the +reltime feature}
|
||||
|
||||
file:{filename} Read file {filename}, which must have two columns,
|
||||
separated by a slash. The first column contains the
|
||||
bad word, the second column the suggested good word.
|
||||
@ -7430,7 +7459,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global or local to window |global-local|
|
||||
{not available when compiled without the |+statusline|
|
||||
feature}
|
||||
When nonempty, this option determines the content of the status line.
|
||||
When non-empty, this option determines the content of the status line.
|
||||
Also see |status-line|.
|
||||
|
||||
The option consists of printf style '%' items interspersed with
|
||||
@ -7738,7 +7767,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'tabline'* *'tal'*
|
||||
'tabline' 'tal' string (default empty)
|
||||
global
|
||||
When nonempty, this option determines the content of the tab pages
|
||||
When non-empty, this option determines the content of the tab pages
|
||||
line at the top of the Vim window. When empty Vim will use a default
|
||||
tab pages line. See |setting-tabline| for more info.
|
||||
|
||||
@ -7771,10 +7800,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'tabstop' 'ts' number (default 8)
|
||||
local to buffer
|
||||
Number of spaces that a <Tab> in the file counts for. Also see
|
||||
|:retab| command, and 'softtabstop' option.
|
||||
the |:retab| command, and the 'softtabstop' option.
|
||||
|
||||
Note: Setting 'tabstop' to any other value than 8 can make your file
|
||||
appear wrong in many places (e.g., when printing it).
|
||||
appear wrong in many places, e.g., when printing it.
|
||||
The value must be more than 0 and less than 10000.
|
||||
|
||||
There are four main ways to use tabs in Vim:
|
||||
1. Always keep 'tabstop' at 8, set 'softtabstop' and 'shiftwidth' to 4
|
||||
@ -8288,7 +8318,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
This option cannot be set in a modeline when 'modelineexpr' is off.
|
||||
|
||||
Example: >
|
||||
:auto BufEnter * let &titlestring = hostname() . "/" . expand("%:p")
|
||||
:auto BufEnter * let &titlestring = hostname() .. "/" .. expand("%:p")
|
||||
:set title titlestring=%<%F%=%l/%L-%P titlelen=70
|
||||
< The value of 'titlelen' is used to align items in the middle or right
|
||||
of the available space.
|
||||
@ -8954,7 +8984,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
mode. On pressing 'wildchar' (usually <Tab>) to invoke completion,
|
||||
the possible matches are shown just above the command line, with the
|
||||
first match highlighted (overwriting the status line, if there is
|
||||
one). Keys that show the previous/next match, such as <Tab> or
|
||||
one). This is the behavior without "pum" in 'wildoptions.
|
||||
Keys that show the previous/next match, such as <Tab> or
|
||||
CTRL-P/CTRL-N, cause the highlight to move to the appropriate match.
|
||||
When 'wildmode' is used, "wildmenu" mode is used where "full" is
|
||||
specified. "longest" and "list" do not start "wildmenu" mode.
|
||||
@ -8962,10 +8993,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
If there are more matches than can fit in the line, a ">" is shown on
|
||||
the right and/or a "<" is shown on the left. The status line scrolls
|
||||
as needed.
|
||||
When 'wildoptions' contains "pum", then the completion matches are
|
||||
shown in a popup menu.
|
||||
The "wildmenu" mode is abandoned when a key is hit that is not used
|
||||
for selecting a completion.
|
||||
While the "wildmenu" is active the following keys have special
|
||||
meanings:
|
||||
While the "wildmenu" is active, not using the popup menu, the
|
||||
following keys have special meanings:
|
||||
|
||||
<Left> <Right> - select previous/next match (like CTRL-P/CTRL-N)
|
||||
<Down> - in filename/menu name completion: move into a
|
||||
@ -8975,6 +9008,21 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
<Up> - in filename/menu name completion: move up into
|
||||
parent directory or parent menu.
|
||||
|
||||
When using the popup menu for command line completion, the following
|
||||
keys have special meanings:
|
||||
<Down> - select next match (like CTRL-N)
|
||||
<Left> - in filename/menu name completion: move up into
|
||||
parent directory or parent menu.
|
||||
<Right> - in filename/menu name completion: move into a
|
||||
subdirectory or submenu.
|
||||
<Up> - select previous match (like CTRL-P)
|
||||
CTRL-E - end completion, go back to what was there before
|
||||
selecting a match.
|
||||
CTRL-N - go to the next entry
|
||||
CTRL-P - go to the previous entry
|
||||
CTRL-Y - accept the currently selected match and stop
|
||||
completion.
|
||||
|
||||
This makes the menus accessible from the console |console-menus|.
|
||||
|
||||
If you prefer the <Left> and <Right> keys to move the cursor instead
|
||||
@ -9037,14 +9085,23 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
{not available when compiled without the |+wildignore|
|
||||
feature}
|
||||
A list of words that change how command line completion is done.
|
||||
Currently only one word is allowed:
|
||||
A list of words that change how |cmdline-completion| is done.
|
||||
The following values are supported:
|
||||
fuzzy Use |fuzzy-matching| to find completion matches. When
|
||||
this value is specified, wildcard expansion will not
|
||||
be used for completion. The matches will be sorted by
|
||||
the "best match" rather than alphabetically sorted.
|
||||
This will find more matches than the wildcard
|
||||
expansion. Currently fuzzy matching based completion
|
||||
is not supported for file and directory names and
|
||||
instead wildcard expansion is used.
|
||||
pum Display the completion matches using the popupmenu
|
||||
in the same style as the |ins-completion-menu|.
|
||||
tagfile When using CTRL-D to list matching tags, the kind of
|
||||
tag and the file of the tag is listed. Only one match
|
||||
is displayed per line. Often used tag kinds are:
|
||||
d #define
|
||||
f function
|
||||
Also see |cmdline-completion|.
|
||||
|
||||
*'winaltkeys'* *'wak'*
|
||||
'winaltkeys' 'wak' string (default "menu")
|
||||
|
@ -603,13 +603,13 @@ program to the new diff on VMS. Add this to your .vimrc file: >
|
||||
function MyDiff()
|
||||
let opt = ""
|
||||
if &diffopt =~ "icase"
|
||||
let opt = opt . "-i "
|
||||
let opt = opt .. "-i "
|
||||
endif
|
||||
if &diffopt =~ "iwhite"
|
||||
let opt = opt . "-b "
|
||||
let opt = opt .. "-b "
|
||||
endif
|
||||
silent execute "!mc GNU:diff.exe -a " . opt . v:fname_in . " " . v:fname_new .
|
||||
\ " > " . v:fname_out
|
||||
silent execute "!mc GNU:diff.exe -a " .. opt .. v:fname_in .. " " .. v:fname_new ..
|
||||
\ " > " .. v:fname_out
|
||||
endfunction
|
||||
endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*os_win32.txt* For Vim version 8.2. Last change: 2021 Apr 05
|
||||
*os_win32.txt* For Vim version 8.2. Last change: 2022 Feb 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by George Reilly
|
||||
@ -294,7 +294,7 @@ A. When using :! to run an external command, you can run it with "start". For
|
||||
/b no console window will be opened
|
||||
You can use only one of these flags at a time. A second one will be
|
||||
treated as the start of the command.
|
||||
|
||||
*windows-asynchronously*
|
||||
Q. How do I avoid getting a window for programs that I run asynchronously?
|
||||
A. You have two possible solutions depending on what you want:
|
||||
1) You may use the /min flag in order to run program in a minimized state
|
||||
@ -308,17 +308,17 @@ A. You have two possible solutions depending on what you want:
|
||||
|
||||
Example for a console application, run Exuberant ctags: >
|
||||
:!start /min ctags -R .
|
||||
< When it has finished you should see file named "tags" in your current
|
||||
< When it has finished you should see file named "tags" in your current
|
||||
directory. You should notice the window title blinking on your taskbar.
|
||||
This is more noticeable for commands that take longer.
|
||||
Now delete the "tags" file and run this command: >
|
||||
:!start /b ctags -R .
|
||||
< You should have the same "tags" file, but this time there will be no
|
||||
< You should have the same "tags" file, but this time there will be no
|
||||
blinking on the taskbar.
|
||||
Example for a GUI application: >
|
||||
:!start /min notepad
|
||||
:!start /b notepad
|
||||
< The first command runs notepad minimized and the second one runs it
|
||||
< The first command runs notepad minimized and the second one runs it
|
||||
normally.
|
||||
|
||||
*windows-icon*
|
||||
|
@ -1,4 +1,4 @@
|
||||
*pattern.txt* For Vim version 8.2. Last change: 2022 Jan 08
|
||||
*pattern.txt* For Vim version 8.2. Last change: 2022 Mar 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -19,7 +19,7 @@ explanations are in chapter 27 |usr_27.txt|.
|
||||
8. Composing characters |patterns-composing|
|
||||
9. Compare with Perl patterns |perl-patterns|
|
||||
10. Highlighting matches |match-highlight|
|
||||
11. Fuzzy matching |fuzzy-match|
|
||||
11. Fuzzy matching |fuzzy-matching|
|
||||
|
||||
==============================================================================
|
||||
1. Search commands *search-commands*
|
||||
@ -164,9 +164,12 @@ index, on which the cursor is. This can look like this: >
|
||||
Note: the count does not take offset into account.
|
||||
|
||||
When no match is found you get the error: *E486* Pattern not found
|
||||
Note that for the |:global| command this behaves like a normal message, for Vi
|
||||
compatibility. For the |:s| command the "e" flag can be used to avoid the
|
||||
error message |:s_flags|.
|
||||
Note that for the `:global` command, when used in legacy script, you get a
|
||||
normal message "Pattern not found", for Vi compatibility.
|
||||
In |Vim9| script you get E486 for "pattern not found" or *E538* when the pattern
|
||||
matches in every line with `:vglobal`.
|
||||
For the |:s| command the "e" flag can be used to avoid the error message
|
||||
|:s_flags|.
|
||||
|
||||
*search-offset* *{offset}*
|
||||
These commands search for the specified pattern. With "/" and "?" an
|
||||
@ -925,7 +928,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|
||||
becomes invalid. Vim doesn't automatically update the matches.
|
||||
Similar to moving the cursor for "\%#" |/\%#|.
|
||||
|
||||
*/\%l* */\%>l* */\%<l* *E951*
|
||||
*/\%l* */\%>l* */\%<l* *E951* *E1204*
|
||||
\%23l Matches in a specific line.
|
||||
\%<23l Matches above a specific line (lower line number).
|
||||
\%>23l Matches below a specific line (higher line number).
|
||||
@ -963,7 +966,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|
||||
the cursor moves the display isn't updated for this change. An update
|
||||
is done when using the |CTRL-L| command (the whole screen is updated).
|
||||
Example, to highlight the column where the cursor currently is: >
|
||||
:exe '/\%' . col(".") . 'c'
|
||||
:exe '/\%' .. col(".") .. 'c'
|
||||
< Alternatively use: >
|
||||
/\%.c
|
||||
< When 'hlsearch' is set and you move the cursor around and make changes
|
||||
@ -1457,7 +1460,7 @@ Finally, these constructs are unique to Perl:
|
||||
":2match" for another plugin.
|
||||
|
||||
==============================================================================
|
||||
11. Fuzzy matching *fuzzy-match*
|
||||
11. Fuzzy matching *fuzzy-matching*
|
||||
|
||||
Fuzzy matching refers to matching strings using a non-exact search string.
|
||||
Fuzzy matching will match a string, if all the characters in the search string
|
||||
|
@ -968,7 +968,7 @@ itself:
|
||||
fun! NetReadFixup(method, line1, line2)
|
||||
if method == 3 " ftp (no <.netrc>)
|
||||
let fourblanklines= line2 - 3
|
||||
silent fourblanklines.",".line2."g/^\s*/d"
|
||||
silent fourblanklines .. "," .. line2 .. "g/^\s*/d"
|
||||
endif
|
||||
endfunction
|
||||
endif
|
||||
@ -1975,7 +1975,7 @@ To use this function, simply assign its output to |g:netrw_list_hide| option. >
|
||||
Example: let g:netrw_list_hide= netrw_gitignore#Hide('my_gitignore_file')
|
||||
Function can take additional files with git-ignore patterns.
|
||||
|
||||
Example: g:netrw_list_hide= netrw_gitignore#Hide() . '.*\.swp$'
|
||||
Example: let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$'
|
||||
Combining 'netrw_gitignore#Hide' with custom patterns.
|
||||
<
|
||||
|
||||
@ -2825,7 +2825,7 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
|
||||
Examples:
|
||||
let g:netrw_list_hide= '.*\.swp$'
|
||||
let g:netrw_list_hide= netrw_gitignore#Hide().'.*\.swp$'
|
||||
let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$'
|
||||
default: ""
|
||||
|
||||
*g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin
|
||||
|
@ -1,4 +1,4 @@
|
||||
*print.txt* For Vim version 8.2. Last change: 2021 Oct 04
|
||||
*print.txt* For Vim version 8.2. Last change: 2022 Jan 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -139,28 +139,28 @@ If there is no error, return zero or an empty string.
|
||||
The default for non MS-Windows or VMS systems is to simply use "lpr" to print
|
||||
the file: >
|
||||
|
||||
system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice)
|
||||
. ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error
|
||||
system('lpr' .. (&printdevice == '' ? '' : ' -P' .. &printdevice)
|
||||
.. ' ' .. v:fname_in) .. delete(v:fname_in) + v:shell_error
|
||||
|
||||
On MS-Windows machines the default is to copy the file to the currently
|
||||
specified printdevice: >
|
||||
|
||||
system('copy' . ' ' . v:fname_in . (&printdevice == ''
|
||||
? ' LPT1:' : (' \"' . &printdevice . '\"')))
|
||||
. delete(v:fname_in)
|
||||
system('copy' .. ' ' .. v:fname_in .. (&printdevice == ''
|
||||
? ' LPT1:' : (' \"' .. &printdevice .. '\"')))
|
||||
.. delete(v:fname_in)
|
||||
|
||||
On VMS machines the default is to send the file to either the default or
|
||||
currently specified printdevice: >
|
||||
|
||||
system('print' . (&printdevice == '' ? '' : ' /queue=' .
|
||||
&printdevice) . ' ' . v:fname_in) . delete(v:fname_in)
|
||||
system('print' .. (&printdevice == '' ? '' : ' /queue=' ..
|
||||
&printdevice) .. ' ' .. v:fname_in) .. delete(v:fname_in)
|
||||
|
||||
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 system("ghostview " .. a:fname)
|
||||
: call delete(a:fname)
|
||||
: return v:shell_error
|
||||
:endfunc
|
||||
@ -178,7 +178,9 @@ If the expression starts with s: or |<SID>|, then it is replaced with the
|
||||
script ID (|local-function|). Example: >
|
||||
set printexpr=s:MyPrintFile()
|
||||
set printexpr=<SID>SomePrintFile()
|
||||
<
|
||||
Otherwise, the expression is evaluated in the context of the script where the
|
||||
option was set, thus script-local items are available.
|
||||
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for security
|
||||
reasons.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*quickfix.txt* For Vim version 8.2. Last change: 2022 Jan 04
|
||||
*quickfix.txt* For Vim version 8.2. Last change: 2022 Feb 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -353,7 +353,7 @@ processing a quickfix or location list command, it will be aborted.
|
||||
cursor position will not be changed. See |:cexpr| for
|
||||
more information.
|
||||
Example: >
|
||||
:g/mypattern/caddexpr expand("%") . ":" . line(".") . ":" . getline(".")
|
||||
:g/mypattern/caddexpr expand("%") .. ":" .. line(".") .. ":" .. getline(".")
|
||||
<
|
||||
*:lad* *:addd* *:laddexpr*
|
||||
:lad[dexpr] {expr} Same as ":caddexpr", except the location list for the
|
||||
@ -654,6 +654,27 @@ quickfix window. If there already is a window for that file, it is used
|
||||
instead. If the buffer in the used window has changed, and the error is in
|
||||
another file, jumping to the error will fail. You will first have to make
|
||||
sure the window contains a buffer which can be abandoned.
|
||||
|
||||
When you select a file from the quickfix window, the following steps are used
|
||||
to find a window to edit the file:
|
||||
|
||||
1. If a window displaying the selected file is present in the current tabpage
|
||||
(starting with the window before the quickfix window), then that window is
|
||||
used.
|
||||
2. If the above step fails and if 'switchbuf' contains "usetab" and a window
|
||||
displaying the selected file is present in any one of the tabpages
|
||||
(starting with the first tabpage) then that window is used.
|
||||
3. If the above step fails then a window in the current tabpage displaying a
|
||||
buffer with 'buftype' not set (starting with the window before the quickfix
|
||||
window) is used.
|
||||
4. If the above step fails and if 'switchbuf' contains "uselast", then the
|
||||
previously accessed window is used.
|
||||
5. If the above step fails then the window before the quickfix window is used.
|
||||
If there is no previous window, then the window after the quickfix window
|
||||
is used.
|
||||
6. If the above step fails, then a new horizontally split window above the
|
||||
quickfix window is used.
|
||||
|
||||
*CTRL-W_<Enter>* *CTRL-W_<CR>*
|
||||
You can use CTRL-W <Enter> to open a new window and jump to the error there.
|
||||
|
||||
@ -663,7 +684,7 @@ FileType event (also see |qf.vim|). Then the BufReadPost event is triggered,
|
||||
using "quickfix" for the buffer name. This can be used to perform some action
|
||||
on the listed errors. Example: >
|
||||
au BufReadPost quickfix setlocal modifiable
|
||||
\ | silent exe 'g/^/s//\=line(".")." "/'
|
||||
\ | silent exe 'g/^/s//\=line(".") .. " "/'
|
||||
\ | setlocal nomodifiable
|
||||
This prepends the line number to each line. Note the use of "\=" in the
|
||||
substitute string of the ":s" command, which is used to evaluate an
|
||||
@ -692,13 +713,15 @@ this window, the displayed location list is used.
|
||||
When you select a file from the location list window, the following steps are
|
||||
used to find a window to edit the file:
|
||||
|
||||
1. If a window with the location list displayed in the location list window is
|
||||
present, then the file is opened in that window.
|
||||
2. If the above step fails and if the file is already opened in another
|
||||
window, then that window is used.
|
||||
3. If the above step fails then an existing window showing a buffer with
|
||||
'buftype' not set is used.
|
||||
4. If the above step fails, then the file is edited in a new window.
|
||||
1. If a non-quickfix window associated with the location list is present in
|
||||
the current tabpage, then that window is used.
|
||||
2. If the above step fails and if the file is already opened in another window
|
||||
in the current tabpage, then that window is used.
|
||||
3. If the above step fails and 'switchbuf' contains "usetab" and if the file
|
||||
is opened in a window in any one of the tabpages, then that window is used.
|
||||
4. If the above step fails then a window in the current tabpage showing a
|
||||
buffer with 'buftype' not set is used.
|
||||
5. If the above step fails, then the file is edited in a new window.
|
||||
|
||||
In all of the above cases, if the location list for the selected window is not
|
||||
yet set, then it is set to the location list displayed in the location list
|
||||
@ -1037,7 +1060,7 @@ commands can be combined to create a NewGrep command: >
|
||||
matching is used to find matching lines. In this
|
||||
case, {pattern} is treated as a literal string
|
||||
instead of a regular expression. See
|
||||
|fuzzy-match| for more information about fuzzy
|
||||
|fuzzy-matching| for more information about fuzzy
|
||||
matching strings.
|
||||
|
||||
|QuickFixCmdPre| and |QuickFixCmdPost| are triggered.
|
||||
@ -1385,12 +1408,17 @@ Basic items
|
||||
%f file name (finds a string)
|
||||
%o module name (finds a string)
|
||||
%l line number (finds a number)
|
||||
%e end line number (finds a number)
|
||||
%c column number (finds a number representing character
|
||||
column of the error, byte index, a <tab> is 1
|
||||
character column)
|
||||
%v virtual column number (finds a number representing
|
||||
screen column of the error (1 <tab> == 8 screen
|
||||
columns))
|
||||
%k end column number (finds a number representing
|
||||
the character column of the error, byte index, or a
|
||||
number representing screen end column of the error if
|
||||
it's used with %v)
|
||||
%t error type (finds a single character):
|
||||
e - error message
|
||||
w - warning message
|
||||
|
@ -1,4 +1,4 @@
|
||||
*remote.txt* For Vim version 8.2. Last change: 2021 Dec 27
|
||||
*remote.txt* For Vim version 8.2. Last change: 2022 Feb 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -120,6 +120,10 @@ when sending command to it.
|
||||
|
||||
The --serverlist argument will cause Vim to print a list of registered command
|
||||
servers on the standard output (stdout) and exit.
|
||||
*{server}*
|
||||
The {server} argument is used by several functions. When this is an empty
|
||||
string then on Unix the default server name is used, which is "GVIM". On
|
||||
MS-Windows an empty string does not work.
|
||||
|
||||
Win32 Note: Making the Vim server go to the foreground doesn't always work,
|
||||
because MS-Windows doesn't allow it. The client will move the server to the
|
||||
|
@ -101,7 +101,7 @@ precedence, otherwise the 'cursorline' highlighting.
|
||||
Here is an example that places a sign "piet", displayed with the text ">>", in
|
||||
line 23 of the current file: >
|
||||
:sign define piet text=>> texthl=Search
|
||||
:exe ":sign place 2 line=23 name=piet file=" . expand("%:p")
|
||||
:exe ":sign place 2 line=23 name=piet file=" .. expand("%:p")
|
||||
|
||||
And here is the command to delete it again: >
|
||||
:sign unplace 2
|
||||
|
@ -131,8 +131,8 @@ zuG Undo |zW| and |zG|, remove the word from the internal
|
||||
rare as this is a fairly uncommon command and all
|
||||
intuitive commands for this are already taken. If you
|
||||
want you can add mappings with e.g.: >
|
||||
nnoremap z? :exe ':spellrare ' . expand('<cWORD>')<CR>
|
||||
nnoremap z/ :exe ':spellrare! ' . expand('<cWORD>')<CR>
|
||||
nnoremap z? :exe ':spellrare ' .. expand('<cWORD>')<CR>
|
||||
nnoremap z/ :exe ':spellrare! ' .. expand('<cWORD>')<CR>
|
||||
< |:spellundo|, |zuw|, or |zuW| can be used to undo this.
|
||||
|
||||
:spellr[rare]! {word} Add {word} as a rare word to the internal word
|
||||
|
@ -1,4 +1,4 @@
|
||||
*starting.txt* For Vim version 8.2. Last change: 2022 Jan 20
|
||||
*starting.txt* For Vim version 8.2. Last change: 2022 Feb 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -256,6 +256,8 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
|
||||
Interfaces, such as Python, Ruby and Lua, are also disabled,
|
||||
since they could be used to execute shell commands. Perl uses
|
||||
the Safe module.
|
||||
For Unix restricted mode is used when the last part of $SHELL
|
||||
is "nologin" or "false".
|
||||
Note that the user may still find a loophole to execute a
|
||||
shell command, it has only been made difficult.
|
||||
|
||||
@ -1376,7 +1378,7 @@ resulting file, when executed with a ":source" command:
|
||||
After restoring the Session, the full filename of your current Session is
|
||||
available in the internal variable "v:this_session" |this_session-variable|.
|
||||
An example mapping: >
|
||||
:nmap <F2> :wa<Bar>exe "mksession! " . v:this_session<CR>:so ~/sessions/
|
||||
:nmap <F2> :wa<Bar>exe "mksession! " .. v:this_session<CR>:so ~/sessions/
|
||||
This saves the current Session, and starts off the command to load another.
|
||||
|
||||
A session includes all tab pages, unless "tabpages" was removed from
|
||||
|
@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 8.2. Last change: 2021 Nov 20
|
||||
*syntax.txt* For Vim version 8.2. Last change: 2022 Mar 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -215,7 +215,8 @@ A syntax group name doesn't specify any color or attributes itself.
|
||||
|
||||
The name for a highlight or syntax group must consist of ASCII letters, digits
|
||||
and the underscore. As a regexp: "[a-zA-Z0-9_]*". However, Vim does not give
|
||||
an error when using other characters.
|
||||
an error when using other characters. The maxium length of a group name is
|
||||
about 200 bytes. *E1249*
|
||||
|
||||
To be able to allow each user to pick their favorite set of colors, there must
|
||||
be preferred names for highlight groups that are common for many languages.
|
||||
@ -652,7 +653,7 @@ evaluate to get a unique string to append to each ID used in a given document,
|
||||
so that the full IDs will be unique even when combined with other content in a
|
||||
larger HTML document. Example, to append _ and the buffer number to each ID: >
|
||||
|
||||
:let g:html_id_expr = '"_".bufnr("%")'
|
||||
:let g:html_id_expr = '"_" .. bufnr("%")'
|
||||
<
|
||||
To append a string "_mystring" to the end of each ID: >
|
||||
|
||||
@ -1536,6 +1537,14 @@ The enhanced mode also takes advantage of additional color features for a dark
|
||||
gvim display. Here, statements are colored LightYellow instead of Yellow, and
|
||||
conditionals are LightBlue for better distinction.
|
||||
|
||||
Both Visual Basic and FORM use the extension ".frm". To detect which one
|
||||
should be used, Vim checks for the string "VB_Name" in the first five lines of
|
||||
the file. If it is found, filetype will be "vb", otherwise "form".
|
||||
|
||||
If the automatic detection doesn't work for you or you only edit, for
|
||||
example, FORM files, use this in your startup vimrc: >
|
||||
:let filetype_frm = "form"
|
||||
|
||||
|
||||
FORTH *forth.vim* *ft-forth-syntax*
|
||||
|
||||
@ -3598,8 +3607,8 @@ Do you want to draw with the mouse? Try the following: >
|
||||
:function! GetPixel()
|
||||
: let c = getline(".")[col(".") - 1]
|
||||
: echo c
|
||||
: exe "noremap <LeftMouse> <LeftMouse>r".c
|
||||
: exe "noremap <LeftDrag> <LeftMouse>r".c
|
||||
: exe "noremap <LeftMouse> <LeftMouse>r" .. c
|
||||
: exe "noremap <LeftDrag> <LeftMouse>r" .. c
|
||||
:endfunction
|
||||
:noremap <RightMouse> <LeftMouse>:call GetPixel()<CR>
|
||||
:set guicursor=n:hor20 " to see the color beneath the cursor
|
||||
@ -3704,12 +3713,13 @@ DEFINING CASE *:syn-case* *E390*
|
||||
items until the next ":syntax case" command are affected.
|
||||
|
||||
:sy[ntax] case
|
||||
Show either "syntax case match" or "syntax case ignore" (translated).
|
||||
Show either "syntax case match" or "syntax case ignore".
|
||||
|
||||
|
||||
DEFINING FOLDLEVEL *:syn-foldlevel*
|
||||
|
||||
:sy[ntax] foldlevel [start | minimum]
|
||||
:sy[ntax] foldlevel start
|
||||
:sy[ntax] foldlevel minimum
|
||||
This defines how the foldlevel of a line is computed when using
|
||||
foldmethod=syntax (see |fold-syntax| and |:syn-fold|):
|
||||
|
||||
@ -3722,13 +3732,16 @@ DEFINING FOLDLEVEL *:syn-foldlevel*
|
||||
may close and open horizontally within a line.
|
||||
|
||||
:sy[ntax] foldlevel
|
||||
Show either "syntax foldlevel start" or "syntax foldlevel minimum".
|
||||
Show the current foldlevel method, either "syntax foldlevel start" or
|
||||
"syntax foldlevel minimum".
|
||||
|
||||
{not meaningful when Vim was compiled without |+folding| feature}
|
||||
|
||||
SPELL CHECKING *:syn-spell*
|
||||
|
||||
:sy[ntax] spell [toplevel | notoplevel | default]
|
||||
:sy[ntax] spell toplevel
|
||||
:sy[ntax] spell notoplevel
|
||||
:sy[ntax] spell default
|
||||
This defines where spell checking is to be done for text that is not
|
||||
in a syntax item:
|
||||
|
||||
@ -3743,8 +3756,8 @@ SPELL CHECKING *:syn-spell*
|
||||
To activate spell checking the 'spell' option must be set.
|
||||
|
||||
:sy[ntax] spell
|
||||
Show either "syntax spell toplevel", "syntax spell notoplevel" or
|
||||
"syntax spell default" (translated).
|
||||
Show the current syntax spell checking method, either "syntax spell
|
||||
toplevel", "syntax spell notoplevel" or "syntax spell default".
|
||||
|
||||
|
||||
SYNTAX ISKEYWORD SETTING *:syn-iskeyword*
|
||||
@ -4343,7 +4356,7 @@ IMPLICIT CONCEAL *:syn-conceal-implicit*
|
||||
given explicitly.
|
||||
|
||||
:sy[ntax] conceal
|
||||
Show either "syntax conceal on" or "syntax conceal off" (translated).
|
||||
Show either "syntax conceal on" or "syntax conceal off".
|
||||
|
||||
==============================================================================
|
||||
8. Syntax patterns *:syn-pattern* *E401* *E402*
|
||||
@ -4439,7 +4452,7 @@ Leading context *:syn-lc* *:syn-leading* *:syn-context*
|
||||
|
||||
Note: This is an obsolete feature, only included for backwards compatibility
|
||||
with previous Vim versions. It's now recommended to use the |/\@<=| construct
|
||||
in the pattern.
|
||||
in the pattern. You can also often use |/\zs|.
|
||||
|
||||
The "lc" offset specifies leading context -- a part of the pattern that must
|
||||
be present, but is not considered part of the match. An offset of "lc=n" will
|
||||
@ -5554,9 +5567,9 @@ types.vim: *.[ch]
|
||||
And put these lines in your .vimrc: >
|
||||
|
||||
" load the types.vim highlighting file, if it exists
|
||||
autocmd BufRead,BufNewFile *.[ch] let fname = expand('<afile>:p:h') . '/types.vim'
|
||||
autocmd BufRead,BufNewFile *.[ch] let fname = expand('<afile>:p:h') .. '/types.vim'
|
||||
autocmd BufRead,BufNewFile *.[ch] if filereadable(fname)
|
||||
autocmd BufRead,BufNewFile *.[ch] exe 'so ' . fname
|
||||
autocmd BufRead,BufNewFile *.[ch] exe 'so ' .. fname
|
||||
autocmd BufRead,BufNewFile *.[ch] endif
|
||||
|
||||
==============================================================================
|
||||
|
@ -1,4 +1,4 @@
|
||||
*tabpage.txt* For Vim version 8.2. Last change: 2020 Oct 14
|
||||
*tabpage.txt* For Vim version 8.2. Last change: 2022 Feb 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -143,7 +143,9 @@ something else.
|
||||
:tabclose 3 " close the third tab page
|
||||
:tabclose $ " close the last tab page
|
||||
:tabclose # " close the last accessed tab page
|
||||
<
|
||||
|
||||
When a tab is closed the next tab page will become the current one.
|
||||
|
||||
*:tabo* *:tabonly*
|
||||
:tabo[nly][!] Close all other tab pages.
|
||||
When the 'hidden' option is set, all buffers in closed windows
|
||||
@ -379,24 +381,24 @@ pages and define labels for them. Then get the label for each tab page. >
|
||||
for i in range(tabpagenr('$'))
|
||||
" select the highlighting
|
||||
if i + 1 == tabpagenr()
|
||||
let s .= '%#TabLineSel#'
|
||||
let s ..= '%#TabLineSel#'
|
||||
else
|
||||
let s .= '%#TabLine#'
|
||||
let s ..= '%#TabLine#'
|
||||
endif
|
||||
|
||||
" set the tab page number (for mouse clicks)
|
||||
let s .= '%' . (i + 1) . 'T'
|
||||
let s ..= '%' .. (i + 1) .. 'T'
|
||||
|
||||
" the label is made by MyTabLabel()
|
||||
let s .= ' %{MyTabLabel(' . (i + 1) . ')} '
|
||||
let s ..= ' %{MyTabLabel(' .. (i + 1) .. ')} '
|
||||
endfor
|
||||
|
||||
" after the last tab fill with TabLineFill and reset tab page nr
|
||||
let s .= '%#TabLineFill#%T'
|
||||
let s ..= '%#TabLineFill#%T'
|
||||
|
||||
" right-align the label to close the current tab page
|
||||
if tabpagenr('$') > 1
|
||||
let s .= '%=%#TabLine#%999Xclose'
|
||||
let s ..= '%=%#TabLine#%999Xclose'
|
||||
endif
|
||||
|
||||
return s
|
||||
@ -459,14 +461,14 @@ windows in the tab page and a '+' if there is a modified buffer: >
|
||||
" Append the number of windows in the tab page if more than one
|
||||
let wincount = tabpagewinnr(v:lnum, '$')
|
||||
if wincount > 1
|
||||
let label .= wincount
|
||||
let label ..= wincount
|
||||
endif
|
||||
if label != ''
|
||||
let label .= ' '
|
||||
let label ..= ' '
|
||||
endif
|
||||
|
||||
" Append the buffer name
|
||||
return label . bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
|
||||
return label .. bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
|
||||
endfunction
|
||||
|
||||
set guitablabel=%{GuiTabLabel()}
|
||||
|
200
runtime/doc/tags
200
runtime/doc/tags
@ -1355,6 +1355,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
+mouse various.txt /*+mouse*
|
||||
+mouse_dec various.txt /*+mouse_dec*
|
||||
+mouse_gpm various.txt /*+mouse_gpm*
|
||||
+mouse_gpm/dyn various.txt /*+mouse_gpm\/dyn*
|
||||
+mouse_jsbterm various.txt /*+mouse_jsbterm*
|
||||
+mouse_netterm various.txt /*+mouse_netterm*
|
||||
+mouse_pterm various.txt /*+mouse_pterm*
|
||||
@ -2112,6 +2113,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:abclear map.txt /*:abclear*
|
||||
:abo windows.txt /*:abo*
|
||||
:aboveleft windows.txt /*:aboveleft*
|
||||
:abstract vim9.txt /*:abstract*
|
||||
:addd quickfix.txt /*:addd*
|
||||
:al windows.txt /*:al*
|
||||
:all windows.txt /*:all*
|
||||
@ -2271,6 +2273,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:chistory quickfix.txt /*:chistory*
|
||||
:cl quickfix.txt /*:cl*
|
||||
:cla quickfix.txt /*:cla*
|
||||
:class vim9.txt /*:class*
|
||||
:clast quickfix.txt /*:clast*
|
||||
:cle motion.txt /*:cle*
|
||||
:clearjumps motion.txt /*:clearjumps*
|
||||
@ -2415,6 +2418,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:dsp tagsrch.txt /*:dsp*
|
||||
:dsplit tagsrch.txt /*:dsplit*
|
||||
:e editing.txt /*:e*
|
||||
:e# editing.txt /*:e#*
|
||||
:ea undo.txt /*:ea*
|
||||
:earlier undo.txt /*:earlier*
|
||||
:ec eval.txt /*:ec*
|
||||
@ -2432,6 +2436,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:edit editing.txt /*:edit*
|
||||
:edit! editing.txt /*:edit!*
|
||||
:edit!_f editing.txt /*:edit!_f*
|
||||
:edit_# editing.txt /*:edit_#*
|
||||
:edit_f editing.txt /*:edit_f*
|
||||
:el eval.txt /*:el*
|
||||
:else eval.txt /*:else*
|
||||
@ -2441,12 +2446,15 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:emenu gui.txt /*:emenu*
|
||||
:en eval.txt /*:en*
|
||||
:end eval.txt /*:end*
|
||||
:endclass vim9.txt /*:endclass*
|
||||
:enddef vim9.txt /*:enddef*
|
||||
:endenum vim9.txt /*:endenum*
|
||||
:endf eval.txt /*:endf*
|
||||
:endfo eval.txt /*:endfo*
|
||||
:endfor eval.txt /*:endfor*
|
||||
:endfunction eval.txt /*:endfunction*
|
||||
:endif eval.txt /*:endif*
|
||||
:endinterface vim9.txt /*:endinterface*
|
||||
:endt eval.txt /*:endt*
|
||||
:endtry eval.txt /*:endtry*
|
||||
:endw eval.txt /*:endw*
|
||||
@ -2455,6 +2463,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:ene! editing.txt /*:ene!*
|
||||
:enew editing.txt /*:enew*
|
||||
:enew! editing.txt /*:enew!*
|
||||
:enum vim9.txt /*:enum*
|
||||
:eval eval.txt /*:eval*
|
||||
:ex editing.txt /*:ex*
|
||||
:exe eval.txt /*:exe*
|
||||
@ -2581,6 +2590,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:inoreme gui.txt /*:inoreme*
|
||||
:inoremenu gui.txt /*:inoremenu*
|
||||
:insert insert.txt /*:insert*
|
||||
:interface vim9.txt /*:interface*
|
||||
:intro starting.txt /*:intro*
|
||||
:is tagsrch.txt /*:is*
|
||||
:isearch tagsrch.txt /*:isearch*
|
||||
@ -3213,6 +3223,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:startgreplace insert.txt /*:startgreplace*
|
||||
:startinsert insert.txt /*:startinsert*
|
||||
:startreplace insert.txt /*:startreplace*
|
||||
:static vim9.txt /*:static*
|
||||
:stj tagsrch.txt /*:stj*
|
||||
:stjump tagsrch.txt /*:stjump*
|
||||
:stop starting.txt /*:stop*
|
||||
@ -3390,6 +3401,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:tunma map.txt /*:tunma*
|
||||
:tunmap map.txt /*:tunmap*
|
||||
:tunmenu gui.txt /*:tunmenu*
|
||||
:type vim9.txt /*:type*
|
||||
:u undo.txt /*:u*
|
||||
:un undo.txt /*:un*
|
||||
:una map.txt /*:una*
|
||||
@ -3948,6 +3960,7 @@ Dictionary-function eval.txt /*Dictionary-function*
|
||||
DiffUpdated autocmd.txt /*DiffUpdated*
|
||||
Digraphs digraph.txt /*Digraphs*
|
||||
DirChanged autocmd.txt /*DirChanged*
|
||||
DirChangedPre autocmd.txt /*DirChangedPre*
|
||||
E motion.txt /*E*
|
||||
E10 message.txt /*E10*
|
||||
E100 diff.txt /*E100*
|
||||
@ -4018,6 +4031,7 @@ E1061 vim9.txt /*E1061*
|
||||
E1062 eval.txt /*E1062*
|
||||
E1063 eval.txt /*E1063*
|
||||
E1064 autocmd.txt /*E1064*
|
||||
E1065 vim9.txt /*E1065*
|
||||
E1066 vim9.txt /*E1066*
|
||||
E1067 eval.txt /*E1067*
|
||||
E1068 vim9.txt /*E1068*
|
||||
@ -4030,33 +4044,132 @@ E1074 vim9.txt /*E1074*
|
||||
E1075 vim9.txt /*E1075*
|
||||
E1076 eval.txt /*E1076*
|
||||
E1077 vim9.txt /*E1077*
|
||||
E1078 autocmd.txt /*E1078*
|
||||
E1079 vim9.txt /*E1079*
|
||||
E108 eval.txt /*E108*
|
||||
E1080 vim9.txt /*E1080*
|
||||
E1081 eval.txt /*E1081*
|
||||
E1083 editing.txt /*E1083*
|
||||
E1084 eval.txt /*E1084*
|
||||
E1085 eval.txt /*E1085*
|
||||
E1086 eval.txt /*E1086*
|
||||
E1087 vim9.txt /*E1087*
|
||||
E1089 eval.txt /*E1089*
|
||||
E109 eval.txt /*E109*
|
||||
E1090 eval.txt /*E1090*
|
||||
E1091 vim9.txt /*E1091*
|
||||
E1092 various.txt /*E1092*
|
||||
E1093 eval.txt /*E1093*
|
||||
E1094 vim9.txt /*E1094*
|
||||
E1095 eval.txt /*E1095*
|
||||
E1096 vim9.txt /*E1096*
|
||||
E1097 vim9.txt /*E1097*
|
||||
E1098 eval.txt /*E1098*
|
||||
E1099 vim9.txt /*E1099*
|
||||
E11 cmdline.txt /*E11*
|
||||
E110 eval.txt /*E110*
|
||||
E1100 vim9.txt /*E1100*
|
||||
E1101 vim9.txt /*E1101*
|
||||
E1102 vim9.txt /*E1102*
|
||||
E1103 vim9.txt /*E1103*
|
||||
E1104 vim9.txt /*E1104*
|
||||
E1105 vim9.txt /*E1105*
|
||||
E1106 vim9.txt /*E1106*
|
||||
E1107 eval.txt /*E1107*
|
||||
E1108 vim9.txt /*E1108*
|
||||
E1109 builtin.txt /*E1109*
|
||||
E111 eval.txt /*E111*
|
||||
E1110 builtin.txt /*E1110*
|
||||
E1111 builtin.txt /*E1111*
|
||||
E1112 builtin.txt /*E1112*
|
||||
E1113 builtin.txt /*E1113*
|
||||
E1114 builtin.txt /*E1114*
|
||||
E1115 testing.txt /*E1115*
|
||||
E1116 testing.txt /*E1116*
|
||||
E1117 vim9.txt /*E1117*
|
||||
E1118 eval.txt /*E1118*
|
||||
E1119 eval.txt /*E1119*
|
||||
E112 eval.txt /*E112*
|
||||
E1120 eval.txt /*E1120*
|
||||
E1121 eval.txt /*E1121*
|
||||
E1122 eval.txt /*E1122*
|
||||
E1123 vim9.txt /*E1123*
|
||||
E1124 vim9.txt /*E1124*
|
||||
E1125 vim9.txt /*E1125*
|
||||
E1126 vim9.txt /*E1126*
|
||||
E1127 vim9.txt /*E1127*
|
||||
E1128 vim9.txt /*E1128*
|
||||
E1129 eval.txt /*E1129*
|
||||
E113 eval.txt /*E113*
|
||||
E1130 vim9.txt /*E1130*
|
||||
E1131 vim9.txt /*E1131*
|
||||
E1132 builtin.txt /*E1132*
|
||||
E1133 vim9.txt /*E1133*
|
||||
E1134 vim9.txt /*E1134*
|
||||
E1135 eval.txt /*E1135*
|
||||
E1136 map.txt /*E1136*
|
||||
E1137 map.txt /*E1137*
|
||||
E1138 eval.txt /*E1138*
|
||||
E1139 vim9.txt /*E1139*
|
||||
E114 eval.txt /*E114*
|
||||
E1140 eval.txt /*E1140*
|
||||
E1141 eval.txt /*E1141*
|
||||
E1142 testing.txt /*E1142*
|
||||
E1143 eval.txt /*E1143*
|
||||
E1144 vim9.txt /*E1144*
|
||||
E1145 eval.txt /*E1145*
|
||||
E1146 vim9.txt /*E1146*
|
||||
E1147 eval.txt /*E1147*
|
||||
E1148 eval.txt /*E1148*
|
||||
E1149 vim9.txt /*E1149*
|
||||
E115 eval.txt /*E115*
|
||||
E1150 vim9.txt /*E1150*
|
||||
E1151 eval.txt /*E1151*
|
||||
E1152 vim9.txt /*E1152*
|
||||
E1153 eval.txt /*E1153*
|
||||
E1154 eval.txt /*E1154*
|
||||
E1155 autocmd.txt /*E1155*
|
||||
E1156 editing.txt /*E1156*
|
||||
E1157 vim9.txt /*E1157*
|
||||
E1158 vim9.txt /*E1158*
|
||||
E1159 windows.txt /*E1159*
|
||||
E116 eval.txt /*E116*
|
||||
E1160 vim9.txt /*E1160*
|
||||
E1161 builtin.txt /*E1161*
|
||||
E1162 builtin.txt /*E1162*
|
||||
E1163 vim9.txt /*E1163*
|
||||
E1164 vim9.txt /*E1164*
|
||||
E1165 eval.txt /*E1165*
|
||||
E1166 eval.txt /*E1166*
|
||||
E1167 vim9.txt /*E1167*
|
||||
E1168 vim9.txt /*E1168*
|
||||
E1169 eval.txt /*E1169*
|
||||
E117 eval.txt /*E117*
|
||||
E1170 vim9.txt /*E1170*
|
||||
E1171 vim9.txt /*E1171*
|
||||
E1172 vim9.txt /*E1172*
|
||||
E1173 vim9.txt /*E1173*
|
||||
E1174 vim9.txt /*E1174*
|
||||
E1175 vim9.txt /*E1175*
|
||||
E1176 vim9.txt /*E1176*
|
||||
E1177 eval.txt /*E1177*
|
||||
E1178 vim9.txt /*E1178*
|
||||
E1179 options.txt /*E1179*
|
||||
E118 eval.txt /*E118*
|
||||
E1180 vim9.txt /*E1180*
|
||||
E1181 vim9.txt /*E1181*
|
||||
E1182 eval.txt /*E1182*
|
||||
E1183 eval.txt /*E1183*
|
||||
E1184 eval.txt /*E1184*
|
||||
E1185 various.txt /*E1185*
|
||||
E1186 vim9.txt /*E1186*
|
||||
E1187 starting.txt /*E1187*
|
||||
E1188 cmdline.txt /*E1188*
|
||||
E1189 vim9.txt /*E1189*
|
||||
E119 eval.txt /*E119*
|
||||
E1190 vim9.txt /*E1190*
|
||||
E1191 vim9.txt /*E1191*
|
||||
E1192 eval.txt /*E1192*
|
||||
E1193 options.txt /*E1193*
|
||||
E1194 options.txt /*E1194*
|
||||
E1195 options.txt /*E1195*
|
||||
@ -4068,26 +4181,79 @@ E12 message.txt /*E12*
|
||||
E120 eval.txt /*E120*
|
||||
E1200 options.txt /*E1200*
|
||||
E1201 options.txt /*E1201*
|
||||
E1205 builtin.txt /*E1205*
|
||||
E1202 vim9.txt /*E1202*
|
||||
E1203 eval.txt /*E1203*
|
||||
E1204 pattern.txt /*E1204*
|
||||
E1205 vim9.txt /*E1205*
|
||||
E1206 vim9.txt /*E1206*
|
||||
E1207 eval.txt /*E1207*
|
||||
E1208 map.txt /*E1208*
|
||||
E1209 builtin.txt /*E1209*
|
||||
E121 eval.txt /*E121*
|
||||
E1210 vim9.txt /*E1210*
|
||||
E1211 vim9.txt /*E1211*
|
||||
E1212 vim9.txt /*E1212*
|
||||
E1213 vim9.txt /*E1213*
|
||||
E1214 builtin.txt /*E1214*
|
||||
E1215 builtin.txt /*E1215*
|
||||
E1216 builtin.txt /*E1216*
|
||||
E1217 vim9.txt /*E1217*
|
||||
E1218 vim9.txt /*E1218*
|
||||
E1219 vim9.txt /*E1219*
|
||||
E122 eval.txt /*E122*
|
||||
E1220 vim9.txt /*E1220*
|
||||
E1221 vim9.txt /*E1221*
|
||||
E1222 vim9.txt /*E1222*
|
||||
E1223 vim9.txt /*E1223*
|
||||
E1224 vim9.txt /*E1224*
|
||||
E1225 vim9.txt /*E1225*
|
||||
E1226 vim9.txt /*E1226*
|
||||
E1227 vim9.txt /*E1227*
|
||||
E1228 vim9.txt /*E1228*
|
||||
E1229 eval.txt /*E1229*
|
||||
E123 eval.txt /*E123*
|
||||
E1230 options.txt /*E1230*
|
||||
E1231 map.txt /*E1231*
|
||||
E1232 builtin.txt /*E1232*
|
||||
E1233 builtin.txt /*E1233*
|
||||
E1234 vim9.txt /*E1234*
|
||||
E1235 vim9.txt /*E1235*
|
||||
E1236 vim9.txt /*E1236*
|
||||
E1237 map.txt /*E1237*
|
||||
E1238 vim9.txt /*E1238*
|
||||
E1239 builtin.txt /*E1239*
|
||||
E124 eval.txt /*E124*
|
||||
E1240 change.txt /*E1240*
|
||||
E1241 change.txt /*E1241*
|
||||
E1242 change.txt /*E1242*
|
||||
E1243 options.txt /*E1243*
|
||||
E1244 message.txt /*E1244*
|
||||
E1245 cmdline.txt /*E1245*
|
||||
E1246 eval.txt /*E1246*
|
||||
E1247 cmdline.txt /*E1247*
|
||||
E1248 vim9.txt /*E1248*
|
||||
E1249 syntax.txt /*E1249*
|
||||
E125 eval.txt /*E125*
|
||||
E1250 vim9.txt /*E1250*
|
||||
E1251 vim9.txt /*E1251*
|
||||
E1252 vim9.txt /*E1252*
|
||||
E1253 vim9.txt /*E1253*
|
||||
E1254 vim9.txt /*E1254*
|
||||
E1255 map.txt /*E1255*
|
||||
E1256 vim9.txt /*E1256*
|
||||
E1257 vim9.txt /*E1257*
|
||||
E1258 vim9.txt /*E1258*
|
||||
E1259 vim9.txt /*E1259*
|
||||
E126 eval.txt /*E126*
|
||||
E1260 vim9.txt /*E1260*
|
||||
E1261 vim9.txt /*E1261*
|
||||
E1262 vim9.txt /*E1262*
|
||||
E1263 eval.txt /*E1263*
|
||||
E1264 vim9.txt /*E1264*
|
||||
E1265 eval.txt /*E1265*
|
||||
E1266 if_pyth.txt /*E1266*
|
||||
E127 eval.txt /*E127*
|
||||
E1270 change.txt /*E1270*
|
||||
E128 eval.txt /*E128*
|
||||
E129 eval.txt /*E129*
|
||||
E13 message.txt /*E13*
|
||||
@ -4269,6 +4435,7 @@ E295 message.txt /*E295*
|
||||
E296 message.txt /*E296*
|
||||
E297 message.txt /*E297*
|
||||
E298 message.txt /*E298*
|
||||
E299 if_perl.txt /*E299*
|
||||
E30 change.txt /*E30*
|
||||
E300 message.txt /*E300*
|
||||
E301 message.txt /*E301*
|
||||
@ -4528,7 +4695,7 @@ E534 options.txt /*E534*
|
||||
E535 options.txt /*E535*
|
||||
E536 options.txt /*E536*
|
||||
E537 options.txt /*E537*
|
||||
E538 builtin.txt /*E538*
|
||||
E538 pattern.txt /*E538*
|
||||
E539 options.txt /*E539*
|
||||
E54 pattern.txt /*E54*
|
||||
E540 options.txt /*E540*
|
||||
@ -4851,6 +5018,7 @@ E835 options.txt /*E835*
|
||||
E836 if_pyth.txt /*E836*
|
||||
E837 if_pyth.txt /*E837*
|
||||
E838 netbeans.txt /*E838*
|
||||
E839 vim9.txt /*E839*
|
||||
E84 windows.txt /*E84*
|
||||
E840 insert.txt /*E840*
|
||||
E841 map.txt /*E841*
|
||||
@ -5708,6 +5876,7 @@ bug-fixes-5 version5.txt /*bug-fixes-5*
|
||||
bug-fixes-6 version6.txt /*bug-fixes-6*
|
||||
bug-fixes-7 version7.txt /*bug-fixes-7*
|
||||
bug-fixes-8 version8.txt /*bug-fixes-8*
|
||||
bug-fixes-9 version9.txt /*bug-fixes-9*
|
||||
bug-reports intro.txt /*bug-reports*
|
||||
bugreport.vim intro.txt /*bugreport.vim*
|
||||
bugs intro.txt /*bugs*
|
||||
@ -6009,6 +6178,7 @@ collate-variable eval.txt /*collate-variable*
|
||||
color-xterm syntax.txt /*color-xterm*
|
||||
coloring syntax.txt /*coloring*
|
||||
colortest.vim syntax.txt /*colortest.vim*
|
||||
command-attributes map.txt /*command-attributes*
|
||||
command-block vim9.txt /*command-block*
|
||||
command-line-functions usr_41.txt /*command-line-functions*
|
||||
command-line-window cmdline.txt /*command-line-window*
|
||||
@ -6018,6 +6188,7 @@ compile-changes-5 version5.txt /*compile-changes-5*
|
||||
compile-changes-6 version6.txt /*compile-changes-6*
|
||||
compile-changes-7 version7.txt /*compile-changes-7*
|
||||
compile-changes-8 version8.txt /*compile-changes-8*
|
||||
compile-changes-9 version9.txt /*compile-changes-9*
|
||||
compiler-compaqada ft_ada.txt /*compiler-compaqada*
|
||||
compiler-decada ft_ada.txt /*compiler-decada*
|
||||
compiler-gcc quickfix.txt /*compiler-gcc*
|
||||
@ -6072,6 +6243,7 @@ conversion-server mbyte.txt /*conversion-server*
|
||||
convert-to-HTML syntax.txt /*convert-to-HTML*
|
||||
convert-to-XHTML syntax.txt /*convert-to-XHTML*
|
||||
convert-to-XML syntax.txt /*convert-to-XML*
|
||||
convert_legacy_function_to_vim9 vim9.txt /*convert_legacy_function_to_vim9*
|
||||
copy() builtin.txt /*copy()*
|
||||
copy-diffs diff.txt /*copy-diffs*
|
||||
copy-move change.txt /*copy-move*
|
||||
@ -6855,7 +7027,7 @@ function-range-example eval.txt /*function-range-example*
|
||||
function-search-undo eval.txt /*function-search-undo*
|
||||
function_key intro.txt /*function_key*
|
||||
functions eval.txt /*functions*
|
||||
fuzzy-match pattern.txt /*fuzzy-match*
|
||||
fuzzy-matching pattern.txt /*fuzzy-matching*
|
||||
fvwm.vim syntax.txt /*fvwm.vim*
|
||||
fvwm2rc syntax.txt /*fvwm2rc*
|
||||
fvwmrc syntax.txt /*fvwmrc*
|
||||
@ -7666,6 +7838,7 @@ improvements-5 version5.txt /*improvements-5*
|
||||
improvements-6 version6.txt /*improvements-6*
|
||||
improvements-7 version7.txt /*improvements-7*
|
||||
improvements-8 version8.txt /*improvements-8*
|
||||
improvements-9 version9.txt /*improvements-9*
|
||||
in_bot channel.txt /*in_bot*
|
||||
in_buf channel.txt /*in_buf*
|
||||
in_io-buffer channel.txt /*in_io-buffer*
|
||||
@ -7681,6 +7854,7 @@ incompatible-5 version5.txt /*incompatible-5*
|
||||
incompatible-6 version6.txt /*incompatible-6*
|
||||
incompatible-7 version7.txt /*incompatible-7*
|
||||
incompatible-8 version8.txt /*incompatible-8*
|
||||
incompatible-9 version9.txt /*incompatible-9*
|
||||
indent() builtin.txt /*indent()*
|
||||
indent-expression indent.txt /*indent-expression*
|
||||
indent.txt indent.txt /*indent.txt*
|
||||
@ -8389,6 +8563,7 @@ new-5 version5.txt /*new-5*
|
||||
new-6 version6.txt /*new-6*
|
||||
new-7 version7.txt /*new-7*
|
||||
new-8 version8.txt /*new-8*
|
||||
new-9 version9.txt /*new-9*
|
||||
new-GTK-GUI version5.txt /*new-GTK-GUI*
|
||||
new-MzScheme version7.txt /*new-MzScheme*
|
||||
new-Select-mode version5.txt /*new-Select-mode*
|
||||
@ -8422,6 +8597,7 @@ new-indent-flex version6.txt /*new-indent-flex*
|
||||
new-items-6 version6.txt /*new-items-6*
|
||||
new-items-7 version7.txt /*new-items-7*
|
||||
new-items-8 version8.txt /*new-items-8*
|
||||
new-items-9 version9.txt /*new-items-9*
|
||||
new-line-continuation version5.txt /*new-line-continuation*
|
||||
new-location-list version7.txt /*new-location-list*
|
||||
new-lua version7.txt /*new-lua*
|
||||
@ -8471,6 +8647,7 @@ new-utf-8 version6.txt /*new-utf-8*
|
||||
new-vertsplit version6.txt /*new-vertsplit*
|
||||
new-vim-script version7.txt /*new-vim-script*
|
||||
new-vim-script-8 version8.txt /*new-vim-script-8*
|
||||
new-vim-script-9 version9.txt /*new-vim-script-9*
|
||||
new-vim-server version6.txt /*new-vim-server*
|
||||
new-vimgrep version7.txt /*new-vimgrep*
|
||||
new-vimscript-8.2 version8.txt /*new-vimscript-8.2*
|
||||
@ -8589,7 +8766,8 @@ pascal.vim syntax.txt /*pascal.vim*
|
||||
patches-8 version8.txt /*patches-8*
|
||||
patches-8.1 version8.txt /*patches-8.1*
|
||||
patches-8.2 version8.txt /*patches-8.2*
|
||||
patches-after-8.2 version8.txt /*patches-after-8.2*
|
||||
patches-9 version9.txt /*patches-9*
|
||||
patches-after-8.2 version9.txt /*patches-after-8.2*
|
||||
pathshorten() builtin.txt /*pathshorten()*
|
||||
pattern pattern.txt /*pattern*
|
||||
pattern-atoms pattern.txt /*pattern-atoms*
|
||||
@ -9857,6 +10035,7 @@ terminal.txt terminal.txt /*terminal.txt*
|
||||
terminalprops() builtin.txt /*terminalprops()*
|
||||
terminfo term.txt /*terminfo*
|
||||
termresponse-variable eval.txt /*termresponse-variable*
|
||||
ternary eval.txt /*ternary*
|
||||
test-functions usr_41.txt /*test-functions*
|
||||
test-functions-details testing.txt /*test-functions-details*
|
||||
test_alloc_fail() testing.txt /*test_alloc_fail()*
|
||||
@ -9865,8 +10044,7 @@ test_feedinput() testing.txt /*test_feedinput()*
|
||||
test_garbagecollect_now() testing.txt /*test_garbagecollect_now()*
|
||||
test_garbagecollect_soon() testing.txt /*test_garbagecollect_soon()*
|
||||
test_getvalue() testing.txt /*test_getvalue()*
|
||||
test_gui_drop_files() testing.txt /*test_gui_drop_files()*
|
||||
test_gui_mouse_event() testing.txt /*test_gui_mouse_event()*
|
||||
test_gui_event() testing.txt /*test_gui_event()*
|
||||
test_ignore_error() testing.txt /*test_ignore_error()*
|
||||
test_null_blob() testing.txt /*test_null_blob()*
|
||||
test_null_channel() testing.txt /*test_null_channel()*
|
||||
@ -9879,7 +10057,6 @@ test_null_string() testing.txt /*test_null_string()*
|
||||
test_option_not_set() testing.txt /*test_option_not_set()*
|
||||
test_override() testing.txt /*test_override()*
|
||||
test_refcount() testing.txt /*test_refcount()*
|
||||
test_scrollbar() testing.txt /*test_scrollbar()*
|
||||
test_setmouse() testing.txt /*test_setmouse()*
|
||||
test_settime() testing.txt /*test_settime()*
|
||||
test_srand_seed() testing.txt /*test_srand_seed()*
|
||||
@ -9950,7 +10127,6 @@ tooltips gui.txt /*tooltips*
|
||||
toupper() builtin.txt /*toupper()*
|
||||
tr() builtin.txt /*tr()*
|
||||
trim() builtin.txt /*trim()*
|
||||
trinary eval.txt /*trinary*
|
||||
trojan-horse starting.txt /*trojan-horse*
|
||||
true vim9.txt /*true*
|
||||
true-variable eval.txt /*true-variable*
|
||||
@ -10305,6 +10481,7 @@ version-7.4 version7.txt /*version-7.4*
|
||||
version-8.0 version8.txt /*version-8.0*
|
||||
version-8.1 version8.txt /*version-8.1*
|
||||
version-8.2 version8.txt /*version-8.2*
|
||||
version-9.0 version9.txt /*version-9.0*
|
||||
version-variable eval.txt /*version-variable*
|
||||
version4.txt version4.txt /*version4.txt*
|
||||
version5.txt version5.txt /*version5.txt*
|
||||
@ -10319,6 +10496,8 @@ version8.0 version8.txt /*version8.0*
|
||||
version8.1 version8.txt /*version8.1*
|
||||
version8.2 version8.txt /*version8.2*
|
||||
version8.txt version8.txt /*version8.txt*
|
||||
version9.0 version9.txt /*version9.0*
|
||||
version9.txt version9.txt /*version9.txt*
|
||||
versionlong-variable eval.txt /*versionlong-variable*
|
||||
vi intro.txt /*vi*
|
||||
vi-differences vi_diff.txt /*vi-differences*
|
||||
@ -10334,6 +10513,8 @@ vim-7.4 version7.txt /*vim-7.4*
|
||||
vim-8 version8.txt /*vim-8*
|
||||
vim-8.1 version8.txt /*vim-8.1*
|
||||
vim-8.2 version8.txt /*vim-8.2*
|
||||
vim-9 version9.txt /*vim-9*
|
||||
vim-9.0 version9.txt /*vim-9.0*
|
||||
vim-additions vi_diff.txt /*vim-additions*
|
||||
vim-announce intro.txt /*vim-announce*
|
||||
vim-arguments starting.txt /*vim-arguments*
|
||||
@ -10380,6 +10561,7 @@ vim9-namespace vim9.txt /*vim9-namespace*
|
||||
vim9-no-dict-function vim9.txt /*vim9-no-dict-function*
|
||||
vim9-rationale vim9.txt /*vim9-rationale*
|
||||
vim9-reload vim9.txt /*vim9-reload*
|
||||
vim9-s-namespace vim9.txt /*vim9-s-namespace*
|
||||
vim9-scopes vim9.txt /*vim9-scopes*
|
||||
vim9-script-intro usr_46.txt /*vim9-script-intro*
|
||||
vim9-types vim9.txt /*vim9-types*
|
||||
@ -10537,6 +10719,7 @@ windowid windows.txt /*windowid*
|
||||
windowid-variable eval.txt /*windowid-variable*
|
||||
windows windows.txt /*windows*
|
||||
windows-3.1 os_win32.txt /*windows-3.1*
|
||||
windows-asynchronously os_win32.txt /*windows-asynchronously*
|
||||
windows-icon os_win32.txt /*windows-icon*
|
||||
windows-intro windows.txt /*windows-intro*
|
||||
windows-starting windows.txt /*windows-starting*
|
||||
@ -10710,6 +10893,7 @@ zz scroll.txt /*zz*
|
||||
{offset} pattern.txt /*{offset}*
|
||||
{register} change.txt /*{register}*
|
||||
{rhs} map.txt /*{rhs}*
|
||||
{server} remote.txt /*{server}*
|
||||
{subject} helphelp.txt /*{subject}*
|
||||
{} intro.txt /*{}*
|
||||
} motion.txt /*}*
|
||||
|
@ -724,7 +724,7 @@ matches the pattern "^# *define" it is not considered to be a comment.
|
||||
If you want to list matches, and then select one to jump to, you could use a
|
||||
mapping to do that for you. Here is an example: >
|
||||
|
||||
:map <F4> [I:let nr = input("Which one: ")<Bar>exe "normal " . nr ."[\t"<CR>
|
||||
:map <F4> [I:let nr = input("Which one: ")<Bar>exe "normal " .. nr .. "[\t"<CR>
|
||||
<
|
||||
*[i*
|
||||
[i Display the first line that contains the keyword
|
||||
|
@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 8.2. Last change: 2021 Dec 21
|
||||
*term.txt* For Vim version 8.2. Last change: 2022 Mar 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -725,12 +725,12 @@ size is wrong you can use the 'lines' and 'columns' options to set the
|
||||
correct values.
|
||||
|
||||
One command can be used to set the screen size:
|
||||
|
||||
*:mod* *:mode* *E359*
|
||||
:mod[e] [mode]
|
||||
|
||||
Without argument this only detects the screen size and redraws the screen.
|
||||
[mode] was used on MS-DOS, but it doesn't work anymore.
|
||||
[mode] was used on MS-DOS, but it doesn't work anymore. In |Vim9| this
|
||||
command is not supported.
|
||||
|
||||
==============================================================================
|
||||
4. Slow and fast terminals *slow-fast-terminal*
|
||||
@ -984,7 +984,7 @@ an #if/#else/#endif block, the selection becomes linewise.
|
||||
For MS-Windows and xterm the time for double clicking can be set with the
|
||||
'mousetime' option. For the other systems this time is defined outside of Vim.
|
||||
An example, for using a double click to jump to the tag under the cursor: >
|
||||
:map <2-LeftMouse> :exe "tag ". expand("<cword>")<CR>
|
||||
:map <2-LeftMouse> :exe "tag " .. expand("<cword>")<CR>
|
||||
|
||||
Dragging the mouse with a double click (button-down, button-up, button-down
|
||||
and then drag) will result in whole words to be selected. This continues
|
||||
|
@ -979,8 +979,8 @@ Currently supported commands:
|
||||
< Calls a function defined like this: >
|
||||
function Tapi_Impression(bufnum, arglist)
|
||||
if len(a:arglist) == 2
|
||||
echomsg "impression " . a:arglist[0]
|
||||
echomsg "count " . a:arglist[1]
|
||||
echomsg "impression " .. a:arglist[0]
|
||||
echomsg "count " .. a:arglist[1]
|
||||
endif
|
||||
endfunc
|
||||
< Output from `:echo` may be erased by a redraw, use `:echomsg`
|
||||
|
@ -1,4 +1,4 @@
|
||||
*testing.txt* For Vim version 8.2. Last change: 2022 Jan 20
|
||||
*testing.txt* For Vim version 8.2. Last change: 2022 Feb 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -65,8 +65,9 @@ test_garbagecollect_now() *test_garbagecollect_now()*
|
||||
Like garbagecollect(), but executed right away. This must
|
||||
only be called directly to avoid any structure to exist
|
||||
internally, and |v:testing| must have been set before calling
|
||||
any function. This will not work when called from a :def
|
||||
function, because variables on the stack will be freed.
|
||||
any function. *E1142*
|
||||
This will not work when called from a :def function, because
|
||||
variables on the stack will be freed.
|
||||
|
||||
|
||||
test_garbagecollect_soon() *test_garbagecollect_soon()*
|
||||
@ -82,46 +83,113 @@ test_getvalue({name}) *test_getvalue()*
|
||||
Can also be used as a |method|: >
|
||||
GetName()->test_getvalue()
|
||||
<
|
||||
*test_gui_drop_files()*
|
||||
test_gui_drop_files({list}, {row}, {col}, {mods})
|
||||
Drop one or more files in {list} in the window at {row}, {col}.
|
||||
This function only works when the GUI is running and the
|
||||
|drop_file| feature is present.
|
||||
*test_gui_event()*
|
||||
test_gui_event({event}, {args})
|
||||
Generate a GUI {event} with arguments {args} for testing Vim
|
||||
functionality. This function works only when the GUI is
|
||||
running.
|
||||
|
||||
The supported values for {mods} are:
|
||||
0x4 Shift
|
||||
0x8 Alt
|
||||
0x10 Ctrl
|
||||
The files are added to the |argument-list| and the first file
|
||||
in {list} is edited in the window. See |drag-n-drop| for more
|
||||
information.
|
||||
{event} is a String and the supported values are:
|
||||
"dropfiles" drop one or more files in a window.
|
||||
"findrepl" search and replace text
|
||||
"mouse" mouse button click event.
|
||||
"scrollbar" move or drag the scrollbar
|
||||
"tabline" select a tab page by mouse click.
|
||||
"tabmenu" select a tabline menu entry.
|
||||
|
||||
*test_gui_mouse_event()*
|
||||
test_gui_mouse_event({button}, {row}, {col}, {multiclick}, {modifiers})
|
||||
Inject a mouse button click event. This function only works
|
||||
when the GUI is running.
|
||||
The supported values for {button} are:
|
||||
0 right mouse button
|
||||
1 middle mouse button
|
||||
2 left mouse button
|
||||
3 mouse button release
|
||||
4 scroll wheel down
|
||||
5 scroll wheel up
|
||||
6 scroll wheel left
|
||||
7 scroll wheel right
|
||||
{row} and {col} specify the location of the mouse click. The
|
||||
first row of the Vim window is 1 and the last row is 'lines'.
|
||||
The maximum value of {col} is 'columns'.
|
||||
To inject a multiclick event, set {multiclick} to 1.
|
||||
The supported values for {modifiers} are:
|
||||
4 shift is pressed
|
||||
8 alt is pressed
|
||||
16 ctrl is pressed
|
||||
After injecting the mouse event you probably should call
|
||||
{args} is a Dict and contains the arguments for the event.
|
||||
|
||||
"dropfiles":
|
||||
Drop one or more files in a specified window. The supported
|
||||
items in {args} are:
|
||||
files: List of file names
|
||||
row: window row number
|
||||
col: window column number
|
||||
modifiers: key modifiers. The supported values are:
|
||||
0x4 Shift
|
||||
0x8 Alt
|
||||
0x10 Ctrl
|
||||
The files are added to the |argument-list| and the first
|
||||
file in {files} is edited in the window. See |drag-n-drop|
|
||||
for more information. This event works only when the
|
||||
|drop_file| feature is present.
|
||||
|
||||
"findrepl":
|
||||
{only available when the GUI has a find/replace dialog}
|
||||
Perform a search and replace of text. The supported items
|
||||
in {args} are:
|
||||
find_text: string to find.
|
||||
repl_text: replacement string
|
||||
flags: flags controlling the find/replace. Supported
|
||||
values are:
|
||||
1 search next string (find dialog)
|
||||
2 search next string (replace dialog)
|
||||
3 replace string once
|
||||
4 replace all matches
|
||||
8 match whole words only
|
||||
16 match case
|
||||
forward: set to 1 for forward search.
|
||||
|
||||
"mouse":
|
||||
Inject a mouse button click event. The supported items in
|
||||
{args} are:
|
||||
button: mouse button. The supported values are:
|
||||
0 right mouse button
|
||||
1 middle mouse button
|
||||
2 left mouse button
|
||||
3 mouse button release
|
||||
4 scroll wheel down
|
||||
5 scroll wheel up
|
||||
6 scroll wheel left
|
||||
7 scroll wheel right
|
||||
row: mouse click row number. The first row of the
|
||||
Vim window is 1 and the last row is 'lines'.
|
||||
col: mouse click column number. The maximum value
|
||||
of {col} is 'columns'.
|
||||
multiclick: set to 1 to inject a multiclick mouse event.
|
||||
modifiers: key modifiers. The supported values are:
|
||||
4 shift is pressed
|
||||
8 alt is pressed
|
||||
16 ctrl is pressed
|
||||
|
||||
"scrollbar":
|
||||
Set or drag the left, right or horizontal scrollbar. Only
|
||||
works when the scrollbar actually exists. The supported
|
||||
items in {args} are:
|
||||
which: scrollbar. The supported values are:
|
||||
left Left scrollbar of the current window
|
||||
right Right scrollbar of the current window
|
||||
hor Horizontal scrollbar
|
||||
value: amount to scroll. For the vertical scrollbars
|
||||
the value can be 1 to the line-count of the
|
||||
buffer. For the horizontal scrollbar the
|
||||
value can be between 1 and the maximum line
|
||||
length, assuming 'wrap' is not set.
|
||||
dragging: 1 to drag the scrollbar and 0 to click in the
|
||||
scrollbar.
|
||||
|
||||
"tabline":
|
||||
Inject a mouse click event on the tabline to select a
|
||||
tabpage. The supported items in {args} are:
|
||||
tabnr: tab page number
|
||||
|
||||
"tabmenu":
|
||||
Inject an event to select a tabline menu entry. The
|
||||
supported items in {args} are:
|
||||
tabnr: tab page number
|
||||
item: tab page menu item number. 1 for the first
|
||||
menu item, 2 for the second item and so on.
|
||||
|
||||
After injecting the GUI events you probably should call
|
||||
|feedkeys()| to have them processed, e.g.: >
|
||||
call feedkeys("y", 'Lx!')
|
||||
<
|
||||
Returns TRUE if the event is successfully added, FALSE if
|
||||
there is a failure.
|
||||
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetEvent()->test_gui_event({args})
|
||||
<
|
||||
test_ignore_error({expr}) *test_ignore_error()*
|
||||
Ignore any error containing {expr}. A normal message is given
|
||||
instead.
|
||||
@ -235,27 +303,6 @@ test_refcount({expr}) *test_refcount()*
|
||||
GetVarname()->test_refcount()
|
||||
|
||||
|
||||
test_scrollbar({which}, {value}, {dragging}) *test_scrollbar()*
|
||||
Pretend using scrollbar {which} to move it to position
|
||||
{value}. {which} can be:
|
||||
left Left scrollbar of the current window
|
||||
right Right scrollbar of the current window
|
||||
hor Horizontal scrollbar
|
||||
|
||||
For the vertical scrollbars {value} can be 1 to the
|
||||
line-count of the buffer. For the horizontal scrollbar the
|
||||
{value} can be between 1 and the maximum line length, assuming
|
||||
'wrap' is not set.
|
||||
|
||||
When {dragging} is non-zero it's like dragging the scrollbar,
|
||||
otherwise it's like clicking in the scrollbar.
|
||||
Only works when the {which} scrollbar actually exists,
|
||||
obviously only when using the GUI.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetValue()->test_scrollbar('right', 0)
|
||||
|
||||
|
||||
test_setmouse({row}, {col}) *test_setmouse()*
|
||||
Set the mouse position to be used for the next mouse action.
|
||||
{row} and {col} are one based.
|
||||
@ -372,12 +419,12 @@ assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]])
|
||||
<
|
||||
If {msg} is empty then it is not used. Do this to get the
|
||||
default message when passing the {lnum} argument.
|
||||
|
||||
*E1115*
|
||||
When {lnum} is present and not negative, and the {error}
|
||||
argument is present and matches, then this is compared with
|
||||
the line number at which the error was reported. That can be
|
||||
the line number in a function or in a script.
|
||||
|
||||
*E1116*
|
||||
When {context} is present it is used as a pattern and matched
|
||||
against the context (script name or function name) where
|
||||
{lnum} is located in.
|
||||
|
@ -101,14 +101,14 @@ What you need:
|
||||
create it with the shell command "mkid file1 file2 ..".
|
||||
|
||||
Put this in your .vimrc: >
|
||||
map _u :call ID_search()<Bar>execute "/\\<" . g:word . "\\>"<CR>
|
||||
map _n :n<Bar>execute "/\\<" . g:word . "\\>"<CR>
|
||||
map _u :call ID_search()<Bar>execute "/\\<" .. g:word .. "\\>"<CR>
|
||||
map _n :n<Bar>execute "/\\<" .. g:word .. "\\>"<CR>
|
||||
|
||||
function! ID_search()
|
||||
let g:word = expand("<cword>")
|
||||
let x = system("lid --key=none ". g:word)
|
||||
let x = system("lid --key=none " .. g:word)
|
||||
let x = substitute(x, "\n", " ", "g")
|
||||
execute "next " . x
|
||||
execute "next " .. x
|
||||
endfun
|
||||
|
||||
To use it, place the cursor on a word, type "_u" and vim will load the file
|
||||
@ -356,13 +356,13 @@ This mapping will format any bullet list. It requires that there is an empty
|
||||
line above and below each list entry. The expression commands are used to
|
||||
be able to give comments to the parts of the mapping. >
|
||||
|
||||
:let m = ":map _f :set ai<CR>" " need 'autoindent' set
|
||||
:let m = m . "{O<Esc>" " add empty line above item
|
||||
:let m = m . "}{)^W" " move to text after bullet
|
||||
:let m = m . "i <CR> <Esc>" " add space for indent
|
||||
:let m = m . "gq}" " format text after the bullet
|
||||
:let m = m . "{dd" " remove the empty line
|
||||
:let m = m . "5lDJ" " put text after bullet
|
||||
:let m = ":map _f :set ai<CR>" " need 'autoindent' set
|
||||
:let m ..= "{O<Esc>" " add empty line above item
|
||||
:let m ..= "}{)^W" " move to text after bullet
|
||||
:let m ..= "i <CR> <Esc>" " add space for indent
|
||||
:let m ..= "gq}" " format text after the bullet
|
||||
:let m ..= "{dd" " remove the empty line
|
||||
:let m ..= "5lDJ" " put text after bullet
|
||||
:execute m |" define the mapping
|
||||
|
||||
(<> notation |<>|. Note that this is all typed literally. ^W is "^" "W", not
|
||||
@ -514,15 +514,15 @@ A slightly more advanced version is used in the |matchparen| plugin.
|
||||
let c = '\['
|
||||
let c2 = '\]'
|
||||
endif
|
||||
let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' .
|
||||
let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' ..
|
||||
\ '=~? "string\\|comment"'
|
||||
execute 'if' s_skip '| let s_skip = 0 | endif'
|
||||
|
||||
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip)
|
||||
|
||||
if m_lnum > 0 && m_lnum >= line('w0') && m_lnum <= line('w$')
|
||||
exe 'match Search /\(\%' . c_lnum . 'l\%' . c_col .
|
||||
\ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
|
||||
exe 'match Search /\(\%' .. c_lnum .. 'l\%' .. c_col ..
|
||||
\ 'c\)\|\(\%' .. m_lnum .. 'l\%' .. m_col .. 'c\)/'
|
||||
let s:paren_hl_on = 1
|
||||
endif
|
||||
endfunction
|
||||
|
@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.2. Last change: 2022 Jan 22
|
||||
*todo.txt* For Vim version 8.2. Last change: 2022 Mar 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -38,15 +38,33 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Also set the script context for other "expr" options, like for 'foldexpr'?
|
||||
'printexpr' eval_printexpr()
|
||||
"expr:" part of 'spellsuggest eval_spell_expr()
|
||||
Allow for assigning v:null to job/channel/funcref etc.
|
||||
- Check that the declared type is not lost.
|
||||
- Check: var d: dict<func> = {a: function('tr'), b: null}
|
||||
|
||||
Fix that with s being an empty string, this returns TRUE:
|
||||
echo s is null_string
|
||||
|
||||
Make sure null types work to:
|
||||
- assign to a variable
|
||||
- use as an argument
|
||||
- use as default value of optional argument
|
||||
- use as return value
|
||||
- use in a list/dict constant, type is correct
|
||||
- revert comparing with null?
|
||||
|
||||
TODO item in eval.c
|
||||
|
||||
Really drop the Athena GUI? And NeXtaw?
|
||||
|
||||
Once Vim9 is stable:
|
||||
- Add all the error numbers in a good place in documentation.
|
||||
done until E1083
|
||||
- Check code coverage, add more tests if needed.
|
||||
- Use Vim9 for runtime files.
|
||||
- Check code coverage, add more tests if needed.
|
||||
vim9execute.c line 1900
|
||||
vim9expr.c
|
||||
vim9instr.c
|
||||
vim9script.c
|
||||
vim9type.c
|
||||
|
||||
Further Vim9 improvements, possibly after launch:
|
||||
- Check performance with callgrind and kcachegrind.
|
||||
@ -62,6 +80,8 @@ Further Vim9 improvements, possibly after launch:
|
||||
evaluation.
|
||||
Use the location where the option was set for deciding whether it's to be
|
||||
evaluated in Vim9 script context.
|
||||
- Implement "import lazy" - like autoload but with a relative or absolute
|
||||
path. #9595
|
||||
- implement :type
|
||||
- implement :enum
|
||||
- implement :class and :interface: See |vim9-classes|
|
||||
@ -78,6 +98,7 @@ Further Vim9 improvements, possibly after launch:
|
||||
Update list of features to vote on:
|
||||
- multiple cursors
|
||||
- built-in LSP support
|
||||
- start first line halfway
|
||||
|
||||
Popup windows:
|
||||
- Preview popup not properly updated when it overlaps with completion menu.
|
||||
@ -207,6 +228,13 @@ Use CTRL-R to specify the register to use. (#9531)
|
||||
|
||||
Some prompts are not translated: #9495
|
||||
|
||||
Improvement in terminal configuration mess: Request the terminfo entry from
|
||||
the terminal itself. The $TERM value then is only relevant for whether this
|
||||
feature is supported or not. Replaces the xterm mechanism to request each
|
||||
entry separately. #6609
|
||||
Multiplexers (screen, tmux) can request it to the underlaying terminal, and
|
||||
pass it on with modifications.
|
||||
|
||||
Test_communicate_ipv6(): is flaky on many systems
|
||||
Fails in line 64 of Ch_communicate, no exception is thrown.
|
||||
|
||||
@ -235,6 +263,8 @@ Memory leak in test_alot with pyeval() (allocating partial)
|
||||
Memory leak in test_alot with expand()
|
||||
Memory leaks in test_channel? (or is it because of fork())
|
||||
|
||||
PR to support %e and %k in 'errorformat'. #9624
|
||||
|
||||
Idea: when typing ":e /some/dir/" and "dir" does not exist, highlight in red.
|
||||
|
||||
":set &shellpipe" and ":set &shellredir" should use the logic from
|
||||
@ -282,6 +312,9 @@ Probably because it's using MAXCOL. #8238
|
||||
Make "g>" and "g<" in Visual mode move the text right or left.
|
||||
Also for a block selection. #8558
|
||||
|
||||
When using dictionary insert completion with 'ignorecase', the leading capital
|
||||
in a word should be preserved.
|
||||
|
||||
Add optional argument to virtcol() that specifies "start", "cursor" or "end"
|
||||
to tell which value from getvvcol() should be used. (#7964)
|
||||
Value returned by virtcol() changes depending on how lines wrap. This is
|
||||
@ -413,9 +446,6 @@ When editing a file with ":edit" the output of :swapname is relative, while
|
||||
editing it with "vim file" it is absolute. (#355)
|
||||
Which one should it be?
|
||||
|
||||
:map output does not clear the reset of the command line.
|
||||
(#5623, also see #5962)
|
||||
|
||||
Problem with auto-formatting - inserting space and putting cursor before added
|
||||
character. (#6154)
|
||||
|
||||
@ -4835,9 +4865,6 @@ Autocommands:
|
||||
CursorHoldC - CursorHold while command-line editing
|
||||
WinMoved - when windows have been moved around, e.g, ":wincmd J"
|
||||
SearchPost - After doing a search command (e.g. to do "M")
|
||||
PreDirChanged/PostDirChanged
|
||||
- Before/after ":cd" has been used (for changing the
|
||||
window title)
|
||||
ShutDown - when the system is about to shut down
|
||||
InsertCharPost - user typed a character in Insert mode, after inserting
|
||||
the char.
|
||||
|
@ -1,4 +1,4 @@
|
||||
*uganda.txt* For Vim version 8.2. Last change: 2020 Jan 08
|
||||
*uganda.txt* For Vim version 8.2. Last change: 2022 Mar 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -11,9 +11,9 @@ Vim is Charityware. You can use and copy it as much as you like, but you are
|
||||
encouraged to make a donation for needy children in Uganda. Please see |kcc|
|
||||
below or visit the ICCF web site, available at these URLs:
|
||||
|
||||
http://iccf-holland.org/
|
||||
http://www.vim.org/iccf/
|
||||
http://www.iccf.nl/
|
||||
https://iccf-holland.org/
|
||||
https://www.vim.org/iccf/
|
||||
https://www.iccf.nl/
|
||||
|
||||
You can also sponsor the development of Vim. Vim sponsors can vote for
|
||||
features. See |sponsor|. The money goes to Uganda anyway.
|
||||
@ -133,11 +133,12 @@ Kibaale Children's Centre *kcc* *Kibaale* *charity*
|
||||
Kibaale Children's Centre (KCC) is located in Kibaale, a small town in the
|
||||
south of Uganda, near Tanzania, in East Africa. The area is known as Rakai
|
||||
District. The population is mostly farmers. Although people are poor, there
|
||||
is enough food. But this district is suffering from AIDS more than any other
|
||||
part of the world. Some say that it started there. Estimations are that 10
|
||||
to 30% of the Ugandans are infected with HIV. Because parents die, there are
|
||||
many orphans. In this district about 60,000 children have lost one or both
|
||||
parents, out of a population of 350,000. And this is still continuing.
|
||||
usually is enough food. But this district is suffering from AIDS more than
|
||||
any other part of the world. Some say that it started there. Estimations are
|
||||
that in the past 10 to 30% of the Ugandans are infected with HIV. Because
|
||||
parents die, there are many orphans. In this district about 60,000 children
|
||||
have lost one or both parents, out of a population of 350,000. Although AIDS
|
||||
is now mostly under control, the problems are still continuing.
|
||||
|
||||
The children need a lot of help. The KCC is working hard to provide the needy
|
||||
with food, medical care and education. Food and medical care to keep them
|
||||
@ -169,10 +170,11 @@ households are stimulated to build a proper latrine. I helped setting up a
|
||||
production site for cement slabs. These are used to build a good latrine.
|
||||
They are sold below cost price.
|
||||
|
||||
There is a small clinic at the project, which provides children and their
|
||||
family with medical help. When needed, transport to a hospital is offered.
|
||||
Immunization programs are carried out and help is provided when an epidemic is
|
||||
breaking out (measles and cholera have been a problem).
|
||||
There is a clinic at the project, which provides children and their family
|
||||
medical help. Since 2020 a maternity ward was added and 24/7 service is
|
||||
available. When needed, transport to a hospital is offered. Immunization
|
||||
programs are carried out and help is provided when an epidemic is breaking out
|
||||
(measles and cholera have been a problem).
|
||||
*donate*
|
||||
Summer 1994 to summer 1995 I spent a whole year at the centre, working as a
|
||||
volunteer. I have helped to expand the centre and worked in the area of water
|
||||
@ -214,44 +216,29 @@ Check the ICCF web site for the latest information! See |iccf| for the URL.
|
||||
|
||||
|
||||
USA: The methods mentioned below can be used.
|
||||
Sending a check to the Nehemiah Group Outreach Society (NGOS)
|
||||
is no longer possible, unfortunately. We are looking for
|
||||
another way to get you an IRS tax receipt.
|
||||
For sponsoring a child contact KCF in Canada (see below). US
|
||||
checks can be sent to them to lower banking costs.
|
||||
If you must send a check send it to our Canadian partner:
|
||||
https://www.kuwasha.net/
|
||||
|
||||
Canada: Contact Kibaale Children's Fund (KCF) in Surrey, Canada. They
|
||||
take care of the Canadian sponsors for the children in
|
||||
Kibaale. KCF forwards 100% of the money to the project in
|
||||
Uganda. You can send them a one time donation directly.
|
||||
Canada: Contact Kuwasha in Surrey, Canada. They take care of the
|
||||
Canadian sponsors for the children in Kibaale. Kuwasha
|
||||
forwards 100% of the money to the project in Uganda. You can
|
||||
send them a one time donation directly.
|
||||
Please send me a note so that I know what has been donated
|
||||
because of Vim. Ask KCF for information about sponsorship.
|
||||
Kibaale Children's Fund c/o Pacific Academy
|
||||
10238-168 Street
|
||||
Surrey, B.C. V4N 1Z4
|
||||
Canada
|
||||
Phone: 604-581-5353
|
||||
If you make a donation to Kibaale Children's Fund (KCF) you
|
||||
will receive a tax receipt which can be submitted with your
|
||||
tax return.
|
||||
because of Vim. Look on their site for information about
|
||||
sponsorship: https://www.kuwasha.net/
|
||||
If you make a donation to Kuwasha you will receive a tax
|
||||
receipt which can be submitted with your tax return.
|
||||
|
||||
Holland: Transfer to the account of "Stichting ICCF Holland" in Lisse.
|
||||
This will allow for tax deduction if you live in Holland.
|
||||
Postbank, nr. 4548774
|
||||
IBAN: NL95 INGB 0004 5487 74
|
||||
Holland: Transfer to the account of "Stichting ICCF Holland" in
|
||||
Amersfoort. This will allow for tax deduction if you live in
|
||||
Holland. ING bank, IBAN: NL95 INGB 0004 5487 74
|
||||
|
||||
Germany: It is possible to make donations that allow for a tax return.
|
||||
Check the ICCF web site for the latest information:
|
||||
http://iccf-holland.org/germany.html
|
||||
https://iccf-holland.org/germany.html
|
||||
|
||||
World: Use a postal money order. That should be possible from any
|
||||
country, mostly from the post office. Use this name (which is
|
||||
in my passport): "Abraham Moolenaar". Use Euro for the
|
||||
currency if possible.
|
||||
|
||||
Europe: Use a bank transfer if possible. Your bank should have a form
|
||||
that you can use for this. See "Others" below for the swift
|
||||
code and IBAN number.
|
||||
Europe: Use a bank transfer if possible. See "Others" below for the
|
||||
swift code and IBAN number.
|
||||
Any other method should work. Ask for information about
|
||||
sponsorship.
|
||||
|
||||
@ -261,28 +248,12 @@ Credit Card: You can use PayPal to send money with a Credit card. This is
|
||||
https://www.paypal.com/en_US/mrb/pal=XAC62PML3GF8Q
|
||||
The e-mail address for sending the money to is:
|
||||
Bram@iccf-holland.org
|
||||
For amounts above 400 Euro ($500) sending a check is
|
||||
preferred.
|
||||
|
||||
Others: Transfer to one of these accounts if possible:
|
||||
Postbank, account 4548774
|
||||
Swift code: INGB NL 2A
|
||||
IBAN: NL95 INGB 0004 5487 74
|
||||
under the name "stichting ICCF Holland", Lisse
|
||||
If that doesn't work:
|
||||
Rabobank Lisse, account 3765.05.117
|
||||
Swift code: RABO NL 2U
|
||||
under the name "Bram Moolenaar", Lisse
|
||||
Otherwise, send a check in euro or US dollars to the address
|
||||
below. Minimal amount: $70 (my bank does not accept smaller
|
||||
amounts for foreign check, sorry)
|
||||
Others: Transfer to this account if possible:
|
||||
ING bank: IBAN: NL95 INGB 0004 5487 74
|
||||
Swift code: INGBNL2A
|
||||
under the name "stichting ICCF Holland", Amersfoort
|
||||
Checks are not accepted.
|
||||
|
||||
Address to send checks to:
|
||||
Bram Moolenaar
|
||||
Finsterruetihof 1
|
||||
8134 Adliswil
|
||||
Switzerland
|
||||
|
||||
This address is expected to be valid for a long time.
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
@ -286,12 +286,12 @@ history file. E.g.: >
|
||||
au BufReadPost * call ReadUndo()
|
||||
au BufWritePost * call WriteUndo()
|
||||
func ReadUndo()
|
||||
if filereadable(expand('%:h'). '/UNDO/' . expand('%:t'))
|
||||
if filereadable(expand('%:h') .. '/UNDO/' .. expand('%:t'))
|
||||
rundo %:h/UNDO/%:t
|
||||
endif
|
||||
endfunc
|
||||
func WriteUndo()
|
||||
let dirname = expand('%:h') . '/UNDO'
|
||||
let dirname = expand('%:h') .. '/UNDO'
|
||||
if !isdirectory(dirname)
|
||||
call mkdir(dirname)
|
||||
endif
|
||||
|
@ -270,7 +270,7 @@ line break. Revert with ":iunmap <C-U>".
|
||||
Enable using the mouse if available. See 'mouse'.
|
||||
|
||||
>
|
||||
vnoremap _g y:exe "grep /" . escape(@", '\\/') . "/ *.c *.h"<CR>
|
||||
vnoremap _g y:exe "grep /" .. escape(@", '\\/') .. "/ *.c *.h"<CR>
|
||||
|
||||
This mapping yanks the visually selected text and searches for it in C files.
|
||||
You can see that a mapping can be used to do quite complicated things. Still,
|
||||
|
@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2022 Jan 01
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2022 Feb 11
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@ -162,7 +162,7 @@ and avoid errors. Such as thinking that the "-0o36" above makes the number
|
||||
negative, while it is actually seen as a subtraction.
|
||||
|
||||
To actually have the minus sign be used for negation, you can put the second
|
||||
expression in parenthesis: >
|
||||
expression in parentheses: >
|
||||
|
||||
echo -0x7f (-0o36)
|
||||
|
||||
@ -1116,8 +1116,7 @@ Testing: *test-functions*
|
||||
test_garbagecollect_now() free memory right now
|
||||
test_garbagecollect_soon() set a flag to free memory soon
|
||||
test_getvalue() get value of an internal variable
|
||||
test_gui_drop_files() drop file(s) in a window
|
||||
test_gui_mouse_event() add a GUI mouse event to the input buffer
|
||||
test_gui_event() generate a GUI event for testing
|
||||
test_ignore_error() ignore a specific error message
|
||||
test_null_blob() return a null Blob
|
||||
test_null_channel() return a null Channel
|
||||
@ -1131,7 +1130,6 @@ Testing: *test-functions*
|
||||
test_setmouse() set the mouse position
|
||||
test_feedinput() add key sequence to input buffer
|
||||
test_option_not_set() reset flag indicating option was set
|
||||
test_scrollbar() simulate scrollbar movement in the GUI
|
||||
test_refcount() return an expression's reference count
|
||||
test_srand_seed() set the seed value for srand()
|
||||
test_unknown() return a value with unknown type
|
||||
@ -2502,7 +2500,7 @@ When the user does ":setfiletype xyz" the effect of the previous filetype
|
||||
should be undone. Set the b:undo_ftplugin variable to the commands that will
|
||||
undo the settings in your filetype plugin. Example: >
|
||||
|
||||
b:undo_ftplugin = "setlocal fo< com< tw< commentstring<"
|
||||
let b:undo_ftplugin = "setlocal fo< com< tw< commentstring<"
|
||||
\ .. "| unlet b:match_ignorecase b:match_words b:match_skip"
|
||||
|
||||
Using ":setlocal" with "<" after the option name resets the option to its
|
||||
@ -2514,6 +2512,8 @@ continuation, as mentioned above |use-cpo-save|.
|
||||
For undoing the effect of an indent script, the b:undo_indent variable should
|
||||
be set accordingly.
|
||||
|
||||
Both these variables use legacy script syntax, not |Vim9| syntax.
|
||||
|
||||
|
||||
FILE NAME
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 8.2. Last change: 2022 Jan 15
|
||||
*various.txt* For Vim version 8.2. Last change: 2022 Mar 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -114,6 +114,7 @@ g8 Print the hex values of the bytes used in the
|
||||
:[range]P[rint] [count] [flags]
|
||||
Just as ":print". Was apparently added to Vi for
|
||||
people that keep the shift key pressed too long...
|
||||
This command is not supported in |Vim9| script.
|
||||
Note: A user command can overrule this command.
|
||||
See |ex-flags| for [flags].
|
||||
|
||||
@ -267,7 +268,7 @@ g8 Print the hex values of the bytes used in the
|
||||
name does not contain a single quote: >
|
||||
:!ls '%'
|
||||
< This should always work, but it's more typing: >
|
||||
:exe "!ls " . shellescape(expand("%"))
|
||||
:exe "!ls " .. shellescape(expand("%"))
|
||||
< To get a literal "%" or "#" prepend it with a
|
||||
backslash. For example, to list all files starting
|
||||
with "%": >
|
||||
@ -410,6 +411,7 @@ T *+mouse* Mouse handling |mouse-using|
|
||||
N *+mouseshape* |'mouseshape'|
|
||||
B *+mouse_dec* Unix only: Dec terminal mouse handling |dec-mouse|
|
||||
N *+mouse_gpm* Unix only: Linux console mouse handling |gpm-mouse|
|
||||
m *+mouse_gpm/dyn* Same as |+mouse_gpm| with optional library dependency |/dyn|
|
||||
N *+mouse_jsbterm* JSB mouse handling |jsbterm-mouse|
|
||||
B *+mouse_netterm* Unix only: netterm mouse handling |netterm-mouse|
|
||||
N *+mouse_pterm* QNX only: pterm mouse handling |qnx-terminal|
|
||||
@ -424,7 +426,7 @@ m *+mzscheme* Mzscheme interface |mzscheme|
|
||||
m *+mzscheme/dyn* Mzscheme interface |mzscheme-dynamic| |/dyn|
|
||||
m *+netbeans_intg* |netbeans|
|
||||
T *+num64* 64-bit Number support |Number|
|
||||
Always enabled since 8.2.0271, use v:numbersize to
|
||||
Always enabled since 8.2.0271, use v:numbersize to
|
||||
check the actual size of a Number.
|
||||
m *+ole* Win32 GUI only: |ole-interface|
|
||||
N *+packages* Loading |packages|
|
||||
@ -549,7 +551,7 @@ N *+X11* Unix only: can restore window title |X11|
|
||||
backward compatibility, the ">" after the register
|
||||
name can be omitted.
|
||||
:redi[r] @">> Append messages to the unnamed register.
|
||||
|
||||
*E1092*
|
||||
:redi[r] => {var} Redirect messages to a variable.
|
||||
In legacy script: If the variable doesn't exist, then
|
||||
it is created. If the variable exists, then it is
|
||||
@ -566,7 +568,7 @@ N *+X11* Unix only: can restore window title |X11|
|
||||
|
||||
:redi[r] =>> {var} Append messages to an existing variable. Only string
|
||||
variables can be used.
|
||||
|
||||
*E1185*
|
||||
:redi[r] END End redirecting messages.
|
||||
|
||||
*:filt* *:filter*
|
||||
@ -649,7 +651,7 @@ N *+X11* Unix only: can restore window title |X11|
|
||||
used. In this example |:silent| is used to avoid the
|
||||
message about reading the file and |:unsilent| to be
|
||||
able to list the first line of each file. >
|
||||
:silent argdo unsilent echo expand('%') . ": " . getline(1)
|
||||
:silent argdo unsilent echo expand('%') .. ": " .. getline(1)
|
||||
<
|
||||
|
||||
*:verb* *:verbose*
|
||||
|
@ -14965,7 +14965,7 @@ Solution: Adjust autoconf. (lilydjwg)
|
||||
Files: src/configure.in, src/auto/configure
|
||||
|
||||
Patch 7.3.806
|
||||
Problem: Compiler warnings in Perl code when building with Visual studio
|
||||
Problem: Compiler warnings in Perl code when building with Visual Studio
|
||||
2012. (skeept)
|
||||
Solution: Add type casts. (Christian Brabandt, 2013 Jan 30)
|
||||
Files: src/if_perl.xs
|
||||
|
File diff suppressed because it is too large
Load Diff
26927
runtime/doc/version9.txt
Normal file
26927
runtime/doc/version9.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
.TH VIM 1 "2006 Apr 11"
|
||||
.TH VIM 1 "2021 Jun 13"
|
||||
.SH 名前
|
||||
vim \- Vi IMproved, プログラマのテキストエディタ
|
||||
.SH 書式
|
||||
|
@ -1,4 +1,4 @@
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2022 Jan 23
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2022 Mar 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -56,14 +56,14 @@ Vim9 script and legacy Vim script can be mixed. There is no requirement to
|
||||
rewrite old scripts, they keep working as before. You may want to use a few
|
||||
`:def` functions for code that needs to be fast.
|
||||
|
||||
:vim9[cmd] {cmd} *:vim9* *:vim9cmd*
|
||||
Execute {cmd} using Vim9 script syntax and semantics.
|
||||
Useful when typing a command and in a legacy script or
|
||||
function.
|
||||
:vim9[cmd] {cmd} *:vim9* *:vim9cmd* *E1164*
|
||||
Evaluate and execute {cmd} using Vim9 script syntax and
|
||||
semantics. Useful when typing a command and in a legacy
|
||||
script or function.
|
||||
|
||||
:leg[acy] {cmd} *:leg* *:legacy*
|
||||
Execute {cmd} using legacy script syntax and semantics. Only
|
||||
useful in a Vim9 script or a :def function.
|
||||
:leg[acy] {cmd} *:leg* *:legacy* *E1189* *E1234*
|
||||
Evaluate and execute {cmd} using legacy script syntax and
|
||||
semantics. Only useful in a Vim9 script or a :def function.
|
||||
Note that {cmd} cannot use local variables, since it is parsed
|
||||
with legacy expression syntax.
|
||||
|
||||
@ -72,7 +72,7 @@ rewrite old scripts, they keep working as before. You may want to use a few
|
||||
2. Differences from legacy Vim script *vim9-differences*
|
||||
|
||||
Overview ~
|
||||
|
||||
*E1146*
|
||||
Brief summary of the differences you will most often encounter when using Vim9
|
||||
script and `:def` functions; details are below:
|
||||
- Comments start with #, not ": >
|
||||
@ -82,7 +82,7 @@ script and `:def` functions; details are below:
|
||||
.. yourName
|
||||
.. ", how are you?"
|
||||
- White space is required in many places to improve readability.
|
||||
- Assign values without `:let`, declare variables with `:var`: >
|
||||
- Assign values without `:let` *E1126* , declare variables with `:var`: >
|
||||
var count = 0
|
||||
count += 3
|
||||
- Constants can be declared with `:final` and `:const`: >
|
||||
@ -94,8 +94,20 @@ script and `:def` functions; details are below:
|
||||
def CallMe(count: number, message: string): bool
|
||||
- Call functions without `:call`: >
|
||||
writefile(['done'], 'file.txt')
|
||||
- You cannot use old Ex commands `:xit`, `:t`, `:k`, `:append`, `:change`,
|
||||
`:insert`, `:open`, and `:s` or `:d` with only flags.
|
||||
- You cannot use old Ex commands:
|
||||
`:Print`
|
||||
`:append`
|
||||
`:change`
|
||||
`:d` directly followed by 'd' or 'p'.
|
||||
`:insert`
|
||||
`:k`
|
||||
`:mode`
|
||||
`:open`
|
||||
`:s` with only flags
|
||||
`:t`
|
||||
`:xit`
|
||||
- Some commands, especially those used for flow control, cannot be shortened.
|
||||
E.g., `:throw` cannot be written as `:th`. *E839*
|
||||
- You cannot use curly-braces names.
|
||||
- A range before a command must be prefixed with a colon: >
|
||||
:%s/this/that
|
||||
@ -128,7 +140,7 @@ To improve readability there must be a space between a command and the #
|
||||
that starts a comment: >
|
||||
var name = value # comment
|
||||
var name = value# error!
|
||||
|
||||
< *E1170*
|
||||
Do not start a comment with #{, it looks like the legacy dictionary literal
|
||||
and produces an error where this might be confusing. #{{ or #{{{ are OK,
|
||||
these can be used to start a fold.
|
||||
@ -139,7 +151,7 @@ arguments).
|
||||
|
||||
|
||||
Vim9 functions ~
|
||||
|
||||
*E1099*
|
||||
A function defined with `:def` is compiled. Execution is many times faster,
|
||||
often 10 to 100 times.
|
||||
|
||||
@ -153,7 +165,7 @@ Compilation is done when any of these is encountered:
|
||||
- `:disassemble` is used for the function.
|
||||
- a function that is compiled calls the function or uses it as a function
|
||||
reference (so that the argument and return types can be checked)
|
||||
*E1091*
|
||||
*E1091* *E1191*
|
||||
If compilation fails it is not tried again on the next call, instead this
|
||||
error is given: "E1091: Function is not compiled: {name}".
|
||||
Compilation will fail when encountering a user command that has not been
|
||||
@ -183,14 +195,14 @@ You can call a legacy dict function though: >
|
||||
var d = {func: Legacy, value: 'text'}
|
||||
d.func()
|
||||
enddef
|
||||
|
||||
< *E1096* *E1174* *E1175*
|
||||
The argument types and return type need to be specified. The "any" type can
|
||||
be used, type checking will then be done at runtime, like with legacy
|
||||
functions.
|
||||
|
||||
*E1106*
|
||||
Arguments are accessed by name, without "a:", just like any other language.
|
||||
There is no "a:" dictionary or "a:000" list.
|
||||
*vim9-variable-arguments* *E1055*
|
||||
*vim9-variable-arguments* *E1055* *E1160* *E1180*
|
||||
Variable arguments are defined as the last argument, with a name and have a
|
||||
list type, similar to TypeScript. For example, a list of numbers: >
|
||||
def MyFunc(...itemlist: list<number>)
|
||||
@ -206,7 +218,7 @@ should use its default value. Example: >
|
||||
enddef
|
||||
MyFunc(v:none, 'LAST') # first argument uses default value 'one'
|
||||
<
|
||||
*vim9-ignored-argument*
|
||||
*vim9-ignored-argument* *E1181*
|
||||
The argument "_" (an underscore) can be used to ignore the argument. This is
|
||||
most useful in callbacks where you don't need it, but do need to give an
|
||||
argument to match the call. E.g. when using map() two arguments are passed,
|
||||
@ -219,34 +231,47 @@ be given.
|
||||
Functions and variables are script-local by default ~
|
||||
*vim9-scopes*
|
||||
When using `:function` or `:def` to specify a new function at the script level
|
||||
in a Vim9 script, the function is local to the script, as if "s:" was
|
||||
prefixed. Using the "s:" prefix is optional. To define a global function or
|
||||
variable the "g:" prefix must be used. For functions in an autoload script
|
||||
the "name#" prefix is sufficient. >
|
||||
in a Vim9 script, the function is local to the script. Like prefixing "s:" in
|
||||
legacy script. To define a global function or variable the "g:" prefix must
|
||||
be used. For functions in a script that is to be imported and in an autoload
|
||||
script "export" needs to be used. >
|
||||
def ThisFunction() # script-local
|
||||
def s:ThisFunction() # script-local
|
||||
def g:ThatFunction() # global
|
||||
def scriptname#function() # autoload
|
||||
export def Function() # for import and import autoload
|
||||
< *E1058* *E1075*
|
||||
When using `:function` or `:def` to specify a nested function inside a `:def`
|
||||
function and no namespace was given, this nested function is local to the code
|
||||
block it is defined in. In a `:def` function it is not possible to define a
|
||||
script-local function. It is possible to define a global function by using
|
||||
the "g:" prefix.
|
||||
block it is defined in. It cannot be used in `function()` with a string
|
||||
argument, pass the function reference itself: >
|
||||
def Outer()
|
||||
def Inner()
|
||||
echo 'inner'
|
||||
enddef
|
||||
var Fok = function(Inner) # OK
|
||||
var Fbad = function('Inner') # does not work
|
||||
|
||||
It is not possible to define a script-local function. It is possible to
|
||||
define a global function by using the "g:" prefix.
|
||||
|
||||
When referring to a function and no "s:" or "g:" prefix is used, Vim will
|
||||
search for the function:
|
||||
- in the function scope, in block scopes
|
||||
- in the script scope, possibly imported
|
||||
- in the list of global functions
|
||||
However, it is recommended to always use "g:" to refer to a global function
|
||||
for clarity.
|
||||
|
||||
Since a script-local function reference can be used without "s:" the name must
|
||||
start with an upper case letter even when using the "s:" prefix. In legacy
|
||||
script "s:funcref" could be used, because it could not be referred to with
|
||||
"funcref". In Vim9 script it can, therefore "s:Funcref" must be used to avoid
|
||||
that the name interferes with builtin functions.
|
||||
*vim9-s-namespace*
|
||||
The use of the "s:" prefix is not supported at the Vim9 script level. All
|
||||
functions and variables without a prefix are script-local.
|
||||
|
||||
In :def functions the use of "s:" depends on the script: Script-local
|
||||
variables and functions in a legacy script do use "s:", while in a Vim9 script
|
||||
they do not use "s:". This matches what you see in the rest of the file.
|
||||
|
||||
In legacy functions the use of "s:" for script items is required, as before.
|
||||
|
||||
In all cases the function must be defined before used. That is when it is
|
||||
called, when `:defcompile` causes it to be compiled, or when code that calls
|
||||
@ -255,7 +280,7 @@ it is being compiled (to figure out the return type).
|
||||
The result is that functions and variables without a namespace can usually be
|
||||
found in the script, either defined there or imported. Global functions and
|
||||
variables could be defined anywhere (good luck finding out where!).
|
||||
|
||||
*E1102*
|
||||
Global functions can still be defined and deleted at nearly any time. In
|
||||
Vim9 script script-local functions are defined once when the script is sourced
|
||||
and cannot be deleted or replaced.
|
||||
@ -267,7 +292,7 @@ You can use an autoload function if needed, or call a legacy function and have
|
||||
|
||||
|
||||
Reloading a Vim9 script clears functions and variables by default ~
|
||||
*vim9-reload*
|
||||
*vim9-reload* *E1149* *E1150*
|
||||
When loading a legacy Vim script a second time nothing is removed, the
|
||||
commands will replace existing variables and functions and create new ones.
|
||||
|
||||
@ -280,17 +305,20 @@ If you do want to keep items, use: >
|
||||
vim9script noclear
|
||||
|
||||
You want to use this in scripts that use a `finish` command to bail out at
|
||||
some point when loaded again. E.g. when a buffer local option is set: >
|
||||
some point when loaded again. E.g. when a buffer local option is set to a
|
||||
function, the function does not need to be defined more than once: >
|
||||
vim9script noclear
|
||||
setlocal completefunc=SomeFunc
|
||||
if exists('*g:SomeFunc') | finish | endif
|
||||
def g:SomeFunc()
|
||||
if exists('*SomeFunc')
|
||||
finish
|
||||
endif
|
||||
def SomeFunc()
|
||||
....
|
||||
|
||||
|
||||
Variable declarations with :var, :final and :const ~
|
||||
*vim9-declaration* *:var*
|
||||
*E1017* *E1020* *E1054*
|
||||
*vim9-declaration* *:var* *E1079*
|
||||
*E1017* *E1020* *E1054* *E1087* *E1108* *E1124*
|
||||
Local variables need to be declared with `:var`. Local constants need to be
|
||||
declared with `:final` or `:const`. We refer to both as "variables" in this
|
||||
section.
|
||||
@ -321,7 +349,7 @@ The declaration must be done earlier: >
|
||||
inner = 0
|
||||
endif
|
||||
echo inner
|
||||
< *E1025*
|
||||
< *E1025* *E1128*
|
||||
To intentionally hide a variable from code that follows, a block can be
|
||||
used: >
|
||||
{
|
||||
@ -348,7 +376,8 @@ And with autocommands: >
|
||||
}
|
||||
|
||||
Although using a :def function probably works better.
|
||||
*E1022*
|
||||
*E1022* *E1103* *E1130* *E1131* *E1133*
|
||||
*E1134* *E1235*
|
||||
Declaring a variable with a type but without an initializer will initialize to
|
||||
false (for bool), empty (for string, list, dict, etc.) or zero (for number,
|
||||
any, etc.). This matters especially when using the "any" type, the value will
|
||||
@ -358,13 +387,16 @@ In Vim9 script `:let` cannot be used. An existing variable is assigned to
|
||||
without any command. The same for global, window, tab, buffer and Vim
|
||||
variables, because they are not really declared. Those can also be deleted
|
||||
with `:unlet`.
|
||||
|
||||
*E1065*
|
||||
You cannot use `:va` to declare a variable, it must be written with the full
|
||||
name `:var`. Just to make sure it is easy to read.
|
||||
*E1178*
|
||||
`:lockvar` does not work on local variables. Use `:const` and `:final`
|
||||
instead.
|
||||
|
||||
The `exists()` and `exists_compiled()` functions do not work on local variables
|
||||
or arguments.
|
||||
*E1006* *E1041*
|
||||
*E1006* *E1041* *E1167* *E1168* *E1213*
|
||||
Variables, functions and function arguments cannot shadow previously defined
|
||||
or imported variables and functions in the same script file.
|
||||
Variables may shadow Ex commands, rename the variable if needed.
|
||||
@ -375,13 +407,12 @@ Global variables must be prefixed with "g:", also at the script level. >
|
||||
g:global = 'value'
|
||||
var Funcref = g:ThatFunction
|
||||
|
||||
Global functions must be prefixed with "g:" when defining them, but can be
|
||||
called without "g:". >
|
||||
Global functions must be prefixed with "g:": >
|
||||
vim9script
|
||||
def g:GlobalFunc(): string
|
||||
return 'text'
|
||||
enddef
|
||||
echo GlobalFunc()
|
||||
echo g:GlobalFunc()
|
||||
The "g:" prefix is not needed for auto-load functions.
|
||||
|
||||
*vim9-function-defined-later*
|
||||
@ -418,7 +449,7 @@ similar to how a function argument can be ignored: >
|
||||
[a, _, c] = theList
|
||||
To ignore any remaining items: >
|
||||
[a, b; _] = longList
|
||||
|
||||
< *E1163* *E1080*
|
||||
Declaring more than one variable at a time, using the unpack notation, is
|
||||
possible. Each variable can have a type or infer it from the value: >
|
||||
var [v1: number, v2] = GetValues()
|
||||
@ -440,7 +471,7 @@ Example: >
|
||||
myList = [3, 4] # Error!
|
||||
myList[0] = 9 # Error!
|
||||
myList->add(3) # Error!
|
||||
< *:final*
|
||||
< *:final* *E1125*
|
||||
`:final` is used for making only the variable a constant, the value can be
|
||||
changed. This is well known from Java. Example: >
|
||||
final myList = [1, 2]
|
||||
@ -460,7 +491,7 @@ The constant only applies to the value itself, not what it refers to. >
|
||||
|
||||
|
||||
Omitting :call and :eval ~
|
||||
|
||||
*E1190*
|
||||
Functions can be called without `:call`: >
|
||||
writefile(lines, 'file')
|
||||
Using `:call` is still possible, but this is discouraged.
|
||||
@ -520,7 +551,8 @@ because of the use of argument types.
|
||||
To avoid these problems Vim9 script uses a different syntax for a lambda,
|
||||
which is similar to JavaScript: >
|
||||
var Lambda = (arg) => expression
|
||||
|
||||
var Lambda = (arg): type => expression
|
||||
< *E1157*
|
||||
No line break is allowed in the arguments of a lambda up to and including the
|
||||
"=>" (so that Vim can tell the difference between an expression in parentheses
|
||||
and lambda arguments). This is OK: >
|
||||
@ -536,7 +568,7 @@ But you can use a backslash to concatenate the lines before parsing: >
|
||||
filter(list, (k,
|
||||
\ v)
|
||||
\ => v > 0)
|
||||
< *vim9-lambda-arguments*
|
||||
< *vim9-lambda-arguments* *E1172*
|
||||
In legacy script a lambda could be called with any number of extra arguments,
|
||||
there was no way to warn for not using them. In Vim9 script the number of
|
||||
arguments must match. If you do want to accept any arguments, or any further
|
||||
@ -545,7 +577,7 @@ arguments, use "..._", which makes the function accept
|
||||
var Callback = (..._) => 'anything'
|
||||
echo Callback(1, 2, 3) # displays "anything"
|
||||
|
||||
< *inline-function*
|
||||
< *inline-function* *E1171*
|
||||
Additionally, a lambda can contain statements in {}: >
|
||||
var Lambda = (arg) => {
|
||||
g:was_called = 'yes'
|
||||
@ -600,7 +632,7 @@ Also when confused with the start of a command block: >
|
||||
|
||||
|
||||
Automatic line continuation ~
|
||||
*vim9-line-continuation*
|
||||
*vim9-line-continuation* *E1097*
|
||||
In many cases it is obvious that an expression continues on the next line. In
|
||||
those cases there is no need to prefix the line with a backslash (see
|
||||
|line-continuation|). For example, when a list spans multiple lines: >
|
||||
@ -708,6 +740,7 @@ second line is seen as a separate command: >
|
||||
Now "exit_cb: Func})" is actually a valid command: save any changes to the
|
||||
file "_cb: Func})" and exit. To avoid this kind of mistake in Vim9 script
|
||||
there must be white space between most command names and the argument.
|
||||
*E1144*
|
||||
|
||||
However, the argument of a command that is a command won't be recognized. For
|
||||
example, after "windo echo expr" a line break inside "expr" will not be seen.
|
||||
@ -738,7 +771,7 @@ Notes:
|
||||
|
||||
|
||||
White space ~
|
||||
*E1004* *E1068* *E1069* *E1074*
|
||||
*E1004* *E1068* *E1069* *E1074* *E1127* *E1202*
|
||||
Vim9 script enforces proper use of white space. This is no longer allowed: >
|
||||
var name=234 # Error!
|
||||
var name= 234 # Error!
|
||||
@ -772,7 +805,7 @@ White space is not allowed:
|
||||
Func(
|
||||
arg # OK
|
||||
)
|
||||
|
||||
< *E1205*
|
||||
White space is not allowed in a `:set` command between the option name and a
|
||||
following "&", "!", "<", "=", "+=", "-=" or "^=".
|
||||
|
||||
@ -782,6 +815,11 @@ No curly braces expansion ~
|
||||
|curly-braces-names| cannot be used.
|
||||
|
||||
|
||||
Command modifiers are not ignored ~
|
||||
*E1176*
|
||||
Using a command modifier for a command that does not use it gives an error.
|
||||
|
||||
|
||||
Dictionary literals ~
|
||||
*vim9-literal-dict* *E1014*
|
||||
Traditionally Vim has supported dictionary literals with a {} syntax: >
|
||||
@ -803,7 +841,7 @@ use another character, use a single or double quoted string: >
|
||||
var dict = {'key with space': value}
|
||||
var dict = {"key\twith\ttabs": value}
|
||||
var dict = {'': value} # empty key
|
||||
|
||||
< *E1139*
|
||||
In case the key needs to be an expression, square brackets can be used, just
|
||||
like in JavaScript: >
|
||||
var dict = {["key" .. nr]: value}
|
||||
@ -816,7 +854,7 @@ error. A number can be given with and without the []: >
|
||||
|
||||
|
||||
No :xit, :t, :k, :append, :change or :insert ~
|
||||
|
||||
*E1100*
|
||||
These commands are too easily confused with local variable names.
|
||||
Instead of `:x` or `:xit` you can use `:exit`.
|
||||
Instead of `:t` you can use `:copy`.
|
||||
@ -826,6 +864,7 @@ Instead of `:k` you can use `:mark`.
|
||||
Comparators ~
|
||||
|
||||
The 'ignorecase' option is not used for comparators that use strings.
|
||||
Thus "=~" works like "=~#".
|
||||
|
||||
|
||||
Abort after error ~
|
||||
@ -840,7 +879,7 @@ error. Example: >
|
||||
|
||||
|
||||
For loop ~
|
||||
|
||||
*E1254*
|
||||
The loop variable must not be declared yet: >
|
||||
var i = 1
|
||||
for i in [1, 2, 3] # Error!
|
||||
@ -928,10 +967,37 @@ always converted to string: >
|
||||
Simple types are Number, Float, Special and Bool. For other types |string()|
|
||||
should be used.
|
||||
*false* *true* *null* *E1034*
|
||||
In Vim9 script one can use "true" for v:true, "false" for v:false and "null"
|
||||
for v:null. When converting a boolean to a string "false" and "true" are
|
||||
used, not "v:false" and "v:true" like in legacy script. "v:none" is not
|
||||
changed, it is only used in JSON and has no equivalent in other languages.
|
||||
In Vim9 script one can use the following predefined values: >
|
||||
true
|
||||
false
|
||||
null
|
||||
null_blob
|
||||
null_channel
|
||||
null_dict
|
||||
null_function
|
||||
null_job
|
||||
null_list
|
||||
null_partial
|
||||
null_string
|
||||
`true` is the same as `v:true`, `false` the same as `v:false`, `null` the same
|
||||
as `v:null`.
|
||||
|
||||
While `null` has the type "special", the other "null_" types have the type
|
||||
indicated by their name. Quite often a null value is handled the same as an
|
||||
empty value, but not always. The values can be useful to clear a script-local
|
||||
variable, since they cannot be deleted with `:unlet`. E.g.: >
|
||||
var theJob = job_start(...)
|
||||
# let the job do its work
|
||||
theJob = null_job
|
||||
|
||||
The values can also be useful as the default value for an argument: >
|
||||
def MyFunc(b: blob = null_blob)
|
||||
if b == null_blob
|
||||
# b argument was not given
|
||||
|
||||
When converting a boolean to a string `false` and `true` are used, not
|
||||
`v:false` and `v:true` like in legacy script. `v:none` has no `none`
|
||||
replacement, it has no equivalent in other languages.
|
||||
|
||||
Indexing a string with [idx] or taking a slice with [idx : idx] uses character
|
||||
indexes instead of byte indexes. Composing characters are included.
|
||||
@ -1082,7 +1148,7 @@ Using ++var or --var in an expression is not supported yet.
|
||||
{return-type}. When {return-type} is omitted or is
|
||||
"void" the function is not expected to return
|
||||
anything.
|
||||
*E1077*
|
||||
*E1077* *E1123*
|
||||
{arguments} is a sequence of zero or more argument
|
||||
declarations. There are three forms:
|
||||
{name}: {type}
|
||||
@ -1100,13 +1166,13 @@ Using ++var or --var in an expression is not supported yet.
|
||||
|
||||
It is possible to nest `:def` inside another `:def` or
|
||||
`:function` up to about 50 levels deep.
|
||||
|
||||
*E1117*
|
||||
[!] is used as with `:function`. Note that
|
||||
script-local functions cannot be deleted or redefined
|
||||
later in Vim9 script. They can only be removed by
|
||||
reloading the same script.
|
||||
|
||||
*:enddef* *E1057*
|
||||
*:enddef* *E1057* *E1152* *E1173*
|
||||
:enddef End of a function defined with `:def`. It should be on
|
||||
a line by its own.
|
||||
|
||||
@ -1185,6 +1251,67 @@ for each closure call a function to define it: >
|
||||
echo range(5)->map((i, _) => flist[i]())
|
||||
# Result: [0, 1, 2, 3, 4]
|
||||
|
||||
In some situations, especially when calling a Vim9 closure from legacy
|
||||
context, the evaluation will fail. *E1248*
|
||||
|
||||
|
||||
Converting a function from legacy to Vim9 ~
|
||||
*convert_legacy_function_to_vim9*
|
||||
These are the most changes that need to be made to convert a legacy function
|
||||
to a Vim9 function:
|
||||
|
||||
- Change `func` or `function` to `def`.
|
||||
- Change `endfunc` or `endfunction` to `enddef`.
|
||||
- Add types to the function arguments.
|
||||
- If the function returns something, add the return type.
|
||||
- Change comments to start with # instead of ".
|
||||
|
||||
For example, a legacy function: >
|
||||
func MyFunc(text)
|
||||
" function body
|
||||
endfunc
|
||||
< Becomes: >
|
||||
def MyFunc(text: string): number
|
||||
# function body
|
||||
enddef
|
||||
|
||||
- Remove "a:" used for arguments. E.g.: >
|
||||
return len(a:text)
|
||||
< Becomes: >
|
||||
return len(text)
|
||||
|
||||
- Change `let` used to declare a variable to `var`.
|
||||
- Remove `let` used to assign a value to a variable. This is for local
|
||||
variables already declared and b: w: g: and t: variables.
|
||||
|
||||
For example, legacy function: >
|
||||
let lnum = 1
|
||||
let lnum += 3
|
||||
let b:result = 42
|
||||
< Becomes: >
|
||||
var lnum = 1
|
||||
lnum += 3
|
||||
b:result = 42
|
||||
|
||||
- Insert white space in expressions where needed.
|
||||
- Change "." used for concatenation to "..".
|
||||
|
||||
For example, legacy function: >
|
||||
echo line(1).line(2)
|
||||
< Becomes: >
|
||||
echo line(1) .. line(2)
|
||||
|
||||
- line continuation does not always require a backslash: >
|
||||
echo ['one',
|
||||
\ 'two',
|
||||
\ 'three'
|
||||
\ ]
|
||||
< Becomes: >
|
||||
echo ['one',
|
||||
'two',
|
||||
'three'
|
||||
]
|
||||
|
||||
==============================================================================
|
||||
|
||||
4. Types *vim9-types*
|
||||
@ -1211,7 +1338,7 @@ Not supported yet:
|
||||
|
||||
These types can be used in declarations, but no simple value will actually
|
||||
have the "void" type. Trying to use a void (e.g. a function without a
|
||||
return value) results in error *E1031* .
|
||||
return value) results in error *E1031* *E1186* .
|
||||
|
||||
There is no array type, use list<{type}> instead. For a list constant an
|
||||
efficient implementation is used that avoids allocating lot of small pieces of
|
||||
@ -1288,7 +1415,7 @@ expected to always be the same. For example, when declaring a list: >
|
||||
At compile time Vim doesn't know the type of "g:two" and the expression type
|
||||
becomes list<any>. An instruction is generated to check the list type before
|
||||
doing the assignment, which is a bit inefficient.
|
||||
*type-casting*
|
||||
*type-casting* *E1104*
|
||||
To avoid this, use a type cast: >
|
||||
var l: list<number> = [1, <number>g:two]
|
||||
The compiled code will then only check that "g:two" is a number and give an
|
||||
@ -1333,6 +1460,24 @@ Results in:
|
||||
For script-local variables in Vim9 script the type is checked, also when the
|
||||
variable was declared in a legacy function.
|
||||
|
||||
When a type has been declared this is attached to a List or Dictionary. When
|
||||
later some expression attempts to change the type an error will be given: >
|
||||
var ll: list<number> = [1, 2, 3]
|
||||
ll->extend(['x']) # Error, 'x' is not a number
|
||||
|
||||
If the type is not declared then it is allowed to change: >
|
||||
[1, 2, 3]->extend(['x']) # result: [1, 2, 3, 'x']
|
||||
|
||||
For a variable declaration an inferred type matters: >
|
||||
var ll = [1, 2, 3]
|
||||
ll->extend(['x']) # Error, 'x' is not a number
|
||||
That is because the declaration looks like a list of numbers, thus is
|
||||
equivalent to: >
|
||||
var ll: list<number> = [1, 2, 3]
|
||||
If you do want a more permissive list you need to declare the type: >
|
||||
var ll: list<any = [1, 2, 3]
|
||||
ll->extend(['x']) # OK
|
||||
|
||||
|
||||
Stricter type checking ~
|
||||
*type-checking*
|
||||
@ -1340,32 +1485,67 @@ In legacy Vim script, where a number was expected, a string would be
|
||||
automatically converted to a number. This was convenient for an actual number
|
||||
such as "123", but leads to unexpected problems (and no error message) if the
|
||||
string doesn't start with a number. Quite often this leads to hard-to-find
|
||||
bugs.
|
||||
|
||||
bugs. e.g.: >
|
||||
echo 123 == '123'
|
||||
< 1 ~
|
||||
With an accidental space: >
|
||||
echo 123 == ' 123'
|
||||
< 0 ~
|
||||
*E1206* *E1210* *E1212*
|
||||
In Vim9 script this has been made stricter. In most places it works just as
|
||||
before, if the value used matches the expected type. There will sometimes be
|
||||
before if the value used matches the expected type. There will sometimes be
|
||||
an error, thus breaking backwards compatibility. For example:
|
||||
- Using a number other than 0 or 1 where a boolean is expected. *E1023*
|
||||
- Using a string value when setting a number option.
|
||||
- Using a number where a string is expected. *E1024*
|
||||
- Using a number where a string is expected. *E1024* *E1105*
|
||||
|
||||
One consequence is that the item type of a list or dict given to |map()| must
|
||||
not change. This will give an error in Vim9 script: >
|
||||
echo map([1, 2, 3], (i, v) => 'item ' .. i)
|
||||
E1012: Type mismatch; expected number but got string
|
||||
Instead use |mapnew()|: >
|
||||
echo mapnew([1, 2, 3], (i, v) => 'item ' .. i)
|
||||
['item 0', 'item 1', 'item 2']
|
||||
not change, if the type was declared. This will give an error in Vim9
|
||||
script: >
|
||||
var mylist: list<number> = [1, 2, 3]
|
||||
echo map(mylist, (i, v) => 'item ' .. i)
|
||||
< E1012: Type mismatch; expected number but got string in map() ~
|
||||
|
||||
If the item type was determined to be "any" it can change to a more specific
|
||||
type. E.g. when a list of mixed types gets changed to a list of strings: >
|
||||
Instead use |mapnew()|, it creates a new list: >
|
||||
var mylist: list<number> = [1, 2, 3]
|
||||
echo mapnew(mylist, (i, v) => 'item ' .. i)
|
||||
< ['item 0', 'item 1', 'item 2'] ~
|
||||
|
||||
If the item type was not declared or determined to be "any" it can change to a
|
||||
more specific type. E.g. when a list of mixed types gets changed to a list of
|
||||
strings: >
|
||||
var mylist = [1, 2.0, '3']
|
||||
# typename(mylist) == "list<any>"
|
||||
map(mylist, (i, v) => 'item ' .. i)
|
||||
# typename(mylist) == "list<string>", no error
|
||||
|
||||
There is a subtle difference between using a list constant directly and
|
||||
through a variable declaration. Because of type inference, when using a list
|
||||
constant to initialize a variable, this also sets the declared type: >
|
||||
var mylist = [1, 2, 3]
|
||||
# typename(mylist) == "list<number>"
|
||||
echo map(mylist, (i, v) => 'item ' .. i) # Error!
|
||||
|
||||
When using the list constant directly, the type is not declared and is allowed
|
||||
to change: >
|
||||
echo map([1, 2, 3], (i, v) => 'item ' .. i) # OK
|
||||
|
||||
The reasoning behind this is that when a type is declared and the list is
|
||||
passed around and changed, the declaration must always hold. So that you can
|
||||
rely on the type to match the declared type. For a constant this is not
|
||||
needed.
|
||||
|
||||
*E1158*
|
||||
Same for |extend()|, use |extendnew()| instead, and for |flatten()|, use
|
||||
|flattennew()| instead.
|
||||
|flattennew()| instead. Since |flatten()| is intended to always change the
|
||||
type, it can not be used in Vim9 script.
|
||||
|
||||
*E1211* *E1217* *E1218* *E1219* *E1220* *E1221*
|
||||
*E1222* *E1223* *E1224* *E1225* *E1226* *E1227*
|
||||
*E1228* *E1238* *E1250* *E1251* *E1252* *E1253*
|
||||
*E1256*
|
||||
Types are checked for most builtin functions to make it easier to spot
|
||||
mistakes.
|
||||
|
||||
==============================================================================
|
||||
|
||||
@ -1398,7 +1578,7 @@ global namespace. If a file starts with: >
|
||||
var myvar = 'yes'
|
||||
Then "myvar" will only exist in this file. While without `vim9script` it would
|
||||
be available as `g:myvar` from any other script and function.
|
||||
|
||||
*E1101*
|
||||
The variables at the file level are very much like the script-local "s:"
|
||||
variables in legacy Vim script, but the "s:" is omitted. And they cannot be
|
||||
deleted.
|
||||
@ -1454,23 +1634,23 @@ be exported. {not implemented yet: class, interface}
|
||||
|
||||
|
||||
Import ~
|
||||
*:import* *:imp* *E1094* *E1047*
|
||||
*E1048* *E1049* *E1053* *E1071*
|
||||
*:import* *:imp* *E1094* *E1047* *E1262*
|
||||
*E1048* *E1049* *E1053* *E1071* *E1236*
|
||||
The exported items can be imported in another Vim9 script: >
|
||||
import "myscript.vim"
|
||||
|
||||
This makes each item available as "myscript.item".
|
||||
*:import-as*
|
||||
*:import-as* *E1257* *E1261*
|
||||
In case the name is long or ambiguous, another name can be specified: >
|
||||
import "thatscript.vim" as that
|
||||
< *E1060*
|
||||
< *E1060* *E1258* *E1259* *E1260*
|
||||
Then you can use "that.EXPORTED_CONST", "that.someValue", etc. You are free
|
||||
to choose the name "that". Use something that will be recognized as referring
|
||||
to the imported script. Avoid command names and builtin function names,
|
||||
because the name will shadow them. If the name starts with a capital letter
|
||||
it can also shadow global user commands and functions. Also, you cannot use
|
||||
the name for something else in the script, such as a function or variable
|
||||
name.
|
||||
to the imported script. Avoid command names, command modifiers and builtin
|
||||
function names, because the name will shadow them.
|
||||
If the name starts with a capital letter it can also shadow global user
|
||||
commands and functions. Also, you cannot use the name for something else in
|
||||
the script, such as a function or variable name.
|
||||
|
||||
In case the dot in the name is undesired, a local reference can be made for a
|
||||
function: >
|
||||
@ -1521,17 +1701,19 @@ line, there can be no line break: >
|
||||
echo that
|
||||
.name # Error!
|
||||
< *:import-cycle*
|
||||
The `import` commands are executed when encountered. If that script (directly
|
||||
or indirectly) imports the current script, then items defined after the
|
||||
`import` won't be processed yet. Therefore cyclic imports can exist, but may
|
||||
result in undefined items.
|
||||
The `import` commands are executed when encountered. If script A imports
|
||||
script B, and B (directly or indirectly) imports A, this will be skipped over.
|
||||
At this point items in A after "import B" will not have been processed and
|
||||
defined yet. Therefore cyclic imports can exist and not result in an error
|
||||
directly, but may result in an error for items in A after "import B" not being
|
||||
defined. This does not apply to autoload imports, see the next section.
|
||||
|
||||
|
||||
Importing an autoload script ~
|
||||
*vim9-autoload*
|
||||
For optimal startup speed, loading scripts should be postponed until they are
|
||||
actually needed. Using the autoload mechanism is recommended:
|
||||
|
||||
*E1264*
|
||||
1. In the plugin define user commands, functions and/or mappings that refer to
|
||||
items imported from an autoload script. >
|
||||
import autoload 'for/search.vim'
|
||||
@ -1621,6 +1803,17 @@ threaded, connecting asynchronous operations is a natural way of allowing
|
||||
plugins to do their work without blocking the user. It's a uniform way to
|
||||
invoke callbacks and handle timeouts and errors.
|
||||
|
||||
Some commands have already been reserved:
|
||||
*:class*
|
||||
*:endclass*
|
||||
*:abstract*
|
||||
*:enum*
|
||||
*:endenum*
|
||||
*:interface*
|
||||
*:endinterface*
|
||||
*:static*
|
||||
*:type*
|
||||
|
||||
Some examples: >
|
||||
|
||||
abstract class Person
|
||||
@ -1747,6 +1940,9 @@ Specific items from TypeScript we avoid:
|
||||
- TypeScript has various "Readonly" types, which have limited usefulness,
|
||||
since a type cast can remove the immutable nature. Vim locks the value,
|
||||
which is more flexible, but is only checked at runtime.
|
||||
- TypeScript has a complicated "import" statement that does not match how the
|
||||
Vim import mechanism works. A much simpler mechanism is used instead, which
|
||||
matches that the imported script is only sourced once.
|
||||
|
||||
|
||||
Declarations ~
|
||||
|
@ -265,6 +265,7 @@ Additionally the following commands can be used:
|
||||
X delete (2) |v_X|
|
||||
Y yank (2) |v_Y|
|
||||
p put |v_p|
|
||||
P put without unnamed register overwrite |v_P|
|
||||
J join (1) |v_J|
|
||||
U make uppercase |v_U|
|
||||
u make lowercase |v_u|
|
||||
|
@ -1,4 +1,4 @@
|
||||
*windows.txt* For Vim version 8.2. Last change: 2022 Jan 08
|
||||
*windows.txt* For Vim version 8.2. Last change: 2022 Feb 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -168,7 +168,7 @@ CTRL-W CTRL-S *CTRL-W_CTRL-S*
|
||||
Note: CTRL-S does not work on all terminals and might block
|
||||
further input, use CTRL-Q to get going again.
|
||||
Also see |++opt| and |+cmd|.
|
||||
*E242*
|
||||
*E242* *E1159*
|
||||
Be careful when splitting a window in an autocommand, it may
|
||||
mess up the window layout if this happens while making other
|
||||
window layout changes.
|
||||
@ -473,7 +473,7 @@ These commands can also be executed with ":wincmd":
|
||||
the |CursorHold| autocommand event). Or when a Normal mode
|
||||
command is inconvenient.
|
||||
The count can also be a window number. Example: >
|
||||
:exe nr . "wincmd w"
|
||||
:exe nr .. "wincmd w"
|
||||
< This goes to window "nr".
|
||||
|
||||
==============================================================================
|
||||
@ -964,12 +964,12 @@ CTRL-W g } *CTRL-W_g}*
|
||||
cursor. This is less clever than using |:ptag|, but you don't
|
||||
need a tags file and it will also find matches in system
|
||||
include files. Example: >
|
||||
:au! CursorHold *.[ch] ++nested exe "silent! psearch " . expand("<cword>")
|
||||
:au! CursorHold *.[ch] ++nested exe "silent! psearch " .. expand("<cword>")
|
||||
< Warning: This can be slow.
|
||||
|
||||
Example *CursorHold-example* >
|
||||
|
||||
:au! CursorHold *.[ch] ++nested exe "silent! ptag " . expand("<cword>")
|
||||
:au! CursorHold *.[ch] ++nested exe "silent! ptag " .. expand("<cword>")
|
||||
|
||||
This will cause a ":ptag" to be executed for the keyword under the cursor,
|
||||
when the cursor hasn't moved for the time set with 'updatetime'. The "nested"
|
||||
@ -992,14 +992,14 @@ is no word under the cursor, and a few other things: >
|
||||
:
|
||||
: " Delete any existing highlight before showing another tag
|
||||
: silent! wincmd P " jump to preview window
|
||||
: if &previewwindow " if we really get there...
|
||||
: if &previewwindow " if we really get there...
|
||||
: match none " delete existing highlight
|
||||
: wincmd p " back to old window
|
||||
: endif
|
||||
:
|
||||
: " Try displaying a matching tag for the word under the cursor
|
||||
: try
|
||||
: exe "ptag " . w
|
||||
: exe "ptag " .. w
|
||||
: catch
|
||||
: return
|
||||
: endtry
|
||||
@ -1011,10 +1011,10 @@ is no word under the cursor, and a few other things: >
|
||||
: endif
|
||||
: call search("$", "b") " to end of previous line
|
||||
: let w = substitute(w, '\\', '\\\\', "")
|
||||
: call search('\<\V' . w . '\>') " position cursor on match
|
||||
: call search('\<\V' .. w .. '\>') " position cursor on match
|
||||
: " Add a match highlight to the word at this position
|
||||
: hi previewWord term=bold ctermbg=green guibg=green
|
||||
: exe 'match previewWord "\%' . line(".") . 'l\%' . col(".") . 'c\k*"'
|
||||
: exe 'match previewWord "\%' .. line(".") .. 'l\%' .. col(".") .. 'c\k*"'
|
||||
: wincmd p " back to old window
|
||||
: endif
|
||||
: endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2022 Jan 23
|
||||
" Last Change: 2022 Feb 13
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@ -44,7 +44,7 @@ endif
|
||||
" file name matches ft_ignore_pat.
|
||||
" When using this, the entry should probably be further down below with the
|
||||
" other StarSetf() calls.
|
||||
func! s:StarSetf(ft)
|
||||
func s:StarSetf(ft)
|
||||
if expand("<amatch>") !~ g:ft_ignore_pat
|
||||
exe 'setf ' . a:ft
|
||||
endif
|
||||
@ -229,6 +229,9 @@ au BufNewFile,BufRead *.bib setf bib
|
||||
" BibTeX Bibliography Style
|
||||
au BufNewFile,BufRead *.bst setf bst
|
||||
|
||||
" Bicep
|
||||
au BufNewFile,BufRead *.bicep setf bicep
|
||||
|
||||
" BIND configuration
|
||||
" sudoedit uses namedXXXX.conf
|
||||
au BufNewFile,BufRead named*.conf,rndc*.conf,rndc*.key setf named
|
||||
@ -481,6 +484,7 @@ au BufNewFile,BufRead */etc/dnsmasq.conf setf dnsmasq
|
||||
au BufNewFile,BufRead *.desc setf desc
|
||||
|
||||
" the D language or dtrace
|
||||
au BufNewFile,BufRead */dtrace/*.d setf dtrace
|
||||
au BufNewFile,BufRead *.d call dist#ft#DtraceCheck()
|
||||
|
||||
" Desktop files
|
||||
@ -727,6 +731,10 @@ au BufNewFile,BufRead gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc setf gnash
|
||||
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
|
||||
|
||||
" Gnuplot scripts
|
||||
au BufNewFile,BufRead *.gpi,.gnuplot setf gnuplot
|
||||
|
||||
@ -1547,6 +1555,9 @@ au BufNewFile,BufRead *.r,*.R call dist#ft#FTr()
|
||||
" Remind
|
||||
au BufNewFile,BufRead .reminders,*.remind,*.rem setf remind
|
||||
|
||||
" ReScript
|
||||
au BufNewFile,BufRead *.res,*.resi setf rescript
|
||||
|
||||
" Resolv.conf
|
||||
au BufNewFile,BufRead resolv.conf setf resolv
|
||||
|
||||
@ -1789,6 +1800,9 @@ au BufNewFile,BufRead *.mib,*.my setf mib
|
||||
au BufNewFile,BufRead *.hog,snort.conf,vision.conf setf hog
|
||||
au BufNewFile,BufRead *.rules call dist#ft#FTRules()
|
||||
|
||||
" Solidity
|
||||
au BufRead,BufNewFile *.sol setf solidity
|
||||
|
||||
" SPARQL queries
|
||||
au BufNewFile,BufRead *.rq,*.sparql setf sparql
|
||||
|
||||
@ -1946,10 +1960,13 @@ au BufNewFile,BufRead texmf.cnf setf texmf
|
||||
au BufNewFile,BufRead .tidyrc,tidyrc,tidy.conf setf tidy
|
||||
|
||||
" TF mud client
|
||||
au BufNewFile,BufRead *.tf,.tfrc,tfrc setf tf
|
||||
au BufNewFile,BufRead .tfrc,tfrc setf tf
|
||||
|
||||
" TF mud client or terraform
|
||||
au BufNewFile,BufRead *.tf call dist#ft#FTtf()
|
||||
|
||||
" TLA+
|
||||
au BufRead,BufNewFile *.tla setf tla
|
||||
au BufNewFile,BufRead *.tla setf tla
|
||||
|
||||
" tmux configuration
|
||||
au BufNewFile,BufRead {.,}tmux*.conf setf tmux
|
||||
@ -1958,7 +1975,7 @@ au BufNewFile,BufRead {.,}tmux*.conf setf tmux
|
||||
au BufNewFile,BufRead *.toml setf toml
|
||||
|
||||
" TPP - Text Presentation Program
|
||||
au BufNewFile,BufReadPost *.tpp setf tpp
|
||||
au BufNewFile,BufRead *.tpp setf tpp
|
||||
|
||||
" Treetop
|
||||
au BufRead,BufNewFile *.treetop setf treetop
|
||||
@ -2015,6 +2032,9 @@ au BufNewFile,BufRead */.init/*.conf,*/.init/*.override setf upstart
|
||||
au BufNewFile,BufRead */.config/upstart/*.conf setf upstart
|
||||
au BufNewFile,BufRead */.config/upstart/*.override setf upstart
|
||||
|
||||
" Vala
|
||||
au BufNewFile,BufRead *.vala setf vala
|
||||
|
||||
" Vera
|
||||
au BufNewFile,BufRead *.vr,*.vri,*.vrh setf vera
|
||||
|
||||
@ -2045,7 +2065,7 @@ au BufRead,BufNewFile *.hw,*.module,*.pkg
|
||||
\ endif
|
||||
|
||||
" Visual Basic (also uses *.bas) or FORM
|
||||
au BufNewFile,BufRead *.frm call dist#ft#FTVB("form")
|
||||
au BufNewFile,BufRead *.frm call dist#ft#FTfrm()
|
||||
|
||||
" SaxBasic is close to Visual Basic
|
||||
au BufNewFile,BufRead *.sba setf vb
|
||||
@ -2507,7 +2527,7 @@ endif
|
||||
" Function called for testing all functions defined here. These are
|
||||
" script-local, thus need to be executed here.
|
||||
" Returns a string with error messages (hopefully empty).
|
||||
func! TestFiletypeFuncs(testlist)
|
||||
func TestFiletypeFuncs(testlist)
|
||||
let output = ''
|
||||
for f in a:testlist
|
||||
try
|
||||
|
@ -1,35 +1,43 @@
|
||||
" Vim support file to switch on loading plugins for file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last change: 2006 Apr 30
|
||||
vim9script noclear
|
||||
|
||||
if exists("did_load_ftplugin")
|
||||
# Vim support file to switch on loading plugins for file types
|
||||
#
|
||||
# Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
# Last change: 2022 Feb 11
|
||||
|
||||
if exists("g:did_load_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let did_load_ftplugin = 1
|
||||
g:did_load_ftplugin = 1
|
||||
|
||||
augroup filetypeplugin
|
||||
au FileType * call s:LoadFTPlugin()
|
||||
|
||||
func! s:LoadFTPlugin()
|
||||
if exists("b:undo_ftplugin")
|
||||
exe b:undo_ftplugin
|
||||
unlet! b:undo_ftplugin b:did_ftplugin
|
||||
endif
|
||||
|
||||
let s = expand("<amatch>")
|
||||
if s != ""
|
||||
if &cpo =~# "S" && exists("b:did_ftplugin")
|
||||
" In compatible mode options are reset to the global values, need to
|
||||
" set the local values also when a plugin was already used.
|
||||
unlet b:did_ftplugin
|
||||
endif
|
||||
|
||||
" When there is a dot it is used to separate filetype names. Thus for
|
||||
" "aaa.bbb" load "aaa" and then "bbb".
|
||||
for name in split(s, '\.')
|
||||
exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim'
|
||||
endfor
|
||||
endif
|
||||
endfunc
|
||||
au FileType * call LoadFTPlugin()
|
||||
augroup END
|
||||
|
||||
if exists('*LoadFTPlugin')
|
||||
# No need to define the function again.
|
||||
finish
|
||||
endif
|
||||
|
||||
def LoadFTPlugin()
|
||||
if exists("b:undo_ftplugin")
|
||||
# We assume b:undo_ftplugin is using legacy script syntax
|
||||
legacy exe b:undo_ftplugin
|
||||
unlet! b:undo_ftplugin b:did_ftplugin
|
||||
endif
|
||||
|
||||
var s = expand("<amatch>")
|
||||
if s != ""
|
||||
if &cpo =~# "S" && exists("b:did_ftplugin")
|
||||
# In compatible mode options are reset to the global values, need to
|
||||
# set the local values also when a plugin was already used.
|
||||
unlet b:did_ftplugin
|
||||
endif
|
||||
|
||||
# When there is a dot it is used to separate filetype names. Thus for
|
||||
# "aaa.bbb" load "aaa" and then "bbb".
|
||||
for name in split(s, '\.')
|
||||
exe 'runtime! ftplugin/' .. name .. '.vim ftplugin/' .. name .. '_*.vim ftplugin/' .. name .. '/*.vim'
|
||||
endfor
|
||||
endif
|
||||
enddef
|
||||
|
@ -1,8 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: ant
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
"
|
||||
" This runtime file is looking for a new maintainer.
|
||||
"
|
||||
" Former maintainer: Dan Sharp
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: aspvbs
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
"
|
||||
" This runtime file is looking for a new maintainer.
|
||||
"
|
||||
" Former maintainer: Dan Sharp
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: BASIC
|
||||
" Language: BASIC (QuickBASIC 4.5)
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2015 Jan 10
|
||||
" Last Change: 2021 Mar 16
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@ -11,17 +11,46 @@ let b:did_ftplugin = 1
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal comments=:REM,:'
|
||||
setlocal comments=:REM\ ,:Rem\ ,:rem\ ,:'
|
||||
setlocal commentstring='\ %s
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "BASIC Source Files (*.bas)\t*.bas\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
" TODO: support exit ... as middle matches?
|
||||
if exists("loaded_matchit") && !exists("b:match_words")
|
||||
let s:line_start = '\%(^\s*\)\@<='
|
||||
let s:not_end = '\%(end\s\+\)\@<!'
|
||||
let s:not_end_or_exit = '\%(\%(end\|exit\)\s\+\)\@<!'
|
||||
|
||||
let b:match_ignorecase = 1
|
||||
let b:match_words =
|
||||
\ s:not_end_or_exit .. '\<def\s\+fn:\<end\s\+def\>,' ..
|
||||
\ s:not_end_or_exit .. '\<function\>:\<end\s\+function\>,' ..
|
||||
\ s:not_end_or_exit .. '\<sub\>:\<end\s\+sub\>,' ..
|
||||
\ s:not_end .. '\<type\>:\<end\s\+type\>,' ..
|
||||
\ s:not_end .. '\<select\>:\%(select\s\+\)\@<!\<case\%(\s\+\%(else\|is\)\)\=\>:\<end\s\+select\>,' ..
|
||||
\ '\<do\>:\<loop\>,' ..
|
||||
\ '\<for\>\%(\s\+\%(input\|output\|random\|append\|binary\)\)\@!:\<next\>,' ..
|
||||
\ '\<while\>:\<wend\>,' ..
|
||||
\ s:line_start .. 'if\%(.*\<then\s*\%($\|''\)\)\@=:\<\%(' .. s:line_start .. 'else\|elseif\)\>:\<end\s\+if\>,' ..
|
||||
\ '\<lock\>:\<unlock\>'
|
||||
|
||||
let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string" || ' ..
|
||||
\ 'strpart(getline("."), 0, col(".") ) =~? "\\<exit\\s\\+"'
|
||||
|
||||
unlet s:line_start s:not_end s:not_end_or_exit
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl fo< com< cms< sua<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "BASIC Source Files (*.bas)\t*.bas\n" ..
|
||||
\ "BASIC Include Files (*.bi, *.bm)\t*.bi;*.bm\n" ..
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl fo< com< cms<" ..
|
||||
\ " | unlet! b:match_ignorecase b:match_skip b:match_words" ..
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
||||
|
@ -1,8 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: config
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
"
|
||||
" This runtime file is looking for a new maintainer.
|
||||
"
|
||||
" Former maintainer: Dan Sharp
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: csc
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
"
|
||||
" This runtime file is looking for a new maintainer.
|
||||
"
|
||||
" Former maintainer: Dan Sharp
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: csh
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Previous Maintainer: Dan Sharp
|
||||
" Contributor: Johannes Zellner <johannes@zellner.org>
|
||||
" Last Change: 2021 Oct 15
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: dtd
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
"
|
||||
" This runtime file is looking for a new maintainer.
|
||||
"
|
||||
" Former maintainer: Dan Sharp
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
@ -1,13 +1,65 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: FreeBasic
|
||||
" Language: FreeBASIC
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2015 Jan 10
|
||||
" Last Change: 2021 Mar 16
|
||||
|
||||
" Setup {{{1
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
runtime! ftplugin/basic.vim
|
||||
|
||||
" vim: ts=8
|
||||
let s:dialect = freebasic#GetDialect()
|
||||
|
||||
" Comments {{{1
|
||||
" add ''comments before 'comments
|
||||
let &l:comments = "sO:*\ -,mO:*\ \ ,exO:*/,s1:/',mb:',ex:'/,:''," .. &l:comments
|
||||
|
||||
" Match words {{{1
|
||||
if exists("loaded_matchit")
|
||||
let s:not_end = '\%(end\s\+\)\@<!'
|
||||
|
||||
let b:match_words ..= ','
|
||||
|
||||
if s:dialect == 'fb'
|
||||
let b:match_words ..= s:not_end .. '\<constructor\>:\<end\s\+constructor\>,' ..
|
||||
\ s:not_end .. '\<destructor\>:\<end\s\+destructor\>,' ..
|
||||
\ s:not_end .. '\<property\>:\<end\s\+property\>,' ..
|
||||
\ s:not_end .. '\<operator\>:\<end\s\+operator\>,' ..
|
||||
\ s:not_end .. '\<extern\%(\s\+"\)\@=:\<end\s\+extern\>,'
|
||||
endif
|
||||
|
||||
if s:dialect == 'fb' || s:dialect == 'deprecated'
|
||||
let b:match_words ..= s:not_end .. '\<scope\>:\<end\s\+scope\>,'
|
||||
endif
|
||||
|
||||
if s:dialect == 'qb'
|
||||
let b:match_words ..= s:not_end .. '\<__asm\>:\<end\s\+__asm\>,' ..
|
||||
\ s:not_end .. '\<__union\>:\<end\s\+__union\>,' ..
|
||||
\ s:not_end .. '\<__with\>:\<end\s\+__with\>,'
|
||||
else
|
||||
let b:match_words ..= s:not_end .. '\<asm\>:\<end\s\+asm\>,' ..
|
||||
\ s:not_end .. '\<namespace\>:\<end\s\+namespace\>,' ..
|
||||
\ s:not_end .. '\<union\>:\<end\s\+union\>,' ..
|
||||
\ s:not_end .. '\<with\>:\<end\s\+with\>,'
|
||||
endif
|
||||
|
||||
let b:match_words ..= s:not_end .. '\<enum\>:\<end\s\+enum\>,' ..
|
||||
\ '^#\s*\%(if\|ifdef\|ifndef\)\>:^#\s*\%(else\|elseif\)\>:^#\s*endif\>,' ..
|
||||
\ '^#\s*macro\>:^#\s*endmacro\>'
|
||||
|
||||
" skip "function = <retval>"
|
||||
let b:match_skip ..= '|| strpart(getline("."), col(".") - 1) =~? "^\\<function\\s\\+="'
|
||||
|
||||
unlet s:not_end
|
||||
endif
|
||||
|
||||
" Cleanup {{{1
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
||||
|
@ -1,8 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: html
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
"
|
||||
" This runtime file is looking for a new maintainer.
|
||||
"
|
||||
" Former maintainer: Dan Sharp
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
@ -1,8 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Java
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
"
|
||||
" This runtime file is looking for a new maintainer.
|
||||
"
|
||||
" Former maintainer: Dan Sharp
|
||||
" Last Change: 2012 Mar 11
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
@ -1,8 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: jsp
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
"
|
||||
" This runtime file is looking for a new maintainer.
|
||||
"
|
||||
" Former maintainer: Dan Sharp
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Pascal
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Previous Maintainer: Dan Sharp
|
||||
" Last Change: 2021 Apr 23
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
@ -1,8 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: php
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
"
|
||||
" This runtime file is looking for a new maintainer.
|
||||
"
|
||||
" Former maintainer: Dan Sharp
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
26
runtime/ftplugin/qb64.vim
Normal file
26
runtime/ftplugin/qb64.vim
Normal file
@ -0,0 +1,26 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: QB64
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
runtime! ftplugin/basic.vim
|
||||
|
||||
let s:not_end = '\%(end\s\+\)\@<!'
|
||||
|
||||
let b:match_words ..= ',' ..
|
||||
\ s:not_end .. '\<declare\>:\<end\s\+declare\>,' ..
|
||||
\ '\<select\s\+everycase\>:\%(select\s\+\)\@<!\<case\%(\s\+\%(else\|is\)\)\=\>:\<end\s\+select\>,' ..
|
||||
\ '$IF\>:$\%(ELSEIF\|ELSE\)\>:$END\s*IF\>'
|
||||
|
||||
unlet s:not_end
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
@ -1,8 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: sgml
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
"
|
||||
" This runtime file is looking for a new maintainer.
|
||||
"
|
||||
" Former maintainer: Dan Sharp
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: sh
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
"
|
||||
" This runtime file is looking for a new maintainer.
|
||||
"
|
||||
" Former maintainer: Dan Sharp
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
@ -1,8 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: svg
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
"
|
||||
" This runtime file is looking for a new maintainer.
|
||||
"
|
||||
" Former maintainer: Dan Sharp
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: tcsh
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Previous Maintainer: Dan Sharp
|
||||
" Last Change: 2021 Oct 15
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
@ -1,8 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: xhtml
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
"
|
||||
" This runtime file is looking for a new maintainer.
|
||||
"
|
||||
" Former maintainer: Dan Sharp
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
" Maintainer: Christian Brabandt <cb@256bit.org>
|
||||
" Last Changed: Dec 07th, 2018
|
||||
" Repository: https://github.com/chrisbra/vim-xml-ftplugin
|
||||
" Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Previous Maintainer: Dan Sharp
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
@ -1,8 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: xsd
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
"
|
||||
" This runtime file is looking for a new maintainer.
|
||||
"
|
||||
" Former maintainer: Dan Sharp
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: xslt
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
"
|
||||
" This runtime file is looking for a new maintainer.
|
||||
"
|
||||
" Former maintainer: Dan Sharp
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
" Vim support file to switch off loading plugins for file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2011 Oct 20
|
||||
vim9script
|
||||
|
||||
if exists("did_load_ftplugin")
|
||||
unlet did_load_ftplugin
|
||||
# Vim support file to switch off loading plugins for file types
|
||||
#
|
||||
# Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
# Last Change: 2022 Feb 09
|
||||
|
||||
if exists("g:did_load_ftplugin")
|
||||
unlet g:did_load_ftplugin
|
||||
endif
|
||||
|
||||
" Remove all autocommands in the filetypeplugin group, if any exist.
|
||||
# Remove all autocommands in the filetypeplugin group, if any exist.
|
||||
if exists("#filetypeplugin")
|
||||
silent! au! filetypeplugin *
|
||||
endif
|
||||
|
@ -6,6 +6,7 @@ Name[de]=GVim
|
||||
Name[eo]=GVim
|
||||
Name[fi]=GVim
|
||||
Name[fr]=GVim
|
||||
Name[ga]=GVim
|
||||
Name[it]=GVim
|
||||
Name[ru]=GVim
|
||||
Name[sr]=GVim
|
||||
@ -16,6 +17,7 @@ GenericName[de]=Texteditor
|
||||
GenericName[eo]=Tekstoredaktilo
|
||||
GenericName[fi]=Tekstinmuokkain
|
||||
GenericName[fr]=Éditeur de texte
|
||||
GenericName[ga]=Eagarthóir Téacs
|
||||
GenericName[it]=Editor di testi
|
||||
GenericName[ja]=テキストエディタ
|
||||
GenericName[ru]=Текстовый редактор
|
||||
@ -27,6 +29,7 @@ Comment[de]=Textdateien bearbeiten
|
||||
Comment[eo]=Redakti tekstajn dosierojn
|
||||
Comment[fi]=Muokkaa tekstitiedostoja
|
||||
Comment[fr]=Éditer des fichiers texte
|
||||
Comment[ga]=Cuir comhaid téacs in eagar
|
||||
Comment[it]=Edita file di testo
|
||||
Comment[ja]=テキストファイルを編集します
|
||||
Comment[ru]=Редактирование текстовых файлов
|
||||
@ -57,7 +60,6 @@ Comment[es]=Edita archivos de texto
|
||||
Comment[et]=Redigeeri tekstifaile
|
||||
Comment[eu]=Editatu testu-fitxategiak
|
||||
Comment[fa]=ویرایش پروندههای متنی
|
||||
Comment[ga]=Eagar comhad Téacs
|
||||
Comment[gu]=લખાણ ફાઇલોમાં ફેરફાર કરો
|
||||
Comment[he]=ערוך קבצי טקסט
|
||||
Comment[hi]=पाठ फ़ाइलें संपादित करें
|
||||
@ -107,6 +109,7 @@ Keywords[de]=Text;Editor;
|
||||
Keywords[eo]=Teksto;redaktilo;
|
||||
Keywords[fi]=Teksti;muokkain;editori;
|
||||
Keywords[fr]=Texte;éditeur;
|
||||
Keywords[ga]=Téacs;eagarthóir;
|
||||
Keywords[it]=Testo;editor;
|
||||
Keywords[ja]=テキスト;エディタ;
|
||||
Keywords[ru]=текст;текстовый редактор;
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim support file to switch on loading indent files for file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2008 Feb 22
|
||||
" Last Change: 2022 Feb 11
|
||||
|
||||
if exists("did_indent_on")
|
||||
finish
|
||||
@ -10,22 +10,23 @@ let did_indent_on = 1
|
||||
|
||||
augroup filetypeindent
|
||||
au FileType * call s:LoadIndent()
|
||||
func! s:LoadIndent()
|
||||
if exists("b:undo_indent")
|
||||
exe b:undo_indent
|
||||
unlet! b:undo_indent b:did_indent
|
||||
endif
|
||||
let s = expand("<amatch>")
|
||||
if s != ""
|
||||
if exists("b:did_indent")
|
||||
unlet b:did_indent
|
||||
endif
|
||||
|
||||
" When there is a dot it is used to separate filetype names. Thus for
|
||||
" "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim".
|
||||
for name in split(s, '\.')
|
||||
exe 'runtime! indent/' . name . '.vim'
|
||||
endfor
|
||||
endif
|
||||
endfunc
|
||||
augroup END
|
||||
|
||||
def s:LoadIndent()
|
||||
if exists("b:undo_indent")
|
||||
legacy exe b:undo_indent
|
||||
unlet! b:undo_indent b:did_indent
|
||||
endif
|
||||
var s = expand("<amatch>")
|
||||
if s != ""
|
||||
if exists("b:did_indent")
|
||||
unlet b:did_indent
|
||||
endif
|
||||
|
||||
# When there is a dot it is used to separate filetype names. Thus for
|
||||
# "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim".
|
||||
for name in split(s, '\.')
|
||||
exe 'runtime! indent/' .. name .. '.vim'
|
||||
endfor
|
||||
endif
|
||||
enddef
|
||||
|
11
runtime/indent/basic.vim
Normal file
11
runtime/indent/basic.vim
Normal file
@ -0,0 +1,11 @@
|
||||
" Vim indent file
|
||||
" Language: BASIC (QuickBASIC 4.5)
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2022 Jan 24
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
runtime! indent/vb.vim
|
11
runtime/indent/freebasic.vim
Normal file
11
runtime/indent/freebasic.vim
Normal file
@ -0,0 +1,11 @@
|
||||
" Vim indent file
|
||||
" Language: FreeBASIC
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2022 Jan 24
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
runtime! indent/vb.vim
|
@ -1,7 +1,7 @@
|
||||
" Vim indent script for HTML
|
||||
" Maintainer: Bram Moolenaar
|
||||
" Original Author: Andy Wokula <anwoku@yahoo.de>
|
||||
" Last Change: 2021 Jun 13
|
||||
" Last Change: 2022 Jan 31
|
||||
" Version: 1.0 "{{{
|
||||
" Description: HTML indent script with cached state for faster indenting on a
|
||||
" range of lines.
|
||||
@ -149,6 +149,15 @@ func HtmlIndent_CheckUserSettings()
|
||||
let b:html_indent_line_limit = 200
|
||||
endif
|
||||
endif
|
||||
|
||||
if exists('b:html_indent_attribute')
|
||||
let b:hi_attr_indent = b:html_indent_attribute
|
||||
elseif exists('g:html_indent_attribute')
|
||||
let b:hi_attr_indent = g:html_indent_attribute
|
||||
else
|
||||
let b:hi_attr_indent = 2
|
||||
endif
|
||||
|
||||
endfunc "}}}
|
||||
|
||||
" Init Script Vars
|
||||
@ -946,11 +955,11 @@ func s:InsideTag(foundHtmlString)
|
||||
let idx = match(text, '<' . s:tagname . '\s\+\zs\w')
|
||||
endif
|
||||
if idx == -1
|
||||
" after just "<tag" indent two levels more
|
||||
" after just "<tag" indent two levels more by default
|
||||
let idx = match(text, '<' . s:tagname . '$')
|
||||
if idx >= 0
|
||||
call cursor(lnum, idx + 1)
|
||||
return virtcol('.') - 1 + shiftwidth() * 2
|
||||
return virtcol('.') - 1 + shiftwidth() * b:hi_attr_indent
|
||||
endif
|
||||
endif
|
||||
if idx > 0
|
||||
|
11
runtime/indent/qb64.vim
Normal file
11
runtime/indent/qb64.vim
Normal file
@ -0,0 +1,11 @@
|
||||
" Vim indent file
|
||||
" Language: QB64
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2022 Jan 24
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
runtime! indent/vb.vim
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user