mirror of
https://github.com/vim/vim
synced 2025-07-29 18:01:41 +00:00
Compare commits
368 Commits
Author | SHA1 | Date | |
---|---|---|---|
5671f3f076 | |||
6f6d58c380 | |||
63b9173693 | |||
af647e76ca | |||
4f33bc20d7 | |||
1b6acf02b7 | |||
6a230c6b32 | |||
bc67e5a0a4 | |||
4a01159da2 | |||
9fe17d473a | |||
f18e8a969a | |||
9dc4bef897 | |||
57942237c1 | |||
d61f2f772a | |||
dd097bdc13 | |||
80d7395dcf | |||
0eec851942 | |||
41a3485dd6 | |||
23e2e11515 | |||
51ad850f5f | |||
2c70711e3f | |||
7bf9a07bd7 | |||
c3160727b9 | |||
bb7ee7abe1 | |||
35578168be | |||
952d9d827e | |||
1321257317 | |||
e041dde7bb | |||
e4db17fb6e | |||
0d4d9ee9bb | |||
f78da4f9d6 | |||
73b8b0ae3a | |||
6db660bed9 | |||
e97976baa7 | |||
78ba933d18 | |||
f24f51d030 | |||
f5d52c90e0 | |||
9e0ee59019 | |||
1780f08ba4 | |||
335c8c7b20 | |||
620c959c6c | |||
78db17c6f3 | |||
8e3fc135e8 | |||
bf634a0a8b | |||
b9115da4be | |||
28d8421bfb | |||
890ee4e2be | |||
4a15504e91 | |||
0f5575d0a7 | |||
1790be6cb6 | |||
60dc8274e9 | |||
921ba52926 | |||
77ab4e28a2 | |||
77111e2bfc | |||
131530a54d | |||
41114a2a27 | |||
83cd0156e0 | |||
0732932553 | |||
6e850a6900 | |||
2a4bd00cef | |||
81530e3603 | |||
d47c39775b | |||
53f7fccc94 | |||
327d3ee455 | |||
eaf3f36168 | |||
6868634abd | |||
78e006b9b0 | |||
e2390c7f32 | |||
7e6a2a64f0 | |||
9088784972 | |||
f723701de0 | |||
4490ec4e83 | |||
5d7c2df536 | |||
53ba05b090 | |||
29b857150c | |||
ccb148ac63 | |||
678b207fb1 | |||
ff34bee3a2 | |||
3c77b6a1ce | |||
a764e73d4f | |||
2ec28aec9d | |||
7a4ca32175 | |||
8a4c812ede | |||
3ed0d93796 | |||
2eb6fc3b52 | |||
5bca906b30 | |||
7d60384a00 | |||
9c9472ff49 | |||
5a9e5845e1 | |||
7973de35ba | |||
dd0b287c1e | |||
88421d6dc8 | |||
1a3e5747b7 | |||
5a234eb18e | |||
0ad871dc4d | |||
1b862c466b | |||
c9e7e344ed | |||
cd268017cf | |||
5dd839ce20 | |||
2b59df00d8 | |||
7a3fe3e180 | |||
a74901929e | |||
f674b358fc | |||
d8e44476d8 | |||
05bd9785fd | |||
c4c5642513 | |||
cd9172077b | |||
189663bdac | |||
11d7e62f1d | |||
63cb6567f0 | |||
e29a27f6f8 | |||
9fa5dabedc | |||
83494b4ac6 | |||
9bb0dad0d8 | |||
605793500b | |||
ac2cd2b08f | |||
6106504e9e | |||
98c2eaed27 | |||
885971e2f5 | |||
9ff9c7b974 | |||
f6488547e3 | |||
24e9316560 | |||
4db572eeb2 | |||
ad2d4969e1 | |||
0c35752d04 | |||
c6ba2f9dde | |||
47bc9c3337 | |||
a9a7c0c602 | |||
20c370d9f2 | |||
f5f1b59d3b | |||
d8cee76b49 | |||
5245beb37c | |||
378697ac58 | |||
547f94f330 | |||
b5841b99e6 | |||
9e60e899ee | |||
0894e0d808 | |||
1557b16dad | |||
1a71d31bf3 | |||
c816a2c226 | |||
4a0b85ad01 | |||
5bea41dea3 | |||
1840a7b4e3 | |||
16e26a3116 | |||
ee41052ccb | |||
042414fa00 | |||
841e498c5d | |||
7b7a118e74 | |||
11005b078d | |||
ffcfddc759 | |||
c72bdd28ac | |||
cc7eb2aa7a | |||
5231224e11 | |||
648594eaf7 | |||
c03fe66ade | |||
4ece152ad6 | |||
0f1227f7d5 | |||
d9162550aa | |||
1aeddeb8bd | |||
de69a7353e | |||
482d2f37a5 | |||
a2438132a6 | |||
31e21766d6 | |||
c323527d67 | |||
fe3418abe0 | |||
5b73992d8f | |||
9da32e4d57 | |||
90fba5627b | |||
6bcb18253a | |||
981217c11f | |||
b885a7c72c | |||
c967d57aa9 | |||
f055d45023 | |||
f32f099761 | |||
d4ab807d62 | |||
09f688c33a | |||
deb108ba0a | |||
1594f31345 | |||
30441bb3d5 | |||
41fb723ee9 | |||
db86472770 | |||
6a9e5c69cf | |||
5ede5b231e | |||
efc5db5215 | |||
90df4b9d42 | |||
303215d60c | |||
b5098060f4 | |||
599a6e5b36 | |||
442b29c968 | |||
5cb09620c1 | |||
404557e6a6 | |||
04db26b360 | |||
f6d877975b | |||
d6fa7bd5b9 | |||
22f85d0459 | |||
6977dba04b | |||
97f227d9c9 | |||
b7480cd893 | |||
f33cae6050 | |||
3777d6e32b | |||
26e88ec8e2 | |||
67b17a6fc6 | |||
7a40ff00ed | |||
4197828dc6 | |||
999db2346b | |||
1d97efce0c | |||
6c72fd51a8 | |||
b17ab86e7b | |||
c60e959cba | |||
fb773a3e0a | |||
74509239df | |||
e28d9b3bd4 | |||
00aaa512d5 | |||
20cc528320 | |||
9cee4a1c9c | |||
fcde67c99f | |||
6fc0161682 | |||
acbb4b5720 | |||
a26f56f675 | |||
72463f883c | |||
b836f631db | |||
11a632d60b | |||
576cb75ceb | |||
a3d1b29bd3 | |||
834193afd7 | |||
d3d8feeb89 | |||
3f987b5917 | |||
80b2ba3e96 | |||
ea042677ab | |||
4067bd3604 | |||
7d7bcc6ba0 | |||
127950241e | |||
ffec6dd16a | |||
108010aa47 | |||
d887297ad0 | |||
1d1ce613cd | |||
17d868b8b2 | |||
577dc93da9 | |||
4d8f476176 | |||
e65081d1b5 | |||
65aee0b714 | |||
4cd5c52d64 | |||
054794c20f | |||
98f9a5f4cb | |||
e3ffaa6b7c | |||
015cf10311 | |||
307dec4567 | |||
14ded11fca | |||
3a3b10e87a | |||
4d5dfe2083 | |||
13e45d14ba | |||
ce024c3e20 | |||
444d878324 | |||
f3caeb63d6 | |||
6582e230a0 | |||
22480d147f | |||
f3d30842dc | |||
b420ac9d20 | |||
98703d7f6c | |||
3a62b14077 | |||
d415d26913 | |||
6738fd2000 | |||
44dea9da4b | |||
18d46587b9 | |||
8cec9273d2 | |||
cc65040986 | |||
8ce3ca8961 | |||
7237cab8f1 | |||
831bdf8622 | |||
ef7be8348f | |||
419a40ac96 | |||
226b28b961 | |||
22f17a29cd | |||
cb54bc6562 | |||
035bd1c99f | |||
f1e7449d56 | |||
2ac4b2536a | |||
4f8f54280f | |||
0d5e1ec37f | |||
2fb1b89d72 | |||
ca81f0e834 | |||
f573c6e1ed | |||
208f0b48b2 | |||
2fb7495686 | |||
6864efa596 | |||
ad52f96a2d | |||
59b50c3bee | |||
fae55a9cb0 | |||
74f4a965bc | |||
6e9695525e | |||
4cea536bdf | |||
29f0dc3689 | |||
6bc30b05e6 | |||
41a7f82dea | |||
b90ac5e96e | |||
55b6b60b69 | |||
61a417b7c1 | |||
a97c36310f | |||
f57b43c230 | |||
8ac681a280 | |||
968a5b62ff | |||
affd0bc626 | |||
caf1a2f296 | |||
3b814af7e1 | |||
47f6db9089 | |||
1b0a9dd413 | |||
26d711645c | |||
b69c6fb7b4 | |||
90478f35a8 | |||
2d6d718dde | |||
5ffefbb35a | |||
2346a63784 | |||
4ee9d8e04d | |||
e70e12b32f | |||
2e66b0d137 | |||
c2dec4cac4 | |||
c3a27bbd53 | |||
6d1792d408 | |||
d9f31c13d2 | |||
e99d422bbd | |||
e6174fd58d | |||
4a27aefe3b | |||
a993153538 | |||
7423577180 | |||
6654ca702c | |||
0b71955552 | |||
5958549760 | |||
744aecf877 | |||
22db0d549f | |||
8de901e1f1 | |||
f0a4069e3d | |||
4f13527598 | |||
3044324e8d | |||
7b4f76c030 | |||
544a38e44d | |||
31e299c08f | |||
a42e6e0082 | |||
54656015d3 | |||
c04f2a4cd4 | |||
e3f50ad640 | |||
b55d618f19 | |||
a733042b12 | |||
445f11d5bc | |||
dc73b4b75d | |||
c41badb748 | |||
8cf02e5cf8 | |||
2f9c209ba0 | |||
f7a023e580 | |||
3a7503c34c | |||
f05d2fc539 | |||
e729ce294f | |||
6db7b6375a | |||
518df27ebe | |||
99285550a9 | |||
2067733b5c | |||
c64ed2b714 | |||
3cfa5b16b0 | |||
7a2217bedd | |||
f5bfa8faa7 | |||
2752360646 | |||
59b262362f | |||
1328bde9d4 | |||
c6d71532dd | |||
8da6d6db34 | |||
b288ba9f1d | |||
4f2417ffee | |||
84e9ade826 | |||
21492743e8 |
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
@ -51,6 +51,7 @@ runtime/compiler/sass.vim @tpope
|
||||
runtime/compiler/se.vim @dkearns
|
||||
runtime/compiler/shellcheck.vim @dkearns
|
||||
runtime/compiler/sml.vim @dkearns
|
||||
runtime/compiler/spectral.vim @romainl
|
||||
runtime/compiler/stylelint.vim @dkearns
|
||||
runtime/compiler/tcl.vim @dkearns
|
||||
runtime/compiler/tidy.vim @dkearns
|
||||
@ -59,6 +60,7 @@ runtime/compiler/tsc.vim @dkearns
|
||||
runtime/compiler/typedoc.vim @dkearns
|
||||
runtime/compiler/xmllint.vim @dkearns
|
||||
runtime/compiler/xo.vim @dkearns
|
||||
runtime/compiler/yamllint.vim @romainl
|
||||
runtime/compiler/zsh.vim @dkearns
|
||||
runtime/doc/pi_getscript.txt @cecamp
|
||||
runtime/doc/pi_logipat.txt @cecamp
|
||||
@ -236,3 +238,4 @@ src/libvterm/ @leonerd
|
||||
src/po/de.po @chrisbra
|
||||
src/po/eo.po @dpelle
|
||||
src/po/fr.po @dpelle
|
||||
src/xxd/ @jnweiger
|
||||
|
7
.github/workflows/ci.yml
vendored
7
.github/workflows/ci.yml
vendored
@ -56,7 +56,7 @@ jobs:
|
||||
|
||||
- name: Install packages
|
||||
run: |
|
||||
sudo apt-get install -y \
|
||||
sudo apt update && sudo apt install -y \
|
||||
autoconf \
|
||||
lcov \
|
||||
gettext \
|
||||
@ -71,7 +71,8 @@ jobs:
|
||||
cscope \
|
||||
libgtk2.0-dev \
|
||||
desktop-file-utils \
|
||||
libtool-bin
|
||||
libtool-bin \
|
||||
libsodium-dev
|
||||
|
||||
- name: Install clang-11
|
||||
if: matrix.compiler == 'clang'
|
||||
@ -365,7 +366,7 @@ jobs:
|
||||
features: NORMAL
|
||||
|
||||
steps:
|
||||
- name: Initalize
|
||||
- name: Initialize
|
||||
id: init
|
||||
shell: bash
|
||||
run: |
|
||||
|
2
Filelist
2
Filelist
@ -134,6 +134,7 @@ SRC_ALL = \
|
||||
src/spell.h \
|
||||
src/spellfile.c \
|
||||
src/spellsuggest.c \
|
||||
src/strings.c \
|
||||
src/structs.h \
|
||||
src/syntax.c \
|
||||
src/tag.c \
|
||||
@ -296,6 +297,7 @@ SRC_ALL = \
|
||||
src/proto/spell.pro \
|
||||
src/proto/spellfile.pro \
|
||||
src/proto/spellsuggest.pro \
|
||||
src/proto/strings.pro \
|
||||
src/proto/syntax.pro \
|
||||
src/proto/tag.pro \
|
||||
src/proto/term.pro \
|
||||
|
@ -4,6 +4,12 @@
|
||||
|
||||
<sub>For translations of this README see the end.</sub>
|
||||
|
||||
If you find a bug or want to discuss the best way to add a new feature, please
|
||||
open an [issue](https://github.com/vim/vim/issues).
|
||||
If you have a question or want to discuss the best way to do something with
|
||||
Vim, you can use [StackExchange](https://vi.stackexchange.com/)
|
||||
or one of the [Maillists](https://www.vim.org/community.php).
|
||||
|
||||
|
||||
## What is Vim? ##
|
||||
|
||||
|
@ -45,14 +45,16 @@ full code is below):
|
||||
| Vim old | 5.018541 |
|
||||
| Python | 0.369598 |
|
||||
| Lua | 0.078817 |
|
||||
| LuaJit | 0.004245 |
|
||||
| Vim new | 0.073595 |
|
||||
|
||||
That looks very promising! It's just one example, but it shows how much
|
||||
we can gain, and also that Vim script can be faster than builtin
|
||||
interfaces.
|
||||
|
||||
In practice the script would not do something useless as counting but change
|
||||
the text. For example, reindent all the lines:
|
||||
LuaJit is much faster at Lua-only instructions. In practice the script would
|
||||
not do something useless as counting but change the text. For example,
|
||||
reindent all the lines:
|
||||
|
||||
``` vim
|
||||
let totallen = 0
|
||||
@ -64,13 +66,17 @@ the text. For example, reindent all the lines:
|
||||
|
||||
| how | time in sec |
|
||||
| --------| -------- |
|
||||
| Vim old | 0.853752 |
|
||||
| Python | 0.304584 |
|
||||
| Lua | 0.286573 |
|
||||
| Vim new | 0.190276 |
|
||||
| Vim old | 0.578598 |
|
||||
| Python | 0.152040 |
|
||||
| Lua | 0.164917 |
|
||||
| LuaJit | 0.128400 |
|
||||
| Vim new | 0.079692 |
|
||||
|
||||
[These times were measured on a different system by Dominique Pelle]
|
||||
|
||||
The differences are smaller, but Vim 9 script is clearly the fastest.
|
||||
Using LuaJIT gives 0.25, only a little bit faster than plain Lua.
|
||||
Using LuaJIT is only a little bit faster than plain Lua here, clearly the call
|
||||
back to the Vim code is costly.
|
||||
|
||||
How does Vim9 script work? The function is first compiled into a sequence of
|
||||
instructions. Each instruction has one or two parameters and a stack is
|
||||
|
@ -74,7 +74,7 @@ Unpack the images:
|
||||
cd nsis
|
||||
unzip icons.zip
|
||||
|
||||
To build then, enter:
|
||||
Then build gvim.exe:
|
||||
|
||||
cd nsis
|
||||
makensis gvim.nsi
|
||||
|
@ -126,10 +126,11 @@ RequestExecutionLevel highest
|
||||
# This adds '\Vim' to the user choice automagically. The actual value is
|
||||
# obtained below with CheckOldVim.
|
||||
!ifdef WIN64
|
||||
InstallDir "$PROGRAMFILES64\Vim"
|
||||
!define DEFAULT_INSTDIR "$PROGRAMFILES64\Vim"
|
||||
!else
|
||||
InstallDir "$PROGRAMFILES\Vim"
|
||||
!define DEFAULT_INSTDIR "$PROGRAMFILES\Vim"
|
||||
!endif
|
||||
InstallDir ${DEFAULT_INSTDIR}
|
||||
|
||||
# Types of installs we can perform:
|
||||
InstType $(str_type_typical)
|
||||
@ -710,8 +711,13 @@ Function .onInit
|
||||
!insertmacro MUI_LANGDLL_DISPLAY
|
||||
!endif
|
||||
|
||||
# Check $VIM
|
||||
ReadEnvStr $INSTDIR "VIM"
|
||||
${If} $INSTDIR == ${DEFAULT_INSTDIR}
|
||||
# Check $VIM
|
||||
ReadEnvStr $3 "VIM"
|
||||
${If} $3 != ""
|
||||
StrCpy $INSTDIR $3
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
|
||||
call CheckOldVim
|
||||
Pop $3
|
||||
@ -721,20 +727,11 @@ Function .onInit
|
||||
SectionSetInstTypes ${id_section_old_ver} 0
|
||||
SectionSetText ${id_section_old_ver} ""
|
||||
${Else}
|
||||
${If} $INSTDIR == ""
|
||||
${If} $INSTDIR == ${DEFAULT_INSTDIR}
|
||||
StrCpy $INSTDIR $3
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
|
||||
# If did not find a path: use the default dir.
|
||||
${If} $INSTDIR == ""
|
||||
!ifdef WIN64
|
||||
StrCpy $INSTDIR "$PROGRAMFILES64\Vim"
|
||||
!else
|
||||
StrCpy $INSTDIR "$PROGRAMFILES\Vim"
|
||||
!endif
|
||||
${EndIf}
|
||||
|
||||
${If} ${RunningX64}
|
||||
SetRegView 64
|
||||
${EndIf}
|
||||
|
11
runtime/autoload/dist/ft.vim
vendored
11
runtime/autoload/dist/ft.vim
vendored
@ -172,6 +172,17 @@ func dist#ft#FTent()
|
||||
setf dtd
|
||||
endfunc
|
||||
|
||||
func dist#ft#ExCheck()
|
||||
let lines = getline(1, min([line("$"), 100]))
|
||||
if exists('g:filetype_euphoria')
|
||||
exe 'setf ' . g:filetype_euphoria
|
||||
elseif match(lines, '^--\|^ifdef\>\|^include\>') > -1
|
||||
setf euphoria3
|
||||
else
|
||||
setf elixir
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func dist#ft#EuphoriaCheck()
|
||||
if exists('g:filetype_euphoria')
|
||||
exe 'setf ' . g:filetype_euphoria
|
||||
|
@ -3,7 +3,7 @@
|
||||
" Maintainer: Mark Guzman <segfault@hasno.info>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2019 Feb 25
|
||||
" Last Change: 2020 Apr 12
|
||||
" ----------------------------------------------------------------------------
|
||||
"
|
||||
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
|
||||
@ -501,13 +501,8 @@ class VimRubyCompletion
|
||||
return if rails_base == nil
|
||||
$:.push rails_base unless $:.index( rails_base )
|
||||
|
||||
rails_config = rails_base + "config/"
|
||||
rails_lib = rails_base + "lib/"
|
||||
$:.push rails_config unless $:.index( rails_config )
|
||||
$:.push rails_lib unless $:.index( rails_lib )
|
||||
|
||||
bootfile = rails_config + "boot.rb"
|
||||
envfile = rails_config + "environment.rb"
|
||||
bootfile = rails_base + "config/boot.rb"
|
||||
envfile = rails_base + "config/environment.rb"
|
||||
if File.exists?( bootfile ) && File.exists?( envfile )
|
||||
begin
|
||||
require bootfile
|
||||
|
17
runtime/compiler/spectral.vim
Normal file
17
runtime/compiler/spectral.vim
Normal file
@ -0,0 +1,17 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Spectral for YAML
|
||||
" Maintainer: Romain Lafourcade <romainlafourcade@gmail.com>
|
||||
" Last Change: 2021 July 21
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "spectral"
|
||||
|
||||
if exists(":CompilerSet") != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=spectral\ lint\ %\ -f\ text
|
||||
CompilerSet errorformat=%f:%l:%c\ %t%.%\\{-}\ %m
|
||||
|
16
runtime/compiler/yamllint.vim
Normal file
16
runtime/compiler/yamllint.vim
Normal file
@ -0,0 +1,16 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Yamllint for YAML
|
||||
" Maintainer: Romain Lafourcade <romainlafourcade@gmail.com>
|
||||
" Last Change: 2021 July 21
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "yamllint"
|
||||
|
||||
if exists(":CompilerSet") != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=yamllint\ -f\ parsable
|
||||
|
@ -1,4 +1,4 @@
|
||||
*arabic.txt* For Vim version 8.2. Last change: 2019 May 05
|
||||
*arabic.txt* For Vim version 8.2. Last change: 2021 Jun 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Nadim Shaikli
|
||||
@ -176,6 +176,13 @@ o Enable Arabic settings [short-cut]
|
||||
and its support is preferred due to its level of offerings.
|
||||
'arabic' when 'termbidi' is enabled only sets the keymap.
|
||||
|
||||
For vertical window isolation while setting 'termbidi' an LTR
|
||||
vertical separator like "l" or "𝖨" may be used. It may also be
|
||||
hidden by changing its color to the foreground color: >
|
||||
:set fillchars=vert:l
|
||||
:hi VertSplit ctermbg=White
|
||||
< Note that this is a workaround, not a proper solution.
|
||||
|
||||
If, on the other hand, you'd like to be verbose and explicit and
|
||||
are opting not to use the 'arabic' short-cut command, here's what
|
||||
is needed (i.e. if you use ':set arabic' you can skip this section) -
|
||||
|
@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 8.2. Last change: 2021 May 29
|
||||
*autocmd.txt* For Vim version 8.2. Last change: 2021 Jul 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -54,7 +54,7 @@ effects. Be careful not to destroy your text.
|
||||
:au[tocmd] [group] {event} {pat} [++once] [++nested] {cmd}
|
||||
Add {cmd} to the list of commands that Vim will
|
||||
execute automatically on {event} for a file matching
|
||||
{pat} |autocmd-patterns|.
|
||||
{pat} |autocmd-patterns|.
|
||||
Here {event} cannot be "*". *E1155*
|
||||
Note: A quote character is seen as argument to the
|
||||
:autocmd and won't start a comment.
|
||||
@ -76,6 +76,12 @@ and in a `:def` function) then {cmd} will be executed as in Vim9
|
||||
script. Thus this depends on where the autocmd is defined, not where it is
|
||||
triggered.
|
||||
|
||||
{cmd} can use a block, like with `:command`, see |:command-repl|. Example: >
|
||||
au BufReadPost *.xml {
|
||||
setlocal matchpairs+=<:>
|
||||
/<start
|
||||
}
|
||||
|
||||
Note: The ":autocmd" command can only be followed by another command when the
|
||||
'|' appears before {cmd}. This works: >
|
||||
:augroup mine | au! BufRead | augroup END
|
||||
@ -679,8 +685,11 @@ CursorHoldI Just like CursorHold, but in Insert mode.
|
||||
CursorMoved After the cursor was moved in Normal or Visual
|
||||
mode. Also when the text of the cursor line
|
||||
has been changed, e.g., with "x", "rx" or "p".
|
||||
Not triggered when there is typeahead or when
|
||||
an operator is pending.
|
||||
Not triggered when there is typeahead, while
|
||||
executing commands in a script file, when
|
||||
an operator is pending or when moving to
|
||||
another window while remaining at the same
|
||||
cursor position.
|
||||
For an example see |match-parens|.
|
||||
Note: This can not be skipped with
|
||||
`:noautocmd`.
|
||||
|
@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 8.2. Last change: 2021 Mar 01
|
||||
*change.txt* For Vim version 8.2. Last change: 2021 Jun 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -780,12 +780,15 @@ For compatibility with Vi these two exceptions are allowed:
|
||||
"\/{string}/" and "\?{string}?" do the same as "//{string}/r".
|
||||
"\&{string}&" does the same as "//{string}/".
|
||||
*pattern-delimiter* *E146*
|
||||
Instead of the '/' which surrounds the pattern and replacement string, you
|
||||
can use any other single-byte character, but not an alphanumeric character,
|
||||
'\', '"' or '|'. This is useful if you want to include a '/' in the search
|
||||
pattern or replacement string. Example: >
|
||||
Instead of the '/' which surrounds the pattern and replacement string, you can
|
||||
use another single-byte character. This is useful if you want to include a
|
||||
'/' in the search pattern or replacement string. Example: >
|
||||
:s+/+//+
|
||||
|
||||
You can use most characters, but not an alphanumeric character, '\', '"' or
|
||||
'|'. In Vim9 script you should not use '#' because it may be recognized as
|
||||
the start of a comment.
|
||||
|
||||
For the definition of a pattern, see |pattern|. In Visual block mode, use
|
||||
|/\%V| in the pattern to have the substitute work in the block only.
|
||||
Otherwise it works on whole lines anyway.
|
||||
@ -1042,6 +1045,10 @@ inside of strings can change! Also see 'softtabstop' option. >
|
||||
cursor to the end of line (which is more logical,
|
||||
but not Vi-compatible) use ":map Y y$".
|
||||
|
||||
*zy*
|
||||
["x]zy{motion} Yank {motion} text [into register x]. Only differs
|
||||
from `y` when selecting a block of text, see |v_zy|.
|
||||
|
||||
*v_y*
|
||||
{Visual}["x]y Yank the highlighted text [into register x] (for
|
||||
{Visual} see |Visual-mode|).
|
||||
@ -1050,6 +1057,12 @@ inside of strings can change! Also see 'softtabstop' option. >
|
||||
{Visual}["x]Y Yank the highlighted lines [into register x] (for
|
||||
{Visual} see |Visual-mode|).
|
||||
|
||||
*v_zy*
|
||||
{Visual}["x]zy Yank the highlighted text [into register x]. Trailing
|
||||
whitespace at the end of each line of a selected block
|
||||
won't be yanked. Especially useful in combination
|
||||
with `zp`. (for {Visual} see |Visual-mode|)
|
||||
|
||||
*:y* *:yank* *E850*
|
||||
:[range]y[ank] [x] Yank [range] lines [into register x]. Yanking to the
|
||||
"* or "+ registers is possible only when the
|
||||
@ -1129,7 +1142,8 @@ inside of strings can change! Also see 'softtabstop' option. >
|
||||
["x]zp or *zp* *zP*
|
||||
["x]zP Like "p" and "P", except without adding trailing spaces
|
||||
when pasting a block. Thus the inserted text will not
|
||||
always be a rectangle.
|
||||
always be a rectangle. Especially useful in
|
||||
combination with |v_zy|.
|
||||
|
||||
You can use these commands to copy text from one place to another. Do this
|
||||
by first getting the text into a register with a yank, delete or change
|
||||
|
@ -852,7 +852,7 @@ available.
|
||||
job_getchannel({job}) *job_getchannel()*
|
||||
Get the channel handle that {job} is using.
|
||||
To check if the job has no channel: >
|
||||
if string(job_getchannel()) == 'channel fail'
|
||||
if string(job_getchannel(job)) == 'channel fail'
|
||||
<
|
||||
Can also be used as a |method|: >
|
||||
GetJob()->job_getchannel()
|
||||
|
@ -1,4 +1,4 @@
|
||||
*digraph.txt* For Vim version 8.2. Last change: 2020 Jul 16
|
||||
*digraph.txt* For Vim version 8.2. Last change: 2021 Jul 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -38,6 +38,9 @@ An alternative is using the 'keymap' option.
|
||||
< Avoid defining a digraph with '_' (underscore) as the
|
||||
first character, it has a special meaning in the
|
||||
future.
|
||||
NOTE: This command cannot add a digraph that starts
|
||||
with a white space. If you want to add such digraph,
|
||||
you can use |digraph_set()| instead.
|
||||
|
||||
Vim is normally compiled with the |+digraphs| feature. If the feature is
|
||||
disabled, the ":digraph" command will display an error message.
|
||||
|
@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.2. Last change: 2021 May 27
|
||||
*editing.txt* For Vim version 8.2. Last change: 2021 Jul 25
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -1469,8 +1469,11 @@ be readable again. If you use a wrong key, it will be a mess.
|
||||
:X Prompt for an encryption key. The typing is done without showing the
|
||||
actual text, so that someone looking at the display won't see it.
|
||||
The typed key is stored in the 'key' option, which is used to encrypt
|
||||
the file when it is written. The file will remain unchanged until you
|
||||
write it. See also |-x|.
|
||||
the file when it is written.
|
||||
The file will remain unchanged until you write it. Note that commands
|
||||
such as `:xit` and `ZZ` will NOT write the file unless there are other
|
||||
changes.
|
||||
See also |-x|.
|
||||
|
||||
The value of the 'key' options is used when text is written. When the option
|
||||
is not empty, the written file will be encrypted, using the value as the
|
||||
@ -1749,6 +1752,12 @@ There are three different types of searching:
|
||||
/u/user_x/work/include
|
||||
/u/user_x/include
|
||||
|
||||
< Note: If your 'path' setting includes an non-existing directory, Vim will
|
||||
skip the non-existing directory, but continues searching in the parent of
|
||||
the non-existing directory if upwards searching is used. E.g. when
|
||||
searching "../include" and that doesn't exist, and upward searching is
|
||||
used, also searches in "..".
|
||||
|
||||
3) Combined up/downward search:
|
||||
If Vim's current path is /u/user_x/work/release and you do >
|
||||
set path=**;/u/user_x
|
||||
|
@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.2. Last change: 2021 May 07
|
||||
*eval.txt* For Vim version 8.2. Last change: 2021 Jul 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -1588,7 +1588,17 @@ The lambda expression is also useful for Channel, Job and timer: >
|
||||
Handler called
|
||||
Handler called
|
||||
|
||||
Note how execute() is used to execute an Ex command. That's ugly though.
|
||||
Note that it is possible to cause memory to be used and not freed if the
|
||||
closure is referenced by the context it depends on: >
|
||||
function Function()
|
||||
let x = 0
|
||||
let F = {-> x}
|
||||
endfunction
|
||||
The closure uses "x" from the function scope, and "F" in that same scope
|
||||
refers to the closure. This cycle results in the memory not being freed.
|
||||
Recommendation: don't do this.
|
||||
|
||||
Notice how execute() is used to execute an Ex command. That's ugly though.
|
||||
In Vim9 script you can use a command block, see |inline-function|.
|
||||
|
||||
Lambda expressions have internal names like '<lambda>42'. If you get an error
|
||||
@ -1963,7 +1973,8 @@ v:fcs_choice What should happen after a |FileChangedShell| event was
|
||||
Vim behaves like it is empty, there is no warning message.
|
||||
|
||||
*v:fname* *fname-variable*
|
||||
v:fname The file name set by 'includeexpr'. Empty otherwise.
|
||||
v:fname When evaluating 'includeexpr': the file name that was
|
||||
detected. Empty otherwise.
|
||||
|
||||
*v:fname_in* *fname_in-variable*
|
||||
v:fname_in The name of the input file. Valid while evaluating:
|
||||
@ -2102,7 +2113,7 @@ v:null An empty String. Used to put "null" in JSON. See
|
||||
v:numbermax Maximum value of a number.
|
||||
|
||||
*v:numbermin* *numbermin-variable*
|
||||
v:numbermin Minimum value of a number (negative)
|
||||
v:numbermin Minimum value of a number (negative).
|
||||
|
||||
*v:numbersize* *numbersize-variable*
|
||||
v:numbersize Number of bits in a Number. This is normally 64, but on some
|
||||
@ -2508,7 +2519,7 @@ char2nr({expr} [, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
|
||||
charclass({string}) Number character class of {string}
|
||||
charcol({expr}) Number column number of cursor or mark
|
||||
charidx({string}, {idx} [, {countcc}])
|
||||
Number char index of byte {idx} in {string}
|
||||
Number char index of byte {idx} in {string}
|
||||
chdir({dir}) String change current working directory
|
||||
cindent({lnum}) Number C indent for line {lnum}
|
||||
clearmatches([{win}]) none clear all matches
|
||||
@ -2529,7 +2540,7 @@ cscope_connection([{num}, {dbpath} [, {prepend}]])
|
||||
cursor({lnum}, {col} [, {off}])
|
||||
Number move cursor to {lnum}, {col}, {off}
|
||||
cursor({list}) Number move cursor to position in {list}
|
||||
debugbreak({pid}) Number interrupt process being debugged
|
||||
debugbreak({pid}) Number interrupt process being debugged
|
||||
deepcopy({expr} [, {noref}]) any make a full copy of {expr}
|
||||
delete({fname} [, {flags}]) Number delete the file or directory {fname}
|
||||
deletebufline({expr}, {first} [, {last}])
|
||||
@ -2537,6 +2548,10 @@ deletebufline({expr}, {first} [, {last}])
|
||||
did_filetype() Number |TRUE| if FileType autocmd event used
|
||||
diff_filler({lnum}) Number diff filler lines about {lnum}
|
||||
diff_hlID({lnum}, {col}) Number diff highlighting at {lnum}/{col}
|
||||
digraph_get({chars}) String get the digraph of {chars}
|
||||
digraph_getlist([{listall}]) List get all |digraph|s
|
||||
digraph_set({chars}, {digraph}) Boolean register |digraph|
|
||||
digraph_setlist({digraphlist}) Boolean register multiple |digraph|s
|
||||
echoraw({expr}) none output {expr} as-is
|
||||
empty({expr}) Number |TRUE| if {expr} is empty
|
||||
environ() Dict return environment variables
|
||||
@ -2594,10 +2609,12 @@ getbufline({expr}, {lnum} [, {end}])
|
||||
getbufvar({expr}, {varname} [, {def}])
|
||||
any variable {varname} in buffer {expr}
|
||||
getchangelist([{expr}]) List list of change list items
|
||||
getchar([expr]) Number get one character from the user
|
||||
getchar([expr]) Number or String
|
||||
get one character from the user
|
||||
getcharmod() Number modifiers for the last typed character
|
||||
getcharpos({expr}) List position of cursor, mark, etc.
|
||||
getcharsearch() Dict last character search
|
||||
getcharstr([expr]) String get one character from the user
|
||||
getcmdline() String return the current command-line
|
||||
getcmdpos() Number return cursor position in command-line
|
||||
getcmdtype() String return current command-line type
|
||||
@ -3020,6 +3037,10 @@ test_feedinput({string}) none add key sequence to input buffer
|
||||
test_garbagecollect_now() none free memory right now for testing
|
||||
test_garbagecollect_soon() none free memory soon for testing
|
||||
test_getvalue({string}) any get value of an internal variable
|
||||
test_gui_drop_files({list}, {row}, {col}, {mods})
|
||||
none drop a list of files in a window
|
||||
test_gui_mouse_event({button}, {row}, {col}, {repeated}, {mods})
|
||||
none add a mouse event to the input buffer
|
||||
test_ignore_error({expr}) none ignore a specific error
|
||||
test_null_blob() Blob null value for testing
|
||||
test_null_channel() Channel null value for testing
|
||||
@ -3156,6 +3177,7 @@ append({lnum}, {text}) *append()*
|
||||
the current buffer.
|
||||
Any type of item is accepted and converted to a String.
|
||||
{lnum} can be zero to insert a line before the first one.
|
||||
{lnum} is used like with |getline()|.
|
||||
Returns 1 for failure ({lnum} out of range or out of memory),
|
||||
0 for success. Example: >
|
||||
:let failed = append(line('$'), "# THE END")
|
||||
@ -3425,8 +3447,9 @@ bufloaded({expr}) *bufloaded()*
|
||||
let loaded = 'somename'->bufloaded()
|
||||
|
||||
bufname([{expr}]) *bufname()*
|
||||
The result is the name of a buffer, as it is displayed by the
|
||||
":ls" command.
|
||||
The result is the name of a buffer. Mostly as it is displayed
|
||||
by the `:ls` command, but not using special names such as
|
||||
"[No Name]".
|
||||
If {expr} is omitted the current buffer is used.
|
||||
If {expr} is a Number, that buffer number's name is given.
|
||||
Number zero is the alternate buffer for the current window.
|
||||
@ -3461,7 +3484,7 @@ bufname([{expr}]) *bufname()*
|
||||
*bufnr()*
|
||||
bufnr([{expr} [, {create}]])
|
||||
The result is the number of a buffer, as it is displayed by
|
||||
the ":ls" command. For the use of {expr}, see |bufname()|
|
||||
the `:ls` command. For the use of {expr}, see |bufname()|
|
||||
above.
|
||||
|
||||
If the buffer doesn't exist, -1 is returned. Or, if the
|
||||
@ -3656,10 +3679,10 @@ charidx({string}, {idx} [, {countcc}])
|
||||
The index of the first character is zero.
|
||||
If there are no multibyte characters the returned value is
|
||||
equal to {idx}.
|
||||
When {countcc} is omitted or zero, then composing characters
|
||||
are not counted separately, their byte length is added to the
|
||||
preceding base character.
|
||||
When {countcc} is set to 1, then composing characters are
|
||||
When {countcc} is omitted or |FALSE|, then composing characters
|
||||
are not counted separately, their byte length is
|
||||
added to the preceding base character.
|
||||
When {countcc} is |TRUE|, then composing characters are
|
||||
counted as separate characters.
|
||||
Returns -1 if the arguments are invalid or if {idx} is greater
|
||||
than the index of the last byte in {string}. An error is
|
||||
@ -3831,7 +3854,9 @@ complete_info([{what}])
|
||||
See |complete-items|.
|
||||
selected Selected item index. First index is zero.
|
||||
Index is -1 if no item is selected (showing
|
||||
typed text only)
|
||||
typed text only, or the last completion after
|
||||
no item is selected when using the <Up> or
|
||||
<Down> keys)
|
||||
inserted Inserted string. [NOT IMPLEMENT YET]
|
||||
|
||||
*complete_info_mode*
|
||||
@ -4046,6 +4071,7 @@ cursor({list})
|
||||
|setcursorcharpos()|.
|
||||
|
||||
Does not change the jumplist.
|
||||
{lnum} is used like with |getline()|.
|
||||
If {lnum} is greater than the number of lines in the buffer,
|
||||
the cursor will be positioned at the last line in the buffer.
|
||||
If {lnum} is zero, the cursor will stay in the current line.
|
||||
@ -4177,6 +4203,107 @@ diff_hlID({lnum}, {col}) *diff_hlID()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetLnum()->diff_hlID(col)
|
||||
<
|
||||
|
||||
digraph_get({chars}) *digraph_get()* *E1214*
|
||||
Return the digraph of {chars}. This should be a string with
|
||||
exactly two characters. If {chars} are not just two
|
||||
characters, or the digraph of {chars} does not exist, an error
|
||||
is given and an empty string is returned.
|
||||
|
||||
The character will be converted from Unicode to 'encoding'
|
||||
when needed. This does require the conversion to be
|
||||
available, it might fail.
|
||||
|
||||
Also see |digraph_getlist()|.
|
||||
|
||||
Examples: >
|
||||
" Get a built-in digraph
|
||||
:echo digraph_get('00') " Returns '∞'
|
||||
|
||||
" Get a user-defined digraph
|
||||
:call digraph_set('aa', 'あ')
|
||||
:echo digraph_get('aa') " Returns 'あ'
|
||||
<
|
||||
Can also be used as a |method|: >
|
||||
GetChars()->digraph_get()
|
||||
<
|
||||
This function works only when compiled with the |+digraphs|
|
||||
feature. If this feature is disabled, this function will
|
||||
display an error message.
|
||||
|
||||
|
||||
digraph_getlist([{listall}]) *digraph_getlist()*
|
||||
Return a list of digraphs. If the {listall} argument is given
|
||||
and it is TRUE, return all digraphs, including the default
|
||||
digraphs. Otherwise, return only user-defined digraphs.
|
||||
|
||||
The characters will be converted from Unicode to 'encoding'
|
||||
when needed. This does require the conservation to be
|
||||
available, it might fail.
|
||||
|
||||
Also see |digraph_get()|.
|
||||
|
||||
Examples: >
|
||||
" Get user-defined digraphs
|
||||
:echo digraph_getlist()
|
||||
|
||||
" Get all the digraphs, including default digraphs
|
||||
:echo digraph_getlist(1)
|
||||
<
|
||||
Can also be used as a |method|: >
|
||||
GetNumber()->digraph_getlist()
|
||||
<
|
||||
This function works only when compiled with the |+digraphs|
|
||||
feature. If this feature is disabled, this function will
|
||||
display an error message.
|
||||
|
||||
|
||||
digraph_set({chars}, {digraph}) *digraph_set()* *E1205*
|
||||
Add digraph {chars} to the list. {chars} must be a string
|
||||
with two characters. {digraph} is a string with one utf-8
|
||||
encoded character. Be careful, composing characters are NOT
|
||||
ignored. This function is similar to |:digraphs| command, but
|
||||
useful to add digraphs start with a white space.
|
||||
|
||||
The function result is v:true if |digraph| is registered. If
|
||||
this fails an error message is given and v:false is returned.
|
||||
|
||||
If you want to define multiple digraphs at once, you can use
|
||||
|digraph_setlist()|.
|
||||
|
||||
Example: >
|
||||
call digraph_set(' ', 'あ')
|
||||
<
|
||||
Can be used as a |method|: >
|
||||
GetString()->digraph_set('あ')
|
||||
<
|
||||
This function works only when compiled with the |+digraphs|
|
||||
feature. If this feature is disabled, this function will
|
||||
display an error message.
|
||||
|
||||
|
||||
digraph_setlist({digraphlist}) *digraph_setlist()*
|
||||
Similar to |digraph_set()| but this function can add multiple
|
||||
digraphs at once. {digraphlist} is a list composed of lists,
|
||||
where each list contains two strings with {chars} and
|
||||
{digraph} as in |digraph_set()|.
|
||||
Example: >
|
||||
call digraph_setlist([['aa', 'あ'], ['ii', 'い']])
|
||||
<
|
||||
It is similar to the following: >
|
||||
for [chars, digraph] in [['aa', 'あ'], ['ii', 'い']]
|
||||
call digraph_set(chars, digraph)
|
||||
endfor
|
||||
< Except that the function returns after the first error,
|
||||
following digraphs will not be added.
|
||||
|
||||
Can be used as a |method|: >
|
||||
GetList()->digraph_setlist()
|
||||
<
|
||||
This function works only when compiled with the |+digraphs|
|
||||
feature. If this feature is disabled, this function will
|
||||
display an error message.
|
||||
|
||||
|
||||
echoraw({expr}) *echoraw()*
|
||||
@ -4315,6 +4442,8 @@ exepath({expr}) *exepath()*
|
||||
*exists()*
|
||||
exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
|
||||
zero otherwise.
|
||||
Note: In a compiled |:def| function local variables and
|
||||
arguments are not visible to `exists()`.
|
||||
|
||||
For checking for a supported feature use |has()|.
|
||||
For checking if a file exists use |filereadable()|.
|
||||
@ -4337,9 +4466,11 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
|
||||
varname internal variable (see
|
||||
|internal-variables|). Also works
|
||||
for |curly-braces-names|, |Dictionary|
|
||||
entries, |List| items, etc. Beware
|
||||
that evaluating an index may cause an
|
||||
error message for an invalid
|
||||
entries, |List| items, etc.
|
||||
Does not work for local variables in a
|
||||
compiled `:def` function.
|
||||
Beware that evaluating an index may
|
||||
cause an error message for an invalid
|
||||
expression. E.g.: >
|
||||
:let l = [1, 2, 3]
|
||||
:echo exists("l[5]")
|
||||
@ -4652,15 +4783,18 @@ filewritable({file}) *filewritable()*
|
||||
|
||||
|
||||
filter({expr1}, {expr2}) *filter()*
|
||||
{expr1} must be a |List| or a |Dictionary|.
|
||||
{expr1} must be a |List|, |Blob| or |Dictionary|.
|
||||
For each item in {expr1} evaluate {expr2} and when the result
|
||||
is zero remove the item from the |List| or |Dictionary|.
|
||||
is zero remove the item from the |List| or |Dictionary|. For a
|
||||
|Blob| each byte is removed.
|
||||
|
||||
{expr2} must be a |string| or |Funcref|.
|
||||
|
||||
If {expr2} is a |string|, inside {expr2} |v:val| has the value
|
||||
of the current item. For a |Dictionary| |v:key| has the key
|
||||
of the current item and for a |List| |v:key| has the index of
|
||||
the current item.
|
||||
the current item. For a |Blob| |v:key| has the index of the
|
||||
current byte.
|
||||
Examples: >
|
||||
call filter(mylist, 'v:val !~ "OLD"')
|
||||
< Removes the items where "OLD" appears. >
|
||||
@ -4691,11 +4825,11 @@ filter({expr1}, {expr2}) *filter()*
|
||||
|Dictionary| to remain unmodified make a copy first: >
|
||||
:let l = filter(copy(mylist), 'v:val =~ "KEEP"')
|
||||
|
||||
< Returns {expr1}, the |List| or |Dictionary| that was filtered.
|
||||
When an error is encountered while evaluating {expr2} no
|
||||
further items in {expr1} are processed. When {expr2} is a
|
||||
Funcref errors inside a function are ignored, unless it was
|
||||
defined with the "abort" flag.
|
||||
< Returns {expr1}, the |List| , |Blob| or |Dictionary| that was
|
||||
filtered. When an error is encountered while evaluating
|
||||
{expr2} no further items in {expr1} are processed. When
|
||||
{expr2} is a Funcref errors inside a function are ignored,
|
||||
unless it was defined with the "abort" flag.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
mylist->filter(expr2)
|
||||
@ -4856,6 +4990,8 @@ foldclosed({lnum}) *foldclosed()*
|
||||
The result is a Number. If the line {lnum} is in a closed
|
||||
fold, the result is the number of the first line in that fold.
|
||||
If the line {lnum} is not in a closed fold, -1 is returned.
|
||||
{lnum} is used like with |getline()|. Thus "." is the current
|
||||
line, "'m" mark m, etc.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetLnum()->foldclosed()
|
||||
@ -4864,6 +5000,8 @@ foldclosedend({lnum}) *foldclosedend()*
|
||||
The result is a Number. If the line {lnum} is in a closed
|
||||
fold, the result is the number of the last line in that fold.
|
||||
If the line {lnum} is not in a closed fold, -1 is returned.
|
||||
{lnum} is used like with |getline()|. Thus "." is the current
|
||||
line, "'m" mark m, etc.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetLnum()->foldclosedend()
|
||||
@ -4877,6 +5015,8 @@ foldlevel({lnum}) *foldlevel()*
|
||||
returned for lines where folds are still to be updated and the
|
||||
foldlevel is unknown. As a special case the level of the
|
||||
previous line is usually available.
|
||||
{lnum} is used like with |getline()|. Thus "." is the current
|
||||
line, "'m" mark m, etc.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetLnum()->foldlevel()
|
||||
@ -4949,7 +5089,7 @@ funcref({name} [, {arglist}] [, {dict}])
|
||||
Can also be used as a |method|: >
|
||||
GetFuncname()->funcref([arg])
|
||||
<
|
||||
*function()* *E700* *E922* *E923*
|
||||
*function()* *partial* *E700* *E922* *E923*
|
||||
function({name} [, {arglist}] [, {dict}])
|
||||
Return a |Funcref| variable that refers to function {name}.
|
||||
{name} can be the name of a user defined function or an
|
||||
@ -5232,6 +5372,7 @@ getchar([expr]) *getchar()*
|
||||
Return zero otherwise.
|
||||
If [expr] is 1, only check if a character is available, it is
|
||||
not consumed. Return zero if no character available.
|
||||
If you prefer always getting a string use |getcharstr()|.
|
||||
|
||||
Without [expr] and when [expr] is 0 a whole character or
|
||||
special key is returned. If it is a single character, the
|
||||
@ -5357,6 +5498,20 @@ getcharsearch() *getcharsearch()*
|
||||
:nnoremap <expr> , getcharsearch().forward ? ',' : ';'
|
||||
< Also see |setcharsearch()|.
|
||||
|
||||
|
||||
getcharstr([expr]) *getcharstr()*
|
||||
Get a single character from the user or input stream as a
|
||||
string.
|
||||
If [expr] is omitted, wait until a character is available.
|
||||
If [expr] is 0 or false, only get a character when one is
|
||||
available. Return an empty string otherwise.
|
||||
If [expr] is 1 or true, only check if a character is
|
||||
available, it is not consumed. Return an empty string
|
||||
if no character is available.
|
||||
Otherwise this works like |getchar()|, except that a number
|
||||
result is converted to a string.
|
||||
|
||||
|
||||
getcmdline() *getcmdline()*
|
||||
Return the current command-line. Only works when the command
|
||||
line is being edited, thus requires use of |c_CTRL-\_e| or
|
||||
@ -5483,8 +5638,8 @@ getcurpos([{winid}])
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetWinid()->getcurpos()
|
||||
|
||||
< *getcursorcharpos()*
|
||||
<
|
||||
*getcursorcharpos()*
|
||||
getcursorcharpos([{winid}])
|
||||
Same as |getcurpos()| but the column number in the returned
|
||||
List is a character index instead of a byte index.
|
||||
@ -5493,8 +5648,8 @@ getcursorcharpos([{winid}])
|
||||
With the cursor on '보' in line 3 with text "여보세요": >
|
||||
getcursorcharpos() returns [0, 3, 2, 0, 3]
|
||||
getcurpos() returns [0, 3, 4, 0, 3]
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
<
|
||||
Can also be used as a |method|: >
|
||||
GetWinid()->getcursorcharpos()
|
||||
|
||||
< *getcwd()*
|
||||
@ -5533,7 +5688,7 @@ getcwd([{winnr} [, {tabnr}]])
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
GetWinnr()->getcwd()
|
||||
<
|
||||
|
||||
getenv({name}) *getenv()*
|
||||
Return the value of environment variable {name}.
|
||||
When the variable does not exist |v:null| is returned. That
|
||||
@ -5719,11 +5874,11 @@ getmarklist([{expr}]) *getmarklist()*
|
||||
see |bufname()|.
|
||||
|
||||
Each item in the returned List is a |Dict| with the following:
|
||||
name - name of the mark prefixed by "'"
|
||||
pos - a |List| with the position of the mark:
|
||||
mark name of the mark prefixed by "'"
|
||||
pos a |List| with the position of the mark:
|
||||
[bufnum, lnum, col, off]
|
||||
Refer to |getpos()| for more information.
|
||||
file - file name
|
||||
Refer to |getpos()| for more information.
|
||||
file file name
|
||||
|
||||
Refer to |getpos()| for getting information about a specific
|
||||
mark.
|
||||
@ -5737,6 +5892,8 @@ getmatches([{win}]) *getmatches()*
|
||||
|getmatches()| is useful in combination with |setmatches()|,
|
||||
as |setmatches()| can restore a list of matches saved by
|
||||
|getmatches()|.
|
||||
If {win} is specified, use the window with this number or
|
||||
window ID instead of the current window.
|
||||
Example: >
|
||||
:echo getmatches()
|
||||
< [{'group': 'MyGroup1', 'pattern': 'TODO',
|
||||
@ -5774,7 +5931,7 @@ getmousepos() *getmousepos()*
|
||||
are zero.
|
||||
|
||||
When the position is after the text then "column" is the
|
||||
length of the text in bytes.
|
||||
length of the text in bytes plus one.
|
||||
|
||||
If the mouse is over a popup window then that window is used.
|
||||
|
||||
@ -5805,7 +5962,7 @@ getpos({expr}) Get the position for {expr}. For possible values of {expr}
|
||||
'> is a large number.
|
||||
The column number in the returned List is the byte position
|
||||
within the line. To get the character position in the line,
|
||||
use |getcharpos()|
|
||||
use |getcharpos()|.
|
||||
The column number can be very large, e.g. 2147483647, in which
|
||||
case it means "after the end of the line".
|
||||
This can be used to save and restore the position of a mark: >
|
||||
@ -5824,7 +5981,10 @@ getqflist([{what}]) *getqflist()*
|
||||
bufname() to get the name
|
||||
module module name
|
||||
lnum line number in the buffer (first line is 1)
|
||||
end_lnum
|
||||
end of line number if the item is multiline
|
||||
col column number (first column is 1)
|
||||
end_col end of column number if the item has range
|
||||
vcol |TRUE|: "col" is visual column
|
||||
|FALSE|: "col" is byte index
|
||||
nr error number
|
||||
@ -5834,8 +5994,10 @@ getqflist([{what}]) *getqflist()*
|
||||
valid |TRUE|: recognized error message
|
||||
|
||||
When there is no error list or it's empty, an empty list is
|
||||
returned. Quickfix list entries with non-existing buffer
|
||||
number are returned with "bufnr" set to zero.
|
||||
returned. Quickfix list entries with a non-existing buffer
|
||||
number are returned with "bufnr" set to zero (Note: some
|
||||
functions accept buffer number zero for the alternate buffer,
|
||||
you may need to explicitly check for zero).
|
||||
|
||||
Useful application: Find pattern matches in multiple files and
|
||||
do something with them: >
|
||||
@ -5979,12 +6141,12 @@ getregtype([{regname}]) *getregtype()*
|
||||
Can also be used as a |method|: >
|
||||
GetRegname()->getregtype()
|
||||
|
||||
gettabinfo([{arg}]) *gettabinfo()*
|
||||
If {arg} is not specified, then information about all the tab
|
||||
pages is returned as a |List|. Each List item is a |Dictionary|.
|
||||
Otherwise, {arg} specifies the tab page number and information
|
||||
about that one is returned. If the tab page does not exist an
|
||||
empty List is returned.
|
||||
gettabinfo([{tabnr}]) *gettabinfo()*
|
||||
If {tabnr} is not specified, then information about all the
|
||||
tab pages is returned as a |List|. Each List item is a
|
||||
|Dictionary|. Otherwise, {tabnr} specifies the tab page
|
||||
number and information about that one is returned. If the tab
|
||||
page does not exist an empty List is returned.
|
||||
|
||||
Each List item is a |Dictionary| with the following entries:
|
||||
tabnr tab page number.
|
||||
@ -6037,11 +6199,11 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()*
|
||||
< Can also be used as a |method|: >
|
||||
GetTabnr()->gettabwinvar(winnr, varname)
|
||||
|
||||
gettagstack([{nr}]) *gettagstack()*
|
||||
The result is a Dict, which is the tag stack of window {nr}.
|
||||
{nr} can be the window number or the |window-ID|.
|
||||
When {nr} is not specified, the current window is used.
|
||||
When window {nr} doesn't exist, an empty Dict is returned.
|
||||
gettagstack([{winnr}]) *gettagstack()*
|
||||
The result is a Dict, which is the tag stack of window {winnr}.
|
||||
{winnr} can be the window number or the |window-ID|.
|
||||
When {winnr} is not specified, the current window is used.
|
||||
When window {winnr} doesn't exist, an empty Dict is returned.
|
||||
|
||||
The returned dictionary contains the following entries:
|
||||
curidx Current index in the stack. When at
|
||||
@ -6988,9 +7150,9 @@ line2byte({lnum}) *line2byte()*
|
||||
below the last line: >
|
||||
line2byte(line("$") + 1)
|
||||
< This is the buffer size plus one. If 'fileencoding' is empty
|
||||
it is the file size plus one.
|
||||
When {lnum} is invalid, or the |+byte_offset| feature has been
|
||||
disabled at compile time, -1 is returned.
|
||||
it is the file size plus one. {lnum} is used like with
|
||||
|getline()|. When {lnum} is invalid, or the |+byte_offset|
|
||||
feature has been disabled at compile time, -1 is returned.
|
||||
Also see |byte2line()|, |go| and |:goto|.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
@ -7163,6 +7325,8 @@ luaeval({expr} [, {expr}]) *luaeval()*
|
||||
as-is.
|
||||
Other objects are returned as zero without any errors.
|
||||
See |lua-luaeval| for more details.
|
||||
Note that in a `:def` function local variables are not visible
|
||||
to {expr}.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetExpr()->luaeval()
|
||||
@ -7182,7 +7346,8 @@ map({expr1}, {expr2}) *map()*
|
||||
If {expr2} is a |string|, inside {expr2} |v:val| has the value
|
||||
of the current item. For a |Dictionary| |v:key| has the key
|
||||
of the current item and for a |List| |v:key| has the index of
|
||||
the current item.
|
||||
the current item. For a |Blob| |v:key| has the index of the
|
||||
current byte.
|
||||
Example: >
|
||||
:call map(mylist, '"> " . v:val . " <"')
|
||||
< This puts "> " before and " <" after each item in "mylist".
|
||||
@ -7620,7 +7785,7 @@ matchfuzzypos({list}, {str} [, {dict}]) *matchfuzzypos()*
|
||||
Same as |matchfuzzy()|, but returns the list of matched
|
||||
strings, the list of character positions where characters
|
||||
in {str} matches and a list of matching scores. You can
|
||||
use |byteidx()|to convert a character position to a byte
|
||||
use |byteidx()| to convert a character position to a byte
|
||||
position.
|
||||
|
||||
If {str} matches multiple times in a string, then only the
|
||||
@ -7828,6 +7993,10 @@ mode([expr]) Return a string that indicates the current mode.
|
||||
s Select by character
|
||||
S Select by line
|
||||
CTRL-S Select blockwise
|
||||
vs Visual by character using |v_CTRL-O| from
|
||||
Select mode
|
||||
Vs Visual by line using |v_CTRL-O| from Select mode
|
||||
CTRL-Vs Visual blockwise using |v_CTRL-O| from Select mode
|
||||
i Insert
|
||||
ic Insert mode completion |compl-generic|
|
||||
ix Insert mode |i_CTRL-X| completion
|
||||
@ -7869,6 +8038,9 @@ mzeval({expr}) *mzeval()*
|
||||
:echo mzeval("l")
|
||||
:echo mzeval("h")
|
||||
<
|
||||
Note that in a `:def` function local variables are not visible
|
||||
to {expr}.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetExpr()->mzeval()
|
||||
<
|
||||
@ -7880,6 +8052,7 @@ nextnonblank({lnum}) *nextnonblank()*
|
||||
if getline(nextnonblank(1)) =~ "Java"
|
||||
< When {lnum} is invalid or there is no non-blank line at or
|
||||
below it, zero is returned.
|
||||
{lnum} is used like with |getline()|.
|
||||
See also |prevnonblank()|.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
@ -7941,6 +8114,9 @@ perleval({expr}) *perleval()*
|
||||
:echo perleval('[1 .. 4]')
|
||||
< [1, 2, 3, 4]
|
||||
|
||||
Note that in a `:def` function local variables are not visible
|
||||
to {expr}.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetExpr()->perleval()
|
||||
|
||||
@ -7972,6 +8148,7 @@ prevnonblank({lnum}) *prevnonblank()*
|
||||
let ind = indent(prevnonblank(v:lnum - 1))
|
||||
< When {lnum} is invalid or there is no non-blank line at or
|
||||
above it, zero is returned.
|
||||
{lnum} is used like with |getline()|.
|
||||
Also see |nextnonblank()|.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
@ -8185,6 +8362,8 @@ prompt_getprompt({buf}) *prompt_getprompt()*
|
||||
Can also be used as a |method|: >
|
||||
GetBuffer()->prompt_getprompt()
|
||||
|
||||
< {only available when compiled with the |+channel| feature}
|
||||
|
||||
|
||||
prompt_setcallback({buf}, {expr}) *prompt_setcallback()*
|
||||
Set prompt callback for buffer {buf} to {expr}. When {expr}
|
||||
@ -8218,6 +8397,7 @@ prompt_setcallback({buf}, {expr}) *prompt_setcallback()*
|
||||
< Can also be used as a |method|: >
|
||||
GetBuffer()->prompt_setcallback(callback)
|
||||
|
||||
< {only available when compiled with the |+channel| feature}
|
||||
|
||||
prompt_setinterrupt({buf}, {expr}) *prompt_setinterrupt()*
|
||||
Set a callback for buffer {buf} to {expr}. When {expr} is an
|
||||
@ -8231,6 +8411,8 @@ prompt_setinterrupt({buf}, {expr}) *prompt_setinterrupt()*
|
||||
Can also be used as a |method|: >
|
||||
GetBuffer()->prompt_setinterrupt(callback)
|
||||
|
||||
< {only available when compiled with the |+channel| feature}
|
||||
|
||||
prompt_setprompt({buf}, {text}) *prompt_setprompt()*
|
||||
Set prompt for buffer {buf} to {text}. You most likely want
|
||||
{text} to end in a space.
|
||||
@ -8241,6 +8423,8 @@ prompt_setprompt({buf}, {text}) *prompt_setprompt()*
|
||||
Can also be used as a |method|: >
|
||||
GetBuffer()->prompt_setprompt('command: ')
|
||||
|
||||
< {only available when compiled with the |+channel| feature}
|
||||
|
||||
prop_ functions are documented here: |text-prop-functions|
|
||||
|
||||
pum_getpos() *pum_getpos()*
|
||||
@ -8272,6 +8456,8 @@ py3eval({expr}) *py3eval()*
|
||||
Lists are represented as Vim |List| type.
|
||||
Dictionaries are represented as Vim |Dictionary| type with
|
||||
keys converted to strings.
|
||||
Note that in a `:def` function local variables are not visible
|
||||
to {expr}.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetExpr()->py3eval()
|
||||
@ -8287,6 +8473,8 @@ pyeval({expr}) *pyeval()*
|
||||
Lists are represented as Vim |List| type.
|
||||
Dictionaries are represented as Vim |Dictionary| type,
|
||||
non-string keys result in error.
|
||||
Note that in a `:def` function local variables are not visible
|
||||
to {expr}.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetExpr()->pyeval()
|
||||
@ -8546,7 +8734,8 @@ reltime([{start} [, {end}]]) *reltime()*
|
||||
and {end}.
|
||||
|
||||
The {start} and {end} arguments must be values returned by
|
||||
reltime().
|
||||
reltime(). If there is an error zero is returned in legacy
|
||||
script, in Vim9 script an error is given.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetStart()->reltime()
|
||||
@ -8561,6 +8750,8 @@ reltimefloat({time}) *reltimefloat()*
|
||||
let seconds = reltimefloat(reltime(start))
|
||||
< See the note of reltimestr() about overhead.
|
||||
Also see |profiling|.
|
||||
If there is an error 0.0 is returned in legacy script, in Vim9
|
||||
script an error is given.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
reltime(start)->reltimefloat()
|
||||
@ -8580,6 +8771,8 @@ reltimestr({time}) *reltimestr()*
|
||||
can use split() to remove it. >
|
||||
echo split(reltimestr(reltime(start)))[0]
|
||||
< Also see |profiling|.
|
||||
If there is an error an empty string is returned in legacy
|
||||
script, in Vim9 script an error is given.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
reltime(start)->reltimestr()
|
||||
@ -8813,6 +9006,8 @@ rubyeval({expr}) *rubyeval()*
|
||||
Hashes are represented as Vim |Dictionary| type.
|
||||
Other objects are represented as strings resulted from their
|
||||
"Object#to_s" method.
|
||||
Note that in a `:def` function local variables are not visible
|
||||
to {expr}.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetRubyExpr()->rubyeval()
|
||||
@ -8880,6 +9075,10 @@ screenpos({winid}, {lnum}, {col}) *screenpos()*
|
||||
The "curscol" value is where the cursor would be placed. For
|
||||
a Tab it would be the same as "endcol", while for a double
|
||||
width character it would be the same as "col".
|
||||
The |conceal| feature is ignored here, the column numbers are
|
||||
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.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetWinid()->screenpos(lnum, col)
|
||||
@ -9434,6 +9633,7 @@ setcursorcharpos({list})
|
||||
Can also be used as a |method|: >
|
||||
GetCursorPos()->setcursorcharpos()
|
||||
|
||||
|
||||
setenv({name}, {val}) *setenv()*
|
||||
Set environment variable {name} to {val}.
|
||||
When {val} is |v:null| the environment variable is deleted.
|
||||
@ -9844,6 +10044,10 @@ 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}
|
||||
in single quotes and will double up all internal single
|
||||
quotes.
|
||||
On MS-Windows, when 'shellslash' is not set, it will enclose
|
||||
{string} in double quotes and double all double quotes within
|
||||
{string}.
|
||||
@ -9944,7 +10148,7 @@ sinh({expr}) *sinh()*
|
||||
{only available when compiled with the |+float| feature}
|
||||
|
||||
|
||||
slice({expr}, {start} [, {end}]) *slice()*
|
||||
slice({expr}, {start} [, {end}]) *slice()*
|
||||
Similar to using a |slice| "expr[start : end]", but "end" is
|
||||
used exclusive. And for a string the indexes are used as
|
||||
character indexes instead of byte indexes, like in
|
||||
@ -10680,7 +10884,7 @@ synID({lnum}, {col}, {trans}) *synID()*
|
||||
line. 'synmaxcol' applies, in a longer line zero is returned.
|
||||
Note that when the position is after the last character,
|
||||
that's where the cursor can be in Insert mode, synID() returns
|
||||
zero.
|
||||
zero. {lnum} is used like with |getline()|.
|
||||
|
||||
When {trans} is |TRUE|, transparent items are reduced to the
|
||||
item that they reveal. This is useful when wanting to know
|
||||
@ -10748,7 +10952,7 @@ synconcealed({lnum}, {col}) *synconcealed()*
|
||||
The result is a |List| with currently three items:
|
||||
1. The first item in the list is 0 if the character at the
|
||||
position {lnum} and {col} is not part of a concealable
|
||||
region, 1 if it is.
|
||||
region, 1 if it is. {lnum} is used like with |getline()|.
|
||||
2. The second item in the list is a string. If the first item
|
||||
is 1, the second item contains the text which will be
|
||||
displayed in place of the concealed text, depending on the
|
||||
@ -10772,8 +10976,9 @@ synconcealed({lnum}, {col}) *synconcealed()*
|
||||
|
||||
synstack({lnum}, {col}) *synstack()*
|
||||
Return a |List|, which is the stack of syntax items at the
|
||||
position {lnum} and {col} in the current window. Each item in
|
||||
the List is an ID like what |synID()| returns.
|
||||
position {lnum} and {col} in the current window. {lnum} is
|
||||
used like with |getline()|. Each item in the List is an ID
|
||||
like what |synID()| returns.
|
||||
The first item in the List is the outer region, following are
|
||||
items contained in that one. The last one is what |synID()|
|
||||
returns, unless not the whole item is highlighted or it is a
|
||||
@ -11006,7 +11211,8 @@ tempname() *tempname()* *temp-file-name*
|
||||
: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 '-'.
|
||||
option is set, or when 'shellcmdflag' starts with '-' and
|
||||
'shell' does not contain powershell or pwsh.
|
||||
|
||||
|
||||
term_ functions are documented here: |terminal-function-details|
|
||||
@ -11455,10 +11661,12 @@ win_gettype([{nr}]) *win_gettype()*
|
||||
Return the type of the window:
|
||||
"autocmd" autocommand window. Temporary window
|
||||
used to execute autocommands.
|
||||
"popup" popup window |popup|
|
||||
"preview" preview window |preview-window|
|
||||
"command" command-line window |cmdwin|
|
||||
(empty) normal window
|
||||
"loclist" |location-list-window|
|
||||
"popup" popup window |popup|
|
||||
"preview" preview window |preview-window|
|
||||
"quickfix" |quickfix-window|
|
||||
"unknown" window {nr} not found
|
||||
|
||||
When {nr} is omitted return the type of the current window.
|
||||
@ -11499,7 +11707,7 @@ win_screenpos({nr}) *win_screenpos()*
|
||||
[1, 1], unless there is a tabline, then it is [2, 1].
|
||||
{nr} can be the window number or the |window-ID|. Use zero
|
||||
for the current window.
|
||||
Return [0, 0] if the window cannot be found in the current
|
||||
Returns [0, 0] if the window cannot be found in the current
|
||||
tabpage.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
@ -11846,6 +12054,7 @@ diff Compiled with |vimdiff| and 'diff' support.
|
||||
digraphs Compiled with support for digraphs.
|
||||
directx Compiled with support for DirectX and 'renderoptions'.
|
||||
dnd Compiled with support for the "~ register |quote_~|.
|
||||
drop_file Compiled with |drop_file| support.
|
||||
ebcdic Compiled on a machine with ebcdic character set.
|
||||
emacs_tags Compiled with support for Emacs tags.
|
||||
eval Compiled with expression evaluation support. Always
|
||||
@ -11951,6 +12160,7 @@ scrollbind Compiled with 'scrollbind' support. (always true)
|
||||
showcmd Compiled with 'showcmd' support.
|
||||
signs Compiled with |:sign| support.
|
||||
smartindent Compiled with 'smartindent' support.
|
||||
sodium Compiled with libsodium for better crypt support
|
||||
sound Compiled with sound support, e.g. `sound_playevent()`
|
||||
spell Compiled with spell checking support |spell|.
|
||||
startuptime Compiled with |--startuptime| support.
|
||||
@ -14215,7 +14425,7 @@ displayed.
|
||||
|
||||
*except-several-errors*
|
||||
When several errors appear in a single command, the first error message is
|
||||
usually the most specific one and therefor converted to the error exception.
|
||||
usually the most specific one and therefore converted to the error exception.
|
||||
Example: >
|
||||
echo novar
|
||||
causes >
|
||||
|
@ -632,7 +632,7 @@ For fish, add to the config file
|
||||
MARKDOWN *ft-markdown-plugin*
|
||||
|
||||
To enable folding use this: >
|
||||
let g:markdown_folding = 1
|
||||
let g:markdown_folding = 1
|
||||
<
|
||||
|
||||
PDF *ft-pdf-plugin*
|
||||
|
@ -1,4 +1,4 @@
|
||||
*fold.txt* For Vim version 8.2. Last change: 2019 Jun 02
|
||||
*fold.txt* For Vim version 8.2. Last change: 2021 Jul 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -541,6 +541,8 @@ nest, the nested fold is one character right of the fold it's contained in.
|
||||
|
||||
A closed fold is indicated with a '+'.
|
||||
|
||||
These characters can be changed with the 'fillchars' option.
|
||||
|
||||
Where the fold column is too narrow to display all nested folds, digits are
|
||||
shown to indicate the nesting level.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*ps1.txt* A Windows PowerShell syntax plugin for Vim
|
||||
*ft_ps1.txt* A Windows PowerShell syntax plugin for Vim
|
||||
|
||||
Author: Peter Provost <https://www.github.com/PProvost>
|
||||
License: Apache 2.0
|
||||
|
@ -1,4 +1,4 @@
|
||||
*vim-raku.txt* The Raku programming language filetype
|
||||
*ft_raku.txt* The Raku programming language filetype
|
||||
|
||||
*vim-raku*
|
||||
|
||||
@ -45,7 +45,7 @@ Numbers, subscripts and superscripts are available with 's' and 'S':
|
||||
1s ₁ 1S ¹ ~
|
||||
2s ₂ 9S ⁹ ~
|
||||
|
||||
But some don´t come defined by default. Those are digraph definitions you can
|
||||
But some don't come defined by default. Those are digraph definitions you can
|
||||
add in your ~/.vimrc file. >
|
||||
exec 'digraph \\ '.char2nr('∖')
|
||||
exec 'digraph \< '.char2nr('≼')
|
||||
|
@ -1,4 +1,4 @@
|
||||
*gui.txt* For Vim version 8.2. Last change: 2021 May 01
|
||||
*gui.txt* For Vim version 8.2. Last change: 2021 Jun 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -411,7 +411,8 @@ Mouse mapping with modifiers does not work for modeless selection.
|
||||
3.7 Drag and drop *drag-n-drop*
|
||||
|
||||
You can drag and drop one or more files into the Vim window, where they will
|
||||
be opened as if a |:drop| command was used.
|
||||
be opened as if a |:drop| command was used. You can check if this is
|
||||
supported with the *drop_file* feature: `has('drop_file')`.
|
||||
|
||||
If you hold down Shift while doing this, Vim changes to the first dropped
|
||||
file's directory. If you hold Ctrl Vim will always split a new window for the
|
||||
|
@ -132,7 +132,7 @@ Advanced editing ~
|
||||
|windows.txt| commands for using multiple windows and buffers
|
||||
|tabpage.txt| commands for using multiple tab pages
|
||||
|spell.txt| spell checking
|
||||
|diff.txt| working with two to four versions of the same file
|
||||
|diff.txt| working with two to eight versions of the same file
|
||||
|autocmd.txt| automatically executing commands on an event
|
||||
|eval.txt| expression evaluation, conditional commands
|
||||
|channel.txt| Jobs, Channels, inter-process communication
|
||||
@ -145,6 +145,7 @@ Special issues ~
|
||||
|term.txt| using different terminals and mice
|
||||
|terminal.txt| Terminal window support
|
||||
|popup.txt| popup window support
|
||||
|vim9.txt| using Vim9 script
|
||||
|
||||
Programming language support ~
|
||||
|indent.txt| automatic indenting for C and other languages
|
||||
@ -153,6 +154,8 @@ Programming language support ~
|
||||
|filetype.txt| settings done specifically for a type of file
|
||||
|quickfix.txt| commands for a quick edit-compile-fix cycle
|
||||
|ft_ada.txt| Ada (the programming language) support
|
||||
|ft_ps1.txt| Filetype plugin for Windows PowerShell
|
||||
|ft_raku.txt| Filetype plugin for Raku
|
||||
|ft_rust.txt| Filetype plugin for Rust
|
||||
|ft_sql.txt| about the SQL filetype plugin
|
||||
|
||||
|
@ -211,6 +211,38 @@ Vim evaluation and command execution, and others.
|
||||
vim.lua_version The Lua version Vim was compiled with, in the
|
||||
form {major}.{minor}.{patch}, e.g. "5.1.4".
|
||||
|
||||
*lua-vim-variables*
|
||||
The Vim editor global dictionaries |g:| |w:| |b:| |t:| |v:| can be accessed
|
||||
from Lua conveniently and idiomatically by referencing the `vim.*` Lua tables
|
||||
described below. In this way you can easily read and modify global Vimscript
|
||||
variables from Lua.
|
||||
|
||||
Example: >
|
||||
|
||||
vim.g.foo = 5 -- Set the g:foo Vimscript variable.
|
||||
print(vim.g.foo) -- Get and print the g:foo Vimscript variable.
|
||||
vim.g.foo = nil -- Delete (:unlet) the Vimscript variable.
|
||||
|
||||
vim.g *vim.g*
|
||||
Global (|g:|) editor variables.
|
||||
Key with no value returns `nil`.
|
||||
|
||||
vim.b *vim.b*
|
||||
Buffer-scoped (|b:|) variables for the current buffer.
|
||||
Invalid or unset key returns `nil`.
|
||||
|
||||
vim.w *vim.w*
|
||||
Window-scoped (|w:|) variables for the current window.
|
||||
Invalid or unset key returns `nil`.
|
||||
|
||||
vim.t *vim.t*
|
||||
Tabpage-scoped (|t:|) variables for the current tabpage.
|
||||
Invalid or unset key returns `nil`.
|
||||
|
||||
vim.v *vim.v*
|
||||
|v:| variables.
|
||||
Invalid or unset key returns `nil`.
|
||||
|
||||
==============================================================================
|
||||
3. List userdata *lua-list*
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 8.2. Last change: 2021 May 27
|
||||
*index.txt* For Vim version 8.2. Last change: 2021 Jun 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -878,6 +878,7 @@ tag char note action in Normal mode ~
|
||||
|zv| zv open enough folds to view the cursor line
|
||||
|zw| zw permanently mark word as incorrectly spelled
|
||||
|zx| zx re-apply 'foldlevel' and do "zv"
|
||||
|zy| zy yank without trailing spaces
|
||||
|zz| zz redraw, cursor line at center of window
|
||||
|z<Left>| z<Left> same as "zh"
|
||||
|z<Right>| z<Right> same as "zl"
|
||||
@ -1311,6 +1312,7 @@ tag command action ~
|
||||
|:endtry| :endt[ry] end previous :try
|
||||
|:endwhile| :endw[hile] end previous :while
|
||||
|:enew| :ene[w] edit a new, unnamed buffer
|
||||
|:eval| :ev[al] evaluate an expression and discard the result
|
||||
|:ex| :ex same as ":edit"
|
||||
|:execute| :exe[cute] execute result of expressions
|
||||
|:exit| :exi[t] same as ":xit"
|
||||
|
@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 8.2. Last change: 2020 Oct 16
|
||||
*insert.txt* For Vim version 8.2. Last change: 2021 Jul 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -1073,7 +1073,8 @@ On the second invocation the arguments are:
|
||||
|
||||
The function must return a List with the matching words. These matches
|
||||
usually include the "a:base" text. When there are no matches return an empty
|
||||
List.
|
||||
List. Note that the cursor may have moved since the first invocation, the
|
||||
text may have been changed.
|
||||
|
||||
In order to return more information than the matching words, return a Dict
|
||||
that contains the List. The Dict can have these items:
|
||||
|
@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 8.2. Last change: 2021 May 16
|
||||
*map.txt* For Vim version 8.2. Last change: 2021 Aug 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -1571,6 +1571,20 @@ feature. Use the full name for new scripts.
|
||||
|
||||
|
||||
Replacement text ~
|
||||
*:command-repl*
|
||||
The {repl} argument is normally one long string, possibly with "|" separated
|
||||
commands. A special case is when the argument is "{", then the following
|
||||
lines, up to a line starting with "}" are used and |Vim9| syntax applies.
|
||||
Example: >
|
||||
:command MyCommand {
|
||||
echo 'hello'
|
||||
g:calledMyCommand = true
|
||||
}
|
||||
< *E1231*
|
||||
There must be white space before the "{". No nesting is supported, inline
|
||||
functions cannot be used. Commands where a "|" may appear in the argument,
|
||||
such as commands with an expression argument, cannot be followed by a "|" and
|
||||
another command.
|
||||
|
||||
The replacement text {repl} for a user defined command is scanned for special
|
||||
escape sequences, using <...> notation. Escape sequences are replaced with
|
||||
|
@ -1,4 +1,4 @@
|
||||
*motion.txt* For Vim version 8.2. Last change: 2021 Mar 28
|
||||
*motion.txt* For Vim version 8.2. Last change: 2021 Jun 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -59,9 +59,14 @@ or change text. The following operators are available:
|
||||
|<| < shift left
|
||||
|zf| zf define a fold
|
||||
|g@| g@ call function set with the 'operatorfunc' option
|
||||
|
||||
*motion-count-multiplied*
|
||||
If the motion includes a count and the operator also had a count before it,
|
||||
the two counts are multiplied. For example: "2d3w" deletes six words.
|
||||
*operator-doubled*
|
||||
When doubling the operator it operates on a line. When using a count, before
|
||||
or after the first character, that many lines are operated upon. Thus `3dd`
|
||||
deletes three lines. A count before and after the first character is
|
||||
multiplied, thus `2y3y` yanks six lines.
|
||||
|
||||
After applying the operator the cursor is mostly left at the start of the text
|
||||
that was operated upon. For example, "yfe" doesn't move the cursor, but "yFe"
|
||||
@ -195,9 +200,9 @@ l or *l*
|
||||
*$* *<End>* *<kEnd>*
|
||||
$ or <End> To the end of the line. When a count is given also go
|
||||
[count - 1] lines downward, or as far is possible.
|
||||
|inclusive| motion. If a count of 2 of larger is
|
||||
|inclusive| motion. If a count of 2 or larger is
|
||||
given and the cursor is on the last line, that is an
|
||||
error an the cursor doesn't move.
|
||||
error and the cursor doesn't move.
|
||||
In Visual mode the cursor goes to just after the last
|
||||
character in the line.
|
||||
When 'virtualedit' is active, "$" may move the cursor
|
||||
|
@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.2. Last change: 2021 May 16
|
||||
*options.txt* For Vim version 8.2. Last change: 2021 Jul 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -1326,7 +1326,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
continuation (positive).
|
||||
sbr Display the 'showbreak' value before applying the
|
||||
additional indent.
|
||||
The default value for min is 20 and shift is 0.
|
||||
list:{n} Adds an additional indent for lines that match a
|
||||
numbered or bulleted list (using the
|
||||
'formatlistpat' setting).
|
||||
list:-1 Uses the length of a match with 'formatlistpat'
|
||||
for indentation.
|
||||
The default value for min is 20, shift and list is 0.
|
||||
|
||||
*'browsedir'* *'bsdir'*
|
||||
'browsedir' 'bsdir' string (default: "last")
|
||||
@ -2384,6 +2389,23 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
you write the file the encrypted bytes will be
|
||||
different. The whole undo file is encrypted, not just
|
||||
the pieces of text.
|
||||
*E1193* *E1194* *E1195* *E1196*
|
||||
*E1197* *E1198* *E1199* *E1200* *E1201*
|
||||
xchacha20 XChaCha20 Cipher with Poly1305 Message Authentication
|
||||
Code. Medium strong till strong encryption.
|
||||
Encryption is provided by the libsodium library, it
|
||||
requires Vim to be built with |+sodium|
|
||||
It adds a seed and a message authentication code (MAC)
|
||||
to the file. This needs at least a Vim 8.2.3022 to
|
||||
read the encrypted file.
|
||||
Encryption of swap files is not supported, therefore
|
||||
no swap file will be used when xchacha20 encryption is
|
||||
enabled.
|
||||
Encryption of undo files is not yet supported,
|
||||
therefore no undo file will currently be written.
|
||||
CURRENTLY EXPERIMENTAL: Files written with this method
|
||||
might have to be read back with the same version of
|
||||
Vim if the binary format changes later.
|
||||
|
||||
You should use "blowfish2", also to re-encrypt older files.
|
||||
|
||||
@ -5595,19 +5617,21 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
- abbreviations are disabled
|
||||
- 'autoindent' is reset
|
||||
- 'expandtab' is reset
|
||||
- 'formatoptions' is used like it is empty
|
||||
- 'hkmap' is reset
|
||||
- 'revins' is reset
|
||||
- 'ruler' is reset
|
||||
- 'showmatch' is reset
|
||||
- 'smartindent' is reset
|
||||
- 'smarttab' is reset
|
||||
- 'softtabstop' is set to 0
|
||||
- 'textwidth' is set to 0
|
||||
- 'wrapmargin' is set to 0
|
||||
- 'varsofttabstop' is made empty
|
||||
These options keep their value, but their effect is disabled:
|
||||
- 'cindent'
|
||||
- 'formatoptions' is used like it is empty
|
||||
- 'indentexpr'
|
||||
- 'lisp'
|
||||
- 'smartindent'
|
||||
NOTE: When you start editing another file while the 'paste' option is
|
||||
on, settings from the modelines or autocommands may change the
|
||||
settings again, causing trouble when pasting text. You might want to
|
||||
@ -6575,23 +6599,25 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
*'shellcmdflag'* *'shcf'*
|
||||
'shellcmdflag' 'shcf' string (default: "-c";
|
||||
Win32, when 'shell' does not contain "sh"
|
||||
Win32, when 'shell' contains "powershell":
|
||||
"-Command", or when it does not contain "sh"
|
||||
somewhere: "/c")
|
||||
global
|
||||
Flag passed to the shell to execute "!" and ":!" commands; e.g.,
|
||||
"bash.exe -c ls" or "cmd.exe /c dir". For MS-Windows, the default is
|
||||
set according to the value of 'shell', to reduce the need to set this
|
||||
option by the user.
|
||||
"bash.exe -c ls", "powershell.exe -Command dir", or "cmd.exe /c dir".
|
||||
For MS-Windows, the default is set according to the value of 'shell',
|
||||
to reduce the need to set this option by the user.
|
||||
On Unix it can have more than one flag. Each white space separated
|
||||
part is passed as an argument to the shell command.
|
||||
See |option-backslash| about including spaces and backslashes.
|
||||
Also see |dos-shell| for MS-Windows.
|
||||
Also see |dos-shell| and |dos-powershell| for MS-Windows.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'shellpipe'* *'sp'*
|
||||
'shellpipe' 'sp' string (default ">", ">%s 2>&1", "| tee", "|& tee" or
|
||||
"2>&1| tee")
|
||||
'shellpipe' 'sp' string (default ">", ">%s 2>&1", "| tee", "|& tee"
|
||||
"2>&1| tee", or
|
||||
"2>&1 | Out-File -Encoding default")
|
||||
global
|
||||
{not available when compiled without the |+quickfix|
|
||||
feature}
|
||||
@ -6601,9 +6627,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The name of the temporary file can be represented by "%s" if necessary
|
||||
(the file name is appended automatically if no %s appears in the value
|
||||
of this option).
|
||||
For the Amiga the default is ">". For MS-Windows the default is
|
||||
">%s 2>&1". The output is directly saved in a file and not echoed to
|
||||
the screen.
|
||||
For the Amiga the default is ">". For MS-Windows using powershell the
|
||||
default is "2>&1 | Out-File -Encoding default", otherwise the default
|
||||
is ">%s 2>&1". The output is directly saved in a file and not echoed
|
||||
to the screen.
|
||||
For Unix the default is "| tee". The stdout of the compiler is saved
|
||||
in a file and echoed to the screen. If the 'shell' option is "csh" or
|
||||
"tcsh" after initializations, the default becomes "|& tee". If the
|
||||
@ -6611,6 +6638,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
"bash", "fish", "ash" or "dash" the default becomes "2>&1| tee". This
|
||||
means that stderr is also included. Before using the 'shell' option a
|
||||
path is removed, thus "/bin/sh" uses "sh".
|
||||
For Unix and MS-Windows, when the 'shell' option is "pwsh" the default
|
||||
becomes ">%s 2>&1" and the output is not echoed to the screen.
|
||||
The initialization of this option is done after reading the ".vimrc"
|
||||
and the other initializations, so that when the 'shell' option is set
|
||||
there, the 'shellpipe' option changes automatically, unless it was
|
||||
@ -6626,8 +6655,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
security reasons.
|
||||
|
||||
*'shellquote'* *'shq'*
|
||||
'shellquote' 'shq' string (default: ""; Win32, when 'shell'
|
||||
contains "sh" somewhere: "\"")
|
||||
'shellquote' 'shq' string (default: "")
|
||||
global
|
||||
Quoting character(s), put around the command passed to the shell, for
|
||||
the "!" and ":!" commands. The redirection is kept outside of the
|
||||
@ -6635,14 +6663,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
probably not useful to set both options.
|
||||
This is an empty string by default. Only known to be useful for
|
||||
third-party shells on MS-Windows-like systems, such as the MKS Korn
|
||||
Shell or bash, where it should be "\"". The default is adjusted
|
||||
according the value of 'shell', to reduce the need to set this option
|
||||
by the user. See |dos-shell|.
|
||||
Shell or bash, where it should be "\"". See |dos-shell|.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'shellredir'* *'srr'*
|
||||
'shellredir' 'srr' string (default ">", ">&" or ">%s 2>&1")
|
||||
'shellredir' 'srr' string (default ">", ">&", ">%s 2>&1", or
|
||||
"2>&1 | Out-File -Encoding default")
|
||||
global
|
||||
String to be used to put the output of a filter command in a temporary
|
||||
file. See also |:!|. See |option-backslash| about including spaces
|
||||
@ -6653,10 +6680,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The default is ">". For Unix, if the 'shell' option is "csh" or
|
||||
"tcsh" during initializations, the default becomes ">&". If the
|
||||
'shell' option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta",
|
||||
"bash" or "fish", the default becomes ">%s 2>&1". This means that
|
||||
stderr is also included. For Win32, the Unix checks are done and
|
||||
additionally "cmd" is checked for, which makes the default ">%s 2>&1".
|
||||
Also, the same names with ".exe" appended are checked for.
|
||||
"bash", "fish", or "pwsh", the default becomes ">%s 2>&1". This means
|
||||
that stderr is also included. For Win32, the Unix checks are done and
|
||||
additionally "cmd" is checked for, which makes the default ">%s 2>&1",
|
||||
and "powershell" is checked for which makes the default
|
||||
"2>&1 | Out-File -Encoding default" (see |dos-powershell|). Also, the
|
||||
same names with ".exe" appended are checked for.
|
||||
The initialization of this option is done after reading the ".vimrc"
|
||||
and the other initializations, so that when the 'shell' option is set
|
||||
there, the 'shellredir' option changes automatically unless it was
|
||||
@ -6671,9 +6700,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
{only for MS-Windows}
|
||||
When set, a forward slash is used when expanding file names. This is
|
||||
useful when a Unix-like shell is used instead of cmd.exe. Backward
|
||||
slashes can still be typed, but they are changed to forward slashes by
|
||||
Vim.
|
||||
useful when a Unix-like shell is used instead of cmd.exe, pwsh.exe, or
|
||||
powershell.exe. Backward slashes can still be typed, but they are
|
||||
changed to forward slashes by Vim.
|
||||
Note that setting or resetting this option has no effect for some
|
||||
existing file names, thus this option needs to be set before opening
|
||||
any file for best results. This might change in the future.
|
||||
@ -6727,6 +6756,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'shellxquote'* *'sxq'*
|
||||
'shellxquote' 'sxq' string (default: "";
|
||||
for Win32, when 'shell' is cmd.exe: "("
|
||||
for Win32, when 'shell' is
|
||||
powershell.exe: "\""
|
||||
for Win32, when 'shell' contains "sh"
|
||||
somewhere: "\""
|
||||
for Unix, when using system(): "\"")
|
||||
@ -6739,11 +6770,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
then ')"' is appended.
|
||||
When the value is '(' then also see 'shellxescape'.
|
||||
This is an empty string by default on most systems, but is known to be
|
||||
useful for on Win32 version, either for cmd.exe which automatically
|
||||
strips off the first and last quote on a command, or 3rd-party shells
|
||||
such as the MKS Korn Shell or bash, where it should be "\"". The
|
||||
default is adjusted according the value of 'shell', to reduce the need
|
||||
to set this option by the user. See |dos-shell|.
|
||||
useful for on Win32 version, either for cmd.exe, powershell.exe, or
|
||||
pwsh.exe which automatically strips off the first and last quote on a
|
||||
command, or 3rd-party shells such as the MKS Korn Shell or bash, where
|
||||
it should be "\"". The default is adjusted according the value of
|
||||
'shell', to reduce the need to set this option by the user. See
|
||||
|dos-shell|.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
@ -8611,12 +8643,16 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
*'virtualedit'* *'ve'*
|
||||
'virtualedit' 've' string (default "")
|
||||
global
|
||||
global or local to window |global-local|
|
||||
A comma separated list of these words:
|
||||
block Allow virtual editing in Visual block mode.
|
||||
insert Allow virtual editing in Insert mode.
|
||||
all Allow virtual editing in all modes.
|
||||
onemore Allow the cursor to move just past the end of the line
|
||||
none When used as the local value, do not allow virtual
|
||||
editing even when the global value is set. When used
|
||||
as the global value, "none" is the same as "".
|
||||
NONE Alternative spelling of "none".
|
||||
|
||||
Virtual editing means that the cursor can be positioned where there is
|
||||
no actual character. This can be halfway into a tab or beyond the end
|
||||
@ -8633,6 +8669,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The `g$` command will move to the end of the screen line.
|
||||
It doesn't make sense to combine "all" with "onemore", but you will
|
||||
not get a warning for it.
|
||||
When combined with other words, "none" is ignored.
|
||||
NOTE: This option is set to "" when 'compatible' is set.
|
||||
|
||||
*'visualbell'* *'vb'* *'novisualbell'* *'novb'* *beep*
|
||||
|
@ -17,6 +17,7 @@ versions of Vim. Also see |os_win32.txt| and |os_msdos.txt|.
|
||||
7. Interrupting |dos-CTRL-Break|
|
||||
8. Temp files |dos-temp-files|
|
||||
9. Shell option default |dos-shell|
|
||||
10. PowerShell |dos-powershell|
|
||||
|
||||
==============================================================================
|
||||
1. File locations *dos-locations*
|
||||
@ -297,8 +298,86 @@ For Win32 as:
|
||||
<shell> -c "command name >file"
|
||||
For DOS 32 bit, DJGPP does this internally somehow.
|
||||
|
||||
When starting up, Vim checks for the presence of "sh" anywhere in the 'shell'
|
||||
option. If it is present, Vim sets the 'shellcmdflag' and 'shellquote' or
|
||||
'shellxquote' options will be set as described above.
|
||||
When starting up, if Vim does not recognise a standard Windows shell it checks
|
||||
for the presence of "sh" anywhere in the 'shell' option. If it is present,
|
||||
Vim sets the 'shellcmdflag' and 'shellquote' or 'shellxquote' options will be
|
||||
set as described above.
|
||||
|
||||
==============================================================================
|
||||
10. PowerShell *dos-powershell* *dos-pwsh*
|
||||
|
||||
Vim supports PowerShell Desktop and PowerShell Core. PowerShell Desktop is
|
||||
the version of PowerShell that is installed with Windows, while PowerShell
|
||||
Core is a separate downloadable version that works cross-platform. To see
|
||||
which version you are using then enter the following in a PowerShell prompt -
|
||||
$PSVersionTable.PSEdition
|
||||
|
||||
If 'shell' includes "powershell" in the filename at startup then VIM sets
|
||||
'shellcmdflag', 'shellxquote', 'shellpipe', and 'shellredir' options to the
|
||||
following values:
|
||||
|
||||
'shellcmdflag' -Command
|
||||
'shellxquote' "
|
||||
'shellpipe' 2>&1 | Out-File -Encoding default
|
||||
'shellredir' 2>&1 | Out-File -Encoding default
|
||||
|
||||
If 'shell' includes "pwsh" in the filename at startup then VIM sets
|
||||
'shellcmdflag', 'shellxquote', 'shellpipe', and 'shellredir' options to the
|
||||
following values:
|
||||
|
||||
'shellcmdflag' -c
|
||||
'shellxquote' "
|
||||
'shellpipe' >%s 2>&1
|
||||
'shellredir' >%s 2>&1
|
||||
|
||||
If you find that PowerShell commands are taking a long time to run then try
|
||||
with "-NoProfile" at the beginning of the 'shellcmdflag'. Note this will
|
||||
prevent any PowerShell environment setup by the profile from taking place.
|
||||
|
||||
If you have problems running PowerShell scripts through the 'shell' then try
|
||||
with "-ExecutionPolicy RemoteSigned -Command" at the beginning of
|
||||
'shellcmdflag'. See online Windows documentation for more information on
|
||||
PowerShell Execution Policy settings.
|
||||
|
||||
See |option-backslash| about including spaces in 'shellcmdflag' when using
|
||||
multiple flags.
|
||||
|
||||
The 'shellpipe' and 'shellredir' option values re-encode the UTF-16le output
|
||||
from PowerShell Desktop to your currently configured console codepage. The
|
||||
output can be forced into a different encoding by changing "default" to one of
|
||||
the following:
|
||||
|
||||
unicode - UTF-16le (default output from PowerShell 5.1)
|
||||
bigendianunicode - UTF-16
|
||||
utf8 - UTF-8
|
||||
utf7 - UTF-7 (no BOM)
|
||||
utf32 - UTF-32
|
||||
ascii - 7-bit ASCII character set
|
||||
default - System's active code page (typically ANSI)
|
||||
oem - System's current OEM code page
|
||||
|
||||
Note The abovce multi-byte Unicode encodings include a leading BOM unless
|
||||
otherwise indicated.
|
||||
|
||||
By default PowerShell Core's output is UTF-8 encoded without a BOM. If you
|
||||
want to force the output of PowerShell Core into a different encoding then set
|
||||
'shellredir' and 'shellpipe' to "2>&1 | Out-File -Encoding encoding" where
|
||||
encoding is one of the following:
|
||||
|
||||
ascii - 7-bit ASCII character set
|
||||
bigendianunicode - UTF-16be
|
||||
bigendianutf32 - UTF-32be
|
||||
oem - System's current OEM code page
|
||||
unicode - UTF-16le
|
||||
utf7 - UTF-7
|
||||
utf8 - UTF-8
|
||||
utf8BOM - UTF-8, with BOM
|
||||
utf8NoBOM - UTF-8, no BOM (default output from PowerShell Core)
|
||||
utf32 - UTF-32
|
||||
|
||||
Since PowerShell Core 6.2, the Encoding parameter also supports specifying a
|
||||
numeric ID of a registered code page (-Encoding 1251) or string names of
|
||||
registered code pages (-Encoding "windows-1251"). The .NET documentation for
|
||||
Encoding.CodePage has more information
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
@ -767,12 +767,12 @@ GNU_TOOLS.ZIP package downloadable from http://www.polarhome.com/vim/
|
||||
|
||||
Version 8.2
|
||||
- make all changes needed for clean compile build of v8.2 on VMS on all platforms
|
||||
- fix the call mkdir bug (vicente_polo@yahoo.es)
|
||||
- fix the call mkdir bug (vicente_polo@yahoo.es)
|
||||
- test on VSI OpenVMS Alpha and Itanium platforms
|
||||
- added LUA support
|
||||
- added XPM support - Motif GUI with toolbar on all platforms
|
||||
- XPM v3.4.11 libraries for IA64, AXP and VAX are added
|
||||
- start integrating the new test scripts
|
||||
- XPM v3.4.11 libraries for IA64, AXP and VAX are added
|
||||
- start integrating the new test scripts
|
||||
|
||||
Version 8.1
|
||||
- make necessary changes to build v8.1 on VMS
|
||||
|
@ -18,7 +18,8 @@ The 32 bit version also runs on 64 bit MS-Windows systems.
|
||||
4. Using the mouse |win32-mouse|
|
||||
5. Running under Windows 95 |win32-win95|
|
||||
6. Running under Windows 3.1 |win32-win3.1|
|
||||
7. Win32 mini FAQ |win32-faq|
|
||||
7. Installation package |win32-installer|
|
||||
8. Win32 mini FAQ |win32-faq|
|
||||
|
||||
Additionally, there are a number of common Win32 and DOS items:
|
||||
File locations |dos-locations|
|
||||
@ -30,6 +31,7 @@ File formats |dos-file-formats|
|
||||
Interrupting |dos-CTRL-Break|
|
||||
Temp files |dos-temp-files|
|
||||
Shell option default |dos-shell|
|
||||
PowerShell defaults |dos-powershell|
|
||||
|
||||
Win32 GUI |gui-w32|
|
||||
|
||||
@ -174,7 +176,29 @@ There was a special version of gvim that runs under Windows 3.1 and 3.11.
|
||||
Support was removed in patch 7.4.1364.
|
||||
|
||||
==============================================================================
|
||||
7. Win32 mini FAQ *win32-faq*
|
||||
7. Installation package *win32-installer*
|
||||
|
||||
A simple installer for windows is available at http://www.vim.org/download.php
|
||||
(stable version) and nightly builds are also available at
|
||||
https://github.com/vim/vim-win32-installer/releases/
|
||||
|
||||
The nightly builds include 32bit and 64bit builds, have most features enabled
|
||||
and usually also contain an extra cryptographic signed installer, so Windows
|
||||
will not complain.
|
||||
|
||||
To use the installer, simply run the exe file. The following switches are
|
||||
also supported: >
|
||||
|
||||
gvim_<version>.exe /S -> silent install without any dialogues
|
||||
gvim_<version>.exe /D=C:\vim -> Install into directory c:\vim
|
||||
-> /D must be the last argument
|
||||
gvim_<version>.exe /S /D=c:\vim -> silent install into c:\vim
|
||||
<
|
||||
The default installation directory can alternatively be given by setting the
|
||||
$VIM environment variable.
|
||||
|
||||
==============================================================================
|
||||
8. Win32 mini FAQ *win32-faq*
|
||||
|
||||
Q. How do I change the font?
|
||||
A. In the GUI version, you can use the 'guifont' option. Example: >
|
||||
|
@ -1,4 +1,4 @@
|
||||
*pattern.txt* For Vim version 8.2. Last change: 2021 May 02
|
||||
*pattern.txt* For Vim version 8.2. Last change: 2021 Jul 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -929,13 +929,20 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|
||||
\%23l Matches in a specific line.
|
||||
\%<23l Matches above a specific line (lower line number).
|
||||
\%>23l Matches below a specific line (higher line number).
|
||||
\%.l Matches at the cursor line.
|
||||
\%<.l Matches above the cursor line.
|
||||
\%>.l Matches below the cursor line.
|
||||
These three can be used to match specific lines in a buffer. The "23"
|
||||
can be any line number. The first line is 1.
|
||||
WARNING: When inserting or deleting lines Vim does not automatically
|
||||
update the matches. This means Syntax highlighting quickly becomes
|
||||
wrong.
|
||||
wrong. Also when referring to the cursor position (".") and
|
||||
the cursor moves the display isn't updated for this change. An update
|
||||
is done when using the |CTRL-L| command (the whole screen is updated).
|
||||
Example, to highlight the line where the cursor currently is: >
|
||||
:exe '/\%' . line(".") . 'l.*'
|
||||
:exe '/\%' . line(".") . 'l'
|
||||
< Alternatively use: >
|
||||
/\%.l
|
||||
< When 'hlsearch' is set and you move the cursor around and make changes
|
||||
this will clearly show when the match is updated or not.
|
||||
|
||||
@ -943,15 +950,23 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|
||||
\%23c Matches in a specific column.
|
||||
\%<23c Matches before a specific column.
|
||||
\%>23c Matches after a specific column.
|
||||
\%.c Matches at the cursor column.
|
||||
\%<.c Matches before the cursor column.
|
||||
\%>.c Matches after the cursor column.
|
||||
These three can be used to match specific columns in a buffer or
|
||||
string. The "23" can be any column number. The first column is 1.
|
||||
Actually, the column is the byte number (thus it's not exactly right
|
||||
for multibyte characters).
|
||||
WARNING: When inserting or deleting text Vim does not automatically
|
||||
update the matches. This means Syntax highlighting quickly becomes
|
||||
wrong.
|
||||
wrong. Also when referring to the cursor position (".") and
|
||||
the cursor moves the display isn't updated for this change. An update
|
||||
is done when using the |CTRL-L| command (the whole screen is updated).
|
||||
|
||||
Example, to highlight the column where the cursor currently is: >
|
||||
:exe '/\%' . col(".") . 'c'
|
||||
< Alternatively use: >
|
||||
/\%.c
|
||||
< When 'hlsearch' is set and you move the cursor around and make changes
|
||||
this will clearly show when the match is updated or not.
|
||||
Example for matching a single byte in column 44: >
|
||||
@ -962,6 +977,9 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|
||||
\%23v Matches in a specific virtual column.
|
||||
\%<23v Matches before a specific virtual column.
|
||||
\%>23v Matches after a specific virtual column.
|
||||
\%.v Matches at the current virtual column.
|
||||
\%<.v Matches before the current virtual column.
|
||||
\%>.v Matches after the current virtual column.
|
||||
These three can be used to match specific virtual columns in a buffer
|
||||
or string. When not matching with a buffer in a window, the option
|
||||
values of the current window are used (e.g., 'tabstop').
|
||||
@ -971,13 +989,18 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|
||||
one screen character.
|
||||
WARNING: When inserting or deleting text Vim does not automatically
|
||||
update highlighted matches. This means Syntax highlighting quickly
|
||||
becomes wrong.
|
||||
becomes wrong. Also when referring to the cursor position (".") and
|
||||
the cursor moves the display isn't updated for this change. An update
|
||||
is done when using the |CTRL-L| command (the whole screen is updated).
|
||||
Example, to highlight all the characters after virtual column 72: >
|
||||
/\%>72v.*
|
||||
< When 'hlsearch' is set and you move the cursor around and make changes
|
||||
this will clearly show when the match is updated or not.
|
||||
To match the text up to column 17: >
|
||||
/^.*\%17v
|
||||
< To match all characters after the current virtual column (where the
|
||||
cursor is): >
|
||||
/\%>.v.*
|
||||
< Column 17 is not included, because this is a |/zero-width| match. To
|
||||
include the column use: >
|
||||
/^.*\%17v.
|
||||
@ -1217,7 +1240,7 @@ x A single character, with no special meaning, matches itself
|
||||
|
||||
\%d123 Matches the character specified with a decimal number. Must be
|
||||
followed by a non-digit.
|
||||
\%o40 Matches the character specified with an octal number up to 0377.
|
||||
\%o40 Matches the character specified with an octal number up to 0o377.
|
||||
Numbers below 0o40 must be followed by a non-octal digit or a
|
||||
non-digit.
|
||||
\%x2a Matches the character specified with up to two hexadecimal characters.
|
||||
@ -1449,7 +1472,8 @@ criteria:
|
||||
- The number of characters (distance) between two consecutive matching
|
||||
characters.
|
||||
- Matches at the beginning of a word
|
||||
- Matches after a camel case character or a path separator or a hyphen.
|
||||
- Matches at a camel case character (e.g. Case in CamelCase)
|
||||
- Matches after a path separator or a hyphen.
|
||||
- The number of unmatched characters in a string.
|
||||
The matching string with the highest score is returned first.
|
||||
|
||||
|
@ -3809,7 +3809,7 @@ netrw:
|
||||
Decho.vim is provided as a "vimball"; see |vimball-intro|. You
|
||||
should edit the Decho.vba.gz file and source it in: >
|
||||
|
||||
vim Decho.vba.gz
|
||||
vim Decho.vba.gz
|
||||
:so %
|
||||
:q
|
||||
<
|
||||
|
@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 8.2. Last change: 2021 May 08
|
||||
*repeat.txt* For Vim version 8.2. Last change: 2021 Jun 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -279,7 +279,9 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
ftdetect scripts are loaded, only the matching
|
||||
directories are added to 'runtimepath'. This is
|
||||
useful in your .vimrc. The plugins will then be
|
||||
loaded during initialization, see |load-plugins|.
|
||||
loaded during initialization, see |load-plugins| (note
|
||||
that the loading order will be reversed, because each
|
||||
directory is inserted before others).
|
||||
Note that for ftdetect scripts to be loaded
|
||||
you will need to write `filetype plugin indent on`
|
||||
AFTER all `packadd!` commands.
|
||||
@ -372,7 +374,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
for some commands.
|
||||
See |:vim9cmd| for executing one command with Vim9
|
||||
syntax and semantics.
|
||||
|
||||
|
||||
*:scr* *:scriptnames*
|
||||
:scr[iptnames] List all sourced script names, in the order they were
|
||||
first sourced. The number is used for the script ID
|
||||
@ -842,6 +844,16 @@ About the additional commands in debug mode:
|
||||
is reset (because it's not clear what you want to repeat).
|
||||
- When you want to use the Ex command with the same name, prepend a colon:
|
||||
":cont", ":next", ":finish" (or shorter).
|
||||
*vim9-debug*
|
||||
When debugging a compiled :def function, "step" will stop before every
|
||||
executed line, not every single instruction. Thus it works mostly like a not
|
||||
compiled function. Access to local variables is limited you can use: >
|
||||
echo varname
|
||||
But not much else.
|
||||
When executing a command that is not a specific bytecode instruction but
|
||||
executed like a normal Ex command, "step" will stop once in the compiled
|
||||
context, where local variables can be inspected, and once just before
|
||||
executing the command.
|
||||
|
||||
The backtrace shows the hierarchy of function calls, e.g.:
|
||||
>bt ~
|
||||
|
@ -1,4 +1,4 @@
|
||||
*rileft.txt* For Vim version 8.2. Last change: 2019 May 05
|
||||
*rileft.txt* For Vim version 8.2. Last change: 2021 Jun 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Avner Lottem
|
||||
@ -75,7 +75,7 @@ o Invocations
|
||||
|
||||
o Typing backwards *ins-reverse*
|
||||
----------------
|
||||
In lieu of using full-fledged the 'rightleft' option, one can opt for
|
||||
In lieu of using the full-fledged 'rightleft' option, one can opt for
|
||||
reverse insertion. When the 'revins' (reverse insert) option is set,
|
||||
inserting happens backwards. This can be used to type right-to-left
|
||||
text. When inserting characters the cursor is not moved and the text
|
||||
|
@ -1,4 +1,4 @@
|
||||
*sponsor.txt* For Vim version 8.2. Last change: 2008 Jun 21
|
||||
*sponsor.txt* For Vim version 8.2. Last change: 2021 Jul 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -11,9 +11,8 @@ Fixing bugs and adding new features takes a lot of time and effort. To show
|
||||
your appreciation for the work and motivate Bram and others to continue
|
||||
working on Vim please send a donation.
|
||||
|
||||
Since Bram is back to a paid job the money will now be used to help children
|
||||
in Uganda. See |uganda|. But at the same time donations increase Bram's
|
||||
motivation to keep working on Vim!
|
||||
Since Bram does not need the money it will be used to help children in Uganda,
|
||||
see |uganda|. Donations increase Bram's motivation to keep working on Vim!
|
||||
|
||||
For the most recent information about sponsoring look on the Vim web site:
|
||||
|
||||
@ -74,19 +73,6 @@ Other methods See |iccf-donations|.
|
||||
amount you transferred if you want to vote for features and
|
||||
show others you are a registered Vim user or sponsor.
|
||||
|
||||
Cash Small amounts can be sent with ordinary mail. Put something
|
||||
around the money, so that it's not noticeable from the
|
||||
outside. Mention your e-mail address if you want to vote for
|
||||
features and show others you are a registered Vim user or
|
||||
sponsor.
|
||||
|
||||
You can use this permanent address:
|
||||
Bram Moolenaar
|
||||
Finsterruetihof 1
|
||||
8134 Adliswil
|
||||
Switzerland
|
||||
|
||||
|
||||
|
||||
QUESTIONS AND ANSWERS *sponsor-faq* *register-faq*
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 8.2. Last change: 2021 May 30
|
||||
*syntax.txt* For Vim version 8.2. Last change: 2021 Jul 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -923,7 +923,7 @@ For Visual Basic use: >
|
||||
|
||||
BAAN *baan.vim* *baan-syntax*
|
||||
|
||||
The baan.vim gives syntax support for BaanC of release BaanIV upto SSA ERP LN
|
||||
The baan.vim gives syntax support for BaanC of release BaanIV up to SSA ERP LN
|
||||
for both 3 GL and 4 GL programming. Large number of standard defines/constants
|
||||
are supported.
|
||||
|
||||
@ -1420,11 +1420,17 @@ To select syntax highlighting file for Euphoria, as well as for
|
||||
auto-detecting the *.e and *.E file extensions as Euphoria file type,
|
||||
add the following line to your startup file: >
|
||||
|
||||
:let filetype_euphoria="euphoria3"
|
||||
:let g:filetype_euphoria = "euphoria3"
|
||||
|
||||
or
|
||||
< or >
|
||||
|
||||
:let filetype_euphoria="euphoria4"
|
||||
:let g:filetype_euphoria = "euphoria4"
|
||||
|
||||
Elixir and Euphoria share the *.ex file extension. If the filetype is
|
||||
specifically set as Euphoria with the g:filetype_euphoria variable, or the
|
||||
file is determined to be Euphoria based on keywords in the file, then the
|
||||
filetype will be set as Euphoria. Otherwise, the filetype will default to
|
||||
Elixir.
|
||||
|
||||
|
||||
ERLANG *erlang.vim* *ft-erlang-syntax*
|
||||
@ -1442,6 +1448,22 @@ To enable highlighting some special atoms, put this in your vimrc: >
|
||||
:let g:erlang_highlight_special_atoms = 1
|
||||
|
||||
|
||||
ELIXIR *elixir.vim* *ft-elixir-syntax*
|
||||
|
||||
Elixir is a dynamic, functional language for building scalable and maintainable
|
||||
applications.
|
||||
|
||||
The following file extensions are auto-detected as Elixir file types:
|
||||
|
||||
*.ex, *.exs, *.eex, *.leex, *.lock
|
||||
|
||||
Elixir and Euphoria share the *.ex file extension. If the filetype is
|
||||
specifically set as Euphoria with the g:filetype_euphoria variable, or the
|
||||
file is determined to be Euphoria based on keywords in the file, then the
|
||||
filetype will be set as Euphoria. Otherwise, the filetype will default to
|
||||
Elixir.
|
||||
|
||||
|
||||
FLEXWIKI *flexwiki.vim* *ft-flexwiki-syntax*
|
||||
|
||||
FlexWiki is an ASP.NET-based wiki package available at http://www.flexwiki.com
|
||||
@ -3430,8 +3452,8 @@ syntax highlighting script handles this with the following logic:
|
||||
Tex: Match Check Control~
|
||||
|
||||
Sometimes one actually wants mismatched parentheses, square braces,
|
||||
and or curly braces; for example, \text{(1,10] is a range from but
|
||||
not including 1 to and including 10}. This wish, of course, conflicts
|
||||
and or curly braces; for example, \text{(1,10]} is a range from but
|
||||
not including 1 to and including 10. This wish, of course, conflicts
|
||||
with the desire to provide delimiter mismatch detection. To
|
||||
accommodate these conflicting goals, syntax/tex.vim provides >
|
||||
g:tex_matchcheck = '[({[]'
|
||||
@ -4084,7 +4106,7 @@ match in the same position overrules an earlier one). The "transparent"
|
||||
argument makes the "myVim" match use the same highlighting as "myString". But
|
||||
it does not contain anything. If the "contains=NONE" argument would be left
|
||||
out, then "myVim" would use the contains argument from myString and allow
|
||||
"myWord" to be contained, which will be highlighted as a Constant. This
|
||||
"myWord" to be contained, which will be highlighted as a Comment. This
|
||||
happens because a contained match doesn't match inside itself in the same
|
||||
position, thus the "myVim" match doesn't overrule the "myWord" match here.
|
||||
|
||||
@ -4970,8 +4992,8 @@ ctermul={color-nr} *highlight-ctermul*
|
||||
*tmux*
|
||||
When using tmux you may want to use this in the tmux config: >
|
||||
# tmux colors
|
||||
set -g default-terminal "xterm-256color"
|
||||
set -ag terminal-overrides ",xterm-256color:Tc"
|
||||
set -s default-terminal "tmux-256color"
|
||||
set -as terminal-overrides ",*-256color:Tc"
|
||||
< More info at:
|
||||
https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-a-256-colour-terminal
|
||||
https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-rgb-colour
|
||||
|
@ -1384,6 +1384,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
+scrollbind various.txt /*+scrollbind*
|
||||
+signs various.txt /*+signs*
|
||||
+smartindent various.txt /*+smartindent*
|
||||
+sodium various.txt /*+sodium*
|
||||
+sound various.txt /*+sound*
|
||||
+spell various.txt /*+spell*
|
||||
+startuptime various.txt /*+startuptime*
|
||||
@ -1959,7 +1960,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:& change.txt /*:&*
|
||||
:&& change.txt /*:&&*
|
||||
:' cmdline.txt /*:'*
|
||||
:++ vim9.txt /*:++*
|
||||
:, cmdline.txt /*:,*
|
||||
:-- vim9.txt /*:--*
|
||||
:. cmdline.txt /*:.*
|
||||
:/ cmdline.txt /*:\/*
|
||||
:0file editing.txt /*:0file*
|
||||
@ -3964,9 +3967,20 @@ E118 eval.txt /*E118*
|
||||
E1187 starting.txt /*E1187*
|
||||
E1188 cmdline.txt /*E1188*
|
||||
E119 eval.txt /*E119*
|
||||
E1193 options.txt /*E1193*
|
||||
E1194 options.txt /*E1194*
|
||||
E1195 options.txt /*E1195*
|
||||
E1196 options.txt /*E1196*
|
||||
E1197 options.txt /*E1197*
|
||||
E1198 options.txt /*E1198*
|
||||
E1199 options.txt /*E1199*
|
||||
E12 message.txt /*E12*
|
||||
E120 eval.txt /*E120*
|
||||
E1200 options.txt /*E1200*
|
||||
E1201 options.txt /*E1201*
|
||||
E1205 eval.txt /*E1205*
|
||||
E121 eval.txt /*E121*
|
||||
E1214 eval.txt /*E1214*
|
||||
E122 eval.txt /*E122*
|
||||
E123 eval.txt /*E123*
|
||||
E124 eval.txt /*E124*
|
||||
@ -6149,6 +6163,10 @@ digraph-encoding digraph.txt /*digraph-encoding*
|
||||
digraph-table digraph.txt /*digraph-table*
|
||||
digraph-table-mbyte digraph.txt /*digraph-table-mbyte*
|
||||
digraph.txt digraph.txt /*digraph.txt*
|
||||
digraph_get() eval.txt /*digraph_get()*
|
||||
digraph_getlist() eval.txt /*digraph_getlist()*
|
||||
digraph_set() eval.txt /*digraph_set()*
|
||||
digraph_setlist() eval.txt /*digraph_setlist()*
|
||||
digraphs digraph.txt /*digraphs*
|
||||
digraphs-changed version6.txt /*digraphs-changed*
|
||||
digraphs-default digraph.txt /*digraphs-default*
|
||||
@ -6178,6 +6196,8 @@ dos-backslash os_dos.txt /*dos-backslash*
|
||||
dos-colors os_dos.txt /*dos-colors*
|
||||
dos-file-formats os_dos.txt /*dos-file-formats*
|
||||
dos-locations os_dos.txt /*dos-locations*
|
||||
dos-powershell os_dos.txt /*dos-powershell*
|
||||
dos-pwsh os_dos.txt /*dos-pwsh*
|
||||
dos-shell os_dos.txt /*dos-shell*
|
||||
dos-standard-mappings os_dos.txt /*dos-standard-mappings*
|
||||
dos-temp-files os_dos.txt /*dos-temp-files*
|
||||
@ -6190,6 +6210,7 @@ dp diff.txt /*dp*
|
||||
drag-n-drop gui.txt /*drag-n-drop*
|
||||
drag-n-drop-win32 gui_w32.txt /*drag-n-drop-win32*
|
||||
drag-status-line term.txt /*drag-status-line*
|
||||
drop_file gui.txt /*drop_file*
|
||||
dtd.vim syntax.txt /*dtd.vim*
|
||||
dtd2vim insert.txt /*dtd2vim*
|
||||
dying-variable eval.txt /*dying-variable*
|
||||
@ -6210,6 +6231,7 @@ efm-%> quickfix.txt /*efm-%>*
|
||||
efm-entries quickfix.txt /*efm-entries*
|
||||
efm-ignore quickfix.txt /*efm-ignore*
|
||||
eiffel.vim syntax.txt /*eiffel.vim*
|
||||
elixir.vim syntax.txt /*elixir.vim*
|
||||
emacs-keys tips.txt /*emacs-keys*
|
||||
emacs-tags tagsrch.txt /*emacs-tags*
|
||||
emacs_tags tagsrch.txt /*emacs_tags*
|
||||
@ -6559,6 +6581,7 @@ ft-docbkxml-syntax syntax.txt /*ft-docbkxml-syntax*
|
||||
ft-dosbatch-syntax syntax.txt /*ft-dosbatch-syntax*
|
||||
ft-dtd-syntax syntax.txt /*ft-dtd-syntax*
|
||||
ft-eiffel-syntax syntax.txt /*ft-eiffel-syntax*
|
||||
ft-elixir-syntax syntax.txt /*ft-elixir-syntax*
|
||||
ft-erlang-syntax syntax.txt /*ft-erlang-syntax*
|
||||
ft-euphoria-syntax syntax.txt /*ft-euphoria-syntax*
|
||||
ft-flexwiki-syntax syntax.txt /*ft-flexwiki-syntax*
|
||||
@ -6674,6 +6697,8 @@ ft-yaml-syntax syntax.txt /*ft-yaml-syntax*
|
||||
ft-zimbu-plugin filetype.txt /*ft-zimbu-plugin*
|
||||
ft-zsh-syntax syntax.txt /*ft-zsh-syntax*
|
||||
ft_ada.txt ft_ada.txt /*ft_ada.txt*
|
||||
ft_ps1.txt ft_ps1.txt /*ft_ps1.txt*
|
||||
ft_raku.txt ft_raku.txt /*ft_raku.txt*
|
||||
ft_rust.txt ft_rust.txt /*ft_rust.txt*
|
||||
ft_sql.txt ft_sql.txt /*ft_sql.txt*
|
||||
ftdetect filetype.txt /*ftdetect*
|
||||
@ -7000,6 +7025,7 @@ getchar() eval.txt /*getchar()*
|
||||
getcharmod() eval.txt /*getcharmod()*
|
||||
getcharpos() eval.txt /*getcharpos()*
|
||||
getcharsearch() eval.txt /*getcharsearch()*
|
||||
getcharstr() eval.txt /*getcharstr()*
|
||||
getcmdline() eval.txt /*getcmdline()*
|
||||
getcmdpos() eval.txt /*getcmdpos()*
|
||||
getcmdtype() eval.txt /*getcmdtype()*
|
||||
@ -7901,6 +7927,7 @@ moo.vim syntax.txt /*moo.vim*
|
||||
more-compatible version5.txt /*more-compatible*
|
||||
more-prompt message.txt /*more-prompt*
|
||||
more-variables eval.txt /*more-variables*
|
||||
motion-count-multiplied motion.txt /*motion-count-multiplied*
|
||||
motion.txt motion.txt /*motion.txt*
|
||||
mouse-mode-table term.txt /*mouse-mode-table*
|
||||
mouse-overview term.txt /*mouse-overview*
|
||||
@ -8348,6 +8375,7 @@ omni-sql-completion ft_sql.txt /*omni-sql-completion*
|
||||
online-help helphelp.txt /*online-help*
|
||||
opening-window windows.txt /*opening-window*
|
||||
operator motion.txt /*operator*
|
||||
operator-doubled motion.txt /*operator-doubled*
|
||||
operator-pending-index index.txt /*operator-pending-index*
|
||||
operator-variable eval.txt /*operator-variable*
|
||||
option-backslash options.txt /*option-backslash*
|
||||
@ -8401,6 +8429,7 @@ page_up intro.txt /*page_up*
|
||||
pager message.txt /*pager*
|
||||
papp.vim syntax.txt /*papp.vim*
|
||||
paragraph motion.txt /*paragraph*
|
||||
partial eval.txt /*partial*
|
||||
pascal.vim syntax.txt /*pascal.vim*
|
||||
patches-8 version8.txt /*patches-8*
|
||||
patches-8.1 version8.txt /*patches-8.1*
|
||||
@ -8598,7 +8627,6 @@ ps1-compiler ft_ps1.txt /*ps1-compiler*
|
||||
ps1-folding ft_ps1.txt /*ps1-folding*
|
||||
ps1-keyword ft_ps1.txt /*ps1-keyword*
|
||||
ps1-syntax ft_ps1.txt /*ps1-syntax*
|
||||
ps1.txt ft_ps1.txt /*ps1.txt*
|
||||
psql ft_sql.txt /*psql*
|
||||
ptcap.vim syntax.txt /*ptcap.vim*
|
||||
pterm-mouse options.txt /*pterm-mouse*
|
||||
@ -9673,6 +9701,8 @@ test_feedinput() testing.txt /*test_feedinput()*
|
||||
test_garbagecollect_now() testing.txt /*test_garbagecollect_now()*
|
||||
test_garbagecollect_soon() testing.txt /*test_garbagecollect_soon()*
|
||||
test_getvalue() testing.txt /*test_getvalue()*
|
||||
test_gui_drop_files() testing.txt /*test_gui_drop_files()*
|
||||
test_gui_mouse_event() testing.txt /*test_gui_mouse_event()*
|
||||
test_ignore_error() testing.txt /*test_ignore_error()*
|
||||
test_null_blob() testing.txt /*test_null_blob()*
|
||||
test_null_channel() testing.txt /*test_null_channel()*
|
||||
@ -10066,6 +10096,7 @@ v_u change.txt /*v_u*
|
||||
v_v visual.txt /*v_v*
|
||||
v_x change.txt /*v_x*
|
||||
v_y change.txt /*v_y*
|
||||
v_zy change.txt /*v_zy*
|
||||
v_~ change.txt /*v_~*
|
||||
vab motion.txt /*vab*
|
||||
val-variable eval.txt /*val-variable*
|
||||
@ -10135,13 +10166,13 @@ vim-8.2 version8.txt /*vim-8.2*
|
||||
vim-additions vi_diff.txt /*vim-additions*
|
||||
vim-announce intro.txt /*vim-announce*
|
||||
vim-arguments starting.txt /*vim-arguments*
|
||||
vim-changelog version8.txt /*vim-changelog*
|
||||
vim-default-editor gui_w32.txt /*vim-default-editor*
|
||||
vim-dev intro.txt /*vim-dev*
|
||||
vim-mac intro.txt /*vim-mac*
|
||||
vim-modes intro.txt /*vim-modes*
|
||||
vim-modes-intro intro.txt /*vim-modes-intro*
|
||||
vim-raku ft_raku.txt /*vim-raku*
|
||||
vim-raku.txt ft_raku.txt /*vim-raku.txt*
|
||||
vim-script-intro usr_41.txt /*vim-script-intro*
|
||||
vim-use intro.txt /*vim-use*
|
||||
vim-variable eval.txt /*vim-variable*
|
||||
@ -10152,6 +10183,7 @@ vim9 vim9.txt /*vim9*
|
||||
vim9-classes vim9.txt /*vim9-classes*
|
||||
vim9-const vim9.txt /*vim9-const*
|
||||
vim9-curly vim9.txt /*vim9-curly*
|
||||
vim9-debug repeat.txt /*vim9-debug*
|
||||
vim9-declaration vim9.txt /*vim9-declaration*
|
||||
vim9-declarations usr_46.txt /*vim9-declarations*
|
||||
vim9-differences vim9.txt /*vim9-differences*
|
||||
@ -10280,6 +10312,7 @@ win32-faq os_win32.txt /*win32-faq*
|
||||
win32-gettext mlang.txt /*win32-gettext*
|
||||
win32-gui gui_w32.txt /*win32-gui*
|
||||
win32-hidden-menus gui.txt /*win32-hidden-menus*
|
||||
win32-installer os_win32.txt /*win32-installer*
|
||||
win32-mouse os_win32.txt /*win32-mouse*
|
||||
win32-open-with-menu gui_w32.txt /*win32-open-with-menu*
|
||||
win32-popup-menu gui_w32.txt /*win32-popup-menu*
|
||||
@ -10435,6 +10468,7 @@ zOS-PuTTY os_390.txt /*zOS-PuTTY*
|
||||
zOS-has-ebcdic os_390.txt /*zOS-has-ebcdic*
|
||||
zOS-limitations os_390.txt /*zOS-limitations*
|
||||
zOS-open-source os_390.txt /*zOS-open-source*
|
||||
zP change.txt /*zP*
|
||||
zR fold.txt /*zR*
|
||||
zW spell.txt /*zW*
|
||||
zX fold.txt /*zX*
|
||||
@ -10462,6 +10496,7 @@ zl scroll.txt /*zl*
|
||||
zm fold.txt /*zm*
|
||||
zn fold.txt /*zn*
|
||||
zo fold.txt /*zo*
|
||||
zp change.txt /*zp*
|
||||
zr fold.txt /*zr*
|
||||
zs scroll.txt /*zs*
|
||||
zsh.vim syntax.txt /*zsh.vim*
|
||||
@ -10473,6 +10508,7 @@ zuw spell.txt /*zuw*
|
||||
zv fold.txt /*zv*
|
||||
zw spell.txt /*zw*
|
||||
zx fold.txt /*zx*
|
||||
zy change.txt /*zy*
|
||||
zz scroll.txt /*zz*
|
||||
{ motion.txt /*{*
|
||||
{Visual} intro.txt /*{Visual}*
|
||||
|
@ -373,10 +373,10 @@ Added by Vim (there are no standard codes for these):
|
||||
t_Ri restore icon text from stack *t_Ri* *'t_Ri'*
|
||||
t_TE end of "raw" mode *t_TE* *'t_TE'*
|
||||
t_TI put terminal into "raw" mode *t_TI* *'t_TI'*
|
||||
t_fd disable focus-event tracking *t_fd* *'t_fd'*
|
||||
|xterm-focus-event|
|
||||
t_fe enable focus-event tracking *t_fe* *'t_fe'*
|
||||
|xterm-focus-event|
|
||||
t_fd disable focus-event tracking *t_fd* *'t_fd'*
|
||||
|xterm-focus-event|
|
||||
|
||||
Some codes have a start, middle and end part. The start and end are defined
|
||||
by the termcap option, the middle part is text.
|
||||
|
@ -1,4 +1,4 @@
|
||||
*testing.txt* For Vim version 8.2. Last change: 2021 Apr 02
|
||||
*testing.txt* For Vim version 8.2. Last change: 2021 Jul 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -78,6 +78,46 @@ test_getvalue({name}) *test_getvalue()*
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetName()->test_getvalue()
|
||||
<
|
||||
*test_gui_drop_files()*
|
||||
test_gui_drop_files({list}, {row}, {col}, {mods})
|
||||
Drop one or more files in {list} in the window at {row}, {col}.
|
||||
This function only works when the GUI is running and the
|
||||
|drag-n-drop| feature is present.
|
||||
|
||||
The supported values for {mods} are:
|
||||
0x4 Shift
|
||||
0x8 Alt
|
||||
0x10 Ctrl
|
||||
The files are added to the argument list and the first file in
|
||||
{list} is edited in the window. See |drag-n-drop| for more
|
||||
information.
|
||||
|
||||
*test_gui_mouse_event()*
|
||||
test_gui_mouse_event({button}, {row}, {col}, {multiclick}, {modifiers})
|
||||
Inject a mouse button click event. This function only works
|
||||
when the GUI is running.
|
||||
The supported values for {button} are:
|
||||
0 right mouse button
|
||||
1 middle mouse button
|
||||
2 left mouse button
|
||||
3 mouse button release
|
||||
4 scroll wheel down
|
||||
5 scroll wheel up
|
||||
6 scroll wheel left
|
||||
7 scroll wheel right
|
||||
{row} and {col} specify the location of the mouse click. The
|
||||
first row of the Vim window is 1 and the last row is 'lines'.
|
||||
The maximum value of {col} is 'columns'.
|
||||
To inject a multiclick event, set {multiclick} to 1.
|
||||
The supported values for {modifiers} are:
|
||||
4 shift is pressed
|
||||
8 alt is pressed
|
||||
16 ctrl is pressed
|
||||
After injecting the mouse event you probably should call
|
||||
|feedkeys()| to have them processed, e.g.: >
|
||||
call feedkeys("y", 'Lx!')
|
||||
|
||||
|
||||
test_ignore_error({expr}) *test_ignore_error()*
|
||||
Ignore any error containing {expr}. A normal message is given
|
||||
|
@ -211,6 +211,8 @@ prop_list({lnum} [, {props}]) *prop_list()*
|
||||
id property ID
|
||||
type name of the property type, omitted if
|
||||
the type was deleted
|
||||
type_bufnr buffer number for which this type was defined;
|
||||
0 if the type is global
|
||||
start when TRUE property starts in this line
|
||||
end when TRUE property ends in this line
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 May 28
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 Jul 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -38,57 +38,34 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Geen memory leak?
|
||||
|
||||
Crash using outer var from nested lambda:
|
||||
vim9script
|
||||
def F(text: string): func(string): func(string): string
|
||||
return (arg: string): func(string): string => ((sep: string): string => {
|
||||
return text .. ' ' .. arg
|
||||
})
|
||||
enddef
|
||||
|
||||
echo F('hello')(' ')('there')
|
||||
|
||||
|
||||
Try out callgrind with kcachegrind.
|
||||
|
||||
Vim9 - Make everything work:
|
||||
- function returning nothing should return void instead of zero
|
||||
- compile "expr" and "call" expression of a channel in channel_exe_cmd()?
|
||||
- Need some solution for dict function. Can we implement part of classes?
|
||||
- A lambda without {} does not require a return type, using { return x } does.
|
||||
That's unexpected, since the arguments are not required to have a type.
|
||||
alt 1: not require a return type, figure it out from the common type of all
|
||||
the return statements found
|
||||
alt 2: also require argument types
|
||||
- Using "windo echo expr" does not accept a line break inside "expr" (in a
|
||||
:def function and at script level in a not executed block). #7681
|
||||
- Check TODO items in vim9compile.c and vim9execute.c
|
||||
- use CheckLegacyAndVim9Success(lines) in many more places
|
||||
This doesn't work - Test_list_assign():
|
||||
var l = [0]
|
||||
l[:] = [1, 2]
|
||||
- For builtin functions using tv_get_string*() use check_for_string() to be
|
||||
more strict about the argument type (not a bool).
|
||||
done: balloon_()
|
||||
- Check many more builtin function arguments at compile time.
|
||||
map() could check that the return type of the function argument matches
|
||||
the type of the list or dict member. (#8092)
|
||||
- Allow for using an autoload function name without quotes. It is then loaded
|
||||
(and compiled) right away. #8124
|
||||
- Test more expressions in legacy and Vim9 script, using
|
||||
CheckLegacyAndVim9Success()
|
||||
Same for other functions, such as searchpair().
|
||||
- Test try/catch and throw better, also nested.
|
||||
Test that return inside try/finally jumps to finally and then returns.
|
||||
- Test that a function defined inside a :def function is local to that
|
||||
function, g: functions can be defined and script-local functions cannot be
|
||||
defined.
|
||||
- Make debugging work - at least per function. Need to recompile a function
|
||||
to step through it line-by-line? Evaluate the stack and variables on the
|
||||
stack?
|
||||
- Reserve command for future use: :type, :class, :enum
|
||||
- Unexpected error message when using "var x: any | x.key = 9", because "x" is
|
||||
given the type number. Can we use VAR_ANY?
|
||||
|
||||
Once Vim9 is stable:
|
||||
- Add the "vim9script" feature, can use has('vim9script')
|
||||
- Change the help to prefer Vim9 syntax where appropriate
|
||||
- Add all the error numbers in a good place in documentation.
|
||||
- In the generic eval docs, point out the Vim9 syntax where it differs.
|
||||
- Add the "vim9script" feature, can use has('vim9script')
|
||||
- Use Vim9 for runtime files.
|
||||
PR #7497 for autoload/ccomplete.vim
|
||||
|
||||
@ -100,13 +77,12 @@ Further Vim9 improvements, possibly after launch:
|
||||
Give an error if compilation fails. (#7625)
|
||||
Use the location where the option was set for deciding whether it's to be
|
||||
evaluated in Vim9 script context.
|
||||
- implement :type, import type declaration.
|
||||
- implement enum, import enum.
|
||||
- Future work: See |vim9-classes|
|
||||
- implement :type, "import type"
|
||||
- implement enum, "import enum".
|
||||
- implement class and interface: See |vim9-classes|
|
||||
- For range: make table of first ASCII character with flag to quickly check if
|
||||
it can be a Vim9 command. E.g. "+" can, but "." can't.
|
||||
- compile get_lambda_tv() in popup_add_timeout()
|
||||
- inline call to map() and filter()
|
||||
- Inline call to map() and filter(), better type checking.
|
||||
- Make accessing varargs faster: arg[expr]
|
||||
EVAL expr
|
||||
LOADVARARG (varargs idx)
|
||||
@ -241,10 +217,13 @@ Terminal emulator window:
|
||||
|
||||
Include patch #6290: recognize shell directory change.
|
||||
|
||||
MS-Windows GUI: default 'encoding' to "utf-8" ? (#8221)
|
||||
Add #ifdef MSWIN before enc_locale() in set_init_1().
|
||||
Or just always for MS-Windows? Conversion to 'termencoding' should always
|
||||
work?
|
||||
When using 'cryptmethod' xchaha20 the undo file is not encrypted.
|
||||
Need to handle extra bytes.
|
||||
|
||||
Test_communicate_ipv6(): is flaky on many systems
|
||||
Fails in line 64 of Ch_communicate, no exception is thrown.
|
||||
|
||||
Rename getdigraphlist -> digraph_getlist() etc.
|
||||
|
||||
Valgrind reports memory leaks in test_options.
|
||||
Valgrind reports overlapping memcpy in
|
||||
@ -269,10 +248,16 @@ Memory leaks in test_channel? (or is it because of fork())
|
||||
initialization to figure out the default value from 'shell'. Add a test for
|
||||
this.
|
||||
|
||||
MS-Windows: did path modifier :p:8 stop working? #8600
|
||||
|
||||
test_arglist func Test_all_not_allowed_from_cmdwin() hangs on MS-Windows.
|
||||
|
||||
Mapping with partial match not executed properly in GTK. (Ingo Karkat, #7082)
|
||||
|
||||
Problem that a previous silent ":throw" causes a following try/catch not to
|
||||
work. (ZyX, 2013 Sep 28) With examples: (Malcolm Rowe, 2015 Dec 24)
|
||||
Also see #8487 for an example.
|
||||
|
||||
Patch for Template string: #4634
|
||||
Have another look at the implementation.
|
||||
|
||||
@ -292,6 +277,9 @@ Remove SPACE_IN_FILENAME ? It is only used for completion.
|
||||
Searching for \%'> does not find anything when using line Visual selection.
|
||||
Probably because it's using MAXCOL. #8238
|
||||
|
||||
Make "g>" and "g<" in Visual mode move the text right or left.
|
||||
Also for a block selection. #8558
|
||||
|
||||
Add optional argument to virtcol() that specifies "start", "cursor" or "end"
|
||||
to tell which value from getvvcol() should be used. (#7964)
|
||||
Value returned by virtcol() changes depending on how lines wrap. This is
|
||||
@ -300,10 +288,15 @@ inconsistent with the documentation.
|
||||
Making breakat support multibyte characters (Yasuhiro Matsumoto, #6598)
|
||||
Scroll doesn't work correctly, why?
|
||||
|
||||
glob() and globfile() do not always honor 'wildignorecase'. #8350
|
||||
globpath() does not use 'wildignorecase' at all?
|
||||
|
||||
":find" incorrectly searches parent directory of path (#8533)
|
||||
|
||||
Add 'termguiattr' option, use "gui=" attributes in the terminal? Would work
|
||||
with 'termguicolors'. #1740
|
||||
|
||||
Patch for blockwise paste reporting changes: #6660.
|
||||
Patch for blockwise paste reporting changes: #6660. Asked for a PR.
|
||||
|
||||
Patch to make fillchars global-local. (#5206)
|
||||
|
||||
@ -312,6 +305,9 @@ Missing filetype test for bashrc, PKGBUILD, etc.
|
||||
Add an option to not fetch terminal codes in xterm, to avoid flicker when t_Co
|
||||
changes.
|
||||
|
||||
MS-Windows: instead of "edit with multiple Vims" use "Edit with Vim in
|
||||
multiple tabs". #8404
|
||||
|
||||
When using ":bwipe!" also get rid of references to be buffer, e.g. in the
|
||||
jumplist and alternate file.
|
||||
|
||||
@ -344,6 +340,12 @@ Should also work without any group:
|
||||
:echo matchstr('aaa bbb', '.\{-1,}\>\|.*')
|
||||
aaa bbb (should be aaa)
|
||||
|
||||
Should add a match/str/list/pos method that also returns the test and position
|
||||
of submatches. #8355
|
||||
|
||||
Syntax highlight for a region does not work with a "nextgroup" if the start
|
||||
match is empty. #8449
|
||||
|
||||
Check out PR #543 (Roland Puntaier).
|
||||
Patch for multibyte characters in langmap and applying a mapping on them.
|
||||
(Christian Brabandt, 2015 Jun 12, update July 25)
|
||||
@ -368,6 +370,7 @@ The buffer list and windows are locked, no changes possible
|
||||
|
||||
Add a ModeChanged autocommand that has an argument indicating the old and new
|
||||
mode, as what's returned from mode(). Also used for switching Terminal mode.
|
||||
#8360, #7863, #7363
|
||||
|
||||
Matchparen doesn't remove highlight after undo. (#7054)
|
||||
Is OK when syntax HL is active.
|
||||
@ -380,6 +383,10 @@ work.
|
||||
Using "au!" after "filetype on" is a bit slow. Can the matching of
|
||||
autocommands be made faster? (#7056)
|
||||
|
||||
Append in Visual block mode inserts the wrong character.
|
||||
Test_visual_block_mode() already has the proper check, which is commented out.
|
||||
(#8288)
|
||||
|
||||
Add the <=> (spaceship) operator and "cond ?< expr ?= expr ?> expr"
|
||||
replace this:
|
||||
let left = GetLeftFunc()
|
||||
@ -1428,9 +1435,6 @@ Appveyor build with self-installing executable, includes getting most
|
||||
interfaces: https://github.com/k-takata/vim/tree/chrisbra-appveyor-build
|
||||
result: https://ci.appveyor.com/project/k-takata/vim/history
|
||||
|
||||
Problem that a previous silent ":throw" causes a following try/catch not to
|
||||
work. (ZyX, 2013 Sep 28) With examples: (Malcolm Rowe, 2015 Dec 24)
|
||||
|
||||
Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
|
||||
|
||||
Patch to make tests pass with EBCDIC. (Owen Leibman, 2016 Apr 10)
|
||||
@ -2263,9 +2267,6 @@ Win32: Improved Makefile for MSVC. (Leonardo Valeri Manera, 2010 Aug 18)
|
||||
|
||||
Win32: Expanding 'path' runs into a maximum size limit. (bgold12, 2009 Nov 15)
|
||||
|
||||
Win32: Patch for enabling quick edit mode in console. (Craig Barkhouse, 2010
|
||||
Sep 1)
|
||||
|
||||
Win32: Patch for using .png files for icons. (Charles Peacech, 2012 Feb 5)
|
||||
|
||||
Putting a Visual block while 'visualedit' is "all" does not leave the cursor
|
||||
@ -3081,7 +3082,7 @@ Awaiting updated patches:
|
||||
7 When 'rightleft' is set, the search pattern should be displayed right
|
||||
to left as well? See patch of Dec 26. (Nadim Shaikli)
|
||||
8 Option to lock all used memory so that it doesn't get swapped to disk
|
||||
(uncrypted). Patch by Jason Holt, 2003 May 23. Uses mlock.
|
||||
(unencrypted). Patch by Jason Holt, 2003 May 23. Uses mlock.
|
||||
7 Add ! register, for shell commands. (patch from Grenie)
|
||||
8 In the gzip plugin, also recognize *.gz.orig, *.gz.bak, etc. Like it's
|
||||
done for filetype detection. Patch from Walter Briscoe, 2003 Jul 1.
|
||||
|
@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2021 Apr 19
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2021 Jul 19
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@ -952,6 +952,7 @@ Interactive: *interactive-functions*
|
||||
browsedir() put up a directory requester
|
||||
confirm() let the user make a choice
|
||||
getchar() get a character from the user
|
||||
getcharstr() get a character from the user as a string
|
||||
getcharmod() get modifiers for the last typed character
|
||||
getmousepos() get last known mouse position
|
||||
echoraw() output characters as-is
|
||||
@ -993,6 +994,10 @@ Window size and position: *window-size-functions*
|
||||
winrestview() restore saved view of current window
|
||||
|
||||
Mappings and Menus: *mapping-functions*
|
||||
digraph_get() get |digraph|
|
||||
digraph_getlist() get all |digraph|s
|
||||
digraph_set() register |digraph|
|
||||
digraph_setlist() register multiple |digraph|s
|
||||
hasmapto() check if a mapping exists
|
||||
mapcheck() check if a matching mapping exists
|
||||
maparg() get rhs of a mapping
|
||||
@ -1020,6 +1025,8 @@ Testing: *test-functions*
|
||||
test_garbagecollect_now() free memory right now
|
||||
test_garbagecollect_soon() set a flag to free memory soon
|
||||
test_getvalue() get value of an internal variable
|
||||
test_gui_drop_files() drop file(s) in a window
|
||||
test_gui_mouse_event() add a GUI mouse event to the input buffer
|
||||
test_ignore_error() ignore a specific error message
|
||||
test_null_blob() return a null Blob
|
||||
test_null_channel() return a null Channel
|
||||
|
@ -444,6 +444,7 @@ m *+ruby/dyn* Ruby interface |ruby-dynamic| |/dyn|
|
||||
T *+scrollbind* |'scrollbind'|
|
||||
B *+signs* |:sign|
|
||||
N *+smartindent* |'smartindent'|
|
||||
B *+sodium* compiled with libsodium for better encryption support
|
||||
B *+sound* |sound_playevent()|, |sound_playfile()| functions, etc.
|
||||
N *+spell* spell checking support, see |spell|
|
||||
N *+startuptime* |--startuptime| argument
|
||||
@ -724,7 +725,7 @@ K Run a program to lookup the keyword under the
|
||||
feature}
|
||||
|
||||
*:sl!* *:sleep!*
|
||||
:[N]sl[eep]! [N] [m] Same as above, but hide the cursor.
|
||||
:[N]sl[eep]! [N][m] Same as above, but hide the cursor.
|
||||
|
||||
*:xrestore* *:xr*
|
||||
:xr[estore] [display] Reinitializes the connection to the X11 server. Useful
|
||||
|
@ -2696,7 +2696,7 @@ Multi-byte:
|
||||
double-wide character.
|
||||
- Overstrike mode for the cmdline replaced only the first byte of a multibyte
|
||||
character.
|
||||
- The cursor in Replace mode (also in the cmdline) was to small on a
|
||||
- The cursor in Replace mode (also in the cmdline) was too small on a
|
||||
double-wide character.
|
||||
- When a multibyte character contained a 0x80 byte, it didn't work (was using
|
||||
a CSI byte instead). (Muraoka Taro)
|
||||
@ -3546,7 +3546,7 @@ Added Simplified Chinese translation of the tutor. (Mendel L Chan)
|
||||
Added Russian keymap for yawerty keyboard.
|
||||
|
||||
Added an explanation of using the vimrc file in the tutor.
|
||||
Changed tutor.vim to get the right encoding for the Taiwainese tutor.
|
||||
Changed tutor.vim to get the right encoding for the Taiwanese tutor.
|
||||
|
||||
Added Russian tutor. (Andrey Kiselev)
|
||||
Added Polish tutor. (Mikolaj Machowski)
|
||||
@ -5465,7 +5465,7 @@ Files: src/fileio.c
|
||||
Patch 6.0.267
|
||||
Problem: UTF-8: Although 'isprint' says a character is printable,
|
||||
utf_char2cells() still considers it unprintable.
|
||||
Solution: Use vim_isprintc() for characters upto 0x100. (Yasuhiro Matsumoto)
|
||||
Solution: Use vim_isprintc() for characters up to 0x100. (Yasuhiro Matsumoto)
|
||||
Files: src/mbyte.c
|
||||
|
||||
Patch 6.0.268 (extra) (depends on patch 6.0.255)
|
||||
|
@ -1,4 +1,4 @@
|
||||
*version7.txt* For Vim version 8.2. Last change: 2021 May 13
|
||||
*version7.txt* For Vim version 8.2. Last change: 2021 May 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -16225,7 +16225,7 @@ Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok,
|
||||
Patch 7.3.1018
|
||||
Problem: New regexp engine wastes memory.
|
||||
Solution: Allocate prog with actual number of states, not estimated maximum
|
||||
number of sates.
|
||||
number of states.
|
||||
Files: src/regexp_nfa.c
|
||||
|
||||
Patch 7.3.1019
|
||||
|
@ -1,4 +1,4 @@
|
||||
*version8.txt* For Vim version 8.2. Last change: 2021 May 13
|
||||
*version8.txt* For Vim version 8.2. Last change: 2021 Jul 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -41,6 +41,10 @@ See |vi_diff.txt| for an overview of differences between Vi and Vim 8.0.
|
||||
See |version4.txt|, |version5.txt|, |version6.txt| and |version7.txt| for
|
||||
differences between other versions.
|
||||
|
||||
*vim-changelog*
|
||||
You can find an overview of the most important changes (according to Martin
|
||||
Tournoij) on this site: https://www.arp242.net/vimlog/
|
||||
|
||||
==============================================================================
|
||||
NEW FEATURES *new-8*
|
||||
|
||||
@ -12980,7 +12984,7 @@ Files: src/evalfunc.c, src/testdir/test_cmdline.vim
|
||||
Patch 7.4.2113
|
||||
Problem: Test for undo is flaky.
|
||||
Solution: Turn it into a new style test. Use test_settime() to avoid
|
||||
flakyness.
|
||||
flakiness.
|
||||
Files: src/Makefile, src/undo.c, src/testdir/test61.in,
|
||||
src/testdir/test61.ok, src/testdir/test_undo.vim,
|
||||
src/testdir/test_undolevels.vim, src/testdir/Make_all.mak,
|
||||
@ -30906,7 +30910,7 @@ Files: src/eval.c, src/testdir/test_assert.vim
|
||||
Patch 8.1.0820
|
||||
Problem: Test for sending large data over channel sometimes fails.
|
||||
Solution: Handle that the job may have finished early. Also fix that file
|
||||
changed test doesn't work in the GUI and reduce flakyness. (Ozaki
|
||||
changed test doesn't work in the GUI and reduce flakiness. (Ozaki
|
||||
Kiichi, closes #3861)
|
||||
Files: src/testdir/test_channel.vim, src/testdir/test_filechanged.vim
|
||||
|
||||
@ -35504,7 +35508,7 @@ Files: Filelist, src/testdir/Make_all.mak, src/testdir/check.vim,
|
||||
src/testdir/test_xxd.vim
|
||||
|
||||
Patch 8.1.1545
|
||||
Problem: When the screen is to small there is no message about that.
|
||||
Problem: When the screen is too small there is no message about that.
|
||||
(Daniel Hahler)
|
||||
Solution: Do not use :cquit. (closes #4534)
|
||||
Files: src/testdir/runtest.vim
|
||||
@ -39253,7 +39257,7 @@ Files: src/option.c
|
||||
|
||||
Patch 8.1.2117
|
||||
Problem: CursorLine highlight used while 'cursorline' is off.
|
||||
Solution: Check 'cursorline' is set. (cloes #5017)
|
||||
Solution: Check 'cursorline' is set. (closes #5017)
|
||||
Files: src/drawline.c, src/testdir/test_cursorline.vim
|
||||
|
||||
Patch 8.1.2118
|
||||
@ -41104,7 +41108,7 @@ Files: src/buffer.c, src/testdir/test_popupwin.vim
|
||||
Patch 8.1.2419
|
||||
Problem: With a long file name the hit-enter prompt appears. (J. Lewis
|
||||
Muir)
|
||||
Solution: When checking for text to wrap don't do this when outputing a CR.
|
||||
Solution: When checking for text to wrap don't do this when outputting a CR.
|
||||
Files: src/message.c, src/testdir/test_display.vim,
|
||||
src/testdir/dumps/Test_long_file_name_1.dump
|
||||
|
||||
|
@ -186,7 +186,7 @@ behave mostly like Vi, even though a .vimrc file exists.
|
||||
.TP
|
||||
\-d
|
||||
Start in diff mode.
|
||||
There should be two, three or four file name arguments.
|
||||
There should between two to eight file name arguments.
|
||||
.B Vim
|
||||
will open all the files and show differences between them.
|
||||
Works like vimdiff(1).
|
||||
|
@ -135,9 +135,9 @@ OPTIONS
|
||||
Vim behave mostly like Vi, even though a .vimrc file ex‐
|
||||
ists.
|
||||
|
||||
-d Start in diff mode. There should be two, three or four
|
||||
file name arguments. Vim will open all the files and show
|
||||
differences between them. Works like vimdiff(1).
|
||||
-d Start in diff mode. There should between two to eight file
|
||||
name arguments. Vim will open all the files and show dif‐
|
||||
ferences between them. Works like vimdiff(1).
|
||||
|
||||
-d {device} Open {device} for use as a terminal. Only on the Amiga.
|
||||
Example: "-d con:20/30/600/150".
|
||||
|
@ -1,4 +1,4 @@
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2021 May 26
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2021 Jul 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -169,6 +169,14 @@ created yet. In this case you can call `execute()` to invoke it at runtime. >
|
||||
used for the command or inside a `:try` block), does not get a range passed
|
||||
cannot be a "dict" function, and can always be a closure.
|
||||
|
||||
Later classes will be added, which replaces the "dict function" mechanism.
|
||||
For now you will need to pass the dictionary explicitly: >
|
||||
def DictFunc(d: dict<any>, arg: string)
|
||||
echo d[arg]
|
||||
enddef
|
||||
var d = {item: 'value', func: DictFunc}
|
||||
d.func(d, 'item')
|
||||
|
||||
The argument types and return type need to be specified. The "any" type can
|
||||
be used, type checking will then be done at runtime, like with legacy
|
||||
functions.
|
||||
@ -313,6 +321,25 @@ used: >
|
||||
}
|
||||
echo temp # Error!
|
||||
|
||||
This is especially useful in a user command: >
|
||||
|
||||
command -range Rename {
|
||||
| var save = @a
|
||||
| @a = 'some expression'
|
||||
| echo 'do something with ' .. @a
|
||||
| @a = save
|
||||
|}
|
||||
|
||||
And with autocommands: >
|
||||
|
||||
au BufWritePre *.go {
|
||||
| var save = winsaveview()
|
||||
| silent! exe ':%! some formatting command'
|
||||
| winrestview(save)
|
||||
|}
|
||||
|
||||
Although using a :def function probably works better.
|
||||
|
||||
Declaring a variable with a type but without an initializer will initialize to
|
||||
zero, false or empty.
|
||||
|
||||
@ -324,6 +351,9 @@ with `:unlet`.
|
||||
`:lockvar` does not work on local variables. Use `:const` and `:final`
|
||||
instead.
|
||||
|
||||
The `exists()` function does not work on local variables or arguments. These
|
||||
are visible at compile time only, not at runtime.
|
||||
|
||||
Variables, functions and function arguments cannot shadow previously defined
|
||||
or imported variables and functions in the same script file.
|
||||
Variables may shadow Ex commands, rename the variable if needed.
|
||||
@ -418,6 +448,12 @@ line starts with `substitute(` this will use the function. Prepend a colon to
|
||||
use the command instead: >
|
||||
:substitute(pattern (replacement (
|
||||
|
||||
If the expression starts with "!" this is interpreted as a shell command, not
|
||||
negation of a condition. Thus this is a shell command: >
|
||||
!shellCommand->something
|
||||
Put the expression in parenthesis to use the "!" for negation: >
|
||||
(!expression)->Method()
|
||||
|
||||
Note that while variables need to be defined before they can be used,
|
||||
functions can be called before being defined. This is required to allow
|
||||
for cyclic dependencies between functions. It is slightly less efficient,
|
||||
@ -434,7 +470,8 @@ The function must already have been defined. >
|
||||
var Funcref = MyFunction
|
||||
|
||||
When using `function()` the resulting type is "func", a function with any
|
||||
number of arguments and any return type. The function can be defined later.
|
||||
number of arguments and any return type (including void). The function can be
|
||||
defined later.
|
||||
|
||||
|
||||
Lambda using => instead of -> ~
|
||||
@ -445,11 +482,12 @@ it is the start of a lambda or a dictionary, which is now more complicated
|
||||
because of the use of argument types.
|
||||
|
||||
To avoid these problems Vim9 script uses a different syntax for a lambda,
|
||||
which is similar to Javascript: >
|
||||
which is similar to JavaScript: >
|
||||
var Lambda = (arg) => expression
|
||||
|
||||
No line break is allowed in the arguments of a lambda up to and including the
|
||||
"=>". This is OK: >
|
||||
"=>" (so that Vim can tell the difference between an expression in parentheses
|
||||
and lambda arguments). This is OK: >
|
||||
filter(list, (k, v) =>
|
||||
v > 0)
|
||||
This does not work: >
|
||||
@ -522,7 +560,7 @@ And when a dict spans multiple lines: >
|
||||
one: 1,
|
||||
two: 2,
|
||||
}
|
||||
Function call: >
|
||||
With a function call: >
|
||||
var result = Func(
|
||||
arg1,
|
||||
arg2
|
||||
@ -555,10 +593,36 @@ at the start of the line indicates line continuation: >
|
||||
| echo 'match'
|
||||
| endif
|
||||
|
||||
< *E1050*
|
||||
Note that this means that in heredoc the first line cannot be a bar: >
|
||||
var lines =<< trim END
|
||||
| this doesn't work
|
||||
END
|
||||
Either use an empty line at the start or do not use heredoc. Or temporarily
|
||||
add the "C" flag to 'cpoptions': >
|
||||
set cpo+=C
|
||||
var lines =<< trim END
|
||||
| this doesn't work
|
||||
END
|
||||
set cpo-=C
|
||||
If the heredoc is inside a function 'cpoptions' must be set before :def and
|
||||
restored after the :enddef.
|
||||
|
||||
In places where line continuation with a backslash is still needed, such as
|
||||
splitting up a long Ex command, comments can start with '#\ ': >
|
||||
syn region Text
|
||||
\ start='foo'
|
||||
#\ comment
|
||||
\ end='bar'
|
||||
Like with legacy script '"\ ' is used. This is also needed when line
|
||||
continuation is used without a backslash and a line starts with a bar: >
|
||||
au CursorHold * echom 'BEFORE bar'
|
||||
#\ some comment
|
||||
| echom 'AFTER bar'
|
||||
<
|
||||
*E1050*
|
||||
To make it possible for the operator at the start of the line to be
|
||||
recognized, it is required to put a colon before a range. This will add
|
||||
"start" and print: >
|
||||
recognized, it is required to put a colon before a range. This example will
|
||||
add "start" and print: >
|
||||
var result = start
|
||||
+ print
|
||||
Like this: >
|
||||
@ -610,6 +674,9 @@ Notes:
|
||||
< This does not work: >
|
||||
echo [1, 2]
|
||||
[3, 4]
|
||||
- In some cases it is difficult for Vim to parse a command, especially when
|
||||
commands are used as an argument to another command, such as `windo`. In
|
||||
those cases the line continuation with a backslash has to be used.
|
||||
|
||||
|
||||
White space ~
|
||||
@ -648,6 +715,9 @@ White space is not allowed:
|
||||
arg # OK
|
||||
)
|
||||
|
||||
White space space is not allowed in a `:set` command between the option name
|
||||
and a following "&", "!", "<", "=", "+=", "-=" or "^=".
|
||||
|
||||
|
||||
No curly braces expansion ~
|
||||
|
||||
@ -904,6 +974,16 @@ The 'gdefault' option value is not used.
|
||||
You may also find this wiki useful. It was written by an early adopter of
|
||||
Vim9 script: https://github.com/lacygoill/wiki/blob/master/vim/vim9.md
|
||||
|
||||
*:++* *:--*
|
||||
The ++ and -- commands have been added. They are very similar to adding or
|
||||
subtracting one: >
|
||||
++var
|
||||
var += 1
|
||||
--var
|
||||
var -= 1
|
||||
|
||||
Using ++var or --var in an expression is not supported yet.
|
||||
|
||||
==============================================================================
|
||||
|
||||
3. New style functions *fast-functions*
|
||||
@ -966,9 +1046,14 @@ prefix if they do not exist at the time of compiling.
|
||||
Note that for command line completion of {func} you
|
||||
can prepend "s:" to find script-local functions.
|
||||
|
||||
:disa[ssemble]! {func} Like `:disassemble` but with the instructions used for
|
||||
:disa[ssemble] profile {func}
|
||||
Like `:disassemble` but with the instructions used for
|
||||
profiling.
|
||||
|
||||
:disa[ssemble] debug {func}
|
||||
Like `:disassemble` but with the instructions used for
|
||||
debugging.
|
||||
|
||||
Limitations ~
|
||||
|
||||
Local variables will not be visible to string evaluation. For example: >
|
||||
@ -991,26 +1076,36 @@ For these the backtick expansion can be used. Example: >
|
||||
g/pattern/s/^/`=newText`/
|
||||
enddef
|
||||
|
||||
Or a script variable can be used: >
|
||||
var newText = 'blah'
|
||||
def Replace()
|
||||
g/pattern/s/^/\=newText/
|
||||
enddef
|
||||
|
||||
Closures defined in a loop will share the same context. For example: >
|
||||
var flist: list<func>
|
||||
for i in range(10)
|
||||
for i in range(5)
|
||||
var inloop = i
|
||||
flist[i] = () => inloop
|
||||
endfor
|
||||
echo range(5)->map((i, _) => flist[i]())
|
||||
# Result: [4, 4, 4, 4, 4]
|
||||
|
||||
The "inloop" variable will exist only once, all closures put in the list refer
|
||||
to the same instance, which in the end will have the value 9. This is
|
||||
efficient. If you do want a separate context for each closure call a function
|
||||
to define it: >
|
||||
def GetFunc(i: number): func
|
||||
var inloop = i
|
||||
return () => inloop
|
||||
to the same instance, which in the end will have the value 4. This is
|
||||
efficient, also when looping many times. If you do want a separate context
|
||||
for each closure call a function to define it: >
|
||||
def GetClosure(i: number): func
|
||||
var infunc = i
|
||||
return () => infunc
|
||||
enddef
|
||||
|
||||
var flist: list<func>
|
||||
for i in range(10)
|
||||
flist[i] = GetFunc(i)
|
||||
for i in range(5)
|
||||
flist[i] = GetClosure(i)
|
||||
endfor
|
||||
echo range(5)->map((i, _) => flist[i]())
|
||||
# Result: [0, 1, 2, 3, 4]
|
||||
|
||||
==============================================================================
|
||||
|
||||
@ -1036,10 +1131,8 @@ The following builtin types are supported:
|
||||
Not supported yet:
|
||||
tuple<a: {type}, b: {type}, ...>
|
||||
|
||||
These types can be used in declarations, but no value will have this type:
|
||||
{type}|{type} {not implemented yet}
|
||||
void
|
||||
any
|
||||
These types can be used in declarations, but no simple value will actually
|
||||
have the "void" type.
|
||||
|
||||
There is no array type, use list<{type}> instead. For a list constant an
|
||||
efficient implementation is used that avoids allocating lot of small pieces of
|
||||
@ -1048,8 +1141,16 @@ memory.
|
||||
A partial and function can be declared in more or less specific ways:
|
||||
func any kind of function reference, no type
|
||||
checking for arguments or return value
|
||||
func: void any number and type of arguments, no return
|
||||
value
|
||||
func: {type} any number and type of arguments with specific
|
||||
return type
|
||||
|
||||
func() function with no argument, does not return a
|
||||
value
|
||||
func(): void same
|
||||
func(): {type} function with no argument and return type
|
||||
|
||||
func({type}) function with argument type, does not return
|
||||
a value
|
||||
func({type}): {type} function with argument type and return type
|
||||
@ -1138,6 +1239,18 @@ dictionary. If there is a mix of types, the "any" type is used. >
|
||||
['a', 'b', 'c'] list<string>
|
||||
[1, 'x', 3] list<any>
|
||||
|
||||
The common type of function references, if they do not all have the same
|
||||
number of arguments, uses "(...)" to indicate the number of arguments is not
|
||||
specified. For example: >
|
||||
def Foo(x: bool)
|
||||
enddef
|
||||
def Bar(x: bool, y: bool)
|
||||
enddef
|
||||
var funclist = [Foo, Bar]
|
||||
echo funclist->typename()
|
||||
Results in:
|
||||
list<func(...)>
|
||||
|
||||
For script-local variables in Vim9 script the type is checked, also when the
|
||||
variable was declared in a legacy function.
|
||||
|
||||
@ -1154,16 +1267,24 @@ In Vim9 script this has been made stricter. In most places it works just as
|
||||
before, if the value used matches the expected type. There will sometimes be
|
||||
an error, thus breaking backwards compatibility. For example:
|
||||
- Using a number other than 0 or 1 where a boolean is expected. *E1023*
|
||||
- Using a string value when setting a number options.
|
||||
- Using a string value when setting a number option.
|
||||
- Using a number where a string is expected. *E1024*
|
||||
|
||||
One consequence is that the item type of a list or dict given to map() must
|
||||
not change. This will give an error in Vim9 script: >
|
||||
map([1, 2, 3], (i, v) => 'item ' .. i)
|
||||
vim9 echo map([1, 2, 3], (i, v) => 'item ' .. i)
|
||||
E1012: Type mismatch; expected number but got string
|
||||
Instead use |mapnew()|. If the item type was determined to be "any" it can
|
||||
change to a more specific type. E.g. when a list of mixed types gets changed
|
||||
to a list of numbers.
|
||||
Instead use |mapnew(): >
|
||||
vim9 echo mapnew([1, 2, 3], (i, v) => 'item ' .. i)
|
||||
['item 0', 'item 1', 'item 2']
|
||||
|
||||
If the item type was determined to be "any" it can change to a more specific
|
||||
type. E.g. when a list of mixed types gets changed to a list of numbers: >
|
||||
var mylist = [1, 2.0, '3']
|
||||
# typename(mylist) == "list<any>"
|
||||
map(mylist, (i, v) => 'item ' .. i)
|
||||
# typename(mylist) == "list<string>", no error
|
||||
|
||||
Same for |extend()|, use |extendnew()| instead, and for |flatten()|, use
|
||||
|flattennew()| instead.
|
||||
|
||||
@ -1240,9 +1361,10 @@ Exporting an item can be written as: >
|
||||
export const someValue = ...
|
||||
export def MyFunc() ...
|
||||
export class MyClass ...
|
||||
export interface MyClass ...
|
||||
|
||||
As this suggests, only constants, variables, `:def` functions and classes can
|
||||
be exported. {not implemented yet: export class}
|
||||
be exported. {not implemented yet: class, interface}
|
||||
|
||||
*E1042*
|
||||
`:export` can only be used in Vim9 script, at the script level.
|
||||
@ -1273,6 +1395,9 @@ script file to avoid confusion.
|
||||
`:import` can also be used in legacy Vim script. The imported items still
|
||||
become script-local, even when the "s:" prefix is not given.
|
||||
|
||||
`:import` can not be used in a function. Imported items are intended to exist
|
||||
at the script level and only imported once.
|
||||
|
||||
The script name after `import` can be:
|
||||
- A relative path, starting "." or "..". This finds a file relative to the
|
||||
location of the script file itself. This is useful to split up a large
|
||||
@ -1282,6 +1407,8 @@ The script name after `import` can be:
|
||||
- A path not being relative or absolute. This will be found in the
|
||||
"import" subdirectories of 'runtimepath' entries. The name will usually be
|
||||
longer and unique, to avoid loading the wrong file.
|
||||
Note that "after/import" is not used, unless it is explicitly added in
|
||||
'runtimepath'.
|
||||
|
||||
Once a vim9 script file has been imported, the result is cached and used the
|
||||
next time the same script is imported. It will not be read again.
|
||||
@ -1342,27 +1469,46 @@ implementing classes is going to be a lot of work, it is left for the future.
|
||||
For now we'll just make sure classes can be added later.
|
||||
|
||||
Thoughts:
|
||||
- `class` / `endclass`, everything in one file
|
||||
- Class names are always CamelCase
|
||||
- Single constructor
|
||||
- `class` / `endclass`, the whole class must be in one file
|
||||
- Class names are always CamelCase (to avoid a name clash with builtin types)
|
||||
- A single constructor called "constructor"
|
||||
- Single inheritance with `class ThisClass extends BaseClass`
|
||||
- `abstract class`
|
||||
- `interface` (Abstract class without any implementation)
|
||||
- `abstract class` (class with incomplete implementation)
|
||||
- `interface` / `endinterface` (abstract class without any implementation)
|
||||
- `class SomeClass implements SomeInterface`
|
||||
- Generics for class: `class <Tkey, Tentry>`
|
||||
- Generics for function: `def <Tkey> GetLast(key: Tkey)`
|
||||
|
||||
Again, much of this is from TypeScript.
|
||||
Again, much of this is from TypeScript with a slightly different syntax.
|
||||
|
||||
Some things that look like good additions:
|
||||
- Use a class as an interface (like Dart)
|
||||
- Extend a class with methods, using an import (like Dart)
|
||||
- Mixins
|
||||
- For testing: Mock mechanism
|
||||
|
||||
An important class that will be provided is "Promise". Since Vim is single
|
||||
threaded, connecting asynchronous operations is a natural way of allowing
|
||||
plugins to do their work without blocking the user. It's a uniform way to
|
||||
invoke callbacks and handle timeouts and errors.
|
||||
|
||||
Some examples: >
|
||||
|
||||
abstract class Person
|
||||
static const prefix = 'xxx'
|
||||
var name: string
|
||||
|
||||
def constructor(name: string)
|
||||
this.name = name
|
||||
enddef
|
||||
|
||||
def display(): void
|
||||
echo name
|
||||
enddef
|
||||
|
||||
abstract def find(string): Person
|
||||
endclass
|
||||
|
||||
==============================================================================
|
||||
|
||||
9. Rationale *vim9-rationale*
|
||||
|
@ -1,17 +1,17 @@
|
||||
.TH VIMDIFF 1 "2001 March 30"
|
||||
.SH NAME
|
||||
vimdiff \- edit two, three or four versions of a file with Vim and show differences
|
||||
vimdiff \- edit between two and eight versions of a file with Vim and show differences
|
||||
.SH SYNOPSIS
|
||||
.br
|
||||
.B vimdiff
|
||||
[options] file1 file2 [file3 [file4]]
|
||||
[options] file1 file2 [file3 [file4 [file5 [file6 [file7 [file8]]]]]]
|
||||
.PP
|
||||
.B gvimdiff
|
||||
.SH DESCRIPTION
|
||||
.B Vimdiff
|
||||
starts
|
||||
.B Vim
|
||||
on two (or three or four) files.
|
||||
on two up to eight files.
|
||||
Each file gets its own window.
|
||||
The differences between the files are highlighted.
|
||||
This is a nice way to inspect changes and to move changes from one version
|
||||
|
@ -1,27 +1,28 @@
|
||||
VIMDIFF(1) VIMDIFF(1)
|
||||
VIMDIFF(1) General Commands Manual VIMDIFF(1)
|
||||
|
||||
|
||||
|
||||
NAME
|
||||
vimdiff - edit two, three or four versions of a file with Vim and show
|
||||
differences
|
||||
vimdiff - edit between two and eight versions of a file with Vim and
|
||||
show differences
|
||||
|
||||
SYNOPSIS
|
||||
vimdiff [options] file1 file2 [file3 [file4]]
|
||||
vimdiff [options] file1 file2 [file3 [file4 [file5 [file6 [file7
|
||||
[file8]]]]]]
|
||||
|
||||
gvimdiff
|
||||
|
||||
DESCRIPTION
|
||||
Vimdiff starts Vim on two (or three or four) files. Each file gets its
|
||||
own window. The differences between the files are highlighted. This
|
||||
is a nice way to inspect changes and to move changes from one version
|
||||
to another version of the same file.
|
||||
Vimdiff starts Vim on two up to eight files. Each file gets its own
|
||||
window. The differences between the files are highlighted. This is a
|
||||
nice way to inspect changes and to move changes from one version to an‐
|
||||
other version of the same file.
|
||||
|
||||
See vim(1) for details about Vim itself.
|
||||
|
||||
When started as gvimdiff the GUI will be started, if available.
|
||||
|
||||
In each window the 'diff' option will be set, which causes the differ-
|
||||
In each window the 'diff' option will be set, which causes the differ‐
|
||||
ences to be highlighted.
|
||||
The 'wrap' and 'scrollbind' options are set to make the text look good.
|
||||
The 'foldmethod' option is set to "diff", which puts ranges of lines
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Apr 17
|
||||
" Last Change: 2021 Jul 03
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@ -393,7 +393,7 @@ au BufNewFile,BufRead *.cfm,*.cfi,*.cfc setf cf
|
||||
" Configure scripts
|
||||
au BufNewFile,BufRead configure.in,configure.ac setf config
|
||||
|
||||
" CUDA Cumpute Unified Device Architecture
|
||||
" CUDA Compute Unified Device Architecture
|
||||
au BufNewFile,BufRead *.cu,*.cuh setf cuda
|
||||
|
||||
" Dockerfile; Podman uses the same syntax with name Containerfile
|
||||
@ -408,8 +408,15 @@ au BufNewFile,BufRead *enlightenment/*.cfg setf c
|
||||
" Eterm
|
||||
au BufNewFile,BufRead *Eterm/*.cfg setf eterm
|
||||
|
||||
" Elixir or Euphoria
|
||||
au BufNewFile,BufRead *.ex call dist#ft#ExCheck()
|
||||
|
||||
" Elixir
|
||||
au BufRead,BufNewFile mix.lock,*.exs setf elixir
|
||||
au BufRead,BufNewFile *.eex,*.leex setf eelixir
|
||||
|
||||
" Euphoria 3 or 4
|
||||
au BufNewFile,BufRead *.eu,*.ew,*.ex,*.exu,*.exw call dist#ft#EuphoriaCheck()
|
||||
au BufNewFile,BufRead *.eu,*.ew,*.exu,*.exw call dist#ft#EuphoriaCheck()
|
||||
if has("fname_case")
|
||||
au BufNewFile,BufRead *.EU,*.EW,*.EX,*.EXU,*.EXW call dist#ft#EuphoriaCheck()
|
||||
endif
|
||||
@ -643,6 +650,9 @@ au BufNewFile,BufRead *.mo,*.gdmo setf gdmo
|
||||
" Gedcom
|
||||
au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom
|
||||
|
||||
" Gemtext
|
||||
au BufNewFile,BufRead *.gmi,*.gemini setf gemtext
|
||||
|
||||
" Gift (Moodle)
|
||||
autocmd BufRead,BufNewFile *.gift setf gift
|
||||
|
||||
@ -855,6 +865,18 @@ au BufNewFile,BufRead *.jov,*.j73,*.jovial setf jovial
|
||||
" JSON
|
||||
au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest setf json
|
||||
|
||||
" JSON Patch (RFC 6902)
|
||||
au BufNewFile,BufRead *.json-patch setf json
|
||||
|
||||
" Jupyter Notebook is also json
|
||||
au BufNewFile,BufRead *.ipynb setf json
|
||||
|
||||
" JSONC
|
||||
au BufNewFile,BufRead *.jsonc setf jsonc
|
||||
|
||||
" Julia
|
||||
au BufNewFile,BufRead *.jl setf julia
|
||||
|
||||
" Kixtart
|
||||
au BufNewFile,BufRead *.kix setf kix
|
||||
|
||||
@ -1496,7 +1518,7 @@ au BufNewFile,BufRead *.sass setf sass
|
||||
au BufNewFile,BufRead *.sa setf sather
|
||||
|
||||
" Scala
|
||||
au BufNewFile,BufRead *.scala setf scala
|
||||
au BufNewFile,BufRead *.scala,*.sc setf scala
|
||||
|
||||
" SBT - Scala Build Tool
|
||||
au BufNewFile,BufRead *.sbt setf sbt
|
||||
@ -1504,6 +1526,9 @@ au BufNewFile,BufRead *.sbt setf sbt
|
||||
" Scilab
|
||||
au BufNewFile,BufRead *.sci,*.sce setf scilab
|
||||
|
||||
" scdoc
|
||||
au BufNewFile,BufRead *.scd setf scdoc
|
||||
|
||||
" SCSS
|
||||
au BufNewFile,BufRead *.scss setf scss
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2019 Jan 06
|
||||
" Last Change: 2020 Jun 28
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@ -118,7 +118,7 @@ endif
|
||||
" TODO: comments=
|
||||
setlocal commentstring=<%#%s%>
|
||||
|
||||
let b:undo_ftplugin = "setl cms< "
|
||||
let b:undo_ftplugin = "setl cms< " .
|
||||
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
|
27
runtime/ftplugin/jsonc.vim
Normal file
27
runtime/ftplugin/jsonc.vim
Normal file
@ -0,0 +1,27 @@
|
||||
" Vim filetype plugin
|
||||
" Language: JSONC (JSON with Comments)
|
||||
" Original Author: Izhak Jakov <izhak724@gmail.com>
|
||||
" Acknowledgement: Based off of vim-jsonc maintained by Kevin Locke <kevin@kevinlocke.name>
|
||||
" https://github.com/kevinoid/vim-jsonc
|
||||
" License: MIT
|
||||
" Last Change: 2021-07-01
|
||||
|
||||
runtime! ftplugin/json.vim
|
||||
|
||||
if exists('b:did_ftplugin_jsonc')
|
||||
finish
|
||||
else
|
||||
let b:did_ftplugin_jsonc = 1
|
||||
endif
|
||||
|
||||
" A list of commands that undo buffer local changes made below.
|
||||
let s:undo_ftplugin = []
|
||||
|
||||
" Set comment (formatting) related options. {{{1
|
||||
setlocal commentstring=//%s comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
|
||||
call add(s:undo_ftplugin, 'commentstring< comments<')
|
||||
|
||||
" Let Vim know how to disable the plug-in.
|
||||
call map(s:undo_ftplugin, "'execute ' . string(v:val)")
|
||||
let b:undo_ftplugin = join(s:undo_ftplugin, ' | ')
|
||||
unlet s:undo_ftplugin
|
@ -3,7 +3,7 @@
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2019 Nov 06
|
||||
" Last Change: 2020 Feb 13
|
||||
|
||||
if (exists("b:did_ftplugin"))
|
||||
finish
|
||||
@ -112,7 +112,7 @@ else
|
||||
if !exists('g:ruby_default_path')
|
||||
if has("ruby") && has("win32")
|
||||
ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) )
|
||||
elseif executable('ruby')
|
||||
elseif executable('ruby') && !empty($HOME)
|
||||
let g:ruby_default_path = s:query_path($HOME)
|
||||
else
|
||||
let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val')
|
||||
|
@ -5,6 +5,7 @@
|
||||
Name[de]=GVim
|
||||
Name[eo]=GVim
|
||||
Name[fr]=GVim
|
||||
Name[it]=GVim
|
||||
Name[ru]=GVim
|
||||
Name[sr]=GVim
|
||||
Name[tr]=GVim
|
||||
@ -13,6 +14,7 @@ Name=GVim
|
||||
GenericName[de]=Texteditor
|
||||
GenericName[eo]=Tekstoredaktilo
|
||||
GenericName[fr]=Éditeur de texte
|
||||
GenericName[it]=Editor di testi
|
||||
GenericName[ja]=テキストエディタ
|
||||
GenericName[ru]=Текстовый редактор
|
||||
GenericName[sr]=Едитор текст
|
||||
@ -22,6 +24,7 @@ GenericName=Text Editor
|
||||
Comment[de]=Textdateien bearbeiten
|
||||
Comment[eo]=Redakti tekstajn dosierojn
|
||||
Comment[fr]=Éditer des fichiers texte
|
||||
Comment[it]=Edita file di testo
|
||||
Comment[ja]=テキストファイルを編集します
|
||||
Comment[ru]=Редактирование текстовых файлов
|
||||
Comment[sr]=Уређујте текст фајлове
|
||||
@ -60,7 +63,6 @@ Comment[hr]=Uređivanje tekstualne datoteke
|
||||
Comment[hu]=Szövegfájlok szerkesztése
|
||||
Comment[id]=Edit file teks
|
||||
Comment[is]=Vinna með textaskrár
|
||||
Comment[it]=Modifica file di testo
|
||||
Comment[kn]=ಪಠ್ಯ ಕಡತಗಳನ್ನು ಸಂಪಾದಿಸು
|
||||
Comment[ko]=텍스트 파일을 편집합니다
|
||||
Comment[lt]=Redaguoti tekstines bylas
|
||||
@ -102,6 +104,7 @@ Type=Application
|
||||
Keywords[de]=Text;Editor;
|
||||
Keywords[eo]=Teksto;redaktilo;
|
||||
Keywords[fr]=Texte;éditeur;
|
||||
Keywords[it]=Testo;editor;
|
||||
Keywords[ja]=テキスト;エディタ;
|
||||
Keywords[ru]=текст;текстовый редактор;
|
||||
Keywords[sr]=Текст;едитор;
|
||||
@ -111,7 +114,9 @@ Keywords=Text;editor;
|
||||
Icon[de]=gvim
|
||||
Icon[eo]=gvim
|
||||
Icon[fr]=gvim
|
||||
Icon[it]=gvim
|
||||
Icon[ru]=gvim
|
||||
Icon[sr]=gvim
|
||||
Icon=gvim
|
||||
Categories=Utility;TextEditor;
|
||||
StartupNotify=true
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: Bazel (http://bazel.io)
|
||||
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
|
||||
" Last Change: 2017 Jun 13
|
||||
" Last Change: 2021 Jul 08
|
||||
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
@ -41,30 +41,41 @@ function GetBzlIndent(lnum) abort
|
||||
if exists('g:pyindent_open_paren')
|
||||
let l:pyindent_open_paren = g:pyindent_open_paren
|
||||
endif
|
||||
let g:pyindent_nested_paren = 'shiftwidth() * 2'
|
||||
let g:pyindent_open_paren = 'shiftwidth() * 2'
|
||||
let g:pyindent_nested_paren = 'shiftwidth()'
|
||||
let g:pyindent_open_paren = 'shiftwidth()'
|
||||
endif
|
||||
|
||||
let l:indent = -1
|
||||
|
||||
" Indent inside parens.
|
||||
" Align with the open paren unless it is at the end of the line.
|
||||
" E.g.
|
||||
" open_paren_not_at_EOL(100,
|
||||
" (200,
|
||||
" 300),
|
||||
" 400)
|
||||
" open_paren_at_EOL(
|
||||
" 100, 200, 300, 400)
|
||||
call cursor(a:lnum, 1)
|
||||
let [l:par_line, l:par_col] = searchpairpos('(\|{\|\[', '', ')\|}\|\]', 'bW',
|
||||
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" .
|
||||
\ " synIDattr(synID(line('.'), col('.'), 1), 'name')" .
|
||||
\ " =~ '\\(Comment\\|String\\)$'")
|
||||
if l:par_line > 0
|
||||
call cursor(l:par_line, 1)
|
||||
if l:par_col != col('$') - 1
|
||||
let l:indent = l:par_col
|
||||
" Indent inside parens.
|
||||
if searchpair('(\|{\|\[', '', ')\|}\|\]', 'W',
|
||||
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" .
|
||||
\ " synIDattr(synID(line('.'), col('.'), 1), 'name')" .
|
||||
\ " =~ '\\(Comment\\|String\\)$'") && line('.') == a:lnum
|
||||
" If cursor is at close parens, match indent with open parens.
|
||||
" E.g.
|
||||
" foo(
|
||||
" )
|
||||
let l:indent = indent(l:par_line)
|
||||
else
|
||||
" Align with the open paren unless it is at the end of the line.
|
||||
" E.g.
|
||||
" open_paren_not_at_EOL(100,
|
||||
" (200,
|
||||
" 300),
|
||||
" 400)
|
||||
" open_paren_at_EOL(
|
||||
" 100, 200, 300, 400)
|
||||
call cursor(l:par_line, 1)
|
||||
if l:par_col != col('$') - 1
|
||||
let l:indent = l:par_col
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim indent script for HTML
|
||||
" Maintainer: Bram Moolenaar
|
||||
" Original Author: Andy Wokula <anwoku@yahoo.de>
|
||||
" Last Change: 2021 Jan 26
|
||||
" Last Change: 2021 Jun 13
|
||||
" Version: 1.0 "{{{
|
||||
" Description: HTML indent script with cached state for faster indenting on a
|
||||
" range of lines.
|
||||
@ -62,7 +62,7 @@ let s:tagname = '\w\+\(-\w\+\)*'
|
||||
" Prefer using buffer-local settings over global settings, so that there can
|
||||
" be defaults for all HTML files and exceptions for specific types of HTML
|
||||
" files.
|
||||
func! HtmlIndent_CheckUserSettings()
|
||||
func HtmlIndent_CheckUserSettings()
|
||||
"{{{
|
||||
let inctags = ''
|
||||
if exists("b:html_indent_inctags")
|
||||
@ -178,7 +178,7 @@ let s:endtags = [0,0,0,0,0,0,0] " long enough for the highest index
|
||||
"}}}
|
||||
|
||||
" Add a list of tag names for a pair of <tag> </tag> to "tags".
|
||||
func! s:AddITags(tags, taglist)
|
||||
func s:AddITags(tags, taglist)
|
||||
"{{{
|
||||
for itag in a:taglist
|
||||
let a:tags[itag] = 1
|
||||
@ -187,7 +187,7 @@ func! s:AddITags(tags, taglist)
|
||||
endfunc "}}}
|
||||
|
||||
" Take a list of tag name pairs that are not to be used as tag pairs.
|
||||
func! s:RemoveITags(tags, taglist)
|
||||
func s:RemoveITags(tags, taglist)
|
||||
"{{{
|
||||
for itag in a:taglist
|
||||
let a:tags[itag] = 1
|
||||
@ -196,7 +196,7 @@ func! s:RemoveITags(tags, taglist)
|
||||
endfunc "}}}
|
||||
|
||||
" Add a block tag, that is a tag with a different kind of indenting.
|
||||
func! s:AddBlockTag(tag, id, ...)
|
||||
func s:AddBlockTag(tag, id, ...)
|
||||
"{{{
|
||||
if !(a:id >= 2 && a:id < len(s:endtags))
|
||||
echoerr 'AddBlockTag ' . a:id
|
||||
@ -255,7 +255,7 @@ call s:AddBlockTag('<!--[', 6, '![endif]-->')
|
||||
" Return non-zero when "tagname" is an opening tag, not being a block tag, for
|
||||
" which there should be a closing tag. Can be used by scripts that include
|
||||
" HTML indenting.
|
||||
func! HtmlIndent_IsOpenTag(tagname)
|
||||
func HtmlIndent_IsOpenTag(tagname)
|
||||
"{{{
|
||||
if get(s:indent_tags, a:tagname) == 1
|
||||
return 1
|
||||
@ -264,7 +264,7 @@ func! HtmlIndent_IsOpenTag(tagname)
|
||||
endfunc "}}}
|
||||
|
||||
" Get the value for "tagname", taking care of buffer-local tags.
|
||||
func! s:get_tag(tagname)
|
||||
func s:get_tag(tagname)
|
||||
"{{{
|
||||
let i = get(s:indent_tags, a:tagname)
|
||||
if (i == 1 || i == -1) && get(b:hi_removed_tags, a:tagname) != 0
|
||||
@ -277,7 +277,7 @@ func! s:get_tag(tagname)
|
||||
endfunc "}}}
|
||||
|
||||
" Count the number of start and end tags in "text".
|
||||
func! s:CountITags(text)
|
||||
func s:CountITags(text)
|
||||
"{{{
|
||||
" Store the result in s:curind and s:nextrel.
|
||||
let s:curind = 0 " relative indent steps for current line [unit &sw]:
|
||||
@ -289,7 +289,7 @@ func! s:CountITags(text)
|
||||
endfunc "}}}
|
||||
|
||||
" Count the number of start and end tags in text.
|
||||
func! s:CountTagsAndState(text)
|
||||
func s:CountTagsAndState(text)
|
||||
"{{{
|
||||
" Store the result in s:curind and s:nextrel. Update b:hi_newstate.block.
|
||||
let s:curind = 0 " relative indent steps for current line [unit &sw]:
|
||||
@ -304,7 +304,7 @@ func! s:CountTagsAndState(text)
|
||||
endfunc "}}}
|
||||
|
||||
" Used by s:CountITags() and s:CountTagsAndState().
|
||||
func! s:CheckTag(itag)
|
||||
func s:CheckTag(itag)
|
||||
"{{{
|
||||
" Returns an empty string or "SCRIPT".
|
||||
" a:itag can be "tag" or "/tag" or "<!--" or "-->"
|
||||
@ -338,7 +338,7 @@ func! s:CheckTag(itag)
|
||||
endfunc "}}}
|
||||
|
||||
" Used by s:CheckTag(). Returns an empty string or "SCRIPT".
|
||||
func! s:CheckBlockTag(blocktag, ind)
|
||||
func s:CheckBlockTag(blocktag, ind)
|
||||
"{{{
|
||||
if a:ind > 0
|
||||
" a block starts here
|
||||
@ -366,7 +366,7 @@ func! s:CheckBlockTag(blocktag, ind)
|
||||
endfunc "}}}
|
||||
|
||||
" Used by s:CheckTag().
|
||||
func! s:CheckCustomTag(ctag)
|
||||
func s:CheckCustomTag(ctag)
|
||||
"{{{
|
||||
" Returns 1 if ctag is the tag for a custom element, 0 otherwise.
|
||||
" a:ctag can be "tag" or "/tag" or "<!--" or "-->"
|
||||
@ -396,7 +396,7 @@ func! s:CheckCustomTag(ctag)
|
||||
endfunc "}}}
|
||||
|
||||
" Return the <script> type: either "javascript" or ""
|
||||
func! s:GetScriptType(str)
|
||||
func s:GetScriptType(str)
|
||||
"{{{
|
||||
if a:str == "" || a:str =~ "java"
|
||||
return "javascript"
|
||||
@ -407,7 +407,7 @@ endfunc "}}}
|
||||
|
||||
" Look back in the file, starting at a:lnum - 1, to compute a state for the
|
||||
" start of line a:lnum. Return the new state.
|
||||
func! s:FreshState(lnum)
|
||||
func s:FreshState(lnum)
|
||||
"{{{
|
||||
" A state is to know ALL relevant details about the
|
||||
" lines 1..a:lnum-1, initial calculating (here!) can be slow, but updating is
|
||||
@ -568,24 +568,29 @@ func! s:FreshState(lnum)
|
||||
endfunc "}}}
|
||||
|
||||
" Indent inside a <pre> block: Keep indent as-is.
|
||||
func! s:Alien2()
|
||||
func s:Alien2()
|
||||
"{{{
|
||||
return -1
|
||||
endfunc "}}}
|
||||
|
||||
" Return the indent inside a <script> block for javascript.
|
||||
func! s:Alien3()
|
||||
func s:Alien3()
|
||||
"{{{
|
||||
let lnum = prevnonblank(v:lnum - 1)
|
||||
while lnum > 1 && getline(lnum) =~ '^\s*/[/*]'
|
||||
" Skip over comments to avoid that cindent() aligns with the <script> tag
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
endwhile
|
||||
if lnum < b:hi_indent.blocklnr
|
||||
" indent for <script> itself
|
||||
return b:hi_indent.blocktagind
|
||||
endif
|
||||
if lnum == b:hi_indent.blocklnr
|
||||
" indent for the first line after <script>
|
||||
return eval(b:hi_js1indent)
|
||||
endif
|
||||
if b:hi_indent.scripttype == "javascript"
|
||||
" indent for further lines
|
||||
return eval(b:hi_js1indent) + GetJavascriptIndent()
|
||||
else
|
||||
return -1
|
||||
@ -593,7 +598,7 @@ func! s:Alien3()
|
||||
endfunc "}}}
|
||||
|
||||
" Return the indent inside a <style> block.
|
||||
func! s:Alien4()
|
||||
func s:Alien4()
|
||||
"{{{
|
||||
if prevnonblank(v:lnum-1) == b:hi_indent.blocklnr
|
||||
" indent for first content line
|
||||
@ -603,7 +608,7 @@ func! s:Alien4()
|
||||
endfunc "}}}
|
||||
|
||||
" Indending inside a <style> block. Returns the indent.
|
||||
func! s:CSSIndent()
|
||||
func s:CSSIndent()
|
||||
"{{{
|
||||
" This handles standard CSS and also Closure stylesheets where special lines
|
||||
" start with @.
|
||||
@ -720,13 +725,13 @@ endfunc "}}}
|
||||
" tag: blah
|
||||
" tag: blah &&
|
||||
" tag: blah ||
|
||||
func! s:CssUnfinished(text)
|
||||
func s:CssUnfinished(text)
|
||||
"{{{
|
||||
return a:text =~ '\(||\|&&\|:\|\k\)\s*$'
|
||||
endfunc "}}}
|
||||
|
||||
" Search back for the first unfinished line above "lnum".
|
||||
func! s:CssFirstUnfinished(lnum, min_lnum)
|
||||
func s:CssFirstUnfinished(lnum, min_lnum)
|
||||
"{{{
|
||||
let align_lnum = a:lnum
|
||||
while align_lnum > a:min_lnum && s:CssUnfinished(getline(align_lnum - 1))
|
||||
@ -736,7 +741,7 @@ func! s:CssFirstUnfinished(lnum, min_lnum)
|
||||
endfunc "}}}
|
||||
|
||||
" Find the non-empty line at or before "lnum" that is not a comment.
|
||||
func! s:CssPrevNonComment(lnum, stopline)
|
||||
func s:CssPrevNonComment(lnum, stopline)
|
||||
"{{{
|
||||
" caller starts from a line a:lnum + 1 that is not a comment
|
||||
let lnum = prevnonblank(a:lnum)
|
||||
@ -761,7 +766,7 @@ func! s:CssPrevNonComment(lnum, stopline)
|
||||
endfunc "}}}
|
||||
|
||||
" Check the number of {} and () in line "lnum". Return a dict with the counts.
|
||||
func! HtmlIndent_CountBraces(lnum)
|
||||
func HtmlIndent_CountBraces(lnum)
|
||||
"{{{
|
||||
let brs = substitute(getline(a:lnum), '[''"].\{-}[''"]\|/\*.\{-}\*/\|/\*.*$\|[^{}()]', '', 'g')
|
||||
let c_open = 0
|
||||
@ -794,7 +799,7 @@ func! HtmlIndent_CountBraces(lnum)
|
||||
endfunc "}}}
|
||||
|
||||
" Return the indent for a comment: <!-- -->
|
||||
func! s:Alien5()
|
||||
func s:Alien5()
|
||||
"{{{
|
||||
let curtext = getline(v:lnum)
|
||||
if curtext =~ '^\s*\zs-->'
|
||||
@ -826,7 +831,7 @@ func! s:Alien5()
|
||||
endfunc "}}}
|
||||
|
||||
" Return the indent for conditional comment: <!--[ ![endif]-->
|
||||
func! s:Alien6()
|
||||
func s:Alien6()
|
||||
"{{{
|
||||
let curtext = getline(v:lnum)
|
||||
if curtext =~ '\s*\zs<!\[endif\]-->'
|
||||
@ -840,7 +845,7 @@ func! s:Alien6()
|
||||
endfunc "}}}
|
||||
|
||||
" When the "lnum" line ends in ">" find the line containing the matching "<".
|
||||
func! HtmlIndent_FindTagStart(lnum)
|
||||
func HtmlIndent_FindTagStart(lnum)
|
||||
"{{{
|
||||
" Avoids using the indent of a continuation line.
|
||||
" Moves the cursor.
|
||||
@ -863,7 +868,7 @@ func! HtmlIndent_FindTagStart(lnum)
|
||||
endfunc "}}}
|
||||
|
||||
" Find the unclosed start tag from the current cursor position.
|
||||
func! HtmlIndent_FindStartTag()
|
||||
func HtmlIndent_FindStartTag()
|
||||
"{{{
|
||||
" The cursor must be on or before a closing tag.
|
||||
" If found, positions the cursor at the match and returns the line number.
|
||||
@ -877,7 +882,7 @@ func! HtmlIndent_FindStartTag()
|
||||
endfunc "}}}
|
||||
|
||||
" Moves the cursor from a "<" to the matching ">".
|
||||
func! HtmlIndent_FindTagEnd()
|
||||
func HtmlIndent_FindTagEnd()
|
||||
"{{{
|
||||
" Call this with the cursor on the "<" of a start tag.
|
||||
" This will move the cursor to the ">" of the matching end tag or, when it's
|
||||
@ -897,7 +902,7 @@ func! HtmlIndent_FindTagEnd()
|
||||
endfunc "}}}
|
||||
|
||||
" Indenting inside a start tag. Return the correct indent or -1 if unknown.
|
||||
func! s:InsideTag(foundHtmlString)
|
||||
func s:InsideTag(foundHtmlString)
|
||||
"{{{
|
||||
if a:foundHtmlString
|
||||
" Inside an attribute string.
|
||||
@ -958,7 +963,7 @@ func! s:InsideTag(foundHtmlString)
|
||||
endfunc "}}}
|
||||
|
||||
" THE MAIN INDENT FUNCTION. Return the amount of indent for v:lnum.
|
||||
func! HtmlIndent()
|
||||
func HtmlIndent()
|
||||
"{{{
|
||||
if prevnonblank(v:lnum - 1) < 1
|
||||
" First non-blank line has no indent.
|
||||
|
189
runtime/indent/jsonc.vim
Normal file
189
runtime/indent/jsonc.vim
Normal file
@ -0,0 +1,189 @@
|
||||
" Vim indent file
|
||||
" Language: JSONC (JSON with Comments)
|
||||
" Original Author: Izhak Jakov <izhak724@gmail.com>
|
||||
" Acknowledgement: Based off of vim-json maintained by Eli Parra <eli@elzr.com>
|
||||
" https://github.com/elzr/vim-json
|
||||
" Last Change: 2021-07-01
|
||||
|
||||
" 0. Initialization {{{1
|
||||
" =================
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal nosmartindent
|
||||
|
||||
" Now, set up our indentation expression and keys that trigger it.
|
||||
setlocal indentexpr=GetJSONCIndent()
|
||||
setlocal indentkeys=0{,0},0),0[,0],!^F,o,O,e
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetJSONCIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" 1. Variables {{{1
|
||||
" ============
|
||||
|
||||
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
|
||||
" Regex that defines blocks.
|
||||
let s:block_regex = '\%({\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term
|
||||
|
||||
" 2. Auxiliary Functions {{{1
|
||||
" ======================
|
||||
|
||||
" Check if the character at lnum:col is inside a string.
|
||||
function s:IsInString(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') == 'jsonString'
|
||||
endfunction
|
||||
|
||||
" Find line above 'lnum' that isn't empty, or in a string.
|
||||
function s:PrevNonBlankNonString(lnum)
|
||||
let lnum = prevnonblank(a:lnum)
|
||||
while lnum > 0
|
||||
" If the line isn't empty or in a string, end search.
|
||||
let line = getline(lnum)
|
||||
if !(s:IsInString(lnum, 1) && s:IsInString(lnum, strlen(line)))
|
||||
break
|
||||
endif
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
endwhile
|
||||
return lnum
|
||||
endfunction
|
||||
|
||||
" Check if line 'lnum' has more opening brackets than closing ones.
|
||||
function s:LineHasOpeningBrackets(lnum)
|
||||
let open_0 = 0
|
||||
let open_2 = 0
|
||||
let open_4 = 0
|
||||
let line = getline(a:lnum)
|
||||
let pos = match(line, '[][(){}]', 0)
|
||||
while pos != -1
|
||||
let idx = stridx('(){}[]', line[pos])
|
||||
if idx % 2 == 0
|
||||
let open_{idx} = open_{idx} + 1
|
||||
else
|
||||
let open_{idx - 1} = open_{idx - 1} - 1
|
||||
endif
|
||||
let pos = match(line, '[][(){}]', pos + 1)
|
||||
endwhile
|
||||
return (open_0 > 0) . (open_2 > 0) . (open_4 > 0)
|
||||
endfunction
|
||||
|
||||
function s:Match(lnum, regex)
|
||||
let col = match(getline(a:lnum), a:regex) + 1
|
||||
return col > 0 && !s:IsInString(a:lnum, col) ? col : 0
|
||||
endfunction
|
||||
|
||||
" 3. GetJSONCIndent Function {{{1
|
||||
" =========================
|
||||
|
||||
function GetJSONCIndent()
|
||||
if !exists("s:inside_comment")
|
||||
let s:inside_comment = 0
|
||||
endif
|
||||
|
||||
" 3.1. Setup {{{2
|
||||
" ----------
|
||||
|
||||
" Set up variables for restoring position in file. Could use v:lnum here.
|
||||
let vcol = col('.')
|
||||
|
||||
" 3.2. Work on the current line {{{2
|
||||
" -----------------------------
|
||||
|
||||
|
||||
" Get the current line.
|
||||
let line = getline(v:lnum)
|
||||
let ind = -1
|
||||
if s:inside_comment == 0
|
||||
" TODO iterate through all the matches in a line
|
||||
let col = matchend(line, '\/\*')
|
||||
if col > 0 && !s:IsInString(v:lnum, col)
|
||||
let s:inside_comment = 1
|
||||
endif
|
||||
endif
|
||||
" If we're in the middle of a comment
|
||||
if s:inside_comment == 1
|
||||
let col = matchend(line, '\*\/')
|
||||
if col > 0 && !s:IsInString(v:lnum, col)
|
||||
let s:inside_comment = 0
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
if line =~ '^\s*//'
|
||||
return ind
|
||||
endif
|
||||
|
||||
" If we got a closing bracket on an empty line, find its match and indent
|
||||
" according to it.
|
||||
let col = matchend(line, '^\s*[]}]')
|
||||
|
||||
if col > 0 && !s:IsInString(v:lnum, col)
|
||||
call cursor(v:lnum, col)
|
||||
let bs = strpart('{}[]', stridx('}]', line[col - 1]) * 2, 2)
|
||||
|
||||
let pairstart = escape(bs[0], '[')
|
||||
let pairend = escape(bs[1], ']')
|
||||
let pairline = searchpair(pairstart, '', pairend, 'bW')
|
||||
|
||||
if pairline > 0
|
||||
let ind = indent(pairline)
|
||||
else
|
||||
let ind = virtcol('.') - 1
|
||||
endif
|
||||
|
||||
return ind
|
||||
endif
|
||||
|
||||
" If we are in a multi-line string, don't do anything to it.
|
||||
if s:IsInString(v:lnum, matchend(line, '^\s*') + 1)
|
||||
return indent('.')
|
||||
endif
|
||||
|
||||
" 3.3. Work on the previous line. {{{2
|
||||
" -------------------------------
|
||||
|
||||
let lnum = prevnonblank(v:lnum - 1)
|
||||
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
" Set up variables for current line.
|
||||
let line = getline(lnum)
|
||||
let ind = indent(lnum)
|
||||
|
||||
" If the previous line ended with a block opening, add a level of indent.
|
||||
" if s:Match(lnum, s:block_regex)
|
||||
" return indent(lnum) + shiftwidth()
|
||||
" endif
|
||||
|
||||
" If the previous line contained an opening bracket, and we are still in it,
|
||||
" add indent depending on the bracket type.
|
||||
if line =~ '[[({]'
|
||||
let counts = s:LineHasOpeningBrackets(lnum)
|
||||
if counts[0] == '1' || counts[1] == '1' || counts[2] == '1'
|
||||
return ind + shiftwidth()
|
||||
else
|
||||
call cursor(v:lnum, vcol)
|
||||
end
|
||||
endif
|
||||
|
||||
" }}}2
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim:set sw=2 sts=2 ts=8 noet:
|
@ -2,7 +2,7 @@
|
||||
" Language: Pascal
|
||||
" Maintainer: Neil Carter <n.carter@swansea.ac.uk>
|
||||
" Created: 2004 Jul 13
|
||||
" Last Change: 2017 Jun 13
|
||||
" Last Change: 2021 Jul 01
|
||||
"
|
||||
" This is version 2.0, a complete rewrite.
|
||||
"
|
||||
@ -20,6 +20,8 @@ setlocal indentkeys+==end;,==const,==type,==var,==begin,==repeat,==until,==for
|
||||
setlocal indentkeys+==program,==function,==procedure,==object,==private
|
||||
setlocal indentkeys+==record,==if,==else,==case
|
||||
|
||||
let b:undo_indent = "setl indentkeys< indentexpr<"
|
||||
|
||||
if exists("*GetPascalIndent")
|
||||
finish
|
||||
endif
|
||||
|
@ -4,6 +4,7 @@
|
||||
" Previous Maintainer: Nikolai Weibull <now at bitwi.se>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 Feb 03
|
||||
|
||||
" 0. Initialization {{{1
|
||||
" =================
|
||||
|
@ -15,7 +15,7 @@ text comment
|
||||
</tag1>
|
||||
<!--
|
||||
text comment
|
||||
end coment -->
|
||||
end comment -->
|
||||
</tag0>
|
||||
<!-- END_INDENT -->
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
</tag1>
|
||||
<!--
|
||||
text comment
|
||||
end coment -->
|
||||
end comment -->
|
||||
</tag0>
|
||||
<!-- END_INDENT -->
|
||||
|
||||
|
@ -22,7 +22,7 @@ map F "hy2l
|
||||
map C "fp
|
||||
map e "fy2l
|
||||
map E "hp
|
||||
map F "hy2l
|
||||
map F "hy2l
|
||||
|
||||
" initialisations:
|
||||
" KM cleanup buffer
|
||||
|
@ -4,7 +4,7 @@ For instructions on installing this file, type
|
||||
`:help matchit-install`
|
||||
inside Vim.
|
||||
|
||||
For Vim version 8.1. Last change: 2020 Mar 01
|
||||
For Vim version 8.1. Last change: 2021 May 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Benji Fisher et al
|
||||
@ -320,7 +320,7 @@ should work (and have the same effect as "foobar:barfoo:endfoobar"), although
|
||||
this has not been thoroughly tested.
|
||||
|
||||
You can use |zero-width| patterns such as |\@<=| and |\zs|. (The latter has
|
||||
not been thouroughly tested in matchit.vim.) For example, if the keyword "if"
|
||||
not been thoroughly tested in matchit.vim.) For example, if the keyword "if"
|
||||
must occur at the start of the line, with optional white space, you might use
|
||||
the pattern "\(^\s*\)\@<=if" so that the cursor will end on the "i" instead of
|
||||
at the start of the line. For another example, if HTML had only one tag then
|
||||
|
@ -9,7 +9,7 @@
|
||||
SPELLDIR = ..
|
||||
FILES = tet_ID.aff tet_ID.dic
|
||||
|
||||
# I don't hava a Tetum locale, use the Dutch one instead.
|
||||
# I don't have a Tetum locale, use the Dutch one instead.
|
||||
all: $SPELLDIR/tet.latin1.spl $SPELLDIR/tet.utf-8.spl ../README_tet.txt
|
||||
|
||||
$SPELLDIR/tet.latin1.spl : $FILES
|
||||
|
@ -293,7 +293,7 @@ syn region eighthComment start="\zs\\" end="$" contains=eighthTodo
|
||||
" Define the default highlighting.
|
||||
if !exists("did_eighth_syntax_inits")
|
||||
let did_eighth_syntax_inits=1
|
||||
" The default methods for highlighting. Can be overriden later.
|
||||
" The default methods for highlighting. Can be overridden later.
|
||||
hi def link eighthTodo Todo
|
||||
hi def link eighthOperators Operator
|
||||
hi def link eighthMath Number
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: APT config file
|
||||
" Maintainer: Yann Amar <quidame@poivron.org>
|
||||
" Last Change: 2015 Dec 22
|
||||
" Last Change: 2021 Jul 12
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if !exists("main_syntax")
|
||||
@ -396,10 +396,13 @@ syn cluster aptconfSynaptic_ contains=aptconfSynaptic,
|
||||
" }}}
|
||||
" Unattended Upgrade: {{{
|
||||
syn keyword aptconfUnattendedUpgrade contained
|
||||
\ AutoFixInterruptedDpkg Automatic-Reboot Automatic-Reboot-Time
|
||||
\ Automatic-Reboot-WithUsers InstallOnShutdown Mail MailOnlyOnError
|
||||
\ MinimalSteps Origins-Pattern Package-Blacklist
|
||||
\ Remove-Unused-Dependencies
|
||||
\ Allow-APT-Mark-Fallback Allow-downgrade AutoFixInterruptedDpkg
|
||||
\ Automatic-Reboot Automatic-Reboot-Time Automatic-Reboot-WithUsers
|
||||
\ Debug InstallOnShutdown Mail MailOnlyOnError MailReport MinimalSteps
|
||||
\ OnlyOnACPower Origins-Pattern Package-Blacklist
|
||||
\ Remove-New-Unused-Dependencies Remove-Unused-Dependencies
|
||||
\ Remove-Unused-Kernel-Packages Skip-Updates-On-Metered-Connections
|
||||
\ SyslogEnable SyslogFacility Verbose
|
||||
|
||||
syn cluster aptconfUnattendedUpgrade_ contains=aptconfUnattendedUpgrade
|
||||
" }}}
|
||||
|
@ -1,58 +1,109 @@
|
||||
" Vim syntax file
|
||||
" Language: Go
|
||||
" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
|
||||
" Last Change: 2014 Aug 16
|
||||
|
||||
" Options:
|
||||
" There are some options for customizing the highlighting; the recommended
|
||||
" settings are the default values, but you can write:
|
||||
" let OPTION_NAME = 0
|
||||
" in your ~/.vimrc file to disable particular options. You can also write:
|
||||
" let OPTION_NAME = 1
|
||||
" to enable particular options. At present, all options default to on.
|
||||
" Copyright 2009 The Go Authors. All rights reserved.
|
||||
" Use of this source code is governed by a BSD-style
|
||||
" license that can be found in the LICENSE file.
|
||||
"
|
||||
" - g:go_highlight_array_whitespace_error
|
||||
" Highlights white space after "[]".
|
||||
" - g:go_highlight_chan_whitespace_error
|
||||
" Highlights white space around the communications operator that don't
|
||||
" follow the standard style.
|
||||
" - g:go_highlight_extra_types
|
||||
" Highlights commonly used library types (io.Reader, etc.).
|
||||
" - g:go_highlight_space_tab_error
|
||||
" Highlights instances of tabs following spaces.
|
||||
" - g:go_highlight_trailing_whitespace_error
|
||||
" Highlights trailing white space.
|
||||
" go.vim: Vim syntax file for Go.
|
||||
" Language: Go
|
||||
" Maintainer: Billie Cleek <bhcleek@gmail.com>
|
||||
" Latest Revision: 2021-06-26
|
||||
" License: BSD-style. See LICENSE file in source repository.
|
||||
" Repository: https://github.com/fatih/vim-go
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists('b:current_syntax')
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists('g:go_highlight_array_whitespace_error')
|
||||
let g:go_highlight_array_whitespace_error = 1
|
||||
endif
|
||||
if !exists('g:go_highlight_chan_whitespace_error')
|
||||
let g:go_highlight_chan_whitespace_error = 1
|
||||
endif
|
||||
if !exists('g:go_highlight_extra_types')
|
||||
let g:go_highlight_extra_types = 1
|
||||
endif
|
||||
if !exists('g:go_highlight_space_tab_error')
|
||||
let g:go_highlight_space_tab_error = 1
|
||||
endif
|
||||
if !exists('g:go_highlight_trailing_whitespace_error')
|
||||
let g:go_highlight_trailing_whitespace_error = 1
|
||||
endif
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! s:FoldEnable(...) abort
|
||||
if a:0 > 0
|
||||
return index(s:FoldEnable(), a:1) > -1
|
||||
endif
|
||||
return get(g:, 'go_fold_enable', ['block', 'import', 'varconst', 'package_comment'])
|
||||
endfunction
|
||||
|
||||
function! s:HighlightArrayWhitespaceError() abort
|
||||
return get(g:, 'go_highlight_array_whitespace_error', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightChanWhitespaceError() abort
|
||||
return get(g:, 'go_highlight_chan_whitespace_error', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightExtraTypes() abort
|
||||
return get(g:, 'go_highlight_extra_types', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightSpaceTabError() abort
|
||||
return get(g:, 'go_highlight_space_tab_error', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightTrailingWhitespaceError() abort
|
||||
return get(g:, 'go_highlight_trailing_whitespace_error', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightOperators() abort
|
||||
return get(g:, 'go_highlight_operators', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightFunctions() abort
|
||||
return get(g:, 'go_highlight_functions', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightFunctionParameters() abort
|
||||
return get(g:, 'go_highlight_function_parameters', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightFunctionCalls() abort
|
||||
return get(g:, 'go_highlight_function_calls', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightFields() abort
|
||||
return get(g:, 'go_highlight_fields', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightTypes() abort
|
||||
return get(g:, 'go_highlight_types', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightBuildConstraints() abort
|
||||
return get(g:, 'go_highlight_build_constraints', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightStringSpellcheck() abort
|
||||
return get(g:, 'go_highlight_string_spellcheck', 1)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightFormatStrings() abort
|
||||
return get(g:, 'go_highlight_format_strings', 1)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightGenerateTags() abort
|
||||
return get(g:, 'go_highlight_generate_tags', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightVariableAssignments() abort
|
||||
return get(g:, 'go_highlight_variable_assignments', 0)
|
||||
endfunction
|
||||
|
||||
function! s:HighlightVariableDeclarations() abort
|
||||
return get(g:, 'go_highlight_variable_declarations', 0)
|
||||
endfunction
|
||||
|
||||
syn case match
|
||||
|
||||
syn keyword goDirective package import
|
||||
syn keyword goDeclaration var const type
|
||||
syn keyword goDeclType struct interface
|
||||
syn keyword goPackage package
|
||||
syn keyword goImport import contained
|
||||
syn keyword goVar var contained
|
||||
syn keyword goConst const contained
|
||||
|
||||
hi def link goDirective Statement
|
||||
hi def link goPackage Statement
|
||||
hi def link goImport Statement
|
||||
hi def link goVar Keyword
|
||||
hi def link goConst Keyword
|
||||
hi def link goDeclaration Keyword
|
||||
hi def link goDeclType Keyword
|
||||
|
||||
" Keywords within functions
|
||||
syn keyword goStatement defer go goto return break continue fallthrough
|
||||
@ -78,28 +129,38 @@ hi def link goUnsignedInts Type
|
||||
hi def link goFloats Type
|
||||
hi def link goComplexes Type
|
||||
|
||||
" Treat func specially: it's a declaration at the start of a line, but a type
|
||||
" elsewhere. Order matters here.
|
||||
syn match goType /\<func\>/
|
||||
syn match goDeclaration /^func\>/
|
||||
|
||||
" Predefined functions and values
|
||||
syn keyword goBuiltins append cap close complex copy delete imag len
|
||||
syn keyword goBuiltins make new panic print println real recover
|
||||
syn keyword goConstants iota true false nil
|
||||
syn keyword goBuiltins append cap close complex copy delete imag len
|
||||
syn keyword goBuiltins make new panic print println real recover
|
||||
syn keyword goBoolean true false
|
||||
syn keyword goPredefinedIdentifiers nil iota
|
||||
|
||||
hi def link goBuiltins Keyword
|
||||
hi def link goConstants Keyword
|
||||
hi def link goBuiltins Identifier
|
||||
hi def link goBoolean Boolean
|
||||
hi def link goPredefinedIdentifiers goBoolean
|
||||
|
||||
" Comments; their contents
|
||||
syn keyword goTodo contained TODO FIXME XXX BUG
|
||||
syn cluster goCommentGroup contains=goTodo
|
||||
syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell
|
||||
syn region goComment start="//" end="$" contains=@goCommentGroup,@Spell
|
||||
|
||||
syn region goComment start="//" end="$" contains=goGenerate,@goCommentGroup,@Spell
|
||||
if s:FoldEnable('comment')
|
||||
syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell fold
|
||||
syn match goComment "\v(^\s*//.*\n)+" contains=goGenerate,@goCommentGroup,@Spell fold
|
||||
else
|
||||
syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell
|
||||
endif
|
||||
|
||||
hi def link goComment Comment
|
||||
hi def link goTodo Todo
|
||||
|
||||
if s:HighlightGenerateTags()
|
||||
syn match goGenerateVariables contained /\%(\$GOARCH\|\$GOOS\|\$GOFILE\|\$GOLINE\|\$GOPACKAGE\|\$DOLLAR\)\>/
|
||||
syn region goGenerate start="^\s*//go:generate" end="$" contains=goGenerateVariables
|
||||
hi def link goGenerate PreProc
|
||||
hi def link goGenerateVariables Special
|
||||
endif
|
||||
|
||||
" Go escapes
|
||||
syn match goEscapeOctal display contained "\\[0-7]\{3}"
|
||||
syn match goEscapeC display contained +\\[abfnrtv\\'"]+
|
||||
@ -118,8 +179,30 @@ hi def link goEscapeError Error
|
||||
|
||||
" Strings and their contents
|
||||
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
|
||||
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
|
||||
syn region goRawString start=+`+ end=+`+
|
||||
if s:HighlightStringSpellcheck()
|
||||
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup,@Spell
|
||||
syn region goRawString start=+`+ end=+`+ contains=@Spell
|
||||
else
|
||||
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
|
||||
syn region goRawString start=+`+ end=+`+
|
||||
endif
|
||||
|
||||
if s:HighlightFormatStrings()
|
||||
" [n] notation is valid for specifying explicit argument indexes
|
||||
" 1. Match a literal % not preceded by a %.
|
||||
" 2. Match any number of -, #, 0, space, or +
|
||||
" 3. Match * or [n]* or any number or nothing before a .
|
||||
" 4. Match * or [n]* or any number or nothing after a .
|
||||
" 5. Match [n] or nothing before a verb
|
||||
" 6. Match a formatting verb
|
||||
syn match goFormatSpecifier /\
|
||||
\%([^%]\%(%%\)*\)\
|
||||
\@<=%[-#0 +]*\
|
||||
\%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\
|
||||
\%(\.\%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\)\=\
|
||||
\%(\[\d\+\]\)\=[vTtbcdoqxXUeEfFgGspw]/ contained containedin=goString,goRawString
|
||||
hi def link goFormatSpecifier goSpecialString
|
||||
endif
|
||||
|
||||
hi def link goString String
|
||||
hi def link goRawString String
|
||||
@ -131,71 +214,263 @@ syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=
|
||||
hi def link goCharacter Character
|
||||
|
||||
" Regions
|
||||
syn region goBlock start="{" end="}" transparent fold
|
||||
syn region goParen start='(' end=')' transparent
|
||||
if s:FoldEnable('block')
|
||||
syn region goBlock start="{" end="}" transparent fold
|
||||
else
|
||||
syn region goBlock start="{" end="}" transparent
|
||||
endif
|
||||
|
||||
" import
|
||||
if s:FoldEnable('import')
|
||||
syn region goImport start='import (' end=')' transparent fold contains=goImport,goString,goComment
|
||||
else
|
||||
syn region goImport start='import (' end=')' transparent contains=goImport,goString,goComment
|
||||
endif
|
||||
|
||||
" var, const
|
||||
if s:FoldEnable('varconst')
|
||||
syn region goVar start='var (' end='^\s*)$' transparent fold
|
||||
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
|
||||
syn region goConst start='const (' end='^\s*)$' transparent fold
|
||||
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
|
||||
else
|
||||
syn region goVar start='var (' end='^\s*)$' transparent
|
||||
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
|
||||
syn region goConst start='const (' end='^\s*)$' transparent
|
||||
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
|
||||
endif
|
||||
|
||||
" Single-line var, const, and import.
|
||||
syn match goSingleDecl /\%(import\|var\|const\) [^(]\@=/ contains=goImport,goVar,goConst
|
||||
|
||||
" Integers
|
||||
syn match goDecimalInt "\<\d\+\([Ee]\d\+\)\?\>"
|
||||
syn match goHexadecimalInt "\<0x\x\+\>"
|
||||
syn match goOctalInt "\<0\o\+\>"
|
||||
syn match goOctalError "\<0\o*[89]\d*\>"
|
||||
syn match goDecimalInt "\<-\=\(0\|[1-9]_\?\(\d\|\d\+_\?\d\+\)*\)\%([Ee][-+]\=\d\+\)\=\>"
|
||||
syn match goDecimalError "\<-\=\(_\(\d\+_*\)\+\|\([1-9]\d*_*\)\+__\(\d\+_*\)\+\|\([1-9]\d*_*\)\+_\+\)\%([Ee][-+]\=\d\+\)\=\>"
|
||||
syn match goHexadecimalInt "\<-\=0[xX]_\?\(\x\+_\?\)\+\>"
|
||||
syn match goHexadecimalError "\<-\=0[xX]_\?\(\x\+_\?\)*\(\([^ \t0-9A-Fa-f_)]\|__\)\S*\|_\)\>"
|
||||
syn match goOctalInt "\<-\=0[oO]\?_\?\(\o\+_\?\)\+\>"
|
||||
syn match goOctalError "\<-\=0[0-7oO_]*\(\([^ \t0-7oOxX_/)\]\}\:]\|[oO]\{2,\}\|__\)\S*\|_\|[oOxX]\)\>"
|
||||
syn match goBinaryInt "\<-\=0[bB]_\?\([01]\+_\?\)\+\>"
|
||||
syn match goBinaryError "\<-\=0[bB]_\?[01_]*\([^ \t01_)]\S*\|__\S*\|_\)\>"
|
||||
|
||||
hi def link goDecimalInt Integer
|
||||
hi def link goDecimalError Error
|
||||
hi def link goHexadecimalInt Integer
|
||||
hi def link goHexadecimalError Error
|
||||
hi def link goOctalInt Integer
|
||||
hi def link goOctalError Error
|
||||
hi def link goBinaryInt Integer
|
||||
hi def link goBinaryError Error
|
||||
hi def link Integer Number
|
||||
|
||||
" Floating point
|
||||
syn match goFloat "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>"
|
||||
syn match goFloat "\<\.\d\+\([Ee][-+]\d\+\)\?\>"
|
||||
syn match goFloat "\<\d\+[Ee][-+]\d\+\>"
|
||||
syn match goFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=\>"
|
||||
syn match goFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=\>"
|
||||
|
||||
hi def link goFloat Float
|
||||
|
||||
" Imaginary literals
|
||||
syn match goImaginary "\<\d\+i\>"
|
||||
syn match goImaginary "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>"
|
||||
syn match goImaginary "\<\.\d\+\([Ee][-+]\d\+\)\?i\>"
|
||||
syn match goImaginary "\<\d\+[Ee][-+]\d\+i\>"
|
||||
syn match goImaginary "\<-\=\d\+i\>"
|
||||
syn match goImaginary "\<-\=\d\+[Ee][-+]\=\d\+i\>"
|
||||
syn match goImaginaryFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=i\>"
|
||||
syn match goImaginaryFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=i\>"
|
||||
|
||||
hi def link goImaginary Number
|
||||
hi def link goImaginaryFloat Float
|
||||
|
||||
" Spaces after "[]"
|
||||
if go_highlight_array_whitespace_error != 0
|
||||
syn match goSpaceError display "\(\[\]\)\@<=\s\+"
|
||||
if s:HighlightArrayWhitespaceError()
|
||||
syn match goSpaceError display "\%(\[\]\)\@<=\s\+"
|
||||
endif
|
||||
|
||||
" Spacing errors around the 'chan' keyword
|
||||
if go_highlight_chan_whitespace_error != 0
|
||||
if s:HighlightChanWhitespaceError()
|
||||
" receive-only annotation on chan type
|
||||
syn match goSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@="
|
||||
"
|
||||
" \(\<chan\>\)\@<!<- (only pick arrow when it doesn't come after a chan)
|
||||
" this prevents picking up 'chan<- chan<-' but not '<- chan'
|
||||
syn match goSpaceError display "\%(\%(\<chan\>\)\@<!<-\)\@<=\s\+\%(\<chan\>\)\@="
|
||||
|
||||
" send-only annotation on chan type
|
||||
syn match goSpaceError display "\(\<chan\)\@<=\s\+\(<-\)\@="
|
||||
"
|
||||
" \(<-\)\@<!\<chan\> (only pick chan when it doesn't come after an arrow)
|
||||
" this prevents picking up '<-chan <-chan' but not 'chan <-'
|
||||
syn match goSpaceError display "\%(\%(<-\)\@<!\<chan\>\)\@<=\s\+\%(<-\)\@="
|
||||
|
||||
" value-ignoring receives in a few contexts
|
||||
syn match goSpaceError display "\(\(^\|[={(,;]\)\s*<-\)\@<=\s\+"
|
||||
syn match goSpaceError display "\%(\%(^\|[={(,;]\)\s*<-\)\@<=\s\+"
|
||||
endif
|
||||
|
||||
" Extra types commonly seen
|
||||
if go_highlight_extra_types != 0
|
||||
syn match goExtraType /\<bytes\.\(Buffer\)\>/
|
||||
syn match goExtraType /\<io\.\(Reader\|Writer\|ReadWriter\|ReadWriteCloser\)\>/
|
||||
syn match goExtraType /\<reflect\.\(Kind\|Type\|Value\)\>/
|
||||
if s:HighlightExtraTypes()
|
||||
syn match goExtraType /\<bytes\.\%(Buffer\)\>/
|
||||
syn match goExtraType /\<context\.\%(Context\)\>/
|
||||
syn match goExtraType /\<io\.\%(Reader\|ReadSeeker\|ReadWriter\|ReadCloser\|ReadWriteCloser\|Writer\|WriteCloser\|Seeker\)\>/
|
||||
syn match goExtraType /\<reflect\.\%(Kind\|Type\|Value\)\>/
|
||||
syn match goExtraType /\<unsafe\.Pointer\>/
|
||||
endif
|
||||
|
||||
" Space-tab error
|
||||
if go_highlight_space_tab_error != 0
|
||||
if s:HighlightSpaceTabError()
|
||||
syn match goSpaceError display " \+\t"me=e-1
|
||||
endif
|
||||
|
||||
" Trailing white space error
|
||||
if go_highlight_trailing_whitespace_error != 0
|
||||
if s:HighlightTrailingWhitespaceError()
|
||||
syn match goSpaceError display excludenl "\s\+$"
|
||||
endif
|
||||
|
||||
hi def link goExtraType Type
|
||||
hi def link goSpaceError Error
|
||||
|
||||
|
||||
|
||||
" included from: https://github.com/athom/more-colorful.vim/blob/master/after/syntax/go.vim
|
||||
"
|
||||
" Comments; their contents
|
||||
syn keyword goTodo contained NOTE
|
||||
hi def link goTodo Todo
|
||||
|
||||
syn match goVarArgs /\.\.\./
|
||||
|
||||
" Operators;
|
||||
if s:HighlightOperators()
|
||||
" match single-char operators: - + % < > ! & | ^ * =
|
||||
" and corresponding two-char operators: -= += %= <= >= != &= |= ^= *= ==
|
||||
syn match goOperator /[-+%<>!&|^*=]=\?/
|
||||
" match / and /=
|
||||
syn match goOperator /\/\%(=\|\ze[^/*]\)/
|
||||
" match two-char operators: << >> &^
|
||||
" and corresponding three-char operators: <<= >>= &^=
|
||||
syn match goOperator /\%(<<\|>>\|&^\)=\?/
|
||||
" match remaining two-char operators: := && || <- ++ --
|
||||
syn match goOperator /:=\|||\|<-\|++\|--/
|
||||
" match ...
|
||||
|
||||
hi def link goPointerOperator goOperator
|
||||
hi def link goVarArgs goOperator
|
||||
endif
|
||||
hi def link goOperator Operator
|
||||
|
||||
" Functions;
|
||||
if s:HighlightFunctions() || s:HighlightFunctionParameters()
|
||||
syn match goDeclaration /\<func\>/ nextgroup=goReceiver,goFunction,goSimpleParams skipwhite skipnl
|
||||
syn match goReceiverVar /\w\+\ze\s\+\%(\w\|\*\)/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained
|
||||
syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl
|
||||
syn match goFunction /\w\+/ nextgroup=goSimpleParams contained skipwhite skipnl
|
||||
syn match goReceiverType /\w\+/ contained
|
||||
if s:HighlightFunctionParameters()
|
||||
syn match goSimpleParams /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType nextgroup=goFunctionReturn skipwhite skipnl
|
||||
syn match goFunctionReturn /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType skipwhite skipnl
|
||||
syn match goParamName /\w\+\%(\s*,\s*\w\+\)*\ze\s\+\%(\w\|\.\|\*\|\[\)/ contained nextgroup=goParamType skipwhite skipnl
|
||||
syn match goParamType /\%([^,)]\|\_s\)\+,\?/ contained nextgroup=goParamName skipwhite skipnl
|
||||
\ contains=goVarArgs,goType,goSignedInts,goUnsignedInts,goFloats,goComplexes,goDeclType,goBlock
|
||||
hi def link goReceiverVar goParamName
|
||||
hi def link goParamName Identifier
|
||||
endif
|
||||
syn match goReceiver /(\s*\w\+\%(\s\+\*\?\s*\w\+\)\?\s*)\ze\s*\w/ contained nextgroup=goFunction contains=goReceiverVar skipwhite skipnl
|
||||
else
|
||||
syn keyword goDeclaration func
|
||||
endif
|
||||
hi def link goFunction Function
|
||||
|
||||
" Function calls;
|
||||
if s:HighlightFunctionCalls()
|
||||
syn match goFunctionCall /\w\+\ze(/ contains=goBuiltins,goDeclaration
|
||||
endif
|
||||
hi def link goFunctionCall Type
|
||||
|
||||
" Fields;
|
||||
if s:HighlightFields()
|
||||
" 1. Match a sequence of word characters coming after a '.'
|
||||
" 2. Require the following but dont match it: ( \@= see :h E59)
|
||||
" - The symbols: / - + * % OR
|
||||
" - The symbols: [] {} <> ) OR
|
||||
" - The symbols: \n \r space OR
|
||||
" - The symbols: , : .
|
||||
" 3. Have the start of highlight (hs) be the start of matched
|
||||
" pattern (s) offsetted one to the right (+1) (see :h E401)
|
||||
syn match goField /\.\w\+\
|
||||
\%(\%([\/\-\+*%]\)\|\
|
||||
\%([\[\]{}<\>\)]\)\|\
|
||||
\%([\!=\^|&]\)\|\
|
||||
\%([\n\r\ ]\)\|\
|
||||
\%([,\:.]\)\)\@=/hs=s+1
|
||||
endif
|
||||
hi def link goField Identifier
|
||||
|
||||
" Structs & Interfaces;
|
||||
if s:HighlightTypes()
|
||||
syn match goTypeConstructor /\<\w\+{\@=/
|
||||
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
|
||||
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
|
||||
syn match goDeclType /\<\%(interface\|struct\)\>/ skipwhite skipnl
|
||||
hi def link goReceiverType Type
|
||||
else
|
||||
syn keyword goDeclType struct interface
|
||||
syn keyword goDeclaration type
|
||||
endif
|
||||
hi def link goTypeConstructor Type
|
||||
hi def link goTypeName Type
|
||||
hi def link goTypeDecl Keyword
|
||||
hi def link goDeclType Keyword
|
||||
|
||||
" Variable Assignments
|
||||
if s:HighlightVariableAssignments()
|
||||
syn match goVarAssign /\v[_.[:alnum:]]+(,\s*[_.[:alnum:]]+)*\ze(\s*([-^+|^\/%&]|\*|\<\<|\>\>|\&\^)?\=[^=])/
|
||||
hi def link goVarAssign Special
|
||||
endif
|
||||
|
||||
" Variable Declarations
|
||||
if s:HighlightVariableDeclarations()
|
||||
syn match goVarDefs /\v\w+(,\s*\w+)*\ze(\s*:\=)/
|
||||
hi def link goVarDefs Special
|
||||
endif
|
||||
|
||||
" Build Constraints
|
||||
if s:HighlightBuildConstraints()
|
||||
syn match goBuildKeyword display contained "+build"
|
||||
" Highlight the known values of GOOS, GOARCH, and other +build options.
|
||||
syn keyword goBuildDirectives contained
|
||||
\ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9
|
||||
\ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64
|
||||
\ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc
|
||||
\ s390 s390x sparc sparc64 cgo ignore race
|
||||
|
||||
" Other words in the build directive are build tags not listed above, so
|
||||
" avoid highlighting them as comments by using a matchgroup just for the
|
||||
" start of the comment.
|
||||
" The rs=s+2 option lets the \s*+build portion be part of the inner region
|
||||
" instead of the matchgroup so it will be highlighted as a goBuildKeyword.
|
||||
syn region goBuildComment matchgroup=goBuildCommentStart
|
||||
\ start="//\s*+build\s"rs=s+2 end="$"
|
||||
\ contains=goBuildKeyword,goBuildDirectives
|
||||
hi def link goBuildCommentStart Comment
|
||||
hi def link goBuildDirectives Type
|
||||
hi def link goBuildKeyword PreProc
|
||||
endif
|
||||
|
||||
if s:HighlightBuildConstraints() || s:FoldEnable('package_comment')
|
||||
" One or more line comments that are followed immediately by a "package"
|
||||
" declaration are treated like package documentation, so these must be
|
||||
" matched as comments to avoid looking like working build constraints.
|
||||
" The he, me, and re options let the "package" itself be highlighted by
|
||||
" the usual rules.
|
||||
exe 'syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/'
|
||||
\ . ' end=/\v\n\s*package/he=e-7,me=e-7,re=e-7'
|
||||
\ . ' contains=@goCommentGroup,@Spell'
|
||||
\ . (s:FoldEnable('package_comment') ? ' fold' : '')
|
||||
exe 'syn region goPackageComment start=/\v^\s*\/\*.*\n(.*\n)*\s*\*\/\npackage/'
|
||||
\ . ' end=/\v\*\/\n\s*package/he=e-7,me=e-7,re=e-7'
|
||||
\ . ' contains=@goCommentGroup,@Spell'
|
||||
\ . (s:FoldEnable('package_comment') ? ' fold' : '')
|
||||
hi def link goPackageComment Comment
|
||||
endif
|
||||
|
||||
" :GoCoverage commands
|
||||
hi def link goCoverageNormalText Comment
|
||||
|
||||
" Search backwards for a global declaration to start processing the syntax.
|
||||
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
|
||||
|
||||
@ -203,6 +478,9 @@ hi def link goSpaceError Error
|
||||
" following as a more expensive/less precise workaround.
|
||||
syn sync minlines=500
|
||||
|
||||
let b:current_syntax = 'go'
|
||||
let b:current_syntax = "go"
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" vim: sw=2 sts=2 et
|
||||
|
85
runtime/syntax/gvpr.vim
Normal file
85
runtime/syntax/gvpr.vim
Normal file
@ -0,0 +1,85 @@
|
||||
" Vim syntax file
|
||||
" Language: Graphviz program
|
||||
" Maintainer: Matthew Fernandez <matthew.fernandez@gmail.com>
|
||||
" Last Change: Tue, 28 Jul 2020 17:20:44 -0700
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn keyword gvArg ARGC ARGV
|
||||
syn keyword gvBeg BEGIN BEG_G N E END END_G
|
||||
syn keyword gvFunc
|
||||
\ graph fstsubg isDirect isStrict isSubg nEdges nNodes nxtsubg subg
|
||||
\ degreeOf fstnode indegreeOf isNode isSubnode node nxtnode nxtnode_sg
|
||||
\ outDegreeOf subnode
|
||||
\ edge edge_sg fstedge fstedge_sg fstin fstin_sg fstout fstout_sg isEdge
|
||||
\ isEdge_sg isSubedge nxtedge nxtedge_sg nxtin nxtin_sg nxtout nxtout_sg opp
|
||||
\ subedge
|
||||
\ freadG fwriteG readG write[] writeG
|
||||
\ aget aset clone cloneG compOf copy[] copyA delete[] fstAttr getDflt hasAttr
|
||||
\ induce isAttr isIn kindOf lock[] nxtAttr setDflt
|
||||
\ canon gsub html index ishtml length llOf match[] rindex split[] sprintf
|
||||
\ sscanf strcmp sub substr tokens tolower toupper urOf xOf yOf
|
||||
\ closeF openF print[] printf scanf readL
|
||||
\ atan2 cos exp log MAX MIN pow sin[] sqrt
|
||||
\ in[] unset
|
||||
\ colorx exit[] rand srand system
|
||||
syn keyword gvCons
|
||||
\ NULL TV_bfs TV_dfs TV_en TV_flat TV_fwd TV_ne TV_prepostdfs TV_prepostfwd
|
||||
\ TV_prepostrev TV_postdfs TV_postfwd tv_postrev TV_rev
|
||||
syn keyword gvType char double float int long unsigned void
|
||||
\ string
|
||||
\ edge_t graph_t node_t obj_t
|
||||
syn match gvVar
|
||||
\ "\$\(\(F\|G\|NG\|O\|T\|tgtname\|tvedge\|tvnext\|tvroot\|tvtype\)\>\)\?\(\<\)\@!"
|
||||
syn keyword gvWord break continue else for forr if return switch while
|
||||
|
||||
" numbers adapted from c.vim's cNumbers and friends
|
||||
syn match gvNums transparent "\<\d\|\.\d" contains=gvNumber,gvFloat,gvOctal
|
||||
syn match gvNumber contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
|
||||
syn match gvNumber contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
|
||||
syn match gvOctal contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=gvOctalZero
|
||||
syn match gvOctalZero contained "\<0"
|
||||
syn match gvFloat contained "\d\+f"
|
||||
syn match gvFloat contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
|
||||
syn match gvFloat contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
|
||||
syn match gvFloat contained "\d\+e[-+]\=\d\+[fl]\=\>"
|
||||
|
||||
syn region gvString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=gvFormat,gvSpecial extend
|
||||
syn region gvString start="'" skip="\\\\\|\\'" end="'" contains=gvFormat,gvSpecial extend
|
||||
|
||||
" adapted from c.vim's cFormat for c_no_c99
|
||||
syn match gvFormat "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
||||
|
||||
syn match gvSpecial "\\." contained
|
||||
|
||||
syn region gvCComment start="//" skip="\\$" end="$" keepend
|
||||
syn region gvCPPComment start="#" skip="\\$" end="$" keepend
|
||||
syn region gvCXXComment start="/\*" end="\*/" fold
|
||||
|
||||
hi def link gvArg Identifier
|
||||
hi def link gvBeg Keyword
|
||||
hi def link gvFloat Number
|
||||
hi def link gvFunc Identifier
|
||||
hi def link gvCons Number
|
||||
hi def link gvNumber Number
|
||||
hi def link gvType Type
|
||||
hi def link gvVar Statement
|
||||
hi def link gvWord Keyword
|
||||
|
||||
hi def link gvString String
|
||||
hi def link gvFormat Special
|
||||
hi def link gvSpecial Special
|
||||
|
||||
hi def link gvCComment Comment
|
||||
hi def link gvCPPComment Comment
|
||||
hi def link gvCXXComment Comment
|
||||
|
||||
let b:current_syntax = "gvpr"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim help file
|
||||
" Maintainer: Bram Moolenaar (Bram@vim.org)
|
||||
" Last Change: 2020 Jul 28
|
||||
" Last Change: 2021 Jun 13
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@ -76,6 +76,7 @@ syn match helpSpecial "\[line]"
|
||||
syn match helpSpecial "\[count]"
|
||||
syn match helpSpecial "\[offset]"
|
||||
syn match helpSpecial "\[cmd]"
|
||||
syn match helpNormal "vim9\[cmd]"
|
||||
syn match helpSpecial "\[num]"
|
||||
syn match helpSpecial "\[+num]"
|
||||
syn match helpSpecial "\[-num]"
|
||||
|
44
runtime/syntax/jsonc.vim
Normal file
44
runtime/syntax/jsonc.vim
Normal file
@ -0,0 +1,44 @@
|
||||
" Vim syntax file
|
||||
" Language: JSONC (JSON with Comments)
|
||||
" Original Author: Izhak Jakov <izhak724@gmail.com>
|
||||
" Acknowledgement: Based off of vim-jsonc maintained by Kevin Locke <kevin@kevinlocke.name>
|
||||
" https://github.com/kevinoid/vim-jsonc
|
||||
" License: MIT
|
||||
" Last Change: 2021-07-01
|
||||
|
||||
" Ensure syntax is loaded once, unless nested inside another (main) syntax
|
||||
" For description of main_syntax, see https://stackoverflow.com/q/16164549
|
||||
if !exists('g:main_syntax')
|
||||
if exists('b:current_syntax') && b:current_syntax ==# 'jsonc'
|
||||
finish
|
||||
endif
|
||||
let g:main_syntax = 'jsonc'
|
||||
endif
|
||||
|
||||
" Based on vim-json syntax
|
||||
runtime! syntax/json.vim
|
||||
|
||||
" Remove syntax group for comments treated as errors
|
||||
if !exists("g:vim_json_warnings") || g:vim_json_warnings
|
||||
syn clear jsonCommentError
|
||||
endif
|
||||
|
||||
syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze\(\_s*\/\/.*\_s*\)*[}\]]/ contains=jsonString
|
||||
syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze\_s*\/\*\_.*\*\/\_s*[}\]]/ contains=jsonString
|
||||
syn match jsonTrailingCommaError /\(,\)\+\ze\(\_s*\/\/.*\_s*\)*[}\]]/
|
||||
syn match jsonTrailingCommaError /\(,\)\+\ze\_s*\/\*\_.*\*\/\_s*[}\]]/
|
||||
|
||||
" Define syntax matching comments and their contents
|
||||
syn keyword jsonCommentTodo FIXME NOTE TBD TODO XXX
|
||||
syn region jsonLineComment start=+\/\/+ end=+$+ contains=@Spell,jsonCommentTodo keepend
|
||||
syn region jsonComment start='/\*' end='\*/' contains=@Spell,jsonCommentTodo fold
|
||||
|
||||
" Link comment syntax comment to highlighting
|
||||
hi! def link jsonLineComment Comment
|
||||
hi! def link jsonComment Comment
|
||||
|
||||
" Set/Unset syntax to avoid duplicate inclusion and correctly handle nesting
|
||||
let b:current_syntax = 'jsonc'
|
||||
if g:main_syntax ==# 'jsonc'
|
||||
unlet g:main_syntax
|
||||
endif
|
@ -3,7 +3,7 @@
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainers: Xavier Crégut <xavier.cregut@enseeiht.fr>
|
||||
" Mario Eusebio <bio@dq.fct.unl.pt>
|
||||
" Last Change: 2021 Apr 23
|
||||
" Last Change: 2021 May 20
|
||||
|
||||
" Contributors: Tim Chase <tchase@csc.com>,
|
||||
" Stas Grabois <stsi@vtrails.com>,
|
||||
|
@ -3,7 +3,7 @@
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2019 Jul 13
|
||||
" Last Change: 2021 Jun 06
|
||||
" ----------------------------------------------------------------------------
|
||||
"
|
||||
" Previous Maintainer: Mirko Nasato
|
||||
@ -66,7 +66,7 @@ endfunction
|
||||
com! -nargs=* SynFold call s:run_syntax_fold(<q-args>)
|
||||
|
||||
" Not-Top Cluster {{{1
|
||||
syn cluster rubyNotTop contains=@rubyCommentNotTop,@rubyStringNotTop,@rubyRegexpSpecial,@rubyDeclaration,@rubyExceptionHandler,@rubyClassOperator,rubyConditional,rubyModuleName,rubyClassName,rubySymbolDelimiter,rubyParentheses
|
||||
syn cluster rubyNotTop contains=@rubyCommentNotTop,@rubyStringNotTop,@rubyRegexpSpecial,@rubyDeclaration,@rubyExceptionHandler,@rubyClassOperator,rubyConditional,rubyModuleName,rubyClassName,rubySymbolDelimiter,rubyParentheses,@Spell
|
||||
|
||||
" Whitespace Errors {{{1
|
||||
if exists("ruby_space_errors")
|
||||
@ -92,7 +92,7 @@ if exists("ruby_operators") || exists("ruby_pseudo_operators")
|
||||
syn match rubyBooleanOperator "\%(\w\|[^\x00-\x7F]\)\@1<!!\|&&\|||"
|
||||
syn match rubyRangeOperator "\.\.\.\="
|
||||
syn match rubyAssignmentOperator "=>\@!\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|||=\||=\|%=\|+=\|>>=\|<<=\|\^="
|
||||
syn match rubyAssignmentOperator "=>\@!" containedin=rubyBlockParameterList " TODO: this is inelegant
|
||||
syn match rubyAssignmentOperator "=>\@!" contained containedin=rubyBlockParameterList " TODO: this is inelegant
|
||||
syn match rubyEqualityOperator "===\|==\|!=\|!\~\|=\~"
|
||||
|
||||
syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\%(\w\|[^\x00-\x7F]\)[?!]\=\|[]})]\)\@2<=\[" end="]" contains=ALLBUT,@rubyNotTop
|
||||
@ -134,10 +134,10 @@ syn match rubyCurlyBraceEscape "\\[{}]" contained display
|
||||
syn match rubyAngleBracketEscape "\\[<>]" contained display
|
||||
syn match rubySquareBracketEscape "\\[[\]]" contained display
|
||||
|
||||
syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained
|
||||
syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained
|
||||
syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained
|
||||
syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained
|
||||
syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" end=")" transparent contained
|
||||
syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" end="}" transparent contained
|
||||
syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" end=">" transparent contained
|
||||
syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" end="\]" transparent contained
|
||||
|
||||
syn cluster rubySingleCharEscape contains=rubyBackslashEscape,rubyQuoteEscape,rubySpaceEscape,rubyParenthesisEscape,rubyCurlyBraceEscape,rubyAngleBracketEscape,rubySquareBracketEscape
|
||||
syn cluster rubyNestedBrackets contains=rubyNested.\+
|
||||
@ -193,7 +193,7 @@ SynFold ':' syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':
|
||||
|
||||
syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@="
|
||||
|
||||
syn region rubyParentheses start="(" end=")" contains=ALLBUT,@rubyNotTop containedin=rubyBlockParameterList
|
||||
syn region rubyParentheses start="(" end=")" contains=ALLBUT,@rubyNotTop contained containedin=rubyBlockParameterList
|
||||
syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\_s*\)\@32<=|" end="|" contains=ALLBUT,@rubyNotTop,@rubyProperOperator
|
||||
|
||||
if exists('ruby_global_variable_error')
|
||||
@ -332,7 +332,7 @@ SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([
|
||||
syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,@rubyGlobalVariable nextgroup=rubyAliasDeclaration2 skipwhite
|
||||
syn match rubyAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=rubySymbol,@rubyGlobalVariable
|
||||
syn match rubyMethodDeclaration "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable
|
||||
syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyClassName,rubyScopeOperator nextgroup=rubySuperClassOperator skipwhite skipnl
|
||||
syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyClassName,rubyScopeOperator nextgroup=rubySuperClassOperator skipwhite
|
||||
syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyModuleName,rubyScopeOperator
|
||||
|
||||
syn match rubyMethodName "\<\%([_[:alpha:]]\|[^\x00-\x7F]\)\%([_[:alnum:]]\|[^\x00-\x7F]\)*[?!=]\=\%([[:alnum:]_.:?!=]\|[^\x00-\x7F]\)\@!" contained containedin=rubyMethodDeclaration
|
||||
@ -462,7 +462,7 @@ endif
|
||||
syn match rubyDefinedOperator "\%#=1\<defined?" display
|
||||
|
||||
" 1.9-style Hash Keys and Keyword Parameters {{{1
|
||||
syn match rubySymbol "\%([{(|,]\_s*\)\@<=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[?!]\=::\@!"he=e-1
|
||||
syn match rubySymbol "\%(\w\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[?!]\=::\@!"he=e-1 contained containedin=rubyBlockParameterList,rubyCurlyBlock
|
||||
syn match rubySymbol "[]})\"':]\@1<!\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],;]\@="he=e-1
|
||||
syn match rubySymbol "[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],;]\@="hs=s+1,he=e-1
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim 8.2 script
|
||||
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" Last Change: May 20, 2021
|
||||
" Version: 8.2-03
|
||||
" Last Change: June 20, 2021
|
||||
" Version: 8.2-06
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
|
||||
" Automatically generated keyword lists: {{{1
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo= &cpo
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" vimTodo: contains common special-notices for comments {{{2
|
||||
@ -19,12 +19,12 @@ syn keyword vimTodo contained COMBAK FIXME TODO XXX
|
||||
syn cluster vimCommentGroup contains=vimTodo,@Spell
|
||||
|
||||
" regular vim commands {{{2
|
||||
syn keyword vimCommand contained a ar[gs] argl[ocal] ba[ll] bl[ast] brea[k] buffers ca caf[ter] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cn[ext] colo[rscheme] cons[t] cs d[elete] delel delf[unction] dif[fupdate] difft[his] dli[st] ds[earch] echoc[onsole] em[enu] endw[hile] export filt[er] fo[ld] fu[nction] gvim helpt[ags] iabc[lear] import isp[lit] keepa l[ist] laf[ter] lbel[ow] lcscope lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] mkvie[w] nbc[lose] noh[lsearch] ol[dfiles] pa[ckadd] po[p] prof[ile] pta[g] ptr[ewind] py3f[ile] pythonx quita[ll] redraws[tatus] rew[ind] rubyf[ile] sIg sa[rgument] sba[ll] sbr[ewind] scl scscope sfir[st] sgl sic sin sm[ap] snoreme spelld[ump] spellw[rong] srg sta[g] sts[elect] sus[pend] syncbind tabN[ext] tabl[ast] tabr[ewind] tcld[o] tj[ump] tlu tno[remap] tu[nmenu] undol[ist] v vie[w] vmapc[lear] wa[ll] winp[os] wundo xme xr[estore]
|
||||
syn keyword vimCommand contained a ar[gs] argl[ocal] ba[ll] bl[ast] brea[k] buffers ca caf[ter] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cn[ext] colo[rscheme] cons[t] cs d[elete] delel delf[unction] dif[fupdate] difft[his] dli[st] ds[earch] echoc[onsole] em[enu] endw[hile] export filt[er] fo[ld] fu[nction] gvim helpt[ags] iabc[lear] import isp[lit] keepa l[ist] laf[ter] lbel[ow] lcscope lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] mkvie[w] nbc[lose] noh[lsearch] ol[dfiles] pa[ckadd] po[p] prof[ile] pta[g] ptr[ewind] py3f[ile] pythonx quita[ll] redraws[tatus] rew[ind] rubyf[ile] sIg sa[rgument] sba[ll] sbr[ewind] scl scscope sfir[st] sgl sic sin sm[ap] snoreme spelld[ump] spellw[rong] srg sta[g] sts[elect] sus[pend] syncbind tabN[ext] tabl[ast] tabr[ewind] tcld[o] tj[ump] tlu tno[remap] tu[nmenu] undol[ist] v vie[w] viu[sage] wa[ll] winp[os] wundo xme xr[estore]
|
||||
syn keyword vimCommand contained ab arga[dd] argu[ment] bad[d] bm[odified] breaka[dd] bun[load] cabc[lear] cal[l] cc cf[ile] changes cla[st] cnew[er] com cope[n] cscope debug delep dell diffg[et] dig[raphs] do dsp[lit] echoe[rr] en[dif] ene[w] exu[sage] fin[d] foldc[lose] g h[elp] hi if in iuna[bbrev] keepalt la[st] lan[guage] lbo[ttom] ld[o] lfdo lgrepa[dd] lma lo[adview] lop[en] lua m[ove] mes[sages] mod[e] nbs[tart] nor omapc[lear] packl[oadall] popu[p] profd[el] ptf[irst] pts[elect] py3f[ile] pyx r[ead] redrawt[abline] ri[ght] rundo sIl sal[l] sbf[irst] sc scp se[t] sg sgn sie sip sme snoremenu spelli[nfo] spr[evious] sri star[tinsert] substitutepattern sv[iew] syntime tabc[lose] tabm[ove] tabs tclf[ile] tl[ast] tlunmenu to[pleft] tunma[p] unh[ide] var vim9[cmd] vne[w] wh[ile] wn[ext] wv[iminfo] xmenu xunme
|
||||
syn keyword vimCommand contained abc[lear] argd[elete] as[cii] balt bn[ext] breakd[el] bw[ipeout] cabo[ve] cat[ch] ccl[ose] cfdo chd[ir] class cnf[ile] comc[lear] cp[revious] cstag debugg[reedy] deletel delm[arks] diffo[ff] dir doau e[dit] echom[sg] enddef eval f[ile] fina[lly] foldd[oopen] go[to] ha[rdcopy] hid[e] ij[ump] inor j[oin] keepj[umps] lab[ove] lat lc[d] le[ft] lfir[st] lh[elpgrep] lmak[e] loadk lp[revious] luado ma[rk] mk[exrc] mz[scheme] new nore on[ly] pc[lose] pp[op] promptf[ind] ptj[ump] pu[t] py[thon] pyxdo rec[over] reg[isters] rightb[elow] rv[iminfo] sIn san[dbox] sbl[ast] scI scr[iptnames] setf[iletype] sgI sgp sig sir smenu so[urce] spellr[are] sr srl startg[replace] substituterepeat sw[apname] t tabd[o] tabn[ext] tags te[aroff] tlm tm[enu] tp[revious] type unl ve[rsion] vim9s[cript] vs[plit] win[size] wp[revious] x[it] xnoreme xunmenu
|
||||
syn keyword vimCommand contained abo[veleft] argdo au bd[elete] bo[tright] breakl[ist] cN[ext] cad[dbuffer] cb[uffer] cd cfir[st] che[ckpath] cle[arjumps] cnor comp[iler] cpf[ile] cun def deletep delp diffp[atch] disa[ssemble] doaut ea echon endf[unction] ex files fini[sh] folddoc[losed] gr[ep] helpc[lose] his[tory] il[ist] interface ju[mps] keepp[atterns] lad[dexpr] later lch[dir] lefta[bove] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] mks[ession] mzf[ile] nmapc[lear] nos[wapfile] opt[ions] pe[rl] pre[serve] promptr[epl] ptl[ast] pw[d] pydo pyxfile red[o] res[ize] ru[ntime] sI sIp sav[eas] sbm[odified] sce scripte[ncoding] setg[lobal] sgc sgr sign sl[eep] smile sor[t] spellr[epall] srI srn startr[eplace] sun[hide] sy tN[ext] tabe[dit] tabnew tc[l] ter[minal] tlmenu tma[p] tr[ewind] u[ndo] unlo[ckvar] verb[ose] vim[grep] wN[ext] winc[md] wq xa[ll] xnoremenu xwininfo
|
||||
syn keyword vimCommand contained addd arge[dit] bN[ext] bel[owright] bp[revious] bro[wse] cNf[ile] cadde[xpr] cbe[fore] cdo cg[etfile] checkt[ime] clo[se] co[py] con[tinue] cq[uit] cuna[bbrev] defc[ompile] deletl dep diffpu[t] dj[ump] dp earlier el[se] endfo[r] exi[t] filet fir[st] foldo[pen] grepa[dd] helpf[ind] i imapc[lear] intro k lN[ext] laddb[uffer] lb[uffer] lcl[ose] leg[acy] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mksp[ell] n[ext] noa nu[mber] ownsyntax ped[it] prev[ious] ps[earch] ptn[ext] py3 pyf[ile] q[uit] redi[r] ret[ab] rub[y] sIc sIr sbN[ext] sbn[ext] scg scriptv[ersion] setl[ocal] sge sh[ell] sil[ent] sla[st] sn[ext] sp[lit] spellr[rare] src srp stj[ump] sunme syn ta[g] tabf[ind] tabo[nly] tcd tf[irst] tln tmapc[lear] try una[bbreviate] uns[ilent] vert[ical] vimgrepa[dd] w[rite] windo wqa[ll] xmapc[lear] xprop y[ank]
|
||||
syn keyword vimCommand contained al[l] argg[lobal] b[uffer] bf[irst] br[ewind] bufdo c[hange] caddf[ile] cbel[ow] ce[nter] cgetb[uffer] chi[story] cmapc[lear] col[der] conf[irm] cr[ewind] cw[indow] delc[ommand] deletp di[splay] diffs[plit] dl dr[op] ec elsei[f] endt[ry] exp filetype fix[del] for gui helpg[rep] ia imp is[earch] kee[pmarks] lNf[ile] laddf[ile] lbe[fore] lcs lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mkv[imrc] nb[key] noautocmd o[pen] p[rint] perld[o] pro ptN[ext] ptp[revious] py3do python3 qa[ll] redr[aw] retu[rn] rubyd[o] sIe sN[ext] sb[uffer] sbp[revious] sci scs sf[ind] sgi si sim[alt] sm[agic] sno[magic] spe[llgood] spellu[ndo] sre[wind] st[op] stopi[nsert] sunmenu sync tab tabfir[st] tabp[revious] tch[dir] th[row] tlnoremenu tn[ext] ts[elect] undoj[oin] up[date] vi[sual] viu[sage]
|
||||
syn keyword vimCommand contained abo[veleft] argdo au bd[elete] bo[tright] breakl[ist] cN[ext] cad[dbuffer] cb[uffer] cd cfir[st] che[ckpath] cle[arjumps] cnor comp[iler] cpf[ile] cun def deletep delp diffp[atch] disa[ssemble] doaut ea echon endf[unction] ex files fini[sh] folddoc[losed] gr[ep] helpc[lose] his[tory] il[ist] interface ju[mps] keepp[atterns] lad[dexpr] later lch[dir] lefta[bove] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] mks[ession] mzf[ile] nmapc[lear] nos[wapfile] opt[ions] pe[rl] pre[serve] promptr[epl] ptl[ast] pw[d] pydo pyxfile red[o] res[ize] ru[ntime] sI sIp sav[eas] sbm[odified] sce scripte[ncoding] setg[lobal] sgc sgr sign sl[eep] smile sor[t] spellr[epall] srI srn startr[eplace] sun[hide] sy tN[ext] tabe[dit] tabnew tc[d] ter[minal] tlmenu tma[p] tr[ewind] u[ndo] unlo[ckvar] verb[ose] vim[grep] wN[ext] winc[md] wq xa[ll] xnoremenu xwininfo
|
||||
syn keyword vimCommand contained addd arge[dit] bN[ext] bel[owright] bp[revious] bro[wse] cNf[ile] cadde[xpr] cbe[fore] cdo cg[etfile] checkt[ime] clo[se] co[py] con[tinue] cq[uit] cuna[bbrev] defc[ompile] deletl dep diffpu[t] dj[ump] dp earlier el[se] endfo[r] exi[t] filet fir[st] foldo[pen] grepa[dd] helpf[ind] i imapc[lear] intro k lN[ext] laddb[uffer] lb[uffer] lcl[ose] leg[acy] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mksp[ell] n[ext] noa nu[mber] ownsyntax ped[it] prev[ious] ps[earch] ptn[ext] py3 pyf[ile] q[uit] redi[r] ret[ab] rub[y] sIc sIr sbN[ext] sbn[ext] scg scriptv[ersion] setl[ocal] sge sh[ell] sil[ent] sla[st] sn[ext] sp[lit] spellr[rare] src srp stj[ump] sunme syn ta[g] tabf[ind] tabo[nly] tch[dir] tf[irst] tln tmapc[lear] try una[bbreviate] uns[ilent] vert[ical] vimgrepa[dd] w[rite] windo wqa[ll] xmapc[lear] xprop y[ank]
|
||||
syn keyword vimCommand contained al[l] argg[lobal] b[uffer] bf[irst] br[ewind] bufdo c[hange] caddf[ile] cbel[ow] ce[nter] cgetb[uffer] chi[story] cmapc[lear] col[der] conf[irm] cr[ewind] cw[indow] delc[ommand] deletp di[splay] diffs[plit] dl dr[op] ec elsei[f] endt[ry] exp filetype fix[del] for gui helpg[rep] ia imp is[earch] kee[pmarks] lNf[ile] laddf[ile] lbe[fore] lcs lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mkv[imrc] nb[key] noautocmd o[pen] p[rint] perld[o] pro ptN[ext] ptp[revious] py3do python3 qa[ll] redr[aw] retu[rn] rubyd[o] sIe sN[ext] sb[uffer] sbp[revious] sci scs sf[ind] sgi si sim[alt] sm[agic] sno[magic] spe[llgood] spellu[ndo] sre[wind] st[op] stopi[nsert] sunmenu sync tab tabfir[st] tabp[revious] tcl th[row] tlnoremenu tn[ext] ts[elect] undoj[oin] up[date] vi[sual]
|
||||
syn match vimCommand contained "\<z[-+^.=]\=\>"
|
||||
syn keyword vimStdPlugin contained Arguments Asm Break Cfilter Clear Continue DiffOrig Evaluate Finish Gdb Lfilter Man N[ext] Over P[rint] Program Run S Source Step Stop Termdebug TermdebugCommand TOhtml Winbar XMLent XMLns
|
||||
|
||||
@ -78,12 +78,12 @@ syn match vimHLGroup contained "Conceal"
|
||||
syn case match
|
||||
|
||||
" Function Names {{{2
|
||||
syn keyword vimFuncName contained abs argc assert_equal assert_match atan browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy echoraw eventhandler exp feedkeys findfile fmod foldlevel funcref getbufline getcharpos getcmdwintype getenv getftype getmarklist getqflist gettabvar getwinpos glob2regpat hasmapto hlexists index inputsave isdirectory job_getchannel job_stop json_encode line listener_flush luaeval mapset matchdelete matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prompt_setprompt prop_remove prop_type_list pyxeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setcharsearch setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_ignore_error test_null_job test_override test_srand_seed timer_start tr undofile visualmode win_execute winheight winnr win_splitmove
|
||||
syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete empty executable expand filereadable flatten fnameescape foldtext function getbufvar getcharsearch getcompletion getfontname getimstatus getmatches getreg gettabwinvar getwinposx globpath histadd hlID input inputsecret isinf job_info join keys line2byte listener_remove map match matchend matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_add prop_type_add pum_getpos rand readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_null_blob test_null_list test_refcount test_unknown timer_stop trim undotree wildmenumode win_findbuf win_id2tabwin winrestcmd winwidth
|
||||
syn keyword vimFuncName contained add arglistid assert_exception assert_notequal balloon_gettext bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline environ execute expandcmd filewritable flattennew fnamemodify foldtextresult garbagecollect getchangelist getcmdline getcurpos getfperm getjumplist getmousepos getreginfo gettagstack getwinposy has histdel hostname inputdialog insert islocked job_setoptions js_decode len lispindent localtime maparg matchadd matchfuzzy max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_getprompt prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_null_channel test_null_partial test_scrollbar test_void timer_stopall trunc uniq winbufnr win_getid win_id2win winrestview wordcount
|
||||
syn keyword vimFuncName contained and argv assert_fails assert_notmatch balloon_show buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype escape exepath extend filter float2nr foldclosed foreground get getchar getcmdpos getcursorcharpos getfsize getline getpid getregtype gettext getwinvar has_key histget iconv inputlist interrupt isnan job_start js_encode libcall list2str log mapcheck matchaddpos matchfuzzypos menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setcallback prop_find prop_type_delete py3eval readblob reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcellwidths setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_dict test_null_string test_setmouse timer_info tolower type values wincol win_gettype winlayout winsaveview writefile
|
||||
syn keyword vimFuncName contained append asin assert_false assert_report balloon_split bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler eval exists extendnew finddir floor foldclosedend fullcommand getbufinfo getcharmod getcmdtype getcwd getftime getloclist getpos gettabinfo getwininfo glob haslocaldir histnr indent inputrestore invert items job_status json_decode libcallnr listener_add log10 mapnew matcharg matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setinterrupt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_function test_option_not_set test_settime timer_pause toupper typename virtcol windowsversion win_gotoid winline win_screenpos xor
|
||||
syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID
|
||||
syn keyword vimFuncName contained abs argc assert_equal assert_match atan browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy echoraw executable expand filereadable flatten fnameescape foldtext function getbufvar getcharsearch getcmdwintype getenv getftype getmarklist getqflist gettabvar getwinpos glob2regpat hasmapto hlexists index inputsave isdirectory job_getchannel job_stop json_encode line listener_flush luaeval mapset matchdelete matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prompt_setprompt prop_remove prop_type_list pyxeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setcharsearch setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_ignore_error test_null_job test_override test_srand_seed timer_start tr undofile visualmode win_execute winheight winnr win_splitmove
|
||||
syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete empty execute expandcmd filewritable flattennew fnamemodify foldtextresult garbagecollect getchangelist getcharstr getcompletion getfontname getimstatus getmatches getreg gettabwinvar getwinposx globpath histadd hlID input inputsecret isinf job_info join keys line2byte listener_remove map match matchend matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_add prop_type_add pum_getpos rand readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_null_blob test_null_list test_refcount test_unknown timer_stop trim undotree wildmenumode win_findbuf win_id2tabwin winrestcmd winwidth
|
||||
syn keyword vimFuncName contained add arglistid assert_exception assert_notequal balloon_gettext bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline environ exepath extend filter float2nr foldclosed foreground get getchar getcmdline getcurpos getfperm getjumplist getmousepos getreginfo gettagstack getwinposy has histdel hostname inputdialog insert islocked job_setoptions js_decode len lispindent localtime maparg matchadd matchfuzzy max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_getprompt prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_null_channel test_null_partial test_scrollbar test_void timer_stopall trunc uniq winbufnr win_getid win_id2win winrestview wordcount
|
||||
syn keyword vimFuncName contained and argv assert_fails assert_notmatch balloon_show buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype escape exists extendnew finddir floor foldclosedend fullcommand getbufinfo getcharmod getcmdpos getcursorcharpos getfsize getline getpid getregtype gettext getwinvar has_key histget iconv inputlist interrupt isnan job_start js_encode libcall list2str log mapcheck matchaddpos matchfuzzypos menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setcallback prop_find prop_type_delete py3eval readblob reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcellwidths setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_dict test_null_string test_setmouse timer_info tolower type values wincol win_gettype winlayout winsaveview writefile
|
||||
syn keyword vimFuncName contained append asin assert_false assert_report balloon_split bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler eval exp feedkeys findfile fmod foldlevel funcref getbufline getcharpos getcmdtype getcwd getftime getloclist getpos gettabinfo getwininfo glob haslocaldir histnr indent inputrestore invert items job_status json_decode libcallnr listener_add log10 mapnew matcharg matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setinterrupt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_function test_option_not_set test_settime timer_pause toupper typename virtcol windowsversion win_gotoid winline win_screenpos xor
|
||||
syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID eventhandler
|
||||
|
||||
"--- syntax here and above generated by mkvimvim ---
|
||||
" Special Vim Highlighting (not automatic) {{{1
|
||||
@ -227,7 +227,7 @@ syn keyword vimAugroupKey contained aug[roup]
|
||||
|
||||
" Operators: {{{2
|
||||
" =========
|
||||
syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue,vim9Comment
|
||||
syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimType,vimRegister,vimContinue,vim9Comment
|
||||
syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
|
||||
syn match vimOper "\(\<is\|\<isnot\)[?#]\{0,2}\>" skipwhite nextgroup=vimString,vimSpecFile
|
||||
syn match vimOper "||\|&&\|[-+.!]" skipwhite nextgroup=vimString,vimSpecFile
|
||||
@ -241,12 +241,13 @@ endif
|
||||
" =========
|
||||
syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID
|
||||
syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimEnvvar,vimExecute,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLetHereDoc,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand
|
||||
syn match vimFunction "\<\(fu\%[nction]\|def\)!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
|
||||
syn match vimFunction "\<\(fu\%[nction]\)!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
|
||||
syn match vimFunction "\<def!\=\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
|
||||
|
||||
if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
|
||||
syn region vimFuncBody contained fold start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList
|
||||
else
|
||||
syn region vimFuncBody contained start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList
|
||||
syn region vimFuncBody contained start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList
|
||||
endif
|
||||
syn match vimFuncVar contained "a:\(\K\k*\|\d\+\)"
|
||||
syn match vimFuncSID contained "\c<sid>\|\<s:"
|
||||
@ -256,6 +257,9 @@ syn match vimFuncBlank contained "\s\+"
|
||||
|
||||
syn keyword vimPattern contained start skip end
|
||||
|
||||
" vimTypes : new for vim9
|
||||
syn match vimType ":\s*\zs\<\(bool\|number\|float\|string\|blob\|list<\|dict<\|job\|channel\|func\)\>"
|
||||
|
||||
" Special Filenames, Modifiers, Extension Removal: {{{2
|
||||
" ===============================================
|
||||
syn match vimSpecFile "<c\(word\|WORD\)>" nextgroup=vimSpecFileMod,vimSubst
|
||||
@ -384,7 +388,7 @@ syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1
|
||||
syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
|
||||
|
||||
" Set command and associated set-options (vimOptions) with comment {{{2
|
||||
syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\." end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" oneline keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vim9Comment,vimSetString,vimSetMod
|
||||
syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\.\n\@!" end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vim9Comment,vimSetString,vimSetMod
|
||||
syn region vimSetEqual contained start="[=:]\|[-+^]=" skip="\\\\\|\\\s" end="[| \t]"me=e-1 end="$" contains=vimCtrlChar,vimSetSep,vimNotation,vimEnvvar
|
||||
syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar
|
||||
syn match vimSetSep contained "[,:]"
|
||||
@ -419,7 +423,7 @@ syn case match
|
||||
" Maps: {{{2
|
||||
" ====
|
||||
syn match vimMap "\<map\>!\=\ze\s*[^(]" skipwhite nextgroup=vimMapMod,vimMapLhs
|
||||
syn keyword vimMap cm[ap] cno[remap] im[ap] ino[remap] lm[ap] ln[oremap] nm[ap] nn[oremap] no[remap] om[ap] ono[remap] smap snor[emap] tno[remap] tm[ap] vm[ap] vn[oremap] xm[ap] xn[oremap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
|
||||
syn keyword vimMap cm[ap] cno[remap] im[ap] ino[remap] lm[ap] ln[oremap] nm[ap] nn[oremap] no[remap] om[ap] ono[remap] smap snor[emap] tno[remap] tm[ap] vm[ap] vmapc[lear] vn[oremap] xm[ap] xn[oremap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
|
||||
syn keyword vimMap mapc[lear] smapc[lear]
|
||||
syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] tunma[p] unm[ap] unm[ap] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
|
||||
syn match vimMapLhs contained "\S\+" contains=vimNotation,vimCtrlChar skipwhite nextgroup=vimMapRhs
|
||||
@ -1002,6 +1006,7 @@ if !exists("skip_vim_syntax_inits")
|
||||
hi def link vimSyntax vimCommand
|
||||
hi def link vimSynType vimSpecial
|
||||
hi def link vimTodo Todo
|
||||
hi def link vimType Type
|
||||
hi def link vimUnmap vimMap
|
||||
hi def link vimUserAttrbCmpltFunc Special
|
||||
hi def link vimUserAttrbCmplt vimSpecial
|
||||
|
@ -19,7 +19,7 @@ Name of tags file to create. (default is 'tags')
|
||||
.IP "\fB-s <shell>\fP"
|
||||
The name of the shell used by the script(s). By default,
|
||||
\fBshtags\fP tries to work out which is the appropriate shell for each
|
||||
file individually by looking at the first line of each file. This wont
|
||||
file individually by looking at the first line of each file. This won't
|
||||
work however, if the script starts as a bourne shell script and tries
|
||||
to be clever about starting the shell it really wants.
|
||||
.b
|
||||
|
@ -195,6 +195,13 @@ func! BuildWidthTable(pattern, tableName)
|
||||
let end = -1
|
||||
let ranges = []
|
||||
let dataidx = 0
|
||||
" Account for indentation differences between ambiguous and doublewidth
|
||||
" table in mbyte.c
|
||||
if a:pattern == 'A'
|
||||
let spc = ' '
|
||||
else
|
||||
let spc = "\t"
|
||||
endif
|
||||
for p in s:widthprops
|
||||
if p[1][0] =~ a:pattern
|
||||
if p[0] =~ '\.\.'
|
||||
@ -229,7 +236,7 @@ func! BuildWidthTable(pattern, tableName)
|
||||
else
|
||||
if start >= 0
|
||||
" produce previous range
|
||||
call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end))
|
||||
call add(ranges, printf("%s{0x%04x, 0x%04x},", spc, start, end))
|
||||
if a:pattern == 'A'
|
||||
call add(s:ambitable, [start, end])
|
||||
else
|
||||
@ -243,7 +250,7 @@ func! BuildWidthTable(pattern, tableName)
|
||||
endif
|
||||
endfor
|
||||
if start >= 0
|
||||
call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end))
|
||||
call add(ranges, printf("%s{0x%04x, 0x%04x},", spc, start, end))
|
||||
if a:pattern == 'A'
|
||||
call add(s:ambitable, [start, end])
|
||||
else
|
||||
@ -254,11 +261,20 @@ func! BuildWidthTable(pattern, tableName)
|
||||
" New buffer to put the result in.
|
||||
new
|
||||
exe "file " . a:tableName
|
||||
call setline(1, " static struct interval " . a:tableName . "[] =")
|
||||
call setline(2, " {")
|
||||
if a:pattern == 'A'
|
||||
call setline(1, "static struct interval " . a:tableName . "[] =")
|
||||
call setline(2, "{")
|
||||
else
|
||||
call setline(1, " static struct interval " . a:tableName . "[] =")
|
||||
call setline(2, " {")
|
||||
endif
|
||||
call append('$', ranges)
|
||||
call setline('$', getline('$')[:-2]) " remove last comma
|
||||
call setline(line('$') + 1, " };")
|
||||
if a:pattern == 'A'
|
||||
call setline(line('$') + 1, "};")
|
||||
else
|
||||
call setline(line('$') + 1, " };")
|
||||
endif
|
||||
wincmd p
|
||||
endfunc
|
||||
|
||||
|
@ -509,7 +509,7 @@ SendEventProc(
|
||||
/*
|
||||
* Didn't recognize this thing. Just skip through the next
|
||||
* null character and try again.
|
||||
* Also, throw away commands that we cant process anyway.
|
||||
* Also, throw away commands that we can't process anyway.
|
||||
*/
|
||||
|
||||
while (*p != 0)
|
||||
|
@ -5,6 +5,7 @@
|
||||
Name[de]=Vim
|
||||
Name[eo]=Vim
|
||||
Name[fr]=Vim
|
||||
Name[it]=Vim
|
||||
Name[ru]=Vim
|
||||
Name[sr]=Vim
|
||||
Name[tr]=Vim
|
||||
@ -13,6 +14,7 @@ Name=Vim
|
||||
GenericName[de]=Texteditor
|
||||
GenericName[eo]=Tekstoredaktilo
|
||||
GenericName[fr]=Éditeur de texte
|
||||
GenericName[it]=Editor di testi
|
||||
GenericName[ja]=テキストエディタ
|
||||
GenericName[ru]=Текстовый редактор
|
||||
GenericName[sr]=Едитор текст
|
||||
@ -22,6 +24,7 @@ GenericName=Text Editor
|
||||
Comment[de]=Textdateien bearbeiten
|
||||
Comment[eo]=Redakti tekstajn dosierojn
|
||||
Comment[fr]=Éditer des fichiers texte
|
||||
Comment[it]=Edita file di testo
|
||||
Comment[ja]=テキストファイルを編集します
|
||||
Comment[ru]=Редактирование текстовых файлов
|
||||
Comment[sr]=Уређујте текст фајлове
|
||||
@ -60,7 +63,6 @@ Comment[hr]=Uređivanje tekstualne datoteke
|
||||
Comment[hu]=Szövegfájlok szerkesztése
|
||||
Comment[id]=Edit file teks
|
||||
Comment[is]=Vinna með textaskrár
|
||||
Comment[it]=Modifica file di testo
|
||||
Comment[kn]=ಪಠ್ಯ ಕಡತಗಳನ್ನು ಸಂಪಾದಿಸು
|
||||
Comment[ko]=텍스트 파일을 편집합니다
|
||||
Comment[lt]=Redaguoti tekstines bylas
|
||||
@ -102,6 +104,7 @@ Type=Application
|
||||
Keywords[de]=Text;Editor;
|
||||
Keywords[eo]=Teksto;redaktilo;
|
||||
Keywords[fr]=Texte;éditeur;
|
||||
Keywords[it]=Testo;editor;
|
||||
Keywords[ja]=テキスト;エディタ;
|
||||
Keywords[ru]=текст;текстовый редактор;
|
||||
Keywords[sr]=Текст;едитор;
|
||||
@ -111,7 +114,9 @@ Keywords=Text;editor;
|
||||
Icon[de]=gvim
|
||||
Icon[eo]=gvim
|
||||
Icon[fr]=gvim
|
||||
Icon[it]=gvim
|
||||
Icon[ru]=gvim
|
||||
Icon[sr]=gvim
|
||||
Icon=gvim
|
||||
Categories=Utility;TextEditor;
|
||||
StartupNotify=false
|
||||
|
@ -35,6 +35,15 @@ UINT cbFiles = 0;
|
||||
* enough */
|
||||
#define BUFSIZE 1100
|
||||
|
||||
// The "Edit with Vim" shell extension provides these choices when
|
||||
// a new instance of Gvim is selected:
|
||||
// - use tabpages
|
||||
// - enable diff mode
|
||||
// - none of the above
|
||||
#define EDIT_WITH_VIM_USE_TABPAGES (2)
|
||||
#define EDIT_WITH_VIM_IN_DIFF_MODE (1)
|
||||
#define EDIT_WITH_VIM_NO_OPTIONS (0)
|
||||
|
||||
//
|
||||
// Get the name of the Gvim executable to use, with the path.
|
||||
// When "runtime" is non-zero, we were called to find the runtime directory.
|
||||
@ -613,7 +622,7 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
|
||||
if (cbFiles > 1)
|
||||
{
|
||||
mii.wID = idCmd++;
|
||||
mii.dwTypeData = _("Edit with &multiple Vims");
|
||||
mii.dwTypeData = _("Edit with Vim using &tabpages");
|
||||
mii.cch = lstrlen(mii.dwTypeData);
|
||||
InsertMenuItem(hMenu, indexMenu++, TRUE, &mii);
|
||||
|
||||
@ -726,6 +735,7 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
|
||||
STDMETHODIMP CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
|
||||
{
|
||||
HRESULT hr = E_INVALIDARG;
|
||||
int gvimExtraOptions;
|
||||
|
||||
// If HIWORD(lpcmi->lpVerb) then we have been called programmatically
|
||||
// and lpVerb is a command that should be invoked. Otherwise, the shell
|
||||
@ -750,29 +760,28 @@ STDMETHODIMP CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
|
||||
switch (idCmd)
|
||||
{
|
||||
case 0:
|
||||
hr = InvokeGvim(lpcmi->hwnd,
|
||||
lpcmi->lpDirectory,
|
||||
lpcmi->lpVerb,
|
||||
lpcmi->lpParameters,
|
||||
lpcmi->nShow);
|
||||
gvimExtraOptions = EDIT_WITH_VIM_USE_TABPAGES;
|
||||
break;
|
||||
case 1:
|
||||
hr = InvokeSingleGvim(lpcmi->hwnd,
|
||||
lpcmi->lpDirectory,
|
||||
lpcmi->lpVerb,
|
||||
lpcmi->lpParameters,
|
||||
lpcmi->nShow,
|
||||
0);
|
||||
gvimExtraOptions = EDIT_WITH_VIM_NO_OPTIONS;
|
||||
break;
|
||||
case 2:
|
||||
hr = InvokeSingleGvim(lpcmi->hwnd,
|
||||
lpcmi->lpDirectory,
|
||||
lpcmi->lpVerb,
|
||||
lpcmi->lpParameters,
|
||||
lpcmi->nShow,
|
||||
1);
|
||||
gvimExtraOptions = EDIT_WITH_VIM_IN_DIFF_MODE;
|
||||
break;
|
||||
default:
|
||||
// If execution reaches this point we likely have an
|
||||
// inconsistency between the code that setup the menus
|
||||
// and this code that determines what the user
|
||||
// selected. This should be detected and fixed during
|
||||
// development.
|
||||
return E_FAIL;
|
||||
}
|
||||
hr = InvokeSingleGvim(lpcmi->hwnd,
|
||||
lpcmi->lpDirectory,
|
||||
lpcmi->lpVerb,
|
||||
lpcmi->lpParameters,
|
||||
lpcmi->nShow,
|
||||
gvimExtraOptions);
|
||||
}
|
||||
}
|
||||
return hr;
|
||||
@ -873,82 +882,13 @@ searchpath(char *name)
|
||||
return (char *)"";
|
||||
}
|
||||
|
||||
STDMETHODIMP CShellExt::InvokeGvim(HWND hParent,
|
||||
LPCSTR /* pszWorkingDir */,
|
||||
LPCSTR /* pszCmd */,
|
||||
LPCSTR /* pszParam */,
|
||||
int /* iShowCmd */)
|
||||
{
|
||||
wchar_t m_szFileUserClickedOn[BUFSIZE];
|
||||
wchar_t cmdStrW[BUFSIZE];
|
||||
UINT i;
|
||||
|
||||
for (i = 0; i < cbFiles; i++)
|
||||
{
|
||||
DragQueryFileW((HDROP)medium.hGlobal,
|
||||
i,
|
||||
m_szFileUserClickedOn,
|
||||
sizeof(m_szFileUserClickedOn));
|
||||
|
||||
getGvimInvocationW(cmdStrW);
|
||||
wcscat(cmdStrW, L" \"");
|
||||
|
||||
if ((wcslen(cmdStrW) + wcslen(m_szFileUserClickedOn) + 2) < BUFSIZE)
|
||||
{
|
||||
wcscat(cmdStrW, m_szFileUserClickedOn);
|
||||
wcscat(cmdStrW, L"\"");
|
||||
|
||||
STARTUPINFOW si;
|
||||
PROCESS_INFORMATION pi;
|
||||
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
|
||||
// Start the child process.
|
||||
if (!CreateProcessW(NULL, // No module name (use command line).
|
||||
cmdStrW, // Command line.
|
||||
NULL, // Process handle not inheritable.
|
||||
NULL, // Thread handle not inheritable.
|
||||
FALSE, // Set handle inheritance to FALSE.
|
||||
0, // No creation flags.
|
||||
NULL, // Use parent's environment block.
|
||||
NULL, // Use parent's starting directory.
|
||||
&si, // Pointer to STARTUPINFO structure.
|
||||
&pi) // Pointer to PROCESS_INFORMATION structure.
|
||||
)
|
||||
{
|
||||
MessageBox(
|
||||
hParent,
|
||||
_("Error creating process: Check if gvim is in your path!"),
|
||||
_("gvimext.dll error"),
|
||||
MB_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
CloseHandle( pi.hProcess );
|
||||
CloseHandle( pi.hThread );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox(
|
||||
hParent,
|
||||
_("Path length too long!"),
|
||||
_("gvimext.dll error"),
|
||||
MB_OK);
|
||||
}
|
||||
}
|
||||
|
||||
return NOERROR;
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent,
|
||||
LPCSTR /* pszWorkingDir */,
|
||||
LPCSTR /* pszCmd */,
|
||||
LPCSTR /* pszParam */,
|
||||
int /* iShowCmd */,
|
||||
int useDiff)
|
||||
int gvimExtraOptions)
|
||||
{
|
||||
wchar_t m_szFileUserClickedOn[BUFSIZE];
|
||||
wchar_t *cmdStrW;
|
||||
@ -962,8 +902,10 @@ STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent,
|
||||
return E_FAIL;
|
||||
getGvimInvocationW(cmdStrW);
|
||||
|
||||
if (useDiff)
|
||||
if (gvimExtraOptions == EDIT_WITH_VIM_IN_DIFF_MODE)
|
||||
wcscat(cmdStrW, L" -d");
|
||||
else if (gvimExtraOptions == EDIT_WITH_VIM_USE_TABPAGES)
|
||||
wcscat(cmdStrW, L" -p");
|
||||
for (i = 0; i < cbFiles; i++)
|
||||
{
|
||||
DragQueryFileW((HDROP)medium.hGlobal,
|
||||
|
@ -129,18 +129,12 @@ protected:
|
||||
int iShowCmd,
|
||||
int idHWnd);
|
||||
|
||||
STDMETHODIMP InvokeGvim(HWND hParent,
|
||||
LPCSTR pszWorkingDir,
|
||||
LPCSTR pszCmd,
|
||||
LPCSTR pszParam,
|
||||
int iShowCmd);
|
||||
|
||||
STDMETHODIMP InvokeSingleGvim(HWND hParent,
|
||||
LPCSTR pszWorkingDir,
|
||||
LPCSTR pszCmd,
|
||||
LPCSTR pszParam,
|
||||
int iShowCmd,
|
||||
int useDiff);
|
||||
int gvimExtraOptions);
|
||||
|
||||
public:
|
||||
int m_cntOfHWnd;
|
||||
|
@ -284,7 +284,8 @@ open the window from the start menu, MSYS2 64 bit / MSYS2 MSYS.
|
||||
Execute:
|
||||
$ pacman -Syu
|
||||
|
||||
And restart MSYS2 console (select "MSYS2 MSYS" icon from the Start Menu).
|
||||
And restart MSYS2 console (select "MSYS2 MSYS 32-Bit" icon from the Start
|
||||
Menu for building 32 bit Vim, otherwise select "MSYS2 MinGW 64-Bit").
|
||||
Then execute:
|
||||
$ pacman -Su
|
||||
|
||||
@ -321,6 +322,9 @@ MSYS2 has its own git package, and you can also install it via pacman:
|
||||
|
||||
$ pacman -S git
|
||||
|
||||
For enabling libsodium support, you also need to install the package
|
||||
|
||||
$ pacman -S mingw-w64-x86_64-libsodium
|
||||
|
||||
2.3. Keep the build environment up-to-date
|
||||
|
||||
|
@ -162,6 +162,7 @@ SRC += \
|
||||
spell.c \
|
||||
spellfile.c \
|
||||
spellsuggest.c \
|
||||
strings.c \
|
||||
syntax.c \
|
||||
tag.c \
|
||||
term.c \
|
||||
|
@ -41,6 +41,9 @@ DEBUG=no
|
||||
# set to yes to measure code coverage
|
||||
COVERAGE=no
|
||||
|
||||
# better encryption support using libsodium
|
||||
#SODIUM=yes
|
||||
|
||||
# set to SIZE for size, SPEED for speed, MAXSPEED for maximum optimization
|
||||
OPTIMIZE=MAXSPEED
|
||||
|
||||
@ -517,6 +520,10 @@ CXXFLAGS = -std=gnu++11
|
||||
WINDRES_FLAGS =
|
||||
EXTRA_LIBS =
|
||||
|
||||
ifdef SODIUM
|
||||
DEFINES += -DHAVE_SODIUM
|
||||
endif
|
||||
|
||||
ifdef GETTEXT
|
||||
DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
|
||||
GETTEXTINCLUDE = $(GETTEXT)/include
|
||||
@ -660,6 +667,10 @@ DEFINES += -DFEAT_DIRECTX_COLOR_EMOJI
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(SODIUM),yes)
|
||||
SODIUMLIB = -lsodium
|
||||
endif
|
||||
|
||||
# Only allow XPM for a GUI build.
|
||||
ifeq (yes, $(GUI))
|
||||
|
||||
@ -798,6 +809,7 @@ OBJ = \
|
||||
$(OUTDIR)/spell.o \
|
||||
$(OUTDIR)/spellfile.o \
|
||||
$(OUTDIR)/spellsuggest.o \
|
||||
$(OUTDIR)/strings.o \
|
||||
$(OUTDIR)/syntax.o \
|
||||
$(OUTDIR)/tag.o \
|
||||
$(OUTDIR)/term.o \
|
||||
@ -1064,7 +1076,7 @@ $(EXEOBJC): | $(OUTDIR)
|
||||
|
||||
ifeq ($(VIMDLL),yes)
|
||||
$(TARGET): $(OBJ)
|
||||
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid -lgdi32 $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
|
||||
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid -lgdi32 $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) $(SODIUMLIB)
|
||||
|
||||
$(GVIMEXE): $(EXEOBJG) $(VIMDLLBASE).dll
|
||||
$(CC) -L. $(EXELFLAGS) -mwindows -o $@ $(EXEOBJG) -l$(VIMDLLBASE)
|
||||
@ -1073,7 +1085,7 @@ $(VIMEXE): $(EXEOBJC) $(VIMDLLBASE).dll
|
||||
$(CC) -L. $(EXELFLAGS) -o $@ $(EXEOBJC) -l$(VIMDLLBASE)
|
||||
else
|
||||
$(TARGET): $(OBJ)
|
||||
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
|
||||
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) $(SODIUMLIB)
|
||||
endif
|
||||
|
||||
upx: exes
|
||||
|
@ -41,6 +41,13 @@
|
||||
#
|
||||
# Sound support: SOUND=yes (default is yes)
|
||||
#
|
||||
# Sodium support: SODIUM=[Path to Sodium directory]
|
||||
# Dynamic built with libsodium
|
||||
# You need to install the msvc package from
|
||||
# https://download.libsodium.org/libsodium/releases/
|
||||
# and package the libsodium.dll with Vim
|
||||
#
|
||||
#
|
||||
# DLL support (EXPERIMENTAL): VIMDLL=yes (default is no)
|
||||
# Creates vim{32,64}.dll, and stub gvim.exe and vim.exe.
|
||||
# The shared codes between the GUI and the console are built into
|
||||
@ -372,6 +379,26 @@ SOUND = no
|
||||
! endif
|
||||
!endif
|
||||
|
||||
!ifndef SODIUM
|
||||
SODIUM = no
|
||||
!endif
|
||||
|
||||
!if "$(SODIUM)" != "no"
|
||||
! if "$(CPU)" == "AMD64"
|
||||
SOD_LIB = $(SODIUM)\x64\Release\v140\dynamic
|
||||
! elseif "$(CPU)" == "i386"
|
||||
SOD_LIB = $(SODIUM)\Win32\Release\v140\dynamic
|
||||
! else
|
||||
SODIUM = no
|
||||
! endif
|
||||
!endif
|
||||
|
||||
!if "$(SODIUM)" != "no"
|
||||
SOD_INC = /I "$(SODIUM)\include"
|
||||
SOD_DEFS = -DHAVE_SODIUM
|
||||
SOD_LIB = $(SOD_LIB)\libsodium.lib
|
||||
!endif
|
||||
|
||||
!ifndef NETBEANS
|
||||
NETBEANS = $(GUI)
|
||||
!endif
|
||||
@ -491,7 +518,7 @@ CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
|
||||
|
||||
CFLAGS = -c /W3 /GF /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
|
||||
$(CSCOPE_DEFS) $(TERM_DEFS) $(SOUND_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \
|
||||
$(NBDEBUG_DEFS) $(XPM_DEFS) \
|
||||
$(NBDEBUG_DEFS) $(XPM_DEFS) $(SOD_DEFS) $(SOD_INC) \
|
||||
$(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
|
||||
|
||||
#>>>>> end of choices
|
||||
@ -792,6 +819,7 @@ OBJ = \
|
||||
$(OUTDIR)\spell.obj \
|
||||
$(OUTDIR)\spellfile.obj \
|
||||
$(OUTDIR)\spellsuggest.obj \
|
||||
$(OUTDIR)\strings.obj \
|
||||
$(OUTDIR)\syntax.obj \
|
||||
$(OUTDIR)\tag.obj \
|
||||
$(OUTDIR)\term.obj \
|
||||
@ -1282,7 +1310,7 @@ conflags = $(conflags) /map /mapinfo:lines
|
||||
LINKARGS1 = $(linkdebug) $(conflags)
|
||||
LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) user32.lib \
|
||||
$(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \
|
||||
$(TCL_LIB) $(SOUND_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
|
||||
$(TCL_LIB) $(SOUND_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(SOD_LIB) $(LINK_PDB)
|
||||
|
||||
# Report link time code generation progress if used.
|
||||
!ifdef NODEBUG
|
||||
@ -1765,6 +1793,8 @@ $(OUTDIR)/spellfile.obj: $(OUTDIR) spellfile.c $(INCL)
|
||||
|
||||
$(OUTDIR)/spellsuggest.obj: $(OUTDIR) spellsuggest.c $(INCL)
|
||||
|
||||
$(OUTDIR)/strings.obj: $(OUTDIR) strings.c $(INCL)
|
||||
|
||||
$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
|
||||
|
||||
$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
|
||||
@ -1985,6 +2015,7 @@ proto.h: \
|
||||
proto/spell.pro \
|
||||
proto/spellfile.pro \
|
||||
proto/spellsuggest.pro \
|
||||
proto/strings.pro \
|
||||
proto/syntax.pro \
|
||||
proto/tag.pro \
|
||||
proto/term.pro \
|
||||
|
@ -393,6 +393,7 @@ SRC = \
|
||||
spell.c \
|
||||
spellfile.c \
|
||||
spellsuggest.c \
|
||||
strings.c \
|
||||
syntax.c \
|
||||
tag.c \
|
||||
term.c \
|
||||
@ -512,6 +513,7 @@ OBJ = \
|
||||
spell.obj \
|
||||
spellfile.obj \
|
||||
spellsuggest.obj \
|
||||
strings.obj \
|
||||
syntax.obj \
|
||||
tag.obj \
|
||||
term.obj \
|
||||
@ -1048,6 +1050,10 @@ spellsuggest.obj : spellsuggest.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h term.h macros.h option.h structs.h \
|
||||
regexp.h gui.h beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h \
|
||||
proto.h errors.h globals.h
|
||||
strings.obj : strings.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h term.h macros.h option.h structs.h \
|
||||
regexp.h gui.h beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h \
|
||||
proto.h errors.h globals.h
|
||||
syntax.obj : syntax.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h term.h macros.h structs.h regexp.h \
|
||||
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
|
10
src/Makefile
10
src/Makefile
@ -1677,6 +1677,7 @@ BASIC_SRC = \
|
||||
spell.c \
|
||||
spellfile.c \
|
||||
spellsuggest.c \
|
||||
strings.c \
|
||||
syntax.c \
|
||||
tag.c \
|
||||
term.c \
|
||||
@ -1828,6 +1829,7 @@ OBJ_COMMON = \
|
||||
objects/spell.o \
|
||||
objects/spellfile.o \
|
||||
objects/spellsuggest.o \
|
||||
objects/strings.o \
|
||||
objects/syntax.o \
|
||||
objects/tag.o \
|
||||
objects/term.o \
|
||||
@ -2011,6 +2013,7 @@ PRO_AUTO = \
|
||||
spell.pro \
|
||||
spellfile.pro \
|
||||
spellsuggest.pro \
|
||||
strings.pro \
|
||||
syntax.pro \
|
||||
tag.pro \
|
||||
term.pro \
|
||||
@ -3516,6 +3519,9 @@ objects/spellfile.o: spellfile.c
|
||||
objects/spellsuggest.o: spellsuggest.c
|
||||
$(CCC) -o $@ spellsuggest.c
|
||||
|
||||
objects/strings.o: strings.c
|
||||
$(CCC) -o $@ strings.c
|
||||
|
||||
objects/syntax.o: syntax.c
|
||||
$(CCC) -o $@ syntax.c
|
||||
|
||||
@ -4049,6 +4055,10 @@ objects/spellsuggest.o: spellsuggest.c vim.h protodef.h auto/config.h feature.h
|
||||
os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
proto.h errors.h globals.h
|
||||
objects/strings.o: strings.c vim.h protodef.h auto/config.h feature.h os_unix.h \
|
||||
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
proto.h errors.h globals.h
|
||||
objects/syntax.o: syntax.c vim.h protodef.h auto/config.h feature.h os_unix.h \
|
||||
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
|
@ -80,6 +80,7 @@ sign.c | signs
|
||||
spell.c | spell checking core
|
||||
spellfile.c | spell file handling
|
||||
spellsuggest.c | spell correction suggestions
|
||||
strings.c | string manipulation functions
|
||||
syntax.c | syntax and other highlighting
|
||||
tag.c | tags
|
||||
term.c | terminal handling, termcap codes
|
||||
|
@ -213,7 +213,7 @@ Troubleshooting
|
||||
Cause: You can't delete an item you once added to the add-ins
|
||||
list box.
|
||||
Explanation: M$ just didn't put a 'delete' button in the dialog box.
|
||||
Unfortunately there is no DEL key accellerator as well...
|
||||
Unfortunately there is no DEL key accelerator as well...
|
||||
Workaround: You can't kill it, but you can knock it out:
|
||||
1. Uncheck the check box in front of 'Vim Developer Studio
|
||||
Add-in'.
|
||||
|
@ -148,7 +148,7 @@ alist_set(
|
||||
return;
|
||||
|
||||
alist_clear(al);
|
||||
if (ga_grow(&al->al_ga, count) == OK)
|
||||
if (GA_GROW_OK(&al->al_ga, count))
|
||||
{
|
||||
for (i = 0; i < count; ++i)
|
||||
{
|
||||
@ -355,7 +355,7 @@ alist_add_list(
|
||||
int old_argcount = ARGCOUNT;
|
||||
|
||||
if (check_arglist_locked() != FAIL
|
||||
&& ga_grow(&ALIST(curwin)->al_ga, count) == OK)
|
||||
&& GA_GROW_OK(&ALIST(curwin)->al_ga, count))
|
||||
{
|
||||
if (after < 0)
|
||||
after = 0;
|
||||
@ -599,7 +599,7 @@ ex_args(exarg_T *eap)
|
||||
garray_T *gap = &curwin->w_alist->al_ga;
|
||||
|
||||
// ":argslocal": make a local copy of the global argument list.
|
||||
if (ga_grow(gap, GARGCOUNT) == OK)
|
||||
if (GA_GROW_OK(gap, GARGCOUNT))
|
||||
for (i = 0; i < GARGCOUNT; ++i)
|
||||
if (GARGLIST[i].ae_fname != NULL)
|
||||
{
|
||||
@ -832,7 +832,7 @@ ex_argdelete(exarg_T *eap)
|
||||
{
|
||||
// Don't give an error for ":%argdel" if the list is empty.
|
||||
if (eap->line1 != 1 || eap->line2 != 0)
|
||||
emsg(_(e_invrange));
|
||||
emsg(_(e_invalid_range));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -920,7 +920,7 @@ do_arg_all(
|
||||
#ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
{
|
||||
emsg(_(e_cmdwin));
|
||||
emsg(_(e_invalid_in_cmdline_window));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@ -1271,6 +1271,9 @@ f_argc(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
win_T *wp;
|
||||
|
||||
if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
if (argvars[0].v_type == VAR_UNKNOWN)
|
||||
// use the current window
|
||||
rettv->vval.v_number = ARGCOUNT;
|
||||
@ -1306,6 +1309,12 @@ f_arglistid(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
win_T *wp;
|
||||
|
||||
if (in_vim9script()
|
||||
&& (check_for_opt_number_arg(argvars, 0) == FAIL
|
||||
|| (argvars[0].v_type != VAR_UNKNOWN
|
||||
&& check_for_opt_number_arg(argvars, 1) == FAIL)))
|
||||
return;
|
||||
|
||||
rettv->vval.v_number = -1;
|
||||
wp = find_tabwin(&argvars[0], &argvars[1], NULL);
|
||||
if (wp != NULL)
|
||||
@ -1336,6 +1345,12 @@ f_argv(typval_T *argvars, typval_T *rettv)
|
||||
aentry_T *arglist = NULL;
|
||||
int argcount = -1;
|
||||
|
||||
if (in_vim9script()
|
||||
&& (check_for_opt_number_arg(argvars, 0) == FAIL
|
||||
|| (argvars[0].v_type != VAR_UNKNOWN
|
||||
&& check_for_opt_number_arg(argvars, 1) == FAIL)))
|
||||
return;
|
||||
|
||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
if (argvars[1].v_type == VAR_UNKNOWN)
|
||||
|
71
src/auto/configure
vendored
71
src/auto/configure
vendored
@ -839,6 +839,7 @@ with_motif_lib
|
||||
with_tlib
|
||||
enable_largefile
|
||||
enable_canberra
|
||||
enable_libsodium
|
||||
enable_acl
|
||||
enable_gpm
|
||||
enable_sysmouse
|
||||
@ -1513,6 +1514,7 @@ Optional Features:
|
||||
--disable-desktop-database-update update disabled
|
||||
--disable-largefile omit support for large files
|
||||
--disable-canberra Do not use libcanberra.
|
||||
--disable-libsodium Do not use libsodium.
|
||||
--disable-acl No check for ACL support.
|
||||
--disable-gpm Don't use gpm (Linux mouse daemon).
|
||||
--disable-sysmouse Don't use sysmouse (mouse in *BSD console).
|
||||
@ -6755,7 +6757,10 @@ else
|
||||
|
||||
vi_cv_path_python3_conf=
|
||||
config_dir="config-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
|
||||
d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"`
|
||||
d=`${vi_cv_path_python3} -c "import sysconfig; print(sysconfig.get_config_var('LIBPL'))" 2> /dev/null`
|
||||
if test "x$d" = "x"; then
|
||||
d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"`
|
||||
fi
|
||||
if test -d "$d" && test -f "$d/config.c"; then
|
||||
vi_cv_path_python3_conf="$d"
|
||||
else
|
||||
@ -13002,6 +13007,70 @@ rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-libsodium argument" >&5
|
||||
$as_echo_n "checking --enable-libsodium argument... " >&6; }
|
||||
# Check whether --enable-libsodium was given.
|
||||
if test "${enable_libsodium+set}" = set; then :
|
||||
enableval=$enable_libsodium;
|
||||
else
|
||||
enable_libsodium="maybe"
|
||||
fi
|
||||
|
||||
|
||||
if test "$enable_libsodium" = "maybe"; then
|
||||
if test "$features" = "big" -o "$features" = "huge"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to yes" >&5
|
||||
$as_echo "Defaulting to yes" >&6; }
|
||||
enable_libsodium="yes"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to no" >&5
|
||||
$as_echo "Defaulting to no" >&6; }
|
||||
enable_libsodium="no"
|
||||
fi
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_libsodium" >&5
|
||||
$as_echo "$enable_libsodium" >&6; }
|
||||
fi
|
||||
if test "$enable_libsodium" = "yes"; then
|
||||
if test "x$PKG_CONFIG" != "xno"; then
|
||||
libsodium_lib=`$PKG_CONFIG --libs libsodium 2>/dev/null`
|
||||
libsodium_cflags=`$PKG_CONFIG --cflags libsodium 2>/dev/null`
|
||||
fi
|
||||
if test "x$libsodium_lib" = "x"; then
|
||||
libsodium_lib=-lsodium
|
||||
libsodium_cflags=
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsodium" >&5
|
||||
$as_echo_n "checking for libsodium... " >&6; }
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $libsodium_cflags"
|
||||
LIBS="$LIBS $libsodium_lib"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
# include <sodium.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
printf("%d", sodium_init());
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }; $as_echo "#define HAVE_SODIUM 1" >>confdefs.h
|
||||
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no; try installing libsodium-dev" >&5
|
||||
$as_echo "no; try installing libsodium-dev" >&6; }; CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_blksize" >&5
|
||||
$as_echo_n "checking for st_blksize... " >&6; }
|
||||
|
@ -258,7 +258,7 @@ static int au_need_clean = FALSE; // need to delete marked patterns
|
||||
|
||||
static char_u *event_nr2name(event_T event);
|
||||
static int au_get_grouparg(char_u **argp);
|
||||
static int do_autocmd_event(event_T event, char_u *pat, int once, int nested, char_u *cmd, int forceit, int group);
|
||||
static int do_autocmd_event(event_T event, char_u *pat, int once, int nested, char_u *cmd, int forceit, int group, int flags);
|
||||
static int apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io, int force, int group, buf_T *buf, exarg_T *eap);
|
||||
static void auto_next_pat(AutoPatCmd *apc, int stop_at_last);
|
||||
static int au_find_group(char_u *name);
|
||||
@ -615,7 +615,7 @@ free_all_autocmds(void)
|
||||
|
||||
for (current_augroup = -1; current_augroup < augroups.ga_len;
|
||||
++current_augroup)
|
||||
do_autocmd((char_u *)"", TRUE);
|
||||
do_autocmd(NULL, (char_u *)"", TRUE);
|
||||
|
||||
for (i = 0; i < augroups.ga_len; ++i)
|
||||
{
|
||||
@ -823,20 +823,23 @@ au_event_restore(char_u *old_ei)
|
||||
* :autocmd * *.c show all autocommands for *.c files.
|
||||
*
|
||||
* Mostly a {group} argument can optionally appear before <event>.
|
||||
* "eap" can be NULL.
|
||||
*/
|
||||
void
|
||||
do_autocmd(char_u *arg_in, int forceit)
|
||||
do_autocmd(exarg_T *eap, char_u *arg_in, int forceit)
|
||||
{
|
||||
char_u *arg = arg_in;
|
||||
char_u *pat;
|
||||
char_u *envpat = NULL;
|
||||
char_u *cmd;
|
||||
int cmd_need_free = FALSE;
|
||||
event_T event;
|
||||
int need_free = FALSE;
|
||||
char_u *tofree = NULL;
|
||||
int nested = FALSE;
|
||||
int once = FALSE;
|
||||
int group;
|
||||
int i;
|
||||
int flags = 0;
|
||||
|
||||
if (*arg == '|')
|
||||
{
|
||||
@ -935,10 +938,14 @@ do_autocmd(char_u *arg_in, int forceit)
|
||||
*/
|
||||
if (*cmd != NUL)
|
||||
{
|
||||
if (eap != NULL)
|
||||
// Read a {} block if it follows.
|
||||
cmd = may_get_cmd_block(eap, cmd, &tofree, &flags);
|
||||
|
||||
cmd = expand_sfile(cmd);
|
||||
if (cmd == NULL) // some error
|
||||
return;
|
||||
need_free = TRUE;
|
||||
cmd_need_free = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -962,19 +969,20 @@ do_autocmd(char_u *arg_in, int forceit)
|
||||
for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
|
||||
event = (event_T)((int)event + 1))
|
||||
if (do_autocmd_event(event, pat,
|
||||
once, nested, cmd, forceit, group) == FAIL)
|
||||
once, nested, cmd, forceit, group, flags) == FAIL)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (*arg && *arg != '|' && !VIM_ISWHITE(*arg))
|
||||
if (do_autocmd_event(event_name2nr(arg, &arg), pat,
|
||||
once, nested, cmd, forceit, group) == FAIL)
|
||||
once, nested, cmd, forceit, group, flags) == FAIL)
|
||||
break;
|
||||
}
|
||||
|
||||
if (need_free)
|
||||
if (cmd_need_free)
|
||||
vim_free(cmd);
|
||||
vim_free(tofree);
|
||||
vim_free(envpat);
|
||||
}
|
||||
|
||||
@ -1024,7 +1032,8 @@ do_autocmd_event(
|
||||
int nested,
|
||||
char_u *cmd,
|
||||
int forceit,
|
||||
int group)
|
||||
int group,
|
||||
int flags)
|
||||
{
|
||||
AutoPat *ap;
|
||||
AutoPat **prev_ap;
|
||||
@ -1251,6 +1260,8 @@ do_autocmd_event(
|
||||
return FAIL;
|
||||
ac->cmd = vim_strsave(cmd);
|
||||
ac->script_ctx = current_sctx;
|
||||
if (flags & UC_VIM9)
|
||||
ac->script_ctx.sc_version = SCRIPT_VERSION_VIM9;
|
||||
#ifdef FEAT_EVAL
|
||||
ac->script_ctx.sc_lnum += SOURCING_LNUM;
|
||||
#endif
|
||||
|
10
src/blob.c
10
src/blob.c
@ -412,15 +412,19 @@ blob_set_range(blob_T *dest, long n1, long n2, typval_T *src)
|
||||
* "remove({blob})" function
|
||||
*/
|
||||
void
|
||||
blob_remove(typval_T *argvars, typval_T *rettv)
|
||||
blob_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg)
|
||||
{
|
||||
blob_T *b = argvars[0].vval.v_blob;
|
||||
int error = FALSE;
|
||||
long idx = (long)tv_get_number_chk(&argvars[1], &error);
|
||||
long idx;
|
||||
long end;
|
||||
|
||||
if (b != NULL && value_check_lock(b->bv_lock, arg_errmsg, TRUE))
|
||||
return;
|
||||
|
||||
idx = (long)tv_get_number_chk(&argvars[1], &error);
|
||||
if (!error)
|
||||
{
|
||||
blob_T *b = argvars[0].vval.v_blob;
|
||||
int len = blob_len(b);
|
||||
char_u *p;
|
||||
|
||||
|
@ -596,7 +596,8 @@ crypt_blowfish_encode(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u *to)
|
||||
char_u *to,
|
||||
int last UNUSED)
|
||||
{
|
||||
bf_state_T *bfs = state->method_state;
|
||||
size_t i;
|
||||
@ -619,7 +620,8 @@ crypt_blowfish_decode(
|
||||
cryptstate_T *state,
|
||||
char_u *from,
|
||||
size_t len,
|
||||
char_u *to)
|
||||
char_u *to,
|
||||
int last UNUSED)
|
||||
{
|
||||
bf_state_T *bfs = state->method_state;
|
||||
size_t i;
|
||||
@ -680,5 +682,4 @@ blowfish_self_test(void)
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
#endif // FEAT_CRYPT
|
||||
|
283
src/buffer.c
283
src/buffer.c
@ -1130,7 +1130,12 @@ handle_swap_exists(bufref_T *old_curbuf)
|
||||
close_buffer(curwin, curbuf, DOBUF_UNLOAD, FALSE, FALSE);
|
||||
if (old_curbuf == NULL || !bufref_valid(old_curbuf)
|
||||
|| old_curbuf->br_buf == curbuf)
|
||||
{
|
||||
// Block autocommands here because curwin->w_buffer is NULL.
|
||||
block_autocmds();
|
||||
buf = buflist_new(NULL, NULL, 1L, BLN_CURBUF | BLN_LISTED);
|
||||
unblock_autocmds();
|
||||
}
|
||||
else
|
||||
buf = old_curbuf->br_buf;
|
||||
if (buf != NULL)
|
||||
@ -1180,122 +1185,6 @@ handle_swap_exists(bufref_T *old_curbuf)
|
||||
swap_exists_action = SEA_NONE;
|
||||
}
|
||||
|
||||
/*
|
||||
* do_bufdel() - delete or unload buffer(s)
|
||||
*
|
||||
* addr_count == 0: ":bdel" - delete current buffer
|
||||
* addr_count == 1: ":N bdel" or ":bdel N [N ..]" - first delete
|
||||
* buffer "end_bnr", then any other arguments.
|
||||
* addr_count == 2: ":N,N bdel" - delete buffers in range
|
||||
*
|
||||
* command can be DOBUF_UNLOAD (":bunload"), DOBUF_WIPE (":bwipeout") or
|
||||
* DOBUF_DEL (":bdel")
|
||||
*
|
||||
* Returns error message or NULL
|
||||
*/
|
||||
char *
|
||||
do_bufdel(
|
||||
int command,
|
||||
char_u *arg, // pointer to extra arguments
|
||||
int addr_count,
|
||||
int start_bnr, // first buffer number in a range
|
||||
int end_bnr, // buffer nr or last buffer nr in a range
|
||||
int forceit)
|
||||
{
|
||||
int do_current = 0; // delete current buffer?
|
||||
int deleted = 0; // number of buffers deleted
|
||||
char *errormsg = NULL; // return value
|
||||
int bnr; // buffer number
|
||||
char_u *p;
|
||||
|
||||
if (addr_count == 0)
|
||||
{
|
||||
(void)do_buffer(command, DOBUF_CURRENT, FORWARD, 0, forceit);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (addr_count == 2)
|
||||
{
|
||||
if (*arg) // both range and argument is not allowed
|
||||
return ex_errmsg(e_trailing_arg, arg);
|
||||
bnr = start_bnr;
|
||||
}
|
||||
else // addr_count == 1
|
||||
bnr = end_bnr;
|
||||
|
||||
for ( ;!got_int; ui_breakcheck())
|
||||
{
|
||||
/*
|
||||
* delete the current buffer last, otherwise when the
|
||||
* current buffer is deleted, the next buffer becomes
|
||||
* the current one and will be loaded, which may then
|
||||
* also be deleted, etc.
|
||||
*/
|
||||
if (bnr == curbuf->b_fnum)
|
||||
do_current = bnr;
|
||||
else if (do_buffer(command, DOBUF_FIRST, FORWARD, (int)bnr,
|
||||
forceit) == OK)
|
||||
++deleted;
|
||||
|
||||
/*
|
||||
* find next buffer number to delete/unload
|
||||
*/
|
||||
if (addr_count == 2)
|
||||
{
|
||||
if (++bnr > end_bnr)
|
||||
break;
|
||||
}
|
||||
else // addr_count == 1
|
||||
{
|
||||
arg = skipwhite(arg);
|
||||
if (*arg == NUL)
|
||||
break;
|
||||
if (!VIM_ISDIGIT(*arg))
|
||||
{
|
||||
p = skiptowhite_esc(arg);
|
||||
bnr = buflist_findpat(arg, p,
|
||||
command == DOBUF_WIPE || command == DOBUF_WIPE_REUSE,
|
||||
FALSE, FALSE);
|
||||
if (bnr < 0) // failed
|
||||
break;
|
||||
arg = p;
|
||||
}
|
||||
else
|
||||
bnr = getdigits(&arg);
|
||||
}
|
||||
}
|
||||
if (!got_int && do_current && do_buffer(command, DOBUF_FIRST,
|
||||
FORWARD, do_current, forceit) == OK)
|
||||
++deleted;
|
||||
|
||||
if (deleted == 0)
|
||||
{
|
||||
if (command == DOBUF_UNLOAD)
|
||||
STRCPY(IObuff, _("E515: No buffers were unloaded"));
|
||||
else if (command == DOBUF_DEL)
|
||||
STRCPY(IObuff, _("E516: No buffers were deleted"));
|
||||
else
|
||||
STRCPY(IObuff, _("E517: No buffers were wiped out"));
|
||||
errormsg = (char *)IObuff;
|
||||
}
|
||||
else if (deleted >= p_report)
|
||||
{
|
||||
if (command == DOBUF_UNLOAD)
|
||||
smsg(NGETTEXT("%d buffer unloaded",
|
||||
"%d buffers unloaded", deleted), deleted);
|
||||
else if (command == DOBUF_DEL)
|
||||
smsg(NGETTEXT("%d buffer deleted",
|
||||
"%d buffers deleted", deleted), deleted);
|
||||
else
|
||||
smsg(NGETTEXT("%d buffer wiped out",
|
||||
"%d buffers wiped out", deleted), deleted);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return errormsg;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make the current buffer empty.
|
||||
* Used when it is wiped out and it's the last buffer.
|
||||
@ -1354,13 +1243,13 @@ empty_curbuf(
|
||||
*
|
||||
* Return FAIL or OK.
|
||||
*/
|
||||
int
|
||||
do_buffer(
|
||||
static int
|
||||
do_buffer_ext(
|
||||
int action,
|
||||
int start,
|
||||
int dir, // FORWARD or BACKWARD
|
||||
int count, // buffer number or number of buffers
|
||||
int forceit) // TRUE for :...!
|
||||
int flags) // DOBUF_FORCEIT etc.
|
||||
{
|
||||
buf_T *buf;
|
||||
buf_T *bp;
|
||||
@ -1446,6 +1335,14 @@ do_buffer(
|
||||
emsg(_("E88: Cannot go before first buffer"));
|
||||
return FAIL;
|
||||
}
|
||||
#ifdef FEAT_PROP_POPUP
|
||||
if ((flags & DOBUF_NOPOPUP) && bt_popup(buf)
|
||||
# ifdef FEAT_TERMINAL
|
||||
&& !bt_terminal(buf)
|
||||
#endif
|
||||
)
|
||||
return OK;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
@ -1470,7 +1367,7 @@ do_buffer(
|
||||
&& buf->b_ml.ml_mfp == NULL && !buf->b_p_bl)
|
||||
return FAIL;
|
||||
|
||||
if (!forceit && bufIsChanged(buf))
|
||||
if ((flags & DOBUF_FORCEIT) == 0 && bufIsChanged(buf))
|
||||
{
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write)
|
||||
@ -1506,7 +1403,7 @@ do_buffer(
|
||||
if (bp->b_p_bl && bp != buf)
|
||||
break;
|
||||
if (bp == NULL && buf == curbuf)
|
||||
return empty_curbuf(TRUE, forceit, action);
|
||||
return empty_curbuf(TRUE, (flags & DOBUF_FORCEIT), action);
|
||||
|
||||
/*
|
||||
* If the deleted buffer is the current one, close the current window
|
||||
@ -1633,7 +1530,7 @@ do_buffer(
|
||||
{
|
||||
// Autocommands must have wiped out all other buffers. Only option
|
||||
// now is to make the current buffer empty.
|
||||
return empty_curbuf(FALSE, forceit, action);
|
||||
return empty_curbuf(FALSE, (flags & DOBUF_FORCEIT), action);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1660,7 +1557,7 @@ do_buffer(
|
||||
/*
|
||||
* Check if the current buffer may be abandoned.
|
||||
*/
|
||||
if (action == DOBUF_GOTO && !can_abandon(curbuf, forceit))
|
||||
if (action == DOBUF_GOTO && !can_abandon(curbuf, (flags & DOBUF_FORCEIT)))
|
||||
{
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write)
|
||||
@ -1695,6 +1592,134 @@ do_buffer(
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
do_buffer(
|
||||
int action,
|
||||
int start,
|
||||
int dir, // FORWARD or BACKWARD
|
||||
int count, // buffer number or number of buffers
|
||||
int forceit) // TRUE when using !
|
||||
{
|
||||
return do_buffer_ext(action, start, dir, count,
|
||||
forceit ? DOBUF_FORCEIT : 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* do_bufdel() - delete or unload buffer(s)
|
||||
*
|
||||
* addr_count == 0: ":bdel" - delete current buffer
|
||||
* addr_count == 1: ":N bdel" or ":bdel N [N ..]" - first delete
|
||||
* buffer "end_bnr", then any other arguments.
|
||||
* addr_count == 2: ":N,N bdel" - delete buffers in range
|
||||
*
|
||||
* command can be DOBUF_UNLOAD (":bunload"), DOBUF_WIPE (":bwipeout") or
|
||||
* DOBUF_DEL (":bdel")
|
||||
*
|
||||
* Returns error message or NULL
|
||||
*/
|
||||
char *
|
||||
do_bufdel(
|
||||
int command,
|
||||
char_u *arg, // pointer to extra arguments
|
||||
int addr_count,
|
||||
int start_bnr, // first buffer number in a range
|
||||
int end_bnr, // buffer nr or last buffer nr in a range
|
||||
int forceit)
|
||||
{
|
||||
int do_current = 0; // delete current buffer?
|
||||
int deleted = 0; // number of buffers deleted
|
||||
char *errormsg = NULL; // return value
|
||||
int bnr; // buffer number
|
||||
char_u *p;
|
||||
|
||||
if (addr_count == 0)
|
||||
{
|
||||
(void)do_buffer(command, DOBUF_CURRENT, FORWARD, 0, forceit);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (addr_count == 2)
|
||||
{
|
||||
if (*arg) // both range and argument is not allowed
|
||||
return ex_errmsg(e_trailing_arg, arg);
|
||||
bnr = start_bnr;
|
||||
}
|
||||
else // addr_count == 1
|
||||
bnr = end_bnr;
|
||||
|
||||
for ( ;!got_int; ui_breakcheck())
|
||||
{
|
||||
/*
|
||||
* Delete the current buffer last, otherwise when the
|
||||
* current buffer is deleted, the next buffer becomes
|
||||
* the current one and will be loaded, which may then
|
||||
* also be deleted, etc.
|
||||
*/
|
||||
if (bnr == curbuf->b_fnum)
|
||||
do_current = bnr;
|
||||
else if (do_buffer_ext(command, DOBUF_FIRST, FORWARD, (int)bnr,
|
||||
DOBUF_NOPOPUP | (forceit ? DOBUF_FORCEIT : 0)) == OK)
|
||||
++deleted;
|
||||
|
||||
/*
|
||||
* find next buffer number to delete/unload
|
||||
*/
|
||||
if (addr_count == 2)
|
||||
{
|
||||
if (++bnr > end_bnr)
|
||||
break;
|
||||
}
|
||||
else // addr_count == 1
|
||||
{
|
||||
arg = skipwhite(arg);
|
||||
if (*arg == NUL)
|
||||
break;
|
||||
if (!VIM_ISDIGIT(*arg))
|
||||
{
|
||||
p = skiptowhite_esc(arg);
|
||||
bnr = buflist_findpat(arg, p,
|
||||
command == DOBUF_WIPE || command == DOBUF_WIPE_REUSE,
|
||||
FALSE, FALSE);
|
||||
if (bnr < 0) // failed
|
||||
break;
|
||||
arg = p;
|
||||
}
|
||||
else
|
||||
bnr = getdigits(&arg);
|
||||
}
|
||||
}
|
||||
if (!got_int && do_current && do_buffer(command, DOBUF_FIRST,
|
||||
FORWARD, do_current, forceit) == OK)
|
||||
++deleted;
|
||||
|
||||
if (deleted == 0)
|
||||
{
|
||||
if (command == DOBUF_UNLOAD)
|
||||
STRCPY(IObuff, _("E515: No buffers were unloaded"));
|
||||
else if (command == DOBUF_DEL)
|
||||
STRCPY(IObuff, _("E516: No buffers were deleted"));
|
||||
else
|
||||
STRCPY(IObuff, _("E517: No buffers were wiped out"));
|
||||
errormsg = (char *)IObuff;
|
||||
}
|
||||
else if (deleted >= p_report)
|
||||
{
|
||||
if (command == DOBUF_UNLOAD)
|
||||
smsg(NGETTEXT("%d buffer unloaded",
|
||||
"%d buffers unloaded", deleted), deleted);
|
||||
else if (command == DOBUF_DEL)
|
||||
smsg(NGETTEXT("%d buffer deleted",
|
||||
"%d buffers deleted", deleted), deleted);
|
||||
else
|
||||
smsg(NGETTEXT("%d buffer wiped out",
|
||||
"%d buffers wiped out", deleted), deleted);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return errormsg;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set current buffer to "buf". Executes autocommands and closes current
|
||||
* buffer. "action" tells how to close the current buffer:
|
||||
@ -1917,7 +1942,7 @@ no_write_message(void)
|
||||
emsg(_("E948: Job still running (add ! to end the job)"));
|
||||
else
|
||||
#endif
|
||||
emsg(_("E37: No write since last change (add ! to override)"));
|
||||
emsg(_(e_no_write_since_last_change_add_bang_to_override));
|
||||
}
|
||||
|
||||
void
|
||||
@ -1928,7 +1953,7 @@ no_write_message_nobang(buf_T *buf UNUSED)
|
||||
emsg(_("E948: Job still running"));
|
||||
else
|
||||
#endif
|
||||
emsg(_("E37: No write since last change"));
|
||||
emsg(_(e_no_write_since_last_change));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2281,6 +2306,10 @@ free_buf_options(
|
||||
clear_string_option(&buf->b_p_fex);
|
||||
#endif
|
||||
#ifdef FEAT_CRYPT
|
||||
# ifdef FEAT_SODIUM
|
||||
if (buf->b_p_key != NULL && (crypt_get_method_nr(buf) == CRYPT_M_SOD))
|
||||
sodium_munlock(buf->b_p_key, STRLEN(buf->b_p_key));
|
||||
# endif
|
||||
clear_string_option(&buf->b_p_key);
|
||||
#endif
|
||||
clear_string_option(&buf->b_p_kp);
|
||||
@ -2387,7 +2416,7 @@ buflist_getfile(
|
||||
if (buf == NULL)
|
||||
{
|
||||
if ((options & GETF_ALT) && n == 0)
|
||||
emsg(_(e_noalt));
|
||||
emsg(_(e_no_alternate_file));
|
||||
else
|
||||
semsg(_("E92: Buffer %d not found"), n);
|
||||
return FAIL;
|
||||
@ -3496,7 +3525,7 @@ getaltfname(
|
||||
if (buflist_name_nr(0, &fname, &dummy) == FAIL)
|
||||
{
|
||||
if (errmsg)
|
||||
emsg(_(e_noalt));
|
||||
emsg(_(e_no_alternate_file));
|
||||
return NULL;
|
||||
}
|
||||
return fname;
|
||||
|
@ -30,6 +30,7 @@ struct bw_info
|
||||
int bw_flags; // FIO_ flags
|
||||
#ifdef FEAT_CRYPT
|
||||
buf_T *bw_buffer; // buffer being written
|
||||
int bw_finish; // finish encrypting
|
||||
#endif
|
||||
char_u bw_rest[CONV_RESTLEN]; // not converted bytes
|
||||
int bw_restlen; // nr of bytes in bw_rest[]
|
||||
@ -493,14 +494,16 @@ buf_write_bytes(struct bw_info *ip)
|
||||
if (crypt_works_inplace(ip->bw_buffer->b_cryptstate))
|
||||
{
|
||||
# endif
|
||||
crypt_encode_inplace(ip->bw_buffer->b_cryptstate, buf, len);
|
||||
crypt_encode_inplace(ip->bw_buffer->b_cryptstate, buf, len,
|
||||
ip->bw_finish);
|
||||
# ifdef CRYPT_NOT_INPLACE
|
||||
}
|
||||
else
|
||||
{
|
||||
char_u *outbuf;
|
||||
|
||||
len = crypt_encode_alloc(curbuf->b_cryptstate, buf, len, &outbuf);
|
||||
len = crypt_encode_alloc(curbuf->b_cryptstate, buf, len, &outbuf,
|
||||
ip->bw_finish);
|
||||
if (len == 0)
|
||||
return OK; // Crypt layer is buffering, will flush later.
|
||||
wlen = write_eintr(ip->bw_fd, outbuf, len);
|
||||
@ -724,6 +727,7 @@ buf_write(
|
||||
#endif
|
||||
#ifdef FEAT_CRYPT
|
||||
write_info.bw_buffer = buf;
|
||||
write_info.bw_finish = FALSE;
|
||||
#endif
|
||||
|
||||
// After writing a file changedtick changes but we don't want to display
|
||||
@ -1982,8 +1986,25 @@ restore_backup:
|
||||
&& overwriting
|
||||
&& !append
|
||||
&& !filtering
|
||||
# ifdef CRYPT_NOT_INPLACE
|
||||
// writing undo file requires
|
||||
// crypt_encode_inplace()
|
||||
&& (buf->b_cryptstate == NULL
|
||||
|| crypt_works_inplace(buf->b_cryptstate))
|
||||
# endif
|
||||
&& reset_changed
|
||||
&& !checking_conversion);
|
||||
# ifdef CRYPT_NOT_INPLACE
|
||||
// remove undo file if encrypting it is not possible
|
||||
if (buf->b_p_udf
|
||||
&& overwriting
|
||||
&& !append
|
||||
&& !filtering
|
||||
&& !checking_conversion
|
||||
&& buf->b_cryptstate != NULL
|
||||
&& !crypt_works_inplace(buf->b_cryptstate))
|
||||
u_undofile_reset_and_delete(buf);
|
||||
# endif
|
||||
if (write_undo_file)
|
||||
// Prepare for computing the hash value of the text.
|
||||
sha256_start(&sha_ctx);
|
||||
@ -2015,6 +2036,13 @@ restore_backup:
|
||||
++s;
|
||||
if (++len != bufsize)
|
||||
continue;
|
||||
#ifdef FEAT_CRYPT
|
||||
if (write_info.bw_fd > 0 && lnum == end
|
||||
&& (write_info.bw_flags & FIO_ENCRYPTED)
|
||||
&& *buf->b_p_key != NUL && !filtering
|
||||
&& *ptr == NUL)
|
||||
write_info.bw_finish = TRUE;
|
||||
#endif
|
||||
if (buf_write_bytes(&write_info) == FAIL)
|
||||
{
|
||||
end = 0; // write error: break loop
|
||||
@ -2118,6 +2146,12 @@ restore_backup:
|
||||
if (len > 0 && end > 0)
|
||||
{
|
||||
write_info.bw_len = len;
|
||||
#ifdef FEAT_CRYPT
|
||||
if (write_info.bw_fd > 0 && lnum >= end
|
||||
&& (write_info.bw_flags & FIO_ENCRYPTED)
|
||||
&& *buf->b_p_key != NUL && !filtering)
|
||||
write_info.bw_finish = TRUE;
|
||||
#endif
|
||||
if (buf_write_bytes(&write_info) == FAIL)
|
||||
end = 0; // write error
|
||||
nchars += len;
|
||||
|
23
src/change.c
23
src/change.c
@ -241,6 +241,9 @@ f_listener_add(typval_T *argvars, typval_T *rettv)
|
||||
listener_T *lnr;
|
||||
buf_T *buf = curbuf;
|
||||
|
||||
if (in_vim9script() && check_for_opt_buffer_arg(argvars, 1) == FAIL)
|
||||
return;
|
||||
|
||||
callback = get_callback(&argvars[0]);
|
||||
if (callback.cb_name == NULL)
|
||||
return;
|
||||
@ -278,6 +281,9 @@ f_listener_flush(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
{
|
||||
buf_T *buf = curbuf;
|
||||
|
||||
if (in_vim9script() && check_for_opt_buffer_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
buf = get_buf_arg(&argvars[0]);
|
||||
@ -296,9 +302,13 @@ f_listener_remove(typval_T *argvars, typval_T *rettv)
|
||||
listener_T *lnr;
|
||||
listener_T *next;
|
||||
listener_T *prev;
|
||||
int id = tv_get_number(argvars);
|
||||
int id;
|
||||
buf_T *buf;
|
||||
|
||||
if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
id = tv_get_number(argvars);
|
||||
FOR_ALL_BUFFERS(buf)
|
||||
{
|
||||
prev = NULL;
|
||||
@ -563,9 +573,12 @@ changed_common(
|
||||
changed_cline_bef_curs_win(wp);
|
||||
if (wp->w_botline >= lnum)
|
||||
{
|
||||
// Assume that botline doesn't change (inserted lines make
|
||||
// other lines scroll down below botline).
|
||||
approximate_botline_win(wp);
|
||||
if (xtra < 0)
|
||||
invalidate_botline_win(wp);
|
||||
else
|
||||
// Assume that botline doesn't change (inserted lines make
|
||||
// other lines scroll down below botline).
|
||||
approximate_botline_win(wp);
|
||||
}
|
||||
|
||||
// Check if any w_lines[] entries have become invalid.
|
||||
@ -1251,7 +1264,7 @@ del_bytes(
|
||||
// fixpos is TRUE, we don't want to end up positioned at the NUL,
|
||||
// unless "restart_edit" is set or 'virtualedit' contains "onemore".
|
||||
if (col > 0 && fixpos && restart_edit == 0
|
||||
&& (ve_flags & VE_ONEMORE) == 0)
|
||||
&& (get_ve_flags() & VE_ONEMORE) == 0)
|
||||
{
|
||||
--curwin->w_cursor.col;
|
||||
curwin->w_cursor.coladd = 0;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user