*:vie* *:view*
:vie[w][!] [++opt] [+cmd] file
- When used in Ex mode: Leave |Ex mode|, go back to
+ When used in Ex mode: Leave |Ex-mode|, go back to
Normal mode. Otherwise same as |:edit|, but set
'readonly' option for this buffer. {not in Vi}
-*eval.txt* For Vim version 8.0. Last change: 2017 Mar 04
+*eval.txt* For Vim version 8.0. Last change: 2017 Mar 09
VIM REFERENCE MANUAL by Bram Moolenaar
*v:testing* *testing-variable*
v:testing Must be set before using `test_garbagecollect_now()`.
+ Also, when set certain error messages won't be shown for 2
+ seconds. (e.g. "'dictionary' option is empty")
*v:this_session* *this_session-variable*
v:this_session Full filename of the last loaded or saved session file. See
Set a flag to enable the effect of 'autochdir' before Vim
startup has finished.
- *test_disable_char_avail()*
-test_disable_char_avail({expr})
- When {expr} is 1 the internal char_avail() function will
- return |FALSE|. When {expr} is 0 the char_avail() function will
- function normally.
- Only use this for a test where typeahead causes the test not
- to work. E.g., to trigger the CursorMovedI autocommand event.
-
test_garbagecollect_now() *test_garbagecollect_now()*
Like garbagecollect(), but executed right away. This must
only be called directly to avoid any structure to exist
test_null_string() *test_null_string()*
Return a String that is null. Only useful for testing.
+test_override({name}, {val}) *test_override()*
+ Overrides certain parts of Vims internal processing to be able
+ to run tests. Only to be used for testing Vim!
+ The override is enabled when {val} is non-zero and removed
+ when {val} is zero.
+ Current supported values for name are:
+
+ name effect when {val} is non-zero ~
+ redraw disable the redrawing() function
+ char_avail disable the char_avail() function
+ ALL clear all overrides ({val} is not used)
+
test_settime({expr}) *test_settime()*
Set the time Vim uses internally. Currently only used for
timestamps in the history, as they are used in viminfo, and
-*if_pyth.txt* For Vim version 8.0. Last change: 2017 Feb 18
+*if_pyth.txt* For Vim version 8.0. Last change: 2017 Mar 09
VIM REFERENCE MANUAL by Paul Moore
9. Dynamic loading |python-dynamic|
10. Python 3 |python3|
11. Python X |python_x|
+12. Building with Python support |python-building|
{Vi does not have any of these commands}
set pyx=3
endif
+==============================================================================
+12. Building with Python support *python-building*
+
+A few hints for building with Python 2 or 3 support.
+
+UNIX
+
+See src/Makefile for how to enable including the Python interface.
+
+On Ubuntu you will want to install these packages for Python 2:
+ python
+ python-dev
+For Python 3:
+ python3
+ pytyon3-dev
+For Python 3.6:
+ python3.6
+ pytyon3.6-dev
+
+If you have more than one version of Python 3, you need to link python3 to the
+one you prefer, before running configure.
+
==============================================================================
vim:tw=78:ts=8:ft=help:norl:
-*map.txt* For Vim version 8.0. Last change: 2016 Oct 15
+*map.txt* For Vim version 8.0. Last change: 2017 Mar 10
VIM REFERENCE MANUAL by Bram Moolenaar
*map-comments*
It is not possible to put a comment after these commands, because the '"'
-character is considered to be part of the {lhs} or {rhs}.
+character is considered to be part of the {lhs} or {rhs}. However, one can
+use |", since this starts a new, empty command with a comment.
*map_bar* *map-bar*
Since the '|' character is used to separate a map command from the next
-*motion.txt* For Vim version 8.0. Last change: 2016 Nov 24
+*motion.txt* For Vim version 8.0. Last change: 2017 Mar 12
VIM REFERENCE MANUAL by Bram Moolenaar
*$* *<End>* *<kEnd>*
$ or <End> To the end of the line. When a count is given also go
- [count - 1] lines downward |inclusive|.
+ [count - 1] lines downward. |inclusive| motion.
In Visual mode the cursor goes to just after the last
character in the line.
When 'virtualedit' is active, "$" may move the cursor
-*options.txt* For Vim version 8.0. Last change: 2017 Mar 05
+*options.txt* For Vim version 8.0. Last change: 2017 Mar 09
VIM REFERENCE MANUAL by Bram Moolenaar
which can be easier to read at certain sizes on certain displays.
Setting this option can sometimes cause problems if 'guifont' is set
to its default (empty string).
+ NOTE: This option is reset when 'compatible' is set.
*'autochdir'* *'acd'* *'noautochdir'* *'noacd'*
'autochdir' 'acd' boolean (default off)
- Disable the use of 'keymap' (without changing its value).
Note that 'arabicshape' and 'delcombine' are not reset (it is a global
option).
+ NOTE: This option is reset when 'compatible' is set.
Also see |arabic.txt|.
*'arabicshape'* *'arshape'*
form.
Arabic is a complex language which requires other settings, for
further details see |arabic.txt|.
+ NOTE: This option is set when 'compatible' is set.
*'autoindent'* *'ai'* *'noautoindent'* *'noai'*
'autoindent' 'ai' boolean (default off)
the system may refuse to do this. In that case the "auto" value will
again not rename the file.
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
*'backupdir'* *'bdir'*
'backupdir' 'bdir' string (default for Amiga: ".,t:",
for MS-DOS and Win32: ".,$TEMP,c:/tmp,c:/temp"
< When they are supported "\n" characters will start a new line. If the
expression evaluates to a |List| this is equal to using each List item
as a string and putting "\n" in between them.
+ NOTE: This option is set to "" when 'compatible' is set.
*'belloff'* *'bo'*
'belloff' 'bo' string (default "")
wildmode More matches in |cmdline-completion| available
(depends on the 'wildmode' setting).
- This is most useful, to fine tune when in insert mode the bell should
- be rung. For normal mode and ex commands, the bell is often rung to
+ This is most useful to fine tune when in Insert mode the bell should
+ be rung. For Normal mode and Ex commands, the bell is often rung to
indicate that an error occurred. It can be silenced by adding the
"error" keyword.
Every wrapped line will continue visually indented (same amount of
space as the beginning of that line), thus preserving horizontal blocks
of text.
+ NOTE: This option is reset when 'compatible' is set.
*'breakindentopt'* *'briopt'*
'breakindentopt' 'briopt' string (default empty)
:exe "set cedit=\<Esc>"
< |Nvi| also has this option, but it only uses the first character.
See |cmdwin|.
+ NOTE: This option is set to the Vim default value when 'compatible'
+ is reset.
*'charconvert'* *'ccv'* *E202* *E214* *E513*
'charconvert' 'ccv' string (default "")
set to its Vim default when 'compatible' is unset.
The {effect} column summarises the change when 'compatible' is set.
- option ? set value effect
+ option ? set value effect ~
'allowrevins' + off no CTRL-_ command
'antialias' + off don't use antialiased fonts
'cscopepathcomp'+ 0 don't show directories in tags list
'cscoperelative'+ off
'cscopetag' + off don't use cscope for ":tag"
- 'cscopetagorder' 0 see |cscopetagorder|
+ 'cscopetagorder'+ 0 see |cscopetagorder|
'cscopeverbose' + off see |cscopeverbose|
'delcombine' + off unicode: delete whole char combination
'digraph' + off no digraphs
'tildeop' + off tilde is not an operator
'ttimeout' + off no terminal timeout
'undofile' + off don't use an undo file
- 'viminfo' - {unchanged} {set vim default only on resetting 'cp'}
+ 'viminfo' - {unchanged} {set Vim default only on resetting 'cp'}
'virtualedit' + "" cursor can only be placed on characters
'whichwrap' & "" left-right movements don't wrap
'wildchar' & CTRL-E only when the current value is <Tab>
existing line. 'expandtab' has no effect on these characters, a Tab
remains a Tab. If the new indent is greater than on the existing
line, the remaining space is filled in the normal manner.
- NOTE: 'copyindent' is reset when 'compatible' is set.
+ NOTE: This option is reset when 'compatible' is set.
Also see 'preserveindent'.
*'cpoptions'* *'cpo'* *cpo*
{not in Vi}
Determines how many components of the path to show in a list of tags.
See |cscopepathcomp|.
+ NOTE: This option is set to 0 when 'compatible' is set.
*'cscopeprg'* *'csprg'*
'cscopeprg' 'csprg' string (default "cscope")
In the absence of a prefix (-P) for cscope. setting this option enables
to use the basename of cscope.out path as the prefix.
See |cscoperelative|.
+ NOTE: This option is reset when 'compatible' is set.
*'cscopetag'* *'cst'* *'nocscopetag'* *'nocst'*
'cscopetag' 'cst' boolean (default off)
This is useful for Arabic, Hebrew and many other languages where one
may have combining characters overtop of base characters, and want
to remove only the combining ones.
+ NOTE: This option is reset when 'compatible' is set.
*'dictionary'* *'dict'*
'dictionary' 'dict' string (default "")
The expression will be evaluated in the |sandbox| when set from a
modeline, see |sandbox-option|. That stops the option from working,
since changing the buffer text is not allowed.
+ NOTE: This option is set to "" when 'compatible' is set.
*'formatoptions'* *'fo'*
'formatoptions' 'fo' string (Vim default: "tcq", Vi default: "vt")
define one. The default uses a different group for each occasion.
See |highlight-default| for the default highlight groups.
- *'hlsearch'* *'hls'* *'nohlsearch'* *'nohls'*
-'hlsearch' 'hls' boolean (default off)
- global
- {not in Vi}
- {not available when compiled without the
- |+extra_search| feature}
- When there is a previous search pattern, highlight all its matches.
- The type of highlighting used can be set with the 'l' occasion in the
- 'highlight' option. This uses the "Search" highlight group by
- default. Note that only the matching text is highlighted, any offsets
- are not applied.
- See also: 'incsearch' and |:match|.
- When you get bored looking at the highlighted matches, you can turn it
- off with |:nohlsearch|. This does not change the option value, as
- soon as you use a search command, the highlighting comes back.
- 'redrawtime' specifies the maximum time spent on finding matches.
- When the search pattern can match an end-of-line, Vim will try to
- highlight all of the matched text. However, this depends on where the
- search starts. This will be the first line in the window or the first
- line below a closed fold. A match in a previous line which is not
- drawn may not continue in a newly drawn line.
- You can specify whether the highlight status is restored on startup
- with the 'h' flag in 'viminfo' |viminfo-h|.
- NOTE: This option is reset when 'compatible' is set.
-
*'history'* *'hi'*
'history' 'hi' number (Vim default: 50, Vi default: 0,
set to 200 in |defaults.vim|)
When on, phonetic keyboard mapping is used. 'hkmap' must also be on.
This is useful if you have a non-Hebrew keyboard.
See |rileft.txt|.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'hlsearch'* *'hls'* *'nohlsearch'* *'nohls'*
+'hlsearch' 'hls' boolean (default off)
+ global
+ {not in Vi}
+ {not available when compiled without the
+ |+extra_search| feature}
+ When there is a previous search pattern, highlight all its matches.
+ The type of highlighting used can be set with the 'l' occasion in the
+ 'highlight' option. This uses the "Search" highlight group by
+ default. Note that only the matching text is highlighted, any offsets
+ are not applied.
+ See also: 'incsearch' and |:match|.
+ When you get bored looking at the highlighted matches, you can turn it
+ off with |:nohlsearch|. This does not change the option value, as
+ soon as you use a search command, the highlighting comes back.
+ 'redrawtime' specifies the maximum time spent on finding matches.
+ When the search pattern can match an end-of-line, Vim will try to
+ highlight all of the matched text. However, this depends on where the
+ search starts. This will be the first line in the window or the first
+ line below a closed fold. A match in a previous line which is not
+ drawn may not continue in a newly drawn line.
+ You can specify whether the highlight status is restored on startup
+ with the 'h' flag in 'viminfo' |viminfo-h|.
NOTE: This option is reset when 'compatible' is set.
*'icon'* *'noicon'*
< Error messages will be suppressed, unless the 'debug' option contains
"msg".
See |indent-expression|.
- NOTE: This option is made empty when 'compatible' is set.
+ NOTE: This option is set to "" when 'compatible' is set.
The expression will be evaluated in the |sandbox| when set from a
modeline, see |sandbox-option|.
feature}
The number of milliseconds between polls for MzScheme threads.
Negative or zero value means no thread scheduling.
+ NOTE: This option is set to the Vim default value when 'compatible'
+ is reset.
*'nrformats'* *'nf'*
'nrformats' 'nf' string (default "bin,octal,hex",
is set. Thus with the Vim default of 4 there is room for a line number
up to 999. When the buffer has 1000 lines five columns will be used.
The minimum value is 1, the maximum value is 10.
- NOTE: 'numberwidth' is reset to 8 when 'compatible' is set.
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
*'omnifunc'* *'ofu'*
'omnifunc' 'ofu' string (default: empty)
a Tab.
NOTE: When using ">>" multiple times the resulting indent is a mix of
tabs and spaces. You might not like this.
- NOTE: 'preserveindent' is reset when 'compatible' is set.
+ NOTE: This option is reset when 'compatible' is set.
Also see 'copyindent'.
Use |:retab| to clean up white space.
"-f" is not inside the quotes, because it is not part of the command
name. And Vim automagically recognizes the backslashes that are path
separators.
- For Dos 32 bits (DJGPP), you can set the $DJSYSFLAGS environment
- variable to change the way external commands are executed. See the
- libc.inf file of DJGPP.
Under MS-Windows, when the executable ends in ".com" it must be
included. Thus setting the shell to "command.com" or "4dos.com"
works, but "command" and "4dos" do not work for all commands (e.g.,
'shelltemp' is off.
The `system()` function does not respect this option and always uses
temp files.
+ NOTE: This option is set to the Vim default value when 'compatible'
+ is reset.
*'shelltype'* *'st'*
'shelltype' 'st' number (default 0)
mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H.
When using the ">>" command, lines starting with '#' are not shifted
right.
- NOTE: 'smartindent' is reset when 'compatible' is set.
+ NOTE: This option is reset when 'compatible' is set.
This option is reset when 'paste' is set and restored when 'paste' is
reset.
ignore Ignore case
match Match case
smart Ignore case unless an upper case letter is used
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
*'taglength'* *'tl'*
'taglength' 'tl' number (default 0)
compatible terminal.
If setting this option does not work (produces a colorless UI)
reading |xterm-true-color| might help.
+ NOTE: This option is reset when 'compatible' is set.
*'terse'* *'noterse'*
'terse' boolean (default off)
The undo file is not read when 'undoreload' causes the buffer from
before a reload to be saved for undo.
When 'undofile' is turned off the undo file is NOT deleted.
+ NOTE: This option is reset when 'compatible' is set.
*'undolevels'* *'ul'*
'undolevels' 'ul' number (default 100, 1000 for Unix, VMS,
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
+ NOTE: This option is set to the Vim default value when 'compatible'
+ is reset.
*'virtualedit'* *'ve'*
'virtualedit' 've' string (default "")
The `g$` command will move to the end of the screen line.
It doesn't make sense to combine "all" with "onemore", but you will
not get a warning for it.
+ NOTE: This option is set to "" when 'compatible' is set.
*'visualbell'* *'vb'* *'novisualbell'* *'novb'* *beep*
'visualbell' 'vb' boolean (default off)
inside the Visual area put it at the start and just before the end of
the pattern, e.g.: >
/\%Vfoo.*ba\%Vr
-< This works if "foo bar" (or more) was Visually selected. This: >
- /\%Vfoo.*ba\%Vr
+< This also works if only "foo bar" was Visually selected. This: >
+ /\%Vfoo.*bar\%V
< would match "foo bar" if the Visual selection continues after the "r".
Only works for the current buffer.
-*quickfix.txt* For Vim version 8.0. Last change: 2016 Nov 04
+*quickfix.txt* For Vim version 8.0. Last change: 2017 Mar 06
VIM REFERENCE MANUAL by Bram Moolenaar
compiler (see |errorformat| below).
*location-list* *E776*
-A location list is similar to a quickfix list and contains a list of positions
-in files. A location list is associated with a window and each window can
-have a separate location list. A location list can be associated with only
-one window. The location list is independent of the quickfix list.
+A location list is a window-local quickfix list. You get one after commands
+like `:lvimgrep`, `:lgrep`, `:lhelpgrep`, `:lmake`, etc., which create a
+location list instead of a quickfix list as the corresponding `:vimgrep`,
+`:grep`, `:helpgrep`, `:make` do.
+A location list is associated with a window and each window can have a
+separate location list. A location list can be associated with only one
+window. The location list is independent of the quickfix list.
When a window with a location list is split, the new window gets a copy of the
location list. When there are no longer any references to a location list,
'macatsui' options.txt /*'macatsui'*
'magic' options.txt /*'magic'*
'makeef' options.txt /*'makeef'*
+'makeencoding' options.txt /*'makeencoding'*
'makeprg' options.txt /*'makeprg'*
'mat' options.txt /*'mat'*
'matchpairs' options.txt /*'matchpairs'*
'maxmemtot' options.txt /*'maxmemtot'*
'mco' options.txt /*'mco'*
'mef' options.txt /*'mef'*
+'menc' options.txt /*'menc'*
'menuitems' options.txt /*'menuitems'*
'mesg' vi_diff.txt /*'mesg'*
'mfd' options.txt /*'mfd'*
cino-= indent.txt /*cino-=*
cino-> indent.txt /*cino->*
cino-C indent.txt /*cino-C*
+cino-E indent.txt /*cino-E*
cino-J indent.txt /*cino-J*
cino-L indent.txt /*cino-L*
cino-M indent.txt /*cino-M*
python-bindeval-objects if_pyth.txt /*python-bindeval-objects*
python-buffer if_pyth.txt /*python-buffer*
python-buffers if_pyth.txt /*python-buffers*
+python-building if_pyth.txt /*python-building*
python-chdir if_pyth.txt /*python-chdir*
python-command if_pyth.txt /*python-command*
python-commands if_pyth.txt /*python-commands*
test-functions usr_41.txt /*test-functions*
test_alloc_fail() eval.txt /*test_alloc_fail()*
test_autochdir() eval.txt /*test_autochdir()*
-test_disable_char_avail() eval.txt /*test_disable_char_avail()*
test_garbagecollect_now() eval.txt /*test_garbagecollect_now()*
test_ignore_error() eval.txt /*test_ignore_error()*
test_null_channel() eval.txt /*test_null_channel()*
test_null_list() eval.txt /*test_null_list()*
test_null_partial() eval.txt /*test_null_partial()*
test_null_string() eval.txt /*test_null_string()*
+test_override() eval.txt /*test_override()*
test_settime() eval.txt /*test_settime()*
testing eval.txt /*testing*
testing-variable eval.txt /*testing-variable*
-*todo.txt* For Vim version 8.0. Last change: 2017 Mar 05
+*todo.txt* For Vim version 8.0. Last change: 2017 Mar 16
VIM REFERENCE MANUAL by Bram Moolenaar
*known-bugs*
-------------------- Known bugs and current work -----------------------
+Using "g<" after ":for x in [1,2,3]|echom x|endfor" looks wrong. (Marcin
+Szamotulski, 2017 Mar 12)
+Also, using Ctrl-C clears the last part.
+
+Test 45 fails on MS-Windows only before resetting 'sw'. Why?
+
+channel:
- Try out background make plugin:
https://github.com/AndrewVos/vim-make-background
Memory leak in test97? The string is actually freed. Weird.
+Include rust files. Got all permissions?
+
+dict_add_list and dict_add_dict may free item when failing. (2017 Mar 12,
+Nikolai Pavlov, #1555)
+
+Patch to add buffer name argument to taglist().
+Ordering of tags in result of taglist call. (Duncan McDougall, #1194)
+
Add a toolbar in the terminal. Can be global, above all windows, or specific
for one window.
Use tb_set(winid, [{'text': 'stop', 'cb': callback, 'hi': 'Green'}])
Json string with trailing \u should be an error. (Lcd)
+On MS-Windows with 'clipboard' set to "unnamed" this doesn't work to double
+lines: :g/^/normal yyp On Unix it works OK. (Bryce Orgill, 2016 Nov 5)
+Another example 2017 Mar 10.
+
Multi-byte bug: dv} splits char. (Urtica Dioica, 2017 Jan 9)
When session file has name in argument list but the buffer was deleted, the
buffer is not deleted when using the session file. (#1393)
Should add the buffer in hidden state.
-When "gf" excludes following ":99", jump to line 99.
-Also when editing a file foo.txt:99 ?
-
When an item in the quickfix list has a file name that does not exist, behave
like the item was not a match for :cnext.
+Patch to test regexp classes. (Dominique, 2017 Mar 13, #1560)
+Do we need to adjust the implementation?
+Make different classes that depend on the system and that don't.
+
Wrong diff highlighting with three files. (2016 Oct 20, #1186)
Also get E749 on exit.
Another example in #1309
When deleting a mark or register, leave a tombstone, so that it's also deleted
when writing viminfo (and the delete was the most recent action). #1339
-Patch to add 'makeencoding', useful when the system encoding differs from
-Vim's 'encoding' setting. (Ken Takata, 2017 Jan 31)
-
-Patch to adjust marks when adding a new line to the end of buffer in diff
-mode. (James McCoy, 2016 Dec 14, #1329)
-
Suggestion to improve pt-br spell checking. (Marcelo D Montu, 2016 Dec 15,
#1330)
Error in test_startup_utf8 on Solaris. (Danek Duvall, 2016 Aug 17)
-Patch to fix that test87 fails on Arch Linux. (Jesin, 2017 Feb 10)
-
Completion for :!cmd shows each match twice. #1435
GTK: When adding a timer from 'balloonexpr' it won't fire, because
Using CTRL-G_U in InsertCharPre causes trouble for redo. (Israel Chauca
Fuentes, 2017 Feb 12, #1470)
+Check for errors E704 and E705 only does VAR_FUNC, should also do VAR_PARTIAL.
+(Nikolai Pavlov, 2017 Mar 13, #1557)
+Make a function to check for function-like type?
+
Screen updated delayed when using CTRL-O u in Insert mode.
(Barlik, #1191) Perhaps because status message?
-Patch to add buffer name argument to taglist().
-Ordering of tags in result of taglist call. (Duncan McDougall, #1194)
-
-Patch to fix that b_ind_has_comment is not correctly reset. (Christian
-Brabandt, 2017 Feb 14, closes #1475)
+Implement optional arguments for functions.
+ func Foo(start, count = 1 all = 1)
+ call Foo(12)
+ call Foo(12, all = 0)
+ call Foo(12, 15, 0)
writefile() does not abort as soon as an error is found. (Nikolai Pavlov,
2017 Feb 14, #1476)
"ci[" does not look for next [ like ci" does look for next ".
(J.F. 2017 Jan 7)
-On MS-Windows with 'clipboard' set to "unnamed" this doesn't work to double
-lines: :g/^/normal yyp On Unix it works OK. (Bryce Orgill, 2016 Nov 5)
-
Patch for wrong cursor position on wrapped line, involving breakindent.
(Ozaki Kiichi, 2016 Nov 25)
Does this also fix #1408 ?
Patch to add Zstandard compressed file support. (Nick Terrell, 2016 Oct 24)
-Patch to add new regexp classes :ident:, :keyword:, :fname:.
-(ichizok, 2016 Jan 12, #1373)
-
Patch to add trim() function. (Bukn, 2016 Nov 25, #1280)
Patch to add MODIFIED_BY to MSVC build file. (Chen Lei, 2016 Nov 24, #1275)
Patch to improve equivalence classes in regexp patterns.
(Christian Brabandt, 2013 Jan 16, update Jan 17)
+Patch to add new regexp classes :ident:, :keyword:, :fname:.
+(ichizok, 2016 Jan 12, #1373)
+
Patch with suggestions for starting.txt. (Tony Mechelynck, 2012 Oct 24)
But use Gnome instead of GTK?
-*usr_02.txt* For Vim version 8.0. Last change: 2016 Jan 16
+*usr_02.txt* For Vim version 8.0. Last change: 2017 Mar 14
VIM USER MANUAL - by Bram Moolenaar
8) Ex-commands always start with ":", so to go to the :s command help: >
:help :s
-9) Commands specifically for debugging start with ">". To go to to the help
+9) Commands specifically for debugging start with ">". To go to the help
for the "cont" debug command: >
:help >cont
-*usr_41.txt* For Vim version 8.0. Last change: 2017 Mar 01
+*usr_41.txt* For Vim version 8.0. Last change: 2017 Mar 09
VIM USER MANUAL - by Bram Moolenaar
assert_fails() assert that a function call fails
test_alloc_fail() make memory allocation fail
test_autochdir() enable 'autochdir' during startup
- test_disable_char_avail() test without typeahead
- test_garbagecollect_now() free memory right now
+ test_override() test with Vim internal overrides
+ test_garbagecollect_now() free memory right now
test_ignore_error() ignore a specific error message
test_null_channel() return a null Channel
test_null_dict() return a null Dict
-*version8.txt* For Vim version 8.0. Last change: 2017 Feb 24
+*version8.txt* For Vim version 8.0. Last change: 2017 Mar 16
VIM REFERENCE MANUAL by Bram Moolenaar
|systemlist()| get the result of a shell command as a list
|test_alloc_fail()| make memory allocation fail
|test_autochdir()| test 'autochdir' functionality
-|test_disable_char_avail()| test without typeahead
+test_disable_char_avail() test without typeahead (removed later)
|test_garbagecollect_now()| free memory right now
|test_null_channel()| return a null Channel
|test_null_dict()| return a null Dict
useful default values for new users. That includes setting 'nocompatible'.
Thus Vim no longer starts up in Vi compatible mode. If you do want that,
either create a .vimrc file that does "set compatible" or start Vim with
-"Vim -C".
+"vim -C".
Support removed ~
src/testdir/test60.ok
Patch 7.4.237 (after 7.4.236)
-Problem: When some patches was not included has("patch-7.4.123") may return
+Problem: When some patches were not included has("patch-7.4.123") may return
true falsely.
Solution: Check for the specific patch number.
Files: runtime/doc/eval.txt, src/eval.c
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2017 Mar 04
+" Last Change: 2017 Mar 13
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
" Not Quite C
au BufNewFile,BufRead *.nqc setf nqc
+" NSE - Nmap Script Engine - uses Lua syntax
+au BufNewFile,BufRead *.nse setf lua
+
" NSIS
au BufNewFile,BufRead *.nsi,*.nsh setf nsis
au BufNewFile,BufRead *.tf,.tfrc,tfrc setf tf
" tmux configuration
-au BufNewFile,BufRead tmux*.conf setf tmux
+au BufNewFile,BufRead {.,}tmux*.conf setf tmux
" TPP - Text Presentation Program
au BufNewFile,BufReadPost *.tpp setf tpp
" Vim filetype plugin
" Language: Hamster Script
" Version: 2.0.6.0
-" Maintainer: David Fishburn <fishburn@ianywhere.com>
-" Last Change: Wed Nov 08 2006 12:03:09 PM
+" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
+" Last Change: 2017 Mar 07
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
let b:did_ftplugin = 1
let s:cpo_save = &cpo
+set cpo&vim
set cpo-=C
let b:undo_ftplugin = "setl fo< com< tw< commentstring<"
" SQL filetype plugin file
" Language: SQL (Common for Oracle, Microsoft SQL Server, Sybase)
-" Version: 11.0
+" Version: 12.0
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
-" Last Change: 2013 May 13
+" Last Change: 2017 Mar 07
" Download: http://vim.sourceforge.net/script.php?script_id=454
" For more details please use:
"
" History
"
+" Version 12.0 (April 2013)
+"
+" NF: Added support for "BEGIN TRY ... END TRY ... BEGIN CATCH ... END CATCH
+" BF: This plugin is designed to be used with other plugins to enable the
+" SQL completion with Perl, Python, Java, ... The loading mechanism
+" was not checking if the SQL objects were created, which can lead to
+" the plugin not loading the SQL support.
+"
" Version 11.0 (May 2013)
"
" NF: Updated to use SyntaxComplete's new regex support for syntax groups.
" Only do this when not done yet for this buffer
-if exists("b:did_ftplugin")
- finish
+" This ftplugin can be used with other ftplugins. So ensure loading
+" happens if all elements of this plugin have not yet loaded.
+if exists("b:did_ftplugin") && exists("b:current_ftplugin") && b:current_ftplugin == 'sql'
+ finish
endif
let s:save_cpo = &cpo
set cpo&vim
" Disable autowrapping for code, but enable for comments
-" t Auto-wrap text using textwidth
+" t Auto-wrap text using textwidth
" c Auto-wrap comments using textwidth, inserting the current comment
" leader automatically.
setlocal formatoptions-=t
if exists("b:current_syntax")
" echomsg 'SQLSetType - clearing syntax'
syntax clear
+ if exists("b:current_syntax")
+ unlet b:current_syntax
+ endif
endif
if exists("b:did_indent")
" echomsg 'SQLSetType - clearing indent'
" Do not specify a buffer local variable if it is
" the default value
if new_sql_type == 'sql'
- let new_sql_type = 'sqloracle'
+ let new_sql_type = 'sqloracle'
endif
let b:sql_type_override = new_sql_type
" echo 'sourcing buffer ftplugin/'.b:sql_type_override.'.vim'
if globpath(&runtimepath, 'ftplugin/'.b:sql_type_override.'.vim') != ''
exec 'runtime ftplugin/'.b:sql_type_override.'.vim'
- " else
- " echomsg 'ftplugin/'.b:sql_type_override.' not exist, using default'
+ " else
+ " echomsg 'ftplugin/'.b:sql_type_override.' not exist, using default'
endif
elseif exists("g:sql_type_default")
" echo 'sourcing global ftplugin/'.g:sql_type_default.'.vim'
if globpath(&runtimepath, 'ftplugin/'.g:sql_type_default.'.vim') != ''
exec 'runtime ftplugin/'.g:sql_type_default.'.vim'
- " else
- " echomsg 'ftplugin/'.g:sql_type_default.'.vim not exist, using default'
+ " else
+ " echomsg 'ftplugin/'.g:sql_type_default.'.vim not exist, using default'
endif
endif
" If the above runtime command succeeded, do not load the default settings
-if exists("b:did_ftplugin")
- finish
+" as they should have already been loaded from a previous run.
+if exists("b:did_ftplugin") && exists("b:current_ftplugin") && b:current_ftplugin == 'sql'
+ finish
endif
let b:undo_ftplugin = "setl comments< formatoptions< define< omnifunc<" .
- \ " | unlet! b:browsefilter b:match_words"
+ \ " | unlet! b:browsefilter b:match_words"
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
" Win32 can filter files in the browse dialog
if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "SQL Files (*.sql)\t*.sql\n" .
- \ "All Files (*.*)\t*.*\n"
+ \ "All Files (*.*)\t*.*\n"
endif
" Some standard expressions for use with the matchit strings
" WHEN column_not_found THEN
" WHEN OTHERS THEN
"
+ " begin try
+ " end try
+ " begin catch
+ " end catch
+ "
" create[ or replace] procedure|function|event
- " \ '^\s*\<\%(do\|for\|while\|loop\)\>.*:'.
+ " \ '^\s*\<\%(do\|for\|while\|loop\)\>.*:'.
" For ColdFusion support
setlocal matchpairs+=<:>
let b:match_words = &matchpairs .
- \ ',\<begin\>:\<end\>\W*$,'.
- \
+ \ ',\%(\<begin\)\%(\s\+\%(try\|catch\)\>\)\@!:\<end\>\W*$,'.
+ \
+ \ '\<begin\s\+try\>:'.
+ \ '\<end\s\+try\>:'.
+ \ '\<begin\s\+catch\>:'.
+ \ '\<end\s\+catch\>,'.
+ \
\ s:notend . '\<if\>:'.
\ '\<elsif\>\|\<elseif\>\|\<else\>:'.
\ '\<end\s\+if\>,'.
\ '\%(\<create\s\+' . s:or_replace . '\)\?'.
\ '\%(function\|procedure\|event\):'.
\ '\<returns\?\>'
- " \ '\<begin\>\|\<returns\?\>:'.
- " \ '\<end\>\(;\)\?\s*$'
- " \ '\<exception\>:'.s:when_no_matched_or_others.
- " \ ':\<when\s\+others\>,'.
- "
- " \ '\%(\<exception\>\|\%('. s:notend . '\<case\>\)\):'.
- " \ '\%(\<default\>\|'.s:when_no_matched_or_others.'\):'.
- " \ '\%(\%(\<when\s\+others\>\)\|\<end\s\+case\>\),' .
+ " \ '\<begin\>\|\<returns\?\>:'.
+ " \ '\<end\>\(;\)\?\s*$'
+ " \ '\<exception\>:'.s:when_no_matched_or_others.
+ " \ ':\<when\s\+others\>,'.
+ "
+ " \ '\%(\<exception\>\|\%('. s:notend . '\<case\>\)\):'.
+ " \ '\%(\<default\>\|'.s:when_no_matched_or_others.'\):'.
+ " \ '\%(\%(\<when\s\+others\>\)\|\<end\s\+case\>\),' .
endif
" Define how to find the macro definition of a variable using the various
" Vim filetype plugin file
-" Language: Tmux config
-" Maintainer: Eric Pruitt <eric.pruitt@gmail.com>
-" Last Change: 2017 Mar 04
+" Language: tmux(1) configuration file
+" URL: https://github.com/ericpruitt/tmux.vim/
+" Maintainer: Eric Pruitt <eric.pruitt@gmail.com>
+" Last Changed: 2017 Mar 10
if exists("b:did_ftplugin")
finish
let [declaration, end] = s:lex1(line, col)
if declaration == ""
- return indent + &sw
+ return indent + shiftwidth()
elseif declaration == '--'
" We’re looking at a comment. Now, simply determine if the comment is
" terminated or not. If it isn’t, let Vim take care of that using
" Check for element name. If none exists, indent one level.
let [name, end] = s:lex(line, end)
if name == ""
- return indent + &sw
+ return indent + shiftwidth()
endif
" Check for token following element name. This can be a specification of
let n += 1
endwhile
if token == ""
- return indent + &sw
+ return indent + shiftwidth()
endif
" Next comes the content model. If the token we’ve found isn’t a
return indent
endif
" TODO: Should use s:lex here on getline(v:lnum) and check for >.
- return getline(v:lnum) =~ '^\s*>' || count(values(seen), 0) == 0 ? indent : (indent + &sw)
+ return getline(v:lnum) =~ '^\s*>' || count(values(seen), 0) == 0 ? indent : (indent + shiftwidth())
endif
" If we’ve seen an addition or exception already and this is of the same
" Check for element name. If none exists, indent one level.
let [name, end] = s:lex(line, end)
if name == ""
- return indent + &sw
+ return indent + shiftwidth()
endif
" Check for any number of attributes.
let [name, end] = s:lex(line, end)
if name == ""
" TODO: Should use s:lex here on getline(v:lnum) and check for >.
- return getline(v:lnum) =~ '^\s*>' ? indent : (indent + &sw)
+ return getline(v:lnum) =~ '^\s*>' ? indent : (indent + shiftwidth())
elseif name == ">"
return indent
endif
" (CDATA|NMTOKEN|NMTOKENS|ID|IDREF|IDREFS|ENTITY|ENTITIES)?
let [value, end] = s:lex(line, end, '^\%((\|[^[:space:]]\+\)')
if value == ""
- return indent + &sw * 2
+ return indent + shiftwidth() * 2
elseif value == 'NOTATION'
" If this is a enumerated value based on notations, read another token
" for the actual value. If it doesn’t exist, indent three levels.
" TODO: If validating according to above, value must be equal to '('.
let [value, end] = s:lex(line, end, '^\%((\|[^[:space:]]\+\)')
if value == ""
- return indent + &sw * 3
+ return indent + shiftwidth() * 3
endif
endif
" two levels.
let [default, end] = s:lex(line, end, '^\%("\_[^"]*"\|#\(REQUIRED\|IMPLIED\|FIXED\)\)')
if default == ""
- return indent + &sw * 2
+ return indent + shiftwidth() * 2
elseif default == '#FIXED'
" We need to look for the fixed value. If non exists, indent three
" levels.
let [default, end] = s:lex(line, end, '^"\_[^"]*"')
if default == ""
- return indent + &sw * 3
+ return indent + shiftwidth() * 3
endif
endif
endwhile
" again, if none exists, indent one level.
let [name, end] = s:lex(line, end)
if name == ""
- return indent + &sw
+ return indent + shiftwidth()
elseif name == '%'
let [name, end] = s:lex(line, end)
if name == ""
- return indent + &sw
+ return indent + shiftwidth()
endif
endif
" we’re now done with this entity.
let [value, end] = s:lex(line, end)
if value == ""
- return indent + &sw
+ return indent + shiftwidth()
elseif value == 'SYSTEM' || value == 'PUBLIC'
let [quoted_string, end] = s:lex(line, end, '\%("[^"]\+"\|''[^'']\+''\)')
if quoted_string == ""
- return indent + &sw * 2
+ return indent + shiftwidth() * 2
endif
if value == 'PUBLIC'
let [quoted_string, end] = s:lex(line, end, '\%("[^"]\+"\|''[^'']\+''\)')
if quoted_string == ""
- return indent + &sw * 2
+ return indent + shiftwidth() * 2
endif
endif
let [ndata, end] = s:lex(line, end)
if ndata == ""
- return indent + &sw
+ return indent + shiftwidth()
endif
let [name, end] = s:lex(line, end)
- return name == "" ? (indent + &sw * 2) : indent
+ return name == "" ? (indent + shiftwidth() * 2) : indent
else
return indent
endif
" Check for notation name. If none exists, indent one level.
let [name, end] = s:lex(line, end)
if name == ""
- return indent + &sw
+ return indent + shiftwidth()
endif
" Now check for the external ID. If none exists, indent one level.
let [id, end] = s:lex(line, end)
if id == ""
- return indent + &sw
+ return indent + shiftwidth()
elseif id == 'SYSTEM' || id == 'PUBLIC'
let [quoted_string, end] = s:lex(line, end, '\%("[^"]\+"\|''[^'']\+''\)')
if quoted_string == ""
- return indent + &sw * 2
+ return indent + shiftwidth() * 2
endif
if id == 'PUBLIC'
let [quoted_string, end] = s:lex(line, end, '\%("[^"]\+"\|''[^'']\+''\|>\)')
if quoted_string == ""
" TODO: Should use s:lex here on getline(v:lnum) and check for >.
- return getline(v:lnum) =~ '^\s*>' ? indent : (indent + &sw * 2)
+ return getline(v:lnum) =~ '^\s*>' ? indent : (indent + shiftwidth() * 2)
elseif quoted_string == '>'
return indent
endif
" Language: Eiffel
" Maintainer: Jocelyn Fiat <jfiat@eiffel.com>
" Previous-Maintainer: David Clarke <gadicath@dishevelled.net>
+" Contributions from: Takuya Fujiwara
" Contributions from: Thilo Six
-" $Date: 2004/12/09 21:33:52 $
-" $Revision: 1.3 $
+" $Date: 2017/03/08 06:00:00 $
+" $Revision: 1.4 $
" URL: https://github.com/eiffelhub/vim-eiffel
" Only load this indent file when no other was loaded.
" Define some stuff
" keywords grouped by indenting
let s:trust_user_indent = '\(+\)\(\s*\(--\).*\)\=$'
-let s:relative_indent = '^\s*\(deferred\|class\|feature\|creation\|inherit\|loop\|from\|until\|if\|else\|elseif\|ensure\|require\|check\|do\|local\|invariant\|variant\|rename\|redefine\|do\|export\)\>'
+let s:relative_indent = '^\s*\(deferred\|class\|feature\|creation\|inherit\|loop\|from\|across\|until\|if\|else\|elseif\|ensure\|require\|check\|do\|local\|invariant\|variant\|rename\|redefine\|do\|export\)\>'
let s:outdent = '^\s*\(else\|invariant\|variant\|do\|require\|until\|loop\|local\)\>'
let s:no_indent = '^\s*\(class\|feature\|creation\|inherit\)\>'
let s:single_dent = '^[^-]\+[[:alnum:]]\+ is\(\s*\(--\).*\)\=$'
" Add a 'shiftwidth' after lines that start with an indent word
let ind = indent(lnum)
if getline(lnum) =~ s:relative_indent
- let ind = ind + &sw
+ let ind = ind + shiftwidth()
endif
" Indent to single indent
if getline(v:lnum) =~ s:single_dent && getline(v:lnum) !~ s:relative_indent
\ && getline(v:lnum) !~ '\s*\<\(and\|or\|implies\)\>'
- let ind = &sw
+ let ind = shiftwidth()
endif
" Indent to double indent
if getline(v:lnum) =~ s:inheritance_dent
- let ind = 2 * &sw
+ let ind = 2 * shiftwidth()
endif
" Indent line after the first line of the function definition
if getline(lnum) =~ s:single_dent
- let ind = ind + &sw
+ let ind = ind + shiftwidth()
endif
" The following should always be at the start of a line, no indenting
" or first thing after the 'do'
if getline(v:lnum) =~ s:outdent && getline(v:lnum - 1) !~ s:single_dent
\ && getline(v:lnum - 1) !~ '^\s*do\>'
- let ind = ind - &sw
+ let ind = ind - shiftwidth()
endif
" Subtract a shiftwidth for end statements
if getline(v:lnum) =~ '^\s*end\>'
- let ind = ind - &sw
+ let ind = ind - shiftwidth()
endif
" set indent of zero end statements that are at an indent of 3, this should
" only ever be the class's end.
- if getline(v:lnum) =~ '^\s*end\>' && ind == &sw
+ if getline(v:lnum) =~ '^\s*end\>' && ind == shiftwidth()
let ind = 0
endif
let ind = indent(lnum)
if getline(lnum) =~ '^\s*begin\>'
- let ind = ind + &sw
+ let ind = ind + shiftwidth()
endif
if getline(v:lnum) =~ '^\s*end\>'
- let ind = ind - &sw
+ let ind = ind - shiftwidth()
endif
return ind
let ind = indent(lnum)
if getline(lnum) =~? '^\s*\%(If\|Loop\|Sub\)'
- let ind = ind + &sw
+ let ind = ind + shiftwidth()
endif
if getline(v:lnum) =~? '^\s*\%(Else\|End\%(If\|Loop\|Sub\)\)'
- let ind = ind - &sw
+ let ind = ind - shiftwidth()
endif
return ind
" Vim indent file
" Language: Java
" Previous Maintainer: Toby Allsopp <toby.allsopp@peace.com>
-" Current Maintainer: Hong Xu <xuhdev@gmail.com>
-" Last Change: 2012 May 18
-" Version: 1.0
+" Current Maintainer: Hong Xu <hong@topbug.net>
+" Homepage: http://www.vim.org/scripts/script.php?script_id=3899
+" https://github.com/xuhdev/indent-java.vim
+" Last Change: 2016 Mar 7
+" Version: 1.1
" License: Same as Vim.
-" Copyright (c) 2012 Hong Xu
-" Before 2012, this file is maintained by Toby Allsopp.
+" Copyright (c) 2012-2016 Hong Xu
+" Before 2012, this file was maintained by Toby Allsopp.
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
if exists("*GetJavaIndent")
finish
endif
+
let s:keepcpo= &cpo
set cpo&vim
" If the previous line starts with '@', we should have the same indent as
" the previous one
- if getline(lnum) =~ '^\s*@\S\+\s*$'
+ if getline(lnum) =~ '^\s*@.*$'
return indent(lnum)
endif
" Try to align "throws" lines for methods and "extends" and "implements" for
" classes.
- if getline(v:lnum) =~ '^\s*\(extends\|implements\)\>'
- \ && getline(lnum) !~ '^\s*\(extends\|implements\)\>'
- let theIndent = theIndent + &sw
+ if getline(v:lnum) =~ '^\s*\(throws\|extends\|implements\)\>'
+ \ && getline(lnum) !~ '^\s*\(throws\|extends\|implements\)\>'
+ let theIndent = theIndent + shiftwidth()
endif
" correct for continuation lines of "throws", "implements" and "extends"
if strlen(cont_kw) > 0
let amount = strlen(cont_kw) + 1
if getline(lnum) !~ ',\s*$'
- let theIndent = theIndent - (amount + &sw)
+ let theIndent = theIndent - (amount + shiftwidth())
if theIndent < 0
let theIndent = 0
endif
elseif prev == lnum
let theIndent = theIndent + amount
if cont_kw ==# 'throws'
- let theIndent = theIndent + &sw
+ let theIndent = theIndent + shiftwidth()
endif
endif
elseif getline(prev) =~ '^\s*\(throws\|implements\|extends\)\>'
\ && (getline(prev) =~ '{\s*$'
\ || getline(v:lnum) =~ '^\s*{\s*$')
- let theIndent = theIndent - &sw
+ let theIndent = theIndent - shiftwidth()
endif
" When the line starts with a }, try aligning it with the matching {,
" skipping over "throws", "extends" and "implements" clauses.
if getline(v:lnum) =~ '^\s*}\s*\(//.*\|/\*.*\)\=$'
call cursor(v:lnum, 1)
- silent normal %
+ silent normal! %
let lnum = line('.')
if lnum < v:lnum
while lnum > 1
if line =~ '^\s*\*'
return cindent(v:lnum)
elseif line =~ '^\s*}'
- return indent(v:lnum) - &sw
+ return indent(v:lnum) - shiftwidth()
endif
let pnum = s:prevnonblanknoncomment(v:lnum - 1)
return 0
endif
- let ind = indent(pnum) + s:count_braces(pnum, 1) * &sw
+ let ind = indent(pnum) + s:count_braces(pnum, 1) * shiftwidth()
let pline = getline(pnum)
if pline =~ '}\s*$'
- let ind -= (s:count_braces(pnum, 0) - (pline =~ '^\s*}' ? 1 : 0)) * &sw
+ let ind -= (s:count_braces(pnum, 0) - (pline =~ '^\s*}' ? 1 : 0)) * shiftwidth()
endif
return ind
if prev_prev_line =~ s:continuation_rx
return indent(prev_lnum)
elseif prev_line =~ s:rule_rx
- return &sw
+ return shiftwidth()
elseif prev_line =~ s:assignment_rx
call cursor(prev_lnum, 1)
if search(s:assignment_rx, 'W') != 0
return virtcol('.') - 1
else
" TODO: ?
- return &sw
+ return shiftwidth()
endif
else
" TODO: OK, this might be a continued shell command, so perhaps indent
" return indent(prev_lnum) + 2
" endif
"endif
- return indent(prev_lnum) + &sw
+ return indent(prev_lnum) + shiftwidth()
endif
elseif prev_prev_line =~ s:continuation_rx
let folded_line = s:remove_continuation(prev_prev_line) . ' ' . s:remove_continuation(prev_line)
return &ts
endif
elseif prev_line =~ s:conditional_directive_rx
- return &sw
+ return shiftwidth()
else
let line = getline(v:lnum)
if line =~ s:just_inserted_rule_rx
return 0
elseif line =~ s:end_conditional_directive_rx
- return v:lnum - 1 == 0 ? 0 : indent(v:lnum - 1) - &sw
+ return v:lnum - 1 == 0 ? 0 : indent(v:lnum - 1) - shiftwidth()
else
return v:lnum - 1 == 0 ? 0 : indent(v:lnum - 1)
endif
let ind = indent(lnum)
if getline(lnum) =~ '^\s*$\(if\|else\)\>'
- let ind = ind + &sw
+ let ind = ind + shiftwidth()
endif
if getline(v:lnum) =~ '^\s*$\(else\|endif\)\>'
- let ind = ind - &sw
+ let ind = ind - shiftwidth()
endif
return ind
--- /dev/null
+" Vim indent file
+" Language: SAS
+" Maintainer: Zhen-Huan Hu <wildkeny@gmail.com>
+" Version: 3.0.1
+" Last Change: Mar 13, 2017
+
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=GetSASIndent()
+setlocal indentkeys+=;,=~data,=~proc,=~macro
+
+if exists("*GetSASIndent")
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" Regex that captures the start of a data/proc section
+let s:section_str = '\v%(^|;)\s*%(data|proc)>'
+" Regex that captures the end of a run-processing section
+let s:section_run = '\v%(^|;)\s*run\s*;'
+" Regex that captures the end of a data/proc section
+let s:section_end = '\v%(^|;)\s*%(quit|enddata)\s*;'
+
+" Regex that captures the start of a control block (anything inside a section)
+let s:block_str = '\v<%(do>%([^;]+<%(to|over)>[^;]+)=|%(define|layout|method|select)>[^;]+|begingraph)\s*;'
+" Regex that captures the end of a control block (anything inside a section)
+let s:block_end = '\v<%(end|endlayout|endgraph)\s*;'
+
+" Regex that captures the start of a macro
+let s:macro_str = '\v%(^|;)\s*\%macro>'
+" Regex that captures the end of a macro
+let s:macro_end = '\v%(^|;)\s*\%mend\s*;'
+
+" Regex that defines the end of the program
+let s:program_end = '\v%(^|;)\s*endsas\s*;'
+
+" List of procs supporting run-processing
+let s:run_processing_procs = [
+ \ 'catalog', 'chart', 'datasets', 'document', 'ds2', 'plot', 'sql',
+ \ 'gareabar', 'gbarline', 'gchart', 'gkpi', 'gmap', 'gplot', 'gradar', 'greplay', 'gslide', 'gtile',
+ \ 'anova', 'arima', 'catmod', 'factex', 'glm', 'model', 'optex', 'plan', 'reg',
+ \ 'iml',
+ \ ]
+
+" Find the line number of previous keyword defined by the regex
+function! s:PrevMatch(lnum, regex)
+ let prev_lnum = prevnonblank(a:lnum - 1)
+ while prev_lnum > 0
+ let prev_line = getline(prev_lnum)
+ if prev_line =~ a:regex
+ break
+ else
+ let prev_lnum = prevnonblank(prev_lnum - 1)
+ endif
+ endwhile
+ return prev_lnum
+endfunction
+
+" Main function
+function! GetSASIndent()
+ let prev_lnum = prevnonblank(v:lnum - 1)
+ if prev_lnum ==# 0
+ " Leave the indentation of the first line unchanged
+ return indent(1)
+ else
+ let prev_line = getline(prev_lnum)
+ " Previous non-blank line contains the start of a macro/section/block
+ " while not the end of a macro/section/block (at the same line)
+ if (prev_line =~ s:section_str && prev_line !~ s:section_run && prev_line !~ s:section_end) ||
+ \ (prev_line =~ s:block_str && prev_line !~ s:block_end) ||
+ \ (prev_line =~ s:macro_str && prev_line !~ s:macro_end)
+ let ind = indent(prev_lnum) + &sts
+ elseif prev_line =~ s:section_run && prev_line !~ s:section_end
+ let prev_section_str_lnum = s:PrevMatch(v:lnum, s:section_str)
+ let prev_section_end_lnum = max([
+ \ s:PrevMatch(v:lnum, s:section_end),
+ \ s:PrevMatch(v:lnum, s:macro_end ),
+ \ s:PrevMatch(v:lnum, s:program_end)])
+ " Check if the section supports run-processing
+ if prev_section_end_lnum < prev_section_str_lnum &&
+ \ getline(prev_section_str_lnum) =~ '\v%(^|;)\s*proc\s+%(' .
+ \ join(s:run_processing_procs, '|') . ')>'
+ let ind = indent(prev_lnum) + &sts
+ else
+ let ind = indent(prev_lnum)
+ endif
+ else
+ let ind = indent(prev_lnum)
+ endif
+ endif
+ " Re-adjustments based on the inputs of the current line
+ let curr_line = getline(v:lnum)
+ if curr_line =~ s:program_end
+ " End of the program
+ " Same indentation as the first non-blank line
+ return indent(nextnonblank(1))
+ elseif curr_line =~ s:macro_end
+ " Current line is the end of a macro
+ " Match the indentation of the start of the macro
+ return indent(s:PrevMatch(v:lnum, s:macro_str))
+ elseif curr_line =~ s:block_end && curr_line !~ s:block_str
+ " Re-adjust if current line is the end of a block
+ " while not the beginning of a block (at the same line)
+ " Returning the indent of previous block start directly
+ " would not work due to nesting
+ let ind = ind - &sts
+ elseif curr_line =~ s:section_str || curr_line =~ s:section_run || curr_line =~ s:section_end
+ " Re-adjust if current line is the start/end of a section
+ " since the end of a section could be inexplicit
+ let prev_section_str_lnum = s:PrevMatch(v:lnum, s:section_str)
+ " Check if the previous section supports run-processing
+ if getline(prev_section_str_lnum) =~ '\v%(^|;)\s*proc\s+%(' .
+ \ join(s:run_processing_procs, '|') . ')>'
+ let prev_section_end_lnum = max([
+ \ s:PrevMatch(v:lnum, s:section_end),
+ \ s:PrevMatch(v:lnum, s:macro_end ),
+ \ s:PrevMatch(v:lnum, s:program_end)])
+ else
+ let prev_section_end_lnum = max([
+ \ s:PrevMatch(v:lnum, s:section_end),
+ \ s:PrevMatch(v:lnum, s:section_run),
+ \ s:PrevMatch(v:lnum, s:macro_end ),
+ \ s:PrevMatch(v:lnum, s:program_end)])
+ endif
+ if prev_section_end_lnum < prev_section_str_lnum
+ let ind = ind - &sts
+ endif
+ endif
+ return ind
+endfunction
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
if prevline =~ '^\s*\.'
return ind
else
- return ind + &shiftwidth
+ return ind + shiftwidth()
endif
endif
" Indent html literals
if prevline !~ '/>\s*$' && prevline =~ '^\s*<[a-zA-Z][^>]*>\s*$'
call scala#ConditionalConfirm("3")
- return ind + &shiftwidth
+ return ind + shiftwidth()
endif
" assumes curly braces around try-block
if curline =~ '^\s*}\s*\<catch\>'
- return ind - &shiftwidth
+ return ind - shiftwidth()
elseif curline =~ '^\s*\<catch\>'
return ind
endif
- " Add a 'shiftwidth' after lines that start a block
+ " Add a shiftwidth()' after lines that start a block
" If 'if', 'for' or 'while' end with ), this is a one-line block
" If 'val', 'var', 'def' end with =, this is a one-line block
if (prevline =~ '^\s*\<\%(\%(}\?\s*else\s\+\)\?if\|for\|while\)\>.*[)=]\s*$' && scala#NumberOfBraceGroups(prevline) <= 1)
\ || prevline =~ '^\s*\%(}\s*\)\?\<else\>\s*$'
\ || prevline =~ '=\s*$'
call scala#ConditionalConfirm("4")
- let ind = ind + &shiftwidth
+ let ind = ind + shiftwidth()
elseif prevline =~ '^\s*\<\%(}\?\s*else\s\+\)\?if\>' && curline =~ '^\s*}\?\s*\<else\>'
return ind
endif
let bracketCount = scala#CountBrackets(prevline, '{', '}')
if bracketCount > 0 || prevline =~ '.*{\s*$'
call scala#ConditionalConfirm("5b")
- let ind = ind + &shiftwidth
+ let ind = ind + shiftwidth()
elseif bracketCount < 0
call scala#ConditionalConfirm("6b")
" if the closing brace actually completes the braces entirely, then we
let bracketCount = scala#CountBrackets(prevline, '(', ')')
if bracketCount > 0 || prevline =~ '.*(\s*$'
call scala#ConditionalConfirm("5a")
- let ind = ind + &shiftwidth
+ let ind = ind + shiftwidth()
elseif bracketCount < 0
call scala#ConditionalConfirm("6a")
" if the closing brace actually completes the braces entirely, then we
else
" This is the only part that's different from from the '{', '}' one below
" Yup... some refactoring is necessary at some point.
- let ind = ind + (bracketCount * &shiftwidth)
+ let ind = ind + (bracketCount * shiftwidth())
let lineCompletedBrackets = 1
endif
endif
if curline =~ '^\s*}\?\s*\<else\>\%(\s\+\<if\>\s*(.*)\)\?\s*{\?\s*$' &&
\ ! scala#LineIsCompleteIf(prevline) &&
\ prevline !~ '^.*}\s*$'
- let ind = ind - &shiftwidth
+ let ind = ind - shiftwidth()
endif
- " Subtract a 'shiftwidth' on '}' or html
+ " Subtract a shiftwidth()' on '}' or html
let curCurlyCount = scala#CountCurlies(curline)
if curCurlyCount < 0
call scala#ConditionalConfirm("14a")
return indent(matchline)
elseif curline =~ '^\s*</[a-zA-Z][^>]*>'
call scala#ConditionalConfirm("14c")
- return ind - &shiftwidth
+ return ind - shiftwidth()
endif
let prevParenCount = scala#CountParens(prevline)
let prevCurlyCount = scala#CountCurlies(prevline)
if prevCurlyCount == 0 && prevline =~ '^.*\%(=>\|⇒\)\s*$' && prevline !~ '^\s*this\s*:.*\%(=>\|⇒\)\s*$' && curline !~ '^\s*\<case\>'
call scala#ConditionalConfirm("16")
- let ind = ind + &shiftwidth
+ let ind = ind + shiftwidth()
endif
if ind == originalIndentValue && curline =~ '^\s*\<case\>'
if scala#LineIsAClosingXML(prevline)
if scala#LineCompletesXML(prevlnum, prevline)
call scala#ConditionalConfirm("20a")
- return ind - &shiftwidth
+ return ind - shiftwidth()
else
call scala#ConditionalConfirm("20b")
return ind
"let indentMultiplier = scala#LineCompletesDefValr(prevlnum, prevline)
"if indentMultiplier != 0
" call scala#ConditionalConfirm("19a")
- " let ind = ind - (indentMultiplier * &shiftwidth)
+ " let ind = ind - (indentMultiplier * shiftwidth())
let defValrLine = scala#Test(prevlnum, prevline, '{', '}')
if defValrLine != -1
call scala#ConditionalConfirm("21a")
call scala#ConditionalConfirm("21b")
if scala#GetLine(prevnonblank(prevlnum - 1)) =~ '^.*\<else\>\s*\%(//.*\)\?$'
call scala#ConditionalConfirm("21c")
- let ind = ind - &shiftwidth
+ let ind = ind - shiftwidth()
elseif scala#LineCompletesIfElse(prevlnum, prevline)
call scala#ConditionalConfirm("21d")
- let ind = ind - &shiftwidth
+ let ind = ind - shiftwidth()
elseif scala#CountParens(curline) < 0 && curline =~ '^\s*)' && scala#GetLine(scala#GetLineThatMatchesBracket('(', ')')) =~ '.*(\s*$'
" Handles situations that look like this:
"
" 10
" ).somethingHere()
call scala#ConditionalConfirm("21e")
- let ind = ind - &shiftwidth
+ let ind = ind - shiftwidth()
endif
endif
endif
if line =~ '^\s*\*'
return cindent(v:lnum)
elseif line =~ '^\s*}'
- return indent(v:lnum) - &sw
+ return indent(v:lnum) - shiftwidth()
endif
let pnum = s:prevnonblanknoncomment(v:lnum - 1)
return 0
endif
- let ind = indent(pnum) + s:count_braces(pnum, 1) * &sw
+ let ind = indent(pnum) + s:count_braces(pnum, 1) * shiftwidth()
let pline = getline(pnum)
if pline =~ '}\s*$'
- let ind -= (s:count_braces(pnum, 0) - (pline =~ '^\s*}' ? 1 : 0)) * &sw
+ let ind -= (s:count_braces(pnum, 0) - (pline =~ '^\s*}' ? 1 : 0)) * shiftwidth()
endif
return ind
let ind = indent(lnum)
let line = getline(lnum)
if line =~ '\v^\s*%(while|foreach)>|^\s*%(case\s.*:|default:|else)\s*$|%(<then|\\)$'
- let ind = ind + &sw
+ let ind = ind + shiftwidth()
endif
if line =~ '\v^\s*breaksw>'
- let ind = ind - &sw
+ let ind = ind - shiftwidth()
endif
" Subtract indent if current line has on end, endif, case commands
let line = getline(v:lnum)
if line =~ '\v^\s*%(else|end|endif)\s*$'
- let ind = ind - &sw
+ let ind = ind - shiftwidth()
endif
return ind
let line = getline(pnum)
if line =~ '^\s*\%(grammar\|module\|rule\)\>'
- let ind += &sw
+ let ind += shiftwidth()
endif
let line = getline(v:lnum)
if line =~ '^\s*end\>'
- let ind -= &sw
+ let ind -= shiftwidth()
end
retur ind
let ind = indent(lnum)
if getline(lnum) =~? '^\s*\(Sub\)\=Section\>'
- let ind = ind + &sw
+ let ind = ind + shiftwidth()
endif
if getline(v:lnum) =~? '^\s*End\(Sub\)\=Section\>'
- let ind = ind - &sw
+ let ind = ind - shiftwidth()
endif
return ind
return 0
endif
- return indent(pnum) + s:count_braces(pnum, 1) * &sw
- \ - s:count_braces(v:lnum, 0) * &sw
+ return indent(pnum) + s:count_braces(pnum, 1) * shiftwidth()
+ \ - s:count_braces(v:lnum, 0) * shiftwidth()
endfunction
let &cpo = s:keepcpo
" Vim syntax file
" Language: Erlang (http://www.erlang.org)
" Maintainer: Csaba Hoch <csaba.hoch@gmail.com>
-" Last Update: 2013-Jul-25
+" Contributor: Adam Rutkowski <hq@mtod.org>
+" Last Update: 2017-Mar-05
" License: Vim license
-" URL: https://github.com/hcs42/vim-erlang
+" URL: https://github.com/vim-erlang/vim-erlang-runtime
" Acknowledgements: This script was originally created by Kresimir Marzic [1].
" The script was then revamped by Csaba Hoch [2]. During the revamp, the new
syn match erlangCommentAnnotation ' \@<=@\%(clear\|docfile\|end\|headerfile\|todo\|TODO\|type\|author\|copyright\|doc\|reference\|see\|since\|title\|version\|deprecated\|hidden\|private\|equiv\|spec\|throws\)' contained
syn match erlangCommentAnnotation /`[^']*'/ contained
syn keyword erlangTodo TODO FIXME XXX contained
-syn match erlangShebang '^#!.*'
" Numbers (minimum base is 2, maximum is 36.)
syn match erlangNumberInteger '\<\d\+\>'
" Strings, atoms, characters
syn region erlangString start=/"/ end=/"/ contains=erlangStringModifier
syn region erlangQuotedAtom start=/'/ end=/'/ contains=erlangQuotedAtomModifier
-syn match erlangStringModifier '\~\a\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' contained
-syn match erlangQuotedAtomModifier '\~\a\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' contained
+syn match erlangStringModifier '\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\|\~\%([ni~]\|\%(-\=\d\+\|\*\)\=\.\=\%(\*\|\d\+\)\=\%(\..\)\=[tl]*[cfegswpWPBX#bx+]\)' contained
+syn match erlangQuotedAtomModifier '\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' contained
syn match erlangModifier '\$\%([^\\]\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\)'
" Operators, separators
-syn match erlangOperator '==\|=:=\|/=\|=/=\|<\|=<\|>\|>=\|++\|--\|=\|!\|<-\|+\|-\|\*\|\/'
+syn match erlangOperator '==\|=:=\|/=\|=/=\|<\|=<\|>\|>=\|=>\|:=\|++\|--\|=\|!\|<-\|+\|-\|\*\|\/'
syn keyword erlangOperator div rem or xor bor bxor bsl bsr and band not bnot andalso orelse
syn match erlangBracket '{\|}\|\[\|]\||\|||'
syn match erlangPipe '|'
syn keyword erlangBoolean true false contained
syn match erlangLocalFuncCall '\<\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangBIF
syn match erlangLocalFuncRef '\<\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@='
-syn match erlangGlobalFuncCall '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangComment
-syn match erlangGlobalFuncRef '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@=' contains=erlangComment
+syn match erlangGlobalFuncCall '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangComment,erlangVariable
+syn match erlangGlobalFuncRef '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@=' contains=erlangComment,erlangVariable
-" Variables, macros, records
+" Variables, macros, records, maps
syn match erlangVariable '\<[A-Z_][[:alnum:]_@]*'
syn match erlangMacro '??\=[[:alnum:]_@]\+'
syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+'
+syn match erlangMap '#'
syn match erlangRecord '#\s*\l[[:alnum:]_@]*'
+syn region erlangQuotedRecord start=/#\s*'/ end=/'/ contains=erlangQuotedAtomModifier
+
+" Shebang (this line has to be after the ErlangMap)
+syn match erlangShebang '^#!.*'
" Bitstrings
syn match erlangBitType '\%(\/\%(\s\|\n\|%.*\n\)*\)\@<=\%(integer\|float\|binary\|bytes\|bitstring\|bits\|binary\|utf8\|utf16\|utf32\|signed\|unsigned\|big\|little\|native\|unit\)\%(\%(\s\|\n\|%.*\n\)*-\%(\s\|\n\|%.*\n\)*\%(integer\|float\|binary\|bytes\|bitstring\|bits\|binary\|utf8\|utf16\|utf32\|signed\|unsigned\|big\|little\|native\|unit\)\)*' contains=erlangComment
syn match erlangType '^\s*-\%(\s\|\n\|%.*\n\)*\%(spec\|type\|opaque\|callback\)\>' contains=erlangComment
" Keywords
-syn keyword erlangKeyword after begin case catch cond end fun if let of query
+syn keyword erlangKeyword after begin case catch cond end fun if let of
syn keyword erlangKeyword receive when try
" Build-in-functions (BIFs)
let s:old_style = (exists("g:erlang_old_style_highlight") &&
\g:erlang_old_style_highlight == 1)
-" Only when an item doesn't have highlighting yet
" Comments
hi def link erlangComment Comment
hi def link erlangVariable Normal
hi def link erlangMacro Normal
hi def link erlangRecord Normal
+hi def link erlangQuotedRecord Normal
+hi def link erlangMap Normal
else
hi def link erlangAtom String
hi def link erlangLocalFuncCall Normal
hi def link erlangVariable Identifier
hi def link erlangMacro Macro
hi def link erlangRecord Structure
+hi def link erlangQuotedRecord Structure
+hi def link erlangMap Structure
endif
" Bitstrings
syn match scalaOperator "||"
syn match scalaOperator "&&"
+syn match scalaOperator "|"
+syn match scalaOperator "&"
hi link scalaOperator Special
syn match scalaNameDefinition /\<[_A-Za-z0-9$]\+\>/ contained nextgroup=scalaPostNameDefinition,scalaVariableDeclarationList
hi link scalaStringEmbeddedQuote String
syn region scalaIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
-syn region scalaTripleIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
+syn region scalaTripleIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"""/ end=/"""\ze\%([^"]\|$\)/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
hi link scalaIString String
hi link scalaTripleIString String
" Maintainer: Eric Pruitt <eric.pruitt@gmail.com>
" License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause)
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
+if exists("b:current_syntax")
finish
-else
- let b:current_syntax = "tmux"
endif
-" this file uses line continuations
-let s:cpo_sav = &cpo
+" Explicitly change compatiblity options to Vim's defaults because this file
+" uses line continuations.
+let s:original_cpo = &cpo
set cpo&vim
+let b:current_syntax = "tmux"
setlocal iskeyword+=-
syntax case match
exec "syn match tmuxColour" . s:i . " /\\<colour" . s:i . "\\>/ display"
\ " | highlight tmuxColour" . s:i . " ctermfg=" . s:i . " ctermbg=" . s:bg
endfor
-unlet s:bg s:i
syn keyword tmuxOptions
\ buffer-limit command-alias default-terminal escape-time exit-unattached
\ swapp swap-window swapw switch-client switchc unbind-key unbind wait-for
\ wait
-let &cpo = s:cpo_sav
-unlet! s:cpo_sav
+let &cpo = s:original_cpo
+unlet! s:original_cpo s:bg s:i