mirror of
https://github.com/vim/vim
synced 2025-07-31 10:51:52 +00:00
Compare commits
367 Commits
Author | SHA1 | Date | |
---|---|---|---|
5017c66bd4 | |||
177847e67a | |||
8c97960850 | |||
6a06940f8a | |||
6d4e725a34 | |||
f26c16144d | |||
cb49a1d934 | |||
3506cf34c1 | |||
3ad2090316 | |||
c947b9ae41 | |||
75a0f3c011 | |||
aa7d0c2335 | |||
0d1f55c044 | |||
478700336d | |||
beb0ef1ab2 | |||
02560424bf | |||
72bb10df1f | |||
0f68e6c07a | |||
ca9d8d2cb9 | |||
1b76a8dfe2 | |||
d0fb2d8041 | |||
91ff3d4f52 | |||
e8a4c0d91f | |||
b471690fad | |||
188639d75c | |||
cc766a85f4 | |||
4829c1c9e9 | |||
7a411a306f | |||
15f74fab65 | |||
242c152c08 | |||
2b74b6805b | |||
1061195057 | |||
0b962e5685 | |||
292e1b9f68 | |||
fa010cdfb1 | |||
c4cb544cd5 | |||
8ef6997e2d | |||
ce416b453a | |||
a3157a476b | |||
72bb47e38f | |||
58f331a05f | |||
0dac1ab579 | |||
5018a836c0 | |||
97f8c1081e | |||
eabddc425e | |||
c1658a196b | |||
17fa233f6f | |||
22ebd172e4 | |||
ffe6e646dc | |||
782c6744b4 | |||
96e08e028c | |||
3a6f952cc8 | |||
a6c18d38ca | |||
ccbfd4883f | |||
1104a6d0c2 | |||
49d008d96b | |||
4dea2d92e4 | |||
d1d2684c80 | |||
1712518f48 | |||
c0ceeeb839 | |||
b4ad3b0dea | |||
46eea444d9 | |||
9247a221ce | |||
2bdad61267 | |||
b55986c52d | |||
fd01280d01 | |||
1624639ec8 | |||
24565cf27b | |||
859cc21c6b | |||
471b3aed3e | |||
8be423b7ac | |||
9dac9b1751 | |||
3e559cd884 | |||
565d1278cb | |||
1501b63f8d | |||
501f978288 | |||
ec15b1cfdc | |||
c75bca3ee9 | |||
f3980dc5d0 | |||
347538fad0 | |||
bf269ed0b0 | |||
c6c1ec4da5 | |||
5e877baf87 | |||
acf7d73a7f | |||
abb6fbd14d | |||
90da27b927 | |||
5d46dcfeed | |||
03a297c63f | |||
43216611a5 | |||
9dd42a6311 | |||
1e2c4175dc | |||
f8e43f6107 | |||
f4f0525c34 | |||
454ce6737c | |||
98b7fe725e | |||
ac48506ac6 | |||
c20e46a4e3 | |||
3c5999e53d | |||
a915fa0103 | |||
81b573d7e5 | |||
fe154990c1 | |||
6f2465d336 | |||
e7dd0fa2c6 | |||
35dc17634d | |||
e18acb02bb | |||
6d877fe018 | |||
85b43c6cb7 | |||
397a87ac1c | |||
efd73ae5d2 | |||
6b8c7ba062 | |||
a4df834a92 | |||
7e0be3ea21 | |||
b6643d10d3 | |||
c670ebddcd | |||
6f95363677 | |||
47c532e2bc | |||
36a5b6867b | |||
95d2e7634c | |||
b10ff5c1b3 | |||
e7a74d5375 | |||
2995e5cf4e | |||
2e17fef225 | |||
f35fd8e5d4 | |||
61efa16932 | |||
1d9cef769d | |||
155b088208 | |||
da6d42c35a | |||
4f6e772c9c | |||
4c8b546da2 | |||
d597ab00d7 | |||
21dc8f1527 | |||
5cffa8df7e | |||
fe8e9f6740 | |||
9323ca51c2 | |||
056678184f | |||
139575de66 | |||
48f69cdfa4 | |||
96923b7a14 | |||
1a572e9b3b | |||
8d5e514d77 | |||
1fdf84e033 | |||
977525fea6 | |||
10792feebd | |||
7a73252063 | |||
7d42840033 | |||
6e2e2cc95b | |||
129e33e44b | |||
5c68617d39 | |||
b29b96806f | |||
424da7aa48 | |||
5f823d1e73 | |||
533870a985 | |||
e850439a56 | |||
754d2b4036 | |||
4f3321f704 | |||
986b0fd0c5 | |||
badf04f5c2 | |||
8b530b3158 | |||
d0b7bfa957 | |||
bbf84e2737 | |||
5b4f8a0e84 | |||
e2adcf3974 | |||
fb43cfc2c6 | |||
f52fac2ed9 | |||
0a4e098f32 | |||
176711f069 | |||
dbf8094b17 | |||
20fb28b1dc | |||
873f8243f6 | |||
e406ff87c8 | |||
1b1df95f1a | |||
53ba6ca5b2 | |||
bf40e90dfe | |||
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 |
96
.github/workflows/ci.yml
vendored
96
.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
|
||||
@ -347,12 +347,11 @@ jobs:
|
||||
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,29 +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 ::group::%COL_GREEN%Vim version:%COL_RESET%
|
||||
.\vim --version || exit 1
|
||||
echo ::endgroup::
|
||||
|
||||
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 ::group::%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 ::endgroup::
|
||||
|
||||
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
|
||||
@ -554,11 +570,35 @@ jobs:
|
||||
set timeout=1
|
||||
:exitloop
|
||||
|
||||
echo ::group::%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
|
||||
)
|
||||
echo ::endgroup::
|
||||
|
||||
- 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
|
||||
|
8
Filelist
8
Filelist
@ -198,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 \
|
||||
@ -447,10 +446,6 @@ SRC_UNIX = \
|
||||
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 \
|
||||
src/gui_athena.c \
|
||||
src/gui_gtk.c \
|
||||
src/gui_gtk_f.c \
|
||||
src/gui_gtk_f.h \
|
||||
@ -475,7 +470,6 @@ SRC_UNIX = \
|
||||
src/osdef1.h.in \
|
||||
src/osdef2.h.in \
|
||||
src/pathdef.sh \
|
||||
src/proto/gui_athena.pro \
|
||||
src/proto/gui_gtk.pro \
|
||||
src/proto/gui_gtk_x11.pro \
|
||||
src/proto/gui_gtk_gresources.pro \
|
||||
@ -632,6 +626,7 @@ SRC_DOS_BIN = \
|
||||
src/xpm/x86/lib-vc14/libXpm.lib \
|
||||
src/xpm/x86/lib/libXpm.a \
|
||||
src/xpm/x86/lib/libXpm.lib \
|
||||
runtime/bitmaps/vim.ico \
|
||||
nsis/icons.zip \
|
||||
|
||||
# source files for Amiga, DOS, etc. (also in the extra archive)
|
||||
@ -1000,6 +995,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
|
||||
@ -400,6 +403,9 @@ Section "$(str_section_exe)" id_section_exe
|
||||
SetOutPath $0\autoload\xml
|
||||
File ${VIMRT}\autoload\xml\*.*
|
||||
|
||||
SetOutPath $0\bitmaps
|
||||
File ${VIMSRC}\vim.ico
|
||||
|
||||
SetOutPath $0\syntax
|
||||
File ${VIMRT}\syntax\*.*
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
43
runtime/autoload/dist/ft.vim
vendored
43
runtime/autoload/dist/ft.vim
vendored
@ -3,7 +3,7 @@ vim9script
|
||||
# Vim functions for file type detection
|
||||
#
|
||||
# Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
# Last Change: 2022 Feb 05
|
||||
# Last Change: 2022 Mar 05
|
||||
|
||||
# These functions are moved here from runtime/filetype.vim to make startup
|
||||
# faster.
|
||||
@ -83,7 +83,7 @@ export def FTbas()
|
||||
setf freebasic
|
||||
elseif match(lines, qb64_preproc) > -1
|
||||
setf qb64
|
||||
elseif match(lines, s:ft_visual_basic_content) > -1
|
||||
elseif match(lines, ft_visual_basic_content) > -1
|
||||
setf vb
|
||||
else
|
||||
setf basic
|
||||
@ -182,7 +182,7 @@ export def FTent()
|
||||
break
|
||||
endif
|
||||
lnum += 1
|
||||
endw
|
||||
endwhile
|
||||
setf dtd
|
||||
enddef
|
||||
|
||||
@ -206,6 +206,10 @@ export def EuphoriaCheck()
|
||||
enddef
|
||||
|
||||
export def DtraceCheck()
|
||||
if did_filetype()
|
||||
# Filetype was already detected
|
||||
return
|
||||
endif
|
||||
var lines = getline(1, min([line("$"), 100]))
|
||||
if match(lines, '^module\>\|^import\>') > -1
|
||||
# D files often start with a module and/or import statement.
|
||||
@ -241,7 +245,7 @@ export def FTfrm()
|
||||
|
||||
var lines = getline(1, min([line("$"), 5]))
|
||||
|
||||
if match(lines, s:ft_visual_basic_content) > -1
|
||||
if match(lines, ft_visual_basic_content) > -1
|
||||
setf vb
|
||||
else
|
||||
setf form
|
||||
@ -434,7 +438,7 @@ export def FTinc()
|
||||
setf php
|
||||
# Pascal supports // comments but they're vary rarely used for file
|
||||
# headers so assume POV-Ray
|
||||
elseif lines =~ '^\s*\%({\|(\*\)' || lines =~? s:ft_pascal_keywords
|
||||
elseif lines =~ '^\s*\%({\|(\*\)' || lines =~? ft_pascal_keywords
|
||||
setf pascal
|
||||
else
|
||||
FTasmsyntax()
|
||||
@ -478,7 +482,7 @@ export def FTprogress_asm()
|
||||
break
|
||||
endif
|
||||
lnum += 1
|
||||
endw
|
||||
endwhile
|
||||
setf progress
|
||||
enddef
|
||||
|
||||
@ -496,7 +500,7 @@ export def FTprogress_pascal()
|
||||
var lnum = 1
|
||||
while lnum <= 10 && lnum < line('$')
|
||||
var line = getline(lnum)
|
||||
if line =~ s:ft_pascal_comments || line =~? s:ft_pascal_keywords
|
||||
if line =~ ft_pascal_comments || line =~? ft_pascal_keywords
|
||||
setf pascal
|
||||
return
|
||||
elseif line !~ '^\s*$' || line =~ '^/\*'
|
||||
@ -505,7 +509,7 @@ export def FTprogress_pascal()
|
||||
break
|
||||
endif
|
||||
lnum += 1
|
||||
endw
|
||||
endwhile
|
||||
setf progress
|
||||
enddef
|
||||
|
||||
@ -514,7 +518,7 @@ export def FTpp()
|
||||
exe "setf " .. g:filetype_pp
|
||||
else
|
||||
var line = getline(nextnonblank(1))
|
||||
if line =~ s:ft_pascal_comments || line =~? s:ft_pascal_keywords
|
||||
if line =~ ft_pascal_comments || line =~? ft_pascal_keywords
|
||||
setf pascal
|
||||
else
|
||||
setf puppet
|
||||
@ -685,8 +689,8 @@ export def FTRules()
|
||||
endtry
|
||||
var dir = expand('<amatch>:p:h')
|
||||
for line in config_lines
|
||||
if line =~ s:ft_rules_udev_rules_pattern
|
||||
var udev_rules = substitute(line, s:ft_rules_udev_rules_pattern, '\1', "")
|
||||
if line =~ ft_rules_udev_rules_pattern
|
||||
var udev_rules = substitute(line, ft_rules_udev_rules_pattern, '\1', "")
|
||||
if dir == udev_rules
|
||||
setf udevrules
|
||||
endif
|
||||
@ -892,6 +896,23 @@ export def FTtf()
|
||||
setf tf
|
||||
enddef
|
||||
|
||||
# Determine if a *.src file is Kuka Robot Language
|
||||
export def FTsrc()
|
||||
if exists("g:filetype_src")
|
||||
exe "setf " .. g:filetype_src
|
||||
elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|\%(global\s\+\)\?def\>\)'
|
||||
setf krl
|
||||
endif
|
||||
enddef
|
||||
|
||||
# Determine if a *.dat file is Kuka Robot Language
|
||||
export def FTdat()
|
||||
if exists("g:filetype_dat")
|
||||
exe "setf " .. g:filetype_dat
|
||||
elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|defdat\>\)'
|
||||
setf krl
|
||||
endif
|
||||
enddef
|
||||
|
||||
# Uncomment this line to check for compilation errors early
|
||||
# defcompile
|
||||
|
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
|
@ -2,7 +2,7 @@
|
||||
" Maintainer: <vacancy>
|
||||
" Previous Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
|
||||
" Version: 0.9
|
||||
" Last Updated: 2020 Oct 9
|
||||
" Last Updated: 2022 Mar 30
|
||||
"
|
||||
" Roland Puntaier: this file contains adaptations for python3 and is parallel to pythoncomplete.vim
|
||||
"
|
||||
@ -91,6 +91,9 @@ endfunction
|
||||
|
||||
function! s:DefPython()
|
||||
py3 << PYTHONEOF
|
||||
import warnings
|
||||
warnings.simplefilter(action='ignore', category=FutureWarning)
|
||||
|
||||
import sys, tokenize, io, types
|
||||
from token import NAME, DEDENT, NEWLINE, STRING
|
||||
|
||||
|
BIN
runtime/bitmaps/vim.ico
Normal file
BIN
runtime/bitmaps/vim.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
@ -1,5 +1,5 @@
|
||||
" Maintainer: Drew Vogel <dvogel@sidejump.org>
|
||||
" Last Change: 2021 Jul 25
|
||||
" Last Change: 2022 Mar 20
|
||||
"
|
||||
" Replaced rgb.txt as the source of de facto standard color names. This is
|
||||
" sourced each time the colorscheme command is run. It is also sourced each
|
||||
@ -430,6 +430,8 @@ call extend(v:colornames, {
|
||||
\ 'yellow2': '#eeee00',
|
||||
\ 'yellow3': '#cdcd00',
|
||||
\ 'yellow4': '#8b8b00',
|
||||
\ 'dark yellow': '#8b8b00',
|
||||
\ 'darkyellow': '#8b8b00',
|
||||
\ 'gold1': '#ffd700',
|
||||
\ 'gold2': '#eec900',
|
||||
\ 'gold3': '#cdad00',
|
||||
@ -506,6 +508,8 @@ call extend(v:colornames, {
|
||||
\ 'orangered2': '#ee4000',
|
||||
\ 'orangered3': '#cd3700',
|
||||
\ 'orangered4': '#8b2500',
|
||||
\ 'light red': '#ff8b8b',
|
||||
\ 'lightred': '#ff8b8b',
|
||||
\ 'red1': '#ff0000',
|
||||
\ 'red2': '#ee0000',
|
||||
\ 'red3': '#cd0000',
|
||||
@ -538,6 +542,8 @@ call extend(v:colornames, {
|
||||
\ 'violetred2': '#ee3a8c',
|
||||
\ 'violetred3': '#cd3278',
|
||||
\ 'violetred4': '#8b2252',
|
||||
\ 'light magenta': '#ff8bff',
|
||||
\ 'lightmagenta': '#ff8bff',
|
||||
\ 'magenta1': '#ff00ff',
|
||||
\ 'magenta2': '#ee00ee',
|
||||
\ 'magenta3': '#cd00cd',
|
||||
|
@ -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 Feb 09
|
||||
*autocmd.txt* For Vim version 8.2. Last change: 2022 Mar 27
|
||||
|
||||
|
||||
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").
|
||||
@ -365,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
|
||||
|
||||
@ -689,9 +690,9 @@ CursorHoldI Just like CursorHold, but in Insert mode.
|
||||
CursorMoved After the cursor was moved in Normal or Visual
|
||||
mode. Also when the text of the cursor line
|
||||
has been changed, e.g., with "x", "rx" or "p".
|
||||
Not triggered when there is typeahead, while
|
||||
executing commands in a script file, when
|
||||
an operator is pending or when moving to
|
||||
Not always triggered when there is typeahead,
|
||||
while executing commands in a script file,
|
||||
when an operator is pending or when moving to
|
||||
another window while remaining at the same
|
||||
cursor position.
|
||||
For an example see |match-parens|.
|
||||
@ -1639,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
|
||||
|
||||
@ -1738,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 Feb 08
|
||||
*builtin.txt* For Vim version 8.2. Last change: 2022 Mar 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -161,7 +161,8 @@ exists_compiled({expr}) Number |TRUE| if {expr} exists at compile time
|
||||
exp({expr}) Float exponential of {expr}
|
||||
expand({expr} [, {nosuf} [, {list}]])
|
||||
any expand special keywords in {expr}
|
||||
expandcmd({expr}) String expand {expr} like with `:edit`
|
||||
expandcmd({string} [, {options}])
|
||||
String expand {string} like with `:edit`
|
||||
extend({expr1}, {expr2} [, {expr3}])
|
||||
List/Dict insert items of {expr2} into {expr1}
|
||||
extendnew({expr1}, {expr2} [, {expr3}])
|
||||
@ -539,8 +540,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
|
||||
@ -854,7 +855,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
|
||||
@ -1134,7 +1135,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.
|
||||
|
||||
@ -1147,7 +1148,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|.
|
||||
@ -1197,7 +1198,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)
|
||||
@ -1392,7 +1393,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.
|
||||
@ -1401,7 +1402,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|: >
|
||||
@ -1562,14 +1563,15 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
|
||||
or another valid interrupt key, confirm() returns 0.
|
||||
|
||||
An example: >
|
||||
:let choice = confirm("What do you want?", "&Apples\n&Oranges\n&Bananas", 2)
|
||||
:if choice == 0
|
||||
: echo "make up your mind!"
|
||||
:elseif choice == 3
|
||||
: echo "tasteful"
|
||||
:else
|
||||
: echo "I prefer bananas myself."
|
||||
:endif
|
||||
let choice = confirm("What do you want?",
|
||||
\ "&Apples\n&Oranges\n&Bananas", 2)
|
||||
if choice == 0
|
||||
echo "make up your mind!"
|
||||
elseif choice == 3
|
||||
echo "tasteful"
|
||||
else
|
||||
echo "I prefer bananas myself."
|
||||
endif
|
||||
< In a GUI dialog, buttons are used. The layout of the buttons
|
||||
depends on the 'v' flag in 'guioptions'. If it is included,
|
||||
the buttons are always put vertically. Otherwise, confirm()
|
||||
@ -2082,9 +2084,12 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
|
||||
dict.key |internal-variables|). Also works
|
||||
list[i] for |curly-braces-names|, |Dictionary|
|
||||
import.Func entries, |List| items, imported
|
||||
items,etc.
|
||||
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.: >
|
||||
@ -2137,7 +2142,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")
|
||||
@ -2243,12 +2249,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
|
||||
@ -2288,16 +2294,28 @@ expand({string} [, {nosuf} [, {list}]]) *expand()*
|
||||
Can also be used as a |method|: >
|
||||
Getpattern()->expand()
|
||||
|
||||
expandcmd({string}) *expandcmd()*
|
||||
expandcmd({string} [, {options}]) *expandcmd()*
|
||||
Expand special items in String {string} like what is done for
|
||||
an Ex command such as `:edit`. This expands special keywords,
|
||||
like with |expand()|, and environment variables, anywhere in
|
||||
{string}. "~user" and "~/path" are only expanded at the
|
||||
start.
|
||||
Returns the expanded string. Example: >
|
||||
:echo expandcmd('make %<.o')
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
The following items are supported in the {options} Dict
|
||||
argument:
|
||||
errmsg If set to TRUE, error messages are displayed
|
||||
if an error is encountered during expansion.
|
||||
By default, error messages are not displayed.
|
||||
|
||||
Returns the expanded string. If an error is encountered
|
||||
during expansion, the unmodified {string} is returned.
|
||||
|
||||
Example: >
|
||||
:echo expandcmd('make %<.o')
|
||||
make /path/runtime/doc/builtin.o
|
||||
:echo expandcmd('make %<.o', {'errmsg': v:true})
|
||||
<
|
||||
Can also be used as a |method|: >
|
||||
GetCommand()->expandcmd()
|
||||
<
|
||||
extend({expr1}, {expr2} [, {expr3}]) *extend()*
|
||||
@ -2629,7 +2647,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
|
||||
<
|
||||
@ -2810,7 +2828,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"}
|
||||
@ -3009,7 +3027,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)
|
||||
@ -3070,9 +3088,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
|
||||
@ -3226,7 +3244,8 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
|
||||
arglist file names in argument list
|
||||
augroup autocmd groups
|
||||
buffer buffer names
|
||||
behave :behave suboptions
|
||||
behave |:behave| suboptions
|
||||
breakpoint |:breakadd| and |:breakdel| suboptions
|
||||
color color schemes
|
||||
command Ex command
|
||||
cmdline |cmdline-completion| result
|
||||
@ -3243,7 +3262,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
|
||||
function function name
|
||||
help help subjects
|
||||
highlight highlight groups
|
||||
history :history suboptions
|
||||
history |:history| suboptions
|
||||
locale locale names (as output of locale -a)
|
||||
mapclear buffer argument
|
||||
mapping mapping name
|
||||
@ -3251,6 +3270,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
|
||||
messages |:messages| suboptions
|
||||
option options
|
||||
packadd optional package |pack-add| names
|
||||
scriptnames sourced script names |:scriptnames|
|
||||
shellcmd Shell command
|
||||
sign |:sign| suboptions
|
||||
syntax syntax file names |'syntax'|
|
||||
@ -3268,6 +3288,13 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
|
||||
is applied to filter the results. Otherwise all the matches
|
||||
are returned. The 'wildignorecase' option always applies.
|
||||
|
||||
If the 'wildoptions' option contains 'fuzzy', then fuzzy
|
||||
matching is used to get the completion matches. Otherwise
|
||||
regular expression matching is used. Thus this function
|
||||
follows the user preference, what happens on the command line.
|
||||
If you do not want this you can make 'wildoptions' empty
|
||||
before calling getcompletion() and restore it afterwards.
|
||||
|
||||
If {type} is "cmdline", then the |cmdline-completion| result is
|
||||
returned. For example, to complete the possible values after
|
||||
a ":call" command: >
|
||||
@ -3869,7 +3896,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}, '&')
|
||||
@ -4002,7 +4029,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)
|
||||
@ -4257,7 +4284,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': >
|
||||
@ -4276,7 +4303,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|. >
|
||||
@ -4522,7 +4549,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: ")
|
||||
@ -4696,7 +4723,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|: >
|
||||
@ -4711,7 +4738,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()|.
|
||||
@ -4923,7 +4950,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|.
|
||||
@ -4999,12 +5026,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)
|
||||
@ -5012,7 +5039,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
|
||||
@ -5139,7 +5166,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
|
||||
@ -5157,7 +5184,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
|
||||
@ -5171,19 +5198,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|.
|
||||
@ -5259,7 +5286,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')
|
||||
@ -5568,7 +5595,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: >
|
||||
@ -5782,7 +5809,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|.
|
||||
|
||||
@ -6223,7 +6250,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
|
||||
@ -6420,7 +6447,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(".")
|
||||
<
|
||||
@ -6617,16 +6644,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}
|
||||
@ -6647,7 +6680,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
|
||||
@ -6676,7 +6709,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()
|
||||
@ -6696,12 +6729,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}
|
||||
@ -6709,12 +6747,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|: >
|
||||
@ -6739,7 +6777,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.
|
||||
@ -6755,13 +6793,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()*
|
||||
@ -6892,7 +6930,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>
|
||||
<
|
||||
@ -6916,6 +6954,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)
|
||||
@ -7014,7 +7054,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$
|
||||
@ -7098,11 +7138,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
|
||||
@ -7897,7 +7937,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
|
||||
@ -7926,10 +7966,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|: >
|
||||
@ -8016,21 +8056,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
|
||||
@ -8047,19 +8088,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
|
||||
@ -8142,8 +8183,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()*
|
||||
@ -8701,7 +8741,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: >
|
||||
@ -8709,7 +8749,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)
|
||||
@ -8898,8 +8938,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
|
||||
@ -9016,7 +9056,7 @@ taglist({expr} [, {filename}]) *taglist()*
|
||||
entry depends on the language specific
|
||||
kind values. Only available when
|
||||
using a tags file generated by
|
||||
Exuberant ctags or hdrtag.
|
||||
Universal/Exuberant ctags or hdrtag.
|
||||
static A file specific tag. Refer to
|
||||
|static-tag| for more information.
|
||||
More entries may be present, depending on the content of the
|
||||
@ -9080,7 +9120,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
|
||||
@ -9277,7 +9317,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) >
|
||||
@ -9468,7 +9508,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.
|
||||
@ -9672,7 +9712,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()
|
||||
@ -9813,7 +9853,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: 2022 Feb 04
|
||||
*change.txt* For Vim version 8.2. Last change: 2022 Mar 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -778,8 +778,8 @@ 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* *E1241* *E1242*
|
||||
@ -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
|
||||
@ -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 =".
|
||||
|
||||
|
@ -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 Mar 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -53,6 +53,7 @@ RAW nothing known, Vim cannot tell where a message ends
|
||||
NL every message ends in a NL (newline) character
|
||||
JSON JSON encoding |json_encode()|
|
||||
JS JavaScript style JSON-like encoding |js_encode()|
|
||||
LSP Language Server Protocol encoding |language-server-protocol|
|
||||
|
||||
Common combination are:
|
||||
- Using a job connected through pipes in NL mode. E.g., to run a style
|
||||
@ -91,7 +92,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
|
||||
@ -118,10 +119,13 @@ To open a channel: >
|
||||
|
||||
Use |ch_status()| to see if the channel could be opened.
|
||||
|
||||
{address} has the form "hostname:port". E.g., "localhost:8765".
|
||||
|
||||
When using an IPv6 address, enclose it within square brackets. E.g.,
|
||||
"[2001:db8::1]:8765".
|
||||
*channel-address*
|
||||
{address} can be a domain name or an IP address, followed by a port number, or
|
||||
a Unix-domain socket path prefixed by "unix:". E.g. >
|
||||
www.example.com:80 " domain + port
|
||||
127.0.0.1:1234 " IPv4 + port
|
||||
[2001:db8::1]:8765 " IPv6 + port
|
||||
unix:/tmp/my-socket " Unix-domain socket path
|
||||
|
||||
{options} is a dictionary with optional entries: *channel-open-options*
|
||||
|
||||
@ -130,18 +134,19 @@ When using an IPv6 address, enclose it within square brackets. E.g.,
|
||||
"js" - Use JS (JavaScript) encoding, more efficient than JSON.
|
||||
"nl" - Use messages that end in a NL character
|
||||
"raw" - Use raw messages
|
||||
"lsp" - Use language server protocol encoding
|
||||
*channel-callback* *E921*
|
||||
"callback" A function that is called when a message is received that is
|
||||
not handled otherwise (e.g. a JSON message with ID zero). It
|
||||
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"})
|
||||
<
|
||||
When "mode" is "json" or "js" the "msg" argument is the body
|
||||
of the received message, converted to Vim types.
|
||||
When "mode" is "json" or "js" or "lsp" the "msg" argument is
|
||||
the body of the received message, converted to Vim types.
|
||||
When "mode" is "nl" the "msg" argument is one message,
|
||||
excluding the NL.
|
||||
When "mode" is "raw" the "msg" argument is the whole message
|
||||
@ -165,7 +170,19 @@ When using an IPv6 address, enclose it within square brackets. E.g.,
|
||||
to check for messages, the close_cb may be invoked while still
|
||||
in the callback. The plugin must handle this somehow, it can
|
||||
be useful to know that no more data is coming.
|
||||
*channel-drop*
|
||||
If it is not known if there is a message to be read, use a
|
||||
try/catch block: >
|
||||
try
|
||||
let msg = ch_readraw(a:channel)
|
||||
catch
|
||||
let msg = 'no message'
|
||||
endtry
|
||||
try
|
||||
let err = ch_readraw(a:channel, #{part: 'err'})
|
||||
catch
|
||||
let err = 'no error'
|
||||
endtry
|
||||
< *channel-drop*
|
||||
"drop" Specifies when to drop messages:
|
||||
"auto" When there is no callback to handle a message.
|
||||
The "close_cb" is also considered for this.
|
||||
@ -443,7 +460,7 @@ to check if there is something to read.
|
||||
Note that when there is no callback, messages are dropped. To avoid that add
|
||||
a close callback to the channel.
|
||||
|
||||
To read all output from a RAW channel that is available: >
|
||||
To read all normal output from a RAW channel that is available: >
|
||||
let output = ch_readraw(channel)
|
||||
To read the error output: >
|
||||
let output = ch_readraw(channel, {"part": "err"})
|
||||
@ -503,6 +520,7 @@ ch_evalexpr({handle}, {expr} [, {options}]) *ch_evalexpr()*
|
||||
according to the type of channel. The function cannot be used
|
||||
with a raw channel. See |channel-use|.
|
||||
{handle} can be a Channel or a Job that has a Channel.
|
||||
When using the "lsp" channel mode, {expr} must be a |Dict|.
|
||||
*E917*
|
||||
{options} must be a Dictionary. It must not have a "callback"
|
||||
entry. It can have a "timeout" entry to specify the timeout
|
||||
@ -564,10 +582,15 @@ ch_info({handle}) *ch_info()*
|
||||
When opened with ch_open():
|
||||
"hostname" the hostname of the address
|
||||
"port" the port of the address
|
||||
"path" the path of the Unix-domain socket
|
||||
"sock_status" "open" or "closed"
|
||||
"sock_mode" "NL", "RAW", "JSON" or "JS"
|
||||
"sock_io" "socket"
|
||||
"sock_timeout" timeout in msec
|
||||
|
||||
Note that "pair" is only present for Unix-domain sockets, for
|
||||
regular ones "hostname" and "port" are present instead.
|
||||
|
||||
When opened with job_start():
|
||||
"out_status" "open", "buffered" or "closed"
|
||||
"out_mode" "NL", "RAW", "JSON" or "JS"
|
||||
@ -578,7 +601,7 @@ ch_info({handle}) *ch_info()*
|
||||
"err_io" "out", "null", "pipe", "file" or "buffer"
|
||||
"err_timeout" timeout in msec
|
||||
"in_status" "open" or "closed"
|
||||
"in_mode" "NL", "RAW", "JSON" or "JS"
|
||||
"in_mode" "NL", "RAW", "JSON", "JS" or "LSP"
|
||||
"in_io" "null", "pipe", "file" or "buffer"
|
||||
"in_timeout" timeout in msec
|
||||
|
||||
@ -626,11 +649,8 @@ ch_open({address} [, {options}]) *ch_open()*
|
||||
Open a channel to {address}. See |channel|.
|
||||
Returns a Channel. Use |ch_status()| to check for failure.
|
||||
|
||||
{address} is a String and has the form "hostname:port", e.g.,
|
||||
"localhost:8765".
|
||||
|
||||
When using an IPv6 address, enclose it within square brackets.
|
||||
E.g., "[2001:db8::1]:8765".
|
||||
{address} is a String, see |channel-address| for the possible
|
||||
accepted forms.
|
||||
|
||||
If {options} is given it must be a |Dictionary|.
|
||||
See |channel-open-options|.
|
||||
@ -674,6 +694,7 @@ ch_sendexpr({handle}, {expr} [, {options}]) *ch_sendexpr()*
|
||||
with a raw channel.
|
||||
See |channel-use|. *E912*
|
||||
{handle} can be a Channel or a Job that has a Channel.
|
||||
When using the "lsp" channel mode, {expr} must be a |Dict|.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetChannel()->ch_sendexpr(expr)
|
||||
@ -1288,18 +1309,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 +1331,6 @@ prompt. >
|
||||
\ err_cb: function('GotOutput'),
|
||||
\ exit_cb: function('JobExit'),
|
||||
\ })
|
||||
let shell_ch = job_getchannel(shell_job)
|
||||
|
||||
new
|
||||
set buftype=prompt
|
||||
@ -1321,6 +1341,117 @@ 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
|
||||
|
||||
==============================================================================
|
||||
14. Language Server Protocol *language-server-protocol*
|
||||
|
||||
The language server protocol specification is available at:
|
||||
|
||||
https://microsoft.github.io/language-server-protocol/specification
|
||||
|
||||
Each LSP protocol message starts with a simple HTTP header followed by the
|
||||
payload encoded in JSON-RPC format. This is described in:
|
||||
|
||||
https://www.jsonrpc.org/specification
|
||||
|
||||
For messages received on a channel with mode set to "lsp", Vim will process
|
||||
the HTTP header and decode the payload into a Vim |Dict| type and call the
|
||||
channel callback or the specified callback function. When sending messages on
|
||||
a channel using |ch_evalexpr()| or |ch_sendexpr()|, Vim will add the HTTP
|
||||
header and encode the Vim expression into JSON-RPC.
|
||||
|
||||
To open a channel using the 'lsp' mode, set the 'mode' item in the |ch_open()|
|
||||
{options} argument to 'lsp'. Example: >
|
||||
|
||||
let ch = ch_open(..., #{mode: 'lsp'})
|
||||
|
||||
To open a channel using the 'lsp' mode with a job, set the 'in_mode' and
|
||||
'out_mode' items in the |job_start()| {options} argument to 'lsp'. Example: >
|
||||
|
||||
let job = job_start(...., #{in_mode: 'lsp', out_mode: 'lsp'})
|
||||
|
||||
To synchronously send a JSON-RPC request to the server, use the |ch_evalexpr()|
|
||||
function. This function will return the response from the server. You can use
|
||||
the 'timeout' field in the {options} argument to control the response wait
|
||||
time. Example: >
|
||||
|
||||
let req = {}
|
||||
let req.method = 'textDocument/definition'
|
||||
let req.params = {}
|
||||
let req.params.textDocument = #{uri: 'a.c'}
|
||||
let req.params.position = #{line: 10, character: 3}
|
||||
let resp = ch_evalexpr(ch, req, #{timeout: 100})
|
||||
|
||||
Note that in the request message the 'id' field should not be specified. If it
|
||||
is specified, then Vim will overwrite the value with an internally generated
|
||||
identifier. Vim currently supports only a number type for the 'id' field.
|
||||
|
||||
To send a JSON-RPC request to the server and asynchronously process the
|
||||
response, use the |ch_sendexpr()| function and supply a callback function.
|
||||
Example: >
|
||||
|
||||
let req = {}
|
||||
let req.method = 'textDocument/hover'
|
||||
let req.params = {}
|
||||
let req.params.textDocument = #{uri: 'a.c'}
|
||||
let req.params.position = #{line: 10, character: 3}
|
||||
let resp = ch_sendexpr(ch, req, #{callback: 'MyFn'})
|
||||
|
||||
To send a JSON-RPC notification message to the server, use the |ch_sendexpr()|
|
||||
function. Example: >
|
||||
|
||||
call ch_sendexpr(ch, #{method: 'initialized'})
|
||||
|
||||
To respond to a JSON-RPC request message from the server, use the
|
||||
|ch_sendexpr()| function. In the response message, copy the 'id' field value
|
||||
from the server request message. Example: >
|
||||
|
||||
let resp = {}
|
||||
let resp.id = req.id
|
||||
let resp.result = 1
|
||||
call ch_sendexpr(ch, resp)
|
||||
|
||||
The JSON-RPC notification messages from the server are delivered through the
|
||||
|channel-callback| function.
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
@ -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
|
||||
|
@ -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 Feb 04
|
||||
*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
|
||||
@ -1695,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:
|
||||
|
@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.2. Last change: 2022 Feb 04
|
||||
*eval.txt* For Vim version 8.2. Last change: 2022 Mar 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -470,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
|
||||
|
||||
@ -498,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 ~
|
||||
@ -568,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: >
|
||||
@ -576,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
|
||||
|
||||
|
||||
@ -677,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 ~
|
||||
@ -921,13 +921,13 @@ 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
|
||||
@ -1371,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)
|
||||
@ -1530,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
|
||||
@ -1820,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
|
||||
@ -1834,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.
|
||||
@ -1955,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,
|
||||
@ -2182,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()|.
|
||||
@ -2214,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
|
||||
@ -2224,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.
|
||||
@ -2828,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
|
||||
|
||||
@ -2873,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("."))
|
||||
<
|
||||
@ -2884,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()
|
||||
<
|
||||
@ -3001,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|.
|
||||
@ -3075,7 +3083,7 @@ 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.
|
||||
@ -3145,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;"
|
||||
@ -3421,14 +3429,17 @@ text...
|
||||
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
|
||||
@ -3437,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("$")
|
||||
@ -3470,12 +3487,14 @@ 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|. *E1177*
|
||||
|
||||
@ -3485,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)
|
||||
@ -3510,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] *E1140*
|
||||
Like ":for" above, but each item in {listlist} must be
|
||||
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]]
|
||||
@ -3520,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: >
|
||||
@ -3560,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
|
||||
@ -3577,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: >
|
||||
@ -3605,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`).
|
||||
|
||||
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: >
|
||||
@ -3636,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
|
||||
@ -3651,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 |:_%|. >
|
||||
@ -3681,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.
|
||||
@ -3691,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
|
||||
@ -3708,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>"
|
||||
|
||||
@ -4026,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
|
||||
@ -4429,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
|
||||
|
||||
@ -4626,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
|
||||
:
|
||||
@ -4653,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
|
||||
:
|
||||
@ -4672,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"
|
||||
@ -4742,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
|
||||
@ -4804,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
|
||||
@ -4815,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
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
*ft_ada.txt* For Vim version 8.2. Last change: 2010 Jul 20
|
||||
*ft_ada.txt* For Vim version 8.2. Last change: 2022 Mar 13
|
||||
|
||||
|
||||
ADA FILE TYPE PLUG-INS REFERENCE MANUAL~
|
||||
@ -89,9 +89,9 @@ file is opened and adds Ada related entries to the main and pop-up menu.
|
||||
*ft-ada-omni*
|
||||
|
||||
The Ada omni-completions (|i_CTRL-X_CTRL-O|) uses tags database created either
|
||||
by "gnat xref -v" or the "exuberant Ctags (http://ctags.sourceforge.net). The
|
||||
complete function will automatically detect which tool was used to create the
|
||||
tags file.
|
||||
by "gnat xref -v" or the "Universal Ctags" (https://ctags.io). The complete
|
||||
function will automatically detect which tool was used to create the tags
|
||||
file.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
3.1 Omni Completion with "gnat xref" ~
|
||||
@ -125,18 +125,18 @@ NOTE: "gnat xref -v" is very tricky to use as it has almost no diagnostic
|
||||
3.2 Omni Completion with "ctags"~
|
||||
*ada-ctags*
|
||||
|
||||
Exuberant Ctags uses its own multi-language code parser. The parser is quite
|
||||
fast, produces a lot of extra information (hence the name "Exuberant Ctags")
|
||||
and can run on files which currently do not compile.
|
||||
Universal/Exuberant Ctags use their own multi-language code parser. The
|
||||
parser is quite fast, produces a lot of extra information and can run on files
|
||||
which currently do not compile.
|
||||
|
||||
There are also lots of other Vim-tools which use exuberant Ctags.
|
||||
There are also lots of other Vim-tools which use Universal/Exuberant Ctags.
|
||||
Universal Ctags is preferred, Exuberant Ctags is no longer being developed.
|
||||
|
||||
You will need to install a version of the Exuberant Ctags which has Ada
|
||||
support patched in. Such a version is available from the GNU Ada Project
|
||||
(http://gnuada.sourceforge.net).
|
||||
You will need to install Universal Ctags which is available from
|
||||
https://ctags.io
|
||||
|
||||
The Ada parser for Exuberant Ctags is fairly new - don't expect complete
|
||||
support yet.
|
||||
The Ada parser for Universal/Exuberant Ctags is fairly new - don't expect
|
||||
complete support yet.
|
||||
|
||||
==============================================================================
|
||||
4. Compiler Support ~
|
||||
|
@ -47,20 +47,20 @@ Numbers, subscripts and superscripts are available with 's' and 'S':
|
||||
|
||||
But some don't come defined by default. Those are digraph definitions you can
|
||||
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
|
||||
@ -25,7 +25,7 @@ Other GUI documentation:
|
||||
|
||||
First you must make sure you actually have a version of Vim with the GUI code
|
||||
included. You can check this with the ":version" command, it says "with xxx
|
||||
GUI", where "xxx" is X11-Motif, X11-Athena, Photon, GTK2, GTK3, etc., or
|
||||
GUI", where "xxx" is X11-Motif, Photon, GTK2, GTK3, etc., or
|
||||
"MS-Windows 32 bit GUI version".
|
||||
|
||||
How to start the GUI depends on the system used. Mostly you can run the
|
||||
@ -108,7 +108,7 @@ There are a number of options which only have meaning in the GUI version of
|
||||
Vim. These are 'guicursor', 'guifont', 'guipty' and 'guioptions'. They are
|
||||
documented in |options.txt| with all the other options.
|
||||
|
||||
If using the Motif or Athena version of the GUI (but not for the GTK+ or
|
||||
If using the Motif version of the GUI (but not for the GTK+ or
|
||||
Win32 version), a number of X resources are available. See |gui-resources|.
|
||||
|
||||
Another way to set the colors for different occasions is with highlight
|
||||
@ -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
|
||||
@ -235,7 +236,7 @@ takes too much time or you don't like the cursor jumping to another line,
|
||||
include the 'h' flag in 'guioptions'. Then the scrolling is limited by the
|
||||
text of the current cursor line.
|
||||
|
||||
*athena-intellimouse*
|
||||
*motif-intellimouse*
|
||||
If you have an Intellimouse and an X server that supports using the wheel,
|
||||
then you can use the wheel to scroll the text up and down in gvim. This works
|
||||
with XFree86 4.0 and later, and with some older versions when you add patches.
|
||||
@ -260,6 +261,7 @@ Other options that are relevant:
|
||||
'mousefocus' window focus follows mouse pointer |gui-mouse-focus|
|
||||
'mousemodel' what mouse button does which action
|
||||
'mousehide' hide mouse pointer while typing text
|
||||
'mousemoveevent' enable mouse move events so that <MouseMove> can be mapped
|
||||
'selectmode' whether to start Select mode or Visual mode
|
||||
|
||||
A quick way to set these is with the ":behave" command.
|
||||
@ -405,6 +407,9 @@ These mappings make selection work the way it probably should in a Motif
|
||||
application, with shift-left mouse allowing for extending the visual area
|
||||
rather than the right mouse button.
|
||||
|
||||
<MouseMove> may be mapped, but 'mousemoveevent' must be enabled to use the
|
||||
mapping.
|
||||
|
||||
Mouse mapping with modifiers does not work for modeless selection.
|
||||
|
||||
|
||||
@ -741,7 +746,7 @@ because the item will never be selected. Use a single colon to keep it
|
||||
simple.
|
||||
|
||||
*gui-toolbar*
|
||||
The toolbar is currently available in the Win32, Athena, Motif, GTK+ (X11),
|
||||
The toolbar is currently available in the Win32, Motif, GTK+ (X11),
|
||||
and Photon GUI. It should turn up in other GUIs in due course. The
|
||||
default toolbar is setup in menu.vim.
|
||||
The display of the toolbar is controlled by the 'guioptions' letter 'T'. You
|
||||
@ -857,7 +862,7 @@ The window toolbar uses the ToolbarLine and ToolbarButton highlight groups.
|
||||
When splitting the window the window toolbar is not copied to the new window.
|
||||
|
||||
*popup-menu*
|
||||
In the Win32, GTK+, Motif, Athena and Photon GUI, you can define the
|
||||
In the Win32, GTK+, Motif and Photon GUI, you can define the
|
||||
special menu "PopUp". This is the menu that is displayed when the right mouse
|
||||
button is pressed, if 'mousemodel' is set to popup or popup_setpos.
|
||||
Example: >
|
||||
|
@ -1,4 +1,4 @@
|
||||
*gui_w32.txt* For Vim version 8.2. Last change: 2021 Oct 24
|
||||
*gui_w32.txt* For Vim version 8.2. Last change: 2022 Mar 09
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -236,7 +236,8 @@ The "* register reflects the contents of the clipboard. |quotestar|
|
||||
|
||||
When the "unnamed" string is included in the 'clipboard' option, the unnamed
|
||||
register is the same. Thus you can yank to and paste from the clipboard
|
||||
without prepending "* to commands.
|
||||
without prepending "* to commands. If this doesn't work use the "unnamedplus"
|
||||
string in the 'clipboard' option.
|
||||
|
||||
The 'a' flag in 'guioptions' is not included by default. This means that text
|
||||
is only put on the clipboard when an operation is performed on it. Just
|
||||
|
@ -1,11 +1,11 @@
|
||||
*gui_x11.txt* For Vim version 8.2. Last change: 2020 Jun 05
|
||||
*gui_x11.txt* For Vim version 8.2. Last change: 2022 Apr 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Vim's Graphical User Interface *gui-x11* *GUI-X11*
|
||||
*Athena* *Motif*
|
||||
*Motif*
|
||||
1. Starting the X11 GUI |gui-x11-start|
|
||||
2. GUI Resources |gui-resources|
|
||||
3. Shell Commands |gui-pty|
|
||||
@ -64,7 +64,7 @@ flag in 'guioptions'. |-f|.
|
||||
==============================================================================
|
||||
2. GUI Resources *gui-resources* *.Xdefaults*
|
||||
|
||||
If using the Motif or Athena version of the GUI (not for the KDE, GTK+ or Win32
|
||||
If using the Motif version of the GUI (not for the KDE, GTK+ or Win32
|
||||
version), a number of X resources are available. You should use Vim's class
|
||||
"Vim" when setting these. They are as follows:
|
||||
|
||||
@ -96,7 +96,6 @@ version), a number of X resources are available. You should use Vim's class
|
||||
is same size as terminal that started it).
|
||||
scrollbarWidth Thickness of scrollbars.
|
||||
borderWidth Thickness of border around text area.
|
||||
menuHeight Height of the menu bar (only for Athena).
|
||||
|
||||
A special font for italic, bold, and italic-bold text will only be used if
|
||||
the user has specified one via a resource. No attempt is made to guess what
|
||||
@ -135,12 +134,9 @@ which make Motif applications look even better, highly recommended!
|
||||
|
||||
The "Vim*fontList" is to set the menu font for Motif. Example: >
|
||||
Vim*menuBar*fontList: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
|
||||
With Athena: >
|
||||
Vim*menuBar*SmeBSB*font: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
|
||||
Vim*menuBar*MenuButton*font: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
|
||||
|
||||
NOTE: A more portable, and indeed more correct, way to specify the menu font
|
||||
in either Motif or Athena is through the resource: >
|
||||
in Motif is through the resource: >
|
||||
Vim.menuFont: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
|
||||
Or, when compiled with the |+xfontset| feature: >
|
||||
Vim.menuFontSet: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
|
||||
@ -255,7 +251,7 @@ For example: >
|
||||
:10vmenu File.Print :w !lpr -Php3
|
||||
<
|
||||
*X11-icon*
|
||||
Vim uses a black&white icon by default when compiled with Motif or Athena. A
|
||||
Vim uses a black&white icon by default when compiled with Motif. A
|
||||
colored Vim icon is included as $VIMRUNTIME/vim32x32.xpm. For GTK+, this is
|
||||
the builtin icon used. Unfortunately, how you should install it depends on
|
||||
your window manager. When you use this, remove the 'i' flag from
|
||||
@ -594,8 +590,7 @@ GTK+ files on your system. When both GTK+ 2 and GTK+ 3 are available, GTK+ 2
|
||||
will be chosen unless --enable-gui=gtk3 is passed explicitly to configure.
|
||||
|
||||
If the GTK+ files cannot be found, then the Motif files will be searched for.
|
||||
Finally, if this fails, the Athena files will be searched for. If all three
|
||||
fail, the GUI will be disabled.
|
||||
If both fail, the GUI will be disabled.
|
||||
|
||||
For GTK+, Vim's configuration process uses pkg-config(1) to check if the
|
||||
GTK+ required for a specified build is properly installed and usable.
|
||||
@ -621,10 +616,10 @@ explicitly to configure, and avoid passing --enable-gnome-check to that, as
|
||||
the functionality of the GNOME 2 support has already been consolidated in
|
||||
GTK+ 3.
|
||||
|
||||
Otherwise, if you are using Motif or Athena, when you have the Motif or Athena
|
||||
files in a directory where configure doesn't look, edit the Makefile to enter
|
||||
the names of the directories. Search for "GUI_INC_LOC" for an example to set
|
||||
the Motif directories, "CONF_OPT_X" for Athena.
|
||||
Otherwise, if you are using Motif, when you have the Motif files in a
|
||||
directory where configure doesn't look, edit the Makefile to enter the names
|
||||
of the directories. Search for "GUI_INC_LOC" for an example to set
|
||||
the Motif directories.
|
||||
|
||||
*gui-x11-gtk*
|
||||
Currently, Vim supports both GTK+ 2 and GTK+ 3.
|
||||
@ -643,18 +638,11 @@ few problems, but you might make it compile and run with a bit of work, please
|
||||
send me the patches if you do). The newest releases of LessTif have been
|
||||
reported to work fine too.
|
||||
|
||||
*gui-x11-athena*
|
||||
The Athena version uses the Xaw widget set by default. If you have the 3D
|
||||
version, you might want to link with Xaw3d instead. This will make the
|
||||
menus look a bit better. Edit the Makefile and look for "XAW_LIB". The
|
||||
scrollbars will remain the same, because Vim has its own, which are already
|
||||
3D (in fact, they look more like Motif).
|
||||
|
||||
*gui-x11-neXtaw*
|
||||
The neXtaw version is mostly like Athena, but uses different widgets.
|
||||
*gui-x11-athena* *gui-x11-neXtaw*
|
||||
Support for the Athena GUI and neXtaw was removed in patch 8.2.4677.
|
||||
|
||||
*gui-x11-misc*
|
||||
In general, do not try to mix files from different GTK+, Motif, Athena and X11
|
||||
In general, do not try to mix files from different GTK+, Motif and X11
|
||||
versions. This will cause problems. For example, using header files for
|
||||
X11R5 with a library for X11R6 probably doesn't work (although the linking
|
||||
won't give an error message, Vim will crash later).
|
||||
|
@ -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 28
|
||||
*if_perl.txt* For Vim version 8.2. Last change: 2022 Mar 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Sven Verdoolaege
|
||||
@ -22,9 +22,9 @@ line of a file, regardless of the filename suffix, to check if a file is a
|
||||
Perl script (see scripts.vim in Vim's syntax directory). Vim assumes a file
|
||||
is POD text if the filename has a .POD suffix.
|
||||
|
||||
To use tags with Perl, you need a recent version of Exuberant ctags. Look
|
||||
here:
|
||||
http://ctags.sourceforge.net
|
||||
To use tags with Perl, you need Universal/Exuberant Ctags. Look here:
|
||||
Universal Ctags (preferred): https://ctags.io
|
||||
Exuberant Ctags: http://ctags.sourceforge.net
|
||||
|
||||
Alternatively, you can use the Perl script pltags.pl, which is shipped with
|
||||
Vim in the $VIMRUNTIME/tools directory. This script has currently more
|
||||
|
@ -1,4 +1,4 @@
|
||||
*if_pyth.txt* For Vim version 8.2. Last change: 2022 Feb 07
|
||||
*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*
|
||||
|
||||
@ -923,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.
|
||||
|
@ -42,11 +42,12 @@ is not a C compiler: it does not recognize all syntax. One requirement is
|
||||
that toplevel functions have a '{' in the first column. Otherwise they are
|
||||
easily confused with declarations.
|
||||
|
||||
These four options control C program indenting:
|
||||
These five options control C program indenting:
|
||||
'cindent' Enables Vim to perform C program indenting automatically.
|
||||
'cinkeys' Specifies which keys trigger reindenting in insert mode.
|
||||
'cinoptions' Sets your preferred indent style.
|
||||
'cinwords' Defines keywords that start an extra indent in the next line.
|
||||
'cinscopedecls' Defines strings that are recognized as a C++ scope declaration.
|
||||
|
||||
If 'lisp' is not on and 'equalprg' is empty, the "=" operator indents using
|
||||
Vim's built-in algorithm rather than calling an external program.
|
||||
@ -293,8 +294,9 @@ The examples below assume a 'shiftwidth' of 4.
|
||||
<
|
||||
*cino-g*
|
||||
gN Place C++ scope declarations N characters from the indent of the
|
||||
block they are in. (default 'shiftwidth'). A scope declaration
|
||||
can be "public:", "protected:" or "private:".
|
||||
block they are in. (default 'shiftwidth'). By default, a scope
|
||||
declaration is "public:", "protected:" or "private:". This can
|
||||
be adjusted with the 'cinscopedecls' option.
|
||||
|
||||
cino= cino=g0 >
|
||||
{ {
|
||||
|
@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 8.2. Last change: 2022 Feb 09
|
||||
*index.txt* For Vim version 8.2. Last change: 2022 Mar 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -1170,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 28
|
||||
|
||||
|
||||
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
|
||||
@ -800,7 +800,7 @@ If the previous expansion was split, because it got longer than 'textwidth',
|
||||
then just the text in the current line will be used.
|
||||
|
||||
If the match found is at the end of a line, then the first word in the next
|
||||
line will be inserted and the message "word from next line" displayed, if
|
||||
line will be inserted and the message "Word from other line" displayed, if
|
||||
this word is accepted the next CTRL-X CTRL-P or CTRL-X CTRL-N will search
|
||||
for those lines starting with this word.
|
||||
|
||||
@ -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
|
||||
@ -1408,11 +1409,16 @@ in 'runtimepath'. Thus for "java" it is autoload/javacomplete.vim.
|
||||
|
||||
C *ft-c-omni*
|
||||
|
||||
Completion of C code requires a tags file. You should use Exuberant ctags,
|
||||
because it adds extra information that is needed for completion. You can find
|
||||
it here: http://ctags.sourceforge.net/ Version 5.6 or later is recommended.
|
||||
Completion of C code requires a tags file. You should use Universal/
|
||||
Exuberant ctags, because it adds extra information that is needed for
|
||||
completion. You can find it here:
|
||||
Universal Ctags: https://ctags.io
|
||||
Exuberant Ctags: http://ctags.sourceforge.net
|
||||
|
||||
For version 5.5.4 you should add a patch that adds the "typename:" field:
|
||||
Universal Ctags is preferred, Exuberant Ctags is no longer being developed.
|
||||
|
||||
For Exuberant ctags, version 5.6 or later is recommended. For version 5.5.4
|
||||
you should add a patch that adds the "typename:" field:
|
||||
ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
|
||||
A compiled .exe for MS-Windows can be found at:
|
||||
http://ctags.sourceforge.net/
|
||||
@ -1533,8 +1539,11 @@ will be suggested. All other elements are not placed in suggestion list.
|
||||
PHP *ft-php-omni*
|
||||
|
||||
Completion of PHP code requires a tags file for completion of data from
|
||||
external files and for class aware completion. You should use Exuberant ctags
|
||||
version 5.5.4 or newer. You can find it here: http://ctags.sourceforge.net/
|
||||
external files and for class aware completion. You should use Universal/
|
||||
Exuberant ctags version 5.5.4 or newer. You can find it here:
|
||||
|
||||
Universal Ctags: https://ctags.io
|
||||
Exuberant Ctags: http://ctags.sourceforge.net
|
||||
|
||||
Script completes:
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 Feb 08
|
||||
*options.txt* For Vim version 8.2. Last change: 2022 Mar 29
|
||||
|
||||
|
||||
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
|
||||
|
||||
@ -977,7 +987,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
nostop like start, except CTRL-W and CTRL-U do not stop at the start of
|
||||
insert.
|
||||
|
||||
When the value is empty, Vi compatible backspacing is used.
|
||||
When the value is empty, Vi compatible backspacing is used, none of
|
||||
the ways mentioned for the items above are possible.
|
||||
|
||||
For backwards compatibility with version 5.4 and earlier:
|
||||
value effect ~
|
||||
@ -1132,7 +1143,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'*
|
||||
@ -1157,7 +1168,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
|
||||
@ -1208,10 +1219,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
|
||||
@ -1527,7 +1538,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).
|
||||
@ -1572,8 +1583,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:
|
||||
@ -1650,13 +1661,23 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
matter, include the keyword both the uppercase and lowercase:
|
||||
"if,If,IF".
|
||||
|
||||
*'clipboard'* *'cb'*
|
||||
*'cinscopedecls'* *'cinsd'*
|
||||
'cinscopedecls' 'cinsd' string (default "public,protected,private")
|
||||
local to buffer
|
||||
{not available when compiled without the |+cindent|
|
||||
feature}
|
||||
Keywords that are interpreted as a C++ scope declaration by |cino-g|.
|
||||
Useful e.g. for working with the Qt framework that defines additional
|
||||
scope declarations "signals", "public slots" and "private slots": >
|
||||
set cinscopedecls+=signals,public\ slots,private\ slots
|
||||
|
||||
< *'clipboard'* *'cb'*
|
||||
'clipboard' 'cb' string (default "autoselect,exclude:cons\|linux"
|
||||
for X-windows, "" otherwise)
|
||||
global
|
||||
{only in GUI versions or when the |+xterm_clipboard|
|
||||
feature is included}
|
||||
This option is a list of comma separated names.
|
||||
This option is a list of comma-separated names.
|
||||
Note: if one of the items is "exclude:", then you can't add an item
|
||||
after that. Therefore do append an item with += but use ^= to
|
||||
prepend, e.g.: >
|
||||
@ -4028,7 +4049,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.
|
||||
|
||||
@ -4046,7 +4067,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|: >
|
||||
@ -4877,7 +4898,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
|
||||
@ -5506,6 +5527,18 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
The 'mousemodel' option is set by the |:behave| command.
|
||||
|
||||
*'mousemoveevent'* *'mousemev'*
|
||||
'mousemoveevent' 'mousemev' boolean (default off)
|
||||
global
|
||||
{only works in the GUI}
|
||||
When on, mouse move events are delivered to the input queue and are
|
||||
available for mapping. The default, off, avoids the mouse movement
|
||||
overhead except when needed. See |gui-mouse-mapping|.
|
||||
Warning: Setting this option can make pending mappings to be aborted
|
||||
when the mouse is moved.
|
||||
Currently only works in the GUI, may be made to work in a terminal
|
||||
later.
|
||||
|
||||
*'mouseshape'* *'mouses'* *E547*
|
||||
'mouseshape' 'mouses' string (default "i-r:beam,s:updown,sd:udsizing,
|
||||
vs:leftright,vd:lrsizing,m:no,
|
||||
@ -5891,7 +5924,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.
|
||||
|
||||
@ -7449,7 +7482,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
|
||||
@ -7757,7 +7790,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.
|
||||
|
||||
@ -7849,9 +7882,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
linear search can be avoided when case is ignored. Use a value of '2'
|
||||
in the "!_TAG_FILE_SORTED" line for this. A tag file can be case-fold
|
||||
sorted with the -f switch to "sort" in most unices, as in the command:
|
||||
"sort -f -o tags tags". For "Exuberant ctags" version 5.x or higher
|
||||
(at least 5.5) the --sort=foldcase switch can be used for this as
|
||||
well. Note that case must be folded to uppercase for this to work.
|
||||
"sort -f -o tags tags". For Universal ctags and Exuberant ctags
|
||||
version 5.x or higher (at least 5.5) the --sort=foldcase switch can be
|
||||
used for this as well. Note that case must be folded to uppercase for
|
||||
this to work.
|
||||
|
||||
By default, tag searches are case-sensitive. Case is ignored when
|
||||
'ignorecase' is set and 'tagcase' is "followic", or when 'tagcase' is
|
||||
@ -8308,7 +8342,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.
|
||||
@ -9077,6 +9111,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
feature}
|
||||
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
|
||||
|
@ -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 Feb 04
|
||||
*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
|
||||
@ -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
|
||||
|
@ -271,6 +271,11 @@ popup_create({what}, {options}) *popup_create()*
|
||||
'buftype' set to "popup". That buffer will be wiped out once
|
||||
the popup closes.
|
||||
|
||||
if {what} is a buffer number and loading the buffer runs into
|
||||
an existing swap file, it is silently opened read-only, as if
|
||||
a |SwapExists| autocommand had set |v:swapchoice| to 'o'.
|
||||
This is because we assume the buffer is only used for viewing.
|
||||
|
||||
{options} is a dictionary with many possible entries.
|
||||
See |popup_create-arguments| for details.
|
||||
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
*quickfix.txt* For Vim version 8.2. Last change: 2022 Feb 08
|
||||
*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.
|
||||
|
@ -643,6 +643,7 @@ Short explanation of each option: *option-list*
|
||||
'cinkeys' 'cink' keys that trigger indent when 'cindent' is set
|
||||
'cinoptions' 'cino' how to do indenting when 'cindent' is set
|
||||
'cinwords' 'cinw' words where 'si' and 'cin' add an indent
|
||||
'cinscopedecls' 'cinsd' words that are recognized by 'cino-g'
|
||||
'clipboard' 'cb' use the clipboard as the unnamed register
|
||||
'cmdheight' 'ch' number of lines to use for the command-line
|
||||
'cmdwinheight' 'cwh' height of the command-line window
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 8.2. Last change: 2022 Jan 21
|
||||
*repeat.txt* For Vim version 8.2. Last change: 2022 Mar 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -197,6 +197,41 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
:so[urce] {file} Read Ex commands from {file}. These are commands that
|
||||
start with a ":".
|
||||
Triggers the |SourcePre| autocommand.
|
||||
|
||||
:[range]so[urce] [++clear]
|
||||
Read Ex commands from the [range] of lines in the
|
||||
current buffer.
|
||||
|
||||
When sourcing commands from the current buffer, the
|
||||
same script-ID |<SID>| is used even if the buffer is
|
||||
sourced multiple times. If a buffer is sourced more
|
||||
than once, then the functions in the buffer are
|
||||
defined again.
|
||||
|
||||
To source a range of lines that doesn't start with the
|
||||
|:vim9script| command in Vim9 script context, the
|
||||
|:vim9cmd| modifier can be used. If you use a Visual
|
||||
selection and type ":", the range in the form "'<,'>"
|
||||
can come before it: >
|
||||
:'<,'>vim9cmd source
|
||||
< Otherwise the range goes after the modifier and must
|
||||
have a colon prefixed, like all Vim9 ranges: >
|
||||
:vim9cmd :5,9source
|
||||
|
||||
< When a range of lines in a buffer is sourced in the
|
||||
Vim9 script context, the previously defined
|
||||
script-local variables and functions are not cleared.
|
||||
This works like the range started with the
|
||||
":vim9script noclear" command. The "++clear" argument
|
||||
can be used to clear the script-local variables and
|
||||
functions before sourcing the script. This works like
|
||||
the range started with the `:vim9script` command
|
||||
without the "noclear" argument. See |vim9-reload| for
|
||||
more information.
|
||||
Examples: >
|
||||
:4,5source
|
||||
:10,18source ++clear
|
||||
|
||||
*:source!*
|
||||
:so[urce]! {file} Read Vim commands from {file}. These are commands
|
||||
that are executed from Normal mode, like you type
|
||||
@ -419,10 +454,10 @@ An alternative is to put the commands in a file, and execute them with the
|
||||
':source!' command. Useful for long command sequences. Can be combined with
|
||||
the ':map' command to put complicated commands under a function key.
|
||||
|
||||
The ':source' command reads Ex commands from a file line by line. You will
|
||||
have to type any needed keyboard input. The ':source!' command reads from a
|
||||
script file character by character, interpreting each character as if you
|
||||
typed it.
|
||||
The ':source' command reads Ex commands from a file or a buffer line by line.
|
||||
You will have to type any needed keyboard input. The ':source!' command reads
|
||||
from a script file character by character, interpreting each character as if
|
||||
you typed it.
|
||||
|
||||
Example: When you give the ":!ls" command you get the |hit-enter| prompt. If
|
||||
you ':source' a file with the line "!ls" in it, you will have to type 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
|
||||
|
@ -1378,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: 2022 Feb 06
|
||||
*syntax.txt* For Vim version 8.2. Last change: 2022 Mar 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -653,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: >
|
||||
|
||||
@ -3607,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
|
||||
@ -4452,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
|
||||
@ -5553,11 +5553,12 @@ WARNING: The longer the tags file, the slower this will be, and the more
|
||||
memory Vim will consume.
|
||||
|
||||
Only highlighting typedefs, unions and structs can be done too. For this you
|
||||
must use Exuberant ctags (found at http://ctags.sf.net).
|
||||
must use Universal Ctags (found at https://ctags.io) or Exuberant ctags (found
|
||||
at http://ctags.sf.net).
|
||||
|
||||
Put these lines in your Makefile:
|
||||
|
||||
# Make a highlight file for types. Requires Exuberant ctags and awk
|
||||
# Make a highlight file for types. Requires Universal/Exuberant ctags and awk
|
||||
types: types.vim
|
||||
types.vim: *.[ch]
|
||||
ctags --c-kinds=gstu -o- *.[ch] |\
|
||||
@ -5567,9 +5568,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
|
||||
|
||||
==============================================================================
|
||||
|
@ -381,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
|
||||
@ -461,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()}
|
||||
|
@ -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*
|
||||
@ -4019,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*
|
||||
@ -4031,7 +4044,10 @@ 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*
|
||||
@ -4237,6 +4253,8 @@ E1264 vim9.txt /*E1264*
|
||||
E1265 eval.txt /*E1265*
|
||||
E1266 if_pyth.txt /*E1266*
|
||||
E127 eval.txt /*E127*
|
||||
E1270 change.txt /*E1270*
|
||||
E1271 vim9.txt /*E1271*
|
||||
E128 eval.txt /*E128*
|
||||
E129 eval.txt /*E129*
|
||||
E13 message.txt /*E13*
|
||||
@ -4678,7 +4696,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*
|
||||
@ -5001,6 +5019,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*
|
||||
@ -5858,6 +5877,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*
|
||||
@ -6159,6 +6179,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*
|
||||
@ -6168,6 +6189,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*
|
||||
@ -7006,7 +7028,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*
|
||||
@ -7817,6 +7839,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*
|
||||
@ -7832,6 +7855,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*
|
||||
@ -7976,6 +8000,7 @@ lace.vim syntax.txt /*lace.vim*
|
||||
lambda eval.txt /*lambda*
|
||||
lang-variable eval.txt /*lang-variable*
|
||||
language-mapping map.txt /*language-mapping*
|
||||
language-server-protocol channel.txt /*language-server-protocol*
|
||||
last-pattern pattern.txt /*last-pattern*
|
||||
last-position-jump usr_05.txt /*last-position-jump*
|
||||
last_buffer_nr() builtin.txt /*last_buffer_nr()*
|
||||
@ -8540,6 +8565,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*
|
||||
@ -8573,6 +8599,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*
|
||||
@ -8622,6 +8649,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*
|
||||
@ -8740,7 +8768,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*
|
||||
@ -10008,6 +10037,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()*
|
||||
@ -10099,7 +10129,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*
|
||||
@ -10454,6 +10483,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*
|
||||
@ -10468,6 +10498,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*
|
||||
@ -10483,6 +10515,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*
|
||||
@ -10529,6 +10563,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*
|
||||
@ -10686,6 +10721,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*
|
||||
@ -10859,6 +10895,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 /*}*
|
||||
|
@ -561,7 +561,8 @@ also works. The <CR> and <NL> characters can never appear inside a line.
|
||||
|
||||
The second format is new. It includes additional information in optional
|
||||
fields at the end of each line. It is backwards compatible with Vi. It is
|
||||
only supported by new versions of ctags (such as Exuberant ctags).
|
||||
only supported by new versions of ctags (such as Universal ctags or Exuberant
|
||||
ctags).
|
||||
|
||||
{tagname} The identifier. Normally the name of a function, but it can
|
||||
be any identifier. It cannot contain a <Tab>.
|
||||
@ -724,7 +725,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`
|
||||
|
@ -131,8 +131,8 @@ test_gui_event({event}, {args})
|
||||
forward: set to 1 for forward search.
|
||||
|
||||
"mouse":
|
||||
Inject a mouse button click event. The supported items in
|
||||
{args} are:
|
||||
Inject either a mouse button click, or a mouse move, event.
|
||||
The supported items in {args} are:
|
||||
button: mouse button. The supported values are:
|
||||
0 right mouse button
|
||||
1 middle mouse button
|
||||
@ -151,6 +151,28 @@ test_gui_event({event}, {args})
|
||||
4 shift is pressed
|
||||
8 alt is pressed
|
||||
16 ctrl is pressed
|
||||
move: Optional; if used and TRUE then a mouse move
|
||||
event can be generated.
|
||||
Only {args} row: and col: are used and
|
||||
required; they are interpreted as pixels.
|
||||
Only results in an event when 'mousemoveevent'
|
||||
is set or a popup uses mouse move events.
|
||||
|
||||
"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.
|
||||
|
||||
"scrollbar":
|
||||
Set or drag the left, right or horizontal scrollbar. Only
|
||||
|
@ -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 Feb 11
|
||||
*todo.txt* For Vim version 8.2. Last change: 2022 Mar 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -38,18 +38,20 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Disallow using "s:" in Vim9 script at the script level.
|
||||
Disallow a legacy function creating an s: variable in Vim9 script.
|
||||
Allow for: "import autoload '../lib/script.vim'"
|
||||
avoids going through 'runtimepath' and avoids name collisions.
|
||||
|
||||
Really drop the Athena and NeXtaw GUI? Decide end of March.
|
||||
|
||||
Once Vim9 is stable:
|
||||
- Use Vim9 for runtime files.
|
||||
- Use Vim9 for more runtime files.
|
||||
- Check code coverage, add more tests if needed.
|
||||
vim9compile.c
|
||||
vim9execute.c
|
||||
vim9execute.c line 1900
|
||||
vim9expr.c
|
||||
vim9instr.c
|
||||
vim9script.c
|
||||
vim9type.c
|
||||
- Adjust intro message to say "help version9".
|
||||
|
||||
Further Vim9 improvements, possibly after launch:
|
||||
- Check performance with callgrind and kcachegrind.
|
||||
@ -108,7 +110,6 @@ Popup windows:
|
||||
- Should popup_getoptions() also return the mask? #7774
|
||||
- Add a way to use popup_menu() synchronously: instead of invoking the
|
||||
callback, return the choice. (Ben Jackson, #6534)
|
||||
- Use popup (or popup menu) for command line completion
|
||||
- When using a popup for the info of a completion menu, and there is not
|
||||
enough space, let the popup overlap with the menu. (#4544)
|
||||
- Implement flip option.
|
||||
@ -213,6 +214,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.
|
||||
|
||||
@ -290,6 +298,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
|
||||
@ -410,20 +421,10 @@ register, then "" doesn't contain anything. Make it still follow "+.
|
||||
|
||||
File marks merging has duplicates since 7.4.1925. (Ingo Karkat, #5733)
|
||||
|
||||
"make test_gui" crashed in submenu_change(). Fix and remove workaround in
|
||||
add_pixmap_args().
|
||||
Athena is OK.
|
||||
Motif: Build on Ubuntu can't enter any text in dialog text fields.
|
||||
Running test_gui and test_gui_init with Motif sometimes kills the window
|
||||
manager. Problem with Motif?
|
||||
|
||||
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)
|
||||
|
||||
@ -474,11 +475,6 @@ Test loose_clipboard() by selecting text before suspending.
|
||||
|
||||
Undo puts cursor in wrong line after "cG<Esc>" undo.
|
||||
|
||||
Implement completion for "breakadd". Should expand the second argument, e.g.
|
||||
"func", and then function names after ":breakadd func". Including
|
||||
script-local functions.
|
||||
Also for ":profile".
|
||||
|
||||
:unmap <c-n> gives error but does remove the mapping. (Antony Scriven, 2019
|
||||
Dec 19)
|
||||
|
||||
@ -2209,10 +2205,6 @@ Jan 7)
|
||||
|
||||
Problem with editing file in binary mode. (Ingo Krabbe, 2009 Oct 8)
|
||||
|
||||
With 'wildmode' set to "longest:full,full" and pressing Tab once the first
|
||||
entry in wildmenu is highlighted, that shouldn't happen. (Yuki Watanabe, 2011
|
||||
Feb 12)
|
||||
|
||||
Display error when 'tabline' that includes a file name with double-width
|
||||
characters. (2010 Aug 14, bootleq)
|
||||
|
||||
@ -2415,10 +2407,6 @@ is executed.
|
||||
first line. (Ingo Karkat, 2008 Jul 1) Ian Kelling is working on this.
|
||||
Similar problem with ":e". (Marc Montu, 2014 Apr 22)
|
||||
|
||||
Wildmenu not deleted: "gvim -u NONE", ":set nocp wildmenu cmdheight=3
|
||||
laststatus=2", CTRL-D CTRL-H CTRL-H CTRL-H. (A.Politz, 2008 April 1)
|
||||
Works OK with Vim in an xterm.
|
||||
|
||||
Cursor line moves in other window when using CTRL-W J that doesn't change
|
||||
anything. (Dasn, 2009 Apr 7)
|
||||
|
||||
@ -2451,10 +2439,6 @@ backslash? (Robert Vibrant, 2008 Jun 5)
|
||||
When 'rightleft' is set, cursorcolumn isn't highlighted after the end of a
|
||||
line. It's also wrong in folds. (Dominique Pelle, 2010 Aug 21)
|
||||
|
||||
After using <Tab> for command line completion after ":ta blah" and getting E33
|
||||
(no tags file), further editing the command to e.g., ":echo 'blah'", the
|
||||
command is not executed. Fix by Ian Kelling?
|
||||
|
||||
":help s/~" jumps to *s/\~*, while ":help s/\~" doesn't find anything. (Tim
|
||||
Chase) Fix by Ian Kelling, 2008 Jul 14.
|
||||
|
||||
@ -2509,10 +2493,6 @@ Works OK when 'cmdheight' is 2.
|
||||
8 Use a mechanism similar to omni completion to figure out the kind of tab
|
||||
for CTRL-] and jump to the appropriate matching tag (if there are
|
||||
several).
|
||||
Alternative: be able to define a function that takes the tag name and uses
|
||||
taglist() to find the right location. With indication of using CTRL-] so
|
||||
that the context can be taken into account. (Robert Webb)
|
||||
Patch by Christian Brabandt, 2013 May 31.
|
||||
|
||||
The utf class table is missing some entries:
|
||||
0x2212, minus sign
|
||||
@ -2630,16 +2610,6 @@ This should avoid flicker. Other solution by A.Politz, 2007 Aug 22.
|
||||
When a register contains illegal bytes, writing viminfo in utf-8 and reading
|
||||
it back doesn't result in utf-8. (Devin Bayer)
|
||||
|
||||
Command line completion: Scanning for tags doesn't check for typed key now and
|
||||
then? Hangs for about 5 seconds. Appears to be caused by finding include
|
||||
files with "foo/**" in 'path'. (Kalisiak, 2006 July 15)
|
||||
Additional info: When using the |wildcards| ** globing, vim hangs
|
||||
indefinitely on lots of directories. The |file-searching| globing, like in
|
||||
":set path=/**" does not hang as often as with globing with |wildcards|, like
|
||||
in ":1find /**/file". This is for files that unix "find" can find very
|
||||
quickly. Merging the 2 kinds of globing might make this an easier fix. (Ian
|
||||
Kelling, 2008 July 4)
|
||||
|
||||
When the file name has parenthesis, e.g., "foo (bar).txt", ":!ls '%'" has the
|
||||
parenthesis escaped but not the space. That's inconsistent. Either escape
|
||||
neither or both. No escaping might be best, because it doesn't depend on
|
||||
@ -2718,8 +2688,6 @@ Cursor displayed in the wrong position when using 'numberwidth'. (James Vega,
|
||||
When $VAR contains a backslash expand('$VAR') removes it. (Teemu Likonen, 2008
|
||||
Jun 18)
|
||||
|
||||
If the variable "g:x#y#z" exists completion after ":echo g:x#" doesn't work.
|
||||
|
||||
In debug mode, using CTRL-R = to evaluate a function causes stepping through
|
||||
the function. (Hari Krishna Dara, 2006 Jun 28)
|
||||
|
||||
@ -2828,13 +2796,6 @@ reload it then?
|
||||
|
||||
For Aap: include a config.arg.example file with hints how to use config.arg.
|
||||
|
||||
Command line completion when 'cmdheight' is maximum and 'wildmenu' is set,
|
||||
only one buffer line displayed, causes display errors.
|
||||
|
||||
Completing with 'wildmenu' and using <Up> and <Down> to move through directory
|
||||
tree stops unexpectedly when using ":cd " and entering a directory that
|
||||
doesn't contain other directories.
|
||||
|
||||
Default for 'background' is wrong when using xterm with 256 colors.
|
||||
Table with estimates from Matteo Cavalleri, 2014 Jan 10.
|
||||
|
||||
@ -3516,8 +3477,6 @@ Macintosh:
|
||||
8 When doing Insert mode completion a mapping cannot recursively call
|
||||
edit(), because the completion information is global. Put everything in
|
||||
an allocated structure?
|
||||
8 Command line completion: buffers "foo.txt" and "../b/foo.txt", completing
|
||||
":buf foo<Tab>" doesn't find the second one. (George V. Reilly)
|
||||
7 mb_off2cells() doesn't work correctly on the tail byte of a double-byte
|
||||
character. (Yasuhiro Matsumoto) It should return 1 when used on a tail
|
||||
byte, like for utf-8. Store second byte of double-byte in ScreenLines2[]
|
||||
@ -4252,8 +4211,6 @@ Syntax highlighting:
|
||||
7 CTRL-] checks the highlight group for finding out what the tag is.
|
||||
7 Add an explanation how a list of words can be used to highlight misspelled
|
||||
words.
|
||||
8 Add more command line completion for :syntax.
|
||||
8 Add more command line completion for :highlight.
|
||||
7 Should find a better way to parse the :syntax and :highlight commands.
|
||||
Use tables or lists that can be shared by parsing for execution and
|
||||
completion?
|
||||
@ -4311,12 +4268,6 @@ Vim script language:
|
||||
restore option values. Especially useful for new options. Problem: how
|
||||
to avoid a performance penalty (esp. for string options)?
|
||||
- range for ":exec", pass it on to the executed command. (Webb)
|
||||
8 ":{range}source": source the lines from the current file.
|
||||
You can already yank lines and use :@" to execute them.
|
||||
Most of do_source() would not be used, need a new function.
|
||||
It's easy when not doing breakpoints or profiling.
|
||||
Requires copying the lines into a list and then creating a function to
|
||||
execute lines from the list. Similar to getnextac().
|
||||
7 ":include" command: just like ":source" but doesn't start a new scriptID?
|
||||
Will be tricky for the list of script names.
|
||||
8 Have a look at VSEL. Would it be useful to include? (Bigham)
|
||||
@ -5045,6 +4996,35 @@ Command line completion:
|
||||
- Add 'wildlongest' option: Key to use to find longest common match for
|
||||
command line completion (default CTRL-L), like 'wildchar'. (Cregut)
|
||||
Also: when there are several matches, show them line a CTRL-D.
|
||||
- With 'wildmode' set to "longest:full,full" and pressing Tab once the first
|
||||
entry in wildmenu is highlighted, that shouldn't happen. (Yuki Watanabe,
|
||||
2011 Feb 12)
|
||||
- After using <Tab> for command line completion after ":ta blah" and getting
|
||||
E33 (no tags file), further editing the command to e.g., ":echo 'blah'",
|
||||
the command is not executed. Fix by Ian Kelling?
|
||||
- Command line completion: Scanning for tags doesn't check for typed key now
|
||||
and then? Hangs for about 5 seconds. Appears to be caused by finding
|
||||
include files with "foo/**" in 'path'. (Kalisiak, 2006 July 15)
|
||||
Additional info: When using the |wildcards| ** globing, vim hangs
|
||||
indefinitely on lots of directories. The |file-searching| globing, like in
|
||||
":set path=/**" does not hang as often as with globing with |wildcards|,
|
||||
like in ":1find /**/file". This is for files that unix "find" can find
|
||||
very quickly. Merging the 2 kinds of globing might make this an easier
|
||||
fix. (Ian Kelling, 2008 July 4)
|
||||
- Command line completion when 'cmdheight' is maximum and 'wildmenu' is set,
|
||||
only one buffer line displayed, causes display errors.
|
||||
- Completing with 'wildmenu' and using <Up> and <Down> to move through
|
||||
directory tree stops unexpectedly when using ":cd " and entering a
|
||||
directory that doesn't contain other directories.
|
||||
8 Command line completion: buffers "foo.txt" and "../b/foo.txt", completing
|
||||
":buf foo<Tab>" doesn't find the second one. (George V. Reilly)
|
||||
8 Add more command line completion for :syntax.
|
||||
8 Add more command line completion for :highlight.
|
||||
- Wildmenu not deleted: "gvim -u NONE", ":set nocp wildmenu cmdheight=3
|
||||
laststatus=2", CTRL-D CTRL-H CTRL-H CTRL-H. (A.Politz, 2008 April 1) Works
|
||||
OK with Vim in an xterm.
|
||||
- If the variable "g:x#y#z" exists completion after ":echo g:x#" doesn't
|
||||
work.
|
||||
|
||||
|
||||
Command line history:
|
||||
|
@ -1,4 +1,4 @@
|
||||
*uganda.txt* For Vim version 8.2. Last change: 2022 Feb 05
|
||||
*uganda.txt* For Vim version 8.2. Last change: 2022 Mar 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -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
|
||||
|
@ -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_29.txt* For Vim version 8.2. Last change: 2016 Feb 27
|
||||
*usr_29.txt* For Vim version 8.2. Last change: 2022 Mar 13
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@ -33,10 +33,12 @@ following command: >
|
||||
ctags *.c
|
||||
|
||||
"ctags" is a separate program. Most Unix systems already have it installed.
|
||||
If you do not have it yet, you can find Exuberant ctags here:
|
||||
|
||||
If you do not have it yet, you can find Universal/Exuberant ctags at:
|
||||
http://ctags.io ~
|
||||
http://ctags.sf.net ~
|
||||
|
||||
Universal ctags is preferred, Exuberant ctags is no longer being developed.
|
||||
|
||||
Now when you are in Vim and you want to go to a function definition, you can
|
||||
jump to it by using the following command: >
|
||||
|
||||
@ -142,15 +144,15 @@ ONE TAGS FILE
|
||||
When Vim has to search many places for tags files, you can hear the disk
|
||||
rattling. It may get a bit slow. In that case it's better to spend this
|
||||
time while generating one big tags file. You might do this overnight.
|
||||
This requires the Exuberant ctags program, mentioned above. It offers an
|
||||
argument to search a whole directory tree: >
|
||||
This requires the Universal or Exuberant ctags program, mentioned above.
|
||||
It offers an argument to search a whole directory tree: >
|
||||
|
||||
cd ~/proj
|
||||
ctags -R .
|
||||
|
||||
The nice thing about this is that Exuberant ctags recognizes various file
|
||||
types. Thus this doesn't work just for C and C++ programs, also for Eiffel
|
||||
and even Vim scripts. See the ctags documentation to tune this.
|
||||
The nice thing about this is that Universal/Exuberant ctags recognizes various
|
||||
file types. Thus this doesn't work just for C and C++ programs, also for
|
||||
Eiffel and even Vim scripts. See the ctags documentation to tune this.
|
||||
Now you only need to tell Vim where your big tags file is: >
|
||||
|
||||
:set tags=~/proj/tags
|
||||
@ -232,7 +234,8 @@ A TAGS BROWSER
|
||||
Since CTRL-] takes you to the definition of the identifier under the cursor,
|
||||
you can use a list of identifier names as a table of contents. Here is an
|
||||
example.
|
||||
First create a list of identifiers (this requires Exuberant ctags): >
|
||||
First create a list of identifiers (this requires Universal or Exuberant
|
||||
ctags): >
|
||||
|
||||
ctags --c-types=f -f functions *.c
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 8.2. Last change: 2022 Feb 03
|
||||
*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|
|
||||
@ -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
26928
runtime/doc/version9.txt
Normal file
26928
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 Feb 11
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2022 Mar 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -57,13 +57,13 @@ 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* *E1164*
|
||||
Execute {cmd} using Vim9 script syntax and semantics.
|
||||
Useful when typing a command and in a legacy script or
|
||||
function.
|
||||
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* *E1189* *E1234*
|
||||
Execute {cmd} using legacy script syntax and semantics. Only
|
||||
useful in a Vim9 script or a :def function.
|
||||
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.
|
||||
|
||||
@ -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
|
||||
@ -172,8 +184,8 @@ For now you will need to pass the dictionary explicitly: >
|
||||
def DictFunc(d: dict<any>, arg: string)
|
||||
echo d[arg]
|
||||
enddef
|
||||
var d = {item: 'value', func: DictFunc}
|
||||
d.func(d, 'item')
|
||||
var ad = {item: 'value', func: DictFunc}
|
||||
ad.func(d, 'item')
|
||||
|
||||
You can call a legacy dict function though: >
|
||||
func Legacy() dict
|
||||
@ -229,8 +241,17 @@ script "export" needs to be used. >
|
||||
< *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. 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:
|
||||
@ -245,9 +266,11 @@ 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:" is optional. This is because in legacy
|
||||
script the "s:" might be needed. Disallowing the use of "s:" only in a :def
|
||||
function in Vim9 script would be a bit confusing.
|
||||
|
||||
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
|
||||
@ -282,18 +305,19 @@ 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')
|
||||
if exists('*SomeFunc')
|
||||
finish
|
||||
endif
|
||||
def g:SomeFunc()
|
||||
def SomeFunc()
|
||||
....
|
||||
|
||||
|
||||
Variable declarations with :var, :final and :const ~
|
||||
*vim9-declaration* *:var*
|
||||
*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
|
||||
@ -352,17 +376,30 @@ And with autocommands: >
|
||||
}
|
||||
|
||||
Although using a :def function probably works better.
|
||||
|
||||
*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
|
||||
default to the number zero.
|
||||
*E1016* *E1052* *E1066*
|
||||
default to the number zero. For example, when declaring a list, items can be
|
||||
added: >
|
||||
var myList: list<number>
|
||||
myList->add(7)
|
||||
|
||||
Initializing a variable to a null value, e.g. `null_list`, differs from not
|
||||
initializing the variable. This throws an error: >
|
||||
var myList = null_list
|
||||
myList->add(7) # E1130: Cannot add to null list
|
||||
|
||||
< *E1016* *E1052* *E1066*
|
||||
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.
|
||||
@ -422,7 +459,7 @@ similar to how a function argument can be ignored: >
|
||||
[a, _, c] = theList
|
||||
To ignore any remaining items: >
|
||||
[a, b; _] = longList
|
||||
< *E1163*
|
||||
< *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()
|
||||
@ -837,6 +874,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 ~
|
||||
@ -939,10 +977,42 @@ 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
|
||||
|
||||
It is possible to compare `null` with any value, this will not give a type
|
||||
error. However, comparing `null` with a number, float or bool will always
|
||||
result in `false`. This is different from legacy script, where comparing
|
||||
`null` with zero or `false` would return `true`.
|
||||
|
||||
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.
|
||||
@ -1179,6 +1249,11 @@ Closures defined in a loop will share the same context. For example: >
|
||||
endfor
|
||||
echo range(5)->map((i, _) => flist[i]())
|
||||
# Result: [4, 4, 4, 4, 4]
|
||||
< *E1271*
|
||||
A closure must be compiled in the context that it is defined in, so that
|
||||
variables in that context can be found. This mostly happens correctly, except
|
||||
when a function is marked for debugging with `breakadd` after it was compiled.
|
||||
Make sure to define the breakpoint before compiling the outer function.
|
||||
|
||||
The "inloop" variable will exist only once, all closures put in the list refer
|
||||
to the same instance, which in the end will have the value 4. This is
|
||||
@ -1430,32 +1505,61 @@ 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* *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
|
||||
< *E1158*
|
||||
|
||||
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*
|
||||
@ -1655,7 +1759,8 @@ actually needed. Using the autoload mechanism is recommended:
|
||||
prefix is obtained from the file name, as you would to manually in a
|
||||
legacy autoload script. Thus the exported function can be found with
|
||||
"for#search#Stuff", but you would normally use `import autoload` and not
|
||||
use the prefix.
|
||||
use the prefix (which has the side effect of loading the autoload script
|
||||
when compiling a function that encounters this name).
|
||||
|
||||
You can split up the functionality and import other scripts from the
|
||||
autoload script as you like. This way you can share code between plugins.
|
||||
@ -1667,7 +1772,17 @@ script context of where the mapping was defined.
|
||||
When compiling a `:def` function and a function in an autoload script is
|
||||
encountered, the script is not loaded until the `:def` function is called.
|
||||
This also means you get any errors only at runtime, since the argument and
|
||||
return types are not known yet.
|
||||
return types are not known yet. If you would use the name with '#' characters
|
||||
then the autoload script IS loaded.
|
||||
|
||||
Be careful to not refer to an item in an autoload script that does trigger
|
||||
loading it unintentionally. For example, when setting an option that takes a
|
||||
function name, make sure to use a string, not a function reference: >
|
||||
import autoload 'qftf.vim'
|
||||
&quickfixtextfunc = 'qftf.Func' # autoload script NOT loaded
|
||||
&quickfixtextfunc = qftf.Func # autoload script IS loaded
|
||||
On the other hand, it can be useful to load the script early, at a time when
|
||||
any errors should be given.
|
||||
|
||||
For testing the |test_override()| function can be used to have the
|
||||
`import autoload` load the script right away, so that the items and types can
|
||||
@ -1719,6 +1834,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
|
||||
|
@ -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 31
|
||||
" 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
|
||||
@ -417,6 +420,9 @@ au BufNewFile,BufRead *.ex call dist#ft#ExCheck()
|
||||
au BufRead,BufNewFile mix.lock,*.exs setf elixir
|
||||
au BufRead,BufNewFile *.eex,*.leex setf eelixir
|
||||
|
||||
" Elvish
|
||||
au BufRead,BufNewFile *.elv setf elvish
|
||||
|
||||
" Euphoria 3 or 4
|
||||
au BufNewFile,BufRead *.eu,*.ew,*.exu,*.exw call dist#ft#EuphoriaCheck()
|
||||
if has("fname_case")
|
||||
@ -481,6 +487,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
|
||||
@ -664,7 +671,7 @@ au BufNewFile,BufRead *.fs call dist#ft#FTfs()
|
||||
au BufNewFile,BufRead *.fsi,*.fsx setf fsharp
|
||||
|
||||
" GDB command files
|
||||
au BufNewFile,BufRead .gdbinit,gdbinit setf gdb
|
||||
au BufNewFile,BufRead .gdbinit,gdbinit,.gdbearlyinit,gdbearlyinit,*.gdb setf gdb
|
||||
|
||||
" GDMO
|
||||
au BufNewFile,BufRead *.mo,*.gdmo setf gdmo
|
||||
@ -727,6 +734,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
|
||||
|
||||
@ -940,6 +951,11 @@ au BufNewFile,BufRead *.jl setf julia
|
||||
" Kixtart
|
||||
au BufNewFile,BufRead *.kix setf kix
|
||||
|
||||
" Kuka Robot Language
|
||||
au BufNewFile,BufRead *.src\c call dist#ft#FTsrc()
|
||||
au BufNewFile,BufRead *.dat\c call dist#ft#FTdat()
|
||||
au BufNewFile,BufRead *.sub\c setf krl
|
||||
|
||||
" Kimwitu[++]
|
||||
au BufNewFile,BufRead *.k setf kwt
|
||||
|
||||
@ -1269,6 +1285,9 @@ au BufNewFile,BufRead *.[Oo][Pp][Ll] setf opl
|
||||
" Oracle config file
|
||||
au BufNewFile,BufRead *.ora setf ora
|
||||
|
||||
" Org
|
||||
au BufNewFile,BufRead *.org,*.org_archive setf org
|
||||
|
||||
" Packet filter conf
|
||||
au BufNewFile,BufRead pf.conf setf pf
|
||||
|
||||
@ -1333,9 +1352,10 @@ au BufNewFile,BufRead *.pm
|
||||
au BufNewFile,BufRead *.pod setf pod
|
||||
|
||||
" Php, php3, php4, etc.
|
||||
" Also Phtml (was used for PHP 2 in the past)
|
||||
" Also .ctp for Cake template file
|
||||
au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp setf php
|
||||
" Also Phtml (was used for PHP 2 in the past).
|
||||
" Also .ctp for Cake template file.
|
||||
" Also .phpt for php tests.
|
||||
au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp,*.phpt setf php
|
||||
|
||||
" PHP config
|
||||
au BufNewFile,BufRead php.ini-* setf dosini
|
||||
@ -1547,6 +1567,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
|
||||
|
||||
@ -1721,7 +1744,7 @@ au BufNewFile,BufRead .zshrc,.zshenv,.zlogin,.zlogout,.zcompdump setf zsh
|
||||
au BufNewFile,BufRead *.zsh setf zsh
|
||||
|
||||
" Scheme
|
||||
au BufNewFile,BufRead *.scm,*.ss,*.sld,*.rkt,*.rktd,*.rktl setf scheme
|
||||
au BufNewFile,BufRead *.scm,*.ss,*.sld,*.rkt,*.rktd,*.rktl setf scheme
|
||||
|
||||
" Screen RC
|
||||
au BufNewFile,BufRead .screenrc,screenrc setf screen
|
||||
@ -1789,6 +1812,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
|
||||
|
||||
@ -2513,7 +2539,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,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
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
" Meikel Brandmeyer <mb@kotka.de>
|
||||
" URL: https://github.com/clojure-vim/clojure.vim
|
||||
" License: Vim (see :h license)
|
||||
" Last Change: 2021-10-26
|
||||
" Last Change: 2022-03-24
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@ -43,7 +43,7 @@ setlocal commentstring=;\ %s
|
||||
" specially and hence are not indented specially.
|
||||
"
|
||||
" -*- LISPWORDS -*-
|
||||
" Generated from https://github.com/clojure-vim/clojure.vim/blob/62b215f079ce0f3834fd295c7a7f6bd8cc54bcc3/clj/src/vim_clojure_static/generate.clj
|
||||
" Generated from https://github.com/clojure-vim/clojure.vim/blob/fd280e33e84c88e97860930557dba3ff80b1a82d/clj/src/vim_clojure_static/generate.clj
|
||||
setlocal lispwords=as->,binding,bound-fn,case,catch,cond->,cond->>,condp,def,definline,definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecord,defstruct,deftest,deftest-,deftype,doseq,dotimes,doto,extend,extend-protocol,extend-type,fn,for,if,if-let,if-not,if-some,let,letfn,locking,loop,ns,proxy,reify,set-test,testing,when,when-first,when-let,when-not,when-some,while,with-bindings,with-in-str,with-local-vars,with-open,with-precision,with-redefs,with-redefs-fn,with-test
|
||||
|
||||
" Provide insert mode completions for special forms and clojure.core. As
|
||||
@ -66,10 +66,10 @@ endif
|
||||
|
||||
" Filter files in the browse dialog
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Clojure Source Files (*.clj)\t*.clj\n" .
|
||||
\ "ClojureScript Source Files (*.cljs)\t*.cljs\n" .
|
||||
\ "Java Source Files (*.java)\t*.java\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
let b:browsefilter = "All Files\t*\n" .
|
||||
\ "Clojure Files\t*.clj;*.cljc;*.cljs;*.cljx\n" .
|
||||
\ "EDN Files\t*.edn\n" .
|
||||
\ "Java Files\t*.java\n"
|
||||
let b:undo_ftplugin .= ' | unlet! b:browsefilter'
|
||||
endif
|
||||
|
||||
|
@ -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,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
|
||||
" Language: Liquid
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2010 May 21
|
||||
" Last Change: 2022 Mar 15
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
@ -53,7 +53,7 @@ if has('gui_win32')
|
||||
endif
|
||||
|
||||
if exists('loaded_matchit')
|
||||
let b:match_words .= '\<\%(if\w*\|unless\|case\)\>:\<\%(elsif\|else\|when\)\>:\<end\%(if\w*\|unless\|case\)\>,\<\%(for\|tablerow\)\>:\%({%\s*\)\@<=empty\>:\<end\%(for\|tablerow\)\>,<\(capture\|comment\|highlight\)\>:\<end\1\>'
|
||||
let b:match_words .= '\<\%(if\w*\|unless\|case\)\>:\<\%(elsif\|else\|when\)\>:\<end\%(if\w*\|unless\|case\)\>,\<\%(for\|tablerow\)\>:\%({%\s*\)\@<=empty\>:\<end\%(for\|tablerow\)\>,\<\(capture\|comment\|highlight\)\>:\<end\1\>'
|
||||
endif
|
||||
|
||||
setlocal commentstring={%\ comment\ %}%s{%\ endcomment\ %}
|
||||
|
@ -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
|
||||
|
||||
@ -71,10 +73,11 @@ exe 'nno <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>'
|
||||
exe 'ono <buffer> <silent> [[ ?' . escape(s:section, '|') . '?<CR>:nohls<CR>'
|
||||
exe 'ono <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>'
|
||||
|
||||
setlocal suffixesadd=.php
|
||||
setlocal commentstring=/*%s*/
|
||||
|
||||
" Undo the stuff we changed.
|
||||
let b:undo_ftplugin = "setlocal commentstring< include< omnifunc<" .
|
||||
let b:undo_ftplugin = "setlocal suffixesadd< commentstring< include< omnifunc<" .
|
||||
\ " | unlet! b:browsefilter b:match_words | " .
|
||||
\ s:undo_ftplugin
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2020 Feb 13
|
||||
" Last Change: 2022 Mar 21
|
||||
|
||||
if (exists("b:did_ftplugin"))
|
||||
finish
|
||||
@ -53,7 +53,7 @@ endif
|
||||
" TODO:
|
||||
"setlocal define=^\\s*def
|
||||
|
||||
setlocal comments=:#
|
||||
setlocal comments=b:#
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
if !exists('g:ruby_version_paths')
|
||||
@ -87,8 +87,14 @@ endfunction
|
||||
|
||||
function! s:build_path(path) abort
|
||||
let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',')
|
||||
if &g:path !~# '\v^%(\.,)=%(/%(usr|emx)/include,)=,$'
|
||||
let path = substitute(&g:path,',,$',',','') . ',' . path
|
||||
if &g:path =~# '\v^%(\.,)=%(/%(usr|emx)/include,)=,$'
|
||||
let path = path . ',.,,'
|
||||
elseif &g:path =~# ',\.,,$'
|
||||
let path = &g:path[0:-4] . path . ',.,,'
|
||||
elseif &g:path =~# ',,$'
|
||||
let path = &g:path[0:-2] . path . ',,'
|
||||
else
|
||||
let path = substitute(&g:path, '[^,]\zs$', ',', '') . path
|
||||
endif
|
||||
return path
|
||||
endfunction
|
||||
@ -164,6 +170,8 @@ let b:undo_ftplugin .= "| sil! cunmap <buffer> <Plug><ctag>| sil! cunmap <buffer
|
||||
if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
||||
nmap <buffer><script> <SID>: :<C-U>
|
||||
nmap <buffer><script> <SID>c: :<C-U><C-R>=v:count ? v:count : ''<CR>
|
||||
cmap <buffer> <SID><cfile> <Plug><cfile>
|
||||
cmap <buffer> <SID><ctag> <Plug><ctag>
|
||||
|
||||
nnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>',['rubyDefine'],'b','n')<CR>
|
||||
nnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>',['rubyDefine'],'','n')<CR>
|
||||
@ -210,20 +218,20 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
||||
call s:map('c', '', '<C-R><C-F> <Plug><cfile>')
|
||||
|
||||
cmap <buffer><script><expr> <SID>tagzv &foldopen =~# 'tag' ? '<Bar>norm! zv' : ''
|
||||
call s:map('n', '<silent>', '<C-]> <SID>:exe v:count1."tag <Plug><ctag>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<silent>', 'g<C-]> <SID>:exe "tjump <Plug><ctag>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<silent>', 'g] <SID>:exe "tselect <Plug><ctag>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<silent>', '<C-W>] <SID>:exe v:count1."stag <Plug><ctag>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<silent>', '<C-W><C-]> <SID>:exe v:count1."stag <Plug><ctag>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<silent>', '<C-W>g<C-]> <SID>:exe "stjump <Plug><ctag>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<silent>', '<C-W>g] <SID>:exe "stselect <Plug><ctag>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<silent>', '<C-W>} <SID>:exe v:count1."ptag <Plug><ctag>"<CR>')
|
||||
call s:map('n', '<silent>', '<C-W>g} <SID>:exe "ptjump <Plug><ctag>"<CR>')
|
||||
call s:map('n', '<script><silent>', '<C-]> <SID>:exe v:count1."tag <SID><ctag>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<script><silent>', 'g<C-]> <SID>:exe "tjump <SID><ctag>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<script><silent>', 'g] <SID>:exe "tselect <SID><ctag>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<script><silent>', '<C-W>] <SID>:exe v:count1."stag <SID><ctag>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<script><silent>', '<C-W><C-]> <SID>:exe v:count1."stag <SID><ctag>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<script><silent>', '<C-W>g<C-]> <SID>:exe "stjump <SID><ctag>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<script><silent>', '<C-W>g] <SID>:exe "stselect <SID><ctag>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<script><silent>', '<C-W>} <SID>:exe v:count1."ptag <SID><ctag>"<CR>')
|
||||
call s:map('n', '<script><silent>', '<C-W>g} <SID>:exe "ptjump <SID><ctag>"<CR>')
|
||||
|
||||
call s:map('n', '<silent>', 'gf <SID>c:find <Plug><cfile><CR>')
|
||||
call s:map('n', '<silent>', '<C-W>f <SID>c:sfind <Plug><cfile><CR>')
|
||||
call s:map('n', '<silent>', '<C-W><C-F> <SID>c:sfind <Plug><cfile><CR>')
|
||||
call s:map('n', '<silent>', '<C-W>gf <SID>c:tabfind <Plug><cfile><CR>')
|
||||
call s:map('n', '<script><silent>', 'gf <SID>c:find <SID><cfile><CR>')
|
||||
call s:map('n', '<script><silent>', '<C-W>f <SID>c:sfind <SID><cfile><CR>')
|
||||
call s:map('n', '<script><silent>', '<C-W><C-F> <SID>c:sfind <SID><cfile><CR>')
|
||||
call s:map('n', '<script><silent>', '<C-W>gf <SID>c:tabfind <SID><cfile><CR>')
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
|
@ -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
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Edit the src/po/gvim.desktop.in file instead.
|
||||
[Desktop Entry]
|
||||
# Translators: This is the Application Name used in the GVim desktop file
|
||||
Name[ca]=GVim
|
||||
Name[de]=GVim
|
||||
Name[eo]=GVim
|
||||
Name[fi]=GVim
|
||||
@ -13,6 +14,7 @@ Name[sr]=GVim
|
||||
Name[tr]=GVim
|
||||
Name=GVim
|
||||
# Translators: This is the Generic Application Name used in the Vim desktop file
|
||||
GenericName[ca]=Editor de text
|
||||
GenericName[de]=Texteditor
|
||||
GenericName[eo]=Tekstoredaktilo
|
||||
GenericName[fi]=Tekstinmuokkain
|
||||
@ -25,6 +27,7 @@ GenericName[sr]=Едитор текст
|
||||
GenericName[tr]=Metin Düzenleyici
|
||||
GenericName=Text Editor
|
||||
# Translators: This is the comment used in the Vim desktop file
|
||||
Comment[ca]=Edita fitxers de text
|
||||
Comment[de]=Textdateien bearbeiten
|
||||
Comment[eo]=Redakti tekstajn dosierojn
|
||||
Comment[fi]=Muokkaa tekstitiedostoja
|
||||
@ -49,7 +52,6 @@ Comment[be]=Рэдагаваньне тэкставых файлаў
|
||||
Comment[bg]=Редактиране на текстови файлове
|
||||
Comment[bn]=টেক্স্ট ফাইল এডিট করুন
|
||||
Comment[bs]=Izmijeni tekstualne datoteke
|
||||
Comment[ca]=Edita fitxers de text
|
||||
Comment[cs]=Úprava textových souborů
|
||||
Comment[cy]=Golygu ffeiliau testun
|
||||
Comment[da]=Rediger tekstfiler
|
||||
@ -105,6 +107,7 @@ Exec=gvim -f %F
|
||||
Terminal=false
|
||||
Type=Application
|
||||
# Translators: Search terms to find this application. Do NOT change the semicolons! The list MUST also end with a semicolon!
|
||||
Keywords[ca]=Text;editor;
|
||||
Keywords[de]=Text;Editor;
|
||||
Keywords[eo]=Teksto;redaktilo;
|
||||
Keywords[fi]=Teksti;muokkain;editori;
|
||||
|
@ -1,20 +1,18 @@
|
||||
" Vim indent file
|
||||
" Language: bst
|
||||
" Author: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" $Id: bst.vim,v 1.1 2007/05/05 18:11:12 vimboss Exp $
|
||||
" Last Change: 2022 Mar 15
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal expandtab
|
||||
setlocal indentexpr=GetBstIndent(v:lnum)
|
||||
"setlocal smartindent
|
||||
setlocal cinkeys&
|
||||
setlocal cinkeys-=0#
|
||||
setlocal indentkeys&
|
||||
"setlocal indentkeys+=0%
|
||||
let b:undo_indent = 'setlocal indentexpr< cinkeys< indentkeys<'
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetBstIndent")
|
||||
|
@ -5,7 +5,7 @@
|
||||
" Meikel Brandmeyer <mb@kotka.de>
|
||||
" URL: https://github.com/clojure-vim/clojure.vim
|
||||
" License: Vim (see :h license)
|
||||
" Last Change: 2021-10-26
|
||||
" Last Change: 2022-03-24
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user