diff --git a/README_vim.md b/README_vim.md
index 0a985d4125..1cb89fc5e0 100644
--- a/README_vim.md
+++ b/README_vim.md
@@ -4,6 +4,12 @@
For translations of this README see the end.
+If you find a bug or want to discuss the best way to add a new feature, please
+open an [issue](https://github.com/vim/vim/issues).
+If you have a question or want to discuss the best way to do something with
+Vim, you can use [StackExchange](https://vi.stackexchange.com/)
+or one of the [Maillists](https://www.vim.org/community.php).
+
## What is Vim? ##
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 86ab622b95..588ab184ea 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -54,7 +54,7 @@ effects. Be careful not to destroy your text.
:au[tocmd] [group] {event} {pat} [++once] [++nested] {cmd}
Add {cmd} to the list of commands that Vim will
execute automatically on {event} for a file matching
- {pat} |autocmd-patterns|.
+ {pat} |autocmd-patterns|.
Here {event} cannot be "*". *E1155*
Note: A quote character is seen as argument to the
:autocmd and won't start a comment.
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index 7b31f9df3c..02e65fcfe6 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1,4 +1,4 @@
-*change.txt* For Vim version 8.2. Last change: 2021 Mar 01
+*change.txt* For Vim version 8.2. Last change: 2021 Jun 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1042,6 +1042,10 @@ inside of strings can change! Also see 'softtabstop' option. >
cursor to the end of line (which is more logical,
but not Vi-compatible) use ":map Y y$".
+ *zy*
+["x]zy{motion} Yank {motion} text [into register x]. Only differs
+ from `y` when selecting a block of text, see |v_zy|.
+
*v_y*
{Visual}["x]y Yank the highlighted text [into register x] (for
{Visual} see |Visual-mode|).
@@ -1050,6 +1054,12 @@ inside of strings can change! Also see 'softtabstop' option. >
{Visual}["x]Y Yank the highlighted lines [into register x] (for
{Visual} see |Visual-mode|).
+ *v_zy*
+{Visual}["x]zy Yank the highlighted text [into register x]. Trailing
+ whitespace at the end of each line of a selected block
+ won't be yanked. Especially useful in combination
+ with `zp`. (for {Visual} see |Visual-mode|)
+
*:y* *:yank* *E850*
:[range]y[ank] [x] Yank [range] lines [into register x]. Yanking to the
"* or "+ registers is possible only when the
@@ -1129,7 +1139,8 @@ inside of strings can change! Also see 'softtabstop' option. >
["x]zp or *zp* *zP*
["x]zP Like "p" and "P", except without adding trailing spaces
when pasting a block. Thus the inserted text will not
- always be a rectangle.
+ always be a rectangle. Especially useful in
+ combination with |v_zy|.
You can use these commands to copy text from one place to another. Do this
by first getting the text into a register with a yank, delete or change
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 0648980eef..09debc5058 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 8.2. Last change: 2021 May 07
+*eval.txt* For Vim version 8.2. Last change: 2021 Jun 07
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2102,7 +2102,7 @@ v:null An empty String. Used to put "null" in JSON. See
v:numbermax Maximum value of a number.
*v:numbermin* *numbermin-variable*
-v:numbermin Minimum value of a number (negative)
+v:numbermin Minimum value of a number (negative).
*v:numbersize* *numbersize-variable*
v:numbersize Number of bits in a Number. This is normally 64, but on some
@@ -2520,7 +2520,7 @@ char2nr({expr} [, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
charclass({string}) Number character class of {string}
charcol({expr}) Number column number of cursor or mark
charidx({string}, {idx} [, {countcc}])
- Number char index of byte {idx} in {string}
+ Number char index of byte {idx} in {string}
chdir({dir}) String change current working directory
cindent({lnum}) Number C indent for line {lnum}
clearmatches([{win}]) none clear all matches
@@ -2541,7 +2541,7 @@ cscope_connection([{num}, {dbpath} [, {prepend}]])
cursor({lnum}, {col} [, {off}])
Number move cursor to {lnum}, {col}, {off}
cursor({list}) Number move cursor to position in {list}
-debugbreak({pid}) Number interrupt process being debugged
+debugbreak({pid}) Number interrupt process being debugged
deepcopy({expr} [, {noref}]) any make a full copy of {expr}
delete({fname} [, {flags}]) Number delete the file or directory {fname}
deletebufline({expr}, {first} [, {last}])
@@ -4963,7 +4963,7 @@ funcref({name} [, {arglist}] [, {dict}])
Can also be used as a |method|: >
GetFuncname()->funcref([arg])
<
- *function()* *E700* *E922* *E923*
+ *function()* *partial* *E700* *E922* *E923*
function({name} [, {arglist}] [, {dict}])
Return a |Funcref| variable that refers to function {name}.
{name} can be the name of a user defined function or an
@@ -5512,8 +5512,8 @@ getcurpos([{winid}])
Can also be used as a |method|: >
GetWinid()->getcurpos()
-
-< *getcursorcharpos()*
+<
+ *getcursorcharpos()*
getcursorcharpos([{winid}])
Same as |getcurpos()| but the column number in the returned
List is a character index instead of a byte index.
@@ -5522,8 +5522,8 @@ getcursorcharpos([{winid}])
With the cursor on '보' in line 3 with text "여보세요": >
getcursorcharpos() returns [0, 3, 2, 0, 3]
getcurpos() returns [0, 3, 4, 0, 3]
-
-< Can also be used as a |method|: >
+<
+ Can also be used as a |method|: >
GetWinid()->getcursorcharpos()
< *getcwd()*
@@ -5748,11 +5748,11 @@ getmarklist([{expr}]) *getmarklist()*
see |bufname()|.
Each item in the returned List is a |Dict| with the following:
- name - name of the mark prefixed by "'"
- pos - a |List| with the position of the mark:
+ mark name of the mark prefixed by "'"
+ pos a |List| with the position of the mark:
[bufnum, lnum, col, off]
- Refer to |getpos()| for more information.
- file - file name
+ Refer to |getpos()| for more information.
+ file file name
Refer to |getpos()| for getting information about a specific
mark.
@@ -5834,7 +5834,7 @@ getpos({expr}) Get the position for {expr}. For possible values of {expr}
'> is a large number.
The column number in the returned List is the byte position
within the line. To get the character position in the line,
- use |getcharpos()|
+ use |getcharpos()|.
The column number can be very large, e.g. 2147483647, in which
case it means "after the end of the line".
This can be used to save and restore the position of a mark: >
@@ -7649,7 +7649,7 @@ matchfuzzypos({list}, {str} [, {dict}]) *matchfuzzypos()*
Same as |matchfuzzy()|, but returns the list of matched
strings, the list of character positions where characters
in {str} matches and a list of matching scores. You can
- use |byteidx()|to convert a character position to a byte
+ use |byteidx()| to convert a character position to a byte
position.
If {str} matches multiple times in a string, then only the
@@ -9973,7 +9973,7 @@ sinh({expr}) *sinh()*
{only available when compiled with the |+float| feature}
-slice({expr}, {start} [, {end}]) *slice()*
+slice({expr}, {start} [, {end}]) *slice()*
Similar to using a |slice| "expr[start : end]", but "end" is
used exclusive. And for a string the indexes are used as
character indexes instead of byte indexes, like in
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index 318507c16b..8295d67780 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -632,7 +632,7 @@ For fish, add to the config file
MARKDOWN *ft-markdown-plugin*
To enable folding use this: >
- let g:markdown_folding = 1
+ let g:markdown_folding = 1
<
PDF *ft-pdf-plugin*
diff --git a/runtime/doc/ft_raku.txt b/runtime/doc/ft_raku.txt
index 26ada8a140..8439de5727 100644
--- a/runtime/doc/ft_raku.txt
+++ b/runtime/doc/ft_raku.txt
@@ -45,7 +45,7 @@ Numbers, subscripts and superscripts are available with 's' and 'S':
1s ₁ 1S ¹ ~
2s ₂ 9S ⁹ ~
-But some don´t come defined by default. Those are digraph definitions you can
+But some don't come defined by default. Those are digraph definitions you can
add in your ~/.vimrc file. >
exec 'digraph \\ '.char2nr('∖')
exec 'digraph \< '.char2nr('≼')
diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt
index 628898eeed..44e95e9ac0 100644
--- a/runtime/doc/help.txt
+++ b/runtime/doc/help.txt
@@ -132,7 +132,7 @@ Advanced editing ~
|windows.txt| commands for using multiple windows and buffers
|tabpage.txt| commands for using multiple tab pages
|spell.txt| spell checking
-|diff.txt| working with two to four versions of the same file
+|diff.txt| working with two to eight versions of the same file
|autocmd.txt| automatically executing commands on an event
|eval.txt| expression evaluation, conditional commands
|channel.txt| Jobs, Channels, inter-process communication
@@ -145,6 +145,7 @@ Special issues ~
|term.txt| using different terminals and mice
|terminal.txt| Terminal window support
|popup.txt| popup window support
+|vim9.txt| using Vim9 script
Programming language support ~
|indent.txt| automatic indenting for C and other languages
@@ -153,6 +154,8 @@ Programming language support ~
|filetype.txt| settings done specifically for a type of file
|quickfix.txt| commands for a quick edit-compile-fix cycle
|ft_ada.txt| Ada (the programming language) support
+|ft_ps1.txt| Filetype plugin for Windows PowerShell
+|ft_raku.txt| Filetype plugin for Raku
|ft_rust.txt| Filetype plugin for Rust
|ft_sql.txt| about the SQL filetype plugin
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 3a5bc33c60..81606200f2 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -878,6 +878,7 @@ tag char note action in Normal mode ~
|zv| zv open enough folds to view the cursor line
|zw| zw permanently mark word as incorrectly spelled
|zx| zx re-apply 'foldlevel' and do "zv"
+|zy| zy yank without trailing spaces
|zz| zz redraw, cursor line at center of window
|z| z same as "zh"
|z| z same as "zl"
diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt
index 4dc0e2e28c..a8ae19c444 100644
--- a/runtime/doc/motion.txt
+++ b/runtime/doc/motion.txt
@@ -1,4 +1,4 @@
-*motion.txt* For Vim version 8.2. Last change: 2021 Mar 28
+*motion.txt* For Vim version 8.2. Last change: 2021 Jun 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -59,9 +59,14 @@ or change text. The following operators are available:
|<| < shift left
|zf| zf define a fold
|g@| g@ call function set with the 'operatorfunc' option
-
+ *motion-count-multiplied*
If the motion includes a count and the operator also had a count before it,
the two counts are multiplied. For example: "2d3w" deletes six words.
+ *operator-doubled*
+When doubling the operator it operates on a line. When using a count, before
+or after the first character, that many lines are operated upon. Thus `3dd`
+deletes three lines. A count before and after the first character is
+multiplied, thus `2y3y` yanks six lines.
After applying the operator the cursor is mostly left at the start of the text
that was operated upon. For example, "yfe" doesn't move the cursor, but "yFe"
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 2def1451b8..e5bc709905 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 8.2. Last change: 2021 May 16
+*options.txt* For Vim version 8.2. Last change: 2021 May 31
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/os_vms.txt b/runtime/doc/os_vms.txt
index 6eb2993bc7..0ebc774872 100644
--- a/runtime/doc/os_vms.txt
+++ b/runtime/doc/os_vms.txt
@@ -767,12 +767,12 @@ GNU_TOOLS.ZIP package downloadable from http://www.polarhome.com/vim/
Version 8.2
- make all changes needed for clean compile build of v8.2 on VMS on all platforms
-- fix the call mkdir bug (vicente_polo@yahoo.es)
+- fix the call mkdir bug (vicente_polo@yahoo.es)
- test on VSI OpenVMS Alpha and Itanium platforms
- added LUA support
- added XPM support - Motif GUI with toolbar on all platforms
-- XPM v3.4.11 libraries for IA64, AXP and VAX are added
-- start integrating the new test scripts
+- XPM v3.4.11 libraries for IA64, AXP and VAX are added
+- start integrating the new test scripts
Version 8.1
- make necessary changes to build v8.1 on VMS
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index 20fed5523c..c23fdb444a 100644
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -1217,7 +1217,7 @@ x A single character, with no special meaning, matches itself
\%d123 Matches the character specified with a decimal number. Must be
followed by a non-digit.
-\%o40 Matches the character specified with an octal number up to 0377.
+\%o40 Matches the character specified with an octal number up to 0o377.
Numbers below 0o40 must be followed by a non-octal digit or a
non-digit.
\%x2a Matches the character specified with up to two hexadecimal characters.
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
index b293d9b15f..421b12f60d 100644
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -3809,7 +3809,7 @@ netrw:
Decho.vim is provided as a "vimball"; see |vimball-intro|. You
should edit the Decho.vba.gz file and source it in: >
- vim Decho.vba.gz
+ vim Decho.vba.gz
:so %
:q
<
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index 18149fcf8f..c6b4b9e9f6 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -1,4 +1,4 @@
-*repeat.txt* For Vim version 8.2. Last change: 2021 May 08
+*repeat.txt* For Vim version 8.2. Last change: 2021 Jun 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -279,7 +279,9 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
ftdetect scripts are loaded, only the matching
directories are added to 'runtimepath'. This is
useful in your .vimrc. The plugins will then be
- loaded during initialization, see |load-plugins|.
+ loaded during initialization, see |load-plugins| (note
+ that the loading order will be reversed, because each
+ directory is inserted before others).
Note that for ftdetect scripts to be loaded
you will need to write `filetype plugin indent on`
AFTER all `packadd!` commands.
@@ -372,7 +374,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
for some commands.
See |:vim9cmd| for executing one command with Vim9
syntax and semantics.
-
+
*:scr* *:scriptnames*
:scr[iptnames] List all sourced script names, in the order they were
first sourced. The number is used for the script ID
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 6bfbcfc6c4..cb5c207e25 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -3430,8 +3430,8 @@ syntax highlighting script handles this with the following logic:
Tex: Match Check Control~
Sometimes one actually wants mismatched parentheses, square braces,
- and or curly braces; for example, \text{(1,10] is a range from but
- not including 1 to and including 10}. This wish, of course, conflicts
+ and or curly braces; for example, \text{(1,10]} is a range from but
+ not including 1 to and including 10. This wish, of course, conflicts
with the desire to provide delimiter mismatch detection. To
accommodate these conflicting goals, syntax/tex.vim provides >
g:tex_matchcheck = '[({[]'
@@ -4084,7 +4084,7 @@ match in the same position overrules an earlier one). The "transparent"
argument makes the "myVim" match use the same highlighting as "myString". But
it does not contain anything. If the "contains=NONE" argument would be left
out, then "myVim" would use the contains argument from myString and allow
-"myWord" to be contained, which will be highlighted as a Constant. This
+"myWord" to be contained, which will be highlighted as a Comment. This
happens because a contained match doesn't match inside itself in the same
position, thus the "myVim" match doesn't overrule the "myWord" match here.
@@ -4970,8 +4970,8 @@ ctermul={color-nr} *highlight-ctermul*
*tmux*
When using tmux you may want to use this in the tmux config: >
# tmux colors
- set -g default-terminal "xterm-256color"
- set -ag terminal-overrides ",xterm-256color:Tc"
+ set -s default-terminal "tmux-256color"
+ set -as terminal-overrides ",*-256color:Tc"
< More info at:
https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-a-256-colour-terminal
https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-rgb-colour
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 5b4f54aa19..5838022730 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -7091,6 +7091,7 @@ getchar() eval.txt /*getchar()*
getcharmod() eval.txt /*getcharmod()*
getcharpos() eval.txt /*getcharpos()*
getcharsearch() eval.txt /*getcharsearch()*
+getcharstr() eval.txt /*getcharstr()*
getcmdline() eval.txt /*getcmdline()*
getcmdpos() eval.txt /*getcmdpos()*
getcmdtype() eval.txt /*getcmdtype()*
@@ -8044,6 +8045,7 @@ moo.vim syntax.txt /*moo.vim*
more-compatible version5.txt /*more-compatible*
more-prompt message.txt /*more-prompt*
more-variables eval.txt /*more-variables*
+motion-count-multiplied motion.txt /*motion-count-multiplied*
motion.txt motion.txt /*motion.txt*
mouse-mode-table term.txt /*mouse-mode-table*
mouse-overview term.txt /*mouse-overview*
@@ -8494,6 +8496,7 @@ omni-sql-completion ft_sql.txt /*omni-sql-completion*
online-help helphelp.txt /*online-help*
opening-window windows.txt /*opening-window*
operator motion.txt /*operator*
+operator-doubled motion.txt /*operator-doubled*
operator-pending-index index.txt /*operator-pending-index*
operator-variable eval.txt /*operator-variable*
option-backslash options.txt /*option-backslash*
@@ -8548,6 +8551,7 @@ page_up intro.txt /*page_up*
pager message.txt /*pager*
papp.vim syntax.txt /*papp.vim*
paragraph motion.txt /*paragraph*
+partial eval.txt /*partial*
pascal.vim syntax.txt /*pascal.vim*
patches-8 version8.txt /*patches-8*
patches-8.1 version8.txt /*patches-8.1*
@@ -10214,6 +10218,7 @@ v_u change.txt /*v_u*
v_v visual.txt /*v_v*
v_x change.txt /*v_x*
v_y change.txt /*v_y*
+v_zy change.txt /*v_zy*
v_~ change.txt /*v_~*
vab motion.txt /*vab*
val-variable eval.txt /*val-variable*
@@ -10584,6 +10589,7 @@ zOS-PuTTY os_390.txt /*zOS-PuTTY*
zOS-has-ebcdic os_390.txt /*zOS-has-ebcdic*
zOS-limitations os_390.txt /*zOS-limitations*
zOS-open-source os_390.txt /*zOS-open-source*
+zP change.txt /*zP*
zR fold.txt /*zR*
zW spell.txt /*zW*
zX fold.txt /*zX*
@@ -10611,6 +10617,7 @@ zl scroll.txt /*zl*
zm fold.txt /*zm*
zn fold.txt /*zn*
zo fold.txt /*zo*
+zp change.txt /*zp*
zr fold.txt /*zr*
zs scroll.txt /*zs*
zsh.vim syntax.txt /*zsh.vim*
@@ -10622,6 +10629,7 @@ zuw spell.txt /*zuw*
zv fold.txt /*zv*
zw spell.txt /*zw*
zx fold.txt /*zx*
+zy change.txt /*zy*
zz scroll.txt /*zz*
{ motion.txt /*{*
{Visual} intro.txt /*{Visual}*
diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt
index 8eea4a59e7..811d507524 100644
--- a/runtime/doc/term.txt
+++ b/runtime/doc/term.txt
@@ -373,10 +373,10 @@ Added by Vim (there are no standard codes for these):
t_Ri restore icon text from stack *t_Ri* *'t_Ri'*
t_TE end of "raw" mode *t_TE* *'t_TE'*
t_TI put terminal into "raw" mode *t_TI* *'t_TI'*
- t_fd disable focus-event tracking *t_fd* *'t_fd'*
- |xterm-focus-event|
t_fe enable focus-event tracking *t_fe* *'t_fe'*
|xterm-focus-event|
+ t_fd disable focus-event tracking *t_fd* *'t_fd'*
+ |xterm-focus-event|
Some codes have a start, middle and end part. The start and end are defined
by the termcap option, the middle part is text.
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index b46c44094e..2c20ceaa44 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 8.2. Last change: 2021 May 28
+*todo.txt* For Vim version 8.2. Last change: 2021 Jun 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,57 +38,30 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------
-Geen memory leak?
-
-Crash using outer var from nested lambda:
- vim9script
- def F(text: string): func(string): func(string): string
- return (arg: string): func(string): string => ((sep: string): string => {
- return text .. ' ' .. arg
- })
- enddef
-
- echo F('hello')(' ')('there')
-
-
-
Vim9 - Make everything work:
-- function returning nothing should return void instead of zero
-- compile "expr" and "call" expression of a channel in channel_exe_cmd()?
-- Need some solution for dict function. Can we implement part of classes?
-- A lambda without {} does not require a return type, using { return x } does.
- That's unexpected, since the arguments are not required to have a type.
- alt 1: not require a return type, figure it out from the common type of all
- the return statements found
- alt 2: also require argument types
-- Using "windo echo expr" does not accept a line break inside "expr" (in a
- :def function and at script level in a not executed block). #7681
-- use CheckLegacyAndVim9Success(lines) in many more places
+- Make debugging work - at least per function.
+ - How to evaluate the stack and variables on the stack?
+ - FIXME in test_debugger.vim
- For builtin functions using tv_get_string*() use check_for_string() to be
more strict about the argument type (not a bool).
done: balloon_()
- Check many more builtin function arguments at compile time.
map() could check that the return type of the function argument matches
the type of the list or dict member. (#8092)
-- Allow for using an autoload function name without quotes. It is then loaded
- (and compiled) right away. #8124
-- Test more expressions in legacy and Vim9 script, using
- CheckLegacyAndVim9Success()
+ Same for other functions, such as searchpair().
+- use CheckLegacyAndVim9Success(lines) in many more places
- Test try/catch and throw better, also nested.
Test that return inside try/finally jumps to finally and then returns.
- Test that a function defined inside a :def function is local to that
function, g: functions can be defined and script-local functions cannot be
defined.
-- Make debugging work - at least per function. Need to recompile a function
- to step through it line-by-line? Evaluate the stack and variables on the
- stack?
-- Reserve command for future use: :type, :class, :enum
+- compile get_lambda_tv() in popup_add_timeout()
Once Vim9 is stable:
+- Add the "vim9script" feature, can use has('vim9script')
- Change the help to prefer Vim9 syntax where appropriate
- Add all the error numbers in a good place in documentation.
- In the generic eval docs, point out the Vim9 syntax where it differs.
-- Add the "vim9script" feature, can use has('vim9script')
- Use Vim9 for runtime files.
PR #7497 for autoload/ccomplete.vim
@@ -100,13 +73,12 @@ Further Vim9 improvements, possibly after launch:
Give an error if compilation fails. (#7625)
Use the location where the option was set for deciding whether it's to be
evaluated in Vim9 script context.
-- implement :type, import type declaration.
-- implement enum, import enum.
-- Future work: See |vim9-classes|
+- implement :type, "import type"
+- implement enum, "import enum".
+- implement class and interface: See |vim9-classes|
- For range: make table of first ASCII character with flag to quickly check if
it can be a Vim9 command. E.g. "+" can, but "." can't.
-- compile get_lambda_tv() in popup_add_timeout()
-- inline call to map() and filter()
+- Inline call to map() and filter(), better type checking.
- Make accessing varargs faster: arg[expr]
EVAL expr
LOADVARARG (varargs idx)
@@ -300,6 +272,9 @@ inconsistent with the documentation.
Making breakat support multibyte characters (Yasuhiro Matsumoto, #6598)
Scroll doesn't work correctly, why?
+glob() and globfile() do not always honor 'wildignorecase'. #8350
+globpath() does not use 'wildignorecase' at all?
+
Add 'termguiattr' option, use "gui=" attributes in the terminal? Would work
with 'termguicolors'. #1740
@@ -344,6 +319,9 @@ Should also work without any group:
:echo matchstr('aaa bbb', '.\{-1,}\>\|.*')
aaa bbb (should be aaa)
+Should add a match/str/list/pos method that also returns the test and position
+of submatches. #8355
+
Check out PR #543 (Roland Puntaier).
Patch for multibyte characters in langmap and applying a mapping on them.
(Christian Brabandt, 2015 Jun 12, update July 25)
@@ -380,6 +358,10 @@ work.
Using "au!" after "filetype on" is a bit slow. Can the matching of
autocommands be made faster? (#7056)
+Append in Visual block mode inserts the wrong character.
+Test_visual_block_mode() already has the proper check, which is commented out.
+(#8288)
+
Add the <=> (spaceship) operator and "cond ?< expr ?= expr ?> expr"
replace this:
let left = GetLeftFunc()
@@ -2263,9 +2245,6 @@ Win32: Improved Makefile for MSVC. (Leonardo Valeri Manera, 2010 Aug 18)
Win32: Expanding 'path' runs into a maximum size limit. (bgold12, 2009 Nov 15)
-Win32: Patch for enabling quick edit mode in console. (Craig Barkhouse, 2010
-Sep 1)
-
Win32: Patch for using .png files for icons. (Charles Peacech, 2012 Feb 5)
Putting a Visual block while 'visualedit' is "all" does not leave the cursor
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 0d66d2bb67..09d5a39db7 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -1,4 +1,4 @@
-*usr_41.txt* For Vim version 8.2. Last change: 2021 Apr 19
+*usr_41.txt* For Vim version 8.2. Last change: 2021 Jun 07
VIM USER MANUAL - by Bram Moolenaar
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index a0dc3a33f1..5820d2e18e 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -727,7 +727,7 @@ K Run a program to lookup the keyword under the
feature}
*:sl!* *:sleep!*
-:[N]sl[eep]! [N] [m] Same as above, but hide the cursor.
+:[N]sl[eep]! [N][m] Same as above, but hide the cursor.
*:xrestore* *:xr*
:xr[estore] [display] Reinitializes the connection to the X11 server. Useful
diff --git a/runtime/doc/vim.1 b/runtime/doc/vim.1
index 5bf0d05030..d55c8b3e85 100644
--- a/runtime/doc/vim.1
+++ b/runtime/doc/vim.1
@@ -186,7 +186,7 @@ behave mostly like Vi, even though a .vimrc file exists.
.TP
\-d
Start in diff mode.
-There should be two, three or four file name arguments.
+There should between two to eight file name arguments.
.B Vim
will open all the files and show differences between them.
Works like vimdiff(1).
diff --git a/runtime/doc/vim.man b/runtime/doc/vim.man
index 91f29e14e5..dbfba53cea 100644
--- a/runtime/doc/vim.man
+++ b/runtime/doc/vim.man
@@ -135,9 +135,9 @@ OPTIONS
Vim behave mostly like Vi, even though a .vimrc file ex‐
ists.
- -d Start in diff mode. There should be two, three or four
- file name arguments. Vim will open all the files and show
- differences between them. Works like vimdiff(1).
+ -d Start in diff mode. There should between two to eight file
+ name arguments. Vim will open all the files and show dif‐
+ ferences between them. Works like vimdiff(1).
-d {device} Open {device} for use as a terminal. Only on the Amiga.
Example: "-d con:20/30/600/150".
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt
index 6c2588271c..6ca1d74a99 100644
--- a/runtime/doc/vim9.txt
+++ b/runtime/doc/vim9.txt
@@ -1,4 +1,4 @@
-*vim9.txt* For Vim version 8.2. Last change: 2021 May 26
+*vim9.txt* For Vim version 8.2. Last change: 2021 Jun 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -169,6 +169,14 @@ created yet. In this case you can call `execute()` to invoke it at runtime. >
used for the command or inside a `:try` block), does not get a range passed
cannot be a "dict" function, and can always be a closure.
+Later classes will be added, which replaces the "dict function" mechanism.
+For now you will need to pass the dictionary explicitly: >
+ def DictFunc(d: dict, arg: string)
+ echo d[arg]
+ enddef
+ var d = {item: 'value', func: DictFunc}
+ d.func(d, 'item')
+
The argument types and return type need to be specified. The "any" type can
be used, type checking will then be done at runtime, like with legacy
functions.
@@ -445,11 +453,12 @@ it is the start of a lambda or a dictionary, which is now more complicated
because of the use of argument types.
To avoid these problems Vim9 script uses a different syntax for a lambda,
-which is similar to Javascript: >
+which is similar to JavaScript: >
var Lambda = (arg) => expression
No line break is allowed in the arguments of a lambda up to and including the
-"=>". This is OK: >
+"=>" (so that Vim can tell the difference between an expression in parenthesis
+and lambda arguments). This is OK: >
filter(list, (k, v) =>
v > 0)
This does not work: >
@@ -522,7 +531,7 @@ And when a dict spans multiple lines: >
one: 1,
two: 2,
}
-Function call: >
+With a function call: >
var result = Func(
arg1,
arg2
@@ -555,10 +564,31 @@ at the start of the line indicates line continuation: >
| echo 'match'
| endif
+Note that this means that in heredoc the first line cannot be a bar: >
+ var lines =<< trim END
+ | this doesn't work
+ END
+Either use an empty line at the start or do not use heredoc. Or temporarily
+add the "C" flag to 'cpoptions': >
+ set cpo+=C
+ var lines =<< trim END
+ | this doesn't work
+ END
+ set cpo-=C
+If the heredoc is inside a function 'cpoptions' must be set before :def and
+restored after the :enddef.
+
+In places where line continuation with a backslash is still needed, such as
+splitting up a long Ex command, comments can start with #\ instead of "\: >
+ syn region Text
+ \ start='foo'
+ #\ comment
+ \ end='bar'
+
< *E1050*
To make it possible for the operator at the start of the line to be
-recognized, it is required to put a colon before a range. This will add
-"start" and print: >
+recognized, it is required to put a colon before a range. This example will
+add "start" and print: >
var result = start
+ print
Like this: >
@@ -610,6 +640,9 @@ Notes:
< This does not work: >
echo [1, 2]
[3, 4]
+- In some cases it is difficult for Vim to parse a command, especially when
+ commands are used as an argument to another command, such as `windo`. In
+ those cases the line continuation with a backslash has to be used.
White space ~
@@ -966,9 +999,14 @@ prefix if they do not exist at the time of compiling.
Note that for command line completion of {func} you
can prepend "s:" to find script-local functions.
-:disa[ssemble]! {func} Like `:disassemble` but with the instructions used for
+:disa[ssemble] profile {func}
+ Like `:disassemble` but with the instructions used for
profiling.
+:disa[ssemble] debug {func}
+ Like `:disassemble` but with the instructions used for
+ debugging.
+
Limitations ~
Local variables will not be visible to string evaluation. For example: >
@@ -1240,9 +1278,10 @@ Exporting an item can be written as: >
export const someValue = ...
export def MyFunc() ...
export class MyClass ...
+ export interface MyClass ...
As this suggests, only constants, variables, `:def` functions and classes can
-be exported. {not implemented yet: export class}
+be exported. {not implemented yet: class, interface}
*E1042*
`:export` can only be used in Vim9 script, at the script level.
@@ -1342,27 +1381,46 @@ implementing classes is going to be a lot of work, it is left for the future.
For now we'll just make sure classes can be added later.
Thoughts:
-- `class` / `endclass`, everything in one file
-- Class names are always CamelCase
-- Single constructor
+- `class` / `endclass`, the whole class must be in one file
+- Class names are always CamelCase (to avoid a name clash with builtin types)
+- A single constructor called "constructor"
- Single inheritance with `class ThisClass extends BaseClass`
-- `abstract class`
-- `interface` (Abstract class without any implementation)
+- `abstract class` (class with incomplete implementation)
+- `interface` / `endinterface` (abstract class without any implementation)
- `class SomeClass implements SomeInterface`
- Generics for class: `class `
- Generics for function: `def GetLast(key: Tkey)`
-Again, much of this is from TypeScript.
+Again, much of this is from TypeScript with a slightly different syntax.
Some things that look like good additions:
- Use a class as an interface (like Dart)
- Extend a class with methods, using an import (like Dart)
+- Mixins
+- For testing: Mock mechanism
An important class that will be provided is "Promise". Since Vim is single
threaded, connecting asynchronous operations is a natural way of allowing
plugins to do their work without blocking the user. It's a uniform way to
invoke callbacks and handle timeouts and errors.
+Some examples: >
+
+ abstract class Person
+ static const prefix = 'xxx'
+ var name: string
+
+ def constructor(name: string)
+ this.name = name;
+ enddef
+
+ def display(): void
+ echo name
+ enddef
+
+ abstract def find(string): Person
+ endclass
+
==============================================================================
9. Rationale *vim9-rationale*
diff --git a/runtime/doc/vimdiff.1 b/runtime/doc/vimdiff.1
index bed2b32889..ddcb30f1ca 100644
--- a/runtime/doc/vimdiff.1
+++ b/runtime/doc/vimdiff.1
@@ -1,17 +1,17 @@
.TH VIMDIFF 1 "2001 March 30"
.SH NAME
-vimdiff \- edit two, three or four versions of a file with Vim and show differences
+vimdiff \- edit between two and eight versions of a file with Vim and show differences
.SH SYNOPSIS
.br
.B vimdiff
-[options] file1 file2 [file3 [file4]]
+[options] file1 file2 [file3 [file4 [file5 [file6 [file7 [file8]]]]]]
.PP
.B gvimdiff
.SH DESCRIPTION
.B Vimdiff
starts
.B Vim
-on two (or three or four) files.
+on two up to eight files.
Each file gets its own window.
The differences between the files are highlighted.
This is a nice way to inspect changes and to move changes from one version
diff --git a/runtime/doc/vimdiff.man b/runtime/doc/vimdiff.man
index 913ac13847..a053e6a742 100644
--- a/runtime/doc/vimdiff.man
+++ b/runtime/doc/vimdiff.man
@@ -1,27 +1,28 @@
-VIMDIFF(1) VIMDIFF(1)
+VIMDIFF(1) General Commands Manual VIMDIFF(1)
NAME
- vimdiff - edit two, three or four versions of a file with Vim and show
- differences
+ vimdiff - edit between two and eight versions of a file with Vim and
+ show differences
SYNOPSIS
- vimdiff [options] file1 file2 [file3 [file4]]
+ vimdiff [options] file1 file2 [file3 [file4 [file5 [file6 [file7
+ [file8]]]]]]
gvimdiff
DESCRIPTION
- Vimdiff starts Vim on two (or three or four) files. Each file gets its
- own window. The differences between the files are highlighted. This
- is a nice way to inspect changes and to move changes from one version
- to another version of the same file.
+ Vimdiff starts Vim on two up to eight files. Each file gets its own
+ window. The differences between the files are highlighted. This is a
+ nice way to inspect changes and to move changes from one version to an‐
+ other version of the same file.
See vim(1) for details about Vim itself.
When started as gvimdiff the GUI will be started, if available.
- In each window the 'diff' option will be set, which causes the differ-
+ In each window the 'diff' option will be set, which causes the differ‐
ences to be highlighted.
The 'wrap' and 'scrollbind' options are set to make the text look good.
The 'foldmethod' option is set to "diff", which puts ranges of lines
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 8ca6f6a77b..04e2001176 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar
-" Last Change: 2021 Apr 17
+" Last Change: 2021 Jun 13
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -855,6 +855,9 @@ au BufNewFile,BufRead *.jov,*.j73,*.jovial setf jovial
" JSON
au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest setf json
+" Jupyter Notebook is also json
+au BufNewFile,BufRead *.ipynb setf json
+
" Kixtart
au BufNewFile,BufRead *.kix setf kix
diff --git a/runtime/gvim.desktop b/runtime/gvim.desktop
index 3132bc861d..8da62cac4e 100644
--- a/runtime/gvim.desktop
+++ b/runtime/gvim.desktop
@@ -112,6 +112,7 @@ Icon[de]=gvim
Icon[eo]=gvim
Icon[fr]=gvim
Icon[ru]=gvim
+Icon[sr]=gvim
Icon=gvim
Categories=Utility;TextEditor;
StartupNotify=true
diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim
index 7019bd4a82..d4b91f6421 100644
--- a/runtime/indent/html.vim
+++ b/runtime/indent/html.vim
@@ -1,7 +1,7 @@
" Vim indent script for HTML
" Maintainer: Bram Moolenaar
" Original Author: Andy Wokula
-" Last Change: 2021 Jan 26
+" Last Change: 2021 Jun 13
" Version: 1.0 "{{{
" Description: HTML indent script with cached state for faster indenting on a
" range of lines.
@@ -62,7 +62,7 @@ let s:tagname = '\w\+\(-\w\+\)*'
" Prefer using buffer-local settings over global settings, so that there can
" be defaults for all HTML files and exceptions for specific types of HTML
" files.
-func! HtmlIndent_CheckUserSettings()
+func HtmlIndent_CheckUserSettings()
"{{{
let inctags = ''
if exists("b:html_indent_inctags")
@@ -178,7 +178,7 @@ let s:endtags = [0,0,0,0,0,0,0] " long enough for the highest index
"}}}
" Add a list of tag names for a pair of to "tags".
-func! s:AddITags(tags, taglist)
+func s:AddITags(tags, taglist)
"{{{
for itag in a:taglist
let a:tags[itag] = 1
@@ -187,7 +187,7 @@ func! s:AddITags(tags, taglist)
endfunc "}}}
" Take a list of tag name pairs that are not to be used as tag pairs.
-func! s:RemoveITags(tags, taglist)
+func s:RemoveITags(tags, taglist)
"{{{
for itag in a:taglist
let a:tags[itag] = 1
@@ -196,7 +196,7 @@ func! s:RemoveITags(tags, taglist)
endfunc "}}}
" Add a block tag, that is a tag with a different kind of indenting.
-func! s:AddBlockTag(tag, id, ...)
+func s:AddBlockTag(tag, id, ...)
"{{{
if !(a:id >= 2 && a:id < len(s:endtags))
echoerr 'AddBlockTag ' . a:id
@@ -255,7 +255,7 @@ call s:AddBlockTag('')
" Return non-zero when "tagname" is an opening tag, not being a block tag, for
" which there should be a closing tag. Can be used by scripts that include
" HTML indenting.
-func! HtmlIndent_IsOpenTag(tagname)
+func HtmlIndent_IsOpenTag(tagname)
"{{{
if get(s:indent_tags, a:tagname) == 1
return 1
@@ -264,7 +264,7 @@ func! HtmlIndent_IsOpenTag(tagname)
endfunc "}}}
" Get the value for "tagname", taking care of buffer-local tags.
-func! s:get_tag(tagname)
+func s:get_tag(tagname)
"{{{
let i = get(s:indent_tags, a:tagname)
if (i == 1 || i == -1) && get(b:hi_removed_tags, a:tagname) != 0
@@ -277,7 +277,7 @@ func! s:get_tag(tagname)
endfunc "}}}
" Count the number of start and end tags in "text".
-func! s:CountITags(text)
+func s:CountITags(text)
"{{{
" Store the result in s:curind and s:nextrel.
let s:curind = 0 " relative indent steps for current line [unit &sw]:
@@ -289,7 +289,7 @@ func! s:CountITags(text)
endfunc "}}}
" Count the number of start and end tags in text.
-func! s:CountTagsAndState(text)
+func s:CountTagsAndState(text)
"{{{
" Store the result in s:curind and s:nextrel. Update b:hi_newstate.block.
let s:curind = 0 " relative indent steps for current line [unit &sw]:
@@ -304,7 +304,7 @@ func! s:CountTagsAndState(text)
endfunc "}}}
" Used by s:CountITags() and s:CountTagsAndState().
-func! s:CheckTag(itag)
+func s:CheckTag(itag)
"{{{
" Returns an empty string or "SCRIPT".
" a:itag can be "tag" or "/tag" or ""
@@ -338,7 +338,7 @@ func! s:CheckTag(itag)
endfunc "}}}
" Used by s:CheckTag(). Returns an empty string or "SCRIPT".
-func! s:CheckBlockTag(blocktag, ind)
+func s:CheckBlockTag(blocktag, ind)
"{{{
if a:ind > 0
" a block starts here
@@ -366,7 +366,7 @@ func! s:CheckBlockTag(blocktag, ind)
endfunc "}}}
" Used by s:CheckTag().
-func! s:CheckCustomTag(ctag)
+func s:CheckCustomTag(ctag)
"{{{
" Returns 1 if ctag is the tag for a custom element, 0 otherwise.
" a:ctag can be "tag" or "/tag" or ""
@@ -396,7 +396,7 @@ func! s:CheckCustomTag(ctag)
endfunc "}}}
" Return the