Update runtime files

This commit is contained in:
Bram Moolenaar
2020-04-10 22:10:56 +02:00
parent 7b293c730b
commit d1caa941d8
24 changed files with 187 additions and 88 deletions

View File

@ -1,7 +1,7 @@
" Vim completion script " Vim completion script
" Language: C " Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2018 Aug 20 " Last Change: 2020 Apr 08
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo&vim set cpo&vim
@ -635,3 +635,5 @@ endfunc
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save
" vim: noet sw=2 sts=2

View File

@ -1,7 +1,7 @@
" Vim functions for file type detection " Vim functions for file type detection
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2020 Jan 02 " Last Change: 2020 Mar 30
" These functions are moved here from runtime/filetype.vim to make startup " These functions are moved here from runtime/filetype.vim to make startup
" faster. " faster.
@ -325,7 +325,7 @@ endfunc
func dist#ft#FTmm() func dist#ft#FTmm()
let n = 1 let n = 1
while n < 10 while n < 20
let line = getline(n) let line = getline(n)
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)' if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)'
setf objcpp setf objcpp

View File

@ -1458,7 +1458,7 @@ text. Put it in your autoload directory, e.g. ~/.vim/autoload/format.vim: >
func! format#Format() func! format#Format()
" only reformat on explicit gq command " only reformat on explicit gq command
if mode() != 'n' if mode() != 'n'
" fall back to Vims internal reformatting " fall back to Vim's internal reformatting
return 1 return 1
endif endif
let lines = getline(v:lnum, v:lnum + v:count - 1) let lines = getline(v:lnum, v:lnum + v:count - 1)

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.2. Last change: 2020 Mar 26 *eval.txt* For Vim version 8.2. Last change: 2020 Apr 08
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -5137,10 +5137,11 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
< <
*getcurpos()* *getcurpos()*
getcurpos() Get the position of the cursor. This is like getpos('.'), but getcurpos() Get the position of the cursor. This is like getpos('.'), but
includes an extra item in the list: includes an extra "curswant" item in the list:
[bufnum, lnum, col, off, curswant] ~ [0, lnum, col, off, curswant] ~
The "curswant" number is the preferred column when moving the The "curswant" number is the preferred column when moving the
cursor vertically. Also see |getpos()|. cursor vertically. Also see |getpos()|.
The first "bufnum" item is always zero.
This can be used to save and restore the cursor position: > This can be used to save and restore the cursor position: >
let save_cursor = getcurpos() let save_cursor = getcurpos()
@ -8917,18 +8918,10 @@ settagstack({nr}, {dict} [, {action}]) *settagstack()*
Returns zero for success, -1 for failure. Returns zero for success, -1 for failure.
Examples: Examples (for more examples see |tagstack-examples||):
Set current index of the tag stack to 4: > Empty the tag stack of window 3: >
call settagstack(1005, {'curidx' : 4})
< Empty the tag stack of window 3: >
call settagstack(3, {'items' : []}) call settagstack(3, {'items' : []})
< Push a new item onto the tag stack: >
let pos = [bufnr('myfile.txt'), 10, 1, 0]
let newtag = [{'tagname' : 'mytag', 'from' : pos}]
call settagstack(2, {'items' : newtag}, 'a')
< Save and restore the tag stack: > < Save and restore the tag stack: >
let stack = gettagstack(1003) let stack = gettagstack(1003)
" do something else " do something else
@ -10876,6 +10869,7 @@ hpux HP-UX version of Vim.
iconv Can use iconv() for conversion. iconv Can use iconv() for conversion.
insert_expand Compiled with support for CTRL-X expansion commands in insert_expand Compiled with support for CTRL-X expansion commands in
Insert mode. (always true) Insert mode. (always true)
job Compiled with support for |channel| and |job|
jumplist Compiled with |jumplist| support. jumplist Compiled with |jumplist| support.
keymap Compiled with 'keymap' support. keymap Compiled with 'keymap' support.
lambda Compiled with |lambda| support. lambda Compiled with |lambda| support.
@ -11240,8 +11234,8 @@ It is allowed to define another function inside a function body.
You can provide default values for positional named arguments. This makes You can provide default values for positional named arguments. This makes
them optional for function calls. When a positional argument is not them optional for function calls. When a positional argument is not
specified at a call, the default expression is used to initialize it. specified at a call, the default expression is used to initialize it.
This only works for functions declared with `:function`, not for lambda This only works for functions declared with `:function` or `:def`, not for
expressions |expr-lambda|. lambda expressions |expr-lambda|.
Example: > Example: >
function Something(key, value = 10) function Something(key, value = 10)
@ -11279,9 +11273,10 @@ Example that does NOT work: >
:function NoGood(first = a:second, second = 10) :function NoGood(first = a:second, second = 10)
:endfunction :endfunction
< <
When not using "...", the number of arguments in a function call must be equal When not using "...", the number of arguments in a function call must be at
to the number of mandatory named arguments. When using "...", the number of least equal to the number of mandatory named arguments. When using "...", the
arguments may be larger. number of arguments may be larger than the total of mandatory and optional
arguments.
*local-variables* *local-variables*
Inside a function local variables can be used. These will disappear when the Inside a function local variables can be used. These will disappear when the
@ -11638,7 +11633,7 @@ This does NOT work: >
Like above, but append/add/subtract the value for each Like above, but append/add/subtract the value for each
|List| item. |List| item.
:let [{name}, ..., ; {lastname}] = {expr1} :let [{name}, ..., ; {lastname}] = {expr1} *E452*
Like |:let-unpack| above, but the |List| may have more Like |:let-unpack| above, but the |List| may have more
items than there are names. A list of the remaining items than there are names. A list of the remaining
items is assigned to {lastname}. If there are no items is assigned to {lastname}. If there are no

View File

@ -199,7 +199,7 @@ With..." menu. This means you can use Vim to edit many files. Not every file
One reason to add this is to be able to edit HTML files directly from Internet One reason to add this is to be able to edit HTML files directly from Internet
Explorer. To enable this use the "Tools" menu, "Internet Options..." entry. Explorer. To enable this use the "Tools" menu, "Internet Options..." entry.
In the dialog select the "Programs" tab and select Vim in the "HTML editor" In the dialog select the "Programs" tab and select Vim in the "HTML editor"
choice. If it's not there than installing didn't work properly. choice. If it's not there then installing didn't work properly.
Doing this manually can be done with this script: Doing this manually can be done with this script:

View File

@ -1,4 +1,4 @@
*help.txt* For Vim version 8.2. Last change: 2019 Jul 21 *help.txt* For Vim version 8.2. Last change: 2020 Apr 05
VIM - main help file VIM - main help file
k k
@ -31,7 +31,7 @@ Get specific help: It is possible to go directly to whatever you want help
help entries for "word". help entries for "word".
Or use ":helpgrep word". |:helpgrep| Or use ":helpgrep word". |:helpgrep|
Getting started: Do the Vim tutor, a 20 minute interactive training for the Getting started: Do the Vim tutor, a 30-minute interactive course for the
basic commands, see |vimtutor|. basic commands, see |vimtutor|.
Read the user manual from start to end: |usr_01.txt| Read the user manual from start to end: |usr_01.txt|
@ -41,7 +41,7 @@ through the help of many others. See |credits|.
*doc-file-list* *Q_ct* *doc-file-list* *Q_ct*
BASIC: BASIC:
|quickref| Overview of the most common commands you will use |quickref| Overview of the most common commands you will use
|tutor| 20 minutes training course for beginners |tutor| 30-minute interactive course for beginners
|copying| About copyrights |copying| About copyrights
|iccf| Helping poor children in Uganda |iccf| Helping poor children in Uganda
|sponsor| Sponsor Vim development, become a registered Vim user |sponsor| Sponsor Vim development, become a registered Vim user
@ -144,7 +144,7 @@ Special issues ~
|remote.txt| using Vim as a server or client |remote.txt| using Vim as a server or client
|term.txt| using different terminals and mice |term.txt| using different terminals and mice
|terminal.txt| Terminal window support |terminal.txt| Terminal window support
|popup.txt| popop window support |popup.txt| popup window support
Programming language support ~ Programming language support ~
|indent.txt| automatic indenting for C and other languages |indent.txt| automatic indenting for C and other languages

View File

@ -154,6 +154,8 @@ CTRL-R CTRL-R {register} *i_CTRL-R_CTRL-R*
you also want to avoid these, use CTRL-R CTRL-O, see below. you also want to avoid these, use CTRL-R CTRL-O, see below.
The '.' register (last inserted text) is still inserted as The '.' register (last inserted text) is still inserted as
typed. typed.
After this command, the '.' register contains the text from
the register as if it was inserted by typing it.
CTRL-R CTRL-O {register} *i_CTRL-R_CTRL-O* CTRL-R CTRL-O {register} *i_CTRL-R_CTRL-O*
Insert the contents of a register literally and don't Insert the contents of a register literally and don't
@ -163,6 +165,9 @@ CTRL-R CTRL-O {register} *i_CTRL-R_CTRL-O*
Does not replace characters! Does not replace characters!
The '.' register (last inserted text) is still inserted as The '.' register (last inserted text) is still inserted as
typed. typed.
After this command, the '.' register contains the command
typed and not the text. I.e., the literals "^R^O" and not the
text from the register.
CTRL-R CTRL-P {register} *i_CTRL-R_CTRL-P* CTRL-R CTRL-P {register} *i_CTRL-R_CTRL-P*
Insert the contents of a register literally and fix the Insert the contents of a register literally and fix the
@ -170,6 +175,9 @@ CTRL-R CTRL-P {register} *i_CTRL-R_CTRL-P*
Does not replace characters! Does not replace characters!
The '.' register (last inserted text) is still inserted as The '.' register (last inserted text) is still inserted as
typed. typed.
After this command, the '.' register contains the command
typed and not the text. I.e., the literals "^R^P" and not the
text from the register.
*i_CTRL-T* *i_CTRL-T*
CTRL-T Insert one shiftwidth of indent at the start of the current CTRL-T Insert one shiftwidth of indent at the start of the current

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 8.2. Last change: 2020 Mar 02 *options.txt* For Vim version 8.2. Last change: 2020 Apr 10
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -7957,7 +7957,7 @@ A jump table for the options with a short description can be found at |Q_op|.
- VIM the server name |v:servername| or "VIM" - VIM the server name |v:servername| or "VIM"
Only works if the terminal supports setting window titles Only works if the terminal supports setting window titles
(currently Amiga console, Win32 console, all GUI versions and (currently Amiga console, Win32 console, all GUI versions and
terminals with a non- empty 't_ts' option - these are Unix xterm and terminals with a non-empty 't_ts' option - these are Unix xterm and
iris-ansi by default, where 't_ts' is taken from the builtin termcap). iris-ansi by default, where 't_ts' is taken from the builtin termcap).
*X11* *X11*
When Vim was compiled with HAVE_X11 defined, the original title will When Vim was compiled with HAVE_X11 defined, the original title will

View File

@ -138,7 +138,7 @@ and merge it back in.
6. The $VIM directory *beos-vimdir* 6. The $VIM directory *beos-vimdir*
$VIM is the symbolic name for the place where Vims support files are stored. $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 > The default value for $VIM is set at compile time and can be determined with >
:version :version

View File

@ -88,7 +88,7 @@ Stuff that does not work yet:
4. The $VIM directory *haiku-vimdir* 4. The $VIM directory *haiku-vimdir*
$VIM is the symbolic name for the place where Vims support files are stored. $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 > The default value for $VIM is set at compile time and can be determined with >
:version :version

View File

@ -4244,6 +4244,7 @@ E447 editing.txt /*E447*
E448 various.txt /*E448* E448 various.txt /*E448*
E449 eval.txt /*E449* E449 eval.txt /*E449*
E45 message.txt /*E45* E45 message.txt /*E45*
E452 eval.txt /*E452*
E455 print.txt /*E455* E455 print.txt /*E455*
E456 print.txt /*E456* E456 print.txt /*E456*
E457 print.txt /*E457* E457 print.txt /*E457*
@ -9348,6 +9349,7 @@ tags-file-format tagsrch.txt /*tags-file-format*
tags-option tagsrch.txt /*tags-option* tags-option tagsrch.txt /*tags-option*
tagsrch.txt tagsrch.txt /*tagsrch.txt* tagsrch.txt tagsrch.txt /*tagsrch.txt*
tagstack tagsrch.txt /*tagstack* tagstack tagsrch.txt /*tagstack*
tagstack-examples tagsrch.txt /*tagstack-examples*
tan() eval.txt /*tan()* tan() eval.txt /*tan()*
tanh() eval.txt /*tanh()* tanh() eval.txt /*tanh()*
tar pi_tar.txt /*tar* tar pi_tar.txt /*tar*
@ -9503,6 +9505,7 @@ test_ignore_error() testing.txt /*test_ignore_error()*
test_null_blob() testing.txt /*test_null_blob()* test_null_blob() testing.txt /*test_null_blob()*
test_null_channel() testing.txt /*test_null_channel()* test_null_channel() testing.txt /*test_null_channel()*
test_null_dict() testing.txt /*test_null_dict()* test_null_dict() testing.txt /*test_null_dict()*
test_null_function() testing.txt /*test_null_function()*
test_null_job() testing.txt /*test_null_job()* test_null_job() testing.txt /*test_null_job()*
test_null_list() testing.txt /*test_null_list()* test_null_list() testing.txt /*test_null_list()*
test_null_partial() testing.txt /*test_null_partial()* test_null_partial() testing.txt /*test_null_partial()*

View File

@ -1,4 +1,4 @@
*tagsrch.txt* For Vim version 8.2. Last change: 2020 Jan 30 *tagsrch.txt* For Vim version 8.2. Last change: 2020 Apr 03
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -185,6 +185,29 @@ commands explained above the tag stack will look like this:
The |gettagstack()| function returns the tag stack of a specified window. The The |gettagstack()| function returns the tag stack of a specified window. The
|settagstack()| function modifies the tag stack of a window. |settagstack()| function modifies the tag stack of a window.
*tagstack-examples*
Write to the tag stack just like `:tag` but with a user-defined
jumper#jump_to_tag function: >
" Store where we're jumping from before we jump.
let tag = expand('<cword>')
let pos = [bufnr()] + getcurpos()[1:]
let item = {'bufnr': pos[0], 'from': pos, 'tagname': tag}
if jumper#jump_to_tag(tag)
" Jump was successful, write previous location to tag stack.
let winid = win_getid()
let stack = gettagstack(winid)
let stack['items'] = [item]
call settagstack(winid, stack, 't')
endif
<
Set current index of the tag stack to 4: >
call settagstack(1005, {'curidx' : 4})
<
Push a new item onto the tag stack: >
let pos = [bufnr('myfile.txt'), 10, 1, 0]
let newtag = [{'tagname' : 'mytag', 'from' : pos}]
call settagstack(2, {'items' : newtag}, 'a')
<
*E73* *E73*
When you try to use the tag stack while it doesn't contain anything you will When you try to use the tag stack while it doesn't contain anything you will
get an error message. get an error message.

View File

@ -960,7 +960,7 @@ Currently supported commands:
directory, thus it's best to use the full path. directory, thus it's best to use the full path.
[options] is only used when opening a new window. If present, [options] is only used when opening a new window. If present,
it must be a Dict. Similarly to |++opt|, These entries are it must be a Dict. Similarly to |++opt|, these entries are
recognized: recognized:
"ff" file format: "dos", "mac" or "unix" "ff" file format: "dos", "mac" or "unix"
"fileformat" idem "fileformat" idem

View File

@ -1,4 +1,4 @@
*testing.txt* For Vim version 8.2. Last change: 2020 Feb 22 *testing.txt* For Vim version 8.2. Last change: 2020 Apr 10
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -107,7 +107,7 @@ test_null_dict() *test_null_dict()*
test_null_function() *test_null_function()* test_null_function() *test_null_function()*
Return a |FuncRef| that is null. Only useful for testing. Return a |Funcref| that is null. Only useful for testing.
test_null_job() *test_null_job()* test_null_job() *test_null_job()*

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.2. Last change: 2020 Mar 27 *todo.txt* For Vim version 8.2. Last change: 2020 Apr 10
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -39,9 +39,19 @@ browser use: https://github.com/vim/vim/issues/1234
-------------------- Known bugs and current work ----------------------- -------------------- Known bugs and current work -----------------------
Vim9 script: Vim9 script:
func and partial types:
- check using func type with default arguments and varargs.
func(type, type?, ...): rettype
- Type checking arguments when calling :def function and test
- Calling unknown user function does not give proper error message:
assert_equal('123text', RefDef2Arg()) typo for "RetDef2Arg"
- "func" inside "vim9script" doesn't work? (Ben Jackson, #5670) - "func" inside "vim9script" doesn't work? (Ben Jackson, #5670)
- "let x = x + 1" should say that "x" is not defined (declare local after - :func inside vim9script must still use a:arg
evaluating expresion). - define function and create funcref in one step:
let ref = def(arg: type): rettype
body
enddef
Also:
- "echo Func()" is an error if Func() does not return anything. - "echo Func()" is an error if Func() does not return anything.
- better implementation for partial and tests for that. - better implementation for partial and tests for that.
- Make "g:imported = Export.exported" work in Vim9 script. - Make "g:imported = Export.exported" work in Vim9 script.
@ -50,7 +60,6 @@ Vim9 script:
- Disallow unlet for local/script/imported vars - Disallow unlet for local/script/imported vars
- Support type for ":let"/":const" at script level for Vim9 script. - Support type for ":let"/":const" at script level for Vim9 script.
(Ben Jackson, #5671) (Ben Jackson, #5671)
- :func inside vim9script must still use a:arg
- Make "++nr" work. - Make "++nr" work.
- Check that import in legacy script works and puts item in s: - Check that import in legacy script works and puts item in s:
- Error in any command in "vim9script" aborts sourcing. - Error in any command in "vim9script" aborts sourcing.
@ -60,23 +69,19 @@ Vim9 script:
- Test try/catch and throw better, also nested. - Test try/catch and throw better, also nested.
Test return inside try/finally jumps to finally and then returns. Test return inside try/finally jumps to finally and then returns.
- call autoload function. - call autoload function.
- Type checking arguments when calling :def function
- Implement more expressions, e.g. [a:b] - Implement more expressions, e.g. [a:b]
- can use func as reference: - can use func as reference:
def SomeFunc() ... def SomeFunc() ...
map(list, SomeFunc) map(list, SomeFunc)
- define function and create funcref in one step:
let ref = def(arg: type): rettype
Also extends lambda
- Test: Function declared inside a :def function is local, disappears at the - Test: Function declared inside a :def function is local, disappears at the
end of the function. Unless g: is used, just like with variables. end of the function. Unless g: is used, just like with variables.
- Can we omit \ for line continuation inside (), {}, ? - Can we omit \ for line continuation inside (), {}, ?
Requires parsing while reading a function. Like fgetline in do_one_cmd()? Requires parsing while reading a function. Like fgetline in do_one_cmd()?
- implement :type - implement :type
- import type declaration?
- implement class - implement class
- implement interface - implement interface
- predefined class: Promise<T> - predefined class: Promise<T>
- import statement for type declaration?
- Make accessing varargs faster: arg[expr] - Make accessing varargs faster: arg[expr]
EVAL expr EVAL expr
LOADVARARG (varags idx) LOADVARARG (varags idx)
@ -106,6 +111,8 @@ Popup windows:
- Figure out the size and position better if wrapping inserts indent - Figure out the size and position better if wrapping inserts indent
Text properties: Text properties:
- Patch to fix that split / join does not update properties properly (Axel
Forsman, #5839) Alternative: #5875.
- "cc" does not call inserted_bytes(). (Axel Forsman, #5763) - "cc" does not call inserted_bytes(). (Axel Forsman, #5763)
- Get E685 with a sequence of commands. (#5674) - Get E685 with a sequence of commands. (#5674)
- Combining text property with 'cursorline' does not always work (Billie - Combining text property with 'cursorline' does not always work (Billie
@ -176,17 +183,22 @@ Terminal emulator window:
conversions. conversions.
Error numbers available: Error numbers available:
E451, E452, E453, E454, E460, E489, E491, E565, E578, E610, E611, E653, E453, E454, E460, E489, E491, E565, E578, E610, E611, E653,
E654, E856, E857, E861, E900 E654, E856, E857, E861, E900
Buffer autocommands are a bit inconsistent. Add a separate set of
autocommands for the buffer lifecycle:
BufIsCreated (after buffer ID exists)
BufIsLoaded (after buffer ID has content)
BufIsUnloaded (after buffer ID no longer has)
BufIsWiped (after buffer ID was wiped)
BufIsRenamed (after buffer ID gets another name)
The buffer list and windows are locked, no changes possible
Patch to fix drawing error with DirectX. (James Grant, #5688) Patch to fix drawing error with DirectX. (James Grant, #5688)
Causes flicker on resizing. Causes flicker on resizing.
Patch to make lambda functions faster (Ken Takata) In gvim always set t_Co to 16777216 (#5903)
https://github.com/vim/vim/pull/5727
LGTM remark: size derived from user input (getenv). Don't see how.
Patch to use more FOR_ALL_ macros and use them. (Yegappan Lakshmanan, #5339)
Patch to explain use of "%" in :!. (David Briscoe, #5591) Patch to explain use of "%" in :!. (David Briscoe, #5591)

View File

@ -1,4 +1,4 @@
*usr_22.txt* For Vim version 8.2. Last change: 2019 Dec 07 *usr_22.txt* For Vim version 8.2. Last change: 2020 Mar 28
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@ -84,7 +84,7 @@ browser. This is what you get: >
a................Hiding Files or Directories................|netrw-a| a................Hiding Files or Directories................|netrw-a|
mb...............Bookmarking a Directory....................|netrw-mb| mb...............Bookmarking a Directory....................|netrw-mb|
gb...............Changing to a Bookmarked Directory.........|netrw-gb| gb...............Changing to a Bookmarked Directory.........|netrw-gb|
c................Make Browsing Directory The Current Dir....|netrw-c| cd...............Make Browsing Directory The Current Dir....|netrw-c|
d................Make A New Directory.......................|netrw-d| d................Make A New Directory.......................|netrw-d|
D................Deleting Files or Directories..............|netrw-D| D................Deleting Files or Directories..............|netrw-D|
<c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h| <c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h|
@ -121,7 +121,7 @@ The following normal-mode commands may be used to control the browser display:
As a sampling of extra normal-mode commands: As a sampling of extra normal-mode commands:
c Change Vim's notion of the current directory to be cd Change Vim's notion of the current directory to be
the same as the browser directory. (see the same as the browser directory. (see
|g:netrw_keepdir| to control this, too) |g:netrw_keepdir| to control this, too)
R Rename the file or directory under the cursor; a R Rename the file or directory under the cursor; a

View File

@ -1,4 +1,4 @@
*vim9.txt* For Vim version 8.2. Last change: 2020 Apr 03 *vim9.txt* For Vim version 8.2. Last change: 2020 Apr 09
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -120,6 +120,13 @@ and without `:let`, because there is no rule about where they are declared.
Variables cannot shadow previously defined variables. Variables cannot shadow previously defined variables.
Variables may shadow Ex commands, rename the variable if needed. Variables may shadow Ex commands, rename the variable if needed.
Global variables must be prefixed with "g:", also at the script level.
However, global user defined functions are used without "g:". >
vim9script
let script_local = 'text'
let g:global = 'value'
let Funcref = ThatFunction
Since "&opt = value" is now assigning a value to option "opt", ":&" cannot be Since "&opt = value" is now assigning a value to option "opt", ":&" cannot be
used to repeat a `:substitute` command. used to repeat a `:substitute` command.
@ -156,6 +163,18 @@ since the function has to be looked up by name. And a typo in the function
name will only be found when the call is executed. name will only be found when the call is executed.
Omitting function() ~
A user defined function can be used as a function reference in an expression
without `function()`. The argument types and return type will then be checked.
The function must already have been defined. >
let Funcref = MyFunction
When using `function()` the resulting type is "func", a function with any
number of arguments and any return type. The function can be defined later.
No curly braces expansion ~ No curly braces expansion ~
|curly-braces-names| cannot be used. |curly-braces-names| cannot be used.
@ -213,8 +232,7 @@ few exceptions.
blob non-empty blob non-empty
list non-empty (different from JavaScript) list non-empty (different from JavaScript)
dictionary non-empty (different from JavaScript) dictionary non-empty (different from JavaScript)
func when not NULL func when there is a function name
partial when not NULL
special v:true special v:true
job when not NULL job when not NULL
channel when not NULL channel when not NULL
@ -301,6 +319,7 @@ The following builtin types are supported:
job job
channel channel
func func
func: {type}
func({type}, ...) func({type}, ...)
func({type}, ...): {type} func({type}, ...): {type}
@ -318,12 +337,22 @@ memory.
A partial and function can be declared in more or less specific ways: A partial and function can be declared in more or less specific ways:
func any kind of function reference, no type func any kind of function reference, no type
checking checking for arguments or return value
func: {type} any number and type of arguments with specific func: {type} any number and type of arguments with specific
return type return type
func({type} ...) function with argument types, does not return func({type}) function with argument type, does not return
a value a value
func({type} ...): {type} function with argument types and return type func({type}): {type} function with argument type and return type
func(?{type}) function with type of optional argument, does
not return a value
func(...{type}) function with type of variable number of
arguments, does not return a value
func({type}, ?{type}, ...{type}): {type}
function with:
- type of mandatory argument
- type of optional argument
- type of variable number of arguments
- return type
If the return type is "void" the function does not return a value. If the return type is "void" the function does not return a value.

View File

@ -1,8 +1,7 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: man " Language: man
" Maintainer: SungHyun Nam <goweol@gmail.com> " Maintainer: SungHyun Nam <goweol@gmail.com>
" Last Change: 2020 Mar 25 " Last Change: 2020 Apr 6
" (fix by Jason Franklin)
" To make the ":Man" command available before editing a manual page, source " To make the ":Man" command available before editing a manual page, source
" this script from your startup vimrc file. " this script from your startup vimrc file.
@ -205,6 +204,7 @@ func <SID>GetPage(cmdmods, ...)
let s:env_has_u = (v:shell_error == 0) let s:env_has_u = (v:shell_error == 0)
endif endif
let env_cmd = s:env_has_u ? 'env -u MANPAGER' : 'env MANPAGER=cat' let env_cmd = s:env_has_u ? 'env -u MANPAGER' : 'env MANPAGER=cat'
let env_cmd .= ' GROFF_NO_SGR=1'
let man_cmd = env_cmd . ' man ' . s:GetCmdArg(sect, page) . ' | col -b' let man_cmd = env_cmd . ' man ' . s:GetCmdArg(sect, page) . ' | col -b'
silent exec "r !" . man_cmd silent exec "r !" . man_cmd

View File

@ -3,7 +3,7 @@
" Maintainer: Marshall Ward <marshall.ward@gmail.com> " Maintainer: Marshall Ward <marshall.ward@gmail.com>
" Original Maintainer: Nikolai Weibull <now@bitwi.se> " Original Maintainer: Nikolai Weibull <now@bitwi.se>
" Website: https://github.com/marshallward/vim-restructuredtext " Website: https://github.com/marshallward/vim-restructuredtext
" Latest Revision: 2018-12-29 " Latest Revision: 2020-03-31
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@ -34,7 +34,7 @@ if exists("g:rst_style") && g:rst_style != 0
setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8 setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8
endif endif
if has('patch-7.3.867') " Introduced the TextChanged event. if g:rst_fold_enabled != 0 && has('patch-7.3.867') " Introduced the TextChanged event.
setlocal foldmethod=expr setlocal foldmethod=expr
setlocal foldexpr=RstFold#GetRstFold() setlocal foldexpr=RstFold#GetRstFold()
setlocal foldtext=RstFold#GetRstFoldText() setlocal foldtext=RstFold#GetRstFoldText()

View File

@ -1,7 +1,9 @@
" Vim indent file " Vim indent file
" Language: reStructuredText Documentation Format " Vim reST indent file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Language: reStructuredText Documentation Format
" Latest Revision: 2011-08-03 " Maintainer: Marshall Ward <marshall.ward@gmail.com>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2020-03-31
if exists("b:did_indent") if exists("b:did_indent")
finish finish
@ -18,6 +20,12 @@ endif
let s:itemization_pattern = '^\s*[-*+]\s' let s:itemization_pattern = '^\s*[-*+]\s'
let s:enumeration_pattern = '^\s*\%(\d\+\|#\)\.\s\+' let s:enumeration_pattern = '^\s*\%(\d\+\|#\)\.\s\+'
let s:note_pattern = '^\.\. '
function! s:get_paragraph_start()
let paragraph_mark_start = getpos("'{")[1]
return getline(paragraph_mark_start) =~ '\S' ? paragraph_mark_start : paragraph_mark_start + 1
endfunction
function GetRSTIndent() function GetRSTIndent()
let lnum = prevnonblank(v:lnum - 1) let lnum = prevnonblank(v:lnum - 1)
@ -28,6 +36,13 @@ function GetRSTIndent()
let ind = indent(lnum) let ind = indent(lnum)
let line = getline(lnum) let line = getline(lnum)
let psnum = s:get_paragraph_start()
if psnum != 0
if getline(psnum) =~ s:note_pattern
let ind = 3
endif
endif
if line =~ s:itemization_pattern if line =~ s:itemization_pattern
let ind += 2 let ind += 2
elseif line =~ s:enumeration_pattern elseif line =~ s:enumeration_pattern

View File

@ -1,9 +1,9 @@
" Vim syntax file " Vim reST syntax file
" Language: reStructuredText documentation format " Language: reStructuredText documentation format
" Maintainer: Marshall Ward <marshall.ward@gmail.com> " Maintainer: Marshall Ward <marshall.ward@gmail.com>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Website: https://github.com/marshallward/vim-restructuredtext " Website: https://github.com/marshallward/vim-restructuredtext
" Latest Revision: 2018-12-29 " Latest Revision: 2020-03-31
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
@ -21,7 +21,7 @@ syn cluster rstCruft contains=rstEmphasis,rstStrongEmphasis,
\ rstInlineInternalTargets,rstFootnoteReference,rstHyperlinkReference \ rstInlineInternalTargets,rstFootnoteReference,rstHyperlinkReference
syn region rstLiteralBlock matchgroup=rstDelimiter syn region rstLiteralBlock matchgroup=rstDelimiter
\ start='::\_s*\n\ze\z(\s\+\)' skip='^$' end='^\z1\@!' \ start='\(^\z(\s*\).*\)\@<=::\n\s*\n' skip='^\s*$' end='^\(\z1\s\+\)\@!'
\ contains=@NoSpell \ contains=@NoSpell
syn region rstQuotedLiteralBlock matchgroup=rstDelimiter syn region rstQuotedLiteralBlock matchgroup=rstDelimiter
@ -90,16 +90,28 @@ execute 'syn match rstSubstitutionDefinition contained' .
\ ' /|.*|\_s\+/ nextgroup=@rstDirectives' \ ' /|.*|\_s\+/ nextgroup=@rstDirectives'
function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right) function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right)
" Only escape the first char of a multichar delimiter (e.g. \* inside **)
if a:start[0] == '\'
let first = a:start[0:1]
else
let first = a:start[0]
endif
execute 'syn match rstEscape'.a:name.' +\\\\\|\\'.first.'+'.' contained'
execute 'syn region rst' . a:name . execute 'syn region rst' . a:name .
\ ' start=+' . a:char_left . '\zs' . a:start . \ ' start=+' . a:char_left . '\zs' . a:start .
\ '\ze[^[:space:]' . a:char_right . a:start[strlen(a:start) - 1] . ']+' . \ '\ze[^[:space:]' . a:char_right . a:start[strlen(a:start) - 1] . ']+' .
\ a:middle . \ a:middle .
\ ' end=+\S' . a:end . '\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+' \ ' end=+' . a:end . '\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+' .
\ ' contains=rstEscape' . a:name
execute 'hi def link rstEscape'.a:name.' Special'
endfunction endfunction
function! s:DefineInlineMarkup(name, start, middle, end) function! s:DefineInlineMarkup(name, start, middle, end)
let middle = a:middle != "" ? let middle = a:middle != "" ?
\ (' skip=+\\\\\|\\' . a:middle . '+') : \ (' skip=+\\\\\|\\' . a:middle . '\|\s' . a:middle . '+') :
\ "" \ ""
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, "'", "'") call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, "'", "'")
@ -161,7 +173,7 @@ syn match rstStandaloneHyperlink contains=@NoSpell
\ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]" \ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]"
syn region rstCodeBlock contained matchgroup=rstDirective syn region rstCodeBlock contained matchgroup=rstDirective
\ start=+\%(sourcecode\|code\%(-block\)\=\)::\s\+.*\_s*\n\ze\z(\s\+\)+ \ start=+\%(sourcecode\|code\%(-block\)\=\)::\s*\(\S*\)\?\s*\n\%(\s*:.*:\s*.*\s*\n\)*\n\ze\z(\s\+\)+
\ skip=+^$+ \ skip=+^$+
\ end=+^\z1\@!+ \ end=+^\z1\@!+
\ contains=@NoSpell \ contains=@NoSpell

View File

@ -3,7 +3,7 @@
" Maintainer: Daniel Kho <daniel.kho@logik.haus> " Maintainer: Daniel Kho <daniel.kho@logik.haus>
" Previous Maintainer: Czo <Olivier.Sirol@lip6.fr> " Previous Maintainer: Czo <Olivier.Sirol@lip6.fr>
" Credits: Stephan Hegel <stephan.hegel@snc.siemens.com.cn> " Credits: Stephan Hegel <stephan.hegel@snc.siemens.com.cn>
" Last Changed: 2020 Mar 09 by Daniel Kho " Last Changed: 2020 Apr 04 by Daniel Kho
" quit when a syntax file was already loaded " quit when a syntax file was already loaded
if exists("b:current_syntax") if exists("b:current_syntax")
@ -16,10 +16,10 @@ set cpo&vim
" case is not significant " case is not significant
syn case ignore syn case ignore
" VHDL keywords " VHDL 1076-2019 keywords
syn keyword vhdlStatement access after alias all assert syn keyword vhdlStatement access after alias all
syn keyword vhdlStatement architecture array attribute syn keyword vhdlStatement architecture array attribute
syn keyword vhdlStatement assume assume_guarantee syn keyword vhdlStatement assert assume
syn keyword vhdlStatement begin block body buffer bus syn keyword vhdlStatement begin block body buffer bus
syn keyword vhdlStatement case component configuration constant syn keyword vhdlStatement case component configuration constant
syn keyword vhdlStatement context cover syn keyword vhdlStatement context cover
@ -34,20 +34,19 @@ syn keyword vhdlStatement map
syn keyword vhdlStatement new next null syn keyword vhdlStatement new next null
syn keyword vhdlStatement of on open others out syn keyword vhdlStatement of on open others out
syn keyword vhdlStatement package port postponed procedure process pure syn keyword vhdlStatement package port postponed procedure process pure
syn keyword vhdlStatement parameter property protected syn keyword vhdlStatement parameter property protected private
syn keyword vhdlStatement range record register reject report return syn keyword vhdlStatement range record register reject report return
syn keyword vhdlStatement release restrict restrict_guarantee syn keyword vhdlStatement release restrict
syn keyword vhdlStatement select severity signal shared syn keyword vhdlStatement select severity signal shared subtype
syn keyword vhdlStatement subtype
syn keyword vhdlStatement sequence strong syn keyword vhdlStatement sequence strong
syn keyword vhdlStatement then to transport type syn keyword vhdlStatement then to transport type
syn keyword vhdlStatement unaffected units until use syn keyword vhdlStatement unaffected units until use
syn keyword vhdlStatement variable syn keyword vhdlStatement variable view
" VHDL-2019 interface syn keyword vhdlStatement vpkg vmode vprop vunit
syn keyword vhdlStatement view
syn keyword vhdlStatement vmode vprop vunit
syn keyword vhdlStatement wait when while with syn keyword vhdlStatement wait when while with
syn keyword vhdlStatement note warning error failure
" VHDL predefined severity levels
syn keyword vhdlAttribute note warning error failure
" Linting of conditionals. " Linting of conditionals.
syn match vhdlStatement "\<\(if\|else\)\>" syn match vhdlStatement "\<\(if\|else\)\>"
@ -265,4 +264,5 @@ let b:current_syntax = "vhdl"
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save
" vim: ts=8 " vim: ts=8

View File

@ -7,7 +7,7 @@
enough of the commands that you will be able to easily use Vim as enough of the commands that you will be able to easily use Vim as
an all-purpose editor. an all-purpose editor.
The approximate time required to complete the tutor is 25-30 minutes, The approximate time required to complete the tutor is 30 minutes,
depending upon how much time is spent with experimentation. depending upon how much time is spent with experimentation.
ATTENTION: ATTENTION:

View File

@ -7,7 +7,7 @@
enough of the commands that you will be able to easily use Vim as enough of the commands that you will be able to easily use Vim as
an all-purpose editor. an all-purpose editor.
The approximate time required to complete the tutor is 25-30 minutes, The approximate time required to complete the tutor is 30 minutes,
depending upon how much time is spent with experimentation. depending upon how much time is spent with experimentation.
ATTENTION: ATTENTION: