Update runtime files.

This commit is contained in:
Bram Moolenaar
2017-09-19 22:06:03 +02:00
parent e22bbf6508
commit 37c64c78fd
39 changed files with 3408 additions and 5967 deletions

View File

@ -1,6 +1,6 @@
" Vim support file to help with paste mappings and menus
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2006 Jun 23
" Last Change: 2017 Aug 30
" Define the string to use for items that are present both in Edit, Popup and
" Toolbar menu. Also used in mswin.vim and macmap.vim.
@ -12,7 +12,7 @@
if has("virtualedit")
let paste#paste_cmd = {'n': ":call paste#Paste()<CR>"}
let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n']
let paste#paste_cmd['i'] = 'x<BS><Esc>' . paste#paste_cmd['n'] . 'gi'
let paste#paste_cmd['i'] = "\<c-\>\<c-o>\"+gP"
func! paste#Paste()
let ove = &ve

View File

@ -1,4 +1,4 @@
*cmdline.txt* For Vim version 8.0. Last change: 2017 Jul 11
*cmdline.txt* For Vim version 8.0. Last change: 2017 Sep 17
VIM REFERENCE MANUAL by Bram Moolenaar
@ -826,6 +826,7 @@ Also see |`=|.
*:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
*:<sfile>* *<sfile>* *:<afile>* *<afile>*
*:<abuf>* *<abuf>* *:<amatch>* *<amatch>*
*:<cexpr>* *<cexpr>*
*<slnum>* *E495* *E496* *E497* *E499* *E500*
Note: these are typed literally, they are not special keys!
<cword> is replaced with the word under the cursor (like |star|)

View File

@ -1,4 +1,4 @@
*diff.txt* For Vim version 8.0. Last change: 2017 Feb 03
*diff.txt* For Vim version 8.0. Last change: 2017 Sep 02
VIM REFERENCE MANUAL by Bram Moolenaar
@ -226,8 +226,8 @@ The diffs are highlighted with these groups:
(searching from the end of the line). The
text in between is highlighted. This means
that parts in the middle that are still the
same are highlighted anyway. Only "iwhite" of
'diffopt' is used here.
same are highlighted anyway. The 'diffopt'
flags "iwhite" and "icase" are used here.
|hl-DiffDelete| DiffDelete Deleted lines. Also called filler lines,
because they don't really exist in this
buffer.

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.0. Last change: 2017 Sep 11
*eval.txt* For Vim version 8.0. Last change: 2017 Sep 17
VIM REFERENCE MANUAL by Bram Moolenaar
@ -4787,7 +4787,9 @@ getwininfo([{winid}]) *getwininfo()*
Each List item is a Dictionary with the following entries:
bufnr number of buffer in the window
height window height
height window height (excluding winbar)
winbar 1 if the window has a toolbar, 0
otherwise
loclist 1 if showing a location list
{only with the +quickfix feature}
quickfix 1 if quickfix or location list window
@ -5676,6 +5678,7 @@ maparg({name}[, {mode} [, {abbr} [, {dict}]]]) *maparg()*
"s" Select
"x" Visual
"l" langmap |language-mapping|
"t" Terminal-Job
"" Normal, Visual and Operator-pending
When {mode} is omitted, the modes for "" are used.
@ -8021,9 +8024,9 @@ term_getattr({attr}, {what}) *term_getattr()*
term_getcursor({buf}) *term_getcursor()*
Get the cursor position of terminal {buf}. Returns a list with
two numbers and a dictionary: [rows, cols, dict].
two numbers and a dictionary: [row, col, dict].
"rows" and "cols" are one based, the first screen cell is row
"row" and "col" are one based, the first screen cell is row
1, column 1. This is the cursor position of the terminal
itself, not of the Vim window.
@ -8138,6 +8141,10 @@ term_sendkeys({buf}, {keys}) *term_sendkeys()*
means the character CTRL-X.
{only available when compiled with the |+terminal| feature}
term_setsize({buf}, {expr}) *term_setsize()*
Not implemented yet.
{only available when compiled with the |+terminal| feature}
term_start({cmd}, {options}) *term_start()*
Open a terminal window and run {cmd} in it.
@ -8609,6 +8616,7 @@ winheight({nr}) *winheight()*
When {nr} is zero, the height of the current window is
returned. When window {nr} doesn't exist, -1 is returned.
An existing window always has a height of zero or more.
This excludes any window toolbar line.
Examples: >
:echo "The current window has " . winheight(0) . " lines."
<
@ -8936,7 +8944,7 @@ title Compiled with window title support |'title'|.
toolbar Compiled with support for |gui-toolbar|.
ttyin input is a terminal (tty)
ttyout output is a terminal (tty)
unix Unix version of Vim.
unix Unix version of Vim. *+unix*
unnamedplus Compiled with support for "unnamedplus" in 'clipboard'
user_commands User-defined commands.
vertsplit Compiled with vertically split windows |:vsplit|.

View File

@ -1,4 +1,4 @@
*gui.txt* For Vim version 8.0. Last change: 2017 Sep 16
*gui.txt* For Vim version 8.0. Last change: 2017 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
@ -784,11 +784,12 @@ In the Win32 and GTK+ GUI, starting a menu name with ']' excludes that menu
from the main menu bar. You must then use the |:popup| or |:tearoff| command
to display it.
*window-toolbar*
*window-toolbar* *WinBar*
Each window can have a local toolbar. This uses the first line of the window,
thus reduces the space for the text by one line.
thus reduces the space for the text by one line. The items in the toolbar
must start with "WinBar".
Only text can be used. When using Unicode special characters can be used to
Only text can be used. When using Unicode, special characters can be used to
make the items look like icons.
If the items do not fit then the last ones cannot be used. The toolbar does
@ -802,6 +803,8 @@ Example for debugger tools: >
<
The window toolbar uses the ToolbarLine and ToolbarButton highlight groups.
When splitting the window the window toolbar is not copied to the new window.
*popup-menu*
In the Win32, GTK+, Motif, Athena and Photon GUI, you can define the
special menu "PopUp". This is the menu that is displayed when the right mouse

View File

@ -1583,13 +1583,17 @@ tag command action ~
|:tjump| :tj[ump] like ":tselect", but jump directly when there
is only one match
|:tlast| :tl[ast] jump to last matching tag
|:tmapclear| :tmapc[lear] remove all mappings for Terminal-Job mode
|:tmap| :tma[p] like ":map" but for Terminal-Job mode
|:tmenu| :tm[enu] define menu tooltip
|:tnext| :tn[ext] jump to next matching tag
|:tnoremap| :tno[remap] like ":noremap" but for Terminal-Job mode
|:topleft| :to[pleft] make split window appear at top or far left
|:tprevious| :tp[revious] jump to previous matching tag
|:trewind| :tr[ewind] jump to first matching tag
|:try| :try execute commands, abort on error or exception
|:tselect| :ts[elect] list matching tags and select one
|:tunmap| :tunma[p] like ":unmap" but for Terminal-Job mode
|:tunmenu| :tu[nmenu] remove menu tooltip
|:undo| :u[ndo] undo last change(s)
|:undojoin| :undoj[oin] join next change with previous undo block

View File

@ -1,4 +1,4 @@
*intro.txt* For Vim version 8.0. Last change: 2017 Aug 24
*intro.txt* For Vim version 8.0. Last change: 2017 Sep 04
VIM REFERENCE MANUAL by Bram Moolenaar
@ -264,6 +264,10 @@ Vim would never have become what it is now, without the help of these people!
Juergen Weigert Lattice version, AUX improvements, UNIX and
MS-DOS ports, autoconf
Stefan 'Sec' Zehl Maintainer of vim.org
Yasuhiro Matsumoto many MS-Windows improvements
Ken Takata fixes and features
Kazunobu Kuriyama GTK 3
Christian Brabandt many fixes, features, user support, etc.
I wish to thank all the people that sent me bug reports and suggestions. The
list is too long to mention them all here. Vim would not be the same without

View File

@ -1,4 +1,4 @@
*map.txt* For Vim version 8.0. Last change: 2017 May 30
*map.txt* For Vim version 8.0. Last change: 2017 Sep 17
VIM REFERENCE MANUAL by Bram Moolenaar
@ -55,7 +55,7 @@ modes.
:im[ap] {lhs} {rhs} |mapmode-i| *:im* *:imap*
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lmap*
:cm[ap] {lhs} {rhs} |mapmode-c| *:cm* *:cmap*
:tm[ap] {lhs} {rhs} |mapmode-t| *:tma* *:tmap*
:tma[p] {lhs} {rhs} |mapmode-t| *:tma* *:tmap*
Map the key sequence {lhs} to {rhs} for the modes
where the map command applies. The result, including
{rhs}, is then further scanned for mappings. This
@ -89,7 +89,7 @@ modes.
:iu[nmap] {lhs} |mapmode-i| *:iu* *:iunmap*
:lu[nmap] {lhs} |mapmode-l| *:lu* *:lunmap*
:cu[nmap] {lhs} |mapmode-c| *:cu* *:cunmap*
:tu[nmap] {lhs} |mapmode-t| *:tunma* *:tunmap*
:tunma[p] {lhs} |mapmode-t| *:tunma* *:tunmap*
Remove the mapping of {lhs} for the modes where the
map command applies. The mapping may remain defined
for other modes where it applies.
@ -125,7 +125,7 @@ modes.
:im[ap] |mapmode-i|
:lm[ap] |mapmode-l|
:cm[ap] |mapmode-c|
:tm[ap] |mapmode-t|
:tma[p] |mapmode-t|
List all key mappings for the modes where the map
command applies. Note that ":map" and ":map!" are
used most often, because they include the other modes.
@ -140,7 +140,7 @@ modes.
:im[ap] {lhs} |mapmode-i| *:imap_l*
:lm[ap] {lhs} |mapmode-l| *:lmap_l*
:cm[ap] {lhs} |mapmode-c| *:cmap_l*
:tm[ap] {lhs} |mapmode-t| *:tmap_l*
:tma[p] {lhs} |mapmode-t| *:tmap_l*
List the key mappings for the key sequences starting
with {lhs} in the modes where the map command applies.
{not in Vi}
@ -694,7 +694,7 @@ option). After that it assumes that the 'q' is to be interpreted as such. If
you type slowly, or your system is slow, reset the 'timeout' option. Then you
might want to set the 'ttimeout' option.
*map-precedence*
*map-precedence*
Buffer-local mappings (defined using |:map-<buffer>|) take precedence over
global mappings. When a buffer-local mapping is the same as a global mapping,
Vim will use the buffer-local mapping. In addition, Vim will use a complete

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 8.0. Last change: 2017 Aug 27
*options.txt* For Vim version 8.0. Last change: 2017 Sep 16
VIM REFERENCE MANUAL by Bram Moolenaar
@ -423,6 +423,16 @@ command, not when assigning a value to an option with ":let".
*$HOME-windows*
On MS-Windows, if $HOME is not defined as an environment variable, then
at runtime Vim will set it to the expansion of $HOMEDRIVE$HOMEPATH.
If $HOMEDRIVE is not set then $USERPROFILE is used.
This expanded value is not exported to the environment, this matters when
running an external command: >
:echo system('set | findstr ^HOME=')
and >
:echo luaeval('os.getenv("HOME")')
should echo nothing (an empty string) despite exists('$HOME') being true.
When setting $HOME to a non-empty string it will be exported to the
subprocesses.
Note the maximum length of an expanded option is limited. How much depends on
@ -722,7 +732,8 @@ A jump table for the options with a short description can be found at |Q_op|.
Vim may set this option automatically at startup time when Vim is
compiled with the |+termresponse| feature and if |t_u7| is set to the
escape sequence to request cursor position report.
escape sequence to request cursor position report. The response can
be found in |v:termu7resp|.
*'antialias'* *'anti'* *'noantialias'* *'noanti'*
'antialias' 'anti' boolean (default: off)
@ -870,11 +881,12 @@ A jump table for the options with a short description can be found at |Q_op|.
< Vim will guess the value. In the GUI this should work correctly,
in other cases Vim might not be able to guess the right value.
When the t_BG option is set, Vim will use it to request the background
When the |t_RB| option is set, Vim will use it to request the background
color from the terminal. If the returned RGB value is dark/light and
'background' is not dark/light, 'background' will be set and the
screen is redrawn. This may have side effects, make t_BG empty in
your .vimrc if you suspect this problem.
your .vimrc if you suspect this problem. The response to |t_RB| can
be found in |v:termrgbresp|.
When starting the GUI, the default value for 'background' will be
"light". When the value is not set in the .gvimrc, and Vim detects
@ -4363,9 +4375,9 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
{only available when compiled with |+xim| and
|+GUI_GTK|}
This option specifies the input style of Input Method.
Set to zero if you want to use on-the-spot style.
Set to one if you want to use over-the-spot style.
This option specifies the input style of Input Method:
0 use on-the-spot style
1 over-the-spot style
See: |xim-input-style|
For a long time on-the-spot sytle had been used in GTK version of vim,
@ -5746,6 +5758,18 @@ A jump table for the options with a short description can be found at |Q_op|.
< Replace the ';' with a ':' or whatever separator is used. Note that
this doesn't work when $INCL contains a comma or white space.
*'perldll'*
'perldll' string (default depends on the build)
global
{not in Vi}
{only available when compiled with the |+perl/dyn|
feature}
Specifies the name of the Perl shared library. The default is
DYNAMIC_PERL_DLL, which was specified at compile time.
Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'preserveindent'* *'pi'* *'nopreserveindent'* *'nopi'*
'preserveindent' 'pi' boolean (default off)
local to buffer

View File

@ -1,4 +1,4 @@
*quickfix.txt* For Vim version 8.0. Last change: 2017 Jun 13
*quickfix.txt* For Vim version 8.0. Last change: 2017 Sep 13
VIM REFERENCE MANUAL by Bram Moolenaar
@ -47,11 +47,6 @@ compiler (see |errorformat| below).
*quickfix-ID*
Each quickfix list has a unique identifier called the quickfix ID and this
number will not change within a Vim session. The getqflist() function can be
used to get the identifier assigned to a list.
*quickfix-ID*
Each quickfix list has a unique identifier called the quickfix ID and this
number will not change within a Vim session. The getqflist() function can be
used to get the identifier assigned to a list. There is also a quickfix list
number which may change whenever more than ten lists are added to a quickfix
stack.

View File

@ -1,4 +1,4 @@
*quickref.txt* For Vim version 8.0. Last change: 2017 Aug 19
*quickref.txt* For Vim version 8.0. Last change: 2017 Sep 10
VIM REFERENCE MANUAL by Bram Moolenaar
@ -749,6 +749,7 @@ Short explanation of each option: *option-list*
'iminsert' 'imi' use :lmap or IM in Insert mode
'imsearch' 'ims' use :lmap or IM when typing a search pattern
'imstatusfunc' 'imsf' function to obtain X input method status
'imstyle' 'imst' specifies the input style of the input method
'include' 'inc' pattern to be used to find an include file
'includeexpr' 'inex' expression used to process an include line
'incsearch' 'is' highlight match while typing search pattern

View File

@ -4,6 +4,7 @@
$ motion.txt /*$*
$HOME options.txt /*$HOME*
$HOME-use version5.txt /*$HOME-use*
$HOME-windows options.txt /*$HOME-windows*
$MYGVIMRC gui.txt /*$MYGVIMRC*
$MYVIMRC starting.txt /*$MYVIMRC*
$VIM starting.txt /*$VIM*
@ -366,7 +367,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'ims' options.txt /*'ims'*
'imsearch' options.txt /*'imsearch'*
'imsf' options.txt /*'imsf'*
'imst' options.txt /*'imst'*
'imstatusfunc' options.txt /*'imstatusfunc'*
'imstyle' options.txt /*'imstyle'*
'inc' options.txt /*'inc'*
'include' options.txt /*'include'*
'includeexpr' options.txt /*'includeexpr'*
@ -746,6 +749,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'path' options.txt /*'path'*
'pdev' options.txt /*'pdev'*
'penc' options.txt /*'penc'*
'perldll' options.txt /*'perldll'*
'pex' options.txt /*'pex'*
'pexpr' options.txt /*'pexpr'*
'pfn' options.txt /*'pfn'*
@ -971,6 +975,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
't_PE' term.txt /*'t_PE'*
't_PS' term.txt /*'t_PS'*
't_RB' term.txt /*'t_RB'*
't_RC' term.txt /*'t_RC'*
't_RI' term.txt /*'t_RI'*
't_RS' term.txt /*'t_RS'*
't_RV' term.txt /*'t_RV'*
@ -980,6 +985,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
't_SR' term.txt /*'t_SR'*
't_Sb' term.txt /*'t_Sb'*
't_Sf' term.txt /*'t_Sf'*
't_Te' term.txt /*'t_Te'*
't_Ts' term.txt /*'t_Ts'*
't_VS' term.txt /*'t_VS'*
't_WP' term.txt /*'t_WP'*
't_WS' term.txt /*'t_WS'*
@ -1328,6 +1335,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
+timers various.txt /*+timers*
+title various.txt /*+title*
+toolbar various.txt /*+toolbar*
+unix eval.txt /*+unix*
+user_commands various.txt /*+user_commands*
+vertsplit various.txt /*+vertsplit*
+viminfo various.txt /*+viminfo*
@ -1892,6 +1900,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:<afile> cmdline.txt /*:<afile>*
:<amatch> cmdline.txt /*:<amatch>*
:<cWORD> cmdline.txt /*:<cWORD>*
:<cexpr> cmdline.txt /*:<cexpr>*
:<cfile> cmdline.txt /*:<cfile>*
:<cword> cmdline.txt /*:<cword>*
:<sfile> cmdline.txt /*:<sfile>*
@ -1951,6 +1960,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:Sexplore pi_netrw.txt /*:Sexplore*
:TOhtml syntax.txt /*:TOhtml*
:TarDiff pi_tar.txt /*:TarDiff*
:Termdebug terminal.txt /*:Termdebug*
:Texplore pi_netrw.txt /*:Texplore*
:UseVimball pi_vimball.txt /*:UseVimball*
:Vexplore pi_netrw.txt /*:Vexplore*
@ -3122,9 +3132,16 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:tl tagsrch.txt /*:tl*
:tlast tagsrch.txt /*:tlast*
:tm gui.txt /*:tm*
:tma map.txt /*:tma*
:tmap map.txt /*:tmap*
:tmap_l map.txt /*:tmap_l*
:tmapc map.txt /*:tmapc*
:tmapclear map.txt /*:tmapclear*
:tmenu gui.txt /*:tmenu*
:tn tagsrch.txt /*:tn*
:tnext tagsrch.txt /*:tnext*
:tno map.txt /*:tno*
:tnoremap map.txt /*:tnoremap*
:topleft windows.txt /*:topleft*
:tp tagsrch.txt /*:tp*
:tprevious tagsrch.txt /*:tprevious*
@ -3134,6 +3151,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:ts tagsrch.txt /*:ts*
:tselect tagsrch.txt /*:tselect*
:tu gui.txt /*:tu*
:tunma map.txt /*:tunma*
:tunmap map.txt /*:tunmap*
:tunmenu gui.txt /*:tunmenu*
:u undo.txt /*:u*
:un undo.txt /*:un*
@ -3398,6 +3417,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
<bang> map.txt /*<bang>*
<buffer=N> autocmd.txt /*<buffer=N>*
<buffer=abuf> autocmd.txt /*<buffer=abuf>*
<cexpr> cmdline.txt /*<cexpr>*
<cfile> cmdline.txt /*<cfile>*
<character> intro.txt /*<character>*
<count> map.txt /*<count>*
@ -3428,6 +3448,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
<mods> map.txt /*<mods>*
<nomodeline> autocmd.txt /*<nomodeline>*
<q-args> map.txt /*<q-args>*
<range> map.txt /*<range>*
<reg> map.txt /*<reg>*
<register> map.txt /*<register>*
<sfile> cmdline.txt /*<sfile>*
@ -4829,6 +4850,7 @@ W22 eval.txt /*W22*
WORD motion.txt /*WORD*
WWW intro.txt /*WWW*
Win32 os_win32.txt /*Win32*
WinBar gui.txt /*WinBar*
WinEnter autocmd.txt /*WinEnter*
WinLeave autocmd.txt /*WinLeave*
WinNew autocmd.txt /*WinNew*
@ -7270,6 +7292,7 @@ mapmode-n map.txt /*mapmode-n*
mapmode-nvo map.txt /*mapmode-nvo*
mapmode-o map.txt /*mapmode-o*
mapmode-s map.txt /*mapmode-s*
mapmode-t map.txt /*mapmode-t*
mapmode-v map.txt /*mapmode-v*
mapmode-x map.txt /*mapmode-x*
mapping map.txt /*mapping*
@ -8005,6 +8028,7 @@ qnx-terminal os_qnx.txt /*qnx-terminal*
quake.vim syntax.txt /*quake.vim*
quickfix quickfix.txt /*quickfix*
quickfix-6 version6.txt /*quickfix-6*
quickfix-ID quickfix.txt /*quickfix-ID*
quickfix-directory-stack quickfix.txt /*quickfix-directory-stack*
quickfix-error-lists quickfix.txt /*quickfix-error-lists*
quickfix-functions usr_41.txt /*quickfix-functions*
@ -8234,6 +8258,7 @@ servername-variable eval.txt /*servername-variable*
session-file starting.txt /*session-file*
set-option options.txt /*set-option*
set-spc-auto spell.txt /*set-spc-auto*
setbufline() eval.txt /*setbufline()*
setbufvar() eval.txt /*setbufvar()*
setcharsearch() eval.txt /*setcharsearch()*
setcmdpos() eval.txt /*setcmdpos()*
@ -8460,6 +8485,7 @@ strdisplaywidth() eval.txt /*strdisplaywidth()*
strftime() eval.txt /*strftime()*
strgetchar() eval.txt /*strgetchar()*
stridx() eval.txt /*stridx()*
strikethrough syntax.txt /*strikethrough*
string eval.txt /*string*
string() eval.txt /*string()*
string-functions usr_41.txt /*string-functions*
@ -8590,6 +8616,7 @@ t_KL term.txt /*t_KL*
t_PE term.txt /*t_PE*
t_PS term.txt /*t_PS*
t_RB term.txt /*t_RB*
t_RC term.txt /*t_RC*
t_RI term.txt /*t_RI*
t_RS term.txt /*t_RS*
t_RV term.txt /*t_RV*
@ -8599,6 +8626,8 @@ t_SI term.txt /*t_SI*
t_SR term.txt /*t_SR*
t_Sb term.txt /*t_Sb*
t_Sf term.txt /*t_Sf*
t_Te term.txt /*t_Te*
t_Ts term.txt /*t_Ts*
t_VS term.txt /*t_VS*
t_WP term.txt /*t_WP*
t_WS term.txt /*t_WS*
@ -8830,6 +8859,7 @@ term_gettty() eval.txt /*term_gettty()*
term_list() eval.txt /*term_list()*
term_scrape() eval.txt /*term_scrape()*
term_sendkeys() eval.txt /*term_sendkeys()*
term_setsize() eval.txt /*term_setsize()*
term_start() eval.txt /*term_start()*
term_wait() eval.txt /*term_wait()*
termcap term.txt /*termcap*
@ -8848,6 +8878,7 @@ terminal-key-codes term.txt /*terminal-key-codes*
terminal-options term.txt /*terminal-options*
terminal-output-codes term.txt /*terminal-output-codes*
terminal-testing terminal.txt /*terminal-testing*
terminal-typing terminal.txt /*terminal-typing*
terminal-use terminal.txt /*terminal-use*
terminal.txt terminal.txt /*terminal.txt*
terminfo term.txt /*terminfo*
@ -8855,6 +8886,7 @@ termresponse-variable eval.txt /*termresponse-variable*
test-functions usr_41.txt /*test-functions*
test_alloc_fail() eval.txt /*test_alloc_fail()*
test_autochdir() eval.txt /*test_autochdir()*
test_feedinput() eval.txt /*test_feedinput()*
test_garbagecollect_now() eval.txt /*test_garbagecollect_now()*
test_ignore_error() eval.txt /*test_ignore_error()*
test_null_channel() eval.txt /*test_null_channel()*
@ -9081,7 +9113,11 @@ v:t_list eval.txt /*v:t_list*
v:t_none eval.txt /*v:t_none*
v:t_number eval.txt /*v:t_number*
v:t_string eval.txt /*v:t_string*
v:termblinkresp eval.txt /*v:termblinkresp*
v:termresponse eval.txt /*v:termresponse*
v:termrgbresp eval.txt /*v:termrgbresp*
v:termstyleresp eval.txt /*v:termstyleresp*
v:termu7resp eval.txt /*v:termu7resp*
v:testing eval.txt /*v:testing*
v:this_session eval.txt /*v:this_session*
v:throwpoint eval.txt /*v:throwpoint*
@ -9401,6 +9437,7 @@ window-resize windows.txt /*window-resize*
window-size term.txt /*window-size*
window-size-functions usr_41.txt /*window-size-functions*
window-tag windows.txt /*window-tag*
window-toolbar gui.txt /*window-toolbar*
window-variable eval.txt /*window-variable*
windowid windows.txt /*windowid*
windowid-variable eval.txt /*windowid-variable*

View File

@ -1,4 +1,4 @@
*term.txt* For Vim version 8.0. Last change: 2017 Aug 26
*term.txt* For Vim version 8.0. Last change: 2017 Aug 28
VIM REFERENCE MANUAL by Bram Moolenaar
@ -295,8 +295,6 @@ OUTPUT CODES *terminal-output-codes*
t_ts set window title start (to status line) *t_ts* *'t_ts'*
t_ue underline end *t_ue* *'t_ue'*
t_us underline mode *t_us* *'t_us'*
t_Ce undercurl end *t_Ce* *'t_Ce'*
t_Cs undercurl mode *t_Cs* *'t_Cs'*
t_ut clearing uses the current background color *t_ut* *'t_ut'*
t_vb visual bell *t_vb* *'t_vb'*
t_ve cursor visible *t_ve* *'t_ve'*
@ -311,6 +309,10 @@ OUTPUT CODES *terminal-output-codes*
t_ZR italics end *t_ZR* *'t_ZR'*
Added by Vim (there are no standard codes for these):
t_Ce undercurl end *t_Ce* *'t_Ce'*
t_Cs undercurl mode *t_Cs* *'t_Cs'*
t_Te strikethrough end *t_Te* *'t_Te'*
t_Ts strikethrough mode *t_Ts* *'t_Ts'*
t_IS set icon text start *t_IS* *'t_IS'*
t_IE set icon text end *t_IE* *'t_IE'*
t_WP set window position (Y, X) in pixels *t_WP* *'t_WP'*
@ -337,6 +339,7 @@ Added by Vim (there are no standard codes for these):
t_SC set cursor color start *t_SC* *'t_SC'*
t_EC set cursor color end *t_EC* *'t_EC'*
t_SH set cursor shape *t_SH* *'t_SH'*
t_RC request terminal cursor blinking *t_RC* *'t_RC'*
t_RS request terminal cursor style *t_RS* *'t_RS'*
Some codes have a start, middle and end part. The start and end are defined

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.0. Last change: 2017 Aug 27
*todo.txt* For Vim version 8.0. Last change: 2017 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
@ -35,25 +35,39 @@ entered there will not be repeated below, unless there is extra information.
*known-bugs*
-------------------- Known bugs and current work -----------------------
:term hangs in Athena and Motif. (Kazunobu Kuriyama, 2017 Sep 17)
Always use FEAT_WINDOWS:
May get rid of:
#define W_WINCOL(wp) (wp->w_wincol)
#define W_WIDTH(wp) (wp->w_width)
#define W_ENDCOL(wp) (wp->w_wincol + wp->w_width)
#define W_VSEP_WIDTH(wp) (wp->w_vsep_width)
#define W_STATUS_HEIGHT(wp) (wp->w_status_height)
#define W_WINROW(wp) (wp->w_winrow)
# define ALIST(win) (win)->w_alist
No maintainer for Vietnamese translations.
No maintainer for Simplified Chinese translations.
Terminal emulator window:
- Lots of stuff to implement, see src/terminal.c
- Add debugger interface. Implementation for gdb by Xavier de Gaye. Should
work like an IDE. Try to keep it generic. Now found here:
http://clewn.sf.net.
Can this replace Agide? http://www.a-a-p.org/images/debugfull.png
- Improve debugger interface:
Include all debug features of Agide.
- Implement the right-click popup menu for the terminal. Can use the
completion popup menu code and mouse dragging.
Use it for "set breakpoint", "remove breakpoint", etc.
- make showballoon() work in a terminal. Requires getting mouse-move
events.
- send 'balloonText' events for the cursor position (using CursorHold ?)
in terminal mode.
- Implement the right-click popup menu for the terminal. Can use the
completion popup menu code and mouse dragging.
- Look into the idevim plugin/script.
- Related wishes for NetBeans commands:
- make it possible to have 'defineAnnoType' also handle terminal colors.
- get ideas from http://clewn.sf.net
- Look into the idevim plugin/script.
- Improve testing:
Make a screenshot of a terminal, store in a file.
Display a stored screenshot, display diff with another one.
Make a test that puts Vim in a specific state, make a screenshot and compare
with the expected screenshot. Set t_Co to 256.
+channel:
- Try out background make plugin:
@ -123,8 +137,6 @@ Regexp problems:
Another one: echom matchstr(" sdfsfsf\n sfdsdfsdf",'[^\n]*')
(2017 May 15, #1252)
Patch to turn test80 into a new style test. (Yegappan Lakshmanan, 2017 Aug 20)
Include a few color schemes, based on popularity:
http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search
http://vimawesome.com/?q=tag:color-scheme
@ -138,26 +150,45 @@ Suggested by Hiroki Kokubun:
- [Iceberg](https://github.com/cocopon/iceberg.vim) (my one)
- [hybrid](https://github.com/w0ng/vim-hybrid)
Patch to update Brazilian translations. (Eduardo Dobay, 2017 Sep 10, #2077)
When starting with --clean packages under "start" are not loaded. Make this
work: :packadd START {name} similar to :runtime START name
Patch to refactor qf_jump(). (Yegappan, 2017 Sep 17)
When using :packadd files under "later" are not used, which is inconsistent
with packages under "start". (xtal8, #1994)
After 8.0.0962 pasting leaves the cursor in another position. (Ken Takata,
2017 Aug 23, #2015) Also (zdm, 2017 Aug 23)
Patch to add quickfix list identifier. (Yegappan, 2017 Aug 15)
Patch to fix popup menu drawing when changing the window size. (Ozaki Kiichi,
2017 Sep 17, #2110)
Patch to fix cursor highlighting with match. (Ozaki Kiichi, 2017 Sep 17,
#2111)
Patch for not profiling the first line of a script. (Lemonboy, 2017 Sep 17,
#2103)
Mac Terminal.app: ctermbg=15 gives light grey instead of white.
ctermbg=256 breaks clearing till end of the line. Both work fine in xterm.
Patch to avoid editing a file in the session file twice. (Christian Brabandt,
2017 Aug 21) #1958
Using ":hi" causes a redraw, but a redraw may update the status line, which
may trigger a ":hi" command.
Last line not in profile if it is a continuation line. (LemonBoy, 2017 Sep 17,
#2112)
"vim -c startinsert!" doesn't append. (#2117)
With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
(Marcin Szewczyk, 2017 Apr 26)
Patch to make Mac features more clear and add "macdarwin". (Kazunobu Kuriyama,
2017 Sep 5)
Using 'wildignore' also applies to literally entered file name. Also with
:drop (remote commands).
@ -168,35 +199,27 @@ ml_get errors with buggy script. (Dominique, 2017 Apr 30)
Error in emsg with buggy script. (Dominique, 2017 Apr 30)
Patch to make ":set scroll&" work properly. (Ozaki Kiichi, 2017 Sep 17, #2104)
mswin.vim should not map CTRL-F in the console (#2093)
Patch from Christian, 2017 Sep 15.
Default install on MS-Windows should source defaults.vim.
Ask whether to use Windows or Vim key behavior?
matchit hasn't been maintained for a long time. #955.
Test runtime files.
Start with filetype detection: testdir/test_filetype.vim
Patch to support on-the-spot and over-the-spot input method. (Ken Takata, 2017
Feb 14). Also see #1215.
Patch to ignore case when 'diffopt' has "icase" for finding the difference
inside a line. (Rick Howe, 2017 Aug 21, 22 with test)
Patch to support strikethrough next to bold and italic. (Christian Brabandt,
2013 Jul 30) Update from Ken Takata, 2013 Oct 12.
Update mentioned by Christian, 2016 Apr 25.
Update from Ken Takata, 2017 Aug 23.
Patch to add setbufline(). (email from Yasuhiro Matsumoto, patch by Ozaki
Kiichi, 2016 Feb 28)
Update Mar 8: https://gist.github.com/mattn/23c1f50999084992ca98
Update Mar 13: https://gist.github.com/mattn/23c1f50999084992ca98
Update Aug 2017: #1953
Patch to fix indenting for raw C++ string. (Christian Brabandt, 2017 Aug 24,
#2019)
Window not closed when deleting buffer. (Harm te Hennepe, 2017 Aug 27, #2029)
Add options_default() / options_restore() to set several options to Vim
defaults for a plugin. Comments from Zyx, 2017 May 10.
Perhaps use a vimcontext / endvimcontext command block.
Patch to fix bogus characters inserted in visual-block append. (Christian
Brabandt, 2017 Aug 23)
After using :noautocmd CursorMoved may still trigger. (Andy Stewart, 2017 Sep
13, #2084). Set old position after the command.
Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28)
Still happens (2017 Jul 9)
@ -207,17 +230,19 @@ line breaks. (Ken Takata, 2017 Aug 22)
This example in the help does not work (Andy Wokula, 2017 Aug 20):
augroup mine | au! BufRead | augroup END
Memory leaks in test_channel? (or is it because of fork())
Memory leak in test_arabic.
Using uninitialized value in test_crypt.
Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
Patch to make gM move to middle of line. (Yasuhiro Matsumoto, Sep 8, #2070)
Include Haiku port. (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
It can replace the BeOS code, which is likely not used anymore.
Now on github: #1856. Is now up-to-date?
Now on github: #1856.
Got permission to include this under the Vim license.
Refactored HTML indent file. (Michael Lee, #1821)
Using uninitialized value in test_crypt.
Test_writefile_fails_conversion failure on Solaris because if different iconv
behavior. Skip when "uname" returns "SunOS"? (Pavel Heimlich, #1872)
@ -235,6 +260,9 @@ Alternatives for ~:
The ++ options for the :edit command are also useful on the Vim command line.
Overlong utf-8 sequence is displayed wrong. (Harm te Hennepe, 2017 Sep 14,
#2089) Patch with possible solution by Björn Linse.
X11: Putting more than about 262040 characters of text on the clipboard and
pasting it in another Vim doesn't work. (Dominique Pelle, 2008 Aug 21-23)
clip_x11_request_selection_cb() is called with zero value and length.
@ -249,6 +277,9 @@ Creating a partial with an autoload function is confused about the "self"
attribute of the function. For an unknown function assume "self" and make
that optiona? (Bjorn Linse, 2017 Aug 5)
Cindent: returning a structure has more indent for the second item.
(Sam Pagenkopf, 2017 Sep 14, #2090)
Completion mixes results from the current buffer with tags and other files.
Happens when typing CTRL-N while still search for results. E.g., type "b_" in
terminal.c and then CTRL-N twice.
@ -1519,6 +1550,9 @@ GTK: tear-off menu does not work. (Kurt Sonnenmoser, 2010 Oct 25)
Win32: tear-off menu does not work when menu language is German. (Markus
Bossler, 2011 Mar 2) Fixed by 7.3.095?
Wish for NetBeans commands:
- make it possible to have 'defineAnnoType' also handle terminal colors.
Version of netbeans.c for use with MacVim. (Kazuki Sakamoto, 2010 Nov 18)
7.3.014 changed how backslash at end of line works, but still get a NUL when
@ -3709,7 +3743,7 @@ Multi-byte characters:
at a multi-byte character >= 0x100.
- Add the possibility to enter mappings which are used whenever normal text
could be entered. E.g., for "f" command. But not in Normal mode. Sort
of opposite of 'langmap'. Use ":tmap" command?
of opposite of 'langmap'. Use ":amap" command?
- When breaking a line, take properties of multi-byte characters into
account. The "linebreak" program from Bruno Haible can do it:
ftp://ftp.ilog.fr/pub/Users/haible/gnu/linebreak-0.1.tar.gz

View File

@ -1,4 +1,4 @@
*usr_07.txt* For Vim version 8.0. Last change: 2017 Aug 11
*usr_07.txt* For Vim version 8.0. Last change: 2017 Sep 18
VIM USER MANUAL - by Bram Moolenaar
@ -215,14 +215,14 @@ change: >
`.
Suppose you are editing the file "one.txt". Somewhere halfway the file you
use "x" to delete a character. Then you go to the last line with "G" and
write the file with ":w". You edit several other files, and then use ":edit
one.txt" to come back to "one.txt". If you now use `" Vim jumps to the last
line of the file. Using `. takes you to the position where you deleted the
character. Even when you move around in the file `" and `. will take you to
the remembered position. At least until you make another change or leave the
file.
Suppose you are editing the file "one.txt". Somewhere halfway through the
file you use "x" to delete a character. Then you go to the last line with "G"
and write the file with ":w". You edit several other files, and then use
":edit one.txt" to come back to "one.txt". If you now use `" Vim jumps to the
last line of the file. Using `. takes you to the position where you deleted
the character. Even when you move around in the file `" and `. will take you
to the remembered position. At least until you make another change or leave
the file.
FILE MARKS
@ -233,8 +233,8 @@ another file and place marks there, these are specific for that file. Thus
each file has its own set of marks, they are local to the file.
So far we were using marks with a lowercase letter. There are also marks
with an uppercase letter. These are global, they can be used from any file.
For example suppose that we are editing the file "foo.txt". Go to halfway the
file ("50%") and place the F mark there (F for foo): >
For example suppose that we are editing the file "foo.txt". Go to halfway
down the file ("50%") and place the F mark there (F for foo): >
50%mF

View File

@ -1,4 +1,4 @@
*various.txt* For Vim version 8.0. Last change: 2017 Feb 24
*various.txt* For Vim version 8.0. Last change: 2017 Sep 16
VIM REFERENCE MANUAL by Bram Moolenaar
@ -322,7 +322,7 @@ N *+cindent* |'cindent'|, C indenting
N *+clientserver* Unix and Win32: Remote invocation |clientserver|
*+clipboard* |clipboard| support
N *+cmdline_compl* command line completion |cmdline-completion|
N *+cmdline_hist* command line history |cmdline-history|
S *+cmdline_hist* command line history |cmdline-history|
N *+cmdline_info* |'showcmd'| and |'ruler'|
N *+comments* |'comments'| support
B *+conceal* "conceal" support, see |conceal| |:syn-conceal| etc.
@ -361,7 +361,7 @@ m *+hangul_input* Hangul input support |hangul|
*+iconv/dyn* Likewise |iconv-dynamic| |/dyn|
N *+insert_expand* |insert_expand| Insert mode completion
m *+job* starting and stopping jobs |job|
N *+jumplist* |jumplist|
S *+jumplist* |jumplist|
B *+keymap* |'keymap'|
N *+lambda* |lambda| and |closure|
B *+langmap* |'langmap'|
@ -438,14 +438,16 @@ N *+title* Setting the window 'title' and 'icon'
N *+toolbar* |gui-toolbar|
N *+user_commands* User-defined commands. |user-commands|
N *+viminfo* |'viminfo'|
N *+vertsplit* Vertically split windows |:vsplit|
*+vertsplit* Vertically split windows |:vsplit|; Always enabled
since 8.0.1118.
in sync with the |+windows| feature
N *+virtualedit* |'virtualedit'|
S *+visual* Visual mode |Visual-mode| Always enabled since 7.4.200.
N *+visualextra* extra Visual mode commands |blockwise-operators|
N *+vreplace* |gR| and |gr|
N *+wildignore* |'wildignore'|
N *+wildmenu* |'wildmenu'|
S *+windows* more than one window
*+windows* more than one window; Always enabled sinde 8.0.1118.
m *+writebackup* |'writebackup'| is default on
m *+xim* X input method |xim|
*+xfontset* X fontset support |xfontset|

View File

@ -1,4 +1,4 @@
*visual.txt* For Vim version 8.0. Last change: 2014 Mar 23
*visual.txt* For Vim version 8.0. Last change: 2017 Sep 02
VIM REFERENCE MANUAL by Bram Moolenaar

View File

@ -1,4 +1,4 @@
*windows.txt* For Vim version 8.0. Last change: 2017 Aug 21
*windows.txt* For Vim version 8.0. Last change: 2017 Sep 08
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1034,6 +1034,7 @@ list of buffers. |unlisted-buffer|
= a readonly buffer
R a terminal buffer with a running job
F a terminal buffer with a finished job
? a terminal buffer without a job: `:terminal NONE`
+ a modified buffer
x a buffer with read errors

View File

@ -3,7 +3,7 @@
" Maintainer: vim-perl <vim-perl@googlegroups.com>
" Homepage: http://github.com/vim-perl/vim-perl
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
" Last Change: 2013-07-21
" Last Change: 2015-02-09
if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1
@ -33,14 +33,14 @@ endif
setlocal include=\\<\\(use\\\|require\\)\\>
setlocal includeexpr=substitute(substitute(substitute(v:fname,'::','/','g'),'->\*','',''),'$','.pm','')
setlocal define=[^A-Za-z_]
setlocal iskeyword+=:
" The following line changes a global variable but is necessary to make
" gf and similar commands work. The change to iskeyword was incorrect.
" Thanks to Andrew Pimlott for pointing out the problem. If this causes a
" problem for you, add an after/ftplugin/perl.vim file that contains
" gf and similar commands work. Thanks to Andrew Pimlott for pointing
" out the problem. If this causes a problem for you, add an
" after/ftplugin/perl.vim file that contains
" set isfname-=:
set isfname+=:
set iskeyword+=:
" Set this once, globally.
if !exists("perlpath")
@ -77,11 +77,12 @@ endif
"---------------------------------------------
" Undo the stuff we changed.
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp< path<" .
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isk< isf< kp< path<" .
\ " | unlet! b:browsefilter"
" proper matching for matchit plugin
let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField'
let b:match_words = '\<if\>:\<elsif\>:\<else\>'
" Restore the saved compatibility options.
let &cpo = s:save_cpo

View File

@ -1,14 +1,12 @@
" Vim indent file
" Program: CMake - Cross-Platform Makefile Generator
" Module: $RCSfile: cmake-indent.vim,v $
" Language: CMake (ft=cmake)
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>
" Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
" Last Change: $Date: 2008-01-16 16:53:53 $
" Version: $Revision: 1.9 $
" Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
" Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
" Last Change: 2017 Aug 30
"
" Licence: The CMake license applies to this file. See
" http://www.cmake.org/HTML/Copyright.html
" https://cmake.org/licensing
" This implies that distribution with Vim is allowed
if exists("b:did_indent")
@ -16,6 +14,7 @@ if exists("b:did_indent")
endif
let b:did_indent = 1
setlocal et
setlocal indentexpr=CMakeGetIndent(v:lnum)
setlocal indentkeys+==ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE(
@ -68,19 +67,19 @@ fun! CMakeGetIndent(lnum)
let ind = ind
else
if previous_line =~? cmake_indent_begin_regex
let ind = ind + shiftwidth()
let ind = ind + &sw
endif
if previous_line =~? cmake_indent_open_regex
let ind = ind + shiftwidth()
let ind = ind + &sw
endif
endif
" Subtract
if this_line =~? cmake_indent_end_regex
let ind = ind - shiftwidth()
let ind = ind - &sw
endif
if previous_line =~? cmake_indent_close_regex
let ind = ind - shiftwidth()
let ind = ind - &sw
endif
return ind

View File

@ -2,7 +2,7 @@
" Language: Javascript
" Maintainer: Chris Paul ( https://github.com/bounceme )
" URL: https://github.com/pangloss/vim-javascript
" Last Change: March 21, 2017
" Last Change: September 18, 2017
" Only load this indent file when no other was loaded.
if exists('b:did_indent')
@ -10,6 +10,10 @@ if exists('b:did_indent')
endif
let b:did_indent = 1
" indent correctly if inside <script>
" vim/vim@690afe1 for the switch from cindent
let b:html_indent_script1 = 'inc'
" Now, set up our indentation expression and keys that trigger it.
setlocal indentexpr=GetJavascriptIndent()
setlocal autoindent nolisp nosmartindent
@ -21,6 +25,13 @@ setlocal indentkeys+=0],0)
let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<'
" Regex of syntax group names that are or delimit string or are comments.
let b:syng_strcom = get(b:,'syng_strcom','string\|comment\|regex\|special\|doc\|template\%(braces\)\@!')
let b:syng_str = get(b:,'syng_str','string\|template\|special')
" template strings may want to be excluded when editing graphql:
" au! Filetype javascript let b:syng_str = '^\%(.*template\)\@!.*string\|special'
" au! Filetype javascript let b:syng_strcom = '^\%(.*template\)\@!.*string\|comment\|regex\|special\|doc'
" Only define the function once.
if exists('*GetJavascriptIndent')
finish
@ -36,7 +47,7 @@ if exists('*shiftwidth')
endfunction
else
function s:sw()
return &l:shiftwidth == 0 ? &l:tabstop : &l:shiftwidth
return &l:shiftwidth ? &l:shiftwidth : &l:tabstop
endfunction
endif
@ -44,272 +55,301 @@ endif
" matches before pos.
let s:z = has('patch-7.4.984') ? 'z' : ''
" Expression used to check whether we should skip a match with searchpair().
let s:skip_expr = "s:SynAt(line('.'),col('.')) =~? b:syng_strcom"
let s:in_comm = s:skip_expr[:-14] . "'comment\\|doc'"
let s:rel = has('reltime')
" searchpair() wrapper
if has('reltime')
function s:GetPair(start,end,flags,skip,time,...)
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 2000,0] + a:000),a:time)
if s:rel
function s:GetPair(start,end,flags,skip)
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,s:l1,a:skip ==# 's:SkipFunc()' ? 2000 : 200)
endfunction
else
function s:GetPair(start,end,flags,skip,...)
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 1000,get(a:000,1)]))
function s:GetPair(start,end,flags,skip)
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,s:l1)
endfunction
endif
" Regex of syntax group names that are or delimit string or are comments.
let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template\%(braces\)\@!'
let s:syng_str = 'string\|template\|special'
let s:syng_com = 'comment\|doc'
" Expression used to check whether we should skip a match with searchpair().
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'"
function s:parse_cino(f) abort
return float2nr(eval(substitute(substitute(join(split(
\ matchstr(&cino,'.*'.a:f.'\zs[^,]*'), 's',1), '*'.s:W)
\ , '^-\=\zs\*','',''), '^-\=\zs\.','0.','')))
endfunction
function s:skip_func()
if getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$'
return eval(s:skip_expr)
elseif s:checkIn || search('\m`\|\${\|\*\/','nW'.s:z,s:looksyn)
let s:checkIn = eval(s:skip_expr)
function s:SynAt(l,c)
let byte = line2byte(a:l) + a:c - 1
let pos = index(s:synid_cache[0], byte)
if pos == -1
let s:synid_cache[:] += [[byte], [synIDattr(synID(a:l, a:c, 0), 'name')]]
endif
let s:looksyn = line('.')
return s:checkIn
return s:synid_cache[1][pos]
endfunction
function s:alternatePair(stop)
let pos = getpos('.')[1:2]
let pat = '[][(){};]'
while search('\m'.pat,'bW',a:stop)
if s:skip_func() | continue | endif
let idx = stridx('])};',s:looking_at())
if idx is 3 | let pat = '[{}()]' | continue | endif
if idx + 1
if s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,a:stop) <= 0
function s:ParseCino(f)
let [divider, n, cstr] = [0] + matchlist(&cino,
\ '\%(.*,\)\=\%(\%d'.char2nr(a:f).'\(-\)\=\([.s0-9]*\)\)\=')[1:2]
for c in split(cstr,'\zs')
if c == '.' && !divider
let divider = 1
elseif c ==# 's'
if n !~ '\d'
return n . s:sw() + 0
endif
let n = str2nr(n) * s:sw()
break
else
let [n, divider] .= [c, 0]
endif
endfor
return str2nr(n) / max([str2nr(divider),1])
endfunction
" Optimized {skip} expr, only callable from the search loop which
" GetJavascriptIndent does to find the containing [[{(] (side-effects)
function s:SkipFunc()
if s:top_col == 1
throw 'out of bounds'
endif
let s:top_col = 0
if s:check_in
if eval(s:skip_expr)
return 1
endif
let s:check_in = 0
elseif getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$'
if eval(s:skip_expr)
let s:looksyn = a:firstline
return 1
endif
elseif search('\m`\|\${\|\*\/','nW'.s:z,s:looksyn) && eval(s:skip_expr)
let s:check_in = 1
return 1
endif
let [s:looksyn, s:top_col] = getpos('.')[1:2]
endfunction
function s:AlternatePair()
let [pat, l:for] = ['[][(){};]', 2]
while s:SearchLoop(pat,'bW','s:SkipFunc()')
if s:LookingAt() == ';'
if !l:for
if s:GetPair('{','}','bW','s:SkipFunc()')
return
endif
break
else
let [pat, l:for] = ['[{}();]', l:for - 1]
endif
else
return
let idx = stridx('])}',s:LookingAt())
if idx == -1
return
elseif !s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:SkipFunc()')
break
endif
endif
endwhile
call call('cursor',pos)
throw 'out of bounds'
endfunction
function s:save_pos(f,...)
let l:pos = getpos('.')[1:2]
let ret = call(a:f,a:000)
call call('cursor',l:pos)
return ret
function s:Nat(int)
return a:int * (a:int > 0)
endfunction
function s:syn_at(l,c)
return synIDattr(synID(a:l,a:c,0),'name')
endfunction
function s:looking_at()
function s:LookingAt()
return getline('.')[col('.')-1]
endfunction
function s:token()
return s:looking_at() =~ '\k' ? expand('<cword>') : s:looking_at()
function s:Token()
return s:LookingAt() =~ '\k' ? expand('<cword>') : s:LookingAt()
endfunction
function s:previous_token()
let l:pos = getpos('.')[1:2]
if search('\m\k\{1,}\zs\k\|\S','bW')
if (getline('.')[col('.')-2:col('.')-1] == '*/' || line('.') != l:pos[0] &&
\ getline('.') =~ '\%<'.col('.').'c\/\/') && s:syn_at(line('.'),col('.')) =~? s:syng_com
while search('\m\S\ze\_s*\/[/*]','bW')
if s:syn_at(line('.'),col('.')) !~? s:syng_com
return s:token()
endif
endwhile
function s:PreviousToken()
let l:col = col('.')
if search('\m\k\{1,}\|\S','ebW')
if search('\m\*\%#\/\|\/\/\%<'.a:firstline.'l','nbW',line('.')) && eval(s:in_comm)
if s:SearchLoop('\S\ze\_s*\/[/*]','bW',s:in_comm)
return s:Token()
endif
call cursor(a:firstline, l:col)
else
return s:token()
return s:Token()
endif
endif
call call('cursor',l:pos)
return ''
endfunction
function s:expr_col()
if getline('.')[col('.')-2] == ':'
return 1
endif
function s:Pure(f,...)
return eval("[call(a:f,a:000),cursor(a:firstline,".col('.').")][0]")
endfunction
function s:SearchLoop(pat,flags,expr)
return s:GetPair(a:pat,'\_$.',a:flags,a:expr)
endfunction
function s:ExprCol()
let bal = 0
while search('\m[{}?:;]','bW')
if eval(s:skip_expr) | continue | endif
" switch (looking_at())
exe { '}': "if s:GetPair('{','}','bW',s:skip_expr,200) <= 0 | return | endif",
\ ';': "return",
\ '{': "return getpos('.')[1:2] != b:js_cache[1:] && !s:IsBlock()",
\ ':': "let bal -= getline('.')[max([col('.')-2,0]):col('.')] !~ '::'",
\ '?': "let bal += 1 | if bal > 0 | return 1 | endif" }[s:looking_at()]
while s:SearchLoop('[{}?]\|\_[^:]\zs::\@!','bW',s:skip_expr)
if s:LookingAt() == ':'
let bal -= 1
elseif s:LookingAt() == '?'
let bal += 1
if bal == 1
break
endif
elseif s:LookingAt() == '{'
let bal = !s:IsBlock()
break
elseif !s:GetPair('{','}','bW',s:skip_expr)
break
endif
endwhile
return s:Nat(bal)
endfunction
" configurable regexes that define continuation lines, not including (, {, or [.
let s:opfirst = '^' . get(g:,'javascript_opfirst',
\ '\C\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)')
\ '\C\%([<>=,.?^%|/&]\|\([-:+]\)\1\@!\|\*\+\|!=\|in\%(stanceof\)\=\>\)')
let s:continuation = get(g:,'javascript_continuation',
\ '\C\%([-+<>=,.~!?/*^%|&:]\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$'
\ '\C\%([<=,.~!?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$'
function s:continues(ln,con)
if !cursor(a:ln, match(' '.a:con,s:continuation))
let teol = s:looking_at()
if teol == '/'
return s:syn_at(line('.'),col('.')) !~? 'regex'
elseif teol =~ '[-+>]'
return getline('.')[col('.')-2] != tr(teol,'>','=')
elseif teol =~ '\l'
return s:previous_token() != '.'
elseif teol == ':'
return s:expr_col()
endif
return 1
function s:Continues(ln,con)
let tok = matchstr(a:con[-15:],s:continuation)
if tok =~ '[a-z:]'
call cursor(a:ln, len(a:con))
return tok == ':' ? s:ExprCol() : s:PreviousToken() != '.'
elseif tok !~ '[/>]'
return tok isnot ''
endif
endfunction
" get the line of code stripped of comments and move cursor to the last
" non-comment char.
function s:Trim(ln)
let pline = substitute(getline(a:ln),'\s*$','','')
let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
while l:max != -1 && s:syn_at(a:ln, strlen(pline)) =~? s:syng_com
let pline = pline[: l:max]
let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
let pline = substitute(pline[:-2],'\s*$','','')
endwhile
return pline is '' || cursor(a:ln,strlen(pline)) ? pline : pline
endfunction
" Find line above 'lnum' that isn't empty or in a comment
function s:PrevCodeLine(lnum)
let [l:pos, l:n] = [getpos('.')[1:2], prevnonblank(a:lnum)]
while l:n
if getline(l:n) =~ '^\s*\/[/*]'
let l:n = prevnonblank(l:n-1)
elseif stridx(getline(l:n), '*/') + 1 && s:syn_at(l:n,1) =~? s:syng_com
call cursor(l:n,1)
keepjumps norm! [*
let l:n = search('\m\S','nbW')
else
break
endif
endwhile
call call('cursor',l:pos)
return l:n
return s:SynAt(a:ln, len(a:con)) !~? (tok == '>' ? 'jsflow\|^html' : 'regex')
endfunction
" Check if line 'lnum' has a balanced amount of parentheses.
function s:Balanced(lnum)
let l:open = 0
let l:line = getline(a:lnum)
let pos = match(l:line, '[][(){}]', 0)
let [l:open, l:line] = [0, getline(a:lnum)]
let pos = match(l:line, '[][(){}]')
while pos != -1
if s:syn_at(a:lnum,pos + 1) !~? s:syng_strcom
if s:SynAt(a:lnum,pos + 1) !~? b:syng_strcom
let l:open += match(' ' . l:line[pos],'[[({]')
if l:open < 0
return
endif
endif
let pos = match(l:line, (l:open ?
\ '['.escape(tr(l:line[pos],'({[]})',')}][{(').l:line[pos],']').']' :
\ '[][(){}]'), pos + 1)
let pos = match(l:line, !l:open ? '[][(){}]' : '()' =~ l:line[pos] ?
\ '[()]' : '{}' =~ l:line[pos] ? '[{}]' : '[][]', pos + 1)
endwhile
return !l:open
endfunction
function s:OneScope(lnum)
let pline = s:Trim(a:lnum)
let kw = 'else do'
if pline[-1:] == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
if s:previous_token() =~# '^\%(await\|each\)$'
call s:previous_token()
let kw = 'for'
else
let kw = 'for if let while with'
endif
function s:OneScope()
if s:LookingAt() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr)
let tok = s:PreviousToken()
return (count(split('for if let while with'),tok) ||
\ tok =~# '^await$\|^each$' && s:PreviousToken() ==# 'for') &&
\ s:Pure('s:PreviousToken') != '.' && !(tok == 'while' && s:DoWhile())
elseif s:Token() =~# '^else$\|^do$'
return s:Pure('s:PreviousToken') != '.'
endif
return pline[-2:] == '=>' || index(split(kw),s:token()) + 1 &&
\ s:save_pos('s:previous_token') != '.'
return strpart(getline('.'),col('.')-2,2) == '=>'
endfunction
" returns braceless levels started by 'i' and above lines * shiftwidth().
" 'num' is the lineNr which encloses the entire context, 'cont' if whether
" line 'i' + 1 is a continued expression, which could have started in a
" braceless context
function s:iscontOne(i,num,cont)
let [l:i, l:num, bL] = [a:i, a:num + !a:num, 0]
let pind = a:num ? indent(l:num) + s:W : 0
let ind = indent(l:i) + (a:cont ? 0 : s:W)
while l:i >= l:num && (ind > pind || l:i == l:num)
if indent(l:i) < ind && s:OneScope(l:i)
let bL += s:W
let l:i = line('.')
elseif !a:cont || bL || ind < indent(a:i)
function s:DoWhile()
let cpos = searchpos('\m\<','cbW')
if s:SearchLoop('\C[{}]\|\<\%(do\|while\)\>','bW',s:skip_expr)
if s:{s:LookingAt() == '}' && s:GetPair('{','}','bW',s:skip_expr) ?
\ 'Previous' : ''}Token() ==# 'do' && s:IsBlock()
return 1
endif
call call('cursor',cpos)
endif
endfunction
" returns total offset from braceless contexts. 'num' is the lineNr which
" encloses the entire context, 'cont' if whether a:firstline is a continued
" expression, which could have started in a braceless context
function s:IsContOne(num,cont)
let [l:num, b_l] = [a:num + !a:num, 0]
let pind = a:num ? indent(a:num) + s:sw() : 0
let ind = indent('.') + !a:cont
while line('.') > l:num && ind > pind || line('.') == l:num
if indent('.') < ind && s:OneScope()
let b_l += 1
elseif !a:cont || b_l || ind < indent(a:firstline)
break
else
call cursor(0,1)
endif
let ind = min([ind, indent('.')])
if s:PreviousToken() is ''
break
endif
let ind = min([ind, indent(l:i)])
let l:i = s:PrevCodeLine(l:i - 1)
endwhile
return bL
return b_l
endfunction
function s:Class()
return (s:Token() ==# 'class' || s:PreviousToken() =~# '^class$\|^extends$') &&
\ s:PreviousToken() != '.'
endfunction
function s:IsSwitch()
return s:PreviousToken() !~ '[.*]' &&
\ (!s:GetPair('{','}','cbW',s:skip_expr) || s:IsBlock() && !s:Class())
endfunction
" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
function s:IsBlock()
if s:looking_at() == '{'
let l:n = line('.')
let char = s:previous_token()
if match(s:stack,'\cxml\|jsx') + 1 && s:syn_at(line('.'),col('.')-1) =~? 'xml\|jsx'
return char != '{'
elseif char =~ '\k'
if char ==# 'type'
return s:previous_token() !~# '^\%(im\|ex\)port$'
endif
return index(split('return const let import export extends yield default delete var await void typeof throw case new of in instanceof')
\ ,char) < (line('.') != l:n) || s:save_pos('s:previous_token') == '.'
elseif char == '>'
return getline('.')[col('.')-2] == '=' || s:syn_at(line('.'),col('.')) =~? '^jsflow'
elseif char == ':'
return !s:save_pos('s:expr_col')
elseif char == '/'
return s:syn_at(line('.'),col('.')) =~? 'regex'
let tok = s:PreviousToken()
if join(s:stack) =~? 'xml\|jsx' && s:SynAt(line('.'),col('.')-1) =~? 'xml\|jsx'
return tok != '{'
elseif tok =~ '\k'
if tok ==# 'type'
return s:Pure('eval',"s:PreviousToken() !~# '^\\%(im\\|ex\\)port$' || s:PreviousToken() == '.'")
elseif tok ==# 'of'
return s:Pure('eval',"!s:GetPair('[[({]','[])}]','bW',s:skip_expr) || s:LookingAt() != '(' ||"
\ ."s:{s:PreviousToken() ==# 'await' ? 'Previous' : ''}Token() !=# 'for' || s:PreviousToken() == '.'")
endif
return char !~ '[=~!<*,?^%|&([]' &&
\ (char !~ '[-+]' || l:n != line('.') && getline('.')[col('.')-2] == char)
return index(split('return const let import export extends yield default delete var await void typeof throw case new in instanceof')
\ ,tok) < (line('.') != a:firstline) || s:Pure('s:PreviousToken') == '.'
elseif tok == '>'
return getline('.')[col('.')-2] == '=' || s:SynAt(line('.'),col('.')) =~? 'jsflow\|^html'
elseif tok == '*'
return s:Pure('s:PreviousToken') == ':'
elseif tok == ':'
return s:Pure('eval',"s:PreviousToken() =~ '^\\K\\k*$' && !s:ExprCol()")
elseif tok == '/'
return s:SynAt(line('.'),col('.')) =~? 'regex'
elseif tok !~ '[=~!<,.?^%|&([]'
return tok !~ '[-+]' || line('.') != a:firstline && getline('.')[col('.')-2] == tok
endif
endfunction
function GetJavascriptIndent()
let b:js_cache = get(b:,'js_cache',[0,0,0])
" Get the current line.
call cursor(v:lnum,1)
let l:line = getline('.')
let s:synid_cache = [[],[]]
let l:line = getline(v:lnum)
" use synstack as it validates syn state and works in an empty line
let s:stack = map(synstack(v:lnum,1),"synIDattr(v:val,'name')")
let syns = get(s:stack,-1,'')
let s:stack = [''] + map(synstack(v:lnum,1),"synIDattr(v:val,'name')")
" start with strings,comments,etc.
if syns =~? s:syng_com
if s:stack[-1] =~? 'comment\|doc'
if l:line =~ '^\s*\*'
return cindent(v:lnum)
elseif l:line !~ '^\s*\/[/*]'
return -1
endif
elseif syns =~? s:syng_str
elseif s:stack[-1] =~? b:syng_str
if b:js_cache[0] == v:lnum - 1 && s:Balanced(v:lnum-1)
let b:js_cache[0] = v:lnum
endif
return -1
endif
let l:lnum = s:PrevCodeLine(v:lnum - 1)
if !l:lnum
let s:l1 = max([0,prevnonblank(v:lnum) - (s:rel ? 2000 : 1000),
\ get(get(b:,'hi_indent',{}),'blocklnr')])
call cursor(v:lnum,1)
if s:PreviousToken() is ''
return
endif
let [l:lnum, pline] = [line('.'), getline('.')[:col('.')-1]]
let l:line = substitute(l:line,'^\s*','','')
let l:line_raw = l:line
if l:line[:1] == '/*'
let l:line = substitute(l:line,'^\%(\/\*.\{-}\*\/\s*\)*','','')
endif
@ -318,60 +358,91 @@ function GetJavascriptIndent()
endif
" the containing paren, bracket, or curly. Many hacks for performance
call cursor(v:lnum,1)
let idx = index([']',')','}'],l:line[0])
if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))
if b:js_cache[0] > l:lnum && b:js_cache[0] < v:lnum ||
\ b:js_cache[0] == l:lnum && s:Balanced(l:lnum)
call call('cursor',b:js_cache[1:])
else
let [s:looksyn, s:checkIn, top] = [v:lnum - 1, 0, (!indent(l:lnum) &&
\ s:syn_at(l:lnum,1) !~? s:syng_str) * l:lnum]
if idx + 1
call s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:skip_func()',2000,top)
elseif getline(v:lnum) !~ '^\S' && syns =~? 'block'
call s:GetPair('{','}','bW','s:skip_func()',2000,top)
else
call s:alternatePair(top)
endif
let [s:looksyn, s:top_col, s:check_in, s:l1] = [v:lnum - 1,0,0,
\ max([s:l1, &smc ? search('\m^.\{'.&smc.',}','nbW',s:l1 + 1) + 1 : 0])]
try
if idx != -1
call s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:SkipFunc()')
elseif getline(v:lnum) !~ '^\S' && s:stack[-1] =~? 'block\|^jsobject$'
call s:GetPair('{','}','bW','s:SkipFunc()')
else
call s:AlternatePair()
endif
catch /^\Cout of bounds$/
call cursor(v:lnum,1)
endtry
let b:js_cache[1:] = line('.') == v:lnum ? [0,0] : getpos('.')[1:2]
endif
let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [0,0] : getpos('.')[1:2])
let num = b:js_cache[1]
let [b:js_cache[0], num] = [v:lnum, b:js_cache[1]]
let [s:W, isOp, bL, switch_offset] = [s:sw(),0,0,0]
if !num || s:IsBlock()
let [num_ind, is_op, b_l, l:switch_offset] = [s:Nat(indent(num)),0,0,0]
if !num || s:LookingAt() == '{' && s:IsBlock()
let ilnum = line('.')
let pline = s:save_pos('s:Trim',l:lnum)
if num && s:looking_at() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
let num = ilnum == num ? line('.') : num
if idx < 0 && s:previous_token() ==# 'switch' && s:previous_token() != '.'
if &cino !~ ':'
let switch_offset = s:W
else
let switch_offset = max([-indent(num),s:parse_cino(':')])
endif
if num && s:LookingAt() == ')' && s:GetPair('(',')','bW',s:skip_expr)
if ilnum == num
let [num, num_ind] = [line('.'), indent('.')]
endif
if idx == -1 && s:PreviousToken() ==# 'switch' && s:IsSwitch()
let l:switch_offset = &cino !~ ':' ? s:sw() : s:ParseCino(':')
if pline[-1:] != '.' && l:line =~# '^\%(default\|case\)\>'
return indent(num) + switch_offset
return s:Nat(num_ind + l:switch_offset)
elseif &cino =~ '='
let l:case_offset = s:ParseCino('=')
endif
endif
endif
if idx < 0 && pline[-1:] !~ '[{;]'
let isOp = (l:line =~# s:opfirst || s:continues(l:lnum,pline)) * s:W
let bL = s:iscontOne(l:lnum,b:js_cache[1],isOp)
let bL -= (bL && l:line[0] == '{') * s:W
if idx == -1 && pline[-1:] !~ '[{;]'
let sol = matchstr(l:line,s:opfirst)
if sol is '' || sol == '/' && s:SynAt(v:lnum,
\ 1 + len(getline(v:lnum)) - len(l:line)) =~? 'regex'
if s:Continues(l:lnum,pline)
let is_op = s:sw()
endif
elseif num && sol =~# '^\%(in\%(stanceof\)\=\|\*\)$'
call call('cursor',b:js_cache[1:])
if s:PreviousToken() =~ '\k' && s:Class()
return num_ind + s:sw()
endif
let is_op = s:sw()
else
let is_op = s:sw()
endif
call cursor(l:lnum, len(pline))
let b_l = s:Nat(s:IsContOne(b:js_cache[1],is_op) - (!is_op && l:line =~ '^{')) * s:sw()
endif
elseif idx < 0 && getline(b:js_cache[1])[b:js_cache[2]-1] == '(' && &cino =~ '('
let pval = s:parse_cino('(')
return !pval ? (s:parse_cino('w') ? 0 : -(!!search('\m\S','W'.s:z,num))) + virtcol('.') :
\ max([indent('.') + pval + (s:GetPair('(',')','nbrmW',s:skip_expr,100,num) * s:W),0])
elseif idx.s:LookingAt().&cino =~ '^-1(.*(' && (search('\m\S','nbW',num) || s:ParseCino('U'))
let pval = s:ParseCino('(')
if !pval
let [Wval, vcol] = [s:ParseCino('W'), virtcol('.')]
if search('\m\S','W',num)
return s:ParseCino('w') ? vcol : virtcol('.')-1
endif
return Wval ? s:Nat(num_ind + Wval) : vcol
endif
return s:Nat(num_ind + pval + searchpair('\m(','','\m)','nbrmW',s:skip_expr,num) * s:sw())
endif
" main return
if l:line =~ '^\%([])}]\||}\)'
return max([indent(num),0])
if l:line =~ '^[])}]\|^|}'
if l:line_raw[0] == ')' && getline(num)[b:js_cache[2]-1] == '('
if s:ParseCino('M')
return indent(l:lnum)
elseif &cino =~# 'm' && !s:ParseCino('m')
return virtcol('.') - 1
endif
endif
return num_ind
elseif num
return indent(num) + s:W + switch_offset + bL + isOp
return s:Nat(num_ind + get(l:,'case_offset',s:sw()) + l:switch_offset + b_l + is_op)
endif
return bL + isOp
return b_l + is_op
endfunction
let &cpo = s:cpo_save

View File

@ -3,7 +3,7 @@
" Maintainer: vim-perl <vim-perl@googlegroups.com>
" Homepage: http://github.com/vim-perl/vim-perl
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
" Last Change: 2017 Jun 13
" Last Change: 2017-01-04
" Suggestions and improvements by :
" Aaron J. Sherman (use syntax for hints)
@ -48,11 +48,6 @@ function! GetPerlIndent()
return 0
endif
" Don't reindent comments on first column
if cline =~ '^#.'
return 0
endif
" Get current syntax item at the line's first char
let csynid = ''
if b:indent_use_syntax
@ -134,6 +129,7 @@ function! GetPerlIndent()
\ || synid == "perlMatchStartEnd"
\ || synid == "perlHereDoc"
\ || synid == "perlBraces"
\ || synid == "perlStatementIndirObj"
\ || synid =~ "^perlFiledescStatement"
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
let brace = strpart(line, bracepos, 1)
@ -151,6 +147,7 @@ function! GetPerlIndent()
if synid == ""
\ || synid == "perlMatchStartEnd"
\ || synid == "perlBraces"
\ || synid == "perlStatementIndirObj"
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
let ind = ind - shiftwidth()
endif

View File

@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2017 Aug 19
" Last Change: 2017 Sep 10
" If there already is an option window, jump to that one.
let buf = bufnr('option-window')
@ -1225,6 +1225,8 @@ endif
call append("$", "iminsert\tin Insert mode: 1: use :lmap; 2: use IM; 0: neither")
call append("$", "\t(local to window)")
call <SID>OptionL("imi")
call append("$", "imstyle\tinput method style, 0: on-the-spot, 1: over-the-spot")
call <SID>OptionG("imst", &imst)
call append("$", "imsearch\tentering a search pattern: 1: use :lmap; 2: use IM; 0: neither")
call append("$", "\t(local to window)")
call <SID>OptionL("ims")

View File

@ -1,5 +1,5 @@
" matchit.vim: (global plugin) Extended "%" matching
" Last Change: 2017 March 26
" Last Change: 2017 Sep 15
" Maintainer: Benji Fisher PhD <benji@member.AMS.org>
" Version: 1.13.3, for Vim 6.3+
" Fix from Fernando Torres included.
@ -704,9 +704,8 @@ fun! s:MultiMatch(spflag, mode)
let skip = 's:comment\|string'
endif
let skip = s:ParseSkip(skip)
" let restore_cursor = line(".") . "G" . virtcol(".") . "|"
" normal! H
" let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
" save v:count1 variable, might be reset from the restore_cursor command
let level = v:count1
let restore_cursor = virtcol(".") . "|"
normal! g0
let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor
@ -726,7 +725,6 @@ fun! s:MultiMatch(spflag, mode)
execute "if " . skip . "| let skip = '0' | endif"
endif
mark '
let level = v:count1
while level
if searchpair(openpat, '', closepat, a:spflag, skip) < 1
call s:CleanUp(restore_options, a:mode, startline, startcol)

View File

@ -15,6 +15,11 @@
" Author: Bram Moolenaar
" Copyright: Vim license applies, see ":help license"
" In case this gets loaded twice.
if exists(':Termdebug')
finish
endif
" The command that starts debugging, e.g. ":Termdebug vim".
" To end type "quit" in the gdb window.
command -nargs=* -complete=file Termdebug call s:StartDebug(<q-args>)

View File

@ -136,7 +136,7 @@ syntax match clojureRegexpBoundary "[$^]" contained display
syntax match clojureRegexpQuantifier "[?*+][?+]\=" contained display
syntax match clojureRegexpQuantifier "\v\{\d+%(,|,\d+)?}\??" contained display
syntax match clojureRegexpOr "|" contained display
syntax match clojureRegexpBackRef "\v\\%([1-9]\d*|k\<[a-zA-z]+\>)" contained display
syntax match clojureRegexpBackRef "\v\\%([1-9]\d*|k\<[a-zA-Z]+\>)" contained display
" Mode modifiers, mode-modified spans, lookaround, regular and atomic
" grouping, and named-capturing.

File diff suppressed because one or more lines are too long

View File

@ -85,7 +85,7 @@ syn match formComment "\;\ *\*.*$" contains=formTodo
syn region formString start=+"+ end=+"+ contains=formSpecial
syn region formString start=+'+ end=+'+
syn region formNestedString start=+`+ end=+'+ contains=formNestedString
syn match formPreProc "^\=\#[a-zA-z][a-zA-Z0-9]*\>"
syn match formPreProc "^\=\#[a-zA-Z][a-zA-Z0-9]*\>"
syn match formNumber "\<\d\+\>"
syn match formNumber "\<\d\+\.\d*\>"
syn match formNumber "\.\d\+\>"
@ -94,13 +94,13 @@ syn match formNumber "-\.\d" contains=Number
syn match formNumber "i_\+\>"
syn match formNumber "fac_\+\>"
" pattern matching wildcards
syn match formNumber "?[A-z0-9]*"
syn match formNumber "?[a-zA-Z0-9]*"
" dollar-variables (new in 3.x)
syn match formNumber "\\$[A-z0-9]*"
syn match formNumber "\\$[a-zA-Z0-9]*"
" scalar products
syn match formNumber "^\=[a-zA-z][a-zA-Z0-9]*\.[a-zA-z][a-zA-Z0-9]*\>"
syn match formNumber "^\=[a-zA-Z][a-zA-Z0-9]*\.[a-zA-Z][a-zA-Z0-9]*\>"
syn match formDirective "^\=\.[a-zA-z][a-zA-Z0-9]*\>"
syn match formDirective "^\=\.[a-zA-Z][a-zA-Z0-9]*\>"
" hi User Labels
syn sync ccomment formComment minlines=10

View File

@ -1,15 +1,13 @@
" Vim syntax file
" Language: Mason (Perl embedded in HTML)
" Maintainer: Andrew Smith <andrewdsmith@yahoo.com>
" Last change: 2003 May 11
" URL: http://www.masonhq.com/editors/mason.vim
" Language: Mason (Perl embedded in HTML)
" Maintainer: vim-perl <vim-perl@googlegroups.com>
" Homepage: http://github.com/vim-perl/vim-perl/tree/master
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
" Last Change: 2017-09-12
" Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
" Andrew Smith <andrewdsmith@yahoo.com>
"
" This seems to work satisfactorily with html.vim and perl.vim for version 5.5.
" Please mail any fixes or improvements to the above address. Things that need
" doing include:
"
" - Add match for component names in <& &> blocks.
" - Add match for component names in <%def> and <%method> block delimiters.
" TODO:
" - Fix <%text> blocks to show HTML tags but ignore Mason tags.
"
@ -34,30 +32,38 @@ syn cluster htmlPreproc add=@masonTop
" Now pull in the Perl syntax.
"
syn include @perlTop syntax/perl.vim
unlet b:current_syntax
syn include @podTop syntax/pod.vim
" It's hard to reduce down to the correct sub-set of Perl to highlight in some
" of these cases so I've taken the safe option of just using perlTop in all of
" them. If you have any suggestions, please let me know.
"
syn region masonLine matchgroup=Delimiter start="^%" end="$" contains=@perlTop
syn region masonExpr matchgroup=Delimiter start="<%" end="%>" contains=@perlTop
syn region masonPerl matchgroup=Delimiter start="<%perl>" end="</%perl>" contains=@perlTop
syn region masonComp keepend matchgroup=Delimiter start="<&" end="&>" contains=@perlTop
syn region masonPod start="^=[a-z]" end="^=cut" keepend contained contains=@podTop
syn cluster perlTop remove=perlBraces
syn region masonLine matchgroup=Delimiter start="^%" end="$" keepend contains=@perlTop
syn region masonPerlComment start="#" end="\%(%>\)\@=\|$" contained contains=perlTodo,@Spell
syn region masonExpr matchgroup=Delimiter start="<%" end="%>" contains=@perlTop,masonPerlComment
syn region masonPerl matchgroup=Delimiter start="<%perl>" end="</%perl>" contains=masonPod,@perlTop
syn region masonComp keepend matchgroup=Delimiter start="<&\s*\%([-._/[:alnum:]]\+:\)\?[-._/[:alnum:]]*" end="&>" contains=@perlTop
syn region masonComp keepend matchgroup=Delimiter skipnl start="<&|\s*\%([-._/[:alnum:]]\+:\)\?[-._/[:alnum:]]*" end="&>" contains=@perlTop nextgroup=masonCompContent
syn region masonCompContent matchgroup=Delimiter start="" end="</&>" contained contains=@masonTop
syn region masonArgs matchgroup=Delimiter start="<%args>" end="</%args>" contains=@perlTop
syn region masonArgs matchgroup=Delimiter start="<%args>" end="</%args>" contains=masonPod,@perlTop
syn region masonInit matchgroup=Delimiter start="<%init>" end="</%init>" contains=@perlTop
syn region masonCleanup matchgroup=Delimiter start="<%cleanup>" end="</%cleanup>" contains=@perlTop
syn region masonOnce matchgroup=Delimiter start="<%once>" end="</%once>" contains=@perlTop
syn region masonShared matchgroup=Delimiter start="<%shared>" end="</%shared>" contains=@perlTop
syn region masonInit matchgroup=Delimiter start="<%init>" end="</%init>" contains=masonPod,@perlTop
syn region masonCleanup matchgroup=Delimiter start="<%cleanup>" end="</%cleanup>" contains=masonPod,@perlTop
syn region masonOnce matchgroup=Delimiter start="<%once>" end="</%once>" contains=masonPod,@perlTop
syn region masonClass matchgroup=Delimiter start="<%class>" end="</%class>" contains=masonPod,@perlTop
syn region masonShared matchgroup=Delimiter start="<%shared>" end="</%shared>" contains=masonPod,@perlTop
syn region masonDef matchgroup=Delimiter start="<%def[^>]*>" end="</%def>" contains=@htmlTop
syn region masonMethod matchgroup=Delimiter start="<%method[^>]*>" end="</%method>" contains=@htmlTop
syn region masonDef matchgroup=Delimiter start="<%def\s*[-._/[:alnum:]]\+\s*>" end="</%def>" contains=@htmlTop
syn region masonMethod matchgroup=Delimiter start="<%method\s*[-._/[:alnum:]]\+\s*>" end="</%method>" contains=@htmlTop
syn region masonFlags matchgroup=Delimiter start="<%flags>" end="</%flags>" contains=@perlTop
syn region masonAttr matchgroup=Delimiter start="<%attr>" end="</%attr>" contains=@perlTop
syn region masonFlags matchgroup=Delimiter start="<%flags>" end="</%flags>" contains=masonPod,@perlTop
syn region masonAttr matchgroup=Delimiter start="<%attr>" end="</%attr>" contains=masonPod,@perlTop
syn region masonFilter matchgroup=Delimiter start="<%filter>" end="</%filter>" contains=@perlTop
syn region masonFilter matchgroup=Delimiter start="<%filter>" end="</%filter>" contains=masonPod,@perlTop
syn region masonDoc matchgroup=Delimiter start="<%doc>" end="</%doc>"
syn region masonText matchgroup=Delimiter start="<%text>" end="</%text>"
@ -67,6 +73,8 @@ syn cluster masonTop contains=masonLine,masonExpr,masonPerl,masonComp,masonArgs,
" Set up default highlighting. Almost all of this is done in the included
" syntax files.
hi def link masonDoc Comment
hi def link masonPod Comment
hi def link masonPerlComment perlComment
let b:current_syntax = "mason"

View File

@ -3,7 +3,7 @@
" Maintainer: vim-perl <vim-perl@googlegroups.com>
" Homepage: http://github.com/vim-perl/vim-perl/tree/master
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
" Last Change: 2013-07-23
" Last Change: 2017-09-12
" Contributors: Andy Lester <andy@petdance.com>
" Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
" Lukas Mai <l.mai.web.de>
@ -28,8 +28,9 @@
" unlet perl_fold
" unlet perl_fold_blocks
" unlet perl_nofold_packages
" let perl_nofold_subs = 1
" unlet perl_nofold_subs
" unlet perl_fold_anonymous_subs
" unlet perl_no_subprototype_error
if exists("b:current_syntax")
finish
@ -38,11 +39,6 @@ endif
let s:cpo_save = &cpo
set cpo&vim
if exists('&regexpengine')
let s:regexpengine=&regexpengine
set regexpengine=1
endif
" POD starts with ^=<word> and ends with ^=cut
if !exists("perl_include_pod") || perl_include_pod == 1
@ -83,7 +79,7 @@ syn match perlControl "\<\%(BEGIN\|CHECK\|INIT\|END\|UNITCHECK\)\>\_s*" nextgr
syn match perlStatementStorage "\<\%(my\|our\|local\|state\)\>"
syn match perlStatementControl "\<\%(return\|last\|next\|redo\|goto\|break\)\>"
syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|uc\%(first\)\=\)\>"
syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|fc\|uc\%(first\)\=\)\>"
syn match perlStatementRegexp "\<\%(pos\|quotemeta\|split\|study\)\>"
syn match perlStatementNumeric "\<\%(abs\|atan2\|cos\|exp\|hex\|int\|log\|oct\|rand\|sin\|sqrt\|srand\)\>"
syn match perlStatementList "\<\%(splice\|unshift\|shift\|push\|pop\|join\|reverse\|grep\|map\|sort\|unpack\)\>"
@ -94,9 +90,9 @@ syn match perlStatementFiledesc "\<\%(fcntl\|flock\|ioctl\|open\%(dir\)\=\|read
syn match perlStatementVector "\<vec\>"
syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdir\|readlink\|rename\|rmdir\|symlink\|umask\|unlink\|utime\)\>"
syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>"
syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\)\>"
syn match perlStatementInclude "\<\%(require\|import\)\>"
syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\="
syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\|evalbytes\)\>"
syn match perlStatementInclude "\<\%(require\|import\|unimport\)\>"
syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autodie\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|overloading\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\="
syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>"
syn match perlStatementSocket "\<\%(accept\|bind\|connect\|get\%(peername\|sock\%(name\|opt\)\)\|listen\|recv\|send\|setsockopt\|shutdown\|socket\%(pair\)\=\)\>"
syn match perlStatementIPC "\<\%(msg\%(ctl\|get\|rcv\|snd\)\|sem\%(ctl\|get\|op\)\|shm\%(ctl\|get\|read\|write\)\)\>"
@ -108,7 +104,7 @@ syn match perlStatementMisc "\<\%(warn\|format\|formline\|reset\|scalar\|protot
syn keyword perlTodo TODO TODO: TBD TBD: FIXME FIXME: XXX XXX: NOTE NOTE: contained
syn region perlStatementIndirObjWrap matchgroup=perlStatementIndirObj start="\<\%(map\|grep\|sort\|printf\=\|say\|system\|exec\)\>\s*{" end="}" contains=@perlTop,perlBraces extend
syn region perlStatementIndirObjWrap matchgroup=perlStatementIndirObj start="\%(\<\%(map\|grep\|sort\|printf\=\|say\|system\|exec\)\>\s*\)\@<={" end="}" transparent extend
syn match perlLabel "^\s*\h\w*\s*::\@!\%(\<v\d\+\s*:\)\@<!"
@ -125,7 +121,7 @@ syn match perlLabel "^\s*\h\w*\s*::\@!\%(\<v\d\+\s*:\)\@<!"
" Special variables first ($^A, ...) and ($|, $', ...)
syn match perlVarPlain "$^[ACDEFHILMNOPRSTVWX]\="
syn match perlVarPlain "$[\\\"\[\]'&`+*.,;=%~!?@#$<>(-]"
syn match perlVarPlain "%+"
syn match perlVarPlain "@[-+]"
syn match perlVarPlain "$\%(0\|[1-9]\d*\)"
" Same as above, but avoids confusion in $::foo (equivalent to $main::foo)
syn match perlVarPlain "$::\@!"
@ -143,41 +139,46 @@ syn match perlPackageRef "[$@#%*&]\%(\%(::\|'\)\=\I\i*\%(\%(::\|'\)\I\i*\)*\)\
" just set the variable "perl_no_extended_vars"...
if !exists("perl_no_scope_in_variables")
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
else
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)"
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
endif
syn match perlVarPlain2 "%[-+]"
if !exists("perl_no_extended_vars")
syn cluster perlExpr contains=perlStatementIndirObjWrap,perlStatementScalar,perlStatementRegexp,perlStatementNumeric,perlStatementList,perlStatementHash,perlStatementFiles,perlStatementTime,perlStatementMisc,perlVarPlain,perlVarPlain2,perlVarNotInMatches,perlVarSlash,perlVarBlock,perlVarBlock2,perlShellCommand,perlFloat,perlNumber,perlStringUnexpanded,perlString,perlQQ,perlArrow,perlBraces
syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
syn region perlArrow matchgroup=perlArrow start="->\s*\$*\I\i*\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
syn match perlVarSimpleMember "\%(->\)\={\s*\I\i*\s*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contains=perlVarSimpleMemberName contained extend
syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
syn region perlArrow matchgroup=perlArrow start="->\s*\$*\I\i*\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
syn match perlVarSimpleMember "\%(->\)\={\s*\I\i*\s*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contains=perlVarSimpleMemberName contained extend
syn match perlVarSimpleMemberName "\I\i*" contained
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
syn match perlPackageConst "__PACKAGE__" nextgroup=perlMethod
syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
syn match perlPackageConst "__PACKAGE__" nextgroup=perlMethod,perlPostDeref
syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
syn match perlPostDeref "->\%($#\|[$@%&*]\)\*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
syn region perlPostDeref start="->\%($#\|[$@%&*]\)\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
syn region perlPostDeref matchgroup=perlPostDeref start="->\%($#\|[$@%&*]\){" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
endif
" File Descriptors
syn match perlFiledescRead "<\h\w*>"
syn match perlFiledescStatementComma "(\=\s*\u\w*\s*,"me=e-1 transparent contained contains=perlFiledescStatement
syn match perlFiledescStatementNocomma "(\=\s*\u\w*\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement
syn match perlFiledescStatementComma "(\=\s*\<\u\w*\>\s*,"me=e-1 transparent contained contains=perlFiledescStatement
syn match perlFiledescStatementNocomma "(\=\s*\<\u\w*\>\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement
syn match perlFiledescStatement "\u\w*" contained
syn match perlFiledescStatement "\<\u\w*\>" contained
" Special characters in strings and matches
syn match perlSpecialString "\\\%(\o\{1,3}\|x\%({\x\+}\|\x\{1,2}\)\|c.\|[^cx]\)" contained extend
@ -241,20 +242,18 @@ syn region perlAnglesDQ start=+<+ end=+>+ extend contained contains=perlAnglesD
" Simple version of searches and matches
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1[msixpodualgc]*+ contains=@perlInterpMatch keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m#+ end=+#[msixpodualgc]*+ contains=@perlInterpMatch keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*'+ end=+'[msixpodualgc]*+ contains=@perlInterpSQ keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*/+ end=+/[msixpodualgc]*+ contains=@perlInterpSlash keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*(+ end=+)[msixpodualgc]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
" A special case for m{}, m<> and m[] which allows for comments and extra whitespace in the pattern
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*{+ end=+}[msixpodualgc]*+ contains=@perlInterpMatch,perlComment,perlBracesDQ extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*<+ end=+>[msixpodualgc]*+ contains=@perlInterpMatch,perlAnglesDQ keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*\[+ end=+\][msixpodualgc]*+ contains=@perlInterpMatch,perlComment,perlBracketsDQ keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1[msixpodualgcn]*+ contains=@perlInterpMatch keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m#+ end=+#[msixpodualgcn]*+ contains=@perlInterpMatch keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*'+ end=+'[msixpodualgcn]*+ contains=@perlInterpSQ keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*/+ end=+/[msixpodualgcn]*+ contains=@perlInterpSlash keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*(+ end=+)[msixpodualgcn]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*{+ end=+}[msixpodualgcn]*+ contains=@perlInterpMatch,perlBracesDQ extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*<+ end=+>[msixpodualgcn]*+ contains=@perlInterpMatch,perlAnglesDQ keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*\[+ end=+\][msixpodualgcn]*+ contains=@perlInterpMatch,perlBracketsDQ keepend extend
" Below some hacks to recognise the // variant. This is virtually impossible to catch in all
" cases as the / is used in so many other ways, but these should be the most obvious ones.
syn region perlMatch matchgroup=perlMatchStartEnd start="\%([$@%&*]\@<!\%(\<split\|\<while\|\<if\|\<unless\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=/\%(/=\)\@!" start=+^/\%(/=\)\@!+ start=+\s\@<=/\%(/=\)\@![^[:space:][:digit:]$@%=]\@=\%(/\_s*\%([([{$@%&*[:digit:]"'`]\|\_s\w\|[[:upper:]_abd-fhjklnqrt-wyz]\)\)\@!+ skip=+\\/+ end=+/[msixpodualgc]*+ contains=@perlInterpSlash extend
syn region perlMatch matchgroup=perlMatchStartEnd start="\%([$@%&*]\@<!\%(\<split\|\<while\|\<if\|\<unless\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=/\%(/=\)\@!" start=+^/\%(/=\)\@!+ start=+\s\@<=/\%(/=\)\@![^[:space:][:digit:]$@%=]\@=\%(/\_s*\%([([{$@%&*[:digit:]"'`]\|\_s\w\|[[:upper:]_abd-fhjklnqrt-wyz]\)\)\@!+ skip=+\\/+ end=+/[msixpodualgcn]*+ contains=@perlInterpSlash extend
" Substitutions
@ -267,12 +266,12 @@ syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*<+ end=+>+ contains=@perlInterpMatch,perlAnglesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*\[+ end=+\]+ contains=@perlInterpMatch,perlBracketsDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*{+ end=+}+ contains=@perlInterpMatch,perlBracesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1[msixpodualgcer]*+ keepend contained contains=@perlInterpDQ extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlParensDQ keepend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][msixpodualgcer]*+ contained contains=@perlInterpDQ,perlBracketsDQ keepend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlBracesDQ keepend extend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend
syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[msixpodualgcer]*+ contained contains=@perlInterpSQ keepend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1[msixpodualgcern]*+ keepend contained contains=@perlInterpDQ extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlParensDQ keepend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][msixpodualgcern]*+ contained contains=@perlInterpDQ,perlBracketsDQ keepend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlBracesDQ keepend extend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend
syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[msixpodualgcern]*+ contained contains=@perlInterpSQ keepend extend
" Translations
" perlMatch is the first part, perlTranslation* is the second, translator part.
@ -314,35 +313,40 @@ syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\>\s*\z([^[:space:]#([{<'/]\)+ end=+\z1[imosx]*+ contains=@perlInterpMatch keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*/+ end=+/[imosx]*+ contains=@perlInterpSlash keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr#+ end=+#[imosx]*+ contains=@perlInterpMatch keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*'+ end=+'[imosx]*+ contains=@perlInterpSQ keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*(+ end=+)[imosx]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\>\s*\z([^[:space:]#([{<'/]\)+ end=+\z1[imosxdual]*+ contains=@perlInterpMatch keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*/+ end=+/[imosxdual]*+ contains=@perlInterpSlash keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr#+ end=+#[imosxdual]*+ contains=@perlInterpMatch keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*'+ end=+'[imosxdual]*+ contains=@perlInterpSQ keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*(+ end=+)[imosxdual]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
" A special case for qr{}, qr<> and qr[] which allows for comments and extra whitespace in the pattern
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*{+ end=+}[imosx]*+ contains=@perlInterpMatch,perlBracesDQ,perlComment keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*<+ end=+>[imosx]*+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*\[+ end=+\][imosx]*+ contains=@perlInterpMatch,perlBracketsDQ,perlComment keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*{+ end=+}[imosxdual]*+ contains=@perlInterpMatch,perlBracesDQ,perlComment keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*<+ end=+>[imosxdual]*+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*\[+ end=+\][imosxdual]*+ contains=@perlInterpMatch,perlBracketsDQ,perlComment keepend extend
" Constructs such as print <<EOF [...] EOF, 'here' documents
"
" XXX Any statements after the identifier are in perlString colour (i.e.
" 'if $a' in 'print <<EOF if $a'). This is almost impossible to get right it
" seems due to the 'auto-extending nature' of regions.
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\z(\I\i*\)+ end=+$+ contains=@perlTop oneline
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+$+ contains=@perlTop oneline
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+$+ contains=@perlTop oneline
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*""+ end=+$+ contains=@perlTop oneline
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*''+ end=+$+ contains=@perlTop oneline
if exists("perl_fold")
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ fold extend
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ fold extend
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ fold extend
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine fold extend
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine fold extend
syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ fold extend
syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine fold extend
syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine fold extend
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL fold extend
else
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine
syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ
syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine
syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL
endif
@ -356,28 +360,22 @@ syn keyword perlStatementPackage package contained
" sub [name] [(prototype)] {
"
syn match perlSubError "[^[:space:];{#]" contained
if v:version == 701 && !has('patch221') " XXX I hope that's the right one
syn match perlSubAttributes ":" contained
syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup
syn match perlSubAttributes "" contained nextgroup=perlSubError
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
if get(g:, "perl_sub_signatures", 0)
syn match perlSignature +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained
else
syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup
syn match perlSubAttributes "" contained nextgroup=perlSubError
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
syn match perlSubPrototype +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
endif
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
syn match perlSubPrototype +(\_[^)]*)\_s*\|+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlComment
syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlSignature,perlSubAttributes,perlComment
syn match perlFunction +\<sub\>\_s*+ nextgroup=perlSubName
if !exists("perl_no_scope_in_variables")
syn match perlFunctionPRef "\h\w*::" contained
syn match perlFunctionName "\h\w*[^:]" contained
else
syn match perlFunctionName "\h[[:alnum:]_:]*" contained
endif
" The => operator forces a bareword to the left of it to be interpreted as
" a string
syn match perlString "\I\@<!-\?\I\i*\%(\s*=>\)\@="
@ -397,10 +395,10 @@ syn match perlFormatField "@$" contained
" __END__ and __DATA__ clauses
if exists("perl_fold")
syntax region perlDATA start="^__DATA__$" skip="." end="." fold
syntax region perlDATA start="^__DATA__$" skip="." end="." contains=@perlDATA fold
syntax region perlDATA start="^__END__$" skip="." end="." contains=perlPOD,@perlDATA fold
else
syntax region perlDATA start="^__DATA__$" skip="." end="."
syntax region perlDATA start="^__DATA__$" skip="." end="." contains=@perlDATA
syntax region perlDATA start="^__END__$" skip="." end="." contains=perlPOD,@perlDATA
endif
@ -414,9 +412,9 @@ if exists("perl_fold")
syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend
endif
if !exists("perl_nofold_subs")
if exists("perl_fold_anonymous_subs") && perl_fold_anonymous_subs
syn region perlSubFold start="\<sub\>[^\n;]*{" end="}" transparent fold keepend extend
syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\)\>\s*{" end="}" transparent fold keepend
if get(g:, "perl_fold_anonymous_subs", 0)
syn region perlSubFold start="\<sub\>[^{]*{" end="}" transparent fold keepend extend
syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\)\>\s*{" end="}" transparent fold keepend
else
syn region perlSubFold start="^\z(\s*\)\<sub\>.*[^};]$" end="^\z1}\s*\%(#.*\)\=$" transparent fold keepend
syn region perlSubFold start="^\z(\s*\)\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend
@ -424,7 +422,7 @@ if exists("perl_fold")
endif
if exists("perl_fold_blocks")
syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)foreach\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)for\%(each\)\=\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*while" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
endif
@ -435,7 +433,6 @@ else
syn sync minlines=0
endif
" NOTE: If you're linking new highlight groups to perlString, please also put
" them into b:match_skip in ftplugin/perl.vim.
@ -458,6 +455,7 @@ hi def link perlOperator Operator
hi def link perlFunction Keyword
hi def link perlSubName Function
hi def link perlSubPrototype Type
hi def link perlSignature Type
hi def link perlSubAttributes PreProc
hi def link perlSubAttributesCont perlSubAttributes
hi def link perlComment Comment
@ -516,8 +514,11 @@ hi def link perlStatementMisc perlStatement
hi def link perlStatementIndirObj perlStatement
hi def link perlFunctionName perlIdentifier
hi def link perlMethod perlIdentifier
hi def link perlPostDeref perlIdentifier
hi def link perlFunctionPRef perlType
hi def link perlPOD perlComment
if !get(g:, 'perl_include_pod', 1)
hi def link perlPOD perlComment
endif
hi def link perlShellCommand perlString
hi def link perlSpecialAscii perlSpecial
hi def link perlSpecialDollar perlSpecial
@ -548,7 +549,6 @@ hi def link perlElseIfError Error
hi def link perlSubPrototypeError Error
hi def link perlSubError Error
" Syncing to speed up processing
"
if !exists("perl_no_sync_on_sub")
@ -575,11 +575,6 @@ syn sync match perlSyncPOD grouphere NONE "^=cut"
let b:current_syntax = "perl"
if exists('&regexpengine')
let &regexpengine=s:regexpengine
unlet s:regexpengine
endif
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -4,7 +4,7 @@
" Previously: Scott Bigham <dsb@killerbunnies.org>
" Homepage: http://github.com/vim-perl/vim-perl
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
" Last Change: 2013-07-21
" Last Change: 2017-09-12
" To add embedded POD documentation highlighting to your syntax file, add
" the commands:
@ -68,7 +68,7 @@ syn match podEscape2 "\d\+>"me=e-1 contained contains=@NoSpell
hi def link podCommand Statement
hi def link podCmdText String
hi def link podOverIndent Number
hi def link podOverIndent Number
hi def link podForKeywd Identifier
hi def link podFormat Identifier
hi def link podVerbatimLine PreProc
@ -76,7 +76,6 @@ hi def link podSpecial Identifier
hi def link podEscape String
hi def link podEscape2 Number
if exists("perl_pod_spellcheck_headings")
" Spell-check headings
syn clear podCmdText

View File

@ -1,7 +1,7 @@
" Vim syntax file
" Language: readline(3) configuration file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2012-04-25
" Latest Revision: 2017-06-25
" readline_has_bash - if defined add support for bash specific
" settings/functions
@ -119,6 +119,7 @@ syn keyword readlineVariable contained
\ nextgroup=readlineBoolean
\ skipwhite
\ bind-tty-special-chars
\ colored-stats
\ completion-ignore-case
\ completion-map-case
\ convert-meta
@ -142,6 +143,7 @@ syn keyword readlineVariable contained
\ revert-all-at-newline
\ show-all-if-ambiguous
\ show-all-if-unmodified
\ show-mode-in-prompt
\ skip-completed-text
\ visible-stats
@ -158,6 +160,7 @@ syn keyword readlineVariable contained
\ completion-prefix-display-length
\ completion-query-items
\ history-size
\ keyseq-timeout
syn keyword readlineVariable contained
\ nextgroup=readlineEditingMode

97
runtime/syntax/tap.vim Normal file
View File

@ -0,0 +1,97 @@
" Vim syntax file
" Language: Verbose TAP Output
" Maintainer: Rufus Cable <rufus@threebytesfull.com>
" Remark: Simple syntax highlighting for TAP output
" License:
" Copyright: (c) 2008-2013 Rufus Cable
" Last Change: 2014-12-13
if exists("b:current_syntax")
finish
endif
syn match tapTestDiag /^ *#.*/ contains=tapTestTodo
syn match tapTestTime /^ *\[\d\d:\d\d:\d\d\].*/ contains=tapTestFile
syn match tapTestFile /\w\+\/[^. ]*/ contained
syn match tapTestFileWithDot /\w\+\/[^ ]*/ contained
syn match tapTestPlan /^ *\d\+\.\.\d\+$/
" tapTest is a line like 'ok 1', 'not ok 2', 'ok 3 - xxxx'
syn match tapTest /^ *\(not \)\?ok \d\+.*/ contains=tapTestStatusOK,tapTestStatusNotOK,tapTestLine
" tapTestLine is the line without the ok/not ok status - i.e. number and
" optional message
syn match tapTestLine /\d\+\( .*\|$\)/ contains=tapTestNumber,tapTestLoadMessage,tapTestTodo,tapTestSkip contained
" turn ok/not ok messages green/red respectively
syn match tapTestStatusOK /ok/ contained
syn match tapTestStatusNotOK /not ok/ contained
" highlight todo tests
syn match tapTestTodo /\(# TODO\|Failed (TODO)\) .*$/ contained contains=tapTestTodoRev
syn match tapTestTodoRev /\<TODO\>/ contained
" highlight skipped tests
syn match tapTestSkip /# skip .*$/ contained contains=tapTestSkipTag
syn match tapTestSkipTag /\(# \)\@<=skip\>/ contained
" look behind so "ok 123" and "not ok 124" match test number
syn match tapTestNumber /\(ok \)\@<=\d\d*/ contained
syn match tapTestLoadMessage /\*\*\*.*\*\*\*/ contained contains=tapTestThreeStars,tapTestFileWithDot
syn match tapTestThreeStars /\*\*\*/ contained
syn region tapTestRegion start=/^ *\(not \)\?ok.*$/me=e+1 end=/^\(\(not \)\?ok\|# Looks like you planned \|All tests successful\|Bailout called\)/me=s-1 fold transparent excludenl
syn region tapTestResultsOKRegion start=/^\(All tests successful\|Result: PASS\)/ end=/$/
syn region tapTestResultsNotOKRegion start=/^\(# Looks like you planned \|Bailout called\|# Looks like you failed \|Result: FAIL\)/ end=/$/
syn region tapTestResultsSummaryRegion start=/^Test Summary Report/ end=/^Files=.*$/ contains=tapTestResultsSummaryHeading,tapTestResultsSummaryNotOK
syn region tapTestResultsSummaryHeading start=/^Test Summary Report/ end=/^-\+$/ contained
syn region tapTestResultsSummaryNotOK start=/TODO passed:/ end=/$/ contained
syn region tapTestInstructionsRegion start=/\%1l/ end=/^$/
set foldtext=TAPTestLine_foldtext()
function! TAPTestLine_foldtext()
let line = getline(v:foldstart)
let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
return sub
endfunction
set foldminlines=5
set foldcolumn=2
set foldenable
set foldmethod=syntax
syn sync fromstart
if !exists("did_tapverboseoutput_syntax_inits")
let did_tapverboseoutput_syntax_inits = 1
hi tapTestStatusOK term=bold ctermfg=green guifg=Green
hi tapTestStatusNotOK term=reverse ctermfg=black ctermbg=red guifg=Black guibg=Red
hi tapTestTodo term=bold ctermfg=yellow ctermbg=black guifg=Yellow guibg=Black
hi tapTestTodoRev term=reverse ctermfg=black ctermbg=yellow guifg=Black guibg=Yellow
hi tapTestSkip term=bold ctermfg=lightblue guifg=LightBlue
hi tapTestSkipTag term=reverse ctermfg=black ctermbg=lightblue guifg=Black guibg=LightBlue
hi tapTestTime term=bold ctermfg=blue guifg=Blue
hi tapTestFile term=reverse ctermfg=black ctermbg=yellow guibg=Black guifg=Yellow
hi tapTestLoadedFile term=bold ctermfg=black ctermbg=cyan guibg=Cyan guifg=Black
hi tapTestThreeStars term=reverse ctermfg=blue guifg=Blue
hi tapTestPlan term=bold ctermfg=yellow guifg=Yellow
hi link tapTestFileWithDot tapTestLoadedFile
hi link tapTestNumber Number
hi link tapTestDiag Comment
hi tapTestRegion ctermbg=green
hi tapTestResultsOKRegion ctermbg=green ctermfg=black
hi tapTestResultsNotOKRegion ctermbg=red ctermfg=black
hi tapTestResultsSummaryHeading ctermbg=blue ctermfg=white
hi tapTestResultsSummaryNotOK ctermbg=red ctermfg=black
hi tapTestInstructionsRegion ctermbg=lightmagenta ctermfg=black
endif
let b:current_syntax="tapVerboseOutput"

View File

@ -3,10 +3,10 @@
" Author: Moriki, Atsushi <4woods+vim@gmail.com>
" Homepage: http://github.com/vim-perl/vim-perl
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
" Last Change: 2013-07-21
" Last Change: 2015-04-25
"
" Instration:
" put tt2.vim and tt2html.vim in to your syntax diretory.
" Installation:
" put tt2.vim and tt2html.vim in to your syntax directory.
"
" add below in your filetype.vim.
" au BufNewFile,BufRead *.tt2 setf tt2

View File

@ -78,7 +78,7 @@ syn case match
" Function Names {{{2
syn keyword vimFuncName contained abs append argv assert_fails assert_notequal atan2 buflisted bufwinid byteidxcomp ch_close_in ch_getjob ch_open ch_sendraw char2nr complete copy cscope_connection did_filetype escape execute expand filewritable float2nr fnamemodify foldtext function getbufline getcharsearch getcmdwintype getfontname getftype getpid getregtype getwininfo glob has_key histdel hlexists index inputrestore invert items job_start js_decode json_encode libcall line2byte log map match matcharg matchlist max mode nr2char perleval printf pyeval reltime remote_expr remote_read rename reverse screenchar search searchpairpos serverlist setcmdpos setloclist setqflist settabwinvar shellescape sin soundfold split str2nr strdisplaywidth stridx strpart strwidth synID synconcealed systemlist tabpagewinnr tan test_alloc_fail test_garbagecollect_now test_null_job test_null_string timer_pause timer_stopall tr undofile values wildmenumode win_gotoid winbufnr winline winrestview wordcount
syn keyword vimFuncName contained acos argc asin assert_false assert_notmatch browse bufloaded bufwinnr call ch_evalexpr ch_info ch_read ch_setoptions cindent complete_add cos cursor diff_filler eval exepath extend filter floor foldclosed foldtextresult garbagecollect getbufvar getcmdline getcompletion getfperm getline getpos gettabinfo getwinposx glob2regpat haslocaldir histget hostname input inputsave isdirectory job_getchannel job_status js_encode keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr min mzeval or pow pumvisible range reltimefloat remote_foreground remote_send repeat round screencol searchdecl searchpos setbufvar setfperm setmatches setreg setwinvar shiftwidth sinh spellbadword sqrt strcharpart strftime string strridx submatch synIDattr synstack tabpagebuflist tagfiles tanh test_autochdir test_null_channel test_null_list test_settime timer_start tolower trunc undotree virtcol win_findbuf win_id2tabwin wincol winnr winsaveview writefile
syn keyword vimFuncName contained acos argc asin assert_false assert_notmatch browse bufloaded bufwinnr call ch_evalexpr ch_info ch_read ch_setoptions cindent complete_add cos cursor diff_filler eval exepath extend filter floor foldclosed foldtextresult garbagecollect getbufvar getcmdline getcompletion getfperm getline getpos gettabinfo getwinposx glob2regpat haslocaldir histget hostname input inputsave isdirectory job_getchannel job_status js_encode keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr min mzeval or pow pumvisible range reltimefloat remote_foreground remote_send repeat round screencol searchdecl searchpos setbufline setbufvar setfperm setmatches setreg setwinvar shiftwidth sinh spellbadword sqrt strcharpart strftime string strridx submatch synIDattr synstack tabpagebuflist tagfiles tanh test_autochdir test_null_channel test_null_list test_settime timer_start tolower trunc undotree virtcol win_findbuf win_id2tabwin wincol winnr winsaveview writefile
syn keyword vimFuncName contained add argidx assert_equal assert_inrange assert_true browsedir bufname byte2line ceil ch_evalraw ch_log ch_readraw ch_status clearmatches complete_check cosh deepcopy diff_hlID eventhandler exists feedkeys finddir fmod foldclosedend foreground get getchar getcmdpos getcurpos getfsize getloclist getqflist gettabvar getwinposy globpath hasmapto histnr iconv inputdialog inputsecret islocked job_info job_stop json_decode len line localtime luaeval mapcheck matchaddpos matchend matchstrpos mkdir nextnonblank pathshorten prevnonblank py3eval readfile reltimestr remote_peek remove resolve screenattr screenrow searchpair server2client setcharsearch setline setpos settabvar sha256 simplify sort spellsuggest str2float strchars strgetchar strlen strtrans substitute synIDtrans system tabpagenr taglist tempname test_disable_char_avail test_null_dict test_null_partial timer_info timer_stop toupper type uniq visualmode win_getid win_id2win winheight winrestcmd winwidth xor
syn keyword vimFuncName contained and arglistid assert_exception assert_match atan bufexists bufnr byteidx ch_close ch_getbufnr ch_logfile ch_sendexpr changenr col confirm count delete empty executable exp filereadable findfile fnameescape foldlevel funcref getbufinfo getcharmod getcmdtype getcwd getftime getmatches getreg gettabwinvar getwinvar has histadd hlID indent inputlist insert isnan job_setoptions join

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@
ATTENTION:
The commands in the lessons will modify the text. Make a copy of this
file to practise on (if you started "vimtutor" this is already a copy).
file to practice on (if you started "vimtutor" this is already a copy).
It is important to remember that this tutor is set up to teach by
use. That means that you need to execute the commands to learn them

View File

@ -12,7 +12,7 @@
ATTENTION:
The commands in the lessons will modify the text. Make a copy of this
file to practise on (if you started "vimtutor" this is already a copy).
file to practice on (if you started "vimtutor" this is already a copy).
It is important to remember that this tutor is set up to teach by
use. That means that you need to execute the commands to learn them

File diff suppressed because it is too large Load Diff