mirror of
https://github.com/zoriya/vim.git
synced 2025-12-12 02:06:18 +00:00
Compare commits
113 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
373c65104e | ||
|
|
7633fe595e | ||
|
|
38041da1c2 | ||
|
|
73fef33014 | ||
|
|
8d9437968b | ||
|
|
7fe875583b | ||
|
|
f5433fbfe4 | ||
|
|
da58134eed | ||
|
|
23c5527373 | ||
|
|
e55b1c098d | ||
|
|
820ffa567c | ||
|
|
a3b7fdc1bb | ||
|
|
8c524f76eb | ||
|
|
6797966dfc | ||
|
|
0cb5bcf583 | ||
|
|
845e0ee594 | ||
|
|
a190548e91 | ||
|
|
b326edf5b3 | ||
|
|
ef6746f637 | ||
|
|
280b0dc815 | ||
|
|
1089374130 | ||
|
|
7e380030c1 | ||
|
|
20298ce679 | ||
|
|
1e0b7b11db | ||
|
|
ec9b017b87 | ||
|
|
3b74b6b4bb | ||
|
|
c785b9a7f4 | ||
|
|
128d307963 | ||
|
|
c5b1c20b6b | ||
|
|
0779fab297 | ||
|
|
c8cb883015 | ||
|
|
efd8855594 | ||
|
|
9b68c82b7c | ||
|
|
511feec6f0 | ||
|
|
865af6b990 | ||
|
|
ceb2e77510 | ||
|
|
72abcf42d4 | ||
|
|
158ea175a9 | ||
|
|
2f03e5a0a9 | ||
|
|
3d9207ad2f | ||
|
|
856c1110c1 | ||
|
|
40a019f157 | ||
|
|
e17f8817a1 | ||
|
|
9bb3eb3e02 | ||
|
|
f7d267ef20 | ||
|
|
101f4810e2 | ||
|
|
0fe937fd86 | ||
|
|
a1bc6f1293 | ||
|
|
a6e8bf2d89 | ||
|
|
84cf6bd81b | ||
|
|
9af78769ee | ||
|
|
c70222d12a | ||
|
|
fdcbe3c3fe | ||
|
|
ab176ce982 | ||
|
|
ad72350360 | ||
|
|
b340baed9f | ||
|
|
47a519a933 | ||
|
|
a65d8b5bb9 | ||
|
|
65e0d77a66 | ||
|
|
8e20f75e58 | ||
|
|
0c8059e0b6 | ||
|
|
8dff4cbf6d | ||
|
|
df7df59d85 | ||
|
|
984dddbef4 | ||
|
|
f3decc5830 | ||
|
|
34db91f7a4 | ||
|
|
c82a5b5da5 | ||
|
|
142499de33 | ||
|
|
0c0eddd3dd | ||
|
|
4a021dfbee | ||
|
|
c9630d2658 | ||
|
|
71ccd03ee8 | ||
|
|
722e505d1a | ||
|
|
5055c56cfb | ||
|
|
37d1673ce0 | ||
|
|
6c6be9e88d | ||
|
|
f6e020b122 | ||
|
|
ec68028604 | ||
|
|
9721fb4ea3 | ||
|
|
00e260bb6c | ||
|
|
1de5f7c81d | ||
|
|
2d4070d3b0 | ||
|
|
e0ebeda4d8 | ||
|
|
215f49c4d7 | ||
|
|
f1f0ff9557 | ||
|
|
362b44bd4a | ||
|
|
be5ee8686a | ||
|
|
6ba24d8763 | ||
|
|
13b8205b44 | ||
|
|
ea1233fccf | ||
|
|
d281b7c227 | ||
|
|
ab54032f29 | ||
|
|
eebd555733 | ||
|
|
152e79e94b | ||
|
|
253ea9fa42 | ||
|
|
32ee627750 | ||
|
|
0e390f40e9 | ||
|
|
517f00f788 | ||
|
|
0ca8b5ba7b | ||
|
|
218cb0fb62 | ||
|
|
59de417b90 | ||
|
|
dcf59c37d0 | ||
|
|
a45551a535 | ||
|
|
077a1e670a | ||
|
|
ec98e93a82 | ||
|
|
7ba5a7eff3 | ||
|
|
f154f3ab2c | ||
|
|
6938e27abd | ||
|
|
b5e18f29fa | ||
|
|
cc613031b9 | ||
|
|
acc2240640 | ||
|
|
df44a27b53 | ||
|
|
da84ac2a6f |
@@ -13,9 +13,6 @@ src/if_sniff.* Interface to SNiFF. If you don't know what SNiFF is,
|
||||
|
||||
src/os_amiga.* Files for the Amiga port.
|
||||
|
||||
src/gui_beos.*
|
||||
src/os_beos.* Files for the BeOS port.
|
||||
|
||||
src/os_msdos.*
|
||||
src/os_dos.* Files for the MS-DOS port.
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ cd src
|
||||
echo "Building MinGW 32bit console version"
|
||||
set PATH=c:\msys64\mingw32\bin;%PATH%
|
||||
mingw32-make.exe -f Make_ming.mak GUI=no OPTIMIZE=speed IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
|
||||
.\vim -u NONE -c "redir @a | ver |0put a | wq" ver_ming.txt
|
||||
:: Save vim.exe before Make clean, moved back below.
|
||||
copy vim.exe testdir
|
||||
mingw32-make.exe -f Make_ming.mak clean
|
||||
@@ -20,13 +21,14 @@ if "%FEATURE%" == "HUGE" (
|
||||
) ELSE (
|
||||
mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed GUI=yes IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
|
||||
)
|
||||
.\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_ming.txt
|
||||
.\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_ming_gui.txt
|
||||
|
||||
:: Filter out the progress bar from the build log
|
||||
sed -e "s/@<<$/@<< | sed -e 's#.*\\\\r.*##'/" Make_mvc.mak > Make_mvc2.mak
|
||||
|
||||
echo "Building MSVC 64bit console Version"
|
||||
nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=no IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
|
||||
:: The executable is not used
|
||||
nmake -f Make_mvc2.mak clean
|
||||
|
||||
:: build MSVC huge version with python and channel support
|
||||
@@ -43,6 +45,8 @@ if "%FEATURE%" == "HUGE" (
|
||||
move /Y testdir\vim.exe .
|
||||
echo "version output MinGW"
|
||||
type ver_ming.txt
|
||||
echo "version output MinGW GUI"
|
||||
type ver_ming_gui.txt
|
||||
echo "version output MVC"
|
||||
type ver_msvc.txt
|
||||
cd ..
|
||||
|
||||
@@ -141,6 +141,7 @@ DOCS = \
|
||||
usr_43.txt \
|
||||
usr_44.txt \
|
||||
usr_45.txt \
|
||||
usr_46.txt \
|
||||
usr_90.txt \
|
||||
usr_toc.txt \
|
||||
various.txt \
|
||||
@@ -282,6 +283,7 @@ HTMLS = \
|
||||
usr_43.html \
|
||||
usr_44.html \
|
||||
usr_45.html \
|
||||
usr_46.html \
|
||||
usr_90.html \
|
||||
usr_toc.html \
|
||||
various.html \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 8.2. Last change: 2020 Jan 26
|
||||
*autocmd.txt* For Vim version 8.2. Last change: 2020 Jun 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -380,6 +380,7 @@ Name triggered by ~
|
||||
info
|
||||
|
||||
|User| to be used in combination with ":doautocmd"
|
||||
|SigUSR1| after the SIGUSR1 signal has been detected
|
||||
|
||||
|
||||
The alphabetical list of autocommand events: *autocmd-events-abc*
|
||||
@@ -1153,11 +1154,14 @@ TextYankPost After text has been yanked or deleted in the
|
||||
register.
|
||||
regtype Type of the register, see
|
||||
|getregtype()|.
|
||||
visual True if the operation is
|
||||
performed on a |Visual| area.
|
||||
Not triggered when |quote_| is used nor when
|
||||
called recursively.
|
||||
It is not allowed to change the buffer text,
|
||||
see |textlock|.
|
||||
{only when compiled with the +eval feature}
|
||||
|
||||
*User*
|
||||
User Never executed automatically. To be used for
|
||||
autocommands that are only executed with
|
||||
@@ -1166,6 +1170,15 @@ User Never executed automatically. To be used for
|
||||
used while there are no matching autocommands,
|
||||
you will get an error. If you don't want
|
||||
that, define a dummy autocommand yourself.
|
||||
|
||||
*SigUSR1*
|
||||
SigUSR1 After the SIGUSR1 signal has been detected.
|
||||
Could be used if other ways of notifying Vim
|
||||
are not feasible. E.g. to check for the
|
||||
result of a build that takes a long time, or
|
||||
when a motion sensor is triggered.
|
||||
{only on Unix}
|
||||
|
||||
*UserGettingBored*
|
||||
UserGettingBored When the user presses the same key 42 times.
|
||||
Just kidding! :-)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 8.2. Last change: 2020 Apr 26
|
||||
*change.txt* For Vim version 8.2. Last change: 2020 Jun 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*channel.txt* For Vim version 8.2. Last change: 2019 Dec 07
|
||||
*channel.txt* For Vim version 8.2. Last change: 2020 Jun 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1235,8 +1235,8 @@ If you want to type input for the job in a Vim window you have a few options:
|
||||
- Use a terminal window. This works well if what you type goes directly to
|
||||
the job and the job output is directly displayed in the window.
|
||||
See |terminal-window|.
|
||||
- Use a prompt window. This works well when entering a line for the job in Vim
|
||||
while displaying (possibly filtered) output from the job.
|
||||
- Use a window with a prompt buffer. This works well when entering a line for
|
||||
the job in Vim while displaying (possibly filtered) output from the job.
|
||||
|
||||
A prompt buffer is created by setting 'buftype' to "prompt". You would
|
||||
normally only do that in a newly created buffer.
|
||||
@@ -1270,5 +1270,46 @@ Any command that starts Insert mode, such as "a", "i", "A" and "I", will move
|
||||
the cursor to the last line. "A" will move to the end of the line, "I" to the
|
||||
start of the line.
|
||||
|
||||
Here is an example for Unix. It starts a shell in the background and prompts
|
||||
for the next shell command. Output from the shell is displayed above the
|
||||
prompt. >
|
||||
|
||||
" Create a channel log so we can see what happens.
|
||||
call ch_logfile('logfile', 'w')
|
||||
|
||||
" Function handling a line of text has been typed.
|
||||
func TextEntered(text)
|
||||
" Send the text to a shell with Enter appended.
|
||||
call ch_sendraw(g:shell_job, a:text .. "\n")
|
||||
endfunc
|
||||
|
||||
" Function handling output from the shell: Added above the prompt.
|
||||
func GotOutput(channel, msg)
|
||||
call append(line("$") - 1, "- " . a:msg)
|
||||
endfunc
|
||||
|
||||
" Function handling the shell exist: close the window.
|
||||
func JobExit(job, status)
|
||||
quit!
|
||||
endfunc
|
||||
|
||||
" Start a shell in the background.
|
||||
let shell_job = job_start(["/bin/sh"], #{
|
||||
\ out_cb: function('GotOutput'),
|
||||
\ err_cb: function('GotOutput'),
|
||||
\ exit_cb: function('JobExit'),
|
||||
\ })
|
||||
let shell_ch = job_getchannel(shell_job)
|
||||
|
||||
new
|
||||
set buftype=prompt
|
||||
let buf = bufnr('')
|
||||
call prompt_setcallback(buf, function("TextEntered"))
|
||||
eval prompt_setprompt(buf, "shell command: ")
|
||||
|
||||
" start accepting shell commands
|
||||
startinsert
|
||||
<
|
||||
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.2. Last change: 2020 May 12
|
||||
*editing.txt* For Vim version 8.2. Last change: 2020 Jun 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.2. Last change: 2020 Jun 03
|
||||
*eval.txt* For Vim version 8.2. Last change: 2020 Jun 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1533,6 +1533,7 @@ An internal variable is explicitly destroyed with the ":unlet" command
|
||||
Using a name that is not an internal variable or refers to a variable that has
|
||||
been destroyed results in an error.
|
||||
|
||||
*variable-scope*
|
||||
There are several name spaces for variables. Which one is to be used is
|
||||
specified by what is prepended:
|
||||
|
||||
@@ -1551,7 +1552,9 @@ delete all script-local variables: >
|
||||
:for k in keys(s:)
|
||||
: unlet s:[k]
|
||||
:endfor
|
||||
<
|
||||
|
||||
Note: in Vim9 script this is different, see |vim9-scopes|.
|
||||
|
||||
*buffer-variable* *b:var* *b:*
|
||||
A variable name that is preceded with "b:" is local to the current buffer.
|
||||
Thus you can have several "b:foo" variables, one for each buffer.
|
||||
@@ -1742,6 +1745,14 @@ v:cmdbang Set like v:cmdarg for a file read/write command. When a "!"
|
||||
was used the value is 1, otherwise it is 0. Note that this
|
||||
can only be used in autocommands. For user commands |<bang>|
|
||||
can be used.
|
||||
*v:collate* *collate-variable*
|
||||
v:collate The current locale setting for collation order of the runtime
|
||||
environment. This allows Vim scripts to be aware of the
|
||||
current locale encoding. Technical: it's the value of
|
||||
LC_COLLATE. When not using a locale the value is "C".
|
||||
This variable can not be set directly, use the |:language|
|
||||
command.
|
||||
See |multi-lang|.
|
||||
|
||||
*v:completed_item* *completed_item-variable*
|
||||
v:completed_item
|
||||
@@ -2194,7 +2205,8 @@ v:termresponse The escape sequence returned by the terminal for the |t_RV|
|
||||
'c', with only digits and ';' in between.
|
||||
When this option is set, the TermResponse autocommand event is
|
||||
fired, so that you can react to the response from the
|
||||
terminal.
|
||||
terminal. You can use |terminalprops()| to see what Vim
|
||||
figured out about the terminal.
|
||||
The response from a new xterm is: "<Esc>[> Pp ; Pv ; Pc c". Pp
|
||||
is the terminal type: 0 for vt100 and 1 for vt220. Pv is the
|
||||
patch level (since this was introduced in patch 95, it's
|
||||
@@ -2451,6 +2463,7 @@ finddir({name} [, {path} [, {count}]])
|
||||
String find directory {name} in {path}
|
||||
findfile({name} [, {path} [, {count}]])
|
||||
String find file {name} in {path}
|
||||
flatten({list} [, {maxdepth}]) List flatten {list} up to {maxdepth} levels
|
||||
float2nr({expr}) Number convert Float {expr} to a Number
|
||||
floor({expr}) Float round {expr} down
|
||||
fmod({expr1}, {expr2}) Float remainder of {expr1} / {expr2}
|
||||
@@ -2678,8 +2691,10 @@ pyxeval({expr}) any evaluate |python_x| expression
|
||||
rand([{expr}]) Number get pseudo-random number
|
||||
range({expr} [, {max} [, {stride}]])
|
||||
List items from {expr} to {max}
|
||||
readdir({dir} [, {expr}]) List file names in {dir} selected by {expr}
|
||||
readdirex({dir} [, {expr}]) List file info in {dir} selected by {expr}
|
||||
readdir({dir} [, {expr} [, {dict}]])
|
||||
List file names in {dir} selected by {expr}
|
||||
readdirex({dir} [, {expr} [, {dict}]])
|
||||
List file info in {dir} selected by {expr}
|
||||
readfile({fname} [, {type} [, {max}]])
|
||||
List get list of lines from file {fname}
|
||||
reduce({object}, {func} [, {initial}])
|
||||
@@ -2869,6 +2884,7 @@ term_setsize({buf}, {rows}, {cols})
|
||||
none set the size of a terminal
|
||||
term_start({cmd} [, {options}]) Number open a terminal window and run a job
|
||||
term_wait({buf} [, {time}]) Number wait for screen to be updated
|
||||
terminalprops() Dict properties of the terminal
|
||||
test_alloc_fail({id}, {countdown}, {repeat})
|
||||
none make memory allocation fail
|
||||
test_autochdir() none enable 'autochdir' during startup
|
||||
@@ -3651,7 +3667,7 @@ complete_info([{what}])
|
||||
"function" User defined completion |i_CTRL-X_CTRL-U|
|
||||
"omni" Omni completion |i_CTRL-X_CTRL-O|
|
||||
"spell" Spelling suggestions |i_CTRL-X_s|
|
||||
"eval" |complete()| completion
|
||||
"eval" |complete()| completion
|
||||
"unknown" Other internal modes
|
||||
|
||||
If the optional {what} list argument is supplied, then only
|
||||
@@ -4514,6 +4530,25 @@ findfile({name} [, {path} [, {count}]]) *findfile()*
|
||||
Can also be used as a |method|: >
|
||||
GetName()->findfile()
|
||||
|
||||
flatten({list} [, {maxdepth}]) *flatten()*
|
||||
Flatten {list} up to {maxdepth} levels. Without {maxdepth}
|
||||
the result is a |List| without nesting, as if {maxdepth} is
|
||||
a very large number.
|
||||
The {list} is changed in place, make a copy first if you do
|
||||
not want that.
|
||||
*E900*
|
||||
{maxdepth} means how deep in nested lists changes are made.
|
||||
{list} is not modified when {maxdepth} is 0.
|
||||
{maxdepth} must be positive number.
|
||||
|
||||
If there is an error the number zero is returned.
|
||||
|
||||
Example: >
|
||||
:echo flatten([1, [2, [3, 4]], 5])
|
||||
< [1, 2, 3, 4, 5] >
|
||||
:echo flatten([1, [2, [3, 4]], 5], 1)
|
||||
< [1, 2, [3, 4], 5]
|
||||
|
||||
float2nr({expr}) *float2nr()*
|
||||
Convert {expr} to a Number by omitting the part after the
|
||||
decimal point.
|
||||
@@ -5128,7 +5163,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
|
||||
highlight highlight groups
|
||||
history :history suboptions
|
||||
locale locale names (as output of locale -a)
|
||||
mapclear buffer argument
|
||||
mapclear buffer argument
|
||||
mapping mapping name
|
||||
menu menus
|
||||
messages |:messages| suboptions
|
||||
@@ -5154,7 +5189,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
|
||||
If {type} is "cmdline", then the |cmdline-completion| result is
|
||||
returned. For example, to complete the possible values after
|
||||
a ":call" command: >
|
||||
echo getcompletion('call ', 'cmdline')
|
||||
echo getcompletion('call ', 'cmdline')
|
||||
<
|
||||
If there are no matches, an empty list is returned. An
|
||||
invalid value for {type} produces an error.
|
||||
@@ -5735,8 +5770,8 @@ getwininfo([{winid}]) *getwininfo()*
|
||||
Returns information about windows as a List with Dictionaries.
|
||||
|
||||
If {winid} is given Information about the window with that ID
|
||||
is returned. If the window does not exist the result is an
|
||||
empty list.
|
||||
is returned, as a List with one item. If the window does not
|
||||
exist the result is an empty list.
|
||||
|
||||
Without {winid} information about all the windows in all the
|
||||
tab pages is returned.
|
||||
@@ -6256,10 +6291,11 @@ inputlist({textlist}) *inputlist()*
|
||||
displayed, one string per line. The user will be prompted to
|
||||
enter a number, which is returned.
|
||||
The user can also select an item by clicking on it with the
|
||||
mouse. For the first string 0 is returned. When clicking
|
||||
above the first item a negative number is returned. When
|
||||
clicking on the prompt one more than the length of {textlist}
|
||||
is returned.
|
||||
mouse, if the mouse is enabled in the command line ('mouse' is
|
||||
"a" or includes "c"). For the first string 0 is returned.
|
||||
When clicking above the first item a negative number is
|
||||
returned. When clicking on the prompt one more than the
|
||||
length of {textlist} is returned.
|
||||
Make sure {textlist} has less than 'lines' entries, otherwise
|
||||
it won't work. It's a good idea to put the entry number at
|
||||
the start of the string. And put a prompt in the first item.
|
||||
@@ -7878,11 +7914,12 @@ rand([{expr}]) *rand()* *random*
|
||||
:echo rand(seed)
|
||||
:echo rand(seed) % 16 " random number 0 - 15
|
||||
<
|
||||
readdir({directory} [, {expr}]) *readdir()*
|
||||
readdir({directory} [, {expr} [, {dict}]]) *readdir()*
|
||||
Return a list with file and directory names in {directory}.
|
||||
You can also use |glob()| if you don't need to do complicated
|
||||
things, such as limiting the number of matches.
|
||||
The list will be sorted (case sensitive).
|
||||
The list will be sorted (case sensitive), see the {dict}
|
||||
argument below for changing the sort order.
|
||||
|
||||
When {expr} is omitted all entries are included.
|
||||
When {expr} is given, it is evaluated to check what to do:
|
||||
@@ -7900,18 +7937,38 @@ readdir({directory} [, {expr}]) *readdir()*
|
||||
< To skip hidden and backup files: >
|
||||
readdir(dirname, {n -> n !~ '^\.\|\~$'})
|
||||
|
||||
< The optional {dict} argument allows for further custom
|
||||
values. Currently this is used to specify if and how sorting
|
||||
should be performed. The dict can have the following members:
|
||||
|
||||
sort How to sort the result returned from the system.
|
||||
Valid values are:
|
||||
"none" do not sort (fastest method)
|
||||
"case" sort case sensitive (byte value of
|
||||
each character, technically, using
|
||||
strcmp()) (default)
|
||||
"icase" sort case insensitive (technically
|
||||
using strcasecmp())
|
||||
"collate" sort using the collation order
|
||||
of the "POSIX" or "C" |locale|
|
||||
(technically using strcoll())
|
||||
Other values are silently ignored.
|
||||
|
||||
For example, to get a list of all files in the current
|
||||
directory without sorting the individual entries: >
|
||||
readdir('.', '1', #{sort: 'none'})
|
||||
< If you want to get a directory tree: >
|
||||
function! s:tree(dir)
|
||||
return {a:dir : map(readdir(a:dir),
|
||||
function! s:tree(dir)
|
||||
return {a:dir : map(readdir(a:dir),
|
||||
\ {_, x -> isdirectory(x) ?
|
||||
\ {x : s:tree(a:dir . '/' . x)} : x})}
|
||||
endfunction
|
||||
echo s:tree(".")
|
||||
\ {x : s:tree(a:dir . '/' . x)} : x})}
|
||||
endfunction
|
||||
echo s:tree(".")
|
||||
<
|
||||
Can also be used as a |method|: >
|
||||
GetDirName()->readdir()
|
||||
<
|
||||
readdirex({directory} [, {expr}]) *readdirex()*
|
||||
readdirex({directory} [, {expr} [, {dict}]]) *readdirex()*
|
||||
Extended version of |readdir()|.
|
||||
Return a list of Dictionaries with file and directory
|
||||
information in {directory}.
|
||||
@@ -7920,7 +7977,9 @@ readdirex({directory} [, {expr}]) *readdirex()*
|
||||
This is much faster than calling |readdir()| then calling
|
||||
|getfperm()|, |getfsize()|, |getftime()| and |getftype()| for
|
||||
each file and directory especially on MS-Windows.
|
||||
The list will be sorted by name (case sensitive).
|
||||
The list will by default be sorted by name (case sensitive),
|
||||
the sorting can be changed by using the optional {dict}
|
||||
argument, see |readdir()|.
|
||||
|
||||
The Dictionary for file and directory information has the
|
||||
following items:
|
||||
@@ -7960,6 +8019,11 @@ readdirex({directory} [, {expr}]) *readdirex()*
|
||||
When {expr} is a function the entry is passed as the argument.
|
||||
For example, to get a list of files ending in ".txt": >
|
||||
readdirex(dirname, {e -> e.name =~ '.txt$'})
|
||||
<
|
||||
For example, to get a list of all files in the current
|
||||
directory without sorting the individual entries: >
|
||||
readdirex(dirname, '1', #{sort: 'none'})
|
||||
|
||||
<
|
||||
Can also be used as a |method|: >
|
||||
GetDirName()->readdirex()
|
||||
@@ -8542,14 +8606,14 @@ searchcount([{options}]) *searchcount()*
|
||||
if result.total > result.maxcount &&
|
||||
\ result.current > result.maxcount
|
||||
return printf(' /%s [>%d/>%d]', @/,
|
||||
\ result.current, result.total)
|
||||
\ result.current, result.total)
|
||||
elseif result.total > result.maxcount
|
||||
return printf(' /%s [%d/>%d]', @/,
|
||||
\ result.current, result.total)
|
||||
\ result.current, result.total)
|
||||
endif
|
||||
endif
|
||||
return printf(' /%s [%d/%d]', @/,
|
||||
\ result.current, result.total)
|
||||
\ result.current, result.total)
|
||||
endfunction
|
||||
let &statusline .= '%{LastSearchCount()}'
|
||||
|
||||
@@ -9322,7 +9386,9 @@ simplify({filename}) *simplify()*
|
||||
Unix) are not resolved. If the first path component in
|
||||
{filename} designates the current directory, this will be
|
||||
valid for the result as well. A trailing path separator is
|
||||
not removed either.
|
||||
not removed either. On Unix "//path" is unchanged, but
|
||||
"///path" is simplified to "/path" (this follows the Posix
|
||||
standard).
|
||||
Example: >
|
||||
simplify("./dir/.././/file/") == "./file/"
|
||||
< Note: The combination "dir/.." is only removed if "dir" is
|
||||
@@ -9517,9 +9583,8 @@ spellbadword([{sentence}])
|
||||
echo spellbadword("the quik brown fox")
|
||||
< ['quik', 'bad'] ~
|
||||
|
||||
The spelling information for the current window is used. The
|
||||
'spell' option must be set and the value of 'spelllang' is
|
||||
used.
|
||||
The spelling information for the current window and the value
|
||||
of 'spelllang' are used.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetText()->spellbadword()
|
||||
@@ -9544,8 +9609,7 @@ spellsuggest({word} [, {max} [, {capital}]])
|
||||
although it may appear capitalized.
|
||||
|
||||
The spelling information for the current window is used. The
|
||||
'spell' option must be set and the values of 'spelllang' and
|
||||
'spellsuggest' are used.
|
||||
values of 'spelllang' and 'spellsuggest' are used.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetWord()->spellsuggest()
|
||||
@@ -9634,7 +9698,7 @@ state([{what}]) *state()*
|
||||
m halfway a mapping, :normal command, feedkeys() or
|
||||
stuffed command
|
||||
o operator pending or waiting for a command argument,
|
||||
e.g. after |f|
|
||||
e.g. after |f|
|
||||
a Insert mode autocomplete active
|
||||
x executing an autocommand
|
||||
w blocked on waiting, e.g. ch_evalexpr(), ch_read() and
|
||||
@@ -10372,6 +10436,41 @@ tempname() *tempname()* *temp-file-name*
|
||||
|
||||
term_ functions are documented here: |terminal-function-details|
|
||||
|
||||
|
||||
terminalprops() *terminalprops()*
|
||||
Returns a dictionary with properties of the terminal that Vim
|
||||
detected from the response to |t_RV| request. See
|
||||
|v:termresponse| for the response itself. If |v:termresponse|
|
||||
is empty most values here will be 'u' for unknown.
|
||||
cursor_style wether sending |t_RS| works **
|
||||
cursor_blink_mode wether sending |t_RC| works **
|
||||
underline_rgb whether |t_8u| works **
|
||||
mouse mouse type supported
|
||||
|
||||
** value 'u' for unknown, 'y' for yes, 'n' for no
|
||||
|
||||
If the |+termresponse| feature is missing then the result is
|
||||
an empty dictionary.
|
||||
|
||||
If "cursor_style" is 'y' then |t_RS| will be sent to request the
|
||||
current cursor style.
|
||||
If "cursor_blink_mode" is 'y' then |t_RC| will be sent to
|
||||
request the cursor blink status.
|
||||
"cursor_style" and "cursor_blink_mode" are also set if |t_u7|
|
||||
is not empty, Vim will detect the working of sending |t_RS|
|
||||
and |t_RC| on startup.
|
||||
|
||||
When "underline_rgb" is not 'y', then |t_8u| will be made empty.
|
||||
This avoids sending it to xterm, which would clear the colors.
|
||||
|
||||
For "mouse" the value 'u' is unknown
|
||||
|
||||
Also see:
|
||||
- 'ambiwidth' - detected by using |t_u7|.
|
||||
- |v:termstyleresp| and |v:termblinkresp| for the response to
|
||||
|t_RS| and |t_RC|.
|
||||
|
||||
|
||||
test_ functions are documented here: |test-functions-details|
|
||||
|
||||
|
||||
@@ -10767,7 +10866,10 @@ win_getid([{win} [, {tab}]]) *win_getid()*
|
||||
|
||||
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
|
||||
"unknown" window {nr} not found
|
||||
@@ -10816,7 +10918,7 @@ win_screenpos({nr}) *win_screenpos()*
|
||||
GetWinid()->win_screenpos()
|
||||
<
|
||||
win_splitmove({nr}, {target} [, {options}]) *win_splitmove()*
|
||||
Move the window {nr} to a new split of the window {target}.
|
||||
Move the window {nr} to a new split of the window {target}.
|
||||
This is similar to moving to {target}, creating a new window
|
||||
using |:split| but having the same contents as window {nr}, and
|
||||
then closing {nr}.
|
||||
@@ -11728,6 +11830,9 @@ like this: >
|
||||
|
||||
:call filename#funcname()
|
||||
|
||||
These functions are always global, in Vim9 script "g:" needs to be used: >
|
||||
:call g:filename#funcname()
|
||||
|
||||
When such a function is called, and it is not defined yet, Vim will search the
|
||||
"autoload" directories in 'runtimepath' for a script file called
|
||||
"filename.vim". For example "~/.vim/autoload/filename.vim". That file should
|
||||
@@ -11739,7 +11844,11 @@ then define the function like this: >
|
||||
|
||||
The file name and the name used before the # in the function must match
|
||||
exactly, and the defined function must have the name exactly as it will be
|
||||
called.
|
||||
called. In Vim9 script the "g:" prefix must be used: >
|
||||
function g:filename#funcname()
|
||||
|
||||
or for a compiled function: >
|
||||
def g:filename#funcname()
|
||||
|
||||
It is possible to use subdirectories. Every # in the function name works like
|
||||
a path separator. Thus when calling a function: >
|
||||
@@ -11822,6 +11931,9 @@ This does NOT work: >
|
||||
==============================================================================
|
||||
7. Commands *expression-commands*
|
||||
|
||||
Note: in Vim9 script `:let` is used for variable declaration, not assignment.
|
||||
An assignment leaves out the `:let` command. |vim9-declaration|
|
||||
|
||||
:let {var-name} = {expr1} *:let* *E18*
|
||||
Set internal variable {var-name} to the result of the
|
||||
expression {expr1}. The variable will get the type
|
||||
@@ -12044,12 +12156,14 @@ text...
|
||||
s: script-local variables
|
||||
l: local function variables
|
||||
v: Vim variables.
|
||||
This does not work in Vim9 script. |vim9-declaration|
|
||||
|
||||
:let List the values of all variables. The type of the
|
||||
variable is indicated before the value:
|
||||
<nothing> String
|
||||
# Number
|
||||
* Funcref
|
||||
This does not work in Vim9 script. |vim9-declaration|
|
||||
|
||||
:unl[et][!] {name} ... *:unlet* *:unl* *E108* *E795*
|
||||
Remove the internal variable {name}. Several variable
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*gui_x11.txt* For Vim version 8.2. Last change: 2019 May 05
|
||||
*gui_x11.txt* For Vim version 8.2. Last change: 2020 Jun 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -356,6 +356,9 @@ need to set those up in some sort of gtkrc file. You'll have to refer
|
||||
to the GTK documentation, however little there is, on how to do this.
|
||||
See http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html
|
||||
for more information.
|
||||
*gtk3-slow*
|
||||
If you are using GTK3 and Vim appears to be slow, try setting the environment
|
||||
variable $GDK_RENDERING to "image".
|
||||
|
||||
|
||||
Tooltip Colors ~
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 8.2. Last change: 2020 May 26
|
||||
*index.txt* For Vim version 8.2. Last change: 2020 May 31
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -85,7 +85,7 @@ tag char action in Insert mode ~
|
||||
|i_CTRL-R_CTRL-P| CTRL-R CTRL-P {register}
|
||||
insert the contents of a register literally
|
||||
and fix indent.
|
||||
CTRL-S (used for terminal control flow)
|
||||
CTRL-S not used or used for terminal control flow
|
||||
|i_CTRL-T| CTRL-T insert one shiftwidth of indent in current
|
||||
line
|
||||
|i_CTRL-U| CTRL-U delete all entered characters in the current
|
||||
@@ -220,9 +220,9 @@ tag char note action in Normal mode ~
|
||||
|CTRL-N| CTRL-N 1 same as "j"
|
||||
|CTRL-O| CTRL-O 1 go to N older entry in jump list
|
||||
|CTRL-P| CTRL-P 1 same as "k"
|
||||
CTRL-Q (used for terminal control flow)
|
||||
CTRL-Q not used, or used for terminal control flow
|
||||
|CTRL-R| CTRL-R 2 redo changes which were undone with 'u'
|
||||
CTRL-S (used for terminal control flow)
|
||||
CTRL-S not used, or used for terminal control flow
|
||||
|CTRL-T| CTRL-T jump to N older Tag in tag list
|
||||
|CTRL-U| CTRL-U scroll N lines Upwards (default: half a
|
||||
screen)
|
||||
@@ -828,7 +828,7 @@ tag char note action in Normal mode ~
|
||||
|zD| zD delete folds recursively
|
||||
|zE| zE eliminate all folds
|
||||
|zF| zF create a fold for N lines
|
||||
|zG| zG temporarily mark word as good spelled word
|
||||
|zG| zG temporarily mark word as correctly spelled
|
||||
|zH| zH when 'wrap' off scroll half a screenwidth
|
||||
to the right
|
||||
|zL| zL when 'wrap' off scroll half a screenwidth
|
||||
@@ -837,7 +837,7 @@ tag char note action in Normal mode ~
|
||||
|zN| zN set 'foldenable'
|
||||
|zO| zO open folds recursively
|
||||
|zR| zR set 'foldlevel' to the deepest fold
|
||||
|zW| zW temporarily mark word as bad spelled word
|
||||
|zW| zW temporarily mark word as incorrectly spelled
|
||||
|zX| zX re-apply 'foldlevel'
|
||||
|z^| z^ cursor on line N (default line above
|
||||
window), otherwise like "z-"
|
||||
@@ -849,7 +849,7 @@ tag char note action in Normal mode ~
|
||||
position the cursor at the end (right side)
|
||||
of the screen
|
||||
|zf| zf{motion} create a fold for Nmove text
|
||||
|zg| zg permanently mark word as good spelled word
|
||||
|zg| zg permanently mark word as correctly spelled
|
||||
|zh| zh when 'wrap' off scroll screen N characters
|
||||
to the right
|
||||
|zi| zi toggle 'foldenable'
|
||||
@@ -870,7 +870,7 @@ tag char note action in Normal mode ~
|
||||
|zuW| zuW undo |zW|
|
||||
|zuG| zuG undo |zG|
|
||||
|zv| zv open enough folds to view the cursor line
|
||||
|zw| zw permanently mark word as bad spelled word
|
||||
|zw| zw permanently mark word as incorrectly spelled
|
||||
|zx| zx re-apply 'foldlevel' and do "zv"
|
||||
|zz| zz redraw, cursor line at center of window
|
||||
|z<Left>| z<Left> same as "zh"
|
||||
@@ -1056,7 +1056,7 @@ tag command action in Command-line editing mode ~
|
||||
|c_CTRL-R_CTRL-O| CTRL-R CTRL-O {regname}
|
||||
insert the contents of a register or object
|
||||
under the cursor literally
|
||||
CTRL-S (used for terminal control flow)
|
||||
CTRL-S not used, or used for terminal control flow
|
||||
|c_CTRL-T| CTRL-T previous match when 'incsearch' is active
|
||||
|c_CTRL-U| CTRL-U remove all characters
|
||||
|c_CTRL-V| CTRL-V insert next non-digit literally, insert three
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*intro.txt* For Vim version 8.2. Last change: 2019 Nov 11
|
||||
*intro.txt* For Vim version 8.2. Last change: 2020 May 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -121,14 +121,16 @@ http://www.vim.org/maillist.php
|
||||
|
||||
Bug reports: *bugs* *bug-reports* *bugreport.vim*
|
||||
|
||||
There are two ways to report bugs, both work:
|
||||
1. Send bug reports to: Vim Developers <vim-dev@vim.org>
|
||||
There are three ways to report bugs:
|
||||
1. Open an issue on GitHub: https://github.com/vim/vim/issues
|
||||
The text will be forwarded to the vim-dev maillist.
|
||||
2. For issues with runtime files, look in the header for an email address or
|
||||
any other way to report it to the maintainer.
|
||||
3. Send bug reports to: Vim Developers <vim-dev@vim.org>
|
||||
This is a maillist, you need to become a member first and many people will
|
||||
see the message. If you don't want that, e.g. because it is a security
|
||||
issue, send it to <bugs@vim.org>, this only goes to the Vim maintainer
|
||||
(that's Bram).
|
||||
2. Open an issue on GitHub: https://github.com/vim/vim/issues
|
||||
The text will be forwarded to the vim-dev maillist.
|
||||
|
||||
Please be brief; all the time that is spent on answering mail is subtracted
|
||||
from the time that is spent on improving Vim! Always give a reproducible
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*mlang.txt* For Vim version 8.2. Last change: 2019 May 05
|
||||
*mlang.txt* For Vim version 8.2. Last change: 2020 Jun 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -37,6 +37,7 @@ use of "-" and "_".
|
||||
:lan[guage] mes[sages]
|
||||
:lan[guage] cty[pe]
|
||||
:lan[guage] tim[e]
|
||||
:lan[guage] col[late]
|
||||
Print the current language (aka locale).
|
||||
With the "messages" argument the language used for
|
||||
messages is printed. Technical: LC_MESSAGES.
|
||||
@@ -44,15 +45,19 @@ use of "-" and "_".
|
||||
character encoding is printed. Technical: LC_CTYPE.
|
||||
With the "time" argument the language used for
|
||||
strftime() is printed. Technical: LC_TIME.
|
||||
With the "collate" argument the language used for
|
||||
collation order is printed. Technical: LC_COLLATE.
|
||||
Without argument all parts of the locale are printed
|
||||
(this is system dependent).
|
||||
The current language can also be obtained with the
|
||||
|v:lang|, |v:ctype| and |v:lc_time| variables.
|
||||
|v:lang|, |v:ctype|, |v:collate| and |v:lc_time|
|
||||
variables.
|
||||
|
||||
:lan[guage] {name}
|
||||
:lan[guage] mes[sages] {name}
|
||||
:lan[guage] cty[pe] {name}
|
||||
:lan[guage] tim[e] {name}
|
||||
:lan[guage] col[late] {name}
|
||||
Set the current language (aka locale) to {name}.
|
||||
The locale {name} must be a valid locale on your
|
||||
system. Some systems accept aliases like "en" or
|
||||
@@ -72,7 +77,10 @@ use of "-" and "_".
|
||||
With the "time" argument the language used for time
|
||||
and date messages is set. This affects strftime().
|
||||
This sets $LC_TIME.
|
||||
Without an argument both are set, and additionally
|
||||
With the "collate" argument the language used for the
|
||||
collation order is set. This affects sorting of
|
||||
characters. This sets $LC_COLLATE.
|
||||
Without an argument all are set, and additionally
|
||||
$LANG is set.
|
||||
When compiled with the |+float| feature the LC_NUMERIC
|
||||
value will always be set to "C", so that floating
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.2. Last change: 2020 May 03
|
||||
*options.txt* For Vim version 8.2. Last change: 2020 Jun 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -5232,7 +5232,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
< If your terminal can't overrule the mouse events going to the
|
||||
application, use: >
|
||||
:set mouse=nvi
|
||||
< The you can press ":", select text for the system, and press Esc to go
|
||||
< Then you can press ":", select text for the system, and press Esc to go
|
||||
back to Vim using the mouse events.
|
||||
In |defaults.vim| "nvi" is used if the 'term' option is not matching
|
||||
"xterm".
|
||||
@@ -5434,8 +5434,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
(without "unsigned" it would become "9-2021").
|
||||
Using CTRL-A on "2020" in "9-2020" results in "9-2021"
|
||||
(without "unsigned" it would become "9-2019").
|
||||
Using CTRL-X on "0" or "18446744073709551615" (2^64) has
|
||||
no effect, overflow is prevented.
|
||||
Using CTRL-X on "0" or CTRL-A on "18446744073709551615"
|
||||
(2^64 - 1) has no effect, overflow is prevented.
|
||||
Numbers which simply begin with a digit in the range 1-9 are always
|
||||
considered decimal. This also happens for numbers that are not
|
||||
recognized as octal or hex.
|
||||
@@ -7105,6 +7105,16 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
up to the first character that is not an ASCII letter or number and
|
||||
not a dash. Also see |set-spc-auto|.
|
||||
|
||||
*'spelloptions'* *'spo'*
|
||||
'spelloptions' 'spo' string (default "")
|
||||
local to buffer
|
||||
{not available when compiled without the |+syntax|
|
||||
feature}
|
||||
A comma separated list of options for spell checking:
|
||||
camel When a word is CamelCased, assume "Cased" is a
|
||||
separate word: every upper-case character in a word
|
||||
that comes after a lower case character indicates the
|
||||
start of a new word.
|
||||
|
||||
*'spellsuggest'* *'sps'*
|
||||
'spellsuggest' 'sps' string (default "best")
|
||||
@@ -7696,7 +7706,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'term' string (default is $TERM, if that fails:
|
||||
in the GUI: "builtin_gui"
|
||||
on Amiga: "amiga"
|
||||
on BeOS: "beos-ansi"
|
||||
on Haiku: "xterm"
|
||||
on Mac: "mac-ansi"
|
||||
on MiNT: "vt52"
|
||||
@@ -8547,8 +8556,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'virtualedit'* *'ve'*
|
||||
'virtualedit' 've' string (default "")
|
||||
global
|
||||
{not available when compiled without the
|
||||
|+virtualedit| feature}
|
||||
A comma separated list of these words:
|
||||
block Allow virtual editing in Visual block mode.
|
||||
insert Allow virtual editing in Insert mode.
|
||||
|
||||
@@ -1,320 +1,13 @@
|
||||
*os_beos.txt* For Vim version 8.2. Last change: 2016 Mar 28
|
||||
*os_beos.txt* For Vim version 8.2. Last change: 2020 Jun 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
*BeOS* *BeBox*
|
||||
This is a port of Vim 5.1 to the BeOS Preview Release 2 (also known as PR2)
|
||||
or later.
|
||||
*beos* *BeOS* *BeBox*
|
||||
This file used to contain particularities for the BeOS port of Vim.
|
||||
|
||||
This file contains the particularities for the BeBox/BeOS version of Vim. For
|
||||
matters not discussed in this file, Vim behaves very much like the Unix
|
||||
|os_unix.txt| version.
|
||||
The BeOS support was removed in patch 8.2.0849.
|
||||
|
||||
1. General |beos-general|
|
||||
2. Compiling Vim |beos-compiling|
|
||||
3. Timeout in the Terminal |beos-timeout|
|
||||
4. Unicode vs. Latin1 |beos-unicode|
|
||||
5. The BeOS GUI |beos-gui|
|
||||
6. The $VIM directory |beos-vimdir|
|
||||
7. Drag & Drop |beos-dragndrop|
|
||||
8. Single Launch vs. Multiple
|
||||
Launch |beos-launch|
|
||||
9. Fonts |beos-fonts|
|
||||
10. The meta key modifier |beos-meta|
|
||||
11. Mouse key mappings |beos-mouse|
|
||||
12. Color names |beos-colors|
|
||||
13. Compiling with Perl |beos-perl|
|
||||
|
||||
|
||||
1. General *beos-general*
|
||||
|
||||
The default syntax highlighting mostly works with different foreground colors
|
||||
to highlight items. This works best if you set your Terminal window to a
|
||||
darkish background and light letters. Some middle-grey background (for
|
||||
instance (r,g,b)=(168,168,168)) with black letters also works nicely. If you
|
||||
use the default light background and dark letters, it may look better to
|
||||
simply reverse the notion of foreground and background color settings. To do
|
||||
this, add this to your .vimrc file (where <Esc> may need to be replaced with
|
||||
the escape character): >
|
||||
|
||||
:if &term == "beos-ansi"
|
||||
: set t_AB=<Esc>[3%dm
|
||||
: set t_AF=<Esc>[4%dm
|
||||
:endif
|
||||
|
||||
|
||||
2. Compiling Vim *beos-compiling*
|
||||
|
||||
From the Advanced Access Preview Release (AAPR) on, Vim can be configured with
|
||||
the standard configure script. To get the compiler and its flags right, use
|
||||
the following command-line in the shell (you can cut and paste it in one go):
|
||||
|
||||
CC=$BE_C_COMPILER CFLAGS="$BE_DEFAULT_C_FLAGS -O7" \
|
||||
./configure --prefix=/boot/home/config
|
||||
|
||||
$BE_C_COMPILER is usually "mwcc", $BE_DEFAULT_C_FLAGS is usually "-I- -I."
|
||||
|
||||
When configure has run, and you wish to enable GUI support, you must edit the
|
||||
config.mk file so that the lines with GUI_xxx refer to $(BEOSGUI_xxx) instead
|
||||
of $(NONE_xxx).
|
||||
Alternatively you can make this change in the Makefile; it will have a
|
||||
more permanent effect. Search for "NONE_".
|
||||
|
||||
After compilation you need to add the resources to the binary. Add the
|
||||
following few lines near the end (before the line with "exit $exit_value") of
|
||||
the link.sh script to do this automatically.
|
||||
|
||||
rmattr BEOS:TYPE vim
|
||||
copyres os_beos.rsrc vim
|
||||
mimeset vim
|
||||
|
||||
Also, create a dummy file "strip":
|
||||
|
||||
#!/bin/sh
|
||||
mimeset $1
|
||||
exit 0
|
||||
|
||||
You will need it when using "make install" to install Vim.
|
||||
|
||||
Now type "make" to compile Vim, then "make install" to install it.
|
||||
|
||||
If you want to install Vim by hand, you must copy Vim to $HOME/config/bin, and
|
||||
create a bunch of symlinks to it ({g,r,rg}{vim,ex,view}). Furthermore you must
|
||||
copy Vim's configuration files to $HOME/config/share/vim:
|
||||
vim-5.0s/{*.vim,doc,syntax}. For completeness, you should also copy the nroff
|
||||
manual pages to $HOME/config/man/man1. Don't forget ctags/ctags and xxd/xxd!
|
||||
|
||||
Obviously, you need the unlimited linker to actually link Vim. See
|
||||
http://www.metrowerks.com for purchasing the CodeWarrior compiler for BeOS.
|
||||
There are currently no other linkers that can do the job.
|
||||
|
||||
This won't be able to include the Perl or Python interfaces even if
|
||||
you have the appropriate files installed. |beos-perl|
|
||||
|
||||
|
||||
3. Timeout in the Terminal *beos-timeout*
|
||||
|
||||
Because some POSIX/UNIX features are still missing[1], there is no direct OS
|
||||
support for read-with-timeout in the Terminal. This would mean that you cannot
|
||||
use :mappings of more than one character, unless you also :set notimeout.
|
||||
|'timeout'|
|
||||
|
||||
To circumvent this problem, I added a workaround to provide the necessary
|
||||
input with timeout by using an extra thread which reads ahead one character.
|
||||
As a side effect, it also makes Vim recognize when the Terminal window
|
||||
resizes.
|
||||
|
||||
Function keys are not supported in the Terminal since they produce very
|
||||
indistinctive character sequences.
|
||||
|
||||
These problems do not exist in the GUI.
|
||||
|
||||
[1]: there is no select() on file descriptors; also the termios VMIN and VTIME
|
||||
settings do not seem to work properly. This has been the case since DR7 at
|
||||
least and still has not been fixed as of PR2.
|
||||
|
||||
*beos-unicode*
|
||||
4. Unicode vs. Latin1 *beos-utf8*
|
||||
|
||||
BeOS uses Unicode and UTF-8 for text strings (16-bit characters encoded to
|
||||
8-bit characters). Vim assumes ISO-Latin1 or other 8-bit character codes.
|
||||
This does not produce the desired results for non-ASCII characters. Try the
|
||||
command :digraphs to see. If they look messed up, use :set isprint=@ to
|
||||
(slightly) improve the display of ISO-Latin1 characters 128-255. This works
|
||||
better in the GUI, depending on which font you use (below).
|
||||
|
||||
You may also use the /boot/bin/xtou command to convert UTF-8 files from (xtou
|
||||
-f iso1 filename) or to (xtou -t iso1 filename) ISO-Latin1 characters.
|
||||
|
||||
|
||||
5. The BeOS GUI *beos-gui*
|
||||
|
||||
The BeOS GUI is no longer included. It was not maintained for a while and
|
||||
most likely didn't work. If you want to work on this: get the Vim 6.x version
|
||||
and merge it back in.
|
||||
|
||||
|
||||
6. The $VIM directory *beos-vimdir*
|
||||
|
||||
$VIM is the symbolic name for the place where Vim's support files are stored.
|
||||
The default value for $VIM is set at compile time and can be determined with >
|
||||
|
||||
:version
|
||||
|
||||
The normal value is /boot/home/config/share/vim. If you don't like it you can
|
||||
set the VIM environment variable to override this, or set 'helpfile' in your
|
||||
.vimrc: >
|
||||
|
||||
:if version >= 500
|
||||
: set helpfile=~/vim/vim54/doc/help.txt
|
||||
: syntax on
|
||||
:endif
|
||||
|
||||
|
||||
7. Drag & Drop *beos-dragndrop*
|
||||
|
||||
You can drop files and directories on either the Vim icon (starts a new Vim
|
||||
session, unless you use the File Types application to set Vim to be "Single
|
||||
Launch") or on the Vim window (starts editing the files). Dropping a folder
|
||||
sets Vim's current working directory. |:cd| |:pwd| If you drop files or
|
||||
folders with either SHIFT key pressed, Vim changes directory to the folder
|
||||
that contains the first item dropped. When starting Vim, there is no need to
|
||||
press shift: Vim behaves as if you do.
|
||||
|
||||
Files dropped set the current argument list. |argument-list|
|
||||
|
||||
|
||||
8. Single Launch vs. Multiple Launch *beos-launch*
|
||||
|
||||
As distributed Vim's Application Flags (as seen in the FileTypes preference)
|
||||
are set to Multiple Launch. If you prefer, you can set them to Single Launch
|
||||
instead. Attempts to start a second copy of Vim will cause the first Vim to
|
||||
open the files instead. This works from the Tracker but also from the command
|
||||
line. In the latter case, non-file (option) arguments are not supported.
|
||||
|
||||
NB: Only the GUI version has a BApplication (and hence Application Flags).
|
||||
This section does not apply to the GUI-less version, should you compile one.
|
||||
|
||||
|
||||
9. Fonts *beos-fonts*
|
||||
|
||||
Set fonts with >
|
||||
|
||||
:set guifont=Courier10_BT/Roman/10
|
||||
|
||||
where the first part is the font family, the second part the style, and the
|
||||
third part the size. You can use underscores instead of spaces in family and
|
||||
style.
|
||||
|
||||
Best results are obtained with monospaced fonts (such as Courier). Vim
|
||||
attempts to use all fonts in B_FIXED_SPACING mode but apparently this does not
|
||||
work for proportional fonts (despite what the BeBook says).
|
||||
|
||||
Vim also tries to use the B_ISO8859_1 encoding, also known as ISO Latin 1.
|
||||
This also does not work for all fonts. It does work for Courier, but not for
|
||||
ProFontISOLatin1/Regular (strangely enough). You can verify this by giving the >
|
||||
|
||||
:digraphs
|
||||
|
||||
command, which lists a bunch of characters with their ISO Latin 1 encoding.
|
||||
If, for instance, there are "box" characters among them, or the last character
|
||||
isn't a dotted-y, then for this font the encoding does not work.
|
||||
|
||||
If the font you specify is unavailable, you get the system fixed font.
|
||||
|
||||
Standard fixed-width system fonts are:
|
||||
|
||||
ProFontISOLatin1/Regular
|
||||
Courier10_BT/Roman
|
||||
Courier10_BT/Italic
|
||||
Courier10_BT/Bold
|
||||
Courier10_BT/Bold_Italic
|
||||
|
||||
Standard proportional system fonts are:
|
||||
|
||||
Swis721_BT/Roman
|
||||
Swis721_BT/Italic
|
||||
Swis721_BT/Bold
|
||||
Swis721_BT/Bold_Italic
|
||||
Dutch801_Rm_BT/Roman
|
||||
Dutch801_Rm_BT/Italic
|
||||
Dutch801_Rm_BT/Bold
|
||||
Dutch801_Rm_BT/Bold_Italic
|
||||
Baskerville/Roman
|
||||
Baskerville/Italic
|
||||
Baskerville/Bold
|
||||
Baskerville/Bold_Italic
|
||||
SymbolProp_BT/Regular
|
||||
|
||||
Try some of them, just for fun.
|
||||
|
||||
|
||||
10. The meta key modifier *beos-meta*
|
||||
|
||||
The META key modifier is obtained by the left or right OPTION keys. This is
|
||||
because the ALT (aka COMMAND) keys are not passed to applications.
|
||||
|
||||
|
||||
11. Mouse key mappings *beos-mouse*
|
||||
|
||||
Vim calls the various mouse buttons LeftMouse, MiddleMouse and RightMouse. If
|
||||
you use the default Mouse preference settings these names indeed correspond to
|
||||
reality. Vim uses this mapping:
|
||||
|
||||
Button 1 -> LeftMouse,
|
||||
Button 2 -> RightMouse,
|
||||
Button 3 -> MiddleMouse.
|
||||
|
||||
If your mouse has fewer than 3 buttons you can provide your own mapping from
|
||||
mouse clicks with modifier(s) to other mouse buttons. See the swapmouse
|
||||
package for an example: |gui-mouse-mapping|
|
||||
$VIMRUNTIME/pack/dist/opt/swapmouse/plugin/swapmouse.vim
|
||||
|
||||
|
||||
12. Color names *beos-colors*
|
||||
|
||||
Vim has a number of color names built-in. Additional names are read from the
|
||||
file $VIMRUNTIME/rgb.txt, if present. This file is basically the color
|
||||
database from X. Names used from this file are cached for efficiency.
|
||||
|
||||
|
||||
13. Compiling with Perl *beos-perl*
|
||||
|
||||
Compiling with Perl support enabled is slightly tricky. The Metrowerks
|
||||
compiler has some strange ideas where to search for include files. Since
|
||||
several include files with Perl have the same names as some Vim header
|
||||
files, the wrong ones get included. To fix this, run the following Perl
|
||||
script while in the vim-5.0/src directory: >
|
||||
|
||||
preproc.pl > perl.h
|
||||
|
||||
#!/bin/env perl
|
||||
# Simple #include expander, just good enough for the Perl header files.
|
||||
|
||||
use strict;
|
||||
use IO::File;
|
||||
use Config;
|
||||
|
||||
sub doinclude
|
||||
{
|
||||
my $filename = $_[0];
|
||||
my $fh = new IO::File($filename, "r");
|
||||
if (defined $fh) {
|
||||
print "/* Start of $filename */\n";
|
||||
|
||||
while (<$fh>) {
|
||||
if (/^#include "(.*)"/) {
|
||||
doinclude($1);
|
||||
print "/* Back in $filename */\n";
|
||||
} else {
|
||||
print $_;
|
||||
}
|
||||
}
|
||||
print "/* End of $filename */\n";
|
||||
|
||||
undef $fh;
|
||||
} else {
|
||||
print "/* Cannot open $filename */\n";
|
||||
print "#include \"$filename\"\n";
|
||||
}
|
||||
}
|
||||
|
||||
chdir $Config{installarchlib}."/CORE";
|
||||
doinclude "perl.h";
|
||||
|
||||
It expands the "perl.h" header file, using only other Perl header files.
|
||||
|
||||
Now you can configure & make Vim with the --enable-perlinterp option.
|
||||
Be warned though that this adds about 616 kilobytes to the size of Vim!
|
||||
Without Perl, Vim with default features and GUI is about 575K, with Perl
|
||||
it is about 1191K.
|
||||
|
||||
-Olaf Seibert
|
||||
|
||||
[Note: these addresses no longer work:]
|
||||
<rhialto@polder.ubc.kun.nl>
|
||||
http://polder.ubc.kun.nl/~rhialto/be
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*os_vms.txt* For Vim version 8.2. Last change: 2019 Jan 29
|
||||
*os_vms.txt* For Vim version 8.2. Last change: 2020 Jun 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL
|
||||
@@ -432,7 +432,6 @@ Terminal entry not found in termcap
|
||||
builtin_gui
|
||||
builtin_riscos
|
||||
builtin_amiga
|
||||
builtin_beos-ansi
|
||||
builtin_ansi
|
||||
builtin_vt320
|
||||
builtin_vt52
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickfix.txt* For Vim version 8.2. Last change: 2020 Jan 06
|
||||
*quickfix.txt* For Vim version 8.2. Last change: 2020 May 31
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1947,19 +1947,24 @@ under the current directory tree. The file path may need to be simplified to a
|
||||
common parent directory.
|
||||
|
||||
The displayed text can be customized by setting the 'quickfixtextfunc' option
|
||||
to a Vim function. This function will be called with a dict argument for
|
||||
every entry in a quickfix or a location list. The dict argument will have the
|
||||
following fields:
|
||||
to a Vim function. This function will be called with a dict argument and
|
||||
should return a List of strings to be displayed in the quickfix or location
|
||||
list window. The dict argument will have the following fields:
|
||||
|
||||
quickfix set to 1 when called for a quickfix list and 0 when called for
|
||||
a location list.
|
||||
winid for a location list, set to the id of the window with the
|
||||
location list. For a quickfix list, set to 0. Can be used in
|
||||
getloclist() to get the location list entry.
|
||||
id quickfix or location list identifier
|
||||
idx index of the entry in the quickfix or location list
|
||||
start_idx index of the first entry for which text should be returned
|
||||
end_idx index of the last entry for which text should be returned
|
||||
|
||||
The function should return a single line of text to display in the quickfix
|
||||
window for the entry identified by idx. The function can obtain information
|
||||
about the current entry using the |getqflist()| function and specifying the
|
||||
quickfix list identifier "id" and the entry index "idx".
|
||||
window for each entry from start_idx to end_idx. The function can obtain
|
||||
information about the entries using the |getqflist()| function and specifying
|
||||
the quickfix list identifier "id". For a location list, getloclist() function
|
||||
can be used with the 'winid' argument.
|
||||
|
||||
If a quickfix or location list specific customization is needed, then the
|
||||
'quickfixtextfunc' attribute of the list can be set using the |setqflist()| or
|
||||
@@ -1974,11 +1979,14 @@ Example: >
|
||||
call setqflist([], ' ', {'lines' : v:oldfiles, 'efm' : '%f',
|
||||
\ 'quickfixtextfunc' : 'QfOldFiles'})
|
||||
func QfOldFiles(info)
|
||||
" get information about the specific quickfix entry
|
||||
let e = getqflist({'id' : a:info.id, 'idx' : a:info.idx,
|
||||
\ 'items' : 1}).items[0]
|
||||
" return the simplified file name
|
||||
return fnamemodify(bufname(e.bufnr), ':p:.')
|
||||
" get information about a range of quickfix entries
|
||||
let items = getqflist({'id' : a:info.id, 'items' : 1}).items
|
||||
let l = []
|
||||
for idx in range(a:info.start_idx - 1, a:info.end_idx - 1)
|
||||
" use the simplified file name
|
||||
call add(l, fnamemodify(bufname(items[idx].bufnr), ':p:.'))
|
||||
endfor
|
||||
return l
|
||||
endfunc
|
||||
<
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 8.2. Last change: 2020 Jan 17
|
||||
*quickref.txt* For Vim version 8.2. Last change: 2020 Jun 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -851,6 +851,7 @@ Short explanation of each option: *option-list*
|
||||
'pythonthreedll' name of the Python 3 dynamic library
|
||||
'pythonthreehome' name of the Python 3 home directory
|
||||
'pyxversion' 'pyx' Python version used for pyx* commands
|
||||
'quickfixtextfunc' 'qftf' function for the text in the quickfix window
|
||||
'quoteescape' 'qe' escape characters used in a string
|
||||
'readonly' 'ro' disallow writing the buffer
|
||||
'redrawtime' 'rdt' timeout for 'hlsearch' and |:match| highlighting
|
||||
@@ -909,6 +910,7 @@ Short explanation of each option: *option-list*
|
||||
'spellcapcheck' 'spc' pattern to locate end of a sentence
|
||||
'spellfile' 'spf' files where |zg| and |zw| store words
|
||||
'spelllang' 'spl' language(s) to do spell checking for
|
||||
'spelloptions' 'spo' options for spell checking
|
||||
'spellsuggest' 'sps' method(s) used to suggest spelling corrections
|
||||
'splitbelow' 'sb' new window from split is below the current one
|
||||
'splitright' 'spr' new window is put right of the current one
|
||||
|
||||
@@ -163,6 +163,11 @@ q Stops recording. (Implementation note: The 'q' that
|
||||
result of evaluating the expression is executed as an
|
||||
Ex command.
|
||||
Mappings are not recognized in these commands.
|
||||
When the |line-continuation| character (\) is present
|
||||
at the beginning of a line in a linewise register,
|
||||
then it is combined with the previous line. This is
|
||||
useful for yanking and executing parts of a Vim
|
||||
script.
|
||||
Future: Will execute the register for each line in the
|
||||
address range.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*spell.txt* For Vim version 8.2. Last change: 2019 Aug 16
|
||||
*spell.txt* For Vim version 8.2. Last change: 2020 Jun 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -215,6 +215,9 @@ When there is a line break right after a sentence the highlighting of the next
|
||||
line may be postponed. Use |CTRL-L| when needed. Also see |set-spc-auto| for
|
||||
how it can be set automatically when 'spelllang' is set.
|
||||
|
||||
The 'spelloptions' option has a few more flags that influence the way spell
|
||||
checking works.
|
||||
|
||||
Vim counts the number of times a good word is encountered. This is used to
|
||||
sort the suggestions: words that have been seen before get a small bonus,
|
||||
words that have been seen often get a bigger bonus. The COMMON item in the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 8.2. Last change: 2020 Feb 29
|
||||
*syntax.txt* For Vim version 8.2. Last change: 2020 Jun 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1214,11 +1214,13 @@ DESKTOP *desktop.vim* *ft-desktop-syntax*
|
||||
|
||||
Primary goal of this syntax file is to highlight .desktop and .directory files
|
||||
according to freedesktop.org standard:
|
||||
http://standards.freedesktop.org/desktop-entry-spec/latest/
|
||||
But actually almost none implements this standard fully. Thus it will
|
||||
highlight all Unix ini files. But you can force strict highlighting according
|
||||
to standard by placing this in your vimrc file: >
|
||||
:let enforce_freedesktop_standard = 1
|
||||
https://specifications.freedesktop.org/desktop-entry-spec/latest/
|
||||
To highlight nonstandard extensions that does not begin with X-, set >
|
||||
let g:desktop_enable_nonstd = 1
|
||||
Note that this may cause wrong highlight.
|
||||
To highlight KDE-reserved features, set >
|
||||
let g:desktop_enable_kde = 1
|
||||
g:desktop_enable_kde follows g:desktop_enable_nonstd if not supplied
|
||||
|
||||
|
||||
DIFF *diff.vim*
|
||||
@@ -4879,7 +4881,12 @@ term={attr-list} *attr-list* *highlight-term* *E418*
|
||||
have the same effect.
|
||||
"undercurl" is a curly underline. When "undercurl" is not possible
|
||||
then "underline" is used. In general "undercurl" and "strikethrough"
|
||||
is only available in the GUI. The color is set with |highlight-guisp|.
|
||||
are only available in the GUI and some terminals. The color is set
|
||||
with |highlight-guisp| or |highlight-ctermul|. You can try these
|
||||
termcap entries to make undercurl work in a terminal: >
|
||||
let &t_Cs = "\e[4:3m"
|
||||
let &t_Ce = "\e[4:0m"
|
||||
|
||||
|
||||
start={term-list} *highlight-start* *E422*
|
||||
stop={term-list} *term-list* *highlight-stop*
|
||||
|
||||
@@ -810,6 +810,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'pyx' options.txt /*'pyx'*
|
||||
'pyxversion' options.txt /*'pyxversion'*
|
||||
'qe' options.txt /*'qe'*
|
||||
'qftf' options.txt /*'qftf'*
|
||||
'quickfixtextfunc' options.txt /*'quickfixtextfunc'*
|
||||
'quote motion.txt /*'quote*
|
||||
'quoteescape' options.txt /*'quoteescape'*
|
||||
'rdt' options.txt /*'rdt'*
|
||||
@@ -913,11 +915,13 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'spellcapcheck' options.txt /*'spellcapcheck'*
|
||||
'spellfile' options.txt /*'spellfile'*
|
||||
'spelllang' options.txt /*'spelllang'*
|
||||
'spelloptions' options.txt /*'spelloptions'*
|
||||
'spellsuggest' options.txt /*'spellsuggest'*
|
||||
'spf' options.txt /*'spf'*
|
||||
'spl' options.txt /*'spl'*
|
||||
'splitbelow' options.txt /*'splitbelow'*
|
||||
'splitright' options.txt /*'splitright'*
|
||||
'spo' options.txt /*'spo'*
|
||||
'spr' options.txt /*'spr'*
|
||||
'sps' options.txt /*'sps'*
|
||||
'sr' options.txt /*'sr'*
|
||||
@@ -956,10 +960,12 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
't_&8' term.txt /*'t_&8'*
|
||||
't_8b' term.txt /*'t_8b'*
|
||||
't_8f' term.txt /*'t_8f'*
|
||||
't_8u' term.txt /*'t_8u'*
|
||||
't_@7' term.txt /*'t_@7'*
|
||||
't_AB' term.txt /*'t_AB'*
|
||||
't_AF' term.txt /*'t_AF'*
|
||||
't_AL' term.txt /*'t_AL'*
|
||||
't_AU' term.txt /*'t_AU'*
|
||||
't_BD' term.txt /*'t_BD'*
|
||||
't_BE' term.txt /*'t_BE'*
|
||||
't_CS' term.txt /*'t_CS'*
|
||||
@@ -1922,6 +1928,10 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
45.3 usr_45.txt /*45.3*
|
||||
45.4 usr_45.txt /*45.4*
|
||||
45.5 usr_45.txt /*45.5*
|
||||
46.1 usr_46.txt /*46.1*
|
||||
46.2 usr_46.txt /*46.2*
|
||||
46.3 usr_46.txt /*46.3*
|
||||
46.? usr_46.txt /*46.?*
|
||||
8g8 various.txt /*8g8*
|
||||
90.1 usr_90.txt /*90.1*
|
||||
90.2 usr_90.txt /*90.2*
|
||||
@@ -2587,6 +2597,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:lbuffer quickfix.txt /*:lbuffer*
|
||||
:lc editing.txt /*:lc*
|
||||
:lcd editing.txt /*:lcd*
|
||||
:lcd- editing.txt /*:lcd-*
|
||||
:lch editing.txt /*:lch*
|
||||
:lchdir editing.txt /*:lchdir*
|
||||
:lcl quickfix.txt /*:lcl*
|
||||
@@ -2894,6 +2905,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:put change.txt /*:put*
|
||||
:pw editing.txt /*:pw*
|
||||
:pwd editing.txt /*:pwd*
|
||||
:pwd-verbose editing.txt /*:pwd-verbose*
|
||||
:py if_pyth.txt /*:py*
|
||||
:py3 if_pyth.txt /*:py3*
|
||||
:py3do if_pyth.txt /*:py3do*
|
||||
@@ -3197,6 +3209,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:syn-file-remarks syntax.txt /*:syn-file-remarks*
|
||||
:syn-files syntax.txt /*:syn-files*
|
||||
:syn-fold syntax.txt /*:syn-fold*
|
||||
:syn-foldlevel syntax.txt /*:syn-foldlevel*
|
||||
:syn-include syntax.txt /*:syn-include*
|
||||
:syn-iskeyword syntax.txt /*:syn-iskeyword*
|
||||
:syn-keepend syntax.txt /*:syn-keepend*
|
||||
@@ -3277,6 +3290,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:tags tagsrch.txt /*:tags*
|
||||
:tc if_tcl.txt /*:tc*
|
||||
:tcd editing.txt /*:tcd*
|
||||
:tcd- editing.txt /*:tcd-*
|
||||
:tch editing.txt /*:tch*
|
||||
:tchdir editing.txt /*:tchdir*
|
||||
:tcl if_tcl.txt /*:tcl*
|
||||
@@ -3878,10 +3892,12 @@ E101 diff.txt /*E101*
|
||||
E102 diff.txt /*E102*
|
||||
E103 diff.txt /*E103*
|
||||
E104 digraph.txt /*E104*
|
||||
E1042 vim9.txt /*E1042*
|
||||
E105 mbyte.txt /*E105*
|
||||
E107 eval.txt /*E107*
|
||||
E108 eval.txt /*E108*
|
||||
E109 eval.txt /*E109*
|
||||
E1094 vim9.txt /*E1094*
|
||||
E11 cmdline.txt /*E11*
|
||||
E110 eval.txt /*E110*
|
||||
E111 eval.txt /*E111*
|
||||
@@ -4249,6 +4265,7 @@ E448 various.txt /*E448*
|
||||
E449 eval.txt /*E449*
|
||||
E45 message.txt /*E45*
|
||||
E452 eval.txt /*E452*
|
||||
E453 syntax.txt /*E453*
|
||||
E455 print.txt /*E455*
|
||||
E456 print.txt /*E456*
|
||||
E457 print.txt /*E457*
|
||||
@@ -4723,6 +4740,7 @@ E897 eval.txt /*E897*
|
||||
E898 channel.txt /*E898*
|
||||
E899 eval.txt /*E899*
|
||||
E90 message.txt /*E90*
|
||||
E900 eval.txt /*E900*
|
||||
E901 channel.txt /*E901*
|
||||
E902 channel.txt /*E902*
|
||||
E903 channel.txt /*E903*
|
||||
@@ -4829,6 +4847,7 @@ E994 eval.txt /*E994*
|
||||
E995 eval.txt /*E995*
|
||||
E996 eval.txt /*E996*
|
||||
E997 popup.txt /*E997*
|
||||
E998 eval.txt /*E998*
|
||||
E999 repeat.txt /*E999*
|
||||
EX intro.txt /*EX*
|
||||
EXINIT starting.txt /*EXINIT*
|
||||
@@ -5049,6 +5068,7 @@ SessionLoad-variable starting.txt /*SessionLoad-variable*
|
||||
SessionLoadPost autocmd.txt /*SessionLoadPost*
|
||||
ShellCmdPost autocmd.txt /*ShellCmdPost*
|
||||
ShellFilterPost autocmd.txt /*ShellFilterPost*
|
||||
SigUSR1 autocmd.txt /*SigUSR1*
|
||||
SourceCmd autocmd.txt /*SourceCmd*
|
||||
SourcePost autocmd.txt /*SourcePost*
|
||||
SourcePre autocmd.txt /*SourcePre*
|
||||
@@ -5440,20 +5460,7 @@ bars help.txt /*bars*
|
||||
base_font_name_list mbyte.txt /*base_font_name_list*
|
||||
basic.vim syntax.txt /*basic.vim*
|
||||
beep options.txt /*beep*
|
||||
beos-colors os_beos.txt /*beos-colors*
|
||||
beos-compiling os_beos.txt /*beos-compiling*
|
||||
beos-dragndrop os_beos.txt /*beos-dragndrop*
|
||||
beos-fonts os_beos.txt /*beos-fonts*
|
||||
beos-general os_beos.txt /*beos-general*
|
||||
beos-gui os_beos.txt /*beos-gui*
|
||||
beos-launch os_beos.txt /*beos-launch*
|
||||
beos-meta os_beos.txt /*beos-meta*
|
||||
beos-mouse os_beos.txt /*beos-mouse*
|
||||
beos-perl os_beos.txt /*beos-perl*
|
||||
beos-timeout os_beos.txt /*beos-timeout*
|
||||
beos-unicode os_beos.txt /*beos-unicode*
|
||||
beos-utf8 os_beos.txt /*beos-utf8*
|
||||
beos-vimdir os_beos.txt /*beos-vimdir*
|
||||
beos os_beos.txt /*beos*
|
||||
better-python-interface version7.txt /*better-python-interface*
|
||||
beval_bufnr-variable eval.txt /*beval_bufnr-variable*
|
||||
beval_col-variable eval.txt /*beval_col-variable*
|
||||
@@ -5792,6 +5799,7 @@ coding-style develop.txt /*coding-style*
|
||||
col() eval.txt /*col()*
|
||||
coldfusion.vim syntax.txt /*coldfusion.vim*
|
||||
collapse tips.txt /*collapse*
|
||||
collate-variable eval.txt /*collate-variable*
|
||||
color-xterm syntax.txt /*color-xterm*
|
||||
coloring syntax.txt /*coloring*
|
||||
colortest.vim syntax.txt /*colortest.vim*
|
||||
@@ -6332,6 +6340,7 @@ filetype.txt filetype.txt /*filetype.txt*
|
||||
filetypedetect-changed version6.txt /*filetypedetect-changed*
|
||||
filetypes filetype.txt /*filetypes*
|
||||
filewritable() eval.txt /*filewritable()*
|
||||
filler-lines windows.txt /*filler-lines*
|
||||
filter change.txt /*filter*
|
||||
filter() eval.txt /*filter()*
|
||||
find-manpage usr_12.txt /*find-manpage*
|
||||
@@ -6354,6 +6363,7 @@ fixed-7.1 version7.txt /*fixed-7.1*
|
||||
fixed-7.2 version7.txt /*fixed-7.2*
|
||||
fixed-7.3 version7.txt /*fixed-7.3*
|
||||
fixed-7.4 version7.txt /*fixed-7.4*
|
||||
flatten() eval.txt /*flatten()*
|
||||
flexwiki.vim syntax.txt /*flexwiki.vim*
|
||||
float-e eval.txt /*float-e*
|
||||
float-functions usr_41.txt /*float-functions*
|
||||
@@ -6910,6 +6920,7 @@ getjumplist() eval.txt /*getjumplist()*
|
||||
getlatestvimscripts-install pi_getscript.txt /*getlatestvimscripts-install*
|
||||
getline() eval.txt /*getline()*
|
||||
getloclist() eval.txt /*getloclist()*
|
||||
getmarklist() eval.txt /*getmarklist()*
|
||||
getmatches() eval.txt /*getmatches()*
|
||||
getmousepos() eval.txt /*getmousepos()*
|
||||
getpid() eval.txt /*getpid()*
|
||||
@@ -6917,6 +6928,7 @@ getpos() eval.txt /*getpos()*
|
||||
getqflist() eval.txt /*getqflist()*
|
||||
getqflist-examples quickfix.txt /*getqflist-examples*
|
||||
getreg() eval.txt /*getreg()*
|
||||
getreginfo() eval.txt /*getreginfo()*
|
||||
getregtype() eval.txt /*getregtype()*
|
||||
getscript pi_getscript.txt /*getscript*
|
||||
getscript-autoinstall pi_getscript.txt /*getscript-autoinstall*
|
||||
@@ -6987,6 +6999,7 @@ gstar pattern.txt /*gstar*
|
||||
gt tabpage.txt /*gt*
|
||||
gtk-css gui_x11.txt /*gtk-css*
|
||||
gtk-tooltip-colors gui_x11.txt /*gtk-tooltip-colors*
|
||||
gtk3-slow gui_x11.txt /*gtk3-slow*
|
||||
gu change.txt /*gu*
|
||||
gugu change.txt /*gugu*
|
||||
gui gui.txt /*gui*
|
||||
@@ -7115,6 +7128,7 @@ highlight-changed version4.txt /*highlight-changed*
|
||||
highlight-cterm syntax.txt /*highlight-cterm*
|
||||
highlight-ctermbg syntax.txt /*highlight-ctermbg*
|
||||
highlight-ctermfg syntax.txt /*highlight-ctermfg*
|
||||
highlight-ctermul syntax.txt /*highlight-ctermul*
|
||||
highlight-default syntax.txt /*highlight-default*
|
||||
highlight-font syntax.txt /*highlight-font*
|
||||
highlight-groups syntax.txt /*highlight-groups*
|
||||
@@ -8549,6 +8563,7 @@ quickfix-title quickfix.txt /*quickfix-title*
|
||||
quickfix-valid quickfix.txt /*quickfix-valid*
|
||||
quickfix-window quickfix.txt /*quickfix-window*
|
||||
quickfix-window-ID quickfix.txt /*quickfix-window-ID*
|
||||
quickfix-window-function quickfix.txt /*quickfix-window-function*
|
||||
quickfix.txt quickfix.txt /*quickfix.txt*
|
||||
quickref quickref.txt /*quickref*
|
||||
quickref.txt quickref.txt /*quickref.txt*
|
||||
@@ -8599,6 +8614,7 @@ read-messages insert.txt /*read-messages*
|
||||
read-only-share editing.txt /*read-only-share*
|
||||
read-stdin version5.txt /*read-stdin*
|
||||
readdir() eval.txt /*readdir()*
|
||||
readdirex() eval.txt /*readdirex()*
|
||||
readfile() eval.txt /*readfile()*
|
||||
readline.vim syntax.txt /*readline.vim*
|
||||
recording repeat.txt /*recording*
|
||||
@@ -8607,6 +8623,7 @@ recovery recover.txt /*recovery*
|
||||
recursive_mapping map.txt /*recursive_mapping*
|
||||
redo undo.txt /*redo*
|
||||
redo-register undo.txt /*redo-register*
|
||||
reduce() eval.txt /*reduce()*
|
||||
ref intro.txt /*ref*
|
||||
reference intro.txt /*reference*
|
||||
reference_toc help.txt /*reference_toc*
|
||||
@@ -8771,6 +8788,7 @@ search-offset pattern.txt /*search-offset*
|
||||
search-pattern pattern.txt /*search-pattern*
|
||||
search-range pattern.txt /*search-range*
|
||||
search-replace change.txt /*search-replace*
|
||||
searchcount() eval.txt /*searchcount()*
|
||||
searchdecl() eval.txt /*searchdecl()*
|
||||
searchforward-variable eval.txt /*searchforward-variable*
|
||||
searchpair() eval.txt /*searchpair()*
|
||||
@@ -8861,11 +8879,13 @@ slow-terminal term.txt /*slow-terminal*
|
||||
socket-interface channel.txt /*socket-interface*
|
||||
sort() eval.txt /*sort()*
|
||||
sorting change.txt /*sorting*
|
||||
sound-functions usr_41.txt /*sound-functions*
|
||||
sound_clear() eval.txt /*sound_clear()*
|
||||
sound_playevent() eval.txt /*sound_playevent()*
|
||||
sound_playfile() eval.txt /*sound_playfile()*
|
||||
sound_stop() eval.txt /*sound_stop()*
|
||||
soundfold() eval.txt /*soundfold()*
|
||||
source-vim9-script usr_46.txt /*source-vim9-script*
|
||||
space intro.txt /*space*
|
||||
spec-customizing pi_spec.txt /*spec-customizing*
|
||||
spec-how-to-use-it pi_spec.txt /*spec-how-to-use-it*
|
||||
@@ -9129,10 +9149,12 @@ t_%i term.txt /*t_%i*
|
||||
t_&8 term.txt /*t_&8*
|
||||
t_8b term.txt /*t_8b*
|
||||
t_8f term.txt /*t_8f*
|
||||
t_8u term.txt /*t_8u*
|
||||
t_@7 term.txt /*t_@7*
|
||||
t_AB term.txt /*t_AB*
|
||||
t_AF term.txt /*t_AF*
|
||||
t_AL term.txt /*t_AL*
|
||||
t_AU term.txt /*t_AU*
|
||||
t_BD term.txt /*t_BD*
|
||||
t_BE term.txt /*t_BE*
|
||||
t_CS term.txt /*t_CS*
|
||||
@@ -9504,6 +9526,7 @@ terminal-unix terminal.txt /*terminal-unix*
|
||||
terminal-use terminal.txt /*terminal-use*
|
||||
terminal-window terminal.txt /*terminal-window*
|
||||
terminal.txt terminal.txt /*terminal.txt*
|
||||
terminalprops() eval.txt /*terminalprops()*
|
||||
terminfo term.txt /*terminfo*
|
||||
termresponse-variable eval.txt /*termresponse-variable*
|
||||
test-functions usr_41.txt /*test-functions*
|
||||
@@ -9560,6 +9583,7 @@ text-prop-changes textprop.txt /*text-prop-changes*
|
||||
text-prop-functions textprop.txt /*text-prop-functions*
|
||||
text-prop-intro textprop.txt /*text-prop-intro*
|
||||
text-properties textprop.txt /*text-properties*
|
||||
text-property-functions usr_41.txt /*text-property-functions*
|
||||
textlock eval.txt /*textlock*
|
||||
textprop textprop.txt /*textprop*
|
||||
textprop.txt textprop.txt /*textprop.txt*
|
||||
@@ -9679,6 +9703,7 @@ usr_42.txt usr_42.txt /*usr_42.txt*
|
||||
usr_43.txt usr_43.txt /*usr_43.txt*
|
||||
usr_44.txt usr_44.txt /*usr_44.txt*
|
||||
usr_45.txt usr_45.txt /*usr_45.txt*
|
||||
usr_46.txt usr_46.txt /*usr_46.txt*
|
||||
usr_90.txt usr_90.txt /*usr_90.txt*
|
||||
usr_toc.txt usr_toc.txt /*usr_toc.txt*
|
||||
utf-8 mbyte.txt /*utf-8*
|
||||
@@ -9700,6 +9725,7 @@ v:charconvert_from eval.txt /*v:charconvert_from*
|
||||
v:charconvert_to eval.txt /*v:charconvert_to*
|
||||
v:cmdarg eval.txt /*v:cmdarg*
|
||||
v:cmdbang eval.txt /*v:cmdbang*
|
||||
v:collate eval.txt /*v:collate*
|
||||
v:completed_item eval.txt /*v:completed_item*
|
||||
v:count eval.txt /*v:count*
|
||||
v:count1 eval.txt /*v:count1*
|
||||
@@ -9898,6 +9924,7 @@ val-variable eval.txt /*val-variable*
|
||||
valgrind debug.txt /*valgrind*
|
||||
values() eval.txt /*values()*
|
||||
var-functions usr_41.txt /*var-functions*
|
||||
variable-scope eval.txt /*variable-scope*
|
||||
variables eval.txt /*variables*
|
||||
various various.txt /*various*
|
||||
various-cmds various.txt /*various-cmds*
|
||||
@@ -9971,11 +9998,15 @@ vim.vim syntax.txt /*vim.vim*
|
||||
vim7 version7.txt /*vim7*
|
||||
vim8 version8.txt /*vim8*
|
||||
vim9 vim9.txt /*vim9*
|
||||
vim9-declaration vim9.txt /*vim9-declaration*
|
||||
vim9-declarations usr_46.txt /*vim9-declarations*
|
||||
vim9-differences vim9.txt /*vim9-differences*
|
||||
vim9-export vim9.txt /*vim9-export*
|
||||
vim9-import vim9.txt /*vim9-import*
|
||||
vim9-rationale vim9.txt /*vim9-rationale*
|
||||
vim9-scopes vim9.txt /*vim9-scopes*
|
||||
vim9-script vim9.txt /*vim9-script*
|
||||
vim9-script-intro usr_46.txt /*vim9-script-intro*
|
||||
vim9-types vim9.txt /*vim9-types*
|
||||
vim9.txt vim9.txt /*vim9.txt*
|
||||
vim9script vim9.txt /*vim9script*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*terminal.txt* For Vim version 8.2. Last change: 2020 May 24
|
||||
*terminal.txt* For Vim version 8.2. Last change: 2020 Jun 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -113,7 +113,8 @@ sent to the job running in the terminal. For example, to make F1 switch
|
||||
to Terminal-Normal mode: >
|
||||
tnoremap <F1> <C-W>N
|
||||
You can use Esc, but you need to make sure it won't cause other keys to
|
||||
break (cursor keys start with an Esc, so they may break): >
|
||||
break (cursor keys start with an Esc, so they may break), this probably only
|
||||
works in the GUI: >
|
||||
tnoremap <Esc> <C-W>N
|
||||
set notimeout ttimeout timeoutlen=100
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*testing.txt* For Vim version 8.2. Last change: 2020 Apr 10
|
||||
*testing.txt* For Vim version 8.2. Last change: 2020 Jun 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -165,6 +165,10 @@ test_override({name}, {val}) *test_override()*
|
||||
terminals
|
||||
no_wait_return set the "no_wait_return" flag. Not restored
|
||||
with "ALL".
|
||||
ui_delay time in msec to use in ui_delay(); overrules a
|
||||
wait time of up to 3 seconds for messages
|
||||
term_props reset all terminal properties when the version
|
||||
string is detected
|
||||
ALL clear all overrides ({val} is not used)
|
||||
|
||||
"starting" is to be used when a test should behave like
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.2. Last change: 2020 May 26
|
||||
*todo.txt* For Vim version 8.2. Last change: 2020 Jun 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -40,12 +40,17 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
|
||||
Include src/po/vim.pot ?
|
||||
|
||||
See if resizing a terminal can be fixed.
|
||||
|
||||
Vim9 script:
|
||||
Making everything work:
|
||||
- Error for "g:var: string = 'value'"
|
||||
- Make func()->append('$') work - value is last argument, not first. #6305
|
||||
- possible memory leak in test_vim9_func through compile_nested_function.
|
||||
- memory leaks in test_vim9_expr
|
||||
- memory leaks in test_vim9_script
|
||||
- Test that a script-local function in Vim9 script cannot be deleted.
|
||||
- more return types depending on the first argument, like sort().
|
||||
- Check that when sourcing a Vim9 script, only the global items can be used.
|
||||
- Make "true" and "false" work in vim9script
|
||||
- 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
|
||||
@@ -53,7 +58,6 @@ Making everything work:
|
||||
- make 0 == 'string' fail on the script level, like inside :def.
|
||||
- Check that when using a user function name without prefix, it does not find
|
||||
a global function. Prefixing g: is required.
|
||||
- Compile: let [var, var] = expr
|
||||
- Compile: for [key, value] in items(map)
|
||||
- Assignment to dict doesn't work:
|
||||
let ret: dict<string> = #{}
|
||||
@@ -73,6 +77,7 @@ Making everything work:
|
||||
(Ben Jackson, #5671)
|
||||
Can we share the code from ex_let_const() between direct execution and
|
||||
compiling?
|
||||
- Implement "as Name" in "import Item as Name from ..."
|
||||
- Disallow unlet for local/script/imported vars
|
||||
- Make "++nr" work.
|
||||
- Make closures work:
|
||||
@@ -85,13 +90,14 @@ Making everything work:
|
||||
New syntax and functionality:
|
||||
Improve error checking:
|
||||
- "echo Func()" is an error if Func() does not return anything.
|
||||
Test:
|
||||
- Using a Vim9 autoload script (functions must be global).
|
||||
Also:
|
||||
- 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.
|
||||
- better implementation for partial and tests for that.
|
||||
- Make "g:imported = Export.exported" work in Vim9 script.
|
||||
- Make Foo.Bar() work to call the dict function. (#5676)
|
||||
- Check that import in legacy script works and puts item in s:
|
||||
- Error in any command in "vim9script" aborts sourcing.
|
||||
- Find a way to test expressions in legacy and Vim9 script without duplication
|
||||
- Fix memory leaks for test_vim9_disassemble, test_vim9_expr, test_vim9_script
|
||||
@@ -128,7 +134,6 @@ Further improvements:
|
||||
- compile "expr" and "call" expression of a channel in channel_exe_cmd()?
|
||||
|
||||
Popup windows:
|
||||
- Can put focus in another window using API and "drop". (#6077)
|
||||
- With some sequence get get hidden finished terminal buffer. (#5768)
|
||||
Cannot close popup terminal (#5744)
|
||||
Buffer can't be wiped, gets status "aF". (#5764)
|
||||
@@ -154,8 +159,6 @@ Popup windows:
|
||||
- Figure out the size and position better if wrapping inserts indent
|
||||
|
||||
Text properties:
|
||||
- Patch to fix that split / join does not update properties properly (Axel
|
||||
Forsman, #5839) Alternative: #5875.
|
||||
- :goto does not go to the right place when test properties are present.
|
||||
(#5930)
|
||||
- "cc" does not call inserted_bytes(). (Axel Forsman, #5763)
|
||||
@@ -197,6 +200,7 @@ Terminal debugger:
|
||||
with another Vim instance.
|
||||
|
||||
Terminal emulator window:
|
||||
- No support for underline color, t_8u.
|
||||
- When started with ":terminal ++close" and the shell exits but there is a
|
||||
background process, the window remains open, because the channel still
|
||||
exists (and output still shows). Perhaps close the window when an explicit
|
||||
@@ -236,10 +240,27 @@ Terminal emulator window:
|
||||
conversions.
|
||||
|
||||
Error numbers available:
|
||||
E453, E454, E489, E610, E611, E653, E856, E857, E861, E900
|
||||
E489, E610, E611, E653, E856
|
||||
|
||||
Patch to fix that typval related code is spread out. (Yegappan Lakshmanan,
|
||||
#6093)
|
||||
Remove SPACE_IN_FILENAME ? It is only used for completion.
|
||||
|
||||
Patch to use collaction based sorting. (Christian Brabandt, #6229)
|
||||
|
||||
Can we detect true color support? https://gist.github.com/XVilka/8346728
|
||||
Try setting a color then request the current color, like using t_u7.
|
||||
|
||||
Check out PR #543 (Roland Puntaier).
|
||||
Patch for multi-byte characters in langmap and applying a mapping on them.
|
||||
(Christian Brabandt, 2015 Jun 12, update July 25)
|
||||
Is this the right solution? Need to cleanup langmap behavior:
|
||||
- in vgetorpeek() apply langmap to the typeahead buffer and put the result in
|
||||
a copy-buffer, only when langmap is appropriate for the current mode. Then
|
||||
check for mapping and let gotchars() work on the copy-buffer.
|
||||
- Remove LANGMAP_ADJUST() in other parts of the code. Make sure the mode is
|
||||
covered by the above change.
|
||||
So that replaying the register doesn't use keymap/langmap and still does the
|
||||
same thing.
|
||||
Also see #737: langmap not applied to replaying recording.
|
||||
|
||||
Buffer autocommands are a bit inconsistent. Add a separate set of
|
||||
autocommands for the buffer lifecycle:
|
||||
@@ -250,39 +271,14 @@ autocommands for the buffer lifecycle:
|
||||
BufIsRenamed (after buffer ID gets another name)
|
||||
The buffer list and windows are locked, no changes possible
|
||||
|
||||
How about removing Atari MiNT support?
|
||||
src/Make_mint.mak, src/os_mint.h, matches with __MINT__
|
||||
|
||||
Patch to make :q work with local arglist. (Christian Brabandt, #6286)
|
||||
|
||||
Patch to fix drawing error with DirectX. (James Grant, #5688)
|
||||
Causes flicker on resizing.
|
||||
|
||||
Patch to support ipv6 for channel. (Ozaki Kiichi, #5893)
|
||||
|
||||
Patch to explain use of "%" in :!. (David Briscoe, #5591)
|
||||
|
||||
Patch to improve Windows terminal support. (Nobuhiro Takasaki, #5546)
|
||||
Ready to include.
|
||||
|
||||
Patch to improve use of Lua path. (Prabir Shrestha, #6098)
|
||||
|
||||
Patch to make exepath() work better on MS-Windows. (#6115)
|
||||
|
||||
Patch to add "-d" to xxd. (#5616)
|
||||
|
||||
Patch for the Haiku port: #5961
|
||||
|
||||
Patch to add Turkish manual. (Emir Sarı, #5641)
|
||||
|
||||
Patch to add lua sleep function. (Prabir Shrestha, #6057)
|
||||
Alternative: use vim.call and vim.fn: #6063
|
||||
|
||||
Patch to add getmarklist() (Yegappan, #6032)
|
||||
|
||||
Patch to support different color for undercurl in cterm.
|
||||
(Timur Celik, #6011)
|
||||
|
||||
Patch to support cindent option to handle pragmas differently.
|
||||
(Max Rumpf, #5468)
|
||||
|
||||
Patch to add ":syn foldlevel" to use fold level further down the line.
|
||||
(Brad King, 2016 Oct 19, update 2017 Jan 30, now in #6087)
|
||||
Causes flicker on resizing. Workaround from Ken Takata.
|
||||
How about only setting the attribute when part of the Vim window is offscreen?
|
||||
|
||||
File marks merging has duplicates since 7.4.1925. (Ingo Karkat, #5733)
|
||||
|
||||
@@ -293,27 +289,21 @@ Motif: Build on Ubuntu can't enter any text in dialog text fields.
|
||||
Running test_gui and test_gui_init with Motif sometimes kills the window
|
||||
manager. Problem with Motif?
|
||||
|
||||
Patch to add :argdedupe. (Nir Lichtman, #6235)
|
||||
|
||||
:map output does not clear the reset of the command line.
|
||||
(#5623, also see #5962)
|
||||
|
||||
Patch to properly break CJK lines: Anton Kochkov, #3875
|
||||
Flag in 'formatoptions' is not used in the tests.
|
||||
|
||||
Patch to add 'vtp' option. (#5344)
|
||||
Needs better docs. Is there a better name?
|
||||
|
||||
Patch to add argument to trim() to only trim start or end of a string.
|
||||
(Yegappan, #6126)
|
||||
Problem with auto-formatting - inserting space and putting cursor before added
|
||||
character. (#6154)
|
||||
|
||||
undo result wrong: Masato Nishihata, #4798
|
||||
|
||||
Patch for Template string: #4491. New pull: #4634
|
||||
Ready to include? Review the code.
|
||||
|
||||
When 'lazyredraw' is set sometimes the title is not updated.
|
||||
(Jason Franklin, 2020 Feb 3) Looks like a race condition.
|
||||
|
||||
Patch to delete BeOS code. (#5817) Anyone who wants to keep it?
|
||||
Regexp to search for duplicate lines does not work correctly:
|
||||
/\(^.*\n\)\1 (Chris Morgan, #6239)
|
||||
|
||||
With bash ":make" does not set v:shell_error. Possible solution: set
|
||||
'shellpipe' to "2>&1| tee %s; exit ${PIPESTATUS[0]}" #5994
|
||||
@@ -340,21 +330,21 @@ Get BufDelete without preceding BufNew. (Paul Jolly, #5694)
|
||||
BufWinenter event not fired when saving unnamed buffer. (Paul Jolly, #5655)
|
||||
Another spurious BufDelete. (Dani Dickstein, #5701)
|
||||
|
||||
Patch to add function to return the text used in the quickfix window.
|
||||
(Yegappan, #5465)
|
||||
|
||||
Patch to add readdirex() (Ken Takata, #5619)
|
||||
|
||||
Wrong error when using local arglist. (Harm te Hennepe, #6133)
|
||||
|
||||
Request to support <Cmd> in mappings, similar to how Neovim does this.
|
||||
(Daniel Hahler, #4784)
|
||||
|
||||
Test loose_clipboard() by selecting text before suspending.
|
||||
|
||||
Undo puts cursor in wrong line after "cG<Esc>" undo.
|
||||
|
||||
:unmap <c-n> gives error but does remove the mapping. (Antony Scriven, 2019
|
||||
Dec 19)
|
||||
|
||||
Patch to add an option to enable/disable VTP. (Nobuhiro Takasaki, #5344)
|
||||
Should have three values: empty, "off", "on". Name it 'winterm'?
|
||||
|
||||
Patch to fix session file when using multiple tab pages. (Jason Franklin, 2019
|
||||
May 20)
|
||||
Also put :argadd commands at the start for all buffers, so that their order
|
||||
@@ -365,9 +355,6 @@ Also #5326: netrw buffers are not restored.
|
||||
When 'backupdir' has a path ending in double slash (meaning: use full path of
|
||||
the file) combined with 'patchmode' the file name is wrong. (#5791)
|
||||
|
||||
Patch to make ":verbose pwd" show the scope of the directory. (Takuya
|
||||
Fujiwara, #5469)
|
||||
|
||||
Completion mixes results from the current buffer with tags and other files.
|
||||
Happens when typing CTRL-N while still searching for results. E.g., type "b_"
|
||||
in terminal.c and then CTRL-N twice.
|
||||
@@ -377,19 +364,13 @@ Should do current file first and not split it up when more results are found.
|
||||
Undo history wrong when ":next file" re-uses a buffer. (#5426)
|
||||
ex_next() should pass flag to do_argfile(), then to do_ecmd().
|
||||
|
||||
Patch to add "note" type to quickfix. (#5527) Missing tests.
|
||||
Help for ":argadd fname" says that if "fname" is already in the argument list
|
||||
that entry is used. But instead it's always added. (#6210)
|
||||
Add flag AL_FIND_ADD, if there is one argument find it in the list.
|
||||
|
||||
Adding "10" to 'spellsuggest' causes spell suggestions to become very slow.
|
||||
(#4087)
|
||||
|
||||
FR: add search_status(), the current values displayed for search (current
|
||||
match, total matches). (#5631)
|
||||
Patch to provide search stats in a variable, so that it can be used in the
|
||||
statusline. (Fujiwara Takuya, #4446)
|
||||
|
||||
Patch for ambiguous width characters in libvterm on MS-Windows 10.
|
||||
(Nobuhiro Takasaki, #4411)
|
||||
|
||||
behavior of i_CTRl-R_CTRL-R differs from documentation. (Paul Desmond Parker,
|
||||
#5771)
|
||||
|
||||
@@ -397,10 +378,15 @@ behavior of i_CTRl-R_CTRL-R differs from documentation. (Paul Desmond Parker,
|
||||
goes to any buffer, and then :bnext skips help buffers, since they are
|
||||
unlisted. (#4478)
|
||||
|
||||
Patch to include reduce() function. (#5481)
|
||||
Patch for Template string: #4634
|
||||
Copies the text twice, not very efficient. Requires a separate implementation
|
||||
for Vim9 script, compiling the string parts and expressions.
|
||||
|
||||
Statusline highlighting error, off by one. (#5599)
|
||||
|
||||
":find" with 'path' set to "data*" does not find files, while completion does
|
||||
find them. (Max Kukartsev, #6218)
|
||||
|
||||
Enable 'termbidi' if $VTE_VERSION >= 5703 ?
|
||||
|
||||
Universal solution to detect if t_RS is working, using cursor position.
|
||||
@@ -415,6 +401,9 @@ support combining characters. (Charles Campbell) Also #4687
|
||||
|
||||
"--cleanFOO" does not result in an error. (#5537)
|
||||
|
||||
Output from assert_equalfile() doesn't give a hint about what's different.
|
||||
Assuming the files are text, print the line with the difference.
|
||||
|
||||
Add "t" action to settagstack(): truncate and add new entries. (#5405)
|
||||
|
||||
When 'relativenumber' is set the line just below a diff change doesn't get
|
||||
@@ -434,7 +423,7 @@ When using :packadd files under "later" are not used, which is inconsistent
|
||||
with packages under "start". (xtal8, #1994)
|
||||
|
||||
Patch to add new motion ]( and ]{. (Yasuhiro Matsumoto, #5320)
|
||||
Or make "v" prefix work?
|
||||
Better: use the "z" prefix. or ]t) and [t(.
|
||||
|
||||
Modeless selection doesn't work in gvim. (#4783)
|
||||
Caused by patch 8.1.1534.
|
||||
@@ -442,8 +431,7 @@ Caused by patch 8.1.1534.
|
||||
Visual highlight not removed when 'dipslay' is "lastline" and line doesn't
|
||||
fit. (Kevin Lawler, #4457)
|
||||
|
||||
Patch to add per-tabpage and per-window previous directory: "lcd -" and "tcd
|
||||
-". (Yegappan Lakshmanan, #4362)
|
||||
Current position in the changelist should be local to the buffer. (#2173)
|
||||
|
||||
Does not build with MinGW out of the box:
|
||||
- _stat64 is not defined, need to use "struct stat" in vim.h
|
||||
@@ -455,14 +443,6 @@ Crash when mixing matchadd and substitute()? (Max Christian Pohle, 2018 May
|
||||
|
||||
Display messed up with matchparen, wrapping and scrolling. (#5638)
|
||||
|
||||
Patch to configure BUILD_DATE for reproducible builds. (James McCoy, #513)
|
||||
|
||||
Patch to add MODIFIED_BY to MSVC build file. (Chen Lei, 2016 Nov 24, #1275)
|
||||
|
||||
Patch to support "0o" for octal numbers. (Ken Takata, #5304)
|
||||
|
||||
Patch to enable IXON, avoid that CTRL-S stops terminal output. (#5775)
|
||||
|
||||
When getting a focus event halfway a mapping this aborts the mapping. E.g.
|
||||
when "qq" is mapped and after the first "q" the mouse is moved outside of the
|
||||
gvim window (with focus follows mouse), then the K_FOCUSLOST key is put in the
|
||||
@@ -491,21 +471,12 @@ Can be used to update highlighting. #3127 #5181
|
||||
Incorrect formatting with autoindent. (Sebastian Gniazdowski, #4909)
|
||||
|
||||
Patch to add the :bvimgrep command. (Christian Brabandt, 2014 Nov 12)
|
||||
Updated 2016 Jun 10, #858 Update 2017 Mar 28: use <buffer>
|
||||
Updated 2016 Jun 10, #858 Update 2017 Mar 28: use <buffer>.
|
||||
Better use ":bufgrep" ?
|
||||
|
||||
Errors found with random data:
|
||||
heap-buffer-overflow in alist_add (#2472)
|
||||
|
||||
Patch to support CamelCase for spell checking: See a lower-to-upper case
|
||||
change as a word boundary. (btucker-MPCData, 2016 Nov 6, #1235)
|
||||
patch for 'spellcamelcase' option: spellcheck each CamelCased word.
|
||||
(Ben Tucker, 2016 Dec 2)
|
||||
|
||||
Patch to add {skip} argument to search(). (Christian Brabandt, 2016 Feb 24)
|
||||
Update 2016 Jun 10, #861
|
||||
|
||||
Patch to add "cmdline" completion to getcompletion(). (Shougo, Oct 1, #1140)
|
||||
|
||||
Improve fallback for menu translations, to avoid having to create lots of
|
||||
files that source the actual file. E.g. menu_da_de -> menu_da
|
||||
Include part of #3242?
|
||||
@@ -521,18 +492,6 @@ Added tests (James McCoy, 2016 Aug 3, #958). Still needs more work.
|
||||
window 2. User expects 10 to be added to size of window 2. (Daniel Steinberg,
|
||||
#5443)
|
||||
|
||||
Patch for multi-byte characters in langmap and applying a mapping on them.
|
||||
(Christian Brabandt, 2015 Jun 12, update July 25)
|
||||
Is this the right solution? Need to cleanup langmap behavior:
|
||||
- in vgetorpeek() apply langmap to the typeahead buffer and put the result in
|
||||
a copy-buffer, only when langmap is appropriate for the current mode. Then
|
||||
check for mapping and let gotchars() work on the copy-buffer.
|
||||
- Remove LANGMAP_ADJUST() in other parts of the code. Make sure the mode is
|
||||
covered by the above change.
|
||||
So that replaying the register doesn't use keymap/langmap and still does the
|
||||
same thing. Remarks on PR #543 (Roland Puntaier).
|
||||
Also see #737: langmap not applied to replaying recording.
|
||||
|
||||
Would be nice to set tab-local values for 'diffexpr' and 'diffopt'. Use
|
||||
t:diffexpr_option t:diffopt_option? (#4782)
|
||||
|
||||
@@ -562,10 +521,10 @@ Give a few examples. (#4288)
|
||||
Opening a file with --remote-tab-silent that matches 'wildignore' does not
|
||||
work, results in (E479: No match". (#4610)
|
||||
|
||||
Patch for this (Tristan Konolige, #1011, only adds the option, no implem.):
|
||||
7 Add an option to add one pixel column to the character width? Lucida
|
||||
Console italic is wider than the normal font ("d" overlaps with next char).
|
||||
Opposite of 'linespace': 'columnspace'.
|
||||
Patch for this (Tristan Konolige, #1011, only added the option, no implem.)
|
||||
|
||||
Bug: script written with "-W scriptout" contains Key codes, while the script
|
||||
read with "-s scriptin" expects escape codes. Probably "scriptout" needs to
|
||||
@@ -618,10 +577,6 @@ Should we include some part of pull request #4505, not increment changedtick
|
||||
in some cases? E.g. for ":write" when the changed flag was already off, the
|
||||
buffer didn't change at all.
|
||||
|
||||
Patch to add getreginfo() and setreg() with an option to set the unnamed
|
||||
register "", So that registers can be saved and fully restored.
|
||||
(Andy Massimino, 2018 Aug 24, #3370)
|
||||
|
||||
Line numbers in profile are off when function was defined with ":execute".
|
||||
(Daniel Hahler, #4511)
|
||||
|
||||
@@ -642,9 +597,6 @@ C syntax: {} inside () causes following {} to be highlighted as error.
|
||||
Check: __attribute__((format(printf, on semsg() and siemsg(). Where was this
|
||||
added?
|
||||
|
||||
Patch to add a flatten() function. #3676. Check that the doc explains the
|
||||
maxdepth argument (applies to the input "recursiveness").
|
||||
|
||||
Add test for urxvt mouse codes. Also test that mouse coordinates can be
|
||||
negative. (see #4326)
|
||||
|
||||
@@ -715,11 +667,6 @@ punctuation is repeated. (Smylers, 2018 Nov 17, #3621)
|
||||
|
||||
ml_get error: (Israel Chauca Fuentes, 2018 Oct 17, #3550).
|
||||
|
||||
Patch to add more info to OptionSet. Should mention what triggered the change
|
||||
":set", ":setlocal", ":setglobal", "modeline"; and the old global value.
|
||||
#4118. Proposed implementation: 2019 Mar 27.
|
||||
Updated 2019 May 25.
|
||||
|
||||
Using single wide base character with double wide composing character gives
|
||||
drawing errors. Fill up the base character? (Dominique, #4328)
|
||||
|
||||
@@ -770,26 +717,13 @@ Neovim uses "eob:X" in 'fillchars'.
|
||||
Sourceforge Vim pages still have content, redirect from empty page.
|
||||
Check for PHP errors. (Wayne Davison, 2018 Oct 26)
|
||||
|
||||
Patch to support ":tag <tagkind> <tagname>". (emmrk, 2018 May 7, #2871)
|
||||
Use something like ":tag {kind}/{tagname}".
|
||||
Not ready to include.
|
||||
|
||||
Problem with Visual yank when 'linebreak' and 'showbreak' are set.
|
||||
Patch with tests, but it's not clear how it is supposed to work. (tommm, 2018
|
||||
Nov 17) Asked about this, Dec 22. Christian will have a look.
|
||||
|
||||
Patch for larger icons in installer. (#978) Still not good.
|
||||
|
||||
Patch to fix that using "5gj" starting inside a closed fold does not work on
|
||||
screen lines but on text lines. (Julius Hulsmann, #4095) Lacks a test.
|
||||
|
||||
Patch to implement 'diffref' option. (#3535)
|
||||
Easier to use a 'diffmaster' option, is the extra complexity needed?
|
||||
Not ready to include.
|
||||
|
||||
Patch to specify color for cterm=underline and cterm=undercurl, like "guisp".
|
||||
Patch #2405 does something like this, but in the wrong way.
|
||||
|
||||
home_replace() uses $HOME instead of "homedir". (Cesar Martins, 2018 Aug 9)
|
||||
|
||||
When the status line uses term_gettitle(), it does not get updated when the
|
||||
@@ -817,7 +751,7 @@ Further xdiff changes:
|
||||
Difference between two regexp engines: #3373
|
||||
|
||||
Patch to add ch_listen() (Yasuhiro Matsumoto, 2018 Nov 26, #3639)
|
||||
What is the practical use for this?
|
||||
What is the practical use for this? Need an example.
|
||||
|
||||
When the last line wraps, selecting with the mouse below that line only
|
||||
includes the first screen line. (2018 Aug 23, #3368)
|
||||
@@ -841,8 +775,6 @@ when adding a sign for every quickfix entry. (#4557)
|
||||
Win32 key codes are messy. Mike Williams tried to fix that, but now old
|
||||
mappings no longer work. Create a new terminal for the better solution?
|
||||
|
||||
Patch to "fix" 'visualbell'. Add option to set delay? (#1789)
|
||||
|
||||
Script generated by :mksession does not work well if there are windows with
|
||||
modified buffers
|
||||
change "silent only" into "silent only!"
|
||||
@@ -932,9 +864,6 @@ deleting autocmds, not when adding them.
|
||||
|
||||
Alternative manpager.vim. (Enno, 2018 Jan 5, #2529)
|
||||
|
||||
Delete all the specific stuff for the Borland compiler? (#3374)
|
||||
Patch in #3377 (Thomas Dziedzic)
|
||||
|
||||
With 'foldmethod' "indent" and appending an empty line, what follows isn't
|
||||
included in the existing fold. Deleting the empty line and undo fixes it.
|
||||
(Oleg Koshovetc, 2018 Jul 15, #3214)
|
||||
@@ -1099,6 +1028,7 @@ The ":move" command does not honor closed folds. (Ryan Lue, #2351)
|
||||
|
||||
Patch to fix increment/decrement not working properly when 'virtualedit' is
|
||||
set. (Hirohito Higashi, 2016 Aug 1, #923)
|
||||
Was this fixed?
|
||||
|
||||
Cannot copy modeless selection when cursor is inside it. (lkintact, #2300)
|
||||
|
||||
@@ -1168,8 +1098,6 @@ Or is this not an actual problem?
|
||||
|
||||
Better TeX indent file. (Christian Brabandt, 2017 May 3)
|
||||
|
||||
Patch to use a separate code for BS on Windows. (Linwei, #1823)
|
||||
|
||||
Use gvimext.dll from the nightly build? (Issue #249)
|
||||
|
||||
'synmaxcol' works with bytes instead of screen cells. (Llandon, 2017 May 31,
|
||||
@@ -1278,13 +1206,6 @@ Implement named arguments for functions:
|
||||
Add a command to take a range of lines, filter them and put the output
|
||||
somewhere else. :{range}copy {dest} !cmd
|
||||
|
||||
Patch to fix that empty first tab is not in session.
|
||||
(Hirohito Higashi, 2016 Nov 25, #1282)
|
||||
|
||||
Patch to fix escaping of job arguments. (Yasuhiro Matsumoto, 2016 Oct 5)
|
||||
Update Oct 14: https://gist.github.com/mattn/d47e7d3bfe5ade4be86062b565a4bfca
|
||||
Update Aug 2017: #1954
|
||||
|
||||
The TermResponse event is not triggered when a plugin has set 'eventignore' to
|
||||
"all". Netrw does this. (Gary Johnson, 2017 Jan 24)
|
||||
Postpone the event until 'eventignore' is reset.
|
||||
@@ -1448,11 +1369,6 @@ Undo message is not always properly displayed. Patch by Ken Takata, 2013 oct
|
||||
3. Doesn't work properly according to Yukihiro Nakadaira.
|
||||
Also see #1635.
|
||||
|
||||
Patch for systemlist(), add empty item. (thinca, Sep 30, #1135)
|
||||
Add an argument to choose binary or non-binary (like readfile()), when omitted
|
||||
use the current behavior.
|
||||
Include the test.
|
||||
|
||||
When 'keywordprg' starts with ":" the argument is still escaped as a shell
|
||||
command argument. (Romain Lafourcade, 2016 Oct 16, #1175)
|
||||
|
||||
@@ -1462,9 +1378,6 @@ Probably list of keystrokes, with some annotations for mode changes.
|
||||
Could store in logfile to be able to analyse it with an external command.
|
||||
E.g. to see when's the last time a plugin command was used.
|
||||
|
||||
execute() cannot be used with command completion. (Daniel Hahler, 2016 Oct 1,
|
||||
#1141)
|
||||
|
||||
cmap using execute() has side effects. (Killthemule, 2016 Aug 17, #983)
|
||||
|
||||
:map X may print invalid data. (Nikolay Pavlov, 2017 Jul 3, #1816)
|
||||
@@ -1477,9 +1390,6 @@ synced. (Ryan Carney, 2016 Sep 14)
|
||||
Syntax highlighting for messages with RFC3339 timestamp (#946)
|
||||
Did maintainer reply?
|
||||
|
||||
Patch to avoid problem with special characters in file name.
|
||||
(Shougo, 2016 Sept 19, #1099) Not finished?
|
||||
|
||||
ml_get errors when reloading file. (Chris Desjardins, 2016 Apr 19)
|
||||
Also with latest version.
|
||||
|
||||
@@ -1498,9 +1408,6 @@ the system encoding (usually utf-8).
|
||||
MS-Windows: use WS_HIDE instead of SW_SHOWMINNOACTIVE in os_win32.c?
|
||||
Otherwise task flickers in taskbar.
|
||||
|
||||
Should make ":@r" handle line continuation. (Cesar Romani, 2016 Jun 26)
|
||||
Also for ":@.".
|
||||
|
||||
Repeating 'opfunc' in a function only works once. (Tarmean, 2016 Jul 15, #925)
|
||||
|
||||
Have a way to get the call stack, in a function and from an exception.
|
||||
@@ -1515,8 +1422,6 @@ Filetype plugin for awk. (Doug Kearns, 2016 Sep 5)
|
||||
|
||||
Patch to improve map documentation. Issue #799.
|
||||
|
||||
Patch for syntax folding optimization. (Shougo, 2016 Sep 6, #1045)
|
||||
|
||||
We can use '. to go to the last change in the current buffer, but how about
|
||||
the last change in any buffer? Can we use ', (, is next to .)?
|
||||
|
||||
@@ -1573,11 +1478,6 @@ Mechelynck) Perhaps use exists("::tearoff") to check?
|
||||
Use vim.vim syntax highlighting for help file examples, but without ":" in
|
||||
'iskeyword' for syntax.
|
||||
|
||||
Patch to make "%:h:h" return "." instead of the full path.
|
||||
(Coot, 2016 Jan 24, #592)
|
||||
|
||||
Remove SPACE_IN_FILENAME ? What could possibly go wrong?
|
||||
|
||||
When command names are very long :command output is difficult to read. Use a
|
||||
maximum for the column width? (#871)
|
||||
Patcy by varmanishant, 2016 Jun 18, #876
|
||||
@@ -2172,11 +2072,6 @@ Vim using lots of memory when joining lines. (John Little, 2010 Dec 3)
|
||||
BT regexp engine: After trying a \@> match and failing, submatches are not
|
||||
cleared. See test64.
|
||||
|
||||
Patch to make "z=" work when 'spell' is off. Does this have nasty side
|
||||
effects? (Christian Brabandt, 2012 Aug 5, Update 2013 Aug 12)
|
||||
Would also need to do this for spellbadword() and spellsuggest().
|
||||
https://github.com/chrisbra/vim-mq-patches/blob/master/enable_spellchecking
|
||||
|
||||
On 64 bit MS-Windows "long" is only 32 bits, but we sometimes need to store a
|
||||
64 bits value. Change all number options to use nropt_T and define it to the
|
||||
right type.
|
||||
@@ -2195,9 +2090,6 @@ doesn't jump to the correct line with :cfirst. (ZyX, 2011 Sep 18)
|
||||
|
||||
Behavior of i" and a" text objects isn't logical. (Ben Fritz, 2013 Nov 19)
|
||||
|
||||
maparg() does not show the <script> flag. When temporarily changing a
|
||||
mapping, how to restore the script ID?
|
||||
|
||||
Bug in try/catch: return with invalid compare throws error that isn't caught.
|
||||
(ZyX, 2011 Jan 26)
|
||||
|
||||
@@ -4978,9 +4870,6 @@ Win32 GUI:
|
||||
|
||||
|
||||
GUI:
|
||||
8 Make inputdialog() work for Photon, Amiga.
|
||||
- <C--> cannot be mapped. Should be possible to recognize this as a
|
||||
normal "-" with the Ctrl modifier.
|
||||
7 Implement ":popup" for other systems than Windows.
|
||||
8 Implement ":tearoff" for other systems than Win32 GUI.
|
||||
6 Implement ":untearoff": hide a torn-off menu.
|
||||
|
||||
@@ -211,7 +211,7 @@ will automatically delete it:
|
||||
- The flag that the file was modified is not set.
|
||||
- The process is not running.
|
||||
|
||||
You can programatically deal with this situation with the |FileChangedShell|
|
||||
You can programmatically deal with this situation with the |FileChangedShell|
|
||||
autocommand event.
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2020 Jun 01
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2020 Jun 13
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -41,10 +41,11 @@ prefer. And you can use any colon command in it (commands that start with a
|
||||
specific file type. A complicated macro can be defined by a separate Vim
|
||||
script file. You can think of other uses yourself.
|
||||
|
||||
Note: if you are familiar with Python, you can find a comparison between
|
||||
Python and Vim script here, with pointers to other documents:
|
||||
https://gist.github.com/yegappan/16d964a37ead0979b05e655aa036cad0
|
||||
|
||||
If you are familiar with Python, you can find a comparison between
|
||||
Python and Vim script here, with pointers to other documents:
|
||||
https://gist.github.com/yegappan/16d964a37ead0979b05e655aa036cad0
|
||||
And if you are familiar with Javascript:
|
||||
https://w0rp.com/blog/post/vim-script-for-the-javascripter/
|
||||
|
||||
Let's start with a simple example: >
|
||||
|
||||
@@ -98,6 +99,8 @@ and the value of the variable i. Since i is one, this will print:
|
||||
Then there is the ":let i += 1" command. This does the same thing as
|
||||
":let i = i + 1". This adds one to the variable i and assigns the new value
|
||||
to the same variable.
|
||||
Note: this is how it works in legacy Vim script, which is what we discuss in
|
||||
this file. In Vim9 script it's a bit different, see |usr_46.txt|.
|
||||
|
||||
The example was given to explain the commands, but would you really want to
|
||||
make such a loop, it can be written much more compact: >
|
||||
@@ -650,6 +653,7 @@ List manipulation: *list-functions*
|
||||
min() minimum value in a List
|
||||
count() count number of times a value appears in a List
|
||||
repeat() repeat a List multiple times
|
||||
flatten() flatten a List
|
||||
|
||||
Dictionary manipulation: *dict-functions*
|
||||
get() get an entry without an error for a wrong key
|
||||
@@ -1147,6 +1151,7 @@ Various: *various-functions*
|
||||
getimstatus() check if IME status is active
|
||||
interrupt() interrupt script execution
|
||||
windowsversion() get MS-Windows version
|
||||
terminalprops() properties of the terminal
|
||||
|
||||
libcall() call a function in an external library
|
||||
libcallnr() idem, returning a number
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
*usr_45.txt* For Vim version 8.2. Last change: 2008 Nov 15
|
||||
*usr_45.txt* For Vim version 8.2. Last change: 2020 Jun 11
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
Select your language
|
||||
Select your language (locale)
|
||||
|
||||
|
||||
The messages in Vim can be given in several languages. This chapter explains
|
||||
@@ -15,7 +15,7 @@ in various languages is explained.
|
||||
|45.4| Editing files with a different encoding
|
||||
|45.5| Entering language text
|
||||
|
||||
Next chapter: |usr_90.txt| Installing Vim
|
||||
Next chapter: |usr_46.txt| Write plugins using Vim9 script
|
||||
Previous chapter: |usr_44.txt| Your own syntax highlighted
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
@@ -408,6 +408,6 @@ Don't type the spaces. See |i_CTRL-V_digit| for the details.
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_90.txt| Installing Vim
|
||||
Next chapter: |usr_46.txt| Write plugins using Vim9 script
|
||||
|
||||
Copyright: see |manual-copyright| vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
||||
192
runtime/doc/usr_46.txt
Normal file
192
runtime/doc/usr_46.txt
Normal file
@@ -0,0 +1,192 @@
|
||||
*usr_46.txt* For Vim version 8.2. Last change: 2020 Jun 14
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
Write plugins using Vim9 script
|
||||
|
||||
|
||||
The Vim9 script language is used for writing plugins, especially larger ones
|
||||
that use multiple files. This chapter explains how to split up a plugin into
|
||||
modules, import and export items and keep the rest local.
|
||||
|
||||
|46.1| Introduction
|
||||
|46.2| Variable declarations
|
||||
|46.3| Functions and types
|
||||
|46.?| Using a Vim9 script from legacy script
|
||||
|
||||
Next chapter: |usr_90.txt| Installing Vim
|
||||
Previous chapter: |usr_45.txt| Select your language (locale)
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*46.1* Introduction *vim9-script-intro*
|
||||
|
||||
Vim9 script was designed to make it easier to write large Vim scripts. It
|
||||
looks more like other script languages, especially Typescript. Also,
|
||||
functions are compiled into instructions that can be executed quickly. This
|
||||
makes Vim9 script a lot faster, up to a 100 times.
|
||||
|
||||
The basic idea is that a script file has items that are private, only used
|
||||
inside the script file, and items that are exported, used outside of the
|
||||
script file. The exported items can then be used by scripts that import them.
|
||||
That makes very clear what is defined where.
|
||||
|
||||
Let's start with an example, a script that exports one function and has one
|
||||
private function: >
|
||||
|
||||
vim9script " This indicates a Vim9 script file,
|
||||
|
||||
export def GetMessage(): string
|
||||
let result = ''
|
||||
...
|
||||
result = GetPart(count)
|
||||
...
|
||||
return result
|
||||
enddef
|
||||
|
||||
def GetPart(nr: number): string
|
||||
if nr == 4
|
||||
return 'yes'
|
||||
else
|
||||
return 'no'
|
||||
endif
|
||||
enddef
|
||||
|
||||
The `vim9script` command must be the very first command in the file. Without
|
||||
it Vim will assume legacy script syntax.
|
||||
|
||||
The `export def GetMessage(): string` line starts with `export`, meaning that
|
||||
this function can be imported and called by other scripts. The line
|
||||
`def GetPart(...` does not start with `export`, this is a script-local
|
||||
function, it can only be used inside this script file.
|
||||
|
||||
In the `export def GetMessage(): string` line you will notice the colon and
|
||||
the return type. Vim9 functions, defined with `def`, require specifying the
|
||||
type of arguments and the return type. That way Vim can compile the code
|
||||
efficiently. The GetPart function defines an argument "nr" of type "number".
|
||||
|
||||
Notice that the assignment `result = GetPart(count)` does not use the `let`
|
||||
command. That is explained in the next section.
|
||||
|
||||
==============================================================================
|
||||
*46.2* Variable declarations *vim9-declarations*
|
||||
|
||||
In Vim9 script variables are declared once with a `:let` or `:const` command.
|
||||
Assigning a value is done without `:let` and it is not possible to `:unlet`
|
||||
the variable.
|
||||
|
||||
In most cases you will want to declare the variable and initialize it at the
|
||||
same time: >
|
||||
let myText = 'some text'
|
||||
...
|
||||
myText = 'other text'
|
||||
|
||||
The type of the variable will be inferred from the expression. In this case
|
||||
it is a string. If you initialize with a number, then the type is number: >
|
||||
let myNumber = 1234
|
||||
...
|
||||
myNumber = 0
|
||||
|
||||
If you try to assign a string to this variable, you will get an error: >
|
||||
let myNumber = 'this fails!'
|
||||
|
||||
In the rare case you want a variable that can take values of any type, you
|
||||
have to specify the type: >
|
||||
let myVar: any = 1234
|
||||
myVar = 'text also works'
|
||||
|
||||
You can also declare a variable without assigning a value. In that case Vim
|
||||
will initialize it to zero or empty: >
|
||||
let word: string
|
||||
if condition
|
||||
word = 'yes'
|
||||
else
|
||||
word = 'no'
|
||||
endif
|
||||
|
||||
Although it's shorter to do: >
|
||||
let word = condition ? 'yes' : 'no'
|
||||
|
||||
==============================================================================
|
||||
*46.3* Functions and types
|
||||
|
||||
Legacy Vim script does have type checking, but this happens at runtime, when
|
||||
the code is executed. And it's permissive, often a computation gives an
|
||||
unexpected value instead of reporting an error. Thus you can define a
|
||||
function and think it's fine, but see a problem only later when it is called: >
|
||||
let s:collected = ''
|
||||
func ExtendAndReturn(add)
|
||||
let s:collected += a:add
|
||||
return s:collected
|
||||
endfunc
|
||||
|
||||
Can you spot the error? Try this: >
|
||||
echo ExtendAndReturn('text')
|
||||
And you'll see zero. Why? Because in legacy Vim script "+=" will convert the
|
||||
arguments to numbers, and any string without a number results in zero!
|
||||
|
||||
With `:def` the type checking happens when compiling the function. For that
|
||||
you need to specify the argument types and the return type. Also notice that
|
||||
the argument is used without the "a:" prefix: >
|
||||
let s:collected = ''
|
||||
def ExtendAndReturn(add: string): string
|
||||
s:collected += add
|
||||
return s:collected
|
||||
enddef
|
||||
defcompile
|
||||
|
||||
Here we use `:defcompile` to do the compilation right away, without it the
|
||||
compilation would happen when the function is called. Vim will tell you what
|
||||
you did wrong: >
|
||||
E1013: type mismatch, expected number but got string
|
||||
|
||||
Vim9 script is strict, it uses the "+" operator only for numbers and floats.
|
||||
For string concatenation ".." must be used. This avoids mistakes and avoids
|
||||
the automatic conversion that gave a surprising result above. So you change
|
||||
the first line of the function to: >
|
||||
s:collected ..= add
|
||||
And now it works.
|
||||
|
||||
If the function does not return anything, just leave out the return type: >
|
||||
def ReportResult(result: string)
|
||||
echo 'The result is: ' .. result
|
||||
enddef
|
||||
|
||||
This is also checked, if you try to return a value you'll get an error.
|
||||
|
||||
In case you don't care about types or have a function that does work with
|
||||
multiple types, you can use the "any" type: >
|
||||
def Store(key: string, value: any)
|
||||
resultDict[key] = value
|
||||
enddef
|
||||
|
||||
==============================================================================
|
||||
*46.?* Using a Vim9 script from legacy script *source-vim9-script*
|
||||
|
||||
In some cases you have a legacy Vim script where you want to use items from a
|
||||
Vim9 script. For example in your .vimrc you want to initialize a plugin. The
|
||||
best way to do this is to use `:import`. For example: >
|
||||
|
||||
import Init as NiceInit from 'myNicePlugin.vim'
|
||||
call NiceInit('today')
|
||||
|
||||
This finds the exported function "Init" in the Vim9 script file and makes it
|
||||
available as script-local item "NiceInit". `:import` always uses the script
|
||||
namespace, even when "s:" is not given. If "myNicePlugin.vim" was already
|
||||
sourced it is not sourced again.
|
||||
|
||||
Besides avoiding putting any items in the global namespace (where name clashes
|
||||
can cause unexpected errors), this also means the script is sourced only once,
|
||||
no matter how many times items from it are imported.
|
||||
|
||||
In some cases, e.g. for testing, you may just want to source the Vim9 script.
|
||||
That is OK, but then only global items will be available. The Vim9 script
|
||||
will have to make sure to use a unique name for these global items. Example: >
|
||||
source ~/.vim/extra/myNicePlugin.vim
|
||||
call g:NicePluginTest()
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_90.txt| Installing Vim
|
||||
|
||||
Copyright: see |manual-copyright| vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_90.txt* For Vim version 8.2. Last change: 2008 Sep 10
|
||||
*usr_90.txt* For Vim version 8.2. Last change: 2020 Jun 11
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -15,7 +15,7 @@ upgrading to a new version is done.
|
||||
|90.4| Common installation issues
|
||||
|90.5| Uninstalling Vim
|
||||
|
||||
Previous chapter: |usr_45.txt| Select your language
|
||||
Previous chapter: |usr_46.txt| Write plugins using Vim9 script
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_toc.txt* For Vim version 8.2. Last change: 2019 May 24
|
||||
*usr_toc.txt* For Vim version 8.2. Last change: 2020 Jun 15
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -42,7 +42,8 @@ Tuning Vim
|
||||
|usr_42.txt| Add new menus
|
||||
|usr_43.txt| Using filetypes
|
||||
|usr_44.txt| Your own syntax highlighted
|
||||
|usr_45.txt| Select your language
|
||||
|usr_45.txt| Select your language (locale)
|
||||
|usr_46.txt| Write plugins using Vim9 script
|
||||
|
||||
Making Vim Run
|
||||
|usr_90.txt| Installing Vim
|
||||
@@ -339,6 +340,12 @@ Make Vim work as you like it.
|
||||
|45.4| Editing files with a different encoding
|
||||
|45.5| Entering language text
|
||||
|
||||
|usr_46.txt| Write plugins using Vim9 script
|
||||
|46.1| Introduction
|
||||
|46.2| Variable declarations
|
||||
|46.3| Functions and types
|
||||
|46.?| Using a Vim9 script from legacy script
|
||||
|
||||
==============================================================================
|
||||
Making Vim Run ~
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 8.2. Last change: 2020 Apr 13
|
||||
*various.txt* For Vim version 8.2. Last change: 2020 May 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -251,14 +251,20 @@ g8 Print the hex values of the bytes used in the
|
||||
it to append a Vim command. See |:bar|.
|
||||
|
||||
If {cmd} contains "%" it is expanded to the current
|
||||
file name. Special characters are not escaped, use
|
||||
quotes to avoid their special meaning: >
|
||||
file name, "#" is expanded to the alternate file name.
|
||||
Special characters in the file name are not escaped,
|
||||
use quotes to avoid their special meaning: >
|
||||
:!ls "%"
|
||||
< If the file name contains a "$" single quotes might
|
||||
work better (but a single quote causes trouble): >
|
||||
< If the file name contains a "$" then single quotes
|
||||
might work better, but this only works if the file
|
||||
name does not contain a single quote: >
|
||||
:!ls '%'
|
||||
< This should always work, but it's more typing: >
|
||||
:exe "!ls " . shellescape(expand("%"))
|
||||
< To get a literal "%" or "#" prepend it with a
|
||||
backslash. For example, to list all files starting
|
||||
with "%": >
|
||||
:!ls \%*
|
||||
<
|
||||
A newline character ends {cmd}, what follows is
|
||||
interpreted as a following ":" command. However, if
|
||||
@@ -464,7 +470,7 @@ B *+vartabs* Variable-width tabstops. |'vartabstop'|
|
||||
N *+viminfo* |'viminfo'|
|
||||
*+vertsplit* Vertically split windows |:vsplit|; Always enabled
|
||||
since 8.0.1118.
|
||||
N *+virtualedit* |'virtualedit'|
|
||||
N *+virtualedit* |'virtualedit'| Always enabled since 8.1.826.
|
||||
T *+visual* Visual mode |Visual-mode| Always enabled since 7.4.200.
|
||||
T *+visualextra* extra Visual mode commands |blockwise-operators|
|
||||
T *+vreplace* |gR| and |gr|
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*version8.txt* For Vim version 8.2. Last change: 2020 Feb 04
|
||||
*version8.txt* For Vim version 8.2. Last change: 2020 Jun 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -30777,7 +30777,7 @@ Solution: Use a double quoted string. Add a test.
|
||||
Files: src/ex_docmd.c, src/testdir/test_mksession.vim
|
||||
|
||||
Patch 8.1.0804
|
||||
Problem: Crash when setting v:errmsg to empty list. (Jaon Franklin)
|
||||
Problem: Crash when setting v:errmsg to empty list. (Jason Franklin)
|
||||
Solution: Separate getting value and assigning result.
|
||||
Files: src/eval.c, src/testdir/test_eval_stuff.vim
|
||||
|
||||
@@ -33684,8 +33684,8 @@ Solution: Also change the textprop implementation.
|
||||
Files: src/textprop.c
|
||||
|
||||
Patch 8.1.1279
|
||||
Problem: Cannot set 'spellang' to "sr@latin". (Bojan Stipic)
|
||||
Solution: Allow using '@' in 'spellang'. (closes #4342)
|
||||
Problem: Cannot set 'spelllang' to "sr@latin". (Bojan Stipic)
|
||||
Solution: Allow using '@' in 'spelllang'. (closes #4342)
|
||||
Files: src/option.c, src/testdir/gen_opt_test.vim
|
||||
|
||||
Patch 8.1.1280
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*vi_diff.txt* For Vim version 8.2. Last change: 2019 Dec 17
|
||||
*vi_diff.txt* For Vim version 8.2. Last change: 2020 Jun 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -135,7 +135,6 @@ Support for different systems.
|
||||
- Amiga (500, 1000, 1200, 2000, 3000, 4000, ...).
|
||||
- MS-Windows
|
||||
- VMS
|
||||
- BeOS
|
||||
- Macintosh
|
||||
- IBM OS/390
|
||||
Note that on some systems features need to be disabled to reduce
|
||||
@@ -162,7 +161,7 @@ Graphical User Interface (GUI). |gui|
|
||||
define your own menus. Better support for CTRL/SHIFT/ALT keys in
|
||||
combination with special keys and mouse. Supported for various
|
||||
platforms, such as X11 (with Motif and Athena interfaces), GTK, Win32
|
||||
(Windows 95 and later), BeOS, Amiga and Macintosh.
|
||||
(Windows XP and later), Amiga and Macintosh.
|
||||
|
||||
Multiple windows and buffers. |windows.txt|
|
||||
Vim can split the screen into several windows, each editing a
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2020 May 25
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2020 Jun 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -30,7 +30,7 @@ THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
|
||||
|
||||
Vim script has been growing over time, while preserving backwards
|
||||
compatibility. That means bad choices from the past often can't be changed
|
||||
and compability with Vi restricts possible solutions. Execution is quite
|
||||
and compatibility with Vi restricts possible solutions. Execution is quite
|
||||
slow, each line is parsed every time it is executed.
|
||||
|
||||
The main goal of Vim9 script is to drastically improve performance. This is
|
||||
@@ -68,7 +68,7 @@ In Vim script comments normally start with double quote. That can also be the
|
||||
start of a string, thus in many places it cannot be used. In Vim9 script a
|
||||
comment can also start with #. In Vi this is a command to list text with
|
||||
numbers, but you can also use `:number` for that. >
|
||||
let count = 0 # number of occurences
|
||||
let count = 0 # number of occurrences
|
||||
|
||||
To improve readability there must be a space between the command and the #
|
||||
that starts a comment. Note that #{ is the start of a dictionary, therefore
|
||||
@@ -106,7 +106,7 @@ list type, similar to Typescript. For example, a list of numbers: >
|
||||
|
||||
|
||||
Functions and variables are script-local by default ~
|
||||
|
||||
*vim9-scopes*
|
||||
When using `:function` or `:def` to specify a new function at the script level
|
||||
in a Vim9 script, the function is local to the script, as if "s:" was
|
||||
prefixed. Using the "s:" prefix is optional.
|
||||
@@ -136,7 +136,7 @@ and cannot be deleted or replaced.
|
||||
|
||||
|
||||
Variable declarations with :let and :const ~
|
||||
|
||||
*vim9-declaration*
|
||||
Local variables need to be declared with `:let`. Local constants need to be
|
||||
declared with `:const`. We refer to both as "variables".
|
||||
|
||||
@@ -269,6 +269,13 @@ possible AFTER the operators. For example: >
|
||||
PosFunc(arg) :
|
||||
NegFunc(arg)
|
||||
|
||||
A special case is "->" for function call chains, it can appear in the next
|
||||
line: >
|
||||
let result = GetBuilder()
|
||||
->BuilderSetWidth(333)
|
||||
->BuilderSetHeight(777)
|
||||
->BuilderBuild()
|
||||
|
||||
Note that "enddef" cannot be used at the start of a continuation line, it ends
|
||||
the current function.
|
||||
|
||||
@@ -388,13 +395,17 @@ THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
|
||||
The second and third form are optional arguments.
|
||||
When the caller omits an argument the {value} is used.
|
||||
|
||||
The function will be compiled into instructions when
|
||||
called, or when `:defcompile` is used. Syntax and
|
||||
type errors will be produced at that time.
|
||||
|
||||
NOTE: It is possible to nest `:def` inside another
|
||||
`:def`, but it is not possible to nest `:def` inside
|
||||
`:function`, for backwards compatibility.
|
||||
|
||||
[!] is used as with `:function`. Note that in Vim9
|
||||
script script-local functions cannot be deleted or
|
||||
redefined.
|
||||
redefined later in the same script.
|
||||
|
||||
*:enddef*
|
||||
:enddef End of a function defined with `:def`.
|
||||
@@ -402,8 +413,9 @@ THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
|
||||
|
||||
If the script the function is defined in is Vim9 script, then script-local
|
||||
variables can be accessed without the "s:" prefix. They must be defined
|
||||
before the function. If the script the function is defined in is legacy
|
||||
script, then script-local variables must be accessed with the "s:" prefix.
|
||||
before the function is compiled. If the script the function is defined in is
|
||||
legacy script, then script-local variables must be accessed with the "s:"
|
||||
prefix.
|
||||
|
||||
*:defc* *:defcompile*
|
||||
:defc[ompile] Compile functions defined in the current script that
|
||||
@@ -555,10 +567,13 @@ be exported.
|
||||
Alternatively, an export statement can be used to export several already
|
||||
defined (otherwise script-local) items: >
|
||||
export {EXPORTED_CONST, someValue, MyFunc, MyClass}
|
||||
<
|
||||
*E1042*
|
||||
`:export` can only be used in Vim9 script, at the script level.
|
||||
|
||||
|
||||
Import ~
|
||||
*:import* *:imp*
|
||||
*:import* *:imp* *E1094*
|
||||
The exported items can be imported individually in another Vim9 script: >
|
||||
import EXPORTED_CONST from "thatscript.vim"
|
||||
import MyClass from "myclass.vim"
|
||||
@@ -629,8 +644,8 @@ actually needed. A recommended mechanism:
|
||||
|
||||
Import in legacy Vim script ~
|
||||
|
||||
If an `import` statement is used in legacy Vim script, for identifier the
|
||||
script-local "s:" namespace will be used, even when "s:" is not specified.
|
||||
If an `import` statement is used in legacy Vim script, the script-local "s:"
|
||||
namespace will be used for the imported item, even when "s:" is not specified.
|
||||
|
||||
|
||||
==============================================================================
|
||||
@@ -673,12 +688,37 @@ widely used. The type names are what was used in Vim before, with some
|
||||
additions such as "void" and "bool".
|
||||
|
||||
|
||||
JavaScript/TypeScript syntax and semantics ~
|
||||
Compiling functions early ~
|
||||
|
||||
Functions are compiled when called or when `:defcompile` is used. Why not
|
||||
compile them early, so that syntax and type errors are reported early?
|
||||
|
||||
The functions can't be compiled right away when encountered, because there may
|
||||
be forward references to functions defined later. Consider defining functions
|
||||
A, B and C, where A calls B, B calls C, and C calls A again. It's impossible
|
||||
to reorder the functions to avoid forward references.
|
||||
|
||||
An alternative would be to first scan through the file to locate items and
|
||||
figure out their type, so that forward references are found, and only then
|
||||
execute the script and compile the functions. This means the script has to be
|
||||
parsed twice, which is slower, and some conditions at the script level, such
|
||||
as checking if a feature is supported, are hard to use. An attempt was made
|
||||
to see if it works, but it turned out to be impossible to make work nicely.
|
||||
|
||||
It would be possible to compile all the functions at the end of the script.
|
||||
The drawback is that if a function never gets called, the overhead of
|
||||
compiling it counts anyway. Since startup speed is very important, in most
|
||||
cases it's better to do it later and accept that syntax and type errors are
|
||||
only reported then. In case these errors should be found early, e.g. when
|
||||
testing, the `:defcompile` command will help out.
|
||||
|
||||
|
||||
TypeScript syntax and semantics ~
|
||||
|
||||
Script writers have complained that the Vim script syntax is unexpectedly
|
||||
different from what they are used to. To reduce this complaint popular
|
||||
languages will be used as an example. At the same time, we do not want to
|
||||
abandon the well-known parts of legacy Vim script.
|
||||
languages are used as an example. At the same time, we do not want to abandon
|
||||
the well-known parts of legacy Vim script.
|
||||
|
||||
Since Vim already uses `:let` and `:const` and optional type checking is
|
||||
desirable, the JavaScript/TypeScript syntax fits best for variable
|
||||
@@ -695,7 +735,7 @@ are doing. Some details are unexpected and can be fixed. For example how the
|
||||
...
|
||||
return result || 0 " returns 1
|
||||
|
||||
Vim9 script works like JavaScript, keep the value: >
|
||||
Vim9 script works like JavaScript/Typescript, keep the value: >
|
||||
let result = 44
|
||||
...
|
||||
return result || 0 " returns 44
|
||||
@@ -727,6 +767,16 @@ that works like one would expect:
|
||||
avoided.
|
||||
- The Vim-specific use of "s:" to make things script-local can be dropped.
|
||||
|
||||
When sourcing a Vim9 script from a legacy script, only the items defined
|
||||
globally can be used, not the exported items. Alternatives considered:
|
||||
- All the exported items become available as script-local items. This makes
|
||||
it uncontrollable what items get defined.
|
||||
- Use the exported items and make them global. Disadvantage is that it's then
|
||||
not possible to avoid name clashes in the global namespace.
|
||||
- Completely disallow sourcing a Vim9 script, require using `:import`. That
|
||||
makes it difficult to use scripts for testing, or sourcing them from the
|
||||
command line to try them out.
|
||||
|
||||
|
||||
Classes ~
|
||||
|
||||
|
||||
@@ -137,6 +137,12 @@ invert the status line. Now it should be "sr", reverse the status line, as
|
||||
status line is inverted anyway; you will only see this problem on terminals
|
||||
that have termcap codes for italics.
|
||||
|
||||
*filler-lines*
|
||||
The lines after the last buffer line in a window are called filler lines.
|
||||
These lines start with a tilde (~) character. By default, these are
|
||||
highlighted as NonText (|hl-NonText|). The EndOfBuffer highlight group
|
||||
(|hl-EndOfBuffer|) can be used to change the highlighting of filler lines.
|
||||
|
||||
==============================================================================
|
||||
3. Opening and closing a window *opening-window* *E36*
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 May 07
|
||||
" Last Change: 2020 Jun 15
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -237,7 +237,7 @@ au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
|
||||
au BufNewFile,BufRead *bsd,*.bsdl setf bsdl
|
||||
|
||||
" Bazel (http://bazel.io)
|
||||
autocmd BufRead,BufNewFile *.bzl,WORKSPACE,BUILD.bazel setf bzl
|
||||
autocmd BufRead,BufNewFile *.bzl,WORKSPACE,BUILD.bazel setf bzl
|
||||
if has("fname_case")
|
||||
" There is another check for BUILD further below.
|
||||
autocmd BufRead,BufNewFile BUILD setf bzl
|
||||
@@ -462,7 +462,7 @@ au BufNewFile,BufRead *.desc setf desc
|
||||
au BufNewFile,BufRead *.d call dist#ft#DtraceCheck()
|
||||
|
||||
" Desktop files
|
||||
au BufNewFile,BufRead *.desktop,.directory setf desktop
|
||||
au BufNewFile,BufRead *.desktop,*.directory setf desktop
|
||||
|
||||
" Dict config
|
||||
au BufNewFile,BufRead dict.conf,.dictrc setf dictconf
|
||||
@@ -625,8 +625,8 @@ au BufNewFile,BufRead *.mo,*.gdmo setf gdmo
|
||||
au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom
|
||||
|
||||
" Git
|
||||
au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit
|
||||
au BufNewFile,BufRead *.git/config,.gitconfig,/etc/gitconfig setf gitconfig
|
||||
au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit
|
||||
au BufNewFile,BufRead *.git/config,.gitconfig,/etc/gitconfig setf gitconfig
|
||||
au BufNewFile,BufRead */.config/git/config setf gitconfig
|
||||
au BufNewFile,BufRead .gitmodules,*.git/modules/*/config setf gitconfig
|
||||
if !empty($XDG_CONFIG_HOME)
|
||||
@@ -770,11 +770,11 @@ au BufNewFile,BufRead *.inf,*.INF setf inform
|
||||
au BufNewFile,BufRead */etc/initng/*/*.i,*.ii setf initng
|
||||
|
||||
" Innovation Data Processing
|
||||
au BufRead,BufNewFile upstream.dat\c,upstream.*.dat\c,*.upstream.dat\c setf upstreamdat
|
||||
au BufRead,BufNewFile fdrupstream.log,upstream.log\c,upstream.*.log\c,*.upstream.log\c,UPSTREAM-*.log\c setf upstreamlog
|
||||
au BufRead,BufNewFile upstream.dat\c,upstream.*.dat\c,*.upstream.dat\c setf upstreamdat
|
||||
au BufRead,BufNewFile fdrupstream.log,upstream.log\c,upstream.*.log\c,*.upstream.log\c,UPSTREAM-*.log\c setf upstreamlog
|
||||
au BufRead,BufNewFile upstreaminstall.log\c,upstreaminstall.*.log\c,*.upstreaminstall.log\c setf upstreaminstalllog
|
||||
au BufRead,BufNewFile usserver.log\c,usserver.*.log\c,*.usserver.log\c setf usserverlog
|
||||
au BufRead,BufNewFile usw2kagt.log\c,usw2kagt.*.log\c,*.usw2kagt.log\c setf usw2kagtlog
|
||||
au BufRead,BufNewFile usserver.log\c,usserver.*.log\c,*.usserver.log\c setf usserverlog
|
||||
au BufRead,BufNewFile usw2kagt.log\c,usw2kagt.*.log\c,*.usw2kagt.log\c setf usw2kagtlog
|
||||
|
||||
" Ipfilter
|
||||
au BufNewFile,BufRead ipf.conf,ipf6.conf,ipf.rules setf ipfilter
|
||||
@@ -1073,7 +1073,7 @@ au BufNewFile,BufRead Mutt{ng,}rc setf muttrc
|
||||
au BufRead,BufNewfile *.n1ql,*.nql setf n1ql
|
||||
|
||||
" Nano
|
||||
au BufNewFile,BufRead */etc/nanorc,*.nanorc setf nanorc
|
||||
au BufNewFile,BufRead */etc/nanorc,*.nanorc setf nanorc
|
||||
|
||||
" Nastran input/DMAP
|
||||
"au BufNewFile,BufRead *.dat setf nastran
|
||||
@@ -1156,7 +1156,7 @@ au BufNewFile,BufRead *.dpr setf pascal
|
||||
au BufNewFile,BufRead *.pdf setf pdf
|
||||
|
||||
" PCMK - HAE - crm configure edit
|
||||
au BufNewFile,BufRead *.pcmk setf pcmk
|
||||
au BufNewFile,BufRead *.pcmk setf pcmk
|
||||
|
||||
" Perl
|
||||
if has("fname_case")
|
||||
@@ -1166,6 +1166,7 @@ else
|
||||
endif
|
||||
au BufNewFile,BufRead *.plx,*.al,*.psgi setf perl
|
||||
au BufNewFile,BufRead *.p6,*.pm6,*.pl6 setf perl6
|
||||
au BufNewFile,BufRead *.raku,*.rakumod setf perl6
|
||||
|
||||
" Perl, XPM or XPM2
|
||||
au BufNewFile,BufRead *.pm
|
||||
@@ -1295,7 +1296,8 @@ au BufNewFile,BufRead *.pyx,*.pxd setf pyrex
|
||||
|
||||
" Python, Python Shell Startup and Python Stub Files
|
||||
" Quixote (Python-based web framework)
|
||||
au BufNewFile,BufRead *.py,*.pyw,.pythonstartup,.pythonrc,*.ptl,*.pyi setf python
|
||||
au BufNewFile,BufRead *.py,*.pyw,.pythonstartup,.pythonrc setf python
|
||||
au BufNewFile,BufRead *.ptl,*.pyi,SConstruct setf python
|
||||
|
||||
" Radiance
|
||||
au BufNewFile,BufRead *.rad,*.mat setf radiance
|
||||
@@ -1617,10 +1619,12 @@ au BufNewFile,BufRead *.sqlj setf sqlj
|
||||
au BufNewFile,BufRead *.sqr,*.sqi setf sqr
|
||||
|
||||
" OpenSSH configuration
|
||||
au BufNewFile,BufRead ssh_config,*/.ssh/config setf sshconfig
|
||||
au BufNewFile,BufRead ssh_config,*/.ssh/config setf sshconfig
|
||||
au BufNewFile,BufRead */etc/ssh/ssh_config.d/*.conf setf sshconfig
|
||||
|
||||
" OpenSSH server configuration
|
||||
au BufNewFile,BufRead sshd_config setf sshdconfig
|
||||
au BufNewFile,BufRead sshd_config setf sshdconfig
|
||||
au BufNewFile,BufRead */etc/ssh/sshd_config.d/*.conf setf sshdconfig
|
||||
|
||||
" Stata
|
||||
au BufNewFile,BufRead *.ado,*.do,*.imata,*.mata setf stata
|
||||
@@ -1642,10 +1646,10 @@ au BufNewFile,BufRead *.cm setf voscm
|
||||
|
||||
" Swift
|
||||
au BufNewFile,BufRead *.swift setf swift
|
||||
au BufNewFile,BufRead *.swift.gyb setf swiftgyb
|
||||
au BufNewFile,BufRead *.swift.gyb setf swiftgyb
|
||||
|
||||
" Swift Intermediate Language
|
||||
au BufNewFile,BufRead *.sil setf sil
|
||||
au BufNewFile,BufRead *.sil setf sil
|
||||
|
||||
" Sysctl
|
||||
au BufNewFile,BufRead */etc/sysctl.conf,*/etc/sysctl.d/*.conf setf sysctl
|
||||
@@ -2062,7 +2066,7 @@ au BufNewFile,BufRead *fvwm2rc*
|
||||
au BufNewFile,BufRead */tmp/lltmp* call s:StarSetf('gedcom')
|
||||
|
||||
" Git
|
||||
au BufNewFile,BufRead */.gitconfig.d/*,/etc/gitconfig.d/* call s:StarSetf('gitconfig')
|
||||
au BufNewFile,BufRead */.gitconfig.d/*,/etc/gitconfig.d/* call s:StarSetf('gitconfig')
|
||||
|
||||
" Gitolite
|
||||
au BufNewFile,BufRead */gitolite-admin/conf/* call s:StarSetf('gitolite')
|
||||
|
||||
11
runtime/ftplugin/asm.vim
Normal file
11
runtime/ftplugin/asm.vim
Normal file
@@ -0,0 +1,11 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: asm
|
||||
" Maintainer: Colin Caine <cmcaine at the common googlemail domain>
|
||||
" Last Changed: 23 May 2020
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
setl comments=:;,s1:/*,mb:*,ex:*/,://
|
||||
setl commentstring=;%s
|
||||
|
||||
let b:did_ftplugin = 1
|
||||
18
runtime/ftplugin/elm.vim
Normal file
18
runtime/ftplugin/elm.vim
Normal file
@@ -0,0 +1,18 @@
|
||||
" Elm filetype plugin file
|
||||
" Language: Elm
|
||||
" Maintainer: Andreas Scharf <as@99n.de>
|
||||
" Latest Revision: 2020-05-29
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal comments=s1fl:{-,mb:\ ,ex:-},:--
|
||||
setlocal commentstring=--\ %s
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: man
|
||||
" Maintainer: Jason Franklin <vim@justemail.net>
|
||||
" Maintainer: SungHyun Nam <goweol@gmail.com>
|
||||
" Last Change: 2020 May 07
|
||||
" Last Change: 2020 Jun 01
|
||||
|
||||
" To make the ":Man" command available before editing a manual page, source
|
||||
" this script from your startup vimrc file.
|
||||
@@ -34,8 +34,8 @@ if &filetype == "man"
|
||||
endif
|
||||
nnoremap <buffer> <Plug>ManBS :%s/.\b//g<CR>:setl nomod<CR>''
|
||||
|
||||
nnoremap <buffer> <c-]> :call <SID>PreGetPage(v:count)<CR>
|
||||
nnoremap <buffer> <c-t> :call <SID>PopPage()<CR>
|
||||
nnoremap <buffer> <silent> <c-]> :call <SID>PreGetPage(v:count)<CR>
|
||||
nnoremap <buffer> <silent> <c-t> :call <SID>PopPage()<CR>
|
||||
nnoremap <buffer> <silent> q :q<CR>
|
||||
|
||||
" Add undo commands for the maps
|
||||
@@ -138,11 +138,11 @@ func <SID>GetPage(cmdmods, ...)
|
||||
endif
|
||||
endif
|
||||
if s:FindPage(sect, page) == 0
|
||||
let msg = "\nNo manual entry for ".page
|
||||
if sect != ""
|
||||
let msg .= " in section ".sect
|
||||
let msg = 'man.vim: no manual entry for "' . page . '"'
|
||||
if !empty(sect)
|
||||
let msg .= ' in section ' . sect
|
||||
endif
|
||||
echo msg
|
||||
echomsg msg
|
||||
return
|
||||
endif
|
||||
exec "let s:man_tag_buf_".s:man_tag_depth." = ".bufnr("%")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Vim
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 May 17
|
||||
" Last Change: 2020 Jun 16
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -83,8 +83,7 @@ endif
|
||||
if exists("loaded_matchit")
|
||||
let b:match_ignorecase = 0
|
||||
let b:match_words =
|
||||
\ '\<fu\%[nction]\>:\<retu\%[rn]\>:\<endf\%[unction]\>,' .
|
||||
\ '\<def\>:\<retu\%[rn]\>:\<enddef\>,' .
|
||||
\ '\<\%(fu\%[nction]\|def\)\>:\<retu\%[rn]\>:\<\%(endf\%[unction]\|enddef\)\>,' .
|
||||
\ '\<\(wh\%[ile]\|for\)\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<end\(w\%[hile]\|fo\%[r]\)\>,' .
|
||||
\ '\<if\>:\<el\%[seif]\>:\<en\%[dif]\>,' .
|
||||
\ '{:},' .
|
||||
|
||||
114
runtime/indent/elm.vim
Normal file
114
runtime/indent/elm.vim
Normal file
@@ -0,0 +1,114 @@
|
||||
" Elm indent plugin file
|
||||
" Language: Elm
|
||||
" Maintainer: Andreas Scharf <as@99n.de>
|
||||
" Original Author: Joseph Hager <ajhager@gmail.com>
|
||||
" Copyright: Joseph Hager <ajhager@gmail.com>
|
||||
" License: BSD3
|
||||
" Latest Revision: 2020-05-29
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
" Local defaults
|
||||
setlocal expandtab
|
||||
setlocal indentexpr=GetElmIndent()
|
||||
setlocal indentkeys+=0=else,0=if,0=of,0=import,0=then,0=type,0\|,0},0\],0),=-},0=in
|
||||
setlocal nolisp
|
||||
setlocal nosmartindent
|
||||
|
||||
" Only define the function once.
|
||||
if exists('*GetElmIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Indent pairs
|
||||
function! s:FindPair(pstart, pmid, pend)
|
||||
"call search(a:pend, 'bW')
|
||||
return indent(searchpair(a:pstart, a:pmid, a:pend, 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"'))
|
||||
endfunction
|
||||
|
||||
function! GetElmIndent()
|
||||
let l:lnum = v:lnum - 1
|
||||
|
||||
" Ident 0 if the first line of the file:
|
||||
if l:lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let l:ind = indent(l:lnum)
|
||||
let l:lline = getline(l:lnum)
|
||||
let l:line = getline(v:lnum)
|
||||
|
||||
" Indent if current line begins with '}':
|
||||
if l:line =~? '^\s*}'
|
||||
return s:FindPair('{', '', '}')
|
||||
|
||||
" Indent if current line begins with 'else':
|
||||
elseif l:line =~# '^\s*else\>'
|
||||
if l:lline !~# '^\s*\(if\|then\)\>'
|
||||
return s:FindPair('\<if\>', '', '\<else\>')
|
||||
endif
|
||||
|
||||
" Indent if current line begins with 'then':
|
||||
elseif l:line =~# '^\s*then\>'
|
||||
if l:lline !~# '^\s*\(if\|else\)\>'
|
||||
return s:FindPair('\<if\>', '', '\<then\>')
|
||||
endif
|
||||
|
||||
" HACK: Indent lines in case with nearest case clause:
|
||||
elseif l:line =~# '->' && l:line !~# ':' && l:line !~# '\\'
|
||||
return indent(search('^\s*case', 'bWn')) + &shiftwidth
|
||||
|
||||
" HACK: Don't change the indentation if the last line is a comment.
|
||||
elseif l:lline =~# '^\s*--'
|
||||
return l:ind
|
||||
|
||||
" Align the end of block comments with the start
|
||||
elseif l:line =~# '^\s*-}'
|
||||
return indent(search('{-', 'bWn'))
|
||||
|
||||
" Indent double shift after let with an empty rhs
|
||||
elseif l:lline =~# '\<let\>.*\s=$'
|
||||
return l:ind + 4 + &shiftwidth
|
||||
|
||||
" Align 'in' with the parent let.
|
||||
elseif l:line =~# '^\s*in\>'
|
||||
return indent(search('^\s*let', 'bWn'))
|
||||
|
||||
" Align bindings with the parent let.
|
||||
elseif l:lline =~# '\<let\>'
|
||||
return l:ind + 4
|
||||
|
||||
" Align bindings with the parent in.
|
||||
elseif l:lline =~# '^\s*in\>'
|
||||
return l:ind
|
||||
|
||||
endif
|
||||
|
||||
" Add a 'shiftwidth' after lines ending with:
|
||||
if l:lline =~# '\(|\|=\|->\|<-\|(\|\[\|{\|\<\(of\|else\|if\|then\)\)\s*$'
|
||||
let l:ind = l:ind + &shiftwidth
|
||||
|
||||
" Add a 'shiftwidth' after lines starting with type ending with '=':
|
||||
elseif l:lline =~# '^\s*type' && l:line =~# '^\s*='
|
||||
let l:ind = l:ind + &shiftwidth
|
||||
|
||||
" Back to normal indent after comments:
|
||||
elseif l:lline =~# '-}\s*$'
|
||||
call search('-}', 'bW')
|
||||
let l:ind = indent(searchpair('{-', '', '-}', 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"'))
|
||||
|
||||
" Ident some operators if there aren't any starting the last line.
|
||||
elseif l:line =~# '^\s*\(!\|&\|(\|`\|+\||\|{\|[\|,\)=' && l:lline !~# '^\s*\(!\|&\|(\|`\|+\||\|{\|[\|,\)=' && l:lline !~# '^\s*$'
|
||||
let l:ind = l:ind + &shiftwidth
|
||||
|
||||
elseif l:lline ==# '' && getline(l:lnum - 1) !=# ''
|
||||
let l:ind = indent(search('^\s*\S+', 'bWn'))
|
||||
|
||||
endif
|
||||
|
||||
return l:ind
|
||||
endfunc
|
||||
@@ -2,7 +2,7 @@
|
||||
" Header: "{{{
|
||||
" Maintainer: Bram Moolenaar
|
||||
" Original Author: Andy Wokula <anwoku@yahoo.de>
|
||||
" Last Change: 2019 Mar 20
|
||||
" Last Change: 2020 Jun 18
|
||||
" Version: 1.0
|
||||
" Description: HTML indent script with cached state for faster indenting on a
|
||||
" range of lines.
|
||||
@@ -223,7 +223,7 @@ endfunc "}}}
|
||||
call s:AddITags(s:indent_tags, [
|
||||
\ 'a', 'abbr', 'acronym', 'address', 'b', 'bdo', 'big',
|
||||
\ 'blockquote', 'body', 'button', 'caption', 'center', 'cite', 'code',
|
||||
\ 'colgroup', 'del', 'dfn', 'dir', 'div', 'dl', 'em', 'fieldset', 'font',
|
||||
\ 'colgroup', 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt', 'em', 'fieldset', 'font',
|
||||
\ 'form', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'html',
|
||||
\ 'i', 'iframe', 'ins', 'kbd', 'label', 'legend', 'li',
|
||||
\ 'map', 'menu', 'noframes', 'noscript', 'object', 'ol',
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
" Vim indent file
|
||||
" Language: SQL
|
||||
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
|
||||
" Last Change: 2017 Jun 13
|
||||
" Last Change By Maintainer: 2017 Jun 13
|
||||
" Last Change: by Stephen Wall, #5578, 2020 Jun 07
|
||||
" Version: 3.0
|
||||
" Download: http://vim.sourceforge.net/script.php?script_id=495
|
||||
|
||||
@@ -67,68 +68,73 @@ set cpo&vim
|
||||
" IS is excluded, since it is difficult to determine when the
|
||||
" ending block is (especially for procedures/functions).
|
||||
let s:SQLBlockStart = '^\s*\%('.
|
||||
\ 'if\|else\|elseif\|elsif\|'.
|
||||
\ 'while\|loop\|do\|for\|'.
|
||||
\ 'begin\|'.
|
||||
\ 'if\>.*\<then\|'.
|
||||
\ 'then\|else\>\|'.
|
||||
\ 'elseif\>.*\<then\|'.
|
||||
\ 'elsif\>.(\<then\|'.
|
||||
\ 'while\>.*\<loop\|'.
|
||||
\ 'for\>.*\<loop\|'.
|
||||
\ 'foreach\>.*\<loop\|'.
|
||||
\ 'loop\|do\|declare\|begin\|'.
|
||||
\ 'case\|when\|merge\|exception'.
|
||||
\ '\)\>'
|
||||
let s:SQLBlockEnd = '^\s*\(end\)\>'
|
||||
|
||||
" The indent level is also based on unmatched paranethesis
|
||||
" The indent level is also based on unmatched parentheses
|
||||
" If a line has an extra "(" increase the indent
|
||||
" If a line has an extra ")" decrease the indent
|
||||
function! s:CountUnbalancedParan( line, paran_to_check )
|
||||
function! s:CountUnbalancedParen( line, paren_to_check )
|
||||
let l = a:line
|
||||
let lp = substitute(l, '[^(]', '', 'g')
|
||||
let l = a:line
|
||||
let rp = substitute(l, '[^)]', '', 'g')
|
||||
|
||||
if a:paran_to_check =~ ')'
|
||||
" echom 'CountUnbalancedParan ) returning: ' .
|
||||
if a:paren_to_check =~ ')'
|
||||
" echom 'CountUnbalancedParen ) returning: ' .
|
||||
" \ (strlen(rp) - strlen(lp))
|
||||
return (strlen(rp) - strlen(lp))
|
||||
elseif a:paran_to_check =~ '('
|
||||
" echom 'CountUnbalancedParan ( returning: ' .
|
||||
elseif a:paren_to_check =~ '('
|
||||
" echom 'CountUnbalancedParen ( returning: ' .
|
||||
" \ (strlen(lp) - strlen(rp))
|
||||
return (strlen(lp) - strlen(rp))
|
||||
else
|
||||
" echom 'CountUnbalancedParan unknown paran to check: ' .
|
||||
" \ a:paran_to_check
|
||||
" echom 'CountUnbalancedParen unknown paren to check: ' .
|
||||
" \ a:paren_to_check
|
||||
return 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Unindent commands based on previous indent level
|
||||
function! s:CheckToIgnoreRightParan( prev_lnum, num_levels )
|
||||
function! s:CheckToIgnoreRightParen( prev_lnum, num_levels )
|
||||
let lnum = a:prev_lnum
|
||||
let line = getline(lnum)
|
||||
let ends = 0
|
||||
let num_right_paran = a:num_levels
|
||||
let ignore_paran = 0
|
||||
let num_right_paren = a:num_levels
|
||||
let ignore_paren = 0
|
||||
let vircol = 1
|
||||
|
||||
while num_right_paran > 0
|
||||
while num_right_paren > 0
|
||||
silent! exec 'norm! '.lnum."G\<bar>".vircol."\<bar>"
|
||||
let right_paran = search( ')', 'W' )
|
||||
if right_paran != lnum
|
||||
let right_paren = search( ')', 'W' )
|
||||
if right_paren != lnum
|
||||
" This should not happen since there should be at least
|
||||
" num_right_paran matches for this line
|
||||
" num_right_paren matches for this line
|
||||
break
|
||||
endif
|
||||
let vircol = virtcol(".")
|
||||
|
||||
" if getline(".") =~ '^)'
|
||||
let matching_paran = searchpair('(', '', ')', 'bW',
|
||||
let matching_paren = searchpair('(', '', ')', 'bW',
|
||||
\ 's:IsColComment(line("."), col("."))')
|
||||
|
||||
if matching_paran < 1
|
||||
if matching_paren < 1
|
||||
" No match found
|
||||
" echom 'CTIRP - no match found, ignoring'
|
||||
break
|
||||
endif
|
||||
|
||||
if matching_paran == lnum
|
||||
" This was not an unmatched parantenses, start the search again
|
||||
if matching_paren == lnum
|
||||
" This was not an unmatched parentheses, start the search again
|
||||
" again after this column
|
||||
" echom 'CTIRP - same line match, ignoring'
|
||||
continue
|
||||
@@ -136,23 +142,23 @@ function! s:CheckToIgnoreRightParan( prev_lnum, num_levels )
|
||||
|
||||
" echom 'CTIRP - match: ' . line(".") . ' ' . getline(".")
|
||||
|
||||
if getline(matching_paran) =~? '\(if\|while\)\>'
|
||||
if getline(matching_paren) =~? '\(if\|while\)\>'
|
||||
" echom 'CTIRP - if/while ignored: ' . line(".") . ' ' . getline(".")
|
||||
let ignore_paran = ignore_paran + 1
|
||||
let ignore_paren = ignore_paren + 1
|
||||
endif
|
||||
|
||||
" One match found, decrease and check for further matches
|
||||
let num_right_paran = num_right_paran - 1
|
||||
let num_right_paren = num_right_paren - 1
|
||||
|
||||
endwhile
|
||||
|
||||
" Fallback - just move back one
|
||||
" return a:prev_indent - shiftwidth()
|
||||
return ignore_paran
|
||||
return ignore_paren
|
||||
endfunction
|
||||
|
||||
" Based on the keyword provided, loop through previous non empty
|
||||
" non comment lines to find the statement that initated the keyword.
|
||||
" non comment lines to find the statement that initiated the keyword.
|
||||
" Return its indent level
|
||||
" CASE ..
|
||||
" WHEN ...
|
||||
@@ -295,26 +301,26 @@ function! GetSQLIndent()
|
||||
" echom 'prevl - SQLBlockStart - indent ' . ind . ' line: ' . prevline
|
||||
elseif prevline =~ '[()]'
|
||||
if prevline =~ '('
|
||||
let num_unmatched_left = s:CountUnbalancedParan( prevline, '(' )
|
||||
let num_unmatched_left = s:CountUnbalancedParen( prevline, '(' )
|
||||
else
|
||||
let num_unmatched_left = 0
|
||||
endif
|
||||
if prevline =~ ')'
|
||||
let num_unmatched_right = s:CountUnbalancedParan( prevline, ')' )
|
||||
let num_unmatched_right = s:CountUnbalancedParen( prevline, ')' )
|
||||
else
|
||||
let num_unmatched_right = 0
|
||||
" let num_unmatched_right = s:CountUnbalancedParan( prevline, ')' )
|
||||
" let num_unmatched_right = s:CountUnbalancedParen( prevline, ')' )
|
||||
endif
|
||||
if num_unmatched_left > 0
|
||||
" There is a open left paranethesis
|
||||
" There is a open left parenthesis
|
||||
" increase indent
|
||||
let ind = ind + ( shiftwidth() * num_unmatched_left )
|
||||
elseif num_unmatched_right > 0
|
||||
" if it is an unbalanced paranethesis only unindent if
|
||||
" if it is an unbalanced parenthesis only unindent if
|
||||
" it was part of a command (ie create table(..) )
|
||||
" instead of part of an if (ie if (....) then) which should
|
||||
" maintain the indent level
|
||||
let ignore = s:CheckToIgnoreRightParan( prevlnum, num_unmatched_right )
|
||||
let ignore = s:CheckToIgnoreRightParen( prevlnum, num_unmatched_right )
|
||||
" echom 'prevl - ) unbalanced - CTIRP - ignore: ' . ignore
|
||||
|
||||
if prevline =~ '^\s*)'
|
||||
@@ -357,8 +363,8 @@ function! GetSQLIndent()
|
||||
" elseif line =~ '^\s*)\s*;\?\s*$'
|
||||
" elseif line =~ '^\s*)'
|
||||
elseif line =~ '^\s*)'
|
||||
let num_unmatched_right = s:CountUnbalancedParan( line, ')' )
|
||||
let ignore = s:CheckToIgnoreRightParan( v:lnum, num_unmatched_right )
|
||||
let num_unmatched_right = s:CountUnbalancedParen( line, ')' )
|
||||
let ignore = s:CheckToIgnoreRightParen( v:lnum, num_unmatched_right )
|
||||
" If the line ends in a ), then reduce the indent
|
||||
" This catches items like:
|
||||
" CREATE TABLE T1(
|
||||
@@ -368,7 +374,7 @@ function! GetSQLIndent()
|
||||
" But we do not want to unindent a line like:
|
||||
" IF ( c1 = 1
|
||||
" AND c2 = 3 ) THEN
|
||||
" let num_unmatched_right = s:CountUnbalancedParan( line, ')' )
|
||||
" let num_unmatched_right = s:CountUnbalancedParen( line, ')' )
|
||||
" if num_unmatched_right > 0
|
||||
" elseif strpart( line, strlen(line)-1, 1 ) =~ ')'
|
||||
" let ind = ind - shiftwidth()
|
||||
|
||||
@@ -23,4 +23,14 @@ bar">
|
||||
text
|
||||
</div>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
dd text
|
||||
</dd>
|
||||
<dt>
|
||||
dt text
|
||||
</dt>
|
||||
</dl>
|
||||
|
||||
|
||||
" END_INDENT
|
||||
|
||||
@@ -23,4 +23,14 @@
|
||||
text
|
||||
</div>
|
||||
|
||||
<dl>
|
||||
<dd>
|
||||
dd text
|
||||
</dd>
|
||||
<dt>
|
||||
dt text
|
||||
</dt>
|
||||
</dl>
|
||||
|
||||
|
||||
" END_INDENT
|
||||
|
||||
@@ -12,3 +12,8 @@ map2:
|
||||
map: &anchor
|
||||
map: val
|
||||
# END_INDENT
|
||||
|
||||
# START_INDENT
|
||||
map: multiline
|
||||
value
|
||||
# END_INDENT
|
||||
|
||||
@@ -12,3 +12,8 @@ map2:
|
||||
map: &anchor
|
||||
map: val
|
||||
# END_INDENT
|
||||
|
||||
# START_INDENT
|
||||
map: multiline
|
||||
value
|
||||
# END_INDENT
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
" Vim indent file
|
||||
" Language: YAML
|
||||
" Maintainer: Nikolai Pavlov <zyx.vim@gmail.com>
|
||||
" Last Change: 2019 Sep 28
|
||||
" Language: YAML
|
||||
" Maintainer: Nikolai Pavlov <zyx.vim@gmail.com>
|
||||
" Last Update: Lukas Reineke
|
||||
" Last Change: 2020 Jun 07
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
@@ -53,7 +54,7 @@ let s:c_ns_anchor_name = s:c_ns_anchor_char.'+'
|
||||
let s:c_ns_anchor_property = '\v\&'.s:c_ns_anchor_name
|
||||
|
||||
let s:ns_word_char = '\v[[:alnum:]_\-]'
|
||||
let s:ns_tag_char = '\v%(%\x\x|'.s:ns_word_char.'|[#/;?:@&=+$.~*''()])'
|
||||
let s:ns_tag_char = '\v%('.s:ns_word_char.'|[#/;?:@&=+$.~*''()])'
|
||||
let s:c_named_tag_handle = '\v\!'.s:ns_word_char.'+\!'
|
||||
let s:c_secondary_tag_handle = '\v\!\!'
|
||||
let s:c_primary_tag_handle = '\v\!'
|
||||
@@ -62,7 +63,7 @@ let s:c_tag_handle = '\v%('.s:c_named_tag_handle.
|
||||
\ '|'.s:c_primary_tag_handle.')'
|
||||
let s:c_ns_shorthand_tag = '\v'.s:c_tag_handle . s:ns_tag_char.'+'
|
||||
let s:c_non_specific_tag = '\v\!'
|
||||
let s:ns_uri_char = '\v%(%\x\x|'.s:ns_word_char.'\v|[#/;?:@&=+$,.!~*''()[\]])'
|
||||
let s:ns_uri_char = '\v%('.s:ns_word_char.'\v|[#/;?:@&=+$,.!~*''()[\]])'
|
||||
let s:c_verbatim_tag = '\v\!\<'.s:ns_uri_char.'+\>'
|
||||
let s:c_ns_tag_property = '\v'.s:c_verbatim_tag.
|
||||
\ '\v|'.s:c_ns_shorthand_tag.
|
||||
|
||||
@@ -453,12 +453,12 @@ if has("spell")
|
||||
an 40.335.260 &Tools.&Spelling.Set\ Language\ to\ "en_us" :set spl=en_us spell<CR>
|
||||
an <silent> 40.335.270 &Tools.&Spelling.&Find\ More\ Languages :call <SID>SpellLang()<CR>
|
||||
|
||||
let s:undo_spellang = ['aun &Tools.&Spelling.&Find\ More\ Languages']
|
||||
let s:undo_spelllang = ['aun &Tools.&Spelling.&Find\ More\ Languages']
|
||||
func s:SpellLang()
|
||||
for cmd in s:undo_spellang
|
||||
for cmd in s:undo_spelllang
|
||||
exe "silent! " . cmd
|
||||
endfor
|
||||
let s:undo_spellang = []
|
||||
let s:undo_spelllang = []
|
||||
|
||||
if &enc == "iso-8859-15"
|
||||
let enc = "latin1"
|
||||
@@ -481,7 +481,7 @@ if has("spell")
|
||||
let found += 1
|
||||
let menuname = '&Tools.&Spelling.' . escape(g:menutrans_set_lang_to, "\\. \t|") . '\ "' . nm . '"'
|
||||
exe 'an 40.335.' . n . ' ' . menuname . ' :set spl=' . nm . ' spell<CR>'
|
||||
let s:undo_spellang += ['aun ' . menuname]
|
||||
let s:undo_spelllang += ['aun ' . menuname]
|
||||
endif
|
||||
let n += 10
|
||||
endfor
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" These commands create the option window.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2019 Nov 07
|
||||
" Last Change: 2020 Jun 10
|
||||
|
||||
" If there already is an option window, jump to that one.
|
||||
let buf = bufnr('option-window')
|
||||
@@ -447,6 +447,9 @@ if has("syntax")
|
||||
call append("$", "spellcapcheck\tpattern to locate the end of a sentence")
|
||||
call append("$", "\t(local to buffer)")
|
||||
call <SID>OptionL("spc")
|
||||
call append("$", "spelloptions\tflags to change how spell checking works")
|
||||
call append("$", "\t(local to buffer)")
|
||||
call <SID>OptionL("spo")
|
||||
call append("$", "spellsuggest\tmethods used to suggest corrections")
|
||||
call <SID>OptionG("sps", &sps)
|
||||
call append("$", "mkspellmem\tamount of memory used by :mkspell before compressing")
|
||||
@@ -1153,7 +1156,7 @@ call <SID>BinOptionG("warn", &warn)
|
||||
|
||||
|
||||
if has("quickfix")
|
||||
call <SID>Header("running make and jumping to errors")
|
||||
call <SID>Header("running make and jumping to errors (quickfix)")
|
||||
call append("$", "errorfile\tname of the file that contains error messages")
|
||||
call <SID>OptionG("ef", &ef)
|
||||
call append("$", "errorformat\tlist of formats for error messages")
|
||||
@@ -1174,6 +1177,8 @@ if has("quickfix")
|
||||
call append("$", "makeencoding\tencoding of the \":make\" and \":grep\" output")
|
||||
call append("$", "\t(global or local to buffer)")
|
||||
call <SID>OptionG("menc", &menc)
|
||||
call append("$", "quickfixtextfunc\tfunction to display text in the quickfix window")
|
||||
call <SID>OptionG("qftf", &qftf)
|
||||
endif
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"
|
||||
" Author: Bram Moolenaar
|
||||
" Copyright: Vim license applies, see ":help license"
|
||||
" Last Change: 2020 May 22
|
||||
" Last Change: 2020 Jun 12
|
||||
"
|
||||
" WORK IN PROGRESS - Only the basics work
|
||||
" Note: On MS-Windows you need a recent version of gdb. The one included with
|
||||
@@ -710,7 +710,7 @@ func s:DeleteCommands()
|
||||
delcommand Source
|
||||
delcommand Winbar
|
||||
|
||||
if exists('s:k_map_saved')
|
||||
if exists('s:k_map_saved') && !empty(s:k_map_saved)
|
||||
call mapset('n', 0, s:k_map_saved)
|
||||
unlet s:k_map_saved
|
||||
endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim plugin for showing matching parens
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2019 Oct 28
|
||||
" Last Change: 2020 Jun 18
|
||||
|
||||
" Exit quickly when:
|
||||
" - this plugin was already loaded (or disabled)
|
||||
@@ -21,6 +21,7 @@ endif
|
||||
augroup matchparen
|
||||
" Replace all matchparen autocommands
|
||||
autocmd! CursorMoved,CursorMovedI,WinEnter * call s:Highlight_Matching_Pair()
|
||||
autocmd! WinLeave * call s:Remove_Matches()
|
||||
if exists('##TextChanged')
|
||||
autocmd! TextChanged,TextChangedI * call s:Highlight_Matching_Pair()
|
||||
endif
|
||||
@@ -38,10 +39,7 @@ set cpo-=C
|
||||
" for any matching paren.
|
||||
func s:Highlight_Matching_Pair()
|
||||
" Remove any previous match.
|
||||
if exists('w:paren_hl_on') && w:paren_hl_on
|
||||
silent! call matchdelete(3)
|
||||
let w:paren_hl_on = 0
|
||||
endif
|
||||
call s:Remove_Matches()
|
||||
|
||||
" Avoid that we remove the popup menu.
|
||||
" Return when there are no colors (looks like the cursor jumps).
|
||||
@@ -195,6 +193,14 @@ func s:Highlight_Matching_Pair()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
func s:Remove_Matches()
|
||||
if exists('w:paren_hl_on') && w:paren_hl_on
|
||||
silent! call matchdelete(3)
|
||||
let w:paren_hl_on = 0
|
||||
endif
|
||||
endfunc
|
||||
|
||||
|
||||
" Define commands that will disable and enable the plugin.
|
||||
command DoMatchParen call s:DoMatchParen()
|
||||
command NoMatchParen call s:NoMatchParen()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types in scripts
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last change: 2020 Mar 06
|
||||
" Last change: 2020 Jun 07
|
||||
|
||||
" This file is called by an autocommand for every file that has just been
|
||||
" loaded into a buffer. It checks if the type of file can be recognized by
|
||||
@@ -35,10 +35,12 @@ let s:line1 = getline(1)
|
||||
if s:line1 =~# "^#!"
|
||||
" A script that starts with "#!".
|
||||
|
||||
" Check for a line like "#!/usr/bin/env VAR=val bash". Turn it into
|
||||
" Check for a line like "#!/usr/bin/env {options} bash". Turn it into
|
||||
" "#!/usr/bin/bash" to make matching easier.
|
||||
" Recognize only a few {options} that are commonly used.
|
||||
if s:line1 =~# '^#!\s*\S*\<env\s'
|
||||
let s:line1 = substitute(s:line1, '\S\+=\S\+', '', 'g')
|
||||
let s:line1 = substitute(s:line1, '\(-[iS]\|--ignore-environment\|--split-string\)', '', '')
|
||||
let s:line1 = substitute(s:line1, '\<env\s\+', '', '')
|
||||
endif
|
||||
|
||||
|
||||
81
runtime/spell/eu/main.aap
Normal file
81
runtime/spell/eu/main.aap
Normal file
@@ -0,0 +1,81 @@
|
||||
# Aap recipe for Basque Vim spell files.
|
||||
#
|
||||
# NOTE: This takes a VERY long time: several hours on a modern PC, more than
|
||||
# a day on older systems.
|
||||
|
||||
# Select the amount of memory that can be used.
|
||||
# Default.
|
||||
#SETTING = 'set mkspellmem=460000,2000,500'
|
||||
|
||||
# For about 1 Tbyte of RAM.
|
||||
#SETTING = 'set mkspellmem=900000,4000,1000'
|
||||
|
||||
# For about 2 Tbyte of RAM.
|
||||
#SETTING = 'set mkspellmem=1900000,8000,2000'
|
||||
|
||||
# For about 4 Tbyte of RAM.
|
||||
#SETTING = 'set mkspellmem=3900000,16000,4000'
|
||||
|
||||
# For about 8 Tbyte of RAM.
|
||||
SETTING = 'set mkspellmem=7900000,30000,8000'
|
||||
|
||||
|
||||
# Use a freshly compiled Vim if it exists.
|
||||
@if os.path.exists('../../../src/vim'):
|
||||
VIM = ../../../src/vim
|
||||
@else:
|
||||
:progsearch VIM vim
|
||||
|
||||
SPELLDIR = ..
|
||||
FILES = eu_ES.aff eu_ES.dic
|
||||
|
||||
all: $SPELLDIR/eu.utf-8.spl ../README_eu.txt
|
||||
|
||||
$SPELLDIR/eu.utf-8.spl : $FILES
|
||||
:sys env LANG=eu_ES.UTF-8
|
||||
$VIM -u NONE -e -c $SETTING -c "mkspell! $SPELLDIR/eu eu_ES" -c q
|
||||
|
||||
#
|
||||
# Fetching the files.
|
||||
# URL suggested by Zuhaitz Beloki Leiza.
|
||||
#
|
||||
:attr {fetch = http://xuxen.eus/static/hunspell/xuxen_5.1_hunspell.tar.gz} xuxen_5.1_hunspell.tar.gz
|
||||
|
||||
# The files don't depend on the tar file so that we can delete it.
|
||||
# Only download the tar file if the targets don't exist.
|
||||
eu_ES.aff eu_ES.dic: {buildcheck=}
|
||||
:assertpkg tar
|
||||
:fetch xuxen_5.1_hunspell.tar.gz
|
||||
:sys tar xf xuxen_5.1_hunspell.tar.gz
|
||||
:update cleanunused
|
||||
@if not os.path.exists('eu_ES.orig.aff'):
|
||||
:copy eu_ES.aff eu_ES.orig.aff
|
||||
@if not os.path.exists('eu_ES.orig.dic'):
|
||||
:copy eu_ES.dic eu_ES.orig.dic
|
||||
@if os.path.exists('eu_ES.diff'):
|
||||
:sys patch <eu_ES.diff
|
||||
|
||||
../README_eu.txt : LICENSE.txt
|
||||
:cat $source >! $target
|
||||
|
||||
# Delete all the files unpacked from the archive
|
||||
clean: cleanunused
|
||||
:delete {f} eu_ES.dic
|
||||
:delete {f} eu_ES.aff
|
||||
|
||||
# Delete all the files from the archive that are not used, including the
|
||||
# archive itself.
|
||||
cleanunused:
|
||||
:delete {f} xuxen_5.1_hunspell.tar.gz
|
||||
|
||||
# Generate diff files, so that others can get the files and apply
|
||||
# the diffs to get the Vim versions.
|
||||
|
||||
diff:
|
||||
:assertpkg diff
|
||||
:sys {force} diff -a -C 1 eu_ES.orig.aff eu_ES.aff >eu_ES.diff
|
||||
:sys {force} diff -a -C 1 eu_ES.orig.dic eu_ES.dic >>eu_ES.diff
|
||||
|
||||
|
||||
|
||||
# vim: set sts=4 sw=4 :
|
||||
@@ -5,9 +5,10 @@
|
||||
# aap diff create all the diff files
|
||||
|
||||
# "hu" is at the end, because it takes a very long time.
|
||||
# "eu" takes even longer (4 hours on my system).
|
||||
LANG = af am bg br ca cs cy da de el en eo es fr fo ga gd gl he hr id it
|
||||
ku la lt lv mg mi ms nb nl nn ny pl pt ro ru rw sk sl sv sw
|
||||
tet th tl tn tr uk yi zu hu
|
||||
tet th tl tn tr uk yi zu hu eu
|
||||
|
||||
# TODO:
|
||||
# Finnish doesn't work, the dictionary fi_FI.zip file contains hyphenation...
|
||||
@@ -15,6 +16,12 @@ LANG = af am bg br ca cs cy da de el en eo es fr fo ga gd gl he hr id it
|
||||
diff: $*LANG/diff
|
||||
:print Done.
|
||||
|
||||
# Use "aap publish" to upload the .spl files.
|
||||
SPL_files = eu.utf-8.spl
|
||||
|
||||
UPDIR = rsync://bram@ftp1.nluug.nl//var/ftp/pub/vim/runtime/spell
|
||||
:attr {publish = $UPDIR/%file%} $SPL_files
|
||||
|
||||
@for l in string.split(_no.LANG):
|
||||
:child $l/main.aap
|
||||
|
||||
|
||||
@@ -1,107 +1,267 @@
|
||||
" Vim syntax file
|
||||
" Language: .desktop, .directory files
|
||||
" according to freedesktop.org specification 0.9.4
|
||||
" http://pdx.freedesktop.org/Standards/desktop-entry-spec/desktop-entry-spec-0.9.4.html
|
||||
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2016 Apr 02
|
||||
" (added "Keywords")
|
||||
" Version Info: desktop.vim 0.9.4-1.2
|
||||
" Language: XDG desktop entry
|
||||
" Filenames: *.desktop, *.directory
|
||||
" Maintainer: Eisuke Kawashima ( e.kawaschima+vim AT gmail.com )
|
||||
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2020-06-11
|
||||
" Version Info: desktop.vim 1.5
|
||||
" References:
|
||||
" - https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.5.html (2020-04-27)
|
||||
" - https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-0.11.html (2006-02-07)
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
|
||||
" This syntax file can be used to all *nix configuration files similar to dos
|
||||
" ini format (eg. .xawtv, .radio, kde rc files) - this is default mode. But
|
||||
" you can also enforce strict following of freedesktop.org standard for
|
||||
" .desktop and .directory files . Set (eg. in vimrc)
|
||||
" let enforce_freedesktop_standard = 1
|
||||
" and nonstandard extensions not following X- notation will not be highlighted.
|
||||
if exists("enforce_freedesktop_standard")
|
||||
let b:enforce_freedesktop_standard = 1
|
||||
else
|
||||
let b:enforce_freedesktop_standard = 0
|
||||
endif
|
||||
|
||||
" case on
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
syn case match
|
||||
|
||||
" General
|
||||
if b:enforce_freedesktop_standard == 0
|
||||
syn match dtNotStLabel "^.\{-}=\@=" nextgroup=dtDelim
|
||||
" Variable {{{1
|
||||
" This syntax file can be used to all *nix configuration files similar to dos
|
||||
" ini format (eg. .xawtv, .radio, kde rc files) - this is default mode.
|
||||
" By default strict following of freedesktop.org standard is enforced.
|
||||
" To highlight nonstandard extensions that does not begin with X-, set
|
||||
" let g:desktop_enable_nonstd = v:true
|
||||
" Note that this may cause wrong highlight.
|
||||
" To highlight KDE-reserved features, set
|
||||
" let g:desktop_enable_kde = v:true
|
||||
" g:desktop_enable_kde follows g:desktop_enable_nonstd if not supplied
|
||||
|
||||
if exists("g:desktop_enable_nonstd") && g:desktop_enable_nonstd
|
||||
let s:desktop_enable_nonstd = v:true
|
||||
else
|
||||
let s:desktop_enable_nonstd = v:false
|
||||
endif
|
||||
|
||||
syn match dtGroup /^\s*\[.*\]/
|
||||
syn match dtComment /^\s*#.*$/
|
||||
syn match dtDelim /=/ contained
|
||||
if exists("g:desktop_enable_kde") && g:desktop_enable_kde || s:desktop_enable_nonstd
|
||||
let s:desktop_enable_kde = v:true
|
||||
else
|
||||
let s:desktop_enable_kde = v:false
|
||||
endif
|
||||
|
||||
" Locale
|
||||
syn match dtLocale /^\s*\<\(Name\|GenericName\|Comment\|SwallowTitle\|Icon\|UnmountIcon\)\>.*/ contains=dtLocaleKey,dtLocaleName,dtDelim transparent
|
||||
syn keyword dtLocaleKey Name GenericName Comment SwallowTitle Icon UnmountIcon nextgroup=dtLocaleName containedin=dtLocale
|
||||
syn match dtLocaleName /\(\[.\{-}\]\s*=\@=\|\)/ nextgroup=dtDelim containedin=dtLocale contained
|
||||
" Comment {{{1
|
||||
syn match dtComment /^#.*$/
|
||||
|
||||
" Numeric
|
||||
syn match dtNumeric /^\s*\<Version\>/ contains=dtNumericKey,dtDelim
|
||||
syn keyword dtNumericKey Version nextgroup=dtDelim containedin=dtNumeric contained
|
||||
" Error {{{1
|
||||
syn match dtError /\%(^\s.*\|\s\+$\)/
|
||||
|
||||
" Boolean
|
||||
syn match dtBoolean /^\s*\<\(StartupNotify\|ReadOnly\|Terminal\|Hidden\|NoDisplay\)\>.*/ contains=dtBooleanKey,dtDelim,dtBooleanValue transparent
|
||||
syn keyword dtBooleanKey StartupNotify ReadOnly Terminal Hidden NoDisplay nextgroup=dtDelim containedin=dtBoolean contained
|
||||
syn keyword dtBooleanValue true false containedin=dtBoolean contained
|
||||
" Group Header {{{1
|
||||
" ASCII printable characters except for brackets [ (0x5B) and ] (0x5D)
|
||||
syn match dtGroup /^\[[\x20-\x5A\x5C\x5E-\x7E]\+\]$/
|
||||
|
||||
" String
|
||||
syn match dtString /^\s*\<\(Encoding\|Icon\|Path\|Actions\|FSType\|MountPoint\|UnmountIcon\|URL\|Keywords\|Categories\|OnlyShowIn\|NotShowIn\|StartupWMClass\|FilePattern\|MimeType\)\>.*/ contains=dtStringKey,dtDelim transparent
|
||||
syn keyword dtStringKey Type Encoding TryExec Exec Path Actions FSType MountPoint URL Keywords Categories OnlyShowIn NotShowIn StartupWMClass FilePattern MimeType nextgroup=dtDelim containedin=dtString contained
|
||||
" Entries {{{1
|
||||
syn match dtDelim /=/ contained
|
||||
" lang_territory.codeset@modifier
|
||||
syn match dtLocaleSuffix
|
||||
\ /\[\%(C\|POSIX\|[a-z]\{2,4}\%(_[A-Z0-9]\{2,3}\)\?\)\%(\.[A-Za-z0-9_-]\+\)\?\%(@[A-Za-z]\+\)\?\]\ze\s*=/
|
||||
\ contained
|
||||
|
||||
" Exec
|
||||
syn match dtExec /^\s*\<\(Exec\|TryExec\|SwallowExec\)\>.*/ contains=dtExecKey,dtDelim,dtExecParam transparent
|
||||
syn keyword dtExecKey Exec TryExec SwallowExec nextgroup=dtDelim containedin=dtExec contained
|
||||
syn match dtExecParam /%[fFuUnNdDickv]/ containedin=dtExec contained
|
||||
" Boolean Value {{{2
|
||||
syn match dtBoolean
|
||||
\ /^\%(DBusActivatable\|Hidden\|NoDisplay\|PrefersNonDefaultGPU\|StartupNotify\|Terminal\)\s*=\s*\%(true\|false\)/
|
||||
\ contains=dtBooleanKey,dtDelim,dtBooleanValue transparent
|
||||
syn keyword dtBooleanKey
|
||||
\ DBusActivatable Hidden NoDisplay PrefersNonDefaultGPU StartupNotify Terminal
|
||||
\ contained nextgroup=dtDelim
|
||||
|
||||
" Type
|
||||
syn match dtType /^\s*\<Type\>.*/ contains=dtTypeKey,dtDelim,dtTypeValue transparent
|
||||
syn keyword dtTypeKey Type nextgroup=dtDelim containedin=dtType contained
|
||||
syn keyword dtTypeValue Application Link FSDevice Directory containedin=dtType contained
|
||||
if s:desktop_enable_kde
|
||||
syn match dtBoolean
|
||||
\ /^ReadOnly\s*=\s*\%(true\|false\)/
|
||||
\ contains=dtBooleanKey,dtDelim,dtBooleanValue transparent
|
||||
syn keyword dtBooleanKey
|
||||
\ ReadOnly
|
||||
\ contained nextgroup=dtDelim
|
||||
endif
|
||||
syn keyword dtBooleanValue true false contained
|
||||
|
||||
" X-Addition
|
||||
syn match dtXAdd /^\s*X-.*/ contains=dtXAddKey,dtDelim transparent
|
||||
syn match dtXAddKey /^\s*X-.\{-}\s*=\@=/ nextgroup=dtDelim containedin=dtXAdd contains=dtXLocale contained
|
||||
" Numeric Value {{{2
|
||||
" icon theme
|
||||
syn match dtNumeric /^\%(MaxSize\|MinSize\|Size\|Threshold\)\s*=\s*\d\+/ contains=dtNumericKey,dtDelim,dtNumericDecimal
|
||||
syn keyword dtNumericKey
|
||||
\ MaxSize MinSize Size Threshold
|
||||
\ contained nextgroup=dtDelim
|
||||
|
||||
" Locale for X-Addition
|
||||
syn match dtXLocale /\[.\{-}\]\s*=\@=/ containedin=dtXAddKey contained
|
||||
if s:desktop_enable_kde
|
||||
syn match dtNumeric /^InitialPreference\s*=\s*\d\+/ contains=dtNumericKey,dtDelim,dtNumericDecimal
|
||||
syn keyword dtNumericKey
|
||||
\ InitialPreference
|
||||
\ contained nextgroup=dtDelim
|
||||
endif
|
||||
|
||||
" Locale for all
|
||||
syn match dtALocale /\[.\{-}\]\s*=\@=/ containedin=ALL
|
||||
syn match dtNumericDecimal /\<\d\+$/ contained
|
||||
|
||||
" String Value {{{2
|
||||
syn match dtString
|
||||
\ /^\%(Actions\|Implements\|MimeType\|NotShowIn\|OnlyShowIn\|Path\|StartupWMClass\|URL\)\s*=.*\S/
|
||||
\ contains=dtStringKey,dtDelim transparent
|
||||
syn keyword dtStringKey
|
||||
\ Actions Implements MimeType NotShowIn OnlyShowIn Path StartupWMClass URL Version
|
||||
\ contained nextgroup=dtDelim
|
||||
|
||||
" icon theme
|
||||
syn match dtString
|
||||
\ /^\%(Context\|Directories\|Example\|Inherits\)\s*=.*\S/
|
||||
\ contains=dtStringKey,dtDelim transparent
|
||||
syn keyword dtStringKey
|
||||
\ Context Directories Example Inherits
|
||||
\ contained nextgroup=dtDelim
|
||||
|
||||
if s:desktop_enable_kde
|
||||
syn match dtString
|
||||
\ /^\%(Dev\|DocPath\|FSType\|MountPoint\|ServiceTypes\)\s*=.*\S/
|
||||
\ contains=dtStringKey,dtDelim transparent
|
||||
syn keyword dtStringKey
|
||||
\ Dev DocPath FSType MountPoint ServiceTypes
|
||||
\ contained nextgroup=dtDelim
|
||||
endif
|
||||
|
||||
" Categories {{{3
|
||||
" https://specifications.freedesktop.org/menu-spec/menu-spec-1.0.html#category-registry
|
||||
syn match dtCategories /^Categories\s*=.\+\S/ contains=dtCategoriesKey,dtDelim,dtCategoriesValue transparent
|
||||
syn keyword dtCategoriesKey
|
||||
\ Categories
|
||||
\ contained nextgroup=dtDelim
|
||||
|
||||
" Main Categories
|
||||
syn keyword dtCategoriesValue
|
||||
\ Audio AudioVideo Development Education Game Graphics Network Office
|
||||
\ Settings System Utility Video
|
||||
\ contained
|
||||
|
||||
" Additional Categories
|
||||
syn keyword dtCategoriesValue
|
||||
\ BoardGame Chat Clock Geoscience Presentation 2DGraphics 3DGraphics
|
||||
\ Accessibility ActionGame AdventureGame Amusement ArcadeGame Archiving
|
||||
\ Art ArtificialIntelligence Astronomy AudioVideoEditing Biology
|
||||
\ BlocksGame BoardGame Building Calculator Calendar CardGame Chart Chat
|
||||
\ Chemistry Clock Compression ComputerScience ConsoleOnly Construction
|
||||
\ ContactManagement Core DataVisualization Database Debugger
|
||||
\ DesktopSettings Dialup Dictionary DiscBurning Documentation Economy
|
||||
\ Electricity Electronics Email Emulator Engineering FileManager
|
||||
\ FileTools FileTransfer Filesystem Finance FlowChart GNOME GTK
|
||||
\ GUIDesigner Geography Geology Geoscience HamRadio HardwareSettings
|
||||
\ History IDE IRCClient ImageProcessing InstantMessaging Java KDE
|
||||
\ KidsGame Languages Literature LogicGame Math MedicalSoftware Midi
|
||||
\ Mixer Monitor Motif Music News NumericalAnalysis OCR P2P PDA
|
||||
\ PackageManager ParallelComputing Photography Physics Player
|
||||
\ Presentation Printing Profiling ProjectManagement Publishing Qt
|
||||
\ RasterGraphics Recorder RemoteAccess RevisionControl Robotics
|
||||
\ RolePlaying Scanning Science Security Sequencer Simulation Sports
|
||||
\ SportsGame Spreadsheet StrategyGame TV Telephony TelephonyTools
|
||||
\ TerminalEmulator TextEditor TextTools Translation Tuner VectorGraphics
|
||||
\ VideoConference Viewer WebBrowser WebDevelopment WordProcessor
|
||||
\ contained
|
||||
|
||||
" Reserved Category
|
||||
syn keyword dtCategoriesValue
|
||||
\ Applet Screensaver Shell TrayIcon
|
||||
\ contained
|
||||
|
||||
" Exec/TryExec {{{3
|
||||
syn match dtExec /^\%(Exec\|TryExec\)\s*=.\+\S/ contains=dtExecKey,dtDelim,dtExecParam transparent
|
||||
syn keyword dtExecKey
|
||||
\ Exec TryExec
|
||||
\ contained nextgroup=dtDelim
|
||||
" code for file(s), URL(s), etc
|
||||
syn match dtExecParam /\s\zs%[fFuUick]\ze\%(\W\|$\)/ contained
|
||||
|
||||
" Type {{{3
|
||||
syn match dtType /^Type\s*=\s*\S\+/ contains=dtTypeKey,dtDelim,dtTypeValue transparent
|
||||
syn keyword dtTypeKey
|
||||
\ Type
|
||||
\ contained nextgroup=dtDelim
|
||||
syn keyword dtTypeValue
|
||||
\ Application Directory Link
|
||||
\ contained
|
||||
|
||||
if s:desktop_enable_kde
|
||||
syn keyword dtTypeValue
|
||||
\ FSDevice Service ServiceType
|
||||
\ contained
|
||||
endif
|
||||
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
" Version {{{3
|
||||
syn match dtVersion /^Version\s*=\s*\S\+/ contains=dtVersionKey,dtDelim,dtVersionValue transparent
|
||||
syn keyword dtVersionKey
|
||||
\ Version
|
||||
\ contained nextgroup=dtDelim
|
||||
syn match dtVersionValue /[0-9]\+\%(\.[0-9]\+\)\{1,2}$/ contained
|
||||
|
||||
hi def link dtGroup Special
|
||||
hi def link dtComment Comment
|
||||
hi def link dtDelim String
|
||||
" Localestring Value {{{2
|
||||
syn match dtLocalestring
|
||||
\ /^\%(Comment\|GenericName\|Keywords\|Name\)\%(\[.\{-}\]\)\?\s*=.*\S/
|
||||
\ contains=dtLocalestringKey,dtLocaleSuffix,dtDelim transparent
|
||||
syn keyword dtLocalestringKey
|
||||
\ Comment GenericName Keywords Name
|
||||
\ contained nextgroup=dtLocaleSuffix,dtDelim skipwhite
|
||||
|
||||
hi def link dtLocaleKey Type
|
||||
hi def link dtLocaleName Identifier
|
||||
hi def link dtXLocale Identifier
|
||||
hi def link dtALocale Identifier
|
||||
" Iconstring Value {{{2
|
||||
syn match dtIconstring
|
||||
\ /^Icon\s*=.*\S/
|
||||
\ contains=dtIconstringKey,dtDelim transparent
|
||||
syn keyword dtIconstringKey
|
||||
\ Icon
|
||||
\ contained nextgroup=dtDelim skipwhite
|
||||
|
||||
hi def link dtNumericKey Type
|
||||
if s:desktop_enable_kde
|
||||
syn match dtIconstring
|
||||
\ /^UnmountIcon\>\%(\[.\{-}\]\)\?\s*=.*\S/
|
||||
\ contains=dtIconstringKey,dtLocaleSuffix,dtDelim transparent
|
||||
syn keyword dtIconstringKey
|
||||
\ UnmountIcon
|
||||
\ contained nextgroup=dtLocaleSuffix,dtDelim skipwhite
|
||||
endif
|
||||
|
||||
hi def link dtBooleanKey Type
|
||||
hi def link dtBooleanValue Constant
|
||||
" X-Extension {{{2
|
||||
syn match dtXExtension /^X-[0-9A-Za-z-]*\%(\[.\{-}\]\)\?\s*=.*\S/
|
||||
\ contains=dtXExtensionKey,dtLocaleSuffix,dtDelim transparent
|
||||
syn match dtXExtensionKey /^X-[0-9A-Za-z-]*/ contained nextgroup=dtLocaleSuffix,dtDelim
|
||||
|
||||
hi def link dtStringKey Type
|
||||
" non standard {{{2
|
||||
if s:desktop_enable_nonstd
|
||||
syn match dtNonStdLabel /^[0-9A-Za-z-]\+\%(\[.\{-}\]\)\?\s*=.*\S/
|
||||
\ contains=dtNonStdLabelKey,dtLocaleSuffix,dtDelim transparent
|
||||
syn match dtNonStdLabelKey /^[0-9A-Za-z-]\+/ contained nextgroup=dtLocaleSuffix,dtDelim
|
||||
endif
|
||||
|
||||
hi def link dtExecKey Type
|
||||
hi def link dtExecParam Special
|
||||
hi def link dtTypeKey Type
|
||||
hi def link dtTypeValue Constant
|
||||
hi def link dtNotStLabel Type
|
||||
hi def link dtXAddKey Type
|
||||
" Highlight {{{1
|
||||
hi def link dtComment Comment
|
||||
hi def link dtError Error
|
||||
|
||||
hi def link dtGroup Special
|
||||
|
||||
hi def link dtDelim Delimiter
|
||||
hi def link dtLocaleSuffix Identifier
|
||||
|
||||
hi def link dtBooleanKey Type
|
||||
hi def link dtBooleanValue Boolean
|
||||
|
||||
hi def link dtNumericKey Type
|
||||
hi def link dtNumericDecimal Number
|
||||
|
||||
hi def link dtStringKey Type
|
||||
hi def link dtCategoriesKey Type
|
||||
hi def link dtCategoriesValue Constant
|
||||
hi def link dtExecKey Type
|
||||
hi def link dtExecParam Special
|
||||
hi def link dtTypeKey Type
|
||||
hi def link dtTypeValue Constant
|
||||
hi def link dtVersionKey Type
|
||||
hi def link dtVersionValue Constant
|
||||
|
||||
hi def link dtLocalestringKey Type
|
||||
|
||||
hi def link dtIconStringKey Type
|
||||
|
||||
hi def link dtXExtensionKey Type
|
||||
|
||||
hi def link dtNonStdLabelKey Type
|
||||
|
||||
" Clean Up {{{1
|
||||
let b:current_syntax = "desktop"
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
" vim:ts=8
|
||||
" vim:ts=8:sw=2:fdm=marker
|
||||
|
||||
105
runtime/syntax/elm.vim
Normal file
105
runtime/syntax/elm.vim
Normal file
@@ -0,0 +1,105 @@
|
||||
" Vim syntax file
|
||||
" Language: Elm
|
||||
" Maintainer: Andreas Scharf <as@99n.de>
|
||||
" Original Author: Joseph Hager <ajhager@gmail.com>
|
||||
" Copyright: Joseph Hager <ajhager@gmail.com>
|
||||
" License: BSD3
|
||||
" Latest Revision: 2020-05-29
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Keywords
|
||||
syn keyword elmConditional else if of then case
|
||||
syn keyword elmAlias alias
|
||||
syn keyword elmTypedef contained type port
|
||||
syn keyword elmImport exposing as import module where
|
||||
|
||||
" Operators
|
||||
" elm/core
|
||||
syn match elmOperator contained "\(<|\||>\|||\|&&\|==\|/=\|<=\|>=\|++\|::\|+\|-\|*\|/\|//\|^\|<>\|>>\|<<\|<\|>\|%\)"
|
||||
" elm/parser
|
||||
syn match elmOperator contained "\(|.\||=\)"
|
||||
" elm/url
|
||||
syn match elmOperator contained "\(</>\|<?>\)"
|
||||
|
||||
" Types
|
||||
syn match elmType "\<[A-Z][0-9A-Za-z_-]*"
|
||||
syn keyword elmNumberType number
|
||||
|
||||
" Modules
|
||||
syn match elmModule "\<\([A-Z][0-9A-Za-z_'-\.]*\)\+\.[A-Za-z]"me=e-2
|
||||
syn match elmModule "^\(module\|import\)\s\+[A-Z][0-9A-Za-z_'-\.]*\(\s\+as\s\+[A-Z][0-9A-Za-z_'-\.]*\)\?\(\s\+exposing\)\?" contains=elmImport
|
||||
|
||||
" Delimiters
|
||||
syn match elmDelimiter "[,;]"
|
||||
syn match elmBraces "[()[\]{}]"
|
||||
|
||||
" Functions
|
||||
syn match elmTupleFunction "\((,\+)\)"
|
||||
|
||||
" Comments
|
||||
syn keyword elmTodo TODO FIXME XXX contained
|
||||
syn match elmLineComment "--.*" contains=elmTodo,@spell
|
||||
syn region elmComment matchgroup=elmComment start="{-|\=" end="-}" contains=elmTodo,elmComment,@spell fold
|
||||
|
||||
" Strings
|
||||
syn match elmStringEscape "\\u[0-9a-fA-F]\{4}" contained
|
||||
syn match elmStringEscape "\\[nrfvbt\\\"]" contained
|
||||
syn region elmString start="\"" skip="\\\"" end="\"" contains=elmStringEscape,@spell
|
||||
syn region elmTripleString start="\"\"\"" skip="\\\"" end="\"\"\"" contains=elmStringEscape,@spell
|
||||
syn match elmChar "'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'"
|
||||
|
||||
" Lambda
|
||||
syn region elmLambdaFunc start="\\"hs=s+1 end="->"he=e-2
|
||||
|
||||
" Debug
|
||||
syn match elmDebug "Debug.\(log\|todo\|toString\)"
|
||||
|
||||
" Numbers
|
||||
syn match elmInt "-\?\<\d\+\>"
|
||||
syn match elmFloat "-\?\(\<\d\+\.\d\+\>\)"
|
||||
|
||||
" Identifiers
|
||||
syn match elmTopLevelDecl "^\s*[a-zA-Z][a-zA-z0-9_]*\('\)*\s\+:\(\r\n\|\r\|\n\|\s\)\+" contains=elmOperator
|
||||
syn match elmFuncName /^\l\w*/
|
||||
|
||||
" Folding
|
||||
syn region elmTopLevelTypedef start="type" end="\n\(\n\n\)\@=" contains=ALL fold
|
||||
syn region elmTopLevelFunction start="^[a-zA-Z].\+\n[a-zA-Z].\+=" end="^\(\n\+\)\@=" contains=ALL fold
|
||||
syn region elmCaseBlock matchgroup=elmCaseBlockDefinition start="^\z\(\s\+\)\<case\>" end="^\z1\@!\W\@=" end="\(\n\n\z1\@!\)\@=" end="\n\z1\@!\(\n\n\)\@=" contains=ALL fold
|
||||
syn region elmCaseItemBlock start="^\z\(\s\+\).\+->$" end="^\z1\@!\W\@=" end="\(\n\n\z1\@!\)\@=" end="\(\n\z1\S\)\@=" contains=ALL fold
|
||||
syn region elmLetBlock matchgroup=elmLetBlockDefinition start="\<let\>" end="\<in\>" contains=ALL fold
|
||||
|
||||
hi def link elmFuncName Function
|
||||
hi def link elmCaseBlockDefinition Conditional
|
||||
hi def link elmCaseBlockItemDefinition Conditional
|
||||
hi def link elmLetBlockDefinition TypeDef
|
||||
hi def link elmTopLevelDecl Function
|
||||
hi def link elmTupleFunction Normal
|
||||
hi def link elmTodo Todo
|
||||
hi def link elmComment Comment
|
||||
hi def link elmLineComment Comment
|
||||
hi def link elmString String
|
||||
hi def link elmTripleString String
|
||||
hi def link elmChar String
|
||||
hi def link elmStringEscape Special
|
||||
hi def link elmInt Number
|
||||
hi def link elmFloat Float
|
||||
hi def link elmDelimiter Delimiter
|
||||
hi def link elmBraces Delimiter
|
||||
hi def link elmTypedef TypeDef
|
||||
hi def link elmImport Include
|
||||
hi def link elmConditional Conditional
|
||||
hi def link elmAlias Delimiter
|
||||
hi def link elmOperator Operator
|
||||
hi def link elmType Type
|
||||
hi def link elmNumberType Identifier
|
||||
hi def link elmLambdaFunc Function
|
||||
hi def link elmDebug Debug
|
||||
hi def link elmModule Type
|
||||
|
||||
syn sync minlines=500
|
||||
|
||||
let b:current_syntax = 'elm'
|
||||
@@ -1,7 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Objective-C
|
||||
" Maintainer: Kazunobu Kuriyama <kazunobu.kuriyama@gmail.com>
|
||||
" Last Change: 2015 Dec 14
|
||||
" Last Change: 2020 Jun 07
|
||||
" Last Change By Maintainer: 2015 Dec 14
|
||||
|
||||
""" Preparation for loading ObjC stuff
|
||||
if exists("b:current_syntax")
|
||||
@@ -24,7 +25,7 @@ syn keyword objcUsefulTerm nil Nil NO YES
|
||||
|
||||
" Preprocessor Directives
|
||||
syn region objcImported display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
syn match objcImported display contained "\(<\h[-a-zA-Z0-9_/]*\.h>\|<[a-z0-9]\+>\)"
|
||||
syn match objcImported display contained "\(<\h[-+a-zA-Z0-9_/]*\.h>\|<[a-z0-9]\+>\)"
|
||||
syn match objcImport display "^\s*\(%:\|#\)\s*import\>\s*["<]" contains=objcImported
|
||||
|
||||
" ObjC Compiler Directives
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: TeX
|
||||
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" Last Change: May 19, 2020
|
||||
" Version: 117
|
||||
" Last Change: Jun 07, 2020
|
||||
" Version: 118
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
|
||||
"
|
||||
" Notes: {{{1
|
||||
@@ -755,6 +755,8 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['lceil' , '⌈'],
|
||||
\ ['ldots' , '…'],
|
||||
\ ['le' , '≤'],
|
||||
\ ['left|' , '|'],
|
||||
\ ['left\|' , '‖'],
|
||||
\ ['left(' , '('],
|
||||
\ ['left\[' , '['],
|
||||
\ ['left\\{' , '{'],
|
||||
@@ -805,6 +807,8 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['quad' , ' '],
|
||||
\ ['qquad' , ' '],
|
||||
\ ['rfloor' , '⌋'],
|
||||
\ ['right|' , '|'],
|
||||
\ ['right\\|' , '‖'],
|
||||
\ ['right)' , ')'],
|
||||
\ ['right]' , ']'],
|
||||
\ ['right\\}' , '}'],
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim 8.0 script
|
||||
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" Last Change: May 26, 2020
|
||||
" Version: 8.0-35
|
||||
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Last Change: Jun 01, 20200
|
||||
" Version: 8.0-37
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
|
||||
" Automatically generated keyword lists: {{{1
|
||||
|
||||
@@ -19,25 +19,24 @@ 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] bm[odified] breaka[dd] bun[load] cabc[lear] cal[l] cc cf[ile] changes cla[st] cnf[ile] comc[lear] cp[revious] cstag debugg[reedy] deletl dep diffpu[t] dl dr[op] ec em[enu] ene[w] files fini[sh] folddoc[losed] gr[ep] helpc[lose] his[tory] il[ist] isp[lit] keepa l[ist] laf[ter] lbel[ow] lcscope lfdo lgrepa[dd] lma lo[adview] lop[en] lua m[ove] mes 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 st[op] stj[ump] sunmenu syn tN[ext] tabd[o] tabm[ove] tabr[ewind] tch[dir] tf[irst] tlmenu tm[enu] to[pleft] tu[nmenu] undol[ist] up[date] vi[sual] vmapc[lear] wa[ll] winp[os] wundo xme xr[estore]
|
||||
syn keyword vimCommand contained ab arga[dd] argu[ment] bad[d] bn[ext] breakd[el] bw[ipeout] cabo[ve] cat[ch] ccl[ose] cfdo chd[ir] cle[arjumps] cnor comp[iler] cpf[ile] cun delc[ommand] deletp di[splay] diffs[plit] dli[st] ds[earch] echoe[rr] en[dif] eval filet fir[st] foldo[pen] grepa[dd] helpf[ind] i imapc[lear] iuna[bbrev] keepalt la[st] lan[guage] lbo[ttom] ld[o] lfir[st] lh[elpgrep] lmak[e] loadk lp[revious] luado ma[rk] messages 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 sta[g] stopi[nsert] sus[pend] sync ta[g] tabe[dit] tabn[ext] tabs tcld[o] th[row] tln tma[p] tp[revious] tunma[p] unh[ide] v vie[w] vne[w] wh[ile] wn[ext] wv[iminfo] xmenu xunme
|
||||
syn keyword vimCommand contained abc[lear] argd[elete] as[cii] bd[elete] bo[tright] breakl[ist] cN[ext] cad[dbuffer] cb[uffer] cd cfir[st] che[ckpath] clo[se] co[py] con[tinue] cq[uit] cuna[bbrev] delel delf[unction] dif[fupdate] difft[his] do dsp[lit] echom[sg] endf[unction] ex filetype fix[del] for gui helpg[rep] ia in j[oin] keepj[umps] lab[ove] lat lc[d] le[ft] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] 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 star[tinsert] sts[elect] sv[iew] syncbind tab tabf[ind] tabnew tags tclf[ile] tj[ump] tlnoremenu tmapc[lear] tr[ewind] u[ndo] unl ve[rsion] vim[grep] vs[plit] win[size] wp[revious] x[it] xnoreme xunmenu
|
||||
syn keyword vimCommand contained abo[veleft] argdo au bel[owright] bp[revious] bro[wse] cNf[ile] cadde[xpr] cbe[fore] cdo cg[etfile] checkt[ime] cmapc[lear] col[der] conf[irm] cr[ewind] cw[indow] delep dell diffg[et] dig[raphs] doau e[dit] echon endfo[r] exi[t] filt[er] fo[ld] fu[nction] gvim helpt[ags] iabc[lear] inor ju[mps] keepp[atterns] lad[dexpr] later lch[dir] lefta[bove] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks 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 startg[replace] sun[hide] sw[apname] syntime tabN[ext] tabfir[st] tabo[nly] tc[l] te[aroff] tl[ast] tlu tn[ext] try una[bbreviate] unlo[ckvar] verb[ose] vimgrepa[dd] wN[ext] winc[md] wq xa[ll] xnoremenu xwininfo
|
||||
syn keyword vimCommand contained addd arge[dit] bN[ext] bf[irst] br[ewind] bufdo c[hange] caddf[ile] cbel[ow] ce[nter] cgetb[uffer] chi[story] cn[ext] colo[rscheme] cons[t] cs d[elete] deletel delm[arks] diffo[ff] dir doaut ea el[se] endt[ry] exu[sage] fin[d] foldc[lose] g h[elp] hi if intro k lN[ext] laddb[uffer] lb[uffer] lcl[ose] lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] 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 startr[eplace] sunme sy t tabc[lose] tabl[ast] tabp[revious] tcd ter[minal] tlm tlunmenu tno[remap] ts[elect] undoj[oin] uns[ilent] vert[ical] viu[sage] w[rite] windo wqa[ll] xmapc[lear] xprop y[ank]
|
||||
syn keyword vimCommand contained al[l] argg[lobal] b[uffer] bl[ast] brea[k] buffers ca caf[ter] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cnew[er] com cope[n] cscope debug deletep delp diffp[atch] dj[ump] dp earlier elsei[f] endw[hile] f[ile] fina[lly] foldd[oopen] go[to] ha[rdcopy] hid[e] ij[ump] is[earch] kee[pmarks] lNf[ile] laddf[ile] lbe[fore] lcs lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] 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]
|
||||
syn keyword vimCommand contained a ar[gs] argl[ocal] ba[ll] 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] 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] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] 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] sun[hide] sy tN[ext] tabe[dit] tabnew tc[l] ter[minal] tlmenu tma[p] tr[ewind] u[ndo] unl ve[rsion] vim9 vmapc[lear] wa[ll] winp[os] wundo xme xr[estore]
|
||||
syn keyword vimCommand contained ab arga[dd] argu[ment] bad[d] 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] 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] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks 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] sunme syn ta[g] tabf[ind] tabo[nly] tcd tf[irst] tln tmapc[lear] try una[bbreviate] unlo[ckvar] verb[ose] vim9script vne[w] wh[ile] wn[ext] wv[iminfo] xmenu xunme
|
||||
syn keyword vimCommand contained abc[lear] argd[elete] as[cii] 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 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] lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] 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] sunmenu sync tab tabfir[st] tabp[revious] tch[dir] th[row] tlnoremenu tn[ext] ts[elect] undoj[oin] uns[ilent] vert[ical] vim[grep] vs[plit] win[size] wp[revious] x[it] xnoreme xunmenu
|
||||
syn keyword vimCommand contained abo[veleft] argdo au 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 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 lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] 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] sus[pend] syncbind tabN[ext] tabl[ast] tabr[ewind] tcld[o] tj[ump] tlu tno[remap] tu[nmenu] undol[ist] up[date] vi[sual] vimgrepa[dd] wN[ext] winc[md] wq xa[ll] xnoremenu xwininfo
|
||||
syn keyword vimCommand contained addd arge[dit] bN[ext] 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 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 lfdo lgrepa[dd] lma lo[adview] lop[en] lua m[ove] mes 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] sv[iew] syntime tabc[lose] tabm[ove] tabs tclf[ile] tl[ast] tlunmenu to[pleft] tunma[p] unh[ide] v vie[w] viu[sage] w[rite] windo wqa[ll] xmapc[lear] xprop y[ank]
|
||||
syn keyword vimCommand contained al[l] argg[lobal] b[uffer] 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] 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] lfir[st] lh[elpgrep] lmak[e] loadk lp[revious] luado ma[rk] messages 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 sw[apname] t tabd[o] tabn[ext] tags te[aroff] tlm tm[enu] tp[revious] type
|
||||
syn match vimCommand contained "\<z[-+^.=]\=\>"
|
||||
syn keyword vimCommand contained def endd[ef] disa[ssemble] vim9[script] imp[ort] exp[ort]
|
||||
syn keyword vimStdPlugin contained Arguments 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
|
||||
|
||||
" vimOptions are caught only when contained in a vimSet {{{2
|
||||
syn keyword vimOption contained acd ambw arshape background ballooneval bex bl brk buftype cf cinkeys cmdwinheight com completeslash cpoptions cscoperelative csre cursorcolumn delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr go guifontset helpheight history hlsearch imaf ims includeexpr infercase iskeyword keywordprg laststatus lispwords lrm magic maxfuncdepth menuitems mm modifiable mousemodel mzq numberwidth opfunc patchexpr pfn pp printfont pumwidth pythonthreehome redrawtime ri rs sb scroll sect sft shellredir shiftwidth showmatch signcolumn smarttab sp spf srr startofline suffixes switchbuf ta tagfunc tbi term termwintype tgc titlelen toolbariconsize ttimeout ttymouse twt undofile varsofttabstop verbosefile viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan
|
||||
syn keyword vimOption contained ai anti autochdir backspace balloonevalterm bexpr bo browsedir casemap cfu cino cmp comments concealcursor cpp cscopetag cst cursorline dex dip eb emoji errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd gp guifontwide helplang hk ic imak imsearch incsearch insertmode isp km lazyredraw list ls makeef maxmapdepth mfd mmd modified mouses mzquantum nuw osfiletype patchmode ph preserveindent printheader pvh pyx regexpengine rightleft rtp sbo scrollbind sections sh shellslash shm showmode siso smc spc spl ss statusline suffixesadd sws tabline taglength tbidi termbidi terse tgst titleold top ttimeoutlen ttyscroll tx undolevels vartabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write
|
||||
syn keyword vimOption contained akm antialias autoindent backup balloonexpr bg bomb bs cb ch cinoptions cms commentstring conceallevel cpt cscopetagorder csto cursorlineopt dg dir ed enc errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault grepformat guiheadroom hf hkmap icon imc imsf inde is isprint kmp lbr listchars lsp makeencoding maxmem mh mmp more mouseshape mzschemedll odev pa path pheader previewheight printmbcharset pvp pyxversion relativenumber rightleftcmd ru sbr scrollfocus secure shcf shelltemp shortmess showtabline sj smd spell splitbelow ssl stl sw sxe tabpagemax tagrelative tbis termencoding textauto thesaurus titlestring tpm ttm ttytype uc undoreload vb vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany
|
||||
syn keyword vimOption contained al ar autoread backupcopy bdir bh breakat bsdir cc charconvert cinw co compatible confirm crb cscopeverbose csverb cwh dict directory edcompatible encoding errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepprg guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kp lcs lm luadll makeprg maxmempattern mis mmt mouse mouset mzschemegcdll oft packpath pdev pi previewpopup printmbfont pvw qe remap rl rubydll sc scrolljump sel shell shelltype shortname shq slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tags tbs termguicolors textmode tildeop tl tr tty tw udf updatecount vbs viewdir vop wc wh wildignore wincolor winptydll wmw writebackup
|
||||
syn keyword vimOption contained aleph arab autowrite backupdir bdlay bin breakindent bsk ccv ci cinwords cocu complete copyindent cryptmethod csl cuc debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn gtl guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js langmap linebreak lmap lw mat maxmemtot mkspellmem mod mousef mousetime nf ofu para penc pm previewwindow printoptions pw quoteescape renderoptions rlc ruf scb scrolloff selection shellcmdflag shellxescape showbreak si sm so spellfile spr st sts swapsync syn tag tagstack tc termwinkey textwidth timeout tm ts ttybuiltin twk udir updatetime vdir viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay
|
||||
syn keyword vimOption contained allowrevins arabic autowriteall backupext belloff binary breakindentopt bt cd cin clipboard cole completefunc cot cscopepathcomp cspc cul deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtt guitablabel hid hl im imdisable imstyle indk isi key langmenu lines lnr lz matchpairs mco ml modeline mousefocus mp nrformats omnifunc paragraphs perldll pmbcs printdevice prompt pythondll rdt report rnu ruler scf scrollopt selectmode shellpipe shellxquote showcmd sidescroll smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tal tcldll termwinscroll tf timeoutlen to tsl ttyfast tws ul ur ve vif vts wcr wi wildmenu winfixheight wiv wrap ws
|
||||
syn keyword vimOption contained altkeymap arabicshape aw backupskip beval bk bri bufhidden cdpath cindent cm colorcolumn completeopt cp cscopeprg csprg culopt def diffexpr ea ei ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw guicursor guitabtooltip hidden hlg imactivatefunc imi inc inex isident keymap langnoremap linespace loadplugins ma matchtime mef mle modelineexpr mousehide mps nu opendevice paste pex pmbfn printencoding pt pythonhome re restorescreen ro rulerformat scl scs sessionoptions shellquote shiftround showfulltag sidescrolloff smartindent sol spellsuggest sr stal sua swf syntax tagcase tb tenc termwinsize tfu title toolbar tsr ttym twsl undodir ut verbose viminfo wa wd wic wildmode winfixwidth wiw wrapmargin ww
|
||||
syn keyword vimOption contained ambiwidth ari awa balloondelay bevalterm bkc briopt buflisted cedit cink cmdheight columns completepopup cpo cscopequickfix csqf cursorbind define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guifont helpfile highlight hls imactivatekey iminsert include inf isk keymodel langremap lisp lpl macatsui maxcombine menc mls modelines mousem msm number operatorfunc pastetoggle pexpr popt printexpr pumheight pythonthreedll readonly revins rop runtimepath scr
|
||||
syn keyword vimOption contained acd ambw arshape background ballooneval bex bl brk buftype cf cinkeys cmdwinheight com completeslash cpoptions cscoperelative csre cursorcolumn delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr go guifontset helpheight history hlsearch imaf ims includeexpr infercase iskeyword keywordprg laststatus lispwords lrm magic maxfuncdepth menuitems mm modifiable mousemodel mzq numberwidth opfunc patchexpr pfn pp printfont pumwidth pythonthreehome re restorescreen ro rulerformat scl scs sft shellredir shiftwidth showmatch signcolumn smarttab sp spf srr startofline suffixes switchbuf ta tagfunc tbi term termwintype tgc titlelen toolbariconsize ttimeout ttymouse twt undofile varsofttabstop verbosefile viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan
|
||||
syn keyword vimOption contained ai anti autochdir backspace balloonevalterm bexpr bo browsedir casemap cfu cino cmp comments concealcursor cpp cscopetag cst cursorline dex dip eb emoji errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd gp guifontwide helplang hk ic imak imsearch incsearch insertmode isp km lazyredraw list ls makeef maxmapdepth mfd mmd modified mouses mzquantum nuw osfiletype patchmode ph preserveindent printheader pvh pyx readonly revins rop runtimepath scr sect sh shellslash shm showmode siso smc spc spl ss statusline suffixesadd sws tabline taglength tbidi termbidi terse tgst titleold top ttimeoutlen ttyscroll tx undolevels vartabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write
|
||||
syn keyword vimOption contained akm antialias autoindent backup balloonexpr bg bomb bs cb ch cinoptions cms commentstring conceallevel cpt cscopetagorder csto cursorlineopt dg dir ed enc errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault grepformat guiheadroom hf hkmap icon imc imsf inde is isprint kmp lbr listchars lsp makeencoding maxmem mh mmp more mouseshape mzschemedll odev pa path pheader previewheight printmbcharset pvp pyxversion redrawtime ri rs sb scroll sections shcf shelltemp shortmess showtabline sj smd spell splitbelow ssl stl sw sxe tabpagemax tagrelative tbis termencoding textauto thesaurus titlestring tpm ttm ttytype uc undoreload vb vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany
|
||||
syn keyword vimOption contained al ar autoread backupcopy bdir bh breakat bsdir cc charconvert cinw co compatible confirm crb cscopeverbose csverb cwh dict directory edcompatible encoding errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepprg guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kp lcs lm luadll makeprg maxmempattern mis mmt mouse mouset mzschemegcdll oft packpath pdev pi previewpopup printmbfont pvw qe regexpengine rightleft rtp sbo scrollbind secure shell shelltype shortname shq slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tags tbs termguicolors textmode tildeop tl tr tty tw udf updatecount vbs viewdir vop wc wh wildignore wincolor winptydll wmw writebackup
|
||||
syn keyword vimOption contained aleph arab autowrite backupdir bdlay bin breakindent bsk ccv ci cinwords cocu complete copyindent cryptmethod csl cuc debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn gtl guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js langmap linebreak lmap lw mat maxmemtot mkspellmem mod mousef mousetime nf ofu para penc pm previewwindow printoptions pw qftf relativenumber rightleftcmd ru sbr scrollfocus sel shellcmdflag shellxescape showbreak si sm so spellfile spr st sts swapsync syn tag tagstack tc termwinkey textwidth timeout tm ts ttybuiltin twk udir updatetime vdir viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay
|
||||
syn keyword vimOption contained allowrevins arabic autowriteall backupext belloff binary breakindentopt bt cd cin clipboard cole completefunc cot cscopepathcomp cspc cul deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtt guitablabel hid hl im imdisable imstyle indk isi key langmenu lines lnr lz matchpairs mco ml modeline mousefocus mp nrformats omnifunc paragraphs perldll pmbcs printdevice prompt pythondll quickfixtextfunc remap rl rubydll sc scrolljump selection shellpipe shellxquote showcmd sidescroll smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tal tcldll termwinscroll tf timeoutlen to tsl ttyfast tws ul ur ve vif vts wcr wi wildmenu winfixheight wiv wrap ws
|
||||
syn keyword vimOption contained altkeymap arabicshape aw backupskip beval bk bri bufhidden cdpath cindent cm colorcolumn completeopt cp cscopeprg csprg culopt def diffexpr ea ei ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw guicursor guitabtooltip hidden hlg imactivatefunc imi inc inex isident keymap langnoremap linespace loadplugins ma matchtime mef mle modelineexpr mousehide mps nu opendevice paste pex pmbfn printencoding pt pythonhome quoteescape renderoptions rlc ruf scb scrolloff selectmode shellquote shiftround showfulltag sidescrolloff smartindent sol spellsuggest sr stal sua swf syntax tagcase tb tenc termwinsize tfu title toolbar tsr ttym twsl undodir ut verbose viminfo wa wd wic wildmode winfixwidth wiw wrapmargin ww
|
||||
syn keyword vimOption contained ambiwidth ari awa balloondelay bevalterm bkc briopt buflisted cedit cink cmdheight columns completepopup cpo cscopequickfix csqf cursorbind define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guifont helpfile highlight hls imactivatekey iminsert include inf isk keymodel langremap lisp lpl macatsui maxcombine menc mls modelines mousem msm number operatorfunc pastetoggle pexpr popt printexpr pumheight pythonthreedll rdt report rnu ruler scf scrollopt sessionoptions
|
||||
|
||||
" vimOptions: These are the turn-off setting variants {{{2
|
||||
syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread noaw noballooneval nobevalterm nobk nobreakindent nocf nocindent nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noemo noeol noesckeys noexpandtab nofic nofixeol nofoldenable nogd nohid nohkmap nohls noicon noimc noimdisable noinfercase nojoinspaces nolangremap nolinebreak nolnr nolrm nomacatsui noml nomod nomodelineexpr nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscrollbind noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup
|
||||
@@ -50,8 +49,8 @@ syn keyword vimOption contained invai invaltkeymap invar invarabicshape invautoc
|
||||
syn keyword vimOption contained invakm invanti invarab invari invautoindent invautowriteall invbackup invbeval invbinary invbomb invbuflisted invcin invconfirm invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invendofline inverrorbells invex invfen invfixendofline invfkmap invfsync invguipty invhk invhkp invic invim invimd invinf invis invlangnoremap invlbr invlist invlpl invma invmh
|
||||
|
||||
" termcap codes (which can also be set) {{{2
|
||||
syn keyword vimOption contained t_8b t_AB t_al t_bc t_BE t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_EI t_F2 t_F4 t_F6 t_F8 t_fs t_IE t_k1 t_k2 t_K3 t_K4 t_K5 t_K6 t_K7 t_K8 t_K9 t_kb t_KB t_kd t_KD t_ke t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_PE t_PS t_RB t_RC t_RF t_Ri t_RI t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_Si t_SI t_so t_sr t_SR t_ST t_te t_Te t_TE t_ti t_TI t_ts t_Ts t_u7 t_ue t_us t_ut t_vb t_ve t_vi t_vs t_VS t_WP t_WS t_xn t_xs t_ZH t_ZR
|
||||
syn keyword vimOption contained t_8f t_AF t_AL t_BD t_cd t_Ce t_cm t_cs t_CS t_da t_dl t_EC t_F1 t_F3 t_F5 t_F7 t_F9 t_GP t_IS t_K1 t_k3 t_k4 t_k5 t_k6 t_k7 t_k8 t_k9 t_KA t_kB t_KC t_kD
|
||||
syn keyword vimOption contained t_8b t_8u t_AF t_AL t_bc t_BE t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_EI t_F2 t_F4 t_F6 t_F8 t_fs t_IE t_k1 t_k2 t_K3 t_K4 t_K5 t_K6 t_K7 t_K8 t_K9 t_kb t_KB t_kd t_KD t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_PE t_PS t_RB t_RC t_RF t_Ri t_RI t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_Si t_SI t_so t_sr t_SR t_ST t_te t_Te t_TE t_ti t_TI t_ts t_Ts t_u7 t_ue t_us t_ut t_vb t_ve t_vi t_vs t_VS t_WP t_WS t_xn t_xs t_ZH t_ZR
|
||||
syn keyword vimOption contained t_8f t_AB t_al t_AU t_BD t_cd t_Ce t_cm t_cs t_CS t_da t_dl t_EC t_F1 t_F3 t_F5 t_F7 t_F9 t_GP t_IS t_K1 t_k3 t_k4 t_k5 t_k6 t_k7 t_k8 t_k9 t_KA t_kB t_KC t_kD t_ke
|
||||
syn match vimOption contained "t_%1"
|
||||
syn match vimOption contained "t_#2"
|
||||
syn match vimOption contained "t_#4"
|
||||
@@ -79,11 +78,11 @@ syn match vimHLGroup contained "Conceal"
|
||||
syn case match
|
||||
|
||||
" Function Names {{{2
|
||||
syn keyword vimFuncName contained abs appendbufline asin assert_fails assert_notmatch balloon_gettext bufadd bufname byteidx char2nr ch_evalexpr ch_log ch_readraw cindent complete_check cosh deepcopy diff_hlID eval exists feedkeys findfile fnamemodify foldtextresult get getchar getcmdtype getenv getftype getmatches getreg gettagstack getwinvar has_key histget iconv inputlist interrupt isnan job_start js_encode libcall list2str log mapcheck matchdelete max nextnonblank popup_atcursor popup_dialog popup_getoptions popup_notification prevnonblank prop_add prop_type_add pum_getpos rand reg_recording remote_foreground remove round screencol searchdecl serverlist setenv setpos settagstack sign_define sign_placelist sin sound_playevent split str2list strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_sendkeys term_setsize test_autochdir test_getvalue test_null_dict test_null_string test_scrollbar test_unknown timer_start toupper type values winbufnr win_findbuf winheight winline winsaveview winwidth
|
||||
syn keyword vimFuncName contained acos argc assert_beeps assert_false assert_report balloon_show bufexists bufnr byteidxcomp ch_canread ch_evalraw ch_logfile ch_sendexpr clearmatches complete_info count delete echoraw eventhandler exp filereadable float2nr foldclosed foreground getbufinfo getcharmod getcmdwintype getfontname getimstatus getmousepos getregtype getwininfo glob haslocaldir histnr indent inputrestore invert items job_status json_decode libcallnr listener_add log10 match matchend min nr2char popup_beval popup_filter_menu popup_getpos popup_setoptions printf prop_clear prop_type_change pumvisible range reltime remote_peek rename rubyeval screenpos searchpair setbufline setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playfile sqrt str2nr strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_setansicolors term_start test_feedinput test_ignore_error test_null_job test_option_not_set test_setmouse test_void timer_stop tr undofile virtcol wincol win_getid win_id2tabwin winnr win_screenpos wordcount
|
||||
syn keyword vimFuncName contained add argidx assert_equal assert_inrange assert_true balloon_split buflisted bufwinid call ch_close ch_getbufnr ch_open ch_sendraw col confirm cscope_connection deletebufline empty executable expand filewritable floor foldclosedend funcref getbufline getcharsearch getcompletion getfperm getjumplist getpid gettabinfo getwinpos glob2regpat hasmapto hlexists index inputsave isdirectory job_getchannel job_stop json_encode line listener_flush luaeval matchadd matchlist mkdir or popup_clear popup_filter_yesno popup_hide popup_settext prompt_setcallback prop_find prop_type_delete py3eval readdir reltimefloat remote_read repeat screenattr screenrow searchpairpos setbufvar setline setreg sha256 sign_getplaced sign_unplace sort sound_stop srand strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setapi term_wait test_garbagecollect_now test_null_blob test_null_list test_override test_settime timer_info timer_stopall trim undotree visualmode windowsversion win_gettype win_id2win winrestcmd win_splitmove writefile
|
||||
syn keyword vimFuncName contained and arglistid assert_equalfile assert_match atan browse bufload bufwinnr ceil ch_close_in ch_getjob ch_read ch_setoptions complete copy cursor did_filetype environ execute expandcmd filter fmod foldlevel function getbufvar getcmdline getcurpos getfsize getline getpos gettabvar getwinposx globpath histadd hlID input inputsecret isinf job_info join keys line2byte listener_remove map matchaddpos matchstr mode pathshorten popup_close popup_findinfo popup_menu popup_show prompt_setinterrupt prop_list prop_type_get pyeval readfile reltimestr remote_send resolve screenchar screenstring searchpos setcharsearch setloclist settabvar shellescape sign_jump sign_unplacelist sound_clear spellbadword state strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled term_list term_setkill test_alloc_fail test_garbagecollect_soon test_null_channel test_null_partial test_refcount test_srand_seed timer_pause tolower trunc uniq wildmenumode win_execute win_gotoid winlayout winrestview win_type xor
|
||||
syn keyword vimFuncName contained append argv assert_exception assert_notequal atan2 browsedir bufloaded byte2line changenr chdir ch_info ch_readblob ch_status complete_add cos debugbreak diff_filler escape exepath extend finddir fnameescape foldtext garbagecollect getchangelist getcmdpos getcwd getftime getloclist getqflist gettabwinvar getwinposy has histdel hostname inputdialog insert islocked job_setoptions js_decode len lispindent localtime maparg matcharg matchstrpos mzeval perleval popup_create popup_findpreview popup_move pow prompt_setprompt prop_remove prop_type_list pyxeval reg_executing remote_expr remote_startserver reverse screenchars search server2client setcmdpos setmatches settabwinvar shiftwidth sign_place simplify soundfold spellsuggest str2float strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_scrape term_setrestore
|
||||
syn keyword vimFuncName contained abs appendbufline asin assert_fails assert_notmatch balloon_gettext bufadd bufname byteidx char2nr ch_evalexpr ch_log ch_readraw cindent complete_check cosh deepcopy diff_hlID eval exists feedkeys findfile fnamemodify foldtextresult get getchar getcmdtype getenv getftype getmarklist getqflist gettabwinvar getwinposy has histdel hostname inputdialog insert islocked job_setoptions js_decode len lispindent localtime maparg matchaddpos matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prop_add prop_type_add pum_getpos rand reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setline setreg sha256 sign_getplaced sign_unplace sort sound_stop srand strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setapi term_wait test_garbagecollect_soon test_null_dict test_null_string test_setmouse timer_info tolower trunc uniq wildmenumode win_execute win_gotoid winlayout winrestview winwidth
|
||||
syn keyword vimFuncName contained acos argc assert_beeps assert_false assert_report balloon_show bufexists bufnr byteidxcomp ch_canread ch_evalraw ch_logfile ch_sendexpr clearmatches complete_info count delete echoraw eventhandler exp filereadable float2nr foldclosed foreground getbufinfo getcharmod getcmdwintype getfontname getimstatus getmatches getreg gettagstack getwinvar has_key histget iconv inputlist interrupt isnan job_start js_encode libcall list2str log mapcheck matcharg matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_clear prop_type_change pumvisible range reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcharsearch setloclist settabvar shellescape sign_jump sign_unplacelist sound_clear spellbadword state strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled term_list term_setkill test_alloc_fail test_getvalue test_null_function test_option_not_set test_settime timer_pause toupper type values winbufnr win_findbuf winheight winline winsaveview wordcount
|
||||
syn keyword vimFuncName contained add argidx assert_equal assert_inrange assert_true balloon_split buflisted bufwinid call ch_close ch_getbufnr ch_open ch_sendraw col confirm cscope_connection deletebufline empty executable expand filewritable floor foldclosedend funcref getbufline getcharsearch getcompletion getfperm getjumplist getmousepos getregtype getwininfo glob haslocaldir histnr indent inputrestore invert items job_status json_decode libcallnr listener_add log10 mapset matchdelete max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_setcallback prop_find prop_type_delete py3eval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcmdpos setmatches settabwinvar shiftwidth sign_place simplify soundfold spellsuggest str2float strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_scrape term_setrestore test_autochdir test_ignore_error test_null_job test_override test_srand_seed timer_start tr undofile virtcol wincol win_getid win_id2tabwin winnr win_screenpos writefile
|
||||
syn keyword vimFuncName contained and arglistid assert_equalfile assert_match atan browse bufload bufwinnr ceil ch_close_in ch_getjob ch_read ch_setoptions complete copy cursor did_filetype environ execute expandcmd filter fmod foldlevel function getbufvar getcmdline getcurpos getfsize getline getpid gettabinfo getwinpos glob2regpat hasmapto hlexists index inputsave isdirectory job_getchannel job_stop json_encode line listener_flush luaeval match matchend menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setinterrupt prop_list prop_type_get pyeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setenv setpos settagstack sign_define sign_placelist sin sound_playevent split str2list strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_sendkeys term_setsize test_feedinput test_null_blob test_null_list test_refcount test_unknown timer_stop trim undotree visualmode windowsversion win_gettype win_id2win winrestcmd win_splitmove xor
|
||||
syn keyword vimFuncName contained append argv assert_exception assert_notequal atan2 browsedir bufloaded byte2line changenr chdir ch_info ch_readblob ch_status complete_add cos debugbreak diff_filler escape exepath extend finddir fnameescape foldtext garbagecollect getchangelist getcmdpos getcwd getftime getloclist getpos gettabvar getwinposx globpath histadd hlID input inputsecret isinf job_info join keys line2byte listener_remove map matchadd matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setprompt prop_remove prop_type_list pyxeval readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playfile sqrt str2nr strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_setansicolors term_start test_garbagecollect_now test_null_channel test_null_partial test_scrollbar test_void timer_stopall
|
||||
|
||||
"--- syntax here and above generated by mkvimvim ---
|
||||
" Special Vim Highlighting (not automatic) {{{1
|
||||
@@ -170,10 +169,10 @@ endif
|
||||
|
||||
" Numbers {{{2
|
||||
" =======
|
||||
syn match vimNumber "\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment
|
||||
syn match vimNumber "-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment
|
||||
syn match vimNumber "\<0[xX]\x\+" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment
|
||||
syn match vimNumber "\%(^\|\A\)\zs#\x\{6}" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment
|
||||
syn match vimNumber "\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment
|
||||
syn match vimNumber "-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment
|
||||
syn match vimNumber "\<0[xX]\x\+" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment
|
||||
syn match vimNumber "\%(^\|\A\)\zs#\x\{6}" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment
|
||||
|
||||
" All vimCommands are contained by vimIsCommand. {{{2
|
||||
syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimEcho,vimIsCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd
|
||||
@@ -210,7 +209,7 @@ syn keyword vimFTOption contained detect indent off on plugin
|
||||
|
||||
" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2
|
||||
" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
|
||||
syn cluster vimAugroupList contains=vimAugroup,vimIsCommand,vimUserCmd,vimExecute,vimNotFunc,vimFuncName,vimFunction,vimFunctionError,vimLineComment,vimNotFunc,vimMap,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue,vimSetEqual,vimOption
|
||||
syn cluster vimAugroupList contains=vimAugroup,vimIsCommand,vimUserCmd,vimExecute,vimNotFunc,vimFuncName,vimFunction,vimFunctionError,vimLineComment,vimNotFunc,vimMap,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vim9Comment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vim9Comment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue,vimSetEqual,vimOption
|
||||
if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a'
|
||||
syn region vimAugroup fold matchgroup=vimAugroupKey start="\<aug\%[roup]\>\ze\s\+\K\k*" end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList
|
||||
else
|
||||
@@ -237,7 +236,7 @@ endif
|
||||
" Functions : Tag is provided for those who wish to highlight tagged functions {{{2
|
||||
" =========
|
||||
syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID
|
||||
syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,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 cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,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
|
||||
|
||||
if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
|
||||
@@ -296,9 +295,9 @@ syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentS
|
||||
syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString
|
||||
syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"'
|
||||
" Vim9 comments - TODO: might be highlighted while they don't work
|
||||
syn match vimComment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString
|
||||
syn match vimComment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString
|
||||
syn match vimComment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString
|
||||
syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString
|
||||
syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString
|
||||
syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString
|
||||
" Vim9 comment inside expression
|
||||
syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString
|
||||
|
||||
@@ -321,7 +320,7 @@ syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"
|
||||
syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]'+lc=1 end=+'+
|
||||
syn region vimString oneline start=+=!+lc=1 skip=+\\\\\|\\!+ end=+!+ contains=@vimStringGroup
|
||||
syn region vimString oneline start="=+"lc=1 skip="\\\\\|\\+" end="+" contains=@vimStringGroup
|
||||
"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup
|
||||
"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim
|
||||
syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont
|
||||
syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+
|
||||
|
||||
@@ -345,7 +344,7 @@ syn match vimCollClass contained transparent "\%#=1\[:\(alnum\|alpha\|blank\|
|
||||
syn match vimSubstSubstr contained "\\z\=\d"
|
||||
syn match vimSubstTwoBS contained "\\\\"
|
||||
syn match vimSubstFlagErr contained "[^< \t\r|]\+" contains=vimSubstFlags
|
||||
syn match vimSubstFlags contained "[&cegiIpr]\+"
|
||||
syn match vimSubstFlags contained "[&cegiIlnpr#]\+"
|
||||
|
||||
" 'String': {{{2
|
||||
syn match vimString "[^(,]'[^']\{-}\zs'"
|
||||
|
||||
@@ -15,7 +15,6 @@ See INSTALLpc.txt for PC (Windows XP/Vista/7/8/10)
|
||||
See INSTALLvms.txt for VMS
|
||||
See INSTALLx.txt for cross-compiling on Unix
|
||||
See ../READMEdir/README_390.txt for z/OS and OS/390 Unix
|
||||
See ../runtime/doc/os_beos.txt for BeBox
|
||||
See ../runtime/doc/os_haiku.txt for Haiku
|
||||
|
||||
1. Generic
|
||||
|
||||
2
src/auto/configure
vendored
2
src/auto/configure
vendored
@@ -12618,7 +12618,7 @@ for ac_func in fchdir fchown fchmod fsync getcwd getpseudotty \
|
||||
getpwent getpwnam getpwuid getrlimit gettimeofday localtime_r lstat \
|
||||
memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
|
||||
getpgid setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
|
||||
sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
||||
sigprocmask sigvec strcasecmp strcoll strerror strftime stricmp strncasecmp \
|
||||
strnicmp strpbrk strptime strtol tgetent towlower towupper iswupper \
|
||||
tzset usleep utime utimes mblen ftruncate unsetenv posix_openpt
|
||||
do :
|
||||
|
||||
@@ -161,6 +161,7 @@ static struct event_name
|
||||
{"SessionLoadPost", EVENT_SESSIONLOADPOST},
|
||||
{"ShellCmdPost", EVENT_SHELLCMDPOST},
|
||||
{"ShellFilterPost", EVENT_SHELLFILTERPOST},
|
||||
{"SigUSR1", EVENT_SIGUSR1},
|
||||
{"SourceCmd", EVENT_SOURCECMD},
|
||||
{"SourcePre", EVENT_SOURCEPRE},
|
||||
{"SourcePost", EVENT_SOURCEPOST},
|
||||
@@ -763,7 +764,7 @@ au_event_disable(char *what)
|
||||
save_ei = vim_strsave(p_ei);
|
||||
if (save_ei != NULL)
|
||||
{
|
||||
new_ei = vim_strnsave(p_ei, (int)(STRLEN(p_ei) + STRLEN(what)));
|
||||
new_ei = vim_strnsave(p_ei, STRLEN(p_ei) + STRLEN(what));
|
||||
if (new_ei != NULL)
|
||||
{
|
||||
if (*what == ',' && *p_ei == NUL)
|
||||
@@ -991,7 +992,7 @@ au_get_grouparg(char_u **argp)
|
||||
;
|
||||
if (p > arg)
|
||||
{
|
||||
group_name = vim_strnsave(arg, (int)(p - arg));
|
||||
group_name = vim_strnsave(arg, p - arg);
|
||||
if (group_name == NULL) // out of memory
|
||||
return AUGROUP_ERROR;
|
||||
group = au_find_group(group_name);
|
||||
@@ -1759,15 +1760,6 @@ has_cmdundefined(void)
|
||||
return (first_autopat[(int)EVENT_CMDUNDEFINED] != NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE when there is an FuncUndefined autocommand defined.
|
||||
*/
|
||||
int
|
||||
has_funcundefined(void)
|
||||
{
|
||||
return (first_autopat[(int)EVENT_FUNCUNDEFINED] != NULL);
|
||||
}
|
||||
|
||||
#if defined(FEAT_EVAL) || defined(PROTO)
|
||||
/*
|
||||
* Return TRUE when there is a TextYankPost autocommand defined.
|
||||
|
||||
@@ -2287,6 +2287,7 @@ free_buf_options(
|
||||
vim_regfree(buf->b_s.b_cap_prog);
|
||||
buf->b_s.b_cap_prog = NULL;
|
||||
clear_string_option(&buf->b_s.b_p_spl);
|
||||
clear_string_option(&buf->b_s.b_p_spo);
|
||||
#endif
|
||||
#ifdef FEAT_SEARCHPATH
|
||||
clear_string_option(&buf->b_p_sua);
|
||||
@@ -3650,7 +3651,7 @@ fileinfo(
|
||||
#ifdef FEAT_QUICKFIX
|
||||
&& !bt_dontwrite(curbuf)
|
||||
#endif
|
||||
? _("[New file]") : "",
|
||||
? new_file_message() : "",
|
||||
(curbuf->b_flags & BF_READERR) ? _("[Read errors]") : "",
|
||||
curbuf->b_p_ro ? (shortmess(SHM_RO) ? _("[RO]")
|
||||
: _("[readonly]")) : "",
|
||||
|
||||
@@ -598,6 +598,12 @@ set_file_time(
|
||||
}
|
||||
#endif // UNIX
|
||||
|
||||
char *
|
||||
new_file_message(void)
|
||||
{
|
||||
return shortmess(SHM_NEW) ? _("[New]") : _("[New File]");
|
||||
}
|
||||
|
||||
/*
|
||||
* buf_write() - write to file "fname" lines "start" through "end"
|
||||
*
|
||||
@@ -2347,7 +2353,7 @@ restore_backup:
|
||||
}
|
||||
else if (newfile)
|
||||
{
|
||||
STRCAT(IObuff, shortmess(SHM_NEW) ? _("[New]") : _("[New File]"));
|
||||
STRCAT(IObuff, new_file_message());
|
||||
c = TRUE;
|
||||
}
|
||||
if (no_eol)
|
||||
|
||||
@@ -2906,7 +2906,7 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
// Copy the message into allocated memory (excluding the NL)
|
||||
// and remove it from the buffer (including the NL).
|
||||
msg = vim_strnsave(buf, (int)(nl - buf));
|
||||
msg = vim_strnsave(buf, nl - buf);
|
||||
channel_consume(channel, part, (int)(nl - buf) + 1);
|
||||
}
|
||||
}
|
||||
@@ -3703,7 +3703,7 @@ channel_read_block(
|
||||
{
|
||||
// Copy the message into allocated memory and remove it from the
|
||||
// buffer.
|
||||
msg = vim_strnsave(buf, (int)(nl - buf));
|
||||
msg = vim_strnsave(buf, nl - buf);
|
||||
channel_consume(channel, part, (int)(nl - buf) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,18 +499,24 @@ str_foldcase(
|
||||
* Also doesn't work for the first byte of a multi-byte, "c" must be a
|
||||
* character!
|
||||
*/
|
||||
static char_u transchar_buf[7];
|
||||
static char_u transchar_charbuf[7];
|
||||
|
||||
char_u *
|
||||
transchar(int c)
|
||||
{
|
||||
return transchar_buf(curbuf, c);
|
||||
}
|
||||
|
||||
char_u *
|
||||
transchar_buf(buf_T *buf, int c)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
if (IS_SPECIAL(c)) // special key code, display as ~@ char
|
||||
{
|
||||
transchar_buf[0] = '~';
|
||||
transchar_buf[1] = '@';
|
||||
transchar_charbuf[0] = '~';
|
||||
transchar_charbuf[1] = '@';
|
||||
i = 2;
|
||||
c = K_SECOND(c);
|
||||
}
|
||||
@@ -524,12 +530,12 @@ transchar(int c)
|
||||
)) || (c < 256 && vim_isprintc_strict(c)))
|
||||
{
|
||||
// printable character
|
||||
transchar_buf[i] = c;
|
||||
transchar_buf[i + 1] = NUL;
|
||||
transchar_charbuf[i] = c;
|
||||
transchar_charbuf[i + 1] = NUL;
|
||||
}
|
||||
else
|
||||
transchar_nonprint(transchar_buf + i, c);
|
||||
return transchar_buf;
|
||||
transchar_nonprint(buf, transchar_charbuf + i, c);
|
||||
return transchar_charbuf;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -541,27 +547,27 @@ transchar_byte(int c)
|
||||
{
|
||||
if (enc_utf8 && c >= 0x80)
|
||||
{
|
||||
transchar_nonprint(transchar_buf, c);
|
||||
return transchar_buf;
|
||||
transchar_nonprint(curbuf, transchar_charbuf, c);
|
||||
return transchar_charbuf;
|
||||
}
|
||||
return transchar(c);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert non-printable character to two or more printable characters in
|
||||
* "buf[]". "buf" needs to be able to hold five bytes.
|
||||
* "buf[]". "charbuf" needs to be able to hold five bytes.
|
||||
* Does NOT work for multi-byte characters, c must be <= 255.
|
||||
*/
|
||||
void
|
||||
transchar_nonprint(char_u *buf, int c)
|
||||
transchar_nonprint(buf_T *buf, char_u *charbuf, int c)
|
||||
{
|
||||
if (c == NL)
|
||||
c = NUL; // we use newline in place of a NUL
|
||||
else if (c == CAR && get_fileformat(curbuf) == EOL_MAC)
|
||||
else if (c == CAR && get_fileformat(buf) == EOL_MAC)
|
||||
c = NL; // we use CR in place of NL in this case
|
||||
|
||||
if (dy_flags & DY_UHEX) // 'display' has "uhex"
|
||||
transchar_hex(buf, c);
|
||||
transchar_hex(charbuf, c);
|
||||
|
||||
#ifdef EBCDIC
|
||||
// For EBCDIC only the characters 0-63 and 255 are not printable
|
||||
@@ -570,35 +576,35 @@ transchar_nonprint(char_u *buf, int c)
|
||||
else if (c <= 0x7f) // 0x00 - 0x1f and 0x7f
|
||||
#endif
|
||||
{
|
||||
buf[0] = '^';
|
||||
charbuf[0] = '^';
|
||||
#ifdef EBCDIC
|
||||
if (c == DEL)
|
||||
buf[1] = '?'; // DEL displayed as ^?
|
||||
charbuf[1] = '?'; // DEL displayed as ^?
|
||||
else
|
||||
buf[1] = CtrlChar(c);
|
||||
charbuf[1] = CtrlChar(c);
|
||||
#else
|
||||
buf[1] = c ^ 0x40; // DEL displayed as ^?
|
||||
charbuf[1] = c ^ 0x40; // DEL displayed as ^?
|
||||
#endif
|
||||
|
||||
buf[2] = NUL;
|
||||
charbuf[2] = NUL;
|
||||
}
|
||||
else if (enc_utf8 && c >= 0x80)
|
||||
{
|
||||
transchar_hex(buf, c);
|
||||
transchar_hex(charbuf, c);
|
||||
}
|
||||
#ifndef EBCDIC
|
||||
else if (c >= ' ' + 0x80 && c <= '~' + 0x80) // 0xa0 - 0xfe
|
||||
{
|
||||
buf[0] = '|';
|
||||
buf[1] = c - 0x80;
|
||||
buf[2] = NUL;
|
||||
charbuf[0] = '|';
|
||||
charbuf[1] = c - 0x80;
|
||||
charbuf[2] = NUL;
|
||||
}
|
||||
#else
|
||||
else if (c < 64)
|
||||
{
|
||||
buf[0] = '~';
|
||||
buf[1] = MetaChar(c);
|
||||
buf[2] = NUL;
|
||||
charbuf[0] = '~';
|
||||
charbuf[1] = MetaChar(c);
|
||||
charbuf[2] = NUL;
|
||||
}
|
||||
#endif
|
||||
else // 0x80 - 0x9f and 0xff
|
||||
@@ -607,13 +613,13 @@ transchar_nonprint(char_u *buf, int c)
|
||||
* TODO: EBCDIC I don't know what to do with this chars, so I display
|
||||
* them as '~?' for now
|
||||
*/
|
||||
buf[0] = '~';
|
||||
charbuf[0] = '~';
|
||||
#ifdef EBCDIC
|
||||
buf[1] = '?'; // 0xff displayed as ~?
|
||||
charbuf[1] = '?'; // 0xff displayed as ~?
|
||||
#else
|
||||
buf[1] = (c - 0x80) ^ 0x40; // 0xff displayed as ~?
|
||||
charbuf[1] = (c - 0x80) ^ 0x40; // 0xff displayed as ~?
|
||||
#endif
|
||||
buf[2] = NUL;
|
||||
charbuf[2] = NUL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -273,6 +273,7 @@ nextwild(
|
||||
* options = WILD_SILENT: don't print warning messages
|
||||
* options = WILD_ESCAPE: put backslash before special chars
|
||||
* options = WILD_ICASE: ignore case for files
|
||||
* options = WILD_ALLLINKS; keep broken links
|
||||
*
|
||||
* The variables xp->xp_context and xp->xp_backslash must have been set!
|
||||
*/
|
||||
@@ -1145,6 +1146,15 @@ set_one_cmd_context(
|
||||
arg = skipwhite(arg);
|
||||
}
|
||||
|
||||
// Skip over ++argopt argument
|
||||
if ((ea.argt & EX_ARGOPT) && *arg != NUL && STRNCMP(arg, "++", 2) == 0)
|
||||
{
|
||||
p = arg;
|
||||
while (*p && !vim_isspace(*p))
|
||||
MB_PTR_ADV(p);
|
||||
arg = skipwhite(p);
|
||||
}
|
||||
|
||||
// Check for '|' to separate commands and '"' to start comments.
|
||||
// Don't do this for ":read !cmd" and ":write !cmd".
|
||||
if ((ea.argt & EX_TRLBAR) && !usefilter)
|
||||
@@ -1727,7 +1737,8 @@ set_one_cmd_context(
|
||||
{
|
||||
if ( STRNCMP(arg, "messages", p - arg) == 0
|
||||
|| STRNCMP(arg, "ctype", p - arg) == 0
|
||||
|| STRNCMP(arg, "time", p - arg) == 0)
|
||||
|| STRNCMP(arg, "time", p - arg) == 0
|
||||
|| STRNCMP(arg, "collate", p - arg) == 0)
|
||||
{
|
||||
xp->xp_context = EXPAND_LOCALES;
|
||||
xp->xp_pattern = skipwhite(p);
|
||||
@@ -2555,7 +2566,7 @@ ExpandUserDefined(
|
||||
{
|
||||
if (ga_grow(&ga, 1) == FAIL)
|
||||
break;
|
||||
((char_u **)ga.ga_data)[ga.ga_len] = vim_strnsave(s, (int)(e - s));
|
||||
((char_u **)ga.ga_data)[ga.ga_len] = vim_strnsave(s, e - s);
|
||||
++ga.ga_len;
|
||||
}
|
||||
|
||||
|
||||
@@ -198,6 +198,7 @@
|
||||
#undef HAVE_SIGVEC
|
||||
#undef HAVE_SMACK
|
||||
#undef HAVE_STRCASECMP
|
||||
#undef HAVE_STRCOLL
|
||||
#undef HAVE_STRERROR
|
||||
#undef HAVE_STRFTIME
|
||||
#undef HAVE_STRICMP
|
||||
|
||||
@@ -3739,7 +3739,7 @@ AC_CHECK_FUNCS(fchdir fchown fchmod fsync getcwd getpseudotty \
|
||||
getpwent getpwnam getpwuid getrlimit gettimeofday localtime_r lstat \
|
||||
memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
|
||||
getpgid setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
|
||||
sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
||||
sigprocmask sigvec strcasecmp strcoll strerror strftime stricmp strncasecmp \
|
||||
strnicmp strpbrk strptime strtol tgetent towlower towupper iswupper \
|
||||
tzset usleep utime utimes mblen ftruncate unsetenv posix_openpt)
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
|
||||
@@ -779,7 +779,7 @@ get_literal_key(char_u **arg, typval_T *tv)
|
||||
for (p = *arg; ASCII_ISALNUM(*p) || *p == '_' || *p == '-'; ++p)
|
||||
;
|
||||
tv->v_type = VAR_STRING;
|
||||
tv->vval.v_string = vim_strnsave(*arg, (int)(p - *arg));
|
||||
tv->vval.v_string = vim_strnsave(*arg, p - *arg);
|
||||
|
||||
*arg = skipwhite(p);
|
||||
return OK;
|
||||
|
||||
@@ -747,7 +747,7 @@ diff_write_buffer(buf_T *buf, diffin_T *din)
|
||||
|
||||
// xdiff doesn't support ignoring case, fold-case the text.
|
||||
c = PTR2CHAR(s);
|
||||
c = enc_utf8 ? utf_fold(c) : MB_TOLOWER(c);
|
||||
c = MB_CASEFOLD(c);
|
||||
orig_len = mb_ptr2len(s);
|
||||
if (mb_char2bytes(c, cbuf) != orig_len)
|
||||
// TODO: handle byte length difference
|
||||
@@ -1301,7 +1301,7 @@ ex_diffpatch(exarg_T *eap)
|
||||
if (curbuf->b_fname != NULL)
|
||||
{
|
||||
newname = vim_strnsave(curbuf->b_fname,
|
||||
(int)(STRLEN(curbuf->b_fname) + 4));
|
||||
STRLEN(curbuf->b_fname) + 4);
|
||||
if (newname != NULL)
|
||||
STRCAT(newname, ".new");
|
||||
}
|
||||
|
||||
@@ -2387,10 +2387,10 @@ ex_loadkeymap(exarg_T *eap)
|
||||
{
|
||||
kp = (kmap_T *)curbuf->b_kmap_ga.ga_data + curbuf->b_kmap_ga.ga_len;
|
||||
s = skiptowhite(p);
|
||||
kp->from = vim_strnsave(p, (int)(s - p));
|
||||
kp->from = vim_strnsave(p, s - p);
|
||||
p = skipwhite(s);
|
||||
s = skiptowhite(p);
|
||||
kp->to = vim_strnsave(p, (int)(s - p));
|
||||
kp->to = vim_strnsave(p, s - p);
|
||||
|
||||
if (kp->from == NULL || kp->to == NULL
|
||||
|| STRLEN(kp->from) + STRLEN(kp->to) >= KMAP_LLEN
|
||||
|
||||
@@ -1287,13 +1287,13 @@ win_line(
|
||||
// When still displaying '$' of change command, stop at cursor.
|
||||
// When only displaying the (relative) line number and that's done,
|
||||
// stop here.
|
||||
if ((dollar_vcol >= 0 && wp == curwin
|
||||
&& lnum == wp->w_cursor.lnum && vcol >= (long)wp->w_virtcol
|
||||
if (((dollar_vcol >= 0 && wp == curwin
|
||||
&& lnum == wp->w_cursor.lnum && vcol >= (long)wp->w_virtcol)
|
||||
|| (number_only && draw_state > WL_NR))
|
||||
#ifdef FEAT_DIFF
|
||||
&& filler_todo <= 0
|
||||
#endif
|
||||
)
|
||||
|| (number_only && draw_state > WL_NR))
|
||||
{
|
||||
screen_line(screen_row, wp->w_wincol, col, -(int)wp->w_width,
|
||||
screen_line_flags);
|
||||
@@ -1764,7 +1764,7 @@ win_line(
|
||||
{
|
||||
// head byte at end of line
|
||||
mb_l = 1;
|
||||
transchar_nonprint(extra, c);
|
||||
transchar_nonprint(wp->w_buffer, extra, c);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2224,7 +2224,7 @@ win_line(
|
||||
}
|
||||
else if (c != NUL)
|
||||
{
|
||||
p_extra = transchar(c);
|
||||
p_extra = transchar_buf(wp->w_buffer, c);
|
||||
if (n_extra == 0)
|
||||
n_extra = byte2cells(c) - 1;
|
||||
#ifdef FEAT_RIGHTLEFT
|
||||
|
||||
19
src/eval.c
19
src/eval.c
@@ -253,7 +253,7 @@ eval_expr_typval(typval_T *expr, typval_T *argv, int argc, typval_T *rettv)
|
||||
return FAIL;
|
||||
|
||||
if (partial->pt_func != NULL
|
||||
&& partial->pt_func->uf_dfunc_idx != UF_NOT_COMPILED)
|
||||
&& partial->pt_func->uf_def_status != UF_NOT_COMPILED)
|
||||
{
|
||||
if (call_def_function(partial->pt_func, argc, argv,
|
||||
partial, rettv) == FAIL)
|
||||
@@ -1431,7 +1431,7 @@ eval_for_line(
|
||||
if (fi == NULL)
|
||||
return NULL;
|
||||
|
||||
expr = skip_var_list(arg, TRUE, &fi->fi_varcount, &fi->fi_semicolon);
|
||||
expr = skip_var_list(arg, TRUE, &fi->fi_varcount, &fi->fi_semicolon, FALSE);
|
||||
if (expr == NULL)
|
||||
return fi;
|
||||
|
||||
@@ -3139,7 +3139,7 @@ eval_index(
|
||||
if (n1 >= len || n2 < 0 || n1 > n2)
|
||||
s = NULL;
|
||||
else
|
||||
s = vim_strnsave(s + n1, (int)(n2 - n1 + 1));
|
||||
s = vim_strnsave(s + n1, n2 - n1 + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3237,7 +3237,6 @@ eval_index(
|
||||
if (range)
|
||||
{
|
||||
list_T *l;
|
||||
listitem_T *item;
|
||||
|
||||
if (n2 < 0)
|
||||
n2 = len + n2;
|
||||
@@ -3245,19 +3244,9 @@ eval_index(
|
||||
n2 = len - 1;
|
||||
if (!empty2 && (n2 < 0 || n2 + 1 < n1))
|
||||
n2 = -1;
|
||||
l = list_alloc();
|
||||
l = list_slice(rettv->vval.v_list, n1, n2);
|
||||
if (l == NULL)
|
||||
return FAIL;
|
||||
for (item = list_find(rettv->vval.v_list, n1);
|
||||
n1 <= n2; ++n1)
|
||||
{
|
||||
if (list_append_tv(l, &item->li_tv) == FAIL)
|
||||
{
|
||||
list_free(l);
|
||||
return FAIL;
|
||||
}
|
||||
item = item->li_next;
|
||||
}
|
||||
clear_tv(rettv);
|
||||
rettv_list_set(rettv, l);
|
||||
}
|
||||
|
||||
165
src/evalfunc.c
165
src/evalfunc.c
@@ -339,6 +339,14 @@ ret_job(int argcount UNUSED, type_T **argtypes UNUSED)
|
||||
return &t_job;
|
||||
}
|
||||
|
||||
static type_T *
|
||||
ret_first_arg(int argcount, type_T **argtypes)
|
||||
{
|
||||
if (argcount > 0)
|
||||
return argtypes[0];
|
||||
return &t_void;
|
||||
}
|
||||
|
||||
static type_T *ret_f_function(int argcount, type_T **argtypes);
|
||||
|
||||
/*
|
||||
@@ -541,6 +549,7 @@ static funcentry_T global_functions[] =
|
||||
{"filter", 2, 2, FEARG_1, ret_any, f_filter},
|
||||
{"finddir", 1, 3, FEARG_1, ret_string, f_finddir},
|
||||
{"findfile", 1, 3, FEARG_1, ret_string, f_findfile},
|
||||
{"flatten", 1, 2, FEARG_1, ret_list_any, f_flatten},
|
||||
{"float2nr", 1, 1, FEARG_1, ret_number, FLOAT_FUNC(f_float2nr)},
|
||||
{"floor", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_floor)},
|
||||
{"fmod", 2, 2, FEARG_1, ret_float, FLOAT_FUNC(f_fmod)},
|
||||
@@ -768,8 +777,8 @@ static funcentry_T global_functions[] =
|
||||
},
|
||||
{"rand", 0, 1, FEARG_1, ret_number, f_rand},
|
||||
{"range", 1, 3, FEARG_1, ret_list_number, f_range},
|
||||
{"readdir", 1, 2, FEARG_1, ret_list_string, f_readdir},
|
||||
{"readdirex", 1, 2, FEARG_1, ret_list_dict_any, f_readdirex},
|
||||
{"readdir", 1, 3, FEARG_1, ret_list_string, f_readdir},
|
||||
{"readdirex", 1, 3, FEARG_1, ret_list_dict_any, f_readdirex},
|
||||
{"readfile", 1, 3, FEARG_1, ret_any, f_readfile},
|
||||
{"reduce", 2, 3, FEARG_1, ret_any, f_reduce},
|
||||
{"reg_executing", 0, 0, 0, ret_string, f_reg_executing},
|
||||
@@ -848,7 +857,7 @@ static funcentry_T global_functions[] =
|
||||
{"simplify", 1, 1, FEARG_1, ret_string, f_simplify},
|
||||
{"sin", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_sin)},
|
||||
{"sinh", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_sinh)},
|
||||
{"sort", 1, 3, FEARG_1, ret_list_any, f_sort},
|
||||
{"sort", 1, 3, FEARG_1, ret_first_arg, f_sort},
|
||||
{"sound_clear", 0, 0, 0, ret_void, SOUND_FUNC(f_sound_clear)},
|
||||
{"sound_playevent", 1, 2, FEARG_1, ret_number, SOUND_FUNC(f_sound_playevent)},
|
||||
{"sound_playfile", 1, 2, FEARG_1, ret_number, SOUND_FUNC(f_sound_playfile)},
|
||||
@@ -943,6 +952,7 @@ static funcentry_T global_functions[] =
|
||||
{"term_setsize", 3, 3, FEARG_1, ret_void, TERM_FUNC(f_term_setsize)},
|
||||
{"term_start", 1, 2, FEARG_1, ret_number, TERM_FUNC(f_term_start)},
|
||||
{"term_wait", 1, 2, FEARG_1, ret_void, TERM_FUNC(f_term_wait)},
|
||||
{"terminalprops", 0, 0, 0, ret_dict_string, f_terminalprops},
|
||||
{"test_alloc_fail", 3, 3, FEARG_1, ret_void, f_test_alloc_fail},
|
||||
{"test_autochdir", 0, 0, 0, ret_void, f_test_autochdir},
|
||||
{"test_feedinput", 1, 1, FEARG_1, ret_void, f_test_feedinput},
|
||||
@@ -5521,7 +5531,7 @@ find_some_match(typval_T *argvars, typval_T *rettv, matchtype_T type)
|
||||
|
||||
vim_free(li1->li_tv.vval.v_string);
|
||||
li1->li_tv.vval.v_string = vim_strnsave(regmatch.startp[0],
|
||||
(int)(regmatch.endp[0] - regmatch.startp[0]));
|
||||
regmatch.endp[0] - regmatch.startp[0]);
|
||||
li3->li_tv.vval.v_number =
|
||||
(varnumber_T)(regmatch.startp[0] - expr);
|
||||
li4->li_tv.vval.v_number =
|
||||
@@ -5556,7 +5566,7 @@ find_some_match(typval_T *argvars, typval_T *rettv, matchtype_T type)
|
||||
copy_tv(&li->li_tv, rettv);
|
||||
else
|
||||
rettv->vval.v_string = vim_strnsave(regmatch.startp[0],
|
||||
(int)(regmatch.endp[0] - regmatch.startp[0]));
|
||||
regmatch.endp[0] - regmatch.startp[0]);
|
||||
}
|
||||
else if (l != NULL)
|
||||
rettv->vval.v_number = idx;
|
||||
@@ -5992,11 +6002,11 @@ static int srand_seed_for_testing_is_used = FALSE;
|
||||
f_test_srand_seed(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
{
|
||||
if (argvars[0].v_type == VAR_UNKNOWN)
|
||||
srand_seed_for_testing_is_used = FALSE;
|
||||
srand_seed_for_testing_is_used = FALSE;
|
||||
else
|
||||
{
|
||||
srand_seed_for_testing = (UINT32_T)tv_get_number(&argvars[0]);
|
||||
srand_seed_for_testing_is_used = TRUE;
|
||||
srand_seed_for_testing = (UINT32_T)tv_get_number(&argvars[0]);
|
||||
srand_seed_for_testing_is_used = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6009,7 +6019,7 @@ init_srand(UINT32_T *x)
|
||||
|
||||
if (srand_seed_for_testing_is_used)
|
||||
{
|
||||
*x = srand_seed_for_testing;
|
||||
*x = srand_seed_for_testing;
|
||||
return;
|
||||
}
|
||||
#ifndef MSWIN
|
||||
@@ -7258,6 +7268,37 @@ f_setpos(typval_T *argvars, typval_T *rettv)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Translate a register type string to the yank type and block length
|
||||
*/
|
||||
static int
|
||||
get_yank_type(char_u **pp, char_u *yank_type, long *block_len)
|
||||
{
|
||||
char_u *stropt = *pp;
|
||||
switch (*stropt)
|
||||
{
|
||||
case 'v': case 'c': // character-wise selection
|
||||
*yank_type = MCHAR;
|
||||
break;
|
||||
case 'V': case 'l': // line-wise selection
|
||||
*yank_type = MLINE;
|
||||
break;
|
||||
case 'b': case Ctrl_V: // block-wise selection
|
||||
*yank_type = MBLOCK;
|
||||
if (VIM_ISDIGIT(stropt[1]))
|
||||
{
|
||||
++stropt;
|
||||
*block_len = getdigits(&stropt) - 1;
|
||||
--stropt;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return FAIL;
|
||||
}
|
||||
*pp = stropt;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* "setreg()" function
|
||||
*/
|
||||
@@ -7292,30 +7333,31 @@ f_setreg(typval_T *argvars, typval_T *rettv)
|
||||
if (argvars[1].v_type == VAR_DICT)
|
||||
{
|
||||
dict_T *d = argvars[1].vval.v_dict;
|
||||
dictitem_T *di = dict_find(d, (char_u *)"regcontents", -1);
|
||||
dictitem_T *di;
|
||||
|
||||
if (d == NULL || d->dv_hashtab.ht_used == 0)
|
||||
{
|
||||
// Empty dict, clear the register (like setreg(0, []))
|
||||
char_u *lstval[2] = {NULL, NULL};
|
||||
write_reg_contents_lst(regname, lstval, 0, FALSE, MAUTO, -1);
|
||||
return;
|
||||
}
|
||||
|
||||
di = dict_find(d, (char_u *)"regcontents", -1);
|
||||
if (di != NULL)
|
||||
regcontents = &di->di_tv;
|
||||
|
||||
stropt = dict_get_string(d, (char_u *)"regtype", FALSE);
|
||||
if (stropt != NULL)
|
||||
switch (*stropt)
|
||||
{
|
||||
int ret = get_yank_type(&stropt, &yank_type, &block_len);
|
||||
|
||||
if (ret == FAIL || *++stropt != NUL)
|
||||
{
|
||||
case 'v': // character-wise selection
|
||||
yank_type = MCHAR;
|
||||
break;
|
||||
case 'V': // line-wise selection
|
||||
yank_type = MLINE;
|
||||
break;
|
||||
case Ctrl_V: // block-wise selection
|
||||
yank_type = MBLOCK;
|
||||
if (VIM_ISDIGIT(stropt[1]))
|
||||
{
|
||||
++stropt;
|
||||
block_len = getdigits(&stropt) - 1;
|
||||
--stropt;
|
||||
}
|
||||
break;
|
||||
semsg(_(e_invargval), "value");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (regname == '"')
|
||||
{
|
||||
@@ -7334,6 +7376,12 @@ f_setreg(typval_T *argvars, typval_T *rettv)
|
||||
|
||||
if (argvars[2].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
if (yank_type != MAUTO)
|
||||
{
|
||||
semsg(_(e_toomanyarg), "setreg");
|
||||
return;
|
||||
}
|
||||
|
||||
stropt = tv_get_string_chk(&argvars[2]);
|
||||
if (stropt == NULL)
|
||||
return; // type error
|
||||
@@ -7343,21 +7391,8 @@ f_setreg(typval_T *argvars, typval_T *rettv)
|
||||
case 'a': case 'A': // append
|
||||
append = TRUE;
|
||||
break;
|
||||
case 'v': case 'c': // character-wise selection
|
||||
yank_type = MCHAR;
|
||||
break;
|
||||
case 'V': case 'l': // line-wise selection
|
||||
yank_type = MLINE;
|
||||
break;
|
||||
case 'b': case Ctrl_V: // block-wise selection
|
||||
yank_type = MBLOCK;
|
||||
if (VIM_ISDIGIT(stropt[1]))
|
||||
{
|
||||
++stropt;
|
||||
block_len = getdigits(&stropt) - 1;
|
||||
--stropt;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
get_yank_type(&stropt, &yank_type, &block_len);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7595,9 +7630,30 @@ f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
char_u *word = (char_u *)"";
|
||||
hlf_T attr = HLF_COUNT;
|
||||
int len = 0;
|
||||
#ifdef FEAT_SPELL
|
||||
int wo_spell_save = curwin->w_p_spell;
|
||||
|
||||
if (!curwin->w_p_spell)
|
||||
{
|
||||
did_set_spelllang(curwin);
|
||||
curwin->w_p_spell = TRUE;
|
||||
}
|
||||
|
||||
if (*curwin->w_s->b_p_spl == NUL)
|
||||
{
|
||||
emsg(_(e_no_spell));
|
||||
curwin->w_p_spell = wo_spell_save;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (rettv_list_alloc(rettv) == FAIL)
|
||||
{
|
||||
#ifdef FEAT_SPELL
|
||||
curwin->w_p_spell = wo_spell_save;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef FEAT_SPELL
|
||||
if (argvars[0].v_type == VAR_UNKNOWN)
|
||||
@@ -7610,7 +7666,7 @@ f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
curwin->w_set_curswant = TRUE;
|
||||
}
|
||||
}
|
||||
else if (curwin->w_p_spell && *curbuf->b_s.b_p_spl != NUL)
|
||||
else if (*curbuf->b_s.b_p_spl != NUL)
|
||||
{
|
||||
char_u *str = tv_get_string_chk(&argvars[0]);
|
||||
int capcol = -1;
|
||||
@@ -7632,6 +7688,7 @@ f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
}
|
||||
}
|
||||
}
|
||||
curwin->w_p_spell = wo_spell_save;
|
||||
#endif
|
||||
|
||||
list_append_string(rettv->vval.v_list, word, len);
|
||||
@@ -7657,13 +7714,32 @@ f_spellsuggest(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
int i;
|
||||
listitem_T *li;
|
||||
int need_capital = FALSE;
|
||||
int wo_spell_save = curwin->w_p_spell;
|
||||
|
||||
if (!curwin->w_p_spell)
|
||||
{
|
||||
did_set_spelllang(curwin);
|
||||
curwin->w_p_spell = TRUE;
|
||||
}
|
||||
|
||||
if (*curwin->w_s->b_p_spl == NUL)
|
||||
{
|
||||
emsg(_(e_no_spell));
|
||||
curwin->w_p_spell = wo_spell_save;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (rettv_list_alloc(rettv) == FAIL)
|
||||
{
|
||||
#ifdef FEAT_SPELL
|
||||
curwin->w_p_spell = wo_spell_save;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef FEAT_SPELL
|
||||
if (curwin->w_p_spell && *curwin->w_s->b_p_spl != NUL)
|
||||
if (*curwin->w_s->b_p_spl != NUL)
|
||||
{
|
||||
str = tv_get_string(&argvars[0]);
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
@@ -7700,6 +7776,7 @@ f_spellsuggest(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
}
|
||||
ga_clear(&ga);
|
||||
}
|
||||
curwin->w_p_spell = wo_spell_save;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -8861,7 +8938,7 @@ f_trim(typval_T *argvars, typval_T *rettv)
|
||||
}
|
||||
}
|
||||
}
|
||||
rettv->vval.v_string = vim_strnsave(head, (int)(tail - head));
|
||||
rettv->vval.v_string = vim_strnsave(head, tail - head);
|
||||
}
|
||||
|
||||
#ifdef FEAT_FLOAT
|
||||
|
||||
@@ -145,6 +145,7 @@ static struct vimvar
|
||||
{VV_NAME("versionlong", VAR_NUMBER), VV_RO},
|
||||
{VV_NAME("echospace", VAR_NUMBER), VV_RO},
|
||||
{VV_NAME("argv", VAR_LIST), VV_RO},
|
||||
{VV_NAME("collate", VAR_STRING), VV_RO},
|
||||
};
|
||||
|
||||
// shorthand
|
||||
@@ -164,7 +165,6 @@ static dict_T vimvardict; // Dictionary with v: variables
|
||||
// for VIM_VERSION_ defines
|
||||
#include "version.h"
|
||||
|
||||
static char_u *skip_var_one(char_u *arg, int include_type);
|
||||
static void list_glob_vars(int *first);
|
||||
static void list_buf_vars(int *first);
|
||||
static void list_win_vars(int *first);
|
||||
@@ -709,7 +709,7 @@ ex_let(exarg_T *eap)
|
||||
if (eap->arg == eap->cmd)
|
||||
flags |= LET_NO_COMMAND;
|
||||
|
||||
argend = skip_var_list(arg, TRUE, &var_count, &semicolon);
|
||||
argend = skip_var_list(arg, TRUE, &var_count, &semicolon, FALSE);
|
||||
if (argend == NULL)
|
||||
return;
|
||||
if (argend > arg && argend[-1] == '.') // for var.='str'
|
||||
@@ -728,8 +728,18 @@ ex_let(exarg_T *eap)
|
||||
else if (expr[0] == '.')
|
||||
emsg(_("E985: .= is not supported with script version 2"));
|
||||
else if (!ends_excmd2(eap->cmd, arg))
|
||||
// ":let var1 var2"
|
||||
arg = list_arg_vars(eap, arg, &first);
|
||||
{
|
||||
if (current_sctx.sc_version == SCRIPT_VERSION_VIM9)
|
||||
{
|
||||
// Vim9 declaration ":let var: type"
|
||||
arg = vim9_declare_scriptvar(eap, arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ":let var1 var2" - list values
|
||||
arg = list_arg_vars(eap, arg, &first);
|
||||
}
|
||||
}
|
||||
else if (!eap->skip)
|
||||
{
|
||||
// ":let"
|
||||
@@ -906,7 +916,8 @@ ex_let_vars(
|
||||
* Skip over assignable variable "var" or list of variables "[var, var]".
|
||||
* Used for ":let varvar = expr" and ":for varvar in expr".
|
||||
* For "[var, var]" increment "*var_count" for each variable.
|
||||
* for "[var, var; var]" set "semicolon".
|
||||
* for "[var, var; var]" set "semicolon" to 1.
|
||||
* If "silent" is TRUE do not give an "invalid argument" error message.
|
||||
* Return NULL for an error.
|
||||
*/
|
||||
char_u *
|
||||
@@ -914,7 +925,8 @@ skip_var_list(
|
||||
char_u *arg,
|
||||
int include_type,
|
||||
int *var_count,
|
||||
int *semicolon)
|
||||
int *semicolon,
|
||||
int silent)
|
||||
{
|
||||
char_u *p, *s;
|
||||
|
||||
@@ -925,10 +937,11 @@ skip_var_list(
|
||||
for (;;)
|
||||
{
|
||||
p = skipwhite(p + 1); // skip whites after '[', ';' or ','
|
||||
s = skip_var_one(p, TRUE);
|
||||
s = skip_var_one(p, FALSE);
|
||||
if (s == p)
|
||||
{
|
||||
semsg(_(e_invarg2), p);
|
||||
if (!silent)
|
||||
semsg(_(e_invarg2), p);
|
||||
return NULL;
|
||||
}
|
||||
++*var_count;
|
||||
@@ -947,7 +960,8 @@ skip_var_list(
|
||||
}
|
||||
else if (*p != ',')
|
||||
{
|
||||
semsg(_(e_invarg2), p);
|
||||
if (!silent)
|
||||
semsg(_(e_invarg2), p);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -962,7 +976,7 @@ skip_var_list(
|
||||
* l[idx].
|
||||
* In Vim9 script also skip over ": type" if "include_type" is TRUE.
|
||||
*/
|
||||
static char_u *
|
||||
char_u *
|
||||
skip_var_one(char_u *arg, int include_type)
|
||||
{
|
||||
char_u *end;
|
||||
@@ -971,10 +985,13 @@ skip_var_one(char_u *arg, int include_type)
|
||||
return arg + 2;
|
||||
end = find_name_end(*arg == '$' || *arg == '&' ? arg + 1 : arg,
|
||||
NULL, NULL, FNE_INCL_BR | FNE_CHECK_START);
|
||||
if (include_type && current_sctx.sc_version == SCRIPT_VERSION_VIM9
|
||||
&& *end == ':')
|
||||
if (include_type && current_sctx.sc_version == SCRIPT_VERSION_VIM9)
|
||||
{
|
||||
end = skip_type(skipwhite(end + 1));
|
||||
// "a: type" is declaring variable "a" with a type, not "a:".
|
||||
if (end == arg + 2 && end[-1] == ':')
|
||||
--end;
|
||||
if (*end == ':')
|
||||
end = skip_type(skipwhite(end + 1));
|
||||
}
|
||||
return end;
|
||||
}
|
||||
@@ -1187,6 +1204,13 @@ ex_let_one(
|
||||
emsg(_("E996: Cannot lock an environment variable"));
|
||||
return NULL;
|
||||
}
|
||||
if (current_sctx.sc_version == SCRIPT_VERSION_VIM9
|
||||
&& (flags & LET_NO_COMMAND) == 0)
|
||||
{
|
||||
vim9_declare_error(arg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Find the end of the name.
|
||||
++arg;
|
||||
name = arg;
|
||||
@@ -2359,9 +2383,13 @@ get_var_tv(
|
||||
*dip = v;
|
||||
}
|
||||
|
||||
if (tv == NULL && current_sctx.sc_version == SCRIPT_VERSION_VIM9)
|
||||
if (tv == NULL && (current_sctx.sc_version == SCRIPT_VERSION_VIM9
|
||||
|| STRNCMP(name, "s:", 2) == 0))
|
||||
{
|
||||
imported_T *import = find_imported(name, 0, NULL);
|
||||
imported_T *import;
|
||||
char_u *p = STRNCMP(name, "s:", 2) == 0 ? name + 2 : name;
|
||||
|
||||
import = find_imported(p, 0, NULL);
|
||||
|
||||
// imported variable from another script
|
||||
if (import != NULL)
|
||||
@@ -2530,7 +2558,7 @@ lookup_scriptvar(char_u *name, size_t len, cctx_T *dummy UNUSED)
|
||||
}
|
||||
else
|
||||
{
|
||||
p = vim_strnsave(name, (int)len);
|
||||
p = vim_strnsave(name, len);
|
||||
if (p == NULL)
|
||||
return NULL;
|
||||
}
|
||||
@@ -2607,7 +2635,7 @@ find_var_ht(char_u *name, char_u **varname)
|
||||
if (*name == 'v') // v: variable
|
||||
return &vimvarht;
|
||||
if (get_current_funccal() != NULL
|
||||
&& get_current_funccal()->func->uf_dfunc_idx == UF_NOT_COMPILED)
|
||||
&& get_current_funccal()->func->uf_def_status == UF_NOT_COMPILED)
|
||||
{
|
||||
// a: and l: are only used in functions defined with ":function"
|
||||
if (*name == 'a') // a: function argument
|
||||
@@ -2845,6 +2873,15 @@ set_var_const(
|
||||
}
|
||||
is_script_local = ht == get_script_local_ht();
|
||||
|
||||
if (current_sctx.sc_version == SCRIPT_VERSION_VIM9
|
||||
&& !is_script_local
|
||||
&& (flags & LET_NO_COMMAND) == 0
|
||||
&& name[1] == ':')
|
||||
{
|
||||
vim9_declare_error(name);
|
||||
return;
|
||||
}
|
||||
|
||||
di = find_var_in_ht(ht, 0, varname, TRUE);
|
||||
|
||||
// Search in parent scope which is possible to reference from lambda
|
||||
@@ -2865,17 +2902,23 @@ set_var_const(
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_script_local
|
||||
&& current_sctx.sc_version == SCRIPT_VERSION_VIM9)
|
||||
{
|
||||
if ((flags & LET_NO_COMMAND) == 0)
|
||||
{
|
||||
semsg(_("E1041: Redefining script item %s"), name);
|
||||
return;
|
||||
}
|
||||
|
||||
// check the type
|
||||
if (check_script_var_type(&di->di_tv, tv, name) == FAIL)
|
||||
return;
|
||||
}
|
||||
|
||||
if (var_check_ro(di->di_flags, name, FALSE)
|
||||
|| var_check_lock(di->di_tv.v_lock, name, FALSE))
|
||||
return;
|
||||
|
||||
if ((flags & LET_NO_COMMAND) == 0
|
||||
&& is_script_local
|
||||
&& current_sctx.sc_version == SCRIPT_VERSION_VIM9)
|
||||
{
|
||||
semsg(_("E1041: Redefining script item %s"), name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
// can only redefine once
|
||||
|
||||
@@ -858,13 +858,18 @@ f_win_gettype(typval_T *argvars, typval_T *rettv)
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (wp == aucmd_win)
|
||||
rettv->vval.v_string = vim_strsave((char_u *)"autocmd");
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
else if (wp->w_p_pvw)
|
||||
rettv->vval.v_string = vim_strsave((char_u *)"preview");
|
||||
#endif
|
||||
#ifdef FEAT_PROP_POPUP
|
||||
if (WIN_IS_POPUP(wp))
|
||||
else if (WIN_IS_POPUP(wp))
|
||||
rettv->vval.v_string = vim_strsave((char_u *)"popup");
|
||||
else
|
||||
#endif
|
||||
#ifdef FEAT_CMDWIN
|
||||
if (wp == curwin && cmdwin_type != 0)
|
||||
else if (wp == curwin && cmdwin_type != 0)
|
||||
rettv->vval.v_string = vim_strsave((char_u *)"command");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ do_ascii(exarg_T *eap UNUSED)
|
||||
#endif
|
||||
))
|
||||
{
|
||||
transchar_nonprint(buf3, c);
|
||||
transchar_nonprint(curbuf, buf3, c);
|
||||
vim_snprintf(buf1, sizeof(buf1), " <%s>", (char *)buf3);
|
||||
}
|
||||
else
|
||||
@@ -2556,7 +2556,7 @@ do_ecmd(
|
||||
}
|
||||
|
||||
/*
|
||||
* if the file was changed we may not be allowed to abandon it
|
||||
* If the file was changed we may not be allowed to abandon it:
|
||||
* - if we are going to re-edit the same file
|
||||
* - or if we are the only window on this file and if ECMD_HIDE is FALSE
|
||||
*/
|
||||
@@ -3221,7 +3221,7 @@ ex_append(exarg_T *eap)
|
||||
p = vim_strchr(eap->nextcmd, NL);
|
||||
if (p == NULL)
|
||||
p = eap->nextcmd + STRLEN(eap->nextcmd);
|
||||
theline = vim_strnsave(eap->nextcmd, (int)(p - eap->nextcmd));
|
||||
theline = vim_strnsave(eap->nextcmd, p - eap->nextcmd);
|
||||
if (*p != NUL)
|
||||
++p;
|
||||
eap->nextcmd = p;
|
||||
|
||||
146
src/ex_cmds2.c
146
src/ex_cmds2.c
@@ -1185,10 +1185,18 @@ set_lang_var(void)
|
||||
loc = get_locale_val(LC_TIME);
|
||||
# endif
|
||||
set_vim_var_string(VV_LC_TIME, loc, -1);
|
||||
|
||||
# ifdef HAVE_GET_LOCALE_VAL
|
||||
loc = get_locale_val(LC_COLLATE);
|
||||
# else
|
||||
// setlocale() not supported: use the default value
|
||||
loc = (char_u *)"C";
|
||||
# endif
|
||||
set_vim_var_string(VV_COLLATE, loc, -1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LOCALE_H) || defined(X_LOCALE) \
|
||||
#if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
|
||||
/*
|
||||
* ":language": Set the language (locale).
|
||||
*/
|
||||
@@ -1200,11 +1208,11 @@ ex_language(exarg_T *eap)
|
||||
char_u *name;
|
||||
int what = LC_ALL;
|
||||
char *whatstr = "";
|
||||
#ifdef LC_MESSAGES
|
||||
# define VIM_LC_MESSAGES LC_MESSAGES
|
||||
#else
|
||||
# define VIM_LC_MESSAGES 6789
|
||||
#endif
|
||||
# ifdef LC_MESSAGES
|
||||
# define VIM_LC_MESSAGES LC_MESSAGES
|
||||
# else
|
||||
# define VIM_LC_MESSAGES 6789
|
||||
# endif
|
||||
|
||||
name = eap->arg;
|
||||
|
||||
@@ -1232,15 +1240,21 @@ ex_language(exarg_T *eap)
|
||||
name = skipwhite(p);
|
||||
whatstr = "time ";
|
||||
}
|
||||
else if (STRNICMP(eap->arg, "collate", p - eap->arg) == 0)
|
||||
{
|
||||
what = LC_COLLATE;
|
||||
name = skipwhite(p);
|
||||
whatstr = "collate ";
|
||||
}
|
||||
}
|
||||
|
||||
if (*name == NUL)
|
||||
{
|
||||
#ifndef LC_MESSAGES
|
||||
# ifndef LC_MESSAGES
|
||||
if (what == VIM_LC_MESSAGES)
|
||||
p = get_mess_env();
|
||||
else
|
||||
#endif
|
||||
# endif
|
||||
p = (char_u *)setlocale(what, NULL);
|
||||
if (p == NULL || *p == NUL)
|
||||
p = (char_u *)"Unknown";
|
||||
@@ -1248,33 +1262,33 @@ ex_language(exarg_T *eap)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef LC_MESSAGES
|
||||
# ifndef LC_MESSAGES
|
||||
if (what == VIM_LC_MESSAGES)
|
||||
loc = "";
|
||||
else
|
||||
#endif
|
||||
# endif
|
||||
{
|
||||
loc = setlocale(what, (char *)name);
|
||||
#if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
|
||||
# if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
|
||||
// Make sure strtod() uses a decimal point, not a comma.
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
if (loc == NULL)
|
||||
semsg(_("E197: Cannot set language to \"%s\""), name);
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_NL_MSG_CAT_CNTR
|
||||
# ifdef HAVE_NL_MSG_CAT_CNTR
|
||||
// Need to do this for GNU gettext, otherwise cached translations
|
||||
// will be used again.
|
||||
extern int _nl_msg_cat_cntr;
|
||||
|
||||
++_nl_msg_cat_cntr;
|
||||
#endif
|
||||
# endif
|
||||
// Reset $LC_ALL, otherwise it would overrule everything.
|
||||
vim_setenv((char_u *)"LC_ALL", (char_u *)"");
|
||||
|
||||
if (what != LC_TIME)
|
||||
if (what != LC_TIME && what != LC_COLLATE)
|
||||
{
|
||||
// Tell gettext() what to translate to. It apparently doesn't
|
||||
// use the currently effective locale. Also do this when
|
||||
@@ -1296,20 +1310,20 @@ ex_language(exarg_T *eap)
|
||||
if (what != LC_CTYPE)
|
||||
{
|
||||
char_u *mname;
|
||||
#ifdef MSWIN
|
||||
# ifdef MSWIN
|
||||
mname = gettext_lang(name);
|
||||
#else
|
||||
# else
|
||||
mname = name;
|
||||
#endif
|
||||
# endif
|
||||
vim_setenv((char_u *)"LC_MESSAGES", mname);
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
# ifdef FEAT_MULTI_LANG
|
||||
set_helplang_default(mname);
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
# ifdef FEAT_EVAL
|
||||
// Set v:lang, v:lc_time and v:ctype to the final result.
|
||||
// Set v:lang, v:lc_time, v:collate and v:ctype to the final result.
|
||||
set_lang_var();
|
||||
# endif
|
||||
# ifdef FEAT_TITLE
|
||||
@@ -1321,7 +1335,6 @@ ex_language(exarg_T *eap)
|
||||
|
||||
static char_u **locales = NULL; // Array of all available locales
|
||||
|
||||
# ifndef MSWIN
|
||||
static int did_init_locales = FALSE;
|
||||
|
||||
/*
|
||||
@@ -1333,31 +1346,87 @@ find_locales(void)
|
||||
{
|
||||
garray_T locales_ga;
|
||||
char_u *loc;
|
||||
char_u *locale_list;
|
||||
# ifdef MSWIN
|
||||
size_t len = 0;
|
||||
# endif
|
||||
|
||||
// Find all available locales by running command "locale -a". If this
|
||||
// doesn't work we won't have completion.
|
||||
char_u *locale_a = get_cmd_output((char_u *)"locale -a",
|
||||
# ifndef MSWIN
|
||||
locale_list = get_cmd_output((char_u *)"locale -a",
|
||||
NULL, SHELL_SILENT, NULL);
|
||||
if (locale_a == NULL)
|
||||
# else
|
||||
// Find all available locales by examining the directories in
|
||||
// $VIMRUNTIME/lang/
|
||||
{
|
||||
int options = WILD_SILENT|WILD_USE_NL|WILD_KEEP_ALL;
|
||||
expand_T xpc;
|
||||
char_u *p;
|
||||
|
||||
ExpandInit(&xpc);
|
||||
xpc.xp_context = EXPAND_DIRECTORIES;
|
||||
locale_list = ExpandOne(&xpc, (char_u *)"$VIMRUNTIME/lang/*",
|
||||
NULL, options, WILD_ALL);
|
||||
ExpandCleanup(&xpc);
|
||||
if (locale_list == NULL)
|
||||
// Add a dummy input, that will be skipped lated but we need to
|
||||
// have something in locale_list so that the C locale is added at
|
||||
// the end.
|
||||
locale_list = vim_strsave((char_u *)".\n");
|
||||
p = locale_list;
|
||||
// find the last directory delimiter
|
||||
while (p != NULL && *p != NUL)
|
||||
{
|
||||
if (*p == '\n')
|
||||
break;
|
||||
if (*p == '\\')
|
||||
len = p - locale_list;
|
||||
p++;
|
||||
}
|
||||
}
|
||||
# endif
|
||||
if (locale_list == NULL)
|
||||
return NULL;
|
||||
ga_init2(&locales_ga, sizeof(char_u *), 20);
|
||||
|
||||
// Transform locale_a string where each locale is separated by "\n"
|
||||
// Transform locale_list string where each locale is separated by "\n"
|
||||
// into an array of locale strings.
|
||||
loc = (char_u *)strtok((char *)locale_a, "\n");
|
||||
loc = (char_u *)strtok((char *)locale_list, "\n");
|
||||
|
||||
while (loc != NULL)
|
||||
{
|
||||
if (ga_grow(&locales_ga, 1) == FAIL)
|
||||
break;
|
||||
loc = vim_strsave(loc);
|
||||
if (loc == NULL)
|
||||
break;
|
||||
int ignore = FALSE;
|
||||
|
||||
((char_u **)locales_ga.ga_data)[locales_ga.ga_len++] = loc;
|
||||
# ifdef MSWIN
|
||||
if (len > 0)
|
||||
loc += len + 1;
|
||||
// skip locales with a dot (which indicates the charset)
|
||||
if (vim_strchr(loc, '.') != NULL)
|
||||
ignore = TRUE;
|
||||
# endif
|
||||
if (!ignore)
|
||||
{
|
||||
if (ga_grow(&locales_ga, 1) == FAIL)
|
||||
break;
|
||||
|
||||
loc = vim_strsave(loc);
|
||||
if (loc == NULL)
|
||||
break;
|
||||
|
||||
((char_u **)locales_ga.ga_data)[locales_ga.ga_len++] = loc;
|
||||
}
|
||||
loc = (char_u *)strtok(NULL, "\n");
|
||||
}
|
||||
vim_free(locale_a);
|
||||
|
||||
# ifdef MSWIN
|
||||
// Add the C locale
|
||||
if (ga_grow(&locales_ga, 1) == OK)
|
||||
((char_u **)locales_ga.ga_data)[locales_ga.ga_len++] =
|
||||
vim_strsave((char_u *)"C");
|
||||
# endif
|
||||
|
||||
vim_free(locale_list);
|
||||
if (ga_grow(&locales_ga, 1) == FAIL)
|
||||
{
|
||||
ga_clear(&locales_ga);
|
||||
@@ -1366,7 +1435,6 @@ find_locales(void)
|
||||
((char_u **)locales_ga.ga_data)[locales_ga.ga_len] = NULL;
|
||||
return (char_u **)locales_ga.ga_data;
|
||||
}
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Lazy initialization of all available locales.
|
||||
@@ -1374,16 +1442,14 @@ find_locales(void)
|
||||
static void
|
||||
init_locales(void)
|
||||
{
|
||||
# ifndef MSWIN
|
||||
if (!did_init_locales)
|
||||
{
|
||||
did_init_locales = TRUE;
|
||||
locales = find_locales();
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
# if defined(EXITFREE) || defined(PROTO)
|
||||
# if defined(EXITFREE) || defined(PROTO)
|
||||
void
|
||||
free_locales(void)
|
||||
{
|
||||
@@ -1395,7 +1461,7 @@ free_locales(void)
|
||||
VIM_CLEAR(locales);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Function given to ExpandGeneric() to obtain the possible arguments of the
|
||||
@@ -1410,11 +1476,13 @@ get_lang_arg(expand_T *xp UNUSED, int idx)
|
||||
return (char_u *)"ctype";
|
||||
if (idx == 2)
|
||||
return (char_u *)"time";
|
||||
if (idx == 3)
|
||||
return (char_u *)"collate";
|
||||
|
||||
init_locales();
|
||||
if (locales == NULL)
|
||||
return NULL;
|
||||
return locales[idx - 3];
|
||||
return locales[idx - 4];
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1895,7 +1895,7 @@ do_one_cmd(
|
||||
p = ea.cmd;
|
||||
while (ASCII_ISALNUM(*p))
|
||||
++p;
|
||||
p = vim_strnsave(ea.cmd, (int)(p - ea.cmd));
|
||||
p = vim_strnsave(ea.cmd, p - ea.cmd);
|
||||
ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL);
|
||||
vim_free(p);
|
||||
// If the autocommands did something and didn't cause an error, try
|
||||
@@ -6215,6 +6215,7 @@ do_exedit(
|
||||
|| eap->cmdidx == CMD_view))
|
||||
{
|
||||
exmode_active = FALSE;
|
||||
ex_pressedreturn = FALSE;
|
||||
if (*eap->arg == NUL)
|
||||
{
|
||||
// Special case: ":global/pat/visual\NLvi-commands"
|
||||
|
||||
@@ -439,7 +439,7 @@ get_exception_string(
|
||||
{
|
||||
cmdlen = (int)STRLEN(cmdname);
|
||||
ret = (char *)vim_strnsave((char_u *)"Vim(",
|
||||
4 + cmdlen + 2 + (int)STRLEN(mesg));
|
||||
4 + cmdlen + 2 + STRLEN(mesg));
|
||||
if (ret == NULL)
|
||||
return ret;
|
||||
STRCPY(&ret[4], cmdname);
|
||||
@@ -448,7 +448,7 @@ get_exception_string(
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = (char *)vim_strnsave((char_u *)"Vim:", 4 + (int)STRLEN(mesg));
|
||||
ret = (char *)vim_strnsave((char_u *)"Vim:", 4 + STRLEN(mesg));
|
||||
if (ret == NULL)
|
||||
return ret;
|
||||
val = ret + 4;
|
||||
@@ -806,7 +806,7 @@ report_pending(int action, int pending, void *value)
|
||||
if (pending & CSTP_THROW)
|
||||
{
|
||||
vim_snprintf((char *)IObuff, IOSIZE, mesg, _("Exception"));
|
||||
mesg = (char *)vim_strnsave(IObuff, (int)STRLEN(IObuff) + 4);
|
||||
mesg = (char *)vim_strnsave(IObuff, STRLEN(IObuff) + 4);
|
||||
STRCAT(mesg, ": %s");
|
||||
s = (char *)((except_T *)value)->value;
|
||||
}
|
||||
|
||||
56
src/fileio.c
56
src/fileio.c
@@ -35,6 +35,10 @@ static linenr_T readfile_linenr(linenr_T linecnt, char_u *p, char_u *endp);
|
||||
static char_u *check_for_bom(char_u *p, long size, int *lenp, int flags);
|
||||
static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer name");
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
static int readdirex_sort;
|
||||
#endif
|
||||
|
||||
void
|
||||
filemess(
|
||||
buf_T *buf,
|
||||
@@ -506,7 +510,8 @@ readfile(
|
||||
}
|
||||
}
|
||||
if (dir_of_file_exists(fname))
|
||||
filemess(curbuf, sfname, (char_u *)_("[New File]"), 0);
|
||||
filemess(curbuf, sfname,
|
||||
(char_u *)new_file_message(), 0);
|
||||
else
|
||||
filemess(curbuf, sfname,
|
||||
(char_u *)_("[New DIRECTORY]"), 0);
|
||||
@@ -2723,7 +2728,7 @@ next_fenc(char_u **pp, int *alloced)
|
||||
}
|
||||
else
|
||||
{
|
||||
r = vim_strnsave(*pp, (int)(p - *pp));
|
||||
r = vim_strnsave(*pp, p - *pp);
|
||||
*pp = p + 1;
|
||||
if (r != NULL)
|
||||
{
|
||||
@@ -4544,7 +4549,7 @@ create_readdirex_item(char_u *path, char_u *name)
|
||||
int ret, link = FALSE;
|
||||
varnumber_T size;
|
||||
char_u permbuf[] = "---------";
|
||||
char_u *q;
|
||||
char_u *q = NULL;
|
||||
struct passwd *pw;
|
||||
struct group *gr;
|
||||
|
||||
@@ -4563,6 +4568,9 @@ create_readdirex_item(char_u *path, char_u *name)
|
||||
{
|
||||
link = TRUE;
|
||||
ret = mch_stat(p, &st);
|
||||
if (ret < 0)
|
||||
q = (char_u*)"link";
|
||||
|
||||
}
|
||||
vim_free(p);
|
||||
|
||||
@@ -4617,7 +4625,7 @@ create_readdirex_item(char_u *path, char_u *name)
|
||||
goto theend;
|
||||
if (dict_add_number(item, "time", -1) == FAIL)
|
||||
goto theend;
|
||||
if (dict_add_string(item, "type", (char_u*)"") == FAIL)
|
||||
if (dict_add_string(item, "type", q == NULL ? (char_u*)"" : q) == FAIL)
|
||||
goto theend;
|
||||
if (dict_add_string(item, "perm", (char_u*)"") == FAIL)
|
||||
goto theend;
|
||||
@@ -4641,7 +4649,23 @@ compare_readdirex_item(const void *p1, const void *p2)
|
||||
|
||||
name1 = dict_get_string(*(dict_T**)p1, (char_u*)"name", FALSE);
|
||||
name2 = dict_get_string(*(dict_T**)p2, (char_u*)"name", FALSE);
|
||||
return STRCMP(name1, name2);
|
||||
if (readdirex_sort == READDIR_SORT_BYTE)
|
||||
return STRCMP(name1, name2);
|
||||
else if (readdirex_sort == READDIR_SORT_IC)
|
||||
return STRICMP(name1, name2);
|
||||
else
|
||||
return STRCOLL(name1, name2);
|
||||
}
|
||||
|
||||
static int
|
||||
compare_readdir_item(const void *s1, const void *s2)
|
||||
{
|
||||
if (readdirex_sort == READDIR_SORT_BYTE)
|
||||
return STRCMP(*(char **)s1, *(char **)s2);
|
||||
else if (readdirex_sort == READDIR_SORT_IC)
|
||||
return STRICMP(*(char **)s1, *(char **)s2);
|
||||
else
|
||||
return STRCOLL(*(char **)s1, *(char **)s2);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -4659,7 +4683,8 @@ readdir_core(
|
||||
char_u *path,
|
||||
int withattr UNUSED,
|
||||
void *context,
|
||||
int (*checkitem)(void *context, void *item))
|
||||
int (*checkitem)(void *context, void *item),
|
||||
int sort)
|
||||
{
|
||||
int failed = FALSE;
|
||||
char_u *p;
|
||||
@@ -4683,6 +4708,8 @@ readdir_core(
|
||||
else \
|
||||
vim_free(item); \
|
||||
} while (0)
|
||||
|
||||
readdirex_sort = READDIR_SORT_BYTE;
|
||||
# else
|
||||
# define FREE_ITEM(item) vim_free(item)
|
||||
# endif
|
||||
@@ -4719,6 +4746,11 @@ readdir_core(
|
||||
ignore = wp[0] == L'.' &&
|
||||
(wp[1] == NUL ||
|
||||
(wp[1] == L'.' && wp[2] == NUL));
|
||||
if (ignore)
|
||||
{
|
||||
ok = FindNextFileW(hFind, &wfd);
|
||||
continue;
|
||||
}
|
||||
# ifdef FEAT_EVAL
|
||||
if (withattr)
|
||||
item = (void*)create_readdirex_item(&wfd);
|
||||
@@ -4787,6 +4819,8 @@ readdir_core(
|
||||
ignore = p[0] == '.' &&
|
||||
(p[1] == NUL ||
|
||||
(p[1] == '.' && p[2] == NUL));
|
||||
if (ignore)
|
||||
continue;
|
||||
# ifdef FEAT_EVAL
|
||||
if (withattr)
|
||||
item = (void*)create_readdirex_item(path, p);
|
||||
@@ -4833,15 +4867,19 @@ readdir_core(
|
||||
|
||||
# undef FREE_ITEM
|
||||
|
||||
if (!failed && gap->ga_len > 0)
|
||||
if (!failed && gap->ga_len > 0 && sort > READDIR_SORT_NONE)
|
||||
{
|
||||
# ifdef FEAT_EVAL
|
||||
readdirex_sort = sort;
|
||||
if (withattr)
|
||||
qsort((void*)gap->ga_data, (size_t)gap->ga_len, sizeof(dict_T*),
|
||||
compare_readdirex_item);
|
||||
else
|
||||
# endif
|
||||
qsort((void*)gap->ga_data, (size_t)gap->ga_len, sizeof(char_u *),
|
||||
compare_readdir_item);
|
||||
# else
|
||||
sort_strings((char_u **)gap->ga_data, gap->ga_len);
|
||||
# endif
|
||||
}
|
||||
|
||||
return failed ? FAIL : OK;
|
||||
@@ -4872,7 +4910,7 @@ delete_recursive(char_u *name)
|
||||
exp = vim_strsave(name);
|
||||
if (exp == NULL)
|
||||
return -1;
|
||||
if (readdir_core(&ga, exp, FALSE, NULL, NULL) == OK)
|
||||
if (readdir_core(&ga, exp, FALSE, NULL, NULL, READDIR_SORT_NONE) == OK)
|
||||
{
|
||||
for (i = 0; i < ga.ga_len; ++i)
|
||||
{
|
||||
|
||||
@@ -389,7 +389,7 @@ repeat:
|
||||
if (mch_isdir(*fnamep))
|
||||
{
|
||||
// Make room for one or two extra characters.
|
||||
*fnamep = vim_strnsave(*fnamep, (int)STRLEN(*fnamep) + 2);
|
||||
*fnamep = vim_strnsave(*fnamep, STRLEN(*fnamep) + 2);
|
||||
vim_free(*bufp); // free any allocated file name
|
||||
*bufp = *fnamep;
|
||||
if (*fnamep == NULL)
|
||||
@@ -416,7 +416,7 @@ repeat:
|
||||
// Need full path first (use expand_env() to remove a "~/")
|
||||
if (!has_fullname && !has_homerelative)
|
||||
{
|
||||
if (c == '.' && **fnamep == '~')
|
||||
if ((c == '.' || c == '~') && **fnamep == '~')
|
||||
p = pbuf = expand_env_save(*fnamep);
|
||||
else
|
||||
p = pbuf = FullName_save(*fnamep, FALSE);
|
||||
@@ -655,7 +655,7 @@ repeat:
|
||||
p = vim_strchr(s, sep);
|
||||
if (p != NULL)
|
||||
{
|
||||
pat = vim_strnsave(s, (int)(p - s));
|
||||
pat = vim_strnsave(s, p - s);
|
||||
if (pat != NULL)
|
||||
{
|
||||
s = p + 1;
|
||||
@@ -663,7 +663,7 @@ repeat:
|
||||
p = vim_strchr(s, sep);
|
||||
if (p != NULL)
|
||||
{
|
||||
sub = vim_strnsave(s, (int)(p - s));
|
||||
sub = vim_strnsave(s, p - s);
|
||||
str = vim_strnsave(*fnamep, *fnamelen);
|
||||
if (sub != NULL && str != NULL)
|
||||
{
|
||||
@@ -1296,7 +1296,7 @@ mkdir_recurse(char_u *dir, int prot)
|
||||
return OK;
|
||||
|
||||
// If the directory exists we're done. Otherwise: create it.
|
||||
updir = vim_strnsave(dir, (int)(p - dir));
|
||||
updir = vim_strnsave(dir, p - dir);
|
||||
if (updir == NULL)
|
||||
return FAIL;
|
||||
if (mch_isdir(updir))
|
||||
@@ -1405,6 +1405,36 @@ theend:
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int
|
||||
readdirex_dict_arg(typval_T *tv, int *cmp)
|
||||
{
|
||||
char_u *compare;
|
||||
|
||||
if (tv->v_type != VAR_DICT)
|
||||
{
|
||||
emsg(_(e_dictreq));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
if (dict_find(tv->vval.v_dict, (char_u *)"sort", -1) != NULL)
|
||||
compare = dict_get_string(tv->vval.v_dict, (char_u *)"sort", FALSE);
|
||||
else
|
||||
{
|
||||
semsg(_(e_no_dict_key), "sort");
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
if (STRCMP(compare, (char_u *) "none") == 0)
|
||||
*cmp = READDIR_SORT_NONE;
|
||||
else if (STRCMP(compare, (char_u *) "case") == 0)
|
||||
*cmp = READDIR_SORT_BYTE;
|
||||
else if (STRCMP(compare, (char_u *) "icase") == 0)
|
||||
*cmp = READDIR_SORT_IC;
|
||||
else if (STRCMP(compare, (char_u *) "collate") == 0)
|
||||
*cmp = READDIR_SORT_COLLATE;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* "readdir()" function
|
||||
*/
|
||||
@@ -1417,14 +1447,19 @@ f_readdir(typval_T *argvars, typval_T *rettv)
|
||||
char_u *p;
|
||||
garray_T ga;
|
||||
int i;
|
||||
int sort = READDIR_SORT_BYTE;
|
||||
|
||||
if (rettv_list_alloc(rettv) == FAIL)
|
||||
return;
|
||||
path = tv_get_string(&argvars[0]);
|
||||
expr = &argvars[1];
|
||||
|
||||
if (argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN &&
|
||||
readdirex_dict_arg(&argvars[2], &sort) == FAIL)
|
||||
return;
|
||||
|
||||
ret = readdir_core(&ga, path, FALSE, (void *)expr,
|
||||
(expr->v_type == VAR_UNKNOWN) ? NULL : readdir_checkitem);
|
||||
(expr->v_type == VAR_UNKNOWN) ? NULL : readdir_checkitem, sort);
|
||||
if (ret == OK)
|
||||
{
|
||||
for (i = 0; i < ga.ga_len; i++)
|
||||
@@ -1480,14 +1515,19 @@ f_readdirex(typval_T *argvars, typval_T *rettv)
|
||||
char_u *path;
|
||||
garray_T ga;
|
||||
int i;
|
||||
int sort = READDIR_SORT_BYTE;
|
||||
|
||||
if (rettv_list_alloc(rettv) == FAIL)
|
||||
return;
|
||||
path = tv_get_string(&argvars[0]);
|
||||
expr = &argvars[1];
|
||||
|
||||
if (argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN &&
|
||||
readdirex_dict_arg(&argvars[2], &sort) == FAIL)
|
||||
return;
|
||||
|
||||
ret = readdir_core(&ga, path, TRUE, (void *)expr,
|
||||
(expr->v_type == VAR_UNKNOWN) ? NULL : readdirex_checkitem);
|
||||
(expr->v_type == VAR_UNKNOWN) ? NULL : readdirex_checkitem, sort);
|
||||
if (ret == OK)
|
||||
{
|
||||
for (i = 0; i < ga.ga_len; i++)
|
||||
@@ -1594,7 +1634,7 @@ f_readfile(typval_T *argvars, typval_T *rettv)
|
||||
--prevlen;
|
||||
}
|
||||
if (prevlen == 0)
|
||||
s = vim_strnsave(start, (int)len);
|
||||
s = vim_strnsave(start, len);
|
||||
else
|
||||
{
|
||||
// Change "prev" buffer to be the right size. This way
|
||||
@@ -2397,11 +2437,9 @@ home_replace(
|
||||
if (--dstlen > 0)
|
||||
*dst++ = '~';
|
||||
|
||||
/*
|
||||
* If it's just the home directory, add "/".
|
||||
*/
|
||||
if (!vim_ispathsep(src[0]) && --dstlen > 0)
|
||||
*dst++ = '/';
|
||||
// Do not add directory separator into dst, because dst is
|
||||
// expected to just return the directory name without the
|
||||
// directory separator '/'.
|
||||
break;
|
||||
}
|
||||
if (p == homedir_env)
|
||||
@@ -3039,7 +3077,7 @@ expand_backtick(
|
||||
int i;
|
||||
|
||||
// Create the command: lop off the backticks.
|
||||
cmd = vim_strnsave(pat + 1, (int)STRLEN(pat) - 2);
|
||||
cmd = vim_strnsave(pat + 1, STRLEN(pat) - 2);
|
||||
if (cmd == NULL)
|
||||
return -1;
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ vim_findfile_init(
|
||||
if (walker)
|
||||
{
|
||||
search_ctx->ffsc_stopdirs_v[dircount-1] =
|
||||
vim_strnsave(helper, (int)(walker - helper));
|
||||
vim_strnsave(helper, walker - helper);
|
||||
walker++;
|
||||
}
|
||||
else
|
||||
@@ -484,7 +484,7 @@ vim_findfile_init(
|
||||
char *errpt;
|
||||
|
||||
// save the fix part of the path
|
||||
search_ctx->ffsc_fix_path = vim_strnsave(path, (int)(wc_part - path));
|
||||
search_ctx->ffsc_fix_path = vim_strnsave(path, wc_part - path);
|
||||
|
||||
/*
|
||||
* copy wc_path and add restricts to the '**' wildcard.
|
||||
@@ -2641,6 +2641,14 @@ simplify_filename(char_u *filename)
|
||||
while (vim_ispathsep(*p));
|
||||
}
|
||||
start = p; // remember start after "c:/" or "/" or "///"
|
||||
#ifdef UNIX
|
||||
// Posix says that "//path" is unchanged but "///path" is "/path".
|
||||
if (start > filename + 2)
|
||||
{
|
||||
STRMOVE(filename + 1, p);
|
||||
start = p = filename + 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
@@ -2204,6 +2204,13 @@ parse_queued_messages(void)
|
||||
if (has_sound_callback_in_queue())
|
||||
invoke_sound_callback();
|
||||
# endif
|
||||
#ifdef SIGUSR1
|
||||
if (got_sigusr1)
|
||||
{
|
||||
apply_autocmds(EVENT_SIGUSR1, NULL, NULL, FALSE, curbuf);
|
||||
got_sigusr1 = FALSE;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1171,9 +1171,14 @@ EXTERN int curscript INIT(= 0); // index in scriptin[]
|
||||
EXTERN FILE *scriptout INIT(= NULL); // stream to write script to
|
||||
EXTERN int read_cmd_fd INIT(= 0); // fd to read commands from
|
||||
|
||||
// volatile because it is used in signal handler catch_sigint().
|
||||
EXTERN volatile sig_atomic_t got_int INIT(= FALSE); // set to TRUE when interrupt
|
||||
// signal occurred
|
||||
// Set to TRUE when an interrupt signal occurred.
|
||||
// Volatile because it is used in signal handler catch_sigint().
|
||||
EXTERN volatile sig_atomic_t got_int INIT(= FALSE);
|
||||
|
||||
// Set to TRUE when SIGUSR1 signal was detected.
|
||||
// Volatile because it is used in signal handler catch_sigint().
|
||||
EXTERN volatile sig_atomic_t got_sigusr1 INIT(= FALSE);
|
||||
|
||||
#ifdef USE_TERM_CONSOLE
|
||||
EXTERN int term_console INIT(= FALSE); // set to TRUE when console used
|
||||
#endif
|
||||
@@ -1581,6 +1586,9 @@ EXTERN char e_invcmd[] INIT(= N_("E476: Invalid command"));
|
||||
#if defined(UNIX) || defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
|
||||
EXTERN char e_isadir2[] INIT(= N_("E17: \"%s\" is a directory"));
|
||||
#endif
|
||||
#ifdef FEAT_SPELL
|
||||
EXTERN char e_no_spell[] INIT(= N_("E756: Spell checking is not possible"));
|
||||
#endif
|
||||
#ifdef FEAT_LIBCALL
|
||||
EXTERN char e_libcall[] INIT(= N_("E364: Library call failed for \"%s()\""));
|
||||
#endif
|
||||
@@ -1691,6 +1699,7 @@ EXTERN char e_const_option[] INIT(= N_("E996: Cannot lock an option"));
|
||||
EXTERN char e_unknown_option[] INIT(= N_("E113: Unknown option: %s"));
|
||||
EXTERN char e_letunexp[] INIT(= N_("E18: Unexpected characters in :let"));
|
||||
EXTERN char e_reduceempty[] INIT(= N_("E998: Reduce of an empty %s with no initial value"));
|
||||
EXTERN char e_no_dict_key[] INIT(= N_("E857: Dictionary key \"%s\" required"));
|
||||
#endif
|
||||
#ifdef FEAT_QUICKFIX
|
||||
EXTERN char e_readerrf[] INIT(= N_("E47: Error while reading errorfile"));
|
||||
@@ -1777,6 +1786,10 @@ EXTERN char e_white_after[] INIT(= N_("E1069: white space required after '%s'"))
|
||||
EXTERN char e_no_white_before[] INIT(= N_("E1068: No white space allowed before '%s'"));
|
||||
|
||||
EXTERN char e_lock_unlock[] INIT(= N_("E940: Cannot lock or unlock variable %s"));
|
||||
EXTERN char e_const_req_value[] INIT(= N_("E1021: const requires a value"));
|
||||
EXTERN char e_type_req[] INIT(= N_("E1022: type or initialization required"));
|
||||
EXTERN char e_declare_var[] INIT(= N_("E1016: Cannot declare a %s variable: %s"));
|
||||
EXTERN char e_declare_env_var[] INIT(= N_("E1016: Cannot declare an environment variable: %s"));
|
||||
#endif
|
||||
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
|
||||
EXTERN char e_alloc_color[] INIT(= N_("E254: Cannot allocate color %s"));
|
||||
@@ -1831,6 +1844,8 @@ EXTERN int disable_redraw_for_testing INIT(= FALSE);
|
||||
EXTERN int ignore_redraw_flag_for_testing INIT(= FALSE);
|
||||
EXTERN int nfa_fail_for_testing INIT(= FALSE);
|
||||
EXTERN int no_query_mouse_for_testing INIT(= FALSE);
|
||||
EXTERN int ui_delay_for_testing INIT(= 0);
|
||||
EXTERN int reset_term_props_on_termresponse INIT(= FALSE);
|
||||
|
||||
EXTERN int in_free_unref_items INIT(= FALSE);
|
||||
#endif
|
||||
|
||||
@@ -840,7 +840,7 @@ set_printable_label_text(GtkLabel *label, char_u *text)
|
||||
}
|
||||
else
|
||||
{
|
||||
transchar_nonprint(pdest, *p); // ^X
|
||||
transchar_nonprint(curbuf, pdest, *p); // ^X
|
||||
outlen = 2;
|
||||
}
|
||||
if (pixel != INVALCOLOR)
|
||||
|
||||
@@ -1211,15 +1211,19 @@ key_press_event(GtkWidget *widget UNUSED,
|
||||
if (len == 0) // Unrecognized key
|
||||
return TRUE;
|
||||
|
||||
// Handle modifiers.
|
||||
modifiers = modifiers_gdk2vim(state);
|
||||
|
||||
// For some keys a shift modifier is translated into another key code.
|
||||
if (len == -3)
|
||||
key = TO_SPECIAL(string[1], string[2]);
|
||||
else
|
||||
key = string[0];
|
||||
{
|
||||
string[len] = NUL;
|
||||
key = mb_ptr2char(string);
|
||||
}
|
||||
|
||||
// Handle modifiers.
|
||||
modifiers = modifiers_gdk2vim(state);
|
||||
|
||||
// Recognize special keys.
|
||||
key = simplify_key(key, &modifiers);
|
||||
if (key == CSI)
|
||||
key = K_CSI;
|
||||
@@ -1235,8 +1239,11 @@ key_press_event(GtkWidget *widget UNUSED,
|
||||
// <C-H> and <C-h> mean the same thing, always use "H"
|
||||
if ((modifiers & MOD_MASK_CTRL) && ASCII_ISALPHA(key))
|
||||
key = TOUPPER_ASC(key);
|
||||
string[0] = key;
|
||||
len = 1;
|
||||
|
||||
// May remove the shift modifier if it's included in the key.
|
||||
modifiers = may_remove_shift_modifier(modifiers, key);
|
||||
|
||||
len = mb_char2bytes(key, string);
|
||||
}
|
||||
|
||||
if (modifiers != 0)
|
||||
|
||||
@@ -938,7 +938,10 @@ gui_x11_key_hit_cb(
|
||||
if (len == -3)
|
||||
key = TO_SPECIAL(string[1], string[2]);
|
||||
else
|
||||
key = string[0];
|
||||
{
|
||||
string[len] = NUL;
|
||||
key = mb_ptr2char(string);
|
||||
}
|
||||
key = simplify_key(key, &modifiers);
|
||||
if (key == CSI)
|
||||
key = K_CSI;
|
||||
@@ -951,8 +954,7 @@ gui_x11_key_hit_cb(
|
||||
}
|
||||
else
|
||||
{
|
||||
string[0] = key;
|
||||
len = 1;
|
||||
len = mb_char2bytes(key, string);
|
||||
|
||||
// Remove the SHIFT modifier for keys where it's already included,
|
||||
// e.g., '(', '!' and '*'.
|
||||
|
||||
@@ -906,7 +906,7 @@ do_highlight(
|
||||
while (*linep && !VIM_ISWHITE(*linep) && *linep != '=')
|
||||
++linep;
|
||||
vim_free(key);
|
||||
key = vim_strnsave_up(key_start, (int)(linep - key_start));
|
||||
key = vim_strnsave_up(key_start, linep - key_start);
|
||||
if (key == NULL)
|
||||
{
|
||||
error = TRUE;
|
||||
@@ -963,7 +963,7 @@ do_highlight(
|
||||
break;
|
||||
}
|
||||
vim_free(arg);
|
||||
arg = vim_strnsave(arg_start, (int)(linep - arg_start));
|
||||
arg = vim_strnsave(arg_start, linep - arg_start);
|
||||
if (arg == NULL)
|
||||
{
|
||||
error = TRUE;
|
||||
@@ -5003,7 +5003,7 @@ ex_match(exarg_T *eap)
|
||||
{
|
||||
p = skiptowhite(eap->arg);
|
||||
if (!eap->skip)
|
||||
g = vim_strnsave(eap->arg, (int)(p - eap->arg));
|
||||
g = vim_strnsave(eap->arg, p - eap->arg);
|
||||
p = skipwhite(p);
|
||||
if (*p == NUL)
|
||||
{
|
||||
|
||||
@@ -658,6 +658,11 @@ S_SvREFCNT_dec(pTHX_ SV *sv)
|
||||
}
|
||||
# endif
|
||||
|
||||
/* perl-5.32 needs Perl_SvREFCNT_dec */
|
||||
# if (PERL_REVISION == 5) && (PERL_VERSION >= 32)
|
||||
# define Perl_SvREFCNT_dec S_SvREFCNT_dec
|
||||
# endif
|
||||
|
||||
/* perl-5.26 also needs S_TOPMARK and S_POPMARK. */
|
||||
# if (PERL_REVISION == 5) && (PERL_VERSION >= 26)
|
||||
PERL_STATIC_INLINE I32
|
||||
@@ -682,6 +687,20 @@ S_POPMARK(pTHX)
|
||||
}
|
||||
# endif
|
||||
|
||||
/* perl-5.32 needs Perl_POPMARK */
|
||||
# if (PERL_REVISION == 5) && (PERL_VERSION >= 32)
|
||||
# define Perl_POPMARK S_POPMARK
|
||||
|
||||
/* perl-5.32 needs Perl_SvTRUE */
|
||||
PERL_STATIC_INLINE bool
|
||||
Perl_SvTRUE(pTHX_ SV *sv) {
|
||||
if (!LIKELY(sv))
|
||||
return FALSE;
|
||||
SvGETMAGIC(sv);
|
||||
return SvTRUE_nomg_NN(sv);
|
||||
}
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Make all runtime-links of perl.
|
||||
*
|
||||
@@ -1435,7 +1454,7 @@ PerlIOVim_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count)
|
||||
char_u *str;
|
||||
PerlIOVim * s = PerlIOSelf(f, PerlIOVim);
|
||||
|
||||
str = vim_strnsave((char_u *)vbuf, (int)count);
|
||||
str = vim_strnsave((char_u *)vbuf, count);
|
||||
if (str == NULL)
|
||||
return 0;
|
||||
msg_split((char_u *)str, s->attr);
|
||||
|
||||
@@ -1858,7 +1858,7 @@ ruby_convert_to_vim_value(VALUE val, typval_T *rettv)
|
||||
|
||||
rettv->v_type = VAR_STRING;
|
||||
rettv->vval.v_string = vim_strnsave((char_u *)RSTRING_PTR(str),
|
||||
(int)RSTRING_LEN(str));
|
||||
RSTRING_LEN(str));
|
||||
}
|
||||
break;
|
||||
case T_ARRAY:
|
||||
|
||||
@@ -1579,7 +1579,7 @@ ins_compl_bs(void)
|
||||
ins_compl_restart();
|
||||
|
||||
vim_free(compl_leader);
|
||||
compl_leader = vim_strnsave(line + compl_col, (int)(p - line) - compl_col);
|
||||
compl_leader = vim_strnsave(line + compl_col, (p - line) - compl_col);
|
||||
if (compl_leader != NULL)
|
||||
{
|
||||
ins_compl_new_leader();
|
||||
@@ -1706,7 +1706,7 @@ ins_compl_addleader(int c)
|
||||
{
|
||||
vim_free(compl_leader);
|
||||
compl_leader = vim_strnsave(ml_get_curline() + compl_col,
|
||||
(int)(curwin->w_cursor.col - compl_col));
|
||||
curwin->w_cursor.col - compl_col);
|
||||
if (compl_leader != NULL)
|
||||
ins_compl_new_leader();
|
||||
}
|
||||
|
||||
@@ -662,7 +662,7 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
|
||||
if (cur_item != NULL)
|
||||
{
|
||||
cur_item->v_type = VAR_STRING;
|
||||
cur_item->vval.v_string = vim_strnsave(key, (int)(p - key));
|
||||
cur_item->vval.v_string = vim_strnsave(key, p - key);
|
||||
top_item->jd_key = cur_item->vval.v_string;
|
||||
}
|
||||
reader->js_used += (int)(p - key);
|
||||
|
||||
@@ -280,6 +280,12 @@ static int erase_internal(VTermRect rect, int selective, void *user)
|
||||
for(col = rect.start_col; col < rect.end_col; col++) {
|
||||
ScreenCell *cell = getcell(screen, row, col);
|
||||
|
||||
if (cell == NULL)
|
||||
{
|
||||
DEBUG_LOG2("libvterm: erase_internal() position invalid: %d / %d",
|
||||
row, col);
|
||||
return 1;
|
||||
}
|
||||
if(selective && cell->pen.protected_cell)
|
||||
continue;
|
||||
|
||||
@@ -640,6 +646,12 @@ static int setlineinfo(int row, const VTermLineInfo *newinfo, const VTermLineInf
|
||||
newinfo->doubleheight != oldinfo->doubleheight) {
|
||||
for(col = 0; col < screen->cols; col++) {
|
||||
ScreenCell *cell = getcell(screen, row, col);
|
||||
if (cell == NULL)
|
||||
{
|
||||
DEBUG_LOG2("libvterm: setlineinfo() position invalid: %d / %d",
|
||||
row, col);
|
||||
return 1;
|
||||
}
|
||||
cell->pen.dwl = newinfo->doublewidth;
|
||||
cell->pen.dhl = newinfo->doubleheight;
|
||||
}
|
||||
@@ -767,6 +779,12 @@ static size_t _get_chars(const VTermScreen *screen, const int utf8, void *buffer
|
||||
ScreenCell *cell = getcell(screen, row, col);
|
||||
int i;
|
||||
|
||||
if (cell == NULL)
|
||||
{
|
||||
DEBUG_LOG2("libvterm: _get_chars() position invalid: %d / %d",
|
||||
row, col);
|
||||
return 1;
|
||||
}
|
||||
if(cell->chars[0] == 0)
|
||||
// Erased cell, might need a space
|
||||
padding++;
|
||||
|
||||
@@ -16,6 +16,7 @@ static int on_resize(int rows, int cols, void *user);
|
||||
static void putglyph(VTermState *state, const uint32_t chars[], int width, VTermPos pos)
|
||||
{
|
||||
VTermGlyphInfo info;
|
||||
|
||||
info.chars = chars;
|
||||
info.width = width;
|
||||
info.protected_cell = state->protected_cell;
|
||||
@@ -1845,8 +1846,12 @@ static int on_resize(int rows, int cols, void *user)
|
||||
|
||||
if(state->pos.row >= rows)
|
||||
state->pos.row = rows - 1;
|
||||
if(state->pos.row < 0)
|
||||
state->pos.row = 0;
|
||||
if(state->pos.col >= cols)
|
||||
state->pos.col = cols - 1;
|
||||
if(state->pos.col < 0)
|
||||
state->pos.col = 0;
|
||||
|
||||
updatecursor(state, &oldpos, 1);
|
||||
|
||||
|
||||
113
src/list.c
113
src/list.c
@@ -730,6 +730,99 @@ list_insert(list_T *l, listitem_T *ni, listitem_T *item)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Flatten "list" to depth "maxdepth".
|
||||
* It does nothing if "maxdepth" is 0.
|
||||
* Returns FAIL when out of memory.
|
||||
*/
|
||||
static int
|
||||
list_flatten(list_T *list, long maxdepth)
|
||||
{
|
||||
listitem_T *item;
|
||||
listitem_T *tofree;
|
||||
int n;
|
||||
|
||||
if (maxdepth == 0)
|
||||
return OK;
|
||||
CHECK_LIST_MATERIALIZE(list);
|
||||
|
||||
n = 0;
|
||||
item = list->lv_first;
|
||||
while (item != NULL)
|
||||
{
|
||||
fast_breakcheck();
|
||||
if (got_int)
|
||||
return FAIL;
|
||||
|
||||
if (item->li_tv.v_type == VAR_LIST)
|
||||
{
|
||||
listitem_T *next = item->li_next;
|
||||
|
||||
vimlist_remove(list, item, item);
|
||||
if (list_extend(list, item->li_tv.vval.v_list, next) == FAIL)
|
||||
return FAIL;
|
||||
clear_tv(&item->li_tv);
|
||||
tofree = item;
|
||||
|
||||
if (item->li_prev == NULL)
|
||||
item = list->lv_first;
|
||||
else
|
||||
item = item->li_prev->li_next;
|
||||
list_free_item(list, tofree);
|
||||
|
||||
if (++n >= maxdepth)
|
||||
{
|
||||
n = 0;
|
||||
item = next;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
n = 0;
|
||||
item = item->li_next;
|
||||
}
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* "flatten(list[, {maxdepth}])" function
|
||||
*/
|
||||
void
|
||||
f_flatten(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
list_T *l;
|
||||
long maxdepth;
|
||||
int error = FALSE;
|
||||
|
||||
if (argvars[0].v_type != VAR_LIST)
|
||||
{
|
||||
semsg(_(e_listarg), "flatten()");
|
||||
return;
|
||||
}
|
||||
|
||||
if (argvars[1].v_type == VAR_UNKNOWN)
|
||||
maxdepth = 999999;
|
||||
else
|
||||
{
|
||||
maxdepth = (long)tv_get_number_chk(&argvars[1], &error);
|
||||
if (error)
|
||||
return;
|
||||
if (maxdepth < 0)
|
||||
{
|
||||
emsg(_("E900: maxdepth must be non-negative number"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
l = argvars[0].vval.v_list;
|
||||
if (l != NULL && !var_check_lock(l->lv_lock,
|
||||
(char_u *)N_("flatten() argument"), TRUE)
|
||||
&& list_flatten(l, maxdepth) == OK)
|
||||
copy_tv(&argvars[0], rettv);
|
||||
}
|
||||
|
||||
/*
|
||||
* Extend "l1" with "l2".
|
||||
* If "bef" is NULL append at the end, otherwise insert before this item.
|
||||
@@ -775,6 +868,26 @@ list_concat(list_T *l1, list_T *l2, typval_T *tv)
|
||||
return list_extend(l, l2, NULL);
|
||||
}
|
||||
|
||||
list_T *
|
||||
list_slice(list_T *ol, long n1, long n2)
|
||||
{
|
||||
listitem_T *item;
|
||||
list_T *l = list_alloc();
|
||||
|
||||
if (l == NULL)
|
||||
return NULL;
|
||||
for (item = list_find(ol, n1); n1 <= n2; ++n1)
|
||||
{
|
||||
if (list_append_tv(l, &item->li_tv) == FAIL)
|
||||
{
|
||||
list_free(l);
|
||||
return NULL;
|
||||
}
|
||||
item = item->li_next;
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make a copy of list "orig". Shallow if "deep" is FALSE.
|
||||
* The refcount of the new list is set to 1.
|
||||
|
||||
@@ -93,6 +93,7 @@
|
||||
#define MB_ISUPPER(c) vim_isupper(c)
|
||||
#define MB_TOLOWER(c) vim_tolower(c)
|
||||
#define MB_TOUPPER(c) vim_toupper(c)
|
||||
#define MB_CASEFOLD(c) (enc_utf8 ? utf_fold(c) : MB_TOLOWER(c))
|
||||
|
||||
// Use our own isdigit() replacement, because on MS-Windows isdigit() returns
|
||||
// non-zero for superscript 1. Also avoids that isdigit() crashes for numbers
|
||||
|
||||
@@ -407,6 +407,10 @@ main
|
||||
init_highlight(TRUE, FALSE); // set the default highlight groups
|
||||
TIME_MSG("init highlight");
|
||||
|
||||
#if defined(FEAT_TERMRESPONSE)
|
||||
init_term_props(TRUE);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
// Set the break level after the terminal is initialized.
|
||||
debug_break_level = params.use_debug_break_level;
|
||||
@@ -793,7 +797,7 @@ vim_main2(void)
|
||||
|
||||
#if defined(FEAT_TERMRESPONSE)
|
||||
// Must be done before redrawing, puts a few characters on the screen.
|
||||
may_req_ambiguous_char_width();
|
||||
check_terminal_behavior();
|
||||
#endif
|
||||
|
||||
RedrawingDisabled = 0;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user