Compare commits

...

188 Commits

Author SHA1 Message Date
1c13c0fe3e patch 8.0.0632: the quotestar test is still a bit flaky
Problem:    The quotestar test is still a bit flaky.
Solution:   Kill any existing server to make the retry work.  Wait for the
            register to be filled.
2017-06-10 16:30:32 +02:00
fa4161cb0c patch 8.0.0631: can't build with Perl 5.26
Problem:    Perl 5.26 also needs S_TOPMARK and S_POPMARK defined.
Solution:   Define the functions when needed. (Jesin, closes #1748)
2017-06-10 15:46:23 +02:00
f84b122a99 patch 8.0.0630: it is not easy to work on lines without a match
Problem:    The :global command does not work recursively, which makes it
            difficult to execute a command on a line where one pattern matches
            and another does not match. (Miles Cranmer)
Solution:   Allow for recursion if it is for only one line. (closes #1760)
2017-06-10 14:29:52 +02:00
6b1da3312e patch 8.0.0629: checking for ambigous width is not working
Problem:    Checking for ambigous width is not working. (Hirohito Higashi)
Solution:   Reset "starting" earlier.
2017-06-09 21:35:47 +02:00
f085f4266e patch 8.0.0628: cursor disappears after silent mapping
Problem:    Cursor disappears after silent mapping. (Ramel Eshed)
Solution:   Do restore the cursor when it was changed, but don't change it in
            the first place for a silent mapping.
2017-06-07 20:39:47 +02:00
add8dce38d patch 8.0.0627: "gn" selects only one character with 'nowrapscan'
Problem:    When 'wrapscan' is off "gn" does not select the whole pattern when
            it's the last one in the text. (KeyboardFire)
Solution:   Check if the search fails. (Christian Brabandt, closes #1683)
2017-06-05 19:56:04 +02:00
e21d69eec1 patch 8.0.0626: in the GUI the cursor may flicker
Problem:    In the GUI the cursor may flicker.
Solution:   Check the cmd_silent flag before updating the cursor shape.
            (Hirohito Higashi, closes #1637)
2017-06-05 19:32:32 +02:00
206155280d patch 8.0.0625: shellescape() always escapes a newline
Problem:    shellescape() always escapes a newline, which does not work with
            some shells. (Harm te Hennepe)
Solution:   Only escape a newline when the "special" argument is non-zero.
            (Christian Brabandt, closes #1590)
2017-06-05 18:46:26 +02:00
6c95fbc9ae patch 8.0.0624: warning for unused variable in tiny build
Problem:    Warning for unused variable in tiny build. (Tony Mechelynck)
Solution:   Add an #ifdef.
2017-06-05 17:53:37 +02:00
966e58e413 patch 8.0.0623: error for invalid regexp is not very informative
Problem:    The message "Invalid range" is used for multiple errors.
Solution:   Add two more specific error messages. (Itchyny, Ken Hamada)
2017-06-05 16:54:08 +02:00
c5e2b040b4 patch 8.0.0622: selecting quoted text fails with 'selection' "exclusive"
Problem:    Using a text object to select quoted text fails when 'selection'
            is set to "exclusive". (Guraga)
Solution:   Swap cursor and visual start position. (Christian Brabandt,
            closes #1687)
2017-06-05 16:37:07 +02:00
8ad80dea08 patch 8.0.0621: :stag does not respect 'switchbuf'
Problem:    The ":stag" command does not respect 'switchbuf'.
Solution:   Check 'switchbuf' for tag commands that may open a new window.
            (Ingo Karkat, closes #1681)  Define macros for the return values
            of getfile().
2017-06-05 16:01:59 +02:00
b463e8d999 patch 8.0.0620: checking for HAVE_GTK_MULTIHEAD is not needed
Problem:    Since we only support GTK versions that have it, the ckeck for
            HAVE_GTK_MULTIHEAD is no longer needed.
Solution:   Remove HAVE_GTK_MULTIHEAD. (Kazunobu Kuriyama)
2017-06-05 15:07:09 +02:00
6aa8cea46d Update runtime files. 2017-06-05 14:44:35 +02:00
9472eec83c patch 8.0.0619: GUI gets stuck if timer uses feedkeys()
Problem:    In the GUI, when a timer uses feedkeys(), it still waits for an
            event. (Raymond Ko)
Solution:   Check tb_change_cnt in one more place.
2017-06-05 13:31:56 +02:00
bb7943b792 patch 8.0.0618: NFA regex engine handles [0-z] incorrectly
Problem:    NFA regex engine handles [0-z] incorrectly.
Solution:   Return at the right point. (James McCoy, closes #1703)
2017-06-05 13:30:06 +02:00
763209c57b patch 8.0.0617: hardcopy test hangs on MS-Windows
Problem:    Hardcopy test hangs on MS-Windows.
Solution:   Check the postscript feature is supported.
2017-06-04 21:40:36 +02:00
1615b36b91 patch 8.0.0616: not always setting 'background' correctly after :hi Normal
Problem:    When setting the cterm background with ":hi Normal" the value of
            'background' may be set wrongly.
Solution:   Check that the color is less than 16.  Don't set 'background' when
            it was set explicitly. (Lemonboy, closes #1710)
2017-06-04 21:06:09 +02:00
bf15b8d78b patch 8.0.0615: using % with :hardcopy wrongly escapes spaces
Problem:    Using % with :hardcopy wrongly escapes spaces. (Alexey Muranov)
Solution:   Expand % differently. (Christian Brabandt, closes #1682)
2017-06-04 20:43:48 +02:00
863e80b445 patch 8.0.0614: float2nr() is not exactly right
Problem:    float2nr() is not exactly right.
Solution:   Make float2nr() more accurate.  Turn test64 into a new style test.
            (Hirohito Higashi, closes #1688)
2017-06-04 20:30:00 +02:00
3e54569b17 patch 8.0.0613: the conf filetype is used before ftdetect from packages
Problem:    The conf filetype detection is done before ftdetect scripts from
            packages that are added later.
Solution:   Add the FALLBACK argument to :setfiletype. (closes #1679,
            closes #1693)
2017-06-04 19:00:32 +02:00
ce876aaa9a patch 8.0.0612: pack dirs are added to 'runtimepath' too late
Problem:    Package directories are added to 'runtimepath' only after loading
            non-package plugins.
Solution:   Split off the code to add package directories to 'runtimepath'.
            (Ingo Karkat, closes #1680)
2017-06-04 17:47:42 +02:00
976787d1f3 patch 8.0.0611: the screen is not redrawn after sending t_u7
Problem:    When t_u7 is sent a few characters in the second screen line are
            overwritten and not redrawn later. (Rastislav Barlik)
Solution:   Move redrawing the screen to after overwriting the characters.
2017-06-04 15:45:50 +02:00
4b974d5443 patch 8.0.0610: the screen is redrawn when default 'background' is detected
Problem:    The screen is redrawn when t_BG is set and used to detect the
            value for 'background'.
Solution:   Don't redraw when the value of 'background' didn't change.
2017-06-04 15:37:46 +02:00
28a8193e31 patch 8.0.0609: some people still don't know how to quit
Problem:    For some people the hint about quitting is not sufficient.
Solution:   Put <Enter> separately.  Also use ":qa!" to get out even when
            there are changes.
2017-06-04 15:33:48 +02:00
a3921f48c6 patch 8.0.0608: cannot manipulate other than the current quickfix list
Problem:    Cannot manipulate other than the current quickfix list.
Solution:   Pass the list index to quickfix functions. (Yegappan Lakshmanan)
2017-06-04 15:30:34 +02:00
45e5fd135d patch 8.0.0607: after :bwipe + :new bufref might still be valid
Problem:    When creating a bufref, then using :bwipe and :new it might get
            the same memory and bufref_valid() returns true.
Solution:   Add br_fnum to check the buffer number didn't change.
2017-06-04 14:58:02 +02:00
6e62da3e14 patch 8.0.0606: cannot set the context for a specified quickfix list
Problem:    Cannot set the context for a specified quickfix list.
Solution:   Use the list index instead of the current list. (Yegappan
            Lakshmanan)
2017-05-28 08:16:25 +02:00
6dd4a53502 patch 8.0.0605: the quickfix cached buffer may become invalid
Problem:    The buffer that quickfix caches for performance may become
            invalid. (Daniel Hahler)
Solution:   Reset qf_last_bufref in qf_init_ext(). (Daniel Hahler,
            closes #1728, closes #1676)
2017-05-28 07:56:36 +02:00
b4d6c3ea4a Update runtime files. 2017-05-27 16:45:17 +02:00
712598f210 patch 8.0.0604: gF test fails still on MS-Windows
Problem:    gF test fails still on MS-Windows.
Solution:   Use : before the line number and remove it from 'isfname'.
2017-05-24 10:42:37 +02:00
d7aca7a71c patch 8.0.0603: gF test fails on MS-Windows
Problem:    gF test fails on MS-Windows.
Solution:   Use @ instead of : before the line number
2017-05-24 10:05:56 +02:00
2a79ed293c patch 8.0.0602: when gF fails to edit the file the cursor still moves
Problem:    When gF fails to edit the file the cursor still moves to the found
            line number.
Solution:   Check the return value of do_ecmd(). (Michael Hwang)
2017-05-24 09:51:39 +02:00
545cb79da5 patch 8.0.0601: no test coverage for :spellrepall
Problem:    No test coverage for :spellrepall.
Solution:   Add a test. (Dominique Pelle, closes #1717)
2017-05-23 11:31:22 +02:00
2a0b06def4 patch 8.0.0600: test_recover fails on some systems
Problem:    test_recover fails on some systems.
Solution:   Explicitly check if "/" is writable. (Ken Takata)
2017-05-18 16:23:43 +02:00
79a213d6a4 patch 8.0.0599: diff mode is insufficiently tested
Problem:    diff mode is insufficiently tested
Solution:   Add more test cases. (Dominique Pelle, closes #1685)
2017-05-16 13:15:18 +02:00
9e0f6ec076 patch 8.0.0598: building with gcc 7.1 yields new warnings
Problem:    Building with gcc 7.1 yields new warnings.
Solution:   Initialize result. (John Marriott)
2017-05-16 09:36:54 +02:00
253f912877 patch 8.0.0597: off-by-one error in size computation
Problem:    Off-by-one error in buffer size computation.
Solution:   Use ">=" instead of ">". (Lemonboy, closes #1694)
2017-05-15 08:45:13 +02:00
4475b62396 patch 8.0.0596: crash when complete() called after complete_add()
Problem:    Crash when complete() is called after complete_add() in
            'completefunc'. (Lifepillar)
Solution:   Bail out if compl_pattern is NULL. (closes #1668)
            Also avoid using freed memory.
2017-05-01 20:46:52 +02:00
beb9cb19c6 patch 8.0.0595: Coverity warning for not checking return value
Problem:    Coverity warning for not checking return value of dict_add().
Solution:   Check the return value for FAIL.
2017-05-01 14:14:04 +02:00
66c0e70b80 patch 8.0.0594: build failure when windows feature is missing
Problem:    Build failure when windows feature is missing.
Solution:   Add #ifdef.
2017-04-30 20:46:32 +02:00
45cf6e910c patch 8.0.0593: duplication of code for adding a list or dict return value
Problem:    Duplication of code for adding a list or dict return value.
Solution:   Add rettv_dict_set() and rettv_list_set(). (Yegappan Lakshmanan)
2017-04-30 20:25:19 +02:00
29ae377ea7 patch 8.0.0592: if a job writes to a buffer screen is not updated
Problem:    If a job writes to a buffer and the user is typing a command, the
            screen isn't updated. When a message is displayed the changed
            buffer may cause it to be cleared. (Ramel Eshed)
Solution:   Update the screen and then the command line if the screen didn't
            scroll. Avoid inserting screen lines, as it clears any message.
            Update the status line when the buffer changed.
2017-04-30 19:39:39 +02:00
45d2cca1ea patch 8.0.0591: changes to eval functionality not documented
Problem:    Changes to eval functionality not documented.
Solution:   Include all the changes.
2017-04-30 16:36:05 +02:00
8f77c5a4ec patch 8.0.0590: cannot add a context to locations
Problem:    Cannot add a context to locations.
Solution:   Add the "context" entry in location entries. (Yegappan Lakshmanan,
            closes #1012)
2017-04-30 14:21:00 +02:00
a21ccb7a97 patch 8.0.0589: :simalt still does not work
Problem:    :simalt still does not work.
Solution:   Use K_NOP instead of K_IGNORE. (Christian Brabandt)
2017-04-29 17:40:22 +02:00
1a9020d4cb patch 8.0.0588: job_stop() often assumes the channel will be closed
Problem:    job_stop() often assumes the channel will be closed, while the job
            may not actually be stopped. (Martin Gammelsæter)
Solution:   Only assume the job stops on "kill".  Don't send a signal if the
            job has already ended. (closes #1632)
2017-04-29 16:24:38 +02:00
0635ee6824 Runtime file updates 2017-04-28 20:32:33 +02:00
696cbd224b patch 8.0.0587: configure check for return value of tgetent skipped
Problem:    Configure check for return value of tgetent is skipped.
Solution:   Always perform the check. (Marvin Schmidt, closes #1664)
2017-04-28 15:45:46 +02:00
b7637c44c2 patch 8.0.0586: no test for mapping timing out
Problem:    No test for mapping timing out.
Solution:   Add a test.
2017-04-23 18:49:36 +02:00
86e5792906 patch 8.0.0585: test_options fails when run in the GUI
Problem:    Test_options fails when run in the GUI.
Solution:   Also check the 'imactivatekey' value when the GUI is not running.
            Specify test values that work and that fail.
2017-04-23 18:44:26 +02:00
94237495c0 Updated runtime files. 2017-04-23 18:40:21 +02:00
d788f6fe89 patch 8.0.0584: memory leak when executing quickfix tests
Problem:    Memory leak when executing quickfix tests.
Solution:   Free the list reference. (Yegappan Lakshmanan)
2017-04-23 17:19:43 +02:00
b11c826ddc patch 8.0.0583: fold test hangs on MS-Windows
Problem:    Fold test hangs on MS-Windows.
Solution:   Avoid overflow in compare.
2017-04-23 16:48:20 +02:00
5b276aa80e patch 8.0.0582: illegal memory access with z= command
Problem:    Illegal memory access with z= command. (Dominique Pelle)
Solution:   Avoid case folded text to be longer than the original text.  Use
            MB_PTR2LEN() instead of MB_BYTE2LEN().
2017-04-22 23:49:52 +02:00
94be619e30 patch 8.0.0581: moving folded text is sometimes not correct
Problem:    Moving folded text is sometimes not correct.
Solution:   Bail out when "move_end" is zero. (Matthew Malcomson)
2017-04-22 22:40:11 +02:00
f1d21c8cc8 patch 8.0.0580: cannot set the valid flag with setqflist()
Problem:    Cannot set the valid flag with setqflist().
Solution:   Add the "valid" argument. (Yegappan Lakshmanan, closes #1642)
2017-04-22 21:20:46 +02:00
9b77016545 patch 8.0.0579: duplicate test case for quickfix
Problem:    Duplicate test case for quickfix.
Solution:   Remove the function. (Yegappan Lakshmanan)
2017-04-22 15:42:53 +02:00
7a85b0f028 patch 8.0.0578: :simalt on MS-Windows does not work properly
Problem:    :simalt on MS-Windows does not work properly.
Solution:   Put something in the typeahead buffer. (Christian Brabandt)
2017-04-22 15:17:40 +02:00
97db5541a6 patch 8.0.0577: warning for uninitialized variable
Problem:    Warning for uninitialized variable. (John Marriott)
Solution:   Initialize "indent".
2017-04-21 23:18:26 +02:00
1d4be82c7d patch 8.0.0576: can't build when configure choses "install-sh"
Problem:    Can't build when configure choses "install-sh". (Daniel Hahler)
Solution:   Always use install-sh.  Fix remaining use of mkinstalldirs.
            (closes #1647)
2017-04-21 23:00:02 +02:00
a701b3b6f0 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Problem:    Using freed memory when resetting 'indentexpr' while evaluating
            it. (Dominique Pelle)
Solution:   Make a copy of 'indentexpr'.
2017-04-20 22:57:27 +02:00
99895eac1c patch 8.0.0574: get only one quickfix list after :caddbuf
Problem:    Get only one quickfix list after :caddbuf.
Solution:   Reset qf_multiline. (Yegappan Lakshmanan)
2017-04-20 22:44:47 +02:00
91b6e4591a patch 8.0.0573: running parallel make after distclean fails
Problem:    Running parallel make after distclean fails. (Manuel Ortega)
Solution:   Instead of using targets "scratch config myself" use "reconfig".
2017-04-20 22:32:24 +02:00
6de5e12601 patch 8.0.0572: building the command table requires Perl
Problem:    Building the command table requires Perl.
Solution:   Use a Vim script solution. (Dominique Pelle, closes #1641)
2017-04-20 21:55:44 +02:00
a364cdb648 patch 8.0.0571: negative line number when using :z^ in an empty buffer
Problem:    The cursor line number becomes negative when using :z^ in an empty
            buffer. (neovim #6557)
Solution:   Correct the line number.  Also reset the column.
2017-04-20 21:12:30 +02:00
c03944151f patch 8.0.0570: can't run make with several jobs
Problem:    Can't run make with several jobs, creating directories has a race
            condition.
Solution:   Use the MKDIR_P autoconf mechanism. (Eric N. Vander Weele,
            closes #1639)
2017-04-20 20:20:23 +02:00
62cf09b5dc patch 8.0.0569: bracketed paste is still enabled in a shell command
Problem:    Bracketed paste is still enabled when executing a shell command.
            (Michael Smith)
Solution:   Disable brackted paste when going into cooked mode. (closes #1638)
2017-04-20 19:44:09 +02:00
60402d68da patch 8.0.0568: 1gd may hang
Problem:    "1gd" may hang.
Solution:   Don't get stuck in one position. (Christian Brabandt, closes #1643)
2017-04-20 18:54:50 +02:00
fc8f1118e7 patch 8.0.0567: call for requesting color and ambiwidth is too early
Problem:    Call for requesting color and ambiwidth is too early. (Hirohito
            Higashi)
Solution:   Move the call down to below resetting "starting".
2017-04-18 18:51:35 +02:00
43d1ac6e81 patch 8.0.0566: setting nocompatible for the tiny version moves the cursor
Problem:    Setting nocompatible for the tiny version moves the cursor.
Solution:   Use another trick to skip commands when the +eval feature is
            present. (Christian Brabandt, closes #1630)
2017-04-15 15:37:25 +02:00
31bdd13c33 patch 8.0.0565: using freed memory in :caddbuf
Problem:    Using freed memory in :caddbuf after clearing quickfix list.
            (Dominique Pelle)
Solution:   Set qf_last to NULL.
2017-04-15 15:22:52 +02:00
39170e2d97 patch 8.0.0564: cannot detect Bazel BUILD files on some systems
Problem:    Cannot detect Bazel BUILD files on some systems.
Solution:   Check for BUILD after script checks. (Issue #1340)
2017-04-15 14:36:07 +02:00
9f92886277 patch 8.0.0563: crash when getting the window position in tmux
Problem:    Crash when getting the window position in tmux. (Marvin Schmidt)
Solution:   Add t_GP to the list of terminal options. (closes #1627)
2017-04-11 22:44:05 +02:00
ea588154d0 patch 8.0.0562: not enough test coverage for syntax commands
Problem:    Not enough test coverage for syntax commands.
Solution:   Add a few more tests. (Dominique Pelle, closes #1624)
2017-04-10 22:45:30 +02:00
478af67dd6 patch 8.0.0561: undefined behavior when using backslash after empty line
Problem:    Undefined behavior when using backslash after empty line.
Solution:   Check for an empty line. (Dominique Pelle, closes #1631)
2017-04-10 22:22:42 +02:00
451a4a1cb7 patch 8.0.0560: :windo allows for ! but it's not supported
Problem:    :windo allows for ! but it's not supported.
Solution:   Disallow passing !. (Hirohito Higashi)
2017-04-10 21:46:38 +02:00
f803a76978 patch 8.0.0559: setting ttytype to xxx does not always fail
Problem:    Setting ttytype to xxx does not always fail as expected. (Marvin
            Schmidt)
Solution:   Catch both possible errors. (closes #1601)
2017-04-09 22:54:13 +02:00
cd5c8f8250 Update runtime files. 2017-04-09 20:11:58 +02:00
f8ec998613 patch 8.0.0558: :ownsyntax is not tested
Problem:    The :ownsyntax command is not tested.
Solution:   Add a test. (Dominique Pelle, closes #1622)
2017-04-09 15:41:31 +02:00
59053e1d9f patch 8.0.0557: GTK: using static gravities is not useful
Problem:    GTK: using static gravities is not useful.
Solution:   Remove setting static gravities. (Kazunobu Kuriyama)
2017-04-09 15:27:09 +02:00
7860bac57b patch 8.0.0556: getting window position fails if GUI and term possible
Problem:    Getting the window position fails if both the GUI and term
            code is built in.
Solution:   Return after getting the GUI window position. (Kazunobu Kuriyama)
2017-04-09 15:03:15 +02:00
d2381a2cad patch 8.0.0555: toupper/tolower test fails on OSX without Darwin
Problem:    Toupper/tolower test fails on OSX without Darwin.
Solution:   Skip that part of the test also for OSX. (Kazunobu Kuriyama)
2017-04-09 14:58:15 +02:00
1cc482069a patch 8.0.0554: toupper and tolower don't work properly for Turkish
Problem:    Toupper and tolower don't work properly for Turkish when 'casemap'
            contains "keepascii". (Bjorn Linse)
Solution:   When 'casemap' contains "keepascii" use ASCII toupper/tolower.
2017-04-09 13:41:59 +02:00
9f4de1f543 patch 8.0.0553: toupper/tolower test fails on Mac
Problem:    Toupper/tolower test with Turkish locale fails on Mac.
Solution:   Skip the test on Mac.
2017-04-08 19:39:43 +02:00
3317d5ebbe patch 8.0.0552: toupper and tolower don't work properly for Turkish
Problem:    Toupper and tolower don't work properly for Turkish when 'casemap'
            is empty. (Bjorn Linse)
Solution:   Check the 'casemap' options when deciding how to upper/lower case.
2017-04-08 19:12:06 +02:00
d34f9b1155 patch 8.0.0551: the typeahead buffer is reallocated too often
Problem:    The typeahead buffer is reallocated too often.
Solution:   Re-use the existing buffer if possible.
2017-04-08 18:41:13 +02:00
9585a1655b patch 8.0.0550: cannot parse some etags format tags file
Problem:    Some etags format tags file use 0x01, breaking the parsing.
Solution:   Use 0x02 for TAG_SEP. (James McCoy, closes #1614)
2017-04-07 20:30:29 +02:00
395b6bab33 patch 8.0.0549: no test for the 8g8 command
Problem:    No test for the 8g8 command.
Solution:   Add a test. (Dominique Pelle, closes #1615)
2017-04-07 20:09:51 +02:00
d4863aa99e patch 8.0.0548: saving the redo buffer only works one time
Problem:    Saving the redo buffer only works one time, resulting in the "."
            command not working well for a function call inside another
            function call. (Ingo Karkat)
Solution:   Save the redo buffer at every user function call. (closes #1619)
2017-04-07 19:50:12 +02:00
52604f2454 patch 8.0.0547: extra line break in verbosefile
Problem:    Extra line break in verbosefile when using ":echomsg". (Ingo
            Karkat)
Solution:   Don't call msg_start(). (closes #1618)
2017-04-07 16:17:39 +02:00
3bab93998d patch 8.0.0546: swap file exists briefly when opening the command window
Problem:    Swap file exists briefly when opening the command window.
Solution:   Set the noswapfile command modifier before splitting the window.
            (James McCoy, closes #1620)
2017-04-07 15:42:25 +02:00
15ecbd6f3d patch 8.0.0545: edit test may fail on some systems
Problem:    Edit test may fail on some systems.
Solution:   If creating a directory with a very long path fails, bail out.
2017-04-07 14:10:48 +02:00
866c688610 patch 8.0.0544: cppcheck warnings
Problem:    Cppcheck warnings.
Solution:   Use temp variable. Change NUL to NULL. Swap conditions. (Dominique
            Pelle)
2017-04-07 14:02:01 +02:00
ba6ec18297 patch 8.0.0543: test_edit causes older xfce4-terminal to close
Problem:    Test_edit causes older xfce4-terminal to close. (Dominique Pelle)
Solution:   Reduce number of columns to 2000.  Try to restore the window
            position.
2017-04-04 22:41:10 +02:00
a1d5fa65bc patch 8.0.0542: getpos() can return a negative line number
Problem:    getpos() can return a negative line number. (haya14busa)
Solution:   Handle a zero topline and botline. (closes #1613)
2017-04-03 22:02:55 +02:00
04000560ca patch 8.0.0541: compiler warning on MS-Windows
Problem:    Compiler warning on MS-Windows.
Solution:   Add a type cast. (Mike Williams)
2017-04-03 21:35:42 +02:00
a604429529 patch 8.0.0540: building unit tests fails
Problem:    Building unit tests fails.
Solution:   Move params outside of #ifdef.
2017-04-02 18:19:53 +02:00
08f88b139d patch 8.0.0539: startup test fails on Mac
Problem:    Startup test fails on Mac.
Solution:   Use another term name, "unknown" is known. Avoid a 2 second delay.
2017-04-02 17:21:16 +02:00
85045a73db patch 8.0.0538: no test for falling back to default term value
Problem:    No test for falling back to default term value.
Solution:   Add a test.
2017-04-02 16:54:09 +02:00
fa0ad0bb0b patch 8.0.0537: illegal memory access with :z and large count
Problem:    Illegal memory access with :z and large count.
Solution:   Check for number overflow, using long instead of int. (Dominique
            Pelle, closes #1612)
2017-04-02 15:45:17 +02:00
69f40be645 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Problem:    Quickfix window not updated when freeing quickfix stack.
Solution:   Update the quickfix window. (Yegappan Lakshmanan)
2017-04-02 15:15:49 +02:00
6914c64ee5 patch 8.0.0535: memory leak when exiting from within a user function
Problem:    Memory leak when exiting from within a user function.
Solution:   Clear the function call stack on exit.
2017-04-01 21:21:30 +02:00
33ccb24cf7 patch 8.0.0534: defaults.vim does not work well with tiny features
Problem:    Defaults.vim does not work well with tiny features. (crd477)
Solution:   When the +eval feature is not available always reset 'compatible'.
2017-04-01 16:59:29 +02:00
878c263a48 patch 8.0.0533: abbreviation doesn't work after backspacing newline
Problem:    Abbreviation doesn't work after backspacing newline. (Hkonrk)
Solution:   Set the insert start column. (closes #1609)
2017-04-01 15:15:52 +02:00
c77d675747 patch 8.0.0532: test with long directory name fails on Mac
Problem:    Test with long directory name fails on Mac.
Solution:   Skip the test on Mac systems.
2017-04-01 14:13:14 +02:00
9b81079ddd patch 8.0.0531: test with long directory name fails on non-unix systems
Problem:    Test with long directory name fails on non-unix systems.
Solution:   Skip the test on non-unix systems.
2017-03-31 23:32:53 +02:00
658a3a2caf patch 8.0.0530: buffer overflow when 'columns' is very big
Problem:    Buffer overflow when 'columns' is very big. (Nikolai Pavlov)
Solution:   Correctly compute where to truncate.  Fix translation.
            (closes #1600)
2017-03-31 22:27:12 +02:00
13489b9c41 patch 8.0.0529: line in test commented out
Problem:    Line in test commented out.
Solution:   Uncomment the lines for character classes that were failing before
            8.0.0519. (Dominique Pelle, closes #1599)
2017-03-30 22:20:29 +02:00
ef8eb08978 patch 8.0.0528: highlight wrong text when 'wim' includes "longest"
Problem:    When 'wildmenu' is set and 'wildmode' has "longest" then the first
            file name is highlighted, even though the text shows the longest
            match.
Solution:   Do not highlight the first match. (LemonBoy, closes #1602)
2017-03-30 22:04:55 +02:00
ce5c274201 patch 8.0.0527: leftover file from RISC OS
Problem:    RISC OS support was removed long ago, but one file is still
            included.
Solution:   Delete the file. (Thomas Dziedzic, closes #1603)
2017-03-30 21:51:31 +02:00
85325f839a patch 8.0.0526: Coverity complains about possible negative value
Problem:    Coverity complains about possible negative value.
Solution:   Check return value of ftell() not to be negative.
2017-03-30 21:18:45 +02:00
a33ddbbd04 patch 8.0.0525: completion for user command argument not tested
Solution:   Completion for user command argument not tested.
Problem:    Add a test.
2017-03-29 21:30:04 +02:00
8da1e6cedf patch 8.0.0524: folds messed up
Problem:    Folds are messed up when 'encodin' is "utf-8".
Solution:   Also set the fold character when it's not multi-byte.
2017-03-29 20:38:59 +02:00
bf3d58073f patch 8.0.0523: dv} deletes part of a multi-byte character.
Problem:    dv} deletes part of a multi-byte character. (Urtica Dioica)
Solution:   Include the whole character.
2017-03-29 19:48:11 +02:00
3fcfa35f82 patch 8.0.0522: Win32: when 'clipboard' is "unnamed" yyp does not work
Problem:    MS-Windows: when 'clipboard' is "unnamed" yyp does not work in a
            :global command.
Solution:   When setting the clipboard was postponed, do not clear the
            register.
2017-03-29 19:20:41 +02:00
99a6e8dd82 patch 8.0.0521: GtkForm handling is outdated
Problem:    GtkForm handling is outdated.
Solution:   Get rid of event filter functions.  Get rid of GtkForm.width and
            .height.  Eliminate gtk_widget_size_request() calls. (Kazunobu
            Kuriyama)
2017-03-29 18:07:40 +02:00
ace95989ed patch 8.0.0520: using a function pointer while the function is known
Problem:    Using a function pointer instead of the actual function, which we
            know.
Solution:   Change mb_ functions to utf_ functions when already checked for
            Unicode. (Dominique Pelle, closes #1582)
2017-03-29 17:30:27 +02:00
0c078fc7db patch 8.0.0519: character classes are not well tested
Problem:    Character classes are not well tested. They can differ between
            platforms.
Solution:   Add tests.  In the documentation make clear which classes depend
            on what library function.  Only use :cntrl: and :graph: for ASCII.
            (Kazunobu Kuriyama, Dominique Pelle, closes #1560)
            Update the documentation.
2017-03-29 15:31:20 +02:00
c6cd8409c2 patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Problem:    Storing a zero byte from a multi-byte character causes fold text
            to show up wrong.
Solution:   Avoid putting zero in ScreenLines. (Christian Brabandt,
            closes #1567)
2017-03-29 14:40:47 +02:00
b6fa30ccc3 patch 8.0.0517: there is no way to remove quickfix lists
Problem:    There is no way to remove quickfix lists (for testing).
Solution:   Add the 'f' action to setqflist(). Add tests. (Yegappan
            Lakshmanan)
2017-03-29 14:19:25 +02:00
e0720cbf63 Update runtime files. 2017-03-29 13:48:40 +02:00
b1e04fca37 patch 8.0.0516: a large count on a normal command causes trouble
Problem:    A large count on a normal command causes trouble. (Dominique
            Pelle)
Solution:   Make "opcount" long.
2017-03-29 13:08:35 +02:00
d5d37537d1 patch 8.0.0515: ml_get errors in silent Ex mode
Problem:    ml_get errors in silent Ex mode. (Dominique Pelle)
Solution:   Clear valid flags when setting the cursor.  Set the topline when
            not in full screen mode.
2017-03-27 23:02:07 +02:00
980128c369 patch 8.0.0514: script for creating cmdidxs can be improved
Problem:    Script for creating cmdidxs can be improved.
Solution:   Count skipped lines instead of collecting the lines.  Add "const".
            (Dominique Pelle, closes #1594)
2017-03-26 21:46:28 +02:00
c96272e30e patch 8.0.0513: getting name of cleared highlight group is wrong
Problem:    Getting name of cleared highlight group is wrong. (Matt Wozniski)
Solution:   Only skip over cleared names for completion. (closes #1592)
            Also fix that a cleared group causes duplicate completions.
2017-03-26 13:50:09 +02:00
1572e30607 patch 8.0.0512: check for available characters takes too long
Problem:    Check for available characters takes too long.
Solution:   Only check did_start_blocking if wtime is negative. (Daisuke
            Suzuki, closes #1591)
2017-03-25 20:16:28 +01:00
a683ec44c3 patch 8.0.0511: message for skipping client-server tests is unclear
Problem:    Menuage for skipping client-server tests is unclear.
Solution:   Be more specific about what's missing (Hirohito Higashi, Kazunobu
            Kuriyama)
2017-03-25 20:14:34 +01:00
8a0141d4e7 patch 8.0.0510: typo in link to codecov.io results
Problem:    Typo in link to codecov.io results.
Solution:   Remove duplicate https:.
2017-03-25 18:10:31 +01:00
dd00851e07 patch 8.0.0509: no link to codecov.io results
Problem:    No link to codecov.io results.
Solution:   Add a badge to the readme file.
2017-03-25 18:04:32 +01:00
d722fd74d8 patch 8.0.0508: Coveralls no longer shows per-file coverage
Problem:    Coveralls no longer shows per-file coverage.
Solution:   Add coverage from codecov.io. (Christian Brabandt)
2017-03-25 17:46:59 +01:00
a2845b8f5a patch 8.0.0507: client-server tests fail when $DISPLAY is not set
Problem:    Client-server tests fail when $DISPLAY is not set.
Solution:   Check for E240 before running the test.
2017-03-25 15:20:06 +01:00
6c0c1e8052 patch 8.0.0506: can't build with ANSI C
Problem:    Can't build with ANSI C.
Solution:   Move declarations to start of block.
2017-03-25 15:07:43 +01:00
ba6ad17378 patch 8.0.0505: failed window split for :stag not handled
Problem:    Failed window split for :stag not handled. (Coverity CID 99204)
Solution:   If the split fails skip to the end. (bstaletic, closes #1577)
2017-03-25 15:03:45 +01:00
e5e0fbcd42 patch 8.0.0504: looking up an Ex command is a bit slow
Problem:    Looking up an Ex command is a bit slow.
Solution:   Instead of just using the first letter, also use the second letter
            to skip ahead in the list of commands. Generate the table with a
            Perl script. (Dominique Pelle, closes #1589)
2017-03-25 14:51:01 +01:00
9d20ce6970 patch 8.0.0503: endless loop in updating folds with 32 bit ints
Problem:    Endless loop in updating folds with 32 bit ints.
Solution:   Subtract from LHS instead of add to the RHS. (Matthew Malcomson)
2017-03-23 21:53:35 +01:00
a37ffaa5e0 patch 8.0.0502: Coverity complains about possible NULL pointer
Problem:    Coverity complains about possible NULL pointer.
Solution:   Add an assert(), let's see if this works on all systems.
2017-03-21 21:58:00 +01:00
b2964f2570 patch 8.0.0501: on MS-Windows ":!start" does not work as expected
Problem:    On MS-Windows ":!start" does not work as expected.
Solution:   When creating a process fails try passing the argument to
            ShellExecute().  (Katsuya Hino, closes #1570)
2017-03-21 19:29:26 +01:00
3c2881dc11 Update runtime files. Add Rust support. 2017-03-21 19:18:29 +01:00
4889ad7c6c patch 8.0.0500: quotestar test is still a bit flaky
Problem:    Quotestar test is still a bit flaky.
Solution:   Add a slower check for v:version.
2017-03-21 18:02:41 +01:00
c6aafbaf3e patch 8.0.0499: taglist() does not prioritize tags for a buffer
Problem:    taglist() does not prioritize tags for a buffer.
Solution:   Add an optional buffer argument. (Duncan McDougall, closes #1194)
2017-03-21 17:09:10 +01:00
e94260f358 patch 8.0.0498: two autocmd tests are skipped on MS-Windows
Problem:    Two autocmd tests are skipped on MS-Windows.
Solution:   Make the test pass on MS-Windows. Write the messages in a file
            instead of getting the output of system().
2017-03-21 15:50:12 +01:00
3ff2f09525 patch 8.0.0497: arabic support is not fully tested
Problem:    Arabic support is not fully tested.
Solution:   Add more tests for the untested functions.  Comment out
            unreachable code.
2017-03-21 13:22:44 +01:00
518c9b133b patch 8.0.0496: insufficient testing for folding
Problem:    Insufficient testing for folding.
Solution:   Add a couple more fold tests. (Dominique Pelle, closes #1579)
2017-03-21 11:48:39 +01:00
f5610da7a8 patch 8.0.0495: quotestar test uses timer instead of timeout
Problem:    The quotestar test uses a timer instead of a timeout, thus it
            cannot be rerun like a flaky test.
Solution:   Remove the timer and add a timeout. (Kazunobu Kuriyama)
2017-03-20 21:47:16 +01:00
1662ce104e patch 8.0.0494: build failure with older compiler on MS-Windows
Problem:    Build failure with older compiler on MS-Windows.
Solution:   Move declaration to start of block.
2017-03-19 21:47:50 +01:00
15618fa643 patch 8.0.0493: crash with cd command with very long argument
Problem:    Crash with cd command with very long argument.
Solution:   Check for running out of space. (Dominique pending, closes #1576)
2017-03-19 21:37:13 +01:00
81b9d0bd5c patch 8.0.0492: a failing client-server request can make Vim hang
Problem:    A failing client-server request can make Vim hang.
Solution:   Add a timeout argument to functions that wait.
2017-03-19 21:20:53 +01:00
bfd830d3e2 patch 8.0.0491: quotestar test fails when features are missing
Problem:    The quotestar test fails when a required feature is missing.
Solution:   Prepend "Skipped" to the thrown exception.
2017-03-19 21:01:14 +01:00
38e3483637 patch 8.0.0490: vertical split makes 'winfixwidth' window smaller
Problem:    Splitting a 'winfixwidth' window vertically makes it one column
            smaller. (Dominique Pelle)
Solution:   Add one to the width for the separator.
2017-03-19 20:22:36 +01:00
7dd4850698 patch 8.0.0489: clipboard and "* register is not tested
Problem:    Clipboard and "* register is not tested.
Solution:   Add a test for Mac and X11. (Kazunobu Kuriyama)
2017-03-19 20:04:22 +01:00
b4c5572e74 patch 8.0.0488: running tests leaves an "xxx" file behind
Problem:    Running tests leaves an "xxx" file behind.
Solution:   Delete the 'verbosefile' after resetting the option.
2017-03-19 19:11:35 +01:00
651e4056ac patch 8.0.0487: the autocmd test hangs on MS-Windows
Problem:    The autocmd test hangs on MS-Windows.
Solution:   Skip the hanging tests for now.
2017-03-19 18:34:46 +01:00
8c752bd6c4 patch 8.0.0486: crash and endless loop when closing windows in autocmd
Problem:    Crash and endless loop when closing windows in a SessionLoadPost
            autocommand.
Solution:   Check for valid tabpage.  (partly neovim #6308)
2017-03-19 17:09:56 +01:00
4520d440c5 patch 8.0.0485: not all windows commands are tested
Problem:    Not all windows commands are tested.
Solution:   Add more tests for windows commands. (Dominique Pelle,
            closes #1575) Run test_autocmd separately, it interferes with
            other tests.  Fix tests that depended on side effects.
2017-03-19 16:09:46 +01:00
ee85df3763 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Problem:    Using :lhelpgrep with an argument that should fail does not
            produce an error if the previous :helpgrep worked.
Solution:   Use another way to detect that autocommands made the quickfix info
            invalid. (Yegappan Lakshmanan)
2017-03-19 14:19:50 +01:00
f79225ed4f patch 8.0.0483: illegal memory access when using :all
Problem:    Illegal memory access when using :all. (Dominique Pelle)
Solution:   Adjust the cursor position right after setting "curwin".
2017-03-18 23:11:04 +01:00
2c90d51123 patch 8.0.0482: the setbufvar() function may mess up the window layout
Problem:    The setbufvar() function may mess up the window layout. (Kay Z.)
Solution:   Do not check the window to be valid if it is NULL.
2017-03-18 22:35:30 +01:00
aab93b12cb patch 8.0.0481: unnecessary if statement
Problem:    Unnecessary if statement.
Solution:   Remove the statement.  Fix "it's" vs "its" mistakes. (Dominique
            Pelle, closes #1568)
2017-03-18 21:37:28 +01:00
15e737f768 patch 8.0.0480: the remote_peek() test fails on MS-Windows
Problem:    The remote_peek() test fails on MS-Windows.
Solution:   Check for pending messages. Also report errors in the first run if
            a flaky test fails twice.
2017-03-18 21:22:47 +01:00
6caf606b14 patch 8.0.0479: remote_peek() is not tested
Problem:    remote_peek() is not tested.
Solution:   Add a test.
2017-03-18 20:45:05 +01:00
37175409d7 patch 8.0.0478: tests use assert_true(0) and assert_false(1) to report errors
Problem:    Tests use assert_true(0) and assert_false(1) to report errors.
Solution:   Use assert_report().
2017-03-18 20:18:45 +01:00
42205551b1 patch 8.0.0477: the client-server test may hang when failing
Problem:    The client-server test may hang when failing.
Solution:   Set a timer.  Add assert_report()
2017-03-18 19:42:22 +01:00
7a43cb9cb5 patch 8.0.0476: missing change to main.c
Problem:    Missing change to main.c.
Solution:   Add new function.
2017-03-18 18:15:16 +01:00
7416f3e73a patch 8.0.0475: not enough testing for the client-server feature
Problem:    Not enough testing for the client-server feature.
Solution:   Add more tests.  Add the remote_startserver() function.  Fix that
            a locally evaluated expression uses function-local variables.
2017-03-18 18:10:13 +01:00
15bf76d40b patch 8.0.0474: the client-server feature is not tested
Problem:    The client-server feature is not tested.
Solution:   Add a test.
2017-03-18 16:18:37 +01:00
8c34aa09a4 patch 8.0.0473: no test covering arg_all()
Problem:    No test covering arg_all().
Solution:   Add a test expanding ##.
2017-03-16 22:52:32 +01:00
c537947100 patch 8.0.0472: when a test fails another test may also fail
Problem:    When a test fails and test.log is created, Test_edit_CTRL_I
            matches it instead of test1.in.
Solution:   Match with runtest.vim instead.
2017-03-16 22:38:00 +01:00
0529b3eb01 patch 8.0.0471: exit callback test sometimes fails
Problem:    Exit callback test sometimes fails.
Solution:   Add it to the list of flaky tests.
2017-03-16 22:30:37 +01:00
751ba616d1 patch 8.0.0470: not enough testing for help commands
Problem:    Not enough testing for help commands.
Solution:   Add a few more help tests. (Dominique Pelle, closes #1565)
2017-03-16 22:26:44 +01:00
0c0d4eca4d patch 8.0.0469: compiler warnings on MS-Windows
Problem:    Compiler warnings on MS-Windows.
Solution:   Add type casts. (Christian Brabandt)
2017-03-16 22:06:57 +01:00
f2405ed232 patch 8.0.0468: after aborting an Ex command g< does not work
Problem:    After aborting an Ex command g< does not work. (Marcin
            Szamotulski)
Solution:   Postpone clearing scrollback messages to until the command line
            has been entered.  Also fix that the screen isn't redrawn if after
            g< the command line is cancelled.
2017-03-16 19:58:25 +01:00
57002ad70c patch 8.0.0467: using g< after :for does not show the right output
Problem:    Using g< after :for does not show the right output. (Marcin
            Szamotulski)
Solution:   Call msg_sb_eol() in :echomsg.
2017-03-16 19:04:19 +01:00
036986f150 Update runtime files. 2017-03-16 17:41:02 +01:00
8820b48654 patch 8.0.0466: still macros that should be all-caps
Problem:    There are still a few macros that should be all-caps.
Solution:   Make a few more macros all-caps.
2017-03-16 17:23:31 +01:00
40ebc0afda patch 8.0.0465: off-by-one error in using :move with folding
Problem:    Off-by-one error in using :move with folding.
Solution:   Correct off-by-one mistakes and add more tests. (Matthew
            Malcomson)
2017-03-16 15:59:14 +01:00
f3757f0c87 patch 8.0.0464: can't find executable name on Solaris and FreeBSD
Problem:    Can't find executable name on Solaris and FreeBSD.
Solution:   Check for "/proc/self/path/a.out". (Danek Duvall) And for
            "/proc/curproc/file".
2017-03-16 15:13:45 +01:00
0f39a82b07 patch 8.0.0463: side effects from resetting 'compatible' in defaults.vim
Problem:    Resetting 'compatible' in defaults.vim has unexpected side
            effects. (David Fishburn)
Solution:   Only reset 'compatible' if it was set.
2017-03-16 14:19:36 +01:00
b27523ff7a patch 8.0.0462: failure of an MS-Windows test may go unnoticed
Problem:    If an MS-Windows tests succeeds at first and then fails in a way
            it does not produce a test.out file it looks like the test
            succeeded.
Solution:   Delete the previous output file.
2017-03-16 14:04:51 +01:00
4a5a8dd6e5 patch 8.0.0461: test 45 hangs on MS-Windows
Problem:    Test 45 hangs on MS-Windows.
Solution:   Reset 'shiftwidth'.  Also remove redundent function.
2017-03-16 13:54:10 +01:00
d8492792f2 patch 8.0.0460: can't build on HPUX
Problem:    Can't build on HPUX.
Solution:   Fix argument names in vim_stat(). (John Marriott)
2017-03-16 12:22:38 +01:00
fe70c51983 patch 8.0.0459: old fix for :move and folding no longer needed
Problem:    Old fix for :move messing up folding no longer needed, now that we
            have a proper solution.
Solution:   Revert patch 7.4.700. (Christian Brabandt)
2017-03-15 20:45:53 +01:00
42f45b850d patch 8.0.0458: potential crash if adding list or dict to dict fails
Problem:    Potential crash if adding list or dict to dict fails.
Solution:   Make sure the reference count is correct. (Nikolai Pavlov, closes
            #1555)
2017-03-14 22:17:14 +01:00
88d298aed8 patch 8.0.0457: using :move messes up manual folds
Problem:    Using :move messes up manual folds.
Solution:   Split adjusting marks and folds.  Add foldMoveRange(). (neovim
            patch #6221)
2017-03-14 21:53:58 +01:00
84be8b6660 patch 8.0.0456: typo in MinGW test makefile
Problem:    Typo in MinGW test makefile.
Solution:   Change an underscore to a dot. (Michael Soyka)
2017-03-13 22:41:42 +01:00
26a280c47a Fix duplication of patch. 2017-03-13 21:50:55 +01:00
ffea8c99d9 patch 8.0.0455: the mode test may hang
Problem:    The mode test may hang in Test_mode(). (Michael Soyka)
Solution:   Set 'complete' to only search the current buffer (as suggested by
            Michael)
2017-03-13 20:37:15 +01:00
977d037336 patch 8.0.0454: compiler warnings for "always true" comparison
Problem:    Compiler warnings for comparing unsigned char with 256 always
            being true. (Manuel Ortega)
Solution:   Add type cast.
2017-03-12 21:31:58 +01:00
259 changed files with 13670 additions and 3841 deletions

View File

@ -99,5 +99,6 @@ script:
after_success: after_success:
- if [ "$COVERAGE" = "yes" ]; then ~/.local/bin/coveralls -b $SRCDIR -x .xs -e ${SRCDIR}/xxd -e ${SRCDIR}/if_perl.c --encodings utf-8 latin-1 EUC-KR; fi - if [ "$COVERAGE" = "yes" ]; then ~/.local/bin/coveralls -b $SRCDIR -x .xs -e ${SRCDIR}/xxd -e ${SRCDIR}/if_perl.c --encodings utf-8 latin-1 EUC-KR; fi
- if [ "$COVERAGE" = "yes" ]; then cd $SRCDIR && bash <(curl -s https://codecov.io/bash) ; fi
# vim:set sts=2 sw=2 tw=0 et: # vim:set sts=2 sw=2 tw=0 et:

View File

@ -24,6 +24,7 @@ SRC_ALL = \
src/edit.c \ src/edit.c \
src/eval.c \ src/eval.c \
src/evalfunc.c \ src/evalfunc.c \
src/ex_cmdidxs.h \
src/ex_cmds.c \ src/ex_cmds.c \
src/ex_cmds.h \ src/ex_cmds.h \
src/ex_cmds2.c \ src/ex_cmds2.c \
@ -215,6 +216,7 @@ SRC_UNIX = \
src/config.mk.in \ src/config.mk.in \
src/configure \ src/configure \
src/configure.ac \ src/configure.ac \
src/create_cmdidxs.vim \
src/gui_at_fs.c \ src/gui_at_fs.c \
src/gui_at_sb.c \ src/gui_at_sb.c \
src/gui_at_sb.h \ src/gui_at_sb.h \
@ -238,7 +240,7 @@ SRC_UNIX = \
src/link.sh \ src/link.sh \
src/installman.sh \ src/installman.sh \
src/installml.sh \ src/installml.sh \
src/mkinstalldirs \ src/install-sh \
src/os_unix.c \ src/os_unix.c \
src/os_unix.h \ src/os_unix.h \
src/os_unixx.h \ src/os_unixx.h \
@ -724,7 +726,6 @@ EXTRA = \
farsi/README.txt \ farsi/README.txt \
farsi/fonts/*/far-* \ farsi/fonts/*/far-* \
runtime/vimlogo.xpm \ runtime/vimlogo.xpm \
src/swis.s \
src/tee/Makefile \ src/tee/Makefile \
src/tee/Make_mvc.mak \ src/tee/Make_mvc.mak \
src/tee/tee.c \ src/tee/tee.c \

View File

@ -1,5 +1,6 @@
`README.md` for version 8.0 of Vim: Vi IMproved. `README.md` for version 8.0 of Vim: Vi IMproved.
[![Build Status](https://travis-ci.org/vim/vim.svg?branch=master)](https://travis-ci.org/vim/vim) [![Build Status](https://travis-ci.org/vim/vim.svg?branch=master)](https://travis-ci.org/vim/vim)
[![Coverage Status](https://codecov.io/gh/vim/vim/coverage.svg?branch=master)](https://codecov.io/gh/vim/vim?branch=master)
[![Coverage Status](https://coveralls.io/repos/vim/vim/badge.svg?branch=master&service=github)](https://coveralls.io/github/vim/vim?branch=master) [![Coverage Status](https://coveralls.io/repos/vim/vim/badge.svg?branch=master&service=github)](https://coveralls.io/github/vim/vim?branch=master)
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ci.appveyor.com/project/chrisbra/vim) [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ci.appveyor.com/project/chrisbra/vim)
[![Coverity Scan](https://scan.coverity.com/projects/241/badge.svg)](https://scan.coverity.com/projects/vim) [![Coverity Scan](https://scan.coverity.com/projects/241/badge.svg)](https://scan.coverity.com/projects/vim)

415
runtime/autoload/rust.vim Normal file
View File

@ -0,0 +1,415 @@
" Author: Kevin Ballard
" Description: Helper functions for Rust commands/mappings
" Last Modified: May 27, 2014
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
" Jump {{{1
function! rust#Jump(mode, function) range
let cnt = v:count1
normal! m'
if a:mode ==# 'v'
norm! gv
endif
let foldenable = &foldenable
set nofoldenable
while cnt > 0
execute "call <SID>Jump_" . a:function . "()"
let cnt = cnt - 1
endwhile
let &foldenable = foldenable
endfunction
function! s:Jump_Back()
call search('{', 'b')
keepjumps normal! w99[{
endfunction
function! s:Jump_Forward()
normal! j0
call search('{', 'b')
keepjumps normal! w99[{%
call search('{')
endfunction
" Run {{{1
function! rust#Run(bang, args)
let args = s:ShellTokenize(a:args)
if a:bang
let idx = index(l:args, '--')
if idx != -1
let rustc_args = idx == 0 ? [] : l:args[:idx-1]
let args = l:args[idx+1:]
else
let rustc_args = l:args
let args = []
endif
else
let rustc_args = []
endif
let b:rust_last_rustc_args = l:rustc_args
let b:rust_last_args = l:args
call s:WithPath(function("s:Run"), rustc_args, args)
endfunction
function! s:Run(dict, rustc_args, args)
let exepath = a:dict.tmpdir.'/'.fnamemodify(a:dict.path, ':t:r')
if has('win32')
let exepath .= '.exe'
endif
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
let rustc_args = [relpath, '-o', exepath] + a:rustc_args
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
let output = s:system(pwd, shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)')))
if output != ''
echohl WarningMsg
echo output
echohl None
endif
if !v:shell_error
exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)'))
endif
endfunction
" Expand {{{1
function! rust#Expand(bang, args)
let args = s:ShellTokenize(a:args)
if a:bang && !empty(l:args)
let pretty = remove(l:args, 0)
else
let pretty = "expanded"
endif
call s:WithPath(function("s:Expand"), pretty, args)
endfunction
function! s:Expand(dict, pretty, args)
try
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
if a:pretty =~? '^\%(everybody_loops$\|flowgraph=\)'
let flag = '--xpretty'
else
let flag = '--pretty'
endif
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
let args = [relpath, '-Z', 'unstable-options', l:flag, a:pretty] + a:args
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
if v:shell_error
echohl WarningMsg
echo output
echohl None
else
new
silent put =output
1
d
setl filetype=rust
setl buftype=nofile
setl bufhidden=hide
setl noswapfile
" give the buffer a nice name
let suffix = 1
let basename = fnamemodify(a:dict.path, ':t:r')
while 1
let bufname = basename
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
let bufname .= '.pretty.rs'
if bufexists(bufname)
let suffix += 1
continue
endif
exe 'silent noautocmd keepalt file' fnameescape(bufname)
break
endwhile
endif
endtry
endfunction
function! rust#CompleteExpand(lead, line, pos)
if a:line[: a:pos-1] =~ '^RustExpand!\s*\S*$'
" first argument and it has a !
let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph=", "everybody_loops"]
if !empty(a:lead)
call filter(list, "v:val[:len(a:lead)-1] == a:lead")
endif
return list
endif
return glob(escape(a:lead, "*?[") . '*', 0, 1)
endfunction
" Emit {{{1
function! rust#Emit(type, args)
let args = s:ShellTokenize(a:args)
call s:WithPath(function("s:Emit"), a:type, args)
endfunction
function! s:Emit(dict, type, args)
try
let output_path = a:dict.tmpdir.'/output'
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
let args = [relpath, '--emit', a:type, '-o', output_path] + a:args
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
if output != ''
echohl WarningMsg
echo output
echohl None
endif
if !v:shell_error
new
exe 'silent keepalt read' fnameescape(output_path)
1
d
if a:type == "llvm-ir"
setl filetype=llvm
let extension = 'll'
elseif a:type == "asm"
setl filetype=asm
let extension = 's'
endif
setl buftype=nofile
setl bufhidden=hide
setl noswapfile
if exists('l:extension')
" give the buffer a nice name
let suffix = 1
let basename = fnamemodify(a:dict.path, ':t:r')
while 1
let bufname = basename
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
let bufname .= '.'.extension
if bufexists(bufname)
let suffix += 1
continue
endif
exe 'silent noautocmd keepalt file' fnameescape(bufname)
break
endwhile
endif
endif
endtry
endfunction
" Utility functions {{{1
" Invokes func(dict, ...)
" Where {dict} is a dictionary with the following keys:
" 'path' - The path to the file
" 'tmpdir' - The path to a temporary directory that will be deleted when the
" function returns.
" 'istemp' - 1 if the path is a file inside of {dict.tmpdir} or 0 otherwise.
" If {istemp} is 1 then an additional key is provided:
" 'tmpdir_relpath' - The {path} relative to the {tmpdir}.
"
" {dict.path} may be a path to a file inside of {dict.tmpdir} or it may be the
" existing path of the current buffer. If the path is inside of {dict.tmpdir}
" then it is guaranteed to have a '.rs' extension.
function! s:WithPath(func, ...)
let buf = bufnr('')
let saved = {}
let dict = {}
try
let saved.write = &write
set write
let dict.path = expand('%')
let pathisempty = empty(dict.path)
" Always create a tmpdir in case the wrapped command wants it
let dict.tmpdir = tempname()
call mkdir(dict.tmpdir)
if pathisempty || !saved.write
let dict.istemp = 1
" if we're doing this because of nowrite, preserve the filename
if !pathisempty
let filename = expand('%:t:r').".rs"
else
let filename = 'unnamed.rs'
endif
let dict.tmpdir_relpath = filename
let dict.path = dict.tmpdir.'/'.filename
let saved.mod = &mod
set nomod
silent exe 'keepalt write! ' . fnameescape(dict.path)
if pathisempty
silent keepalt 0file
endif
else
let dict.istemp = 0
update
endif
call call(a:func, [dict] + a:000)
finally
if bufexists(buf)
for [opt, value] in items(saved)
silent call setbufvar(buf, '&'.opt, value)
unlet value " avoid variable type mismatches
endfor
endif
if has_key(dict, 'tmpdir') | silent call s:RmDir(dict.tmpdir) | endif
endtry
endfunction
function! rust#AppendCmdLine(text)
call setcmdpos(getcmdpos())
let cmd = getcmdline() . a:text
return cmd
endfunction
" Tokenize the string according to sh parsing rules
function! s:ShellTokenize(text)
" states:
" 0: start of word
" 1: unquoted
" 2: unquoted backslash
" 3: double-quote
" 4: double-quoted backslash
" 5: single-quote
let l:state = 0
let l:current = ''
let l:args = []
for c in split(a:text, '\zs')
if l:state == 0 || l:state == 1 " unquoted
if l:c ==# ' '
if l:state == 0 | continue | endif
call add(l:args, l:current)
let l:current = ''
let l:state = 0
elseif l:c ==# '\'
let l:state = 2
elseif l:c ==# '"'
let l:state = 3
elseif l:c ==# "'"
let l:state = 5
else
let l:current .= l:c
let l:state = 1
endif
elseif l:state == 2 " unquoted backslash
if l:c !=# "\n" " can it even be \n?
let l:current .= l:c
endif
let l:state = 1
elseif l:state == 3 " double-quote
if l:c ==# '\'
let l:state = 4
elseif l:c ==# '"'
let l:state = 1
else
let l:current .= l:c
endif
elseif l:state == 4 " double-quoted backslash
if stridx('$`"\', l:c) >= 0
let l:current .= l:c
elseif l:c ==# "\n" " is this even possible?
" skip it
else
let l:current .= '\'.l:c
endif
let l:state = 3
elseif l:state == 5 " single-quoted
if l:c == "'"
let l:state = 1
else
let l:current .= l:c
endif
endif
endfor
if l:state != 0
call add(l:args, l:current)
endif
return l:args
endfunction
function! s:RmDir(path)
" sanity check; make sure it's not empty, /, or $HOME
if empty(a:path)
echoerr 'Attempted to delete empty path'
return 0
elseif a:path == '/' || a:path == $HOME
echoerr 'Attempted to delete protected path: ' . a:path
return 0
endif
return system("rm -rf " . shellescape(a:path))
endfunction
" Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd.
" If {pwd} is the empty string then it doesn't change the cwd.
function! s:system(pwd, cmd)
let cmd = a:cmd
if !empty(a:pwd)
let cmd = 'cd ' . shellescape(a:pwd) . ' && ' . cmd
endif
return system(cmd)
endfunction
" Playpen Support {{{1
" Parts of gist.vim by Yasuhiro Matsumoto <mattn.jp@gmail.com> reused
" gist.vim available under the BSD license, available at
" http://github.com/mattn/gist-vim
function! s:has_webapi()
if !exists("*webapi#http#post")
try
call webapi#http#post()
catch
endtry
endif
return exists("*webapi#http#post")
endfunction
function! rust#Play(count, line1, line2, ...) abort
redraw
let l:rust_playpen_url = get(g:, 'rust_playpen_url', 'https://play.rust-lang.org/')
let l:rust_shortener_url = get(g:, 'rust_shortener_url', 'https://is.gd/')
if !s:has_webapi()
echohl ErrorMsg | echomsg ':RustPlay depends on webapi.vim (https://github.com/mattn/webapi-vim)' | echohl None
return
endif
let bufname = bufname('%')
if a:count < 1
let content = join(getline(a:line1, a:line2), "\n")
else
let save_regcont = @"
let save_regtype = getregtype('"')
silent! normal! gvy
let content = @"
call setreg('"', save_regcont, save_regtype)
endif
let body = l:rust_playpen_url."?code=".webapi#http#encodeURI(content)
if strlen(body) > 5000
echohl ErrorMsg | echomsg 'Buffer too large, max 5000 encoded characters ('.strlen(body).')' | echohl None
return
endif
let payload = "format=simple&url=".webapi#http#encodeURI(body)
let res = webapi#http#post(l:rust_shortener_url.'create.php', payload, {})
let url = res.content
redraw | echomsg 'Done: '.url
endfunction
" }}}1
" vim: set noet sw=8 ts=8:

View File

@ -0,0 +1,107 @@
" Author: Stephen Sugden <stephen@stephensugden.com>
"
" Adapted from https://github.com/fatih/vim-go
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
if !exists("g:rustfmt_autosave")
let g:rustfmt_autosave = 0
endif
if !exists("g:rustfmt_command")
let g:rustfmt_command = "rustfmt"
endif
if !exists("g:rustfmt_options")
let g:rustfmt_options = ""
endif
if !exists("g:rustfmt_fail_silently")
let g:rustfmt_fail_silently = 0
endif
let s:got_fmt_error = 0
function! s:RustfmtCommandRange(filename, line1, line2)
let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]}
return printf("%s %s --write-mode=overwrite --file-lines '[%s]'", g:rustfmt_command, g:rustfmt_options, json_encode(l:arg))
endfunction
function! s:RustfmtCommand(filename)
return g:rustfmt_command . " --write-mode=overwrite " . g:rustfmt_options . " " . shellescape(a:filename)
endfunction
function! s:RunRustfmt(command, curw, tmpname)
if exists("*systemlist")
let out = systemlist(a:command)
else
let out = split(system(a:command), '\r\?\n')
endif
if v:shell_error == 0 || v:shell_error == 3
" remove undo point caused via BufWritePre
try | silent undojoin | catch | endtry
" Replace current file with temp file, then reload buffer
call rename(a:tmpname, expand('%'))
silent edit!
let &syntax = &syntax
" only clear location list if it was previously filled to prevent
" clobbering other additions
if s:got_fmt_error
let s:got_fmt_error = 0
call setloclist(0, [])
lwindow
endif
elseif g:rustfmt_fail_silently == 0
" otherwise get the errors and put them in the location list
let errors = []
for line in out
" src/lib.rs:13:5: 13:10 error: expected `,`, or `}`, found `value`
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\):\s*\(\d\+:\d\+\s*\)\?\s*error: \(.*\)')
if !empty(tokens)
call add(errors, {"filename": @%,
\"lnum": tokens[2],
\"col": tokens[3],
\"text": tokens[5]})
endif
endfor
if empty(errors)
% | " Couldn't detect rustfmt error format, output errors
endif
if !empty(errors)
call setloclist(0, errors, 'r')
echohl Error | echomsg "rustfmt returned error" | echohl None
endif
let s:got_fmt_error = 1
lwindow
" We didn't use the temp file, so clean up
call delete(a:tmpname)
endif
call winrestview(a:curw)
endfunction
function! rustfmt#FormatRange(line1, line2)
let l:curw = winsaveview()
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
call writefile(getline(1, '$'), l:tmpname)
let command = s:RustfmtCommandRange(l:tmpname, a:line1, a:line2)
call s:RunRustfmt(command, l:curw, l:tmpname)
endfunction
function! rustfmt#Format()
let l:curw = winsaveview()
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
call writefile(getline(1, '$'), l:tmpname)
let command = s:RustfmtCommand(l:tmpname)
call s:RunRustfmt(command, l:curw, l:tmpname)
endfunction

View File

@ -0,0 +1,35 @@
" Vim compiler file
" Compiler: Cargo Compiler
" Maintainer: Damien Radtke <damienradtke@gmail.com>
" Latest Revision: 2014 Sep 24
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
if exists('current_compiler')
finish
endif
runtime compiler/rustc.vim
let current_compiler = "cargo"
let s:save_cpo = &cpo
set cpo&vim
if exists(':CompilerSet') != 2
command -nargs=* CompilerSet setlocal <args>
endif
if exists('g:cargo_makeprg_params')
execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
else
CompilerSet makeprg=cargo\ $*
endif
" Ignore general cargo progress messages
CompilerSet errorformat+=
\%-G%\\s%#Downloading%.%#,
\%-G%\\s%#Compiling%.%#,
\%-G%\\s%#Finished%.%#,
\%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
\%-G%\\s%#To\ learn\ more\\,%.%#
let &cpo = s:save_cpo
unlet s:save_cpo

View File

@ -1,7 +1,8 @@
" Vim compiler file " Vim compiler file
" Compiler: reStructuredText Documentation Format " Compiler: sphinx >= 1.0.8, http://www.sphinx-doc.org
" Description: reStructuredText Documentation Format
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19 " Latest Revision: 2017-03-31
if exists("current_compiler") if exists("current_compiler")
finish finish
@ -11,12 +12,18 @@ let current_compiler = "rst"
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo&vim set cpo&vim
setlocal errorformat= if exists(":CompilerSet") != 2
\%f:%l:\ (%tEBUG/0)\ %m, command -nargs=* CompilerSet setlocal <args>
\%f:%l:\ (%tNFO/1)\ %m, endif
\%f:%l:\ (%tARNING/2)\ %m,
\%f:%l:\ (%tRROR/3)\ %m, CompilerSet errorformat=
\%f:%l:\ (%tEVERE/3)\ %m, \%f\\:%l:\ %tEBUG:\ %m,
\%f\\:%l:\ %tNFO:\ %m,
\%f\\:%l:\ %tARNING:\ %m,
\%f\\:%l:\ %tRROR:\ %m,
\%f\\:%l:\ %tEVERE:\ %m,
\%f\\:%s:\ %tARNING:\ %m,
\%f\\:%s:\ %tRROR:\ %m,
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f', \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
\%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f', \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
\%DMaking\ %*\\a\ in\ %f \%DMaking\ %*\\a\ in\ %f

View File

@ -0,0 +1,46 @@
" Vim compiler file
" Compiler: Rust Compiler
" Maintainer: Chris Morgan <me@chrismorgan.info>
" Latest Revision: 2013 Jul 12
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
if exists("current_compiler")
finish
endif
let current_compiler = "rustc"
let s:cpo_save = &cpo
set cpo&vim
if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args>
endif
if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0
CompilerSet makeprg=rustc
else
CompilerSet makeprg=rustc\ \%
endif
" Old errorformat (before nightly 2016/08/10)
CompilerSet errorformat=
\%f:%l:%c:\ %t%*[^:]:\ %m,
\%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
\%-G%f:%l\ %s,
\%-G%*[\ ]^,
\%-G%*[\ ]^%*[~],
\%-G%*[\ ]...
" New errorformat (after nightly 2016/08/10)
CompilerSet errorformat+=
\%-G,
\%-Gerror:\ aborting\ %.%#,
\%-Gerror:\ Could\ not\ compile\ %.%#,
\%Eerror:\ %m,
\%Eerror[E%n]:\ %m,
\%Wwarning:\ %m,
\%Inote:\ %m,
\%C\ %#-->\ %f:%l:%c
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -1,7 +1,7 @@
" The default vimrc file. " The default vimrc file.
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2016 Sep 02 " Last change: 2017 Apr 12
" "
" This is loaded if no vimrc file was found. " This is loaded if no vimrc file was found.
" Except when Vim is run with "-u NONE" or "-C". " Except when Vim is run with "-u NONE" or "-C".
@ -21,7 +21,16 @@ endif
" Use Vim settings, rather than Vi settings (much better!). " Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect. " This must be first, because it changes other options as a side effect.
set nocompatible " Avoid side effects when it was already reset.
if &compatible
set nocompatible
endif
" When the +eval feature is missing, the set command above will be skipped.
" Use a trick to reset compatible only when the +eval feature is missing.
silent! while 0
set nocompatible
silent! endwhile
" Allow backspacing over everything in insert mode. " Allow backspacing over everything in insert mode.
set backspace=indent,eol,start set backspace=indent,eol,start

View File

@ -30,6 +30,7 @@ DOCS = \
filetype.txt \ filetype.txt \
fold.txt \ fold.txt \
ft_ada.txt \ ft_ada.txt \
ft_rust.txt \
ft_sql.txt \ ft_sql.txt \
gui.txt \ gui.txt \
gui_w32.txt \ gui_w32.txt \
@ -165,6 +166,7 @@ HTMLS = \
filetype.html \ filetype.html \
fold.html \ fold.html \
ft_ada.html \ ft_ada.html \
ft_rust.html \
ft_sql.html \ ft_sql.html \
gui.html \ gui.html \
gui_w32.html \ gui_w32.html \

View File

@ -10,11 +10,11 @@ Arabic Language support (options & mappings) for Vim *Arabic*
*E800* *E800*
In order to use right-to-left and Arabic mapping support, it is In order to use right-to-left and Arabic mapping support, it is
necessary to compile VIM with the |+arabic| feature. necessary to compile Vim with the |+arabic| feature.
These functions have been created by Nadim Shaikli <nadim-at-arabeyes.org> These functions have been created by Nadim Shaikli <nadim-at-arabeyes.org>
It is best to view this file with these settings within VIM's GUI: > It is best to view this file with these settings within Vim's GUI: >
:set encoding=utf-8 :set encoding=utf-8
:set arabicshape :set arabicshape
@ -42,7 +42,7 @@ the user interface remains the standard Vi interface.
Highlights Highlights
---------- ----------
o Editing left-to-right files as in the original VIM hasn't changed. o Editing left-to-right files as in the original Vim hasn't changed.
o Viewing and editing files in right-to-left windows. File o Viewing and editing files in right-to-left windows. File
orientation is per window, so it is possible to view the same orientation is per window, so it is possible to view the same
@ -52,7 +52,7 @@ o No special terminal with right-to-left capabilities is required.
The right-to-left changes are completely hardware independent. The right-to-left changes are completely hardware independent.
Only Arabic fonts are necessary. Only Arabic fonts are necessary.
o Compatible with the original VIM. Almost all features work in o Compatible with the original Vim. Almost all features work in
right-to-left mode (there are liable to be bugs). right-to-left mode (there are liable to be bugs).
o Changing keyboard mapping and reverse insert modes using a single o Changing keyboard mapping and reverse insert modes using a single
@ -66,14 +66,14 @@ o While in Arabic mode, numbers are entered from left to right. Upon
o Arabic keymapping on the command line in reverse insert mode. o Arabic keymapping on the command line in reverse insert mode.
o Proper Bidirectional functionality is possible given VIM is o Proper Bidirectional functionality is possible given Vim is
started within a Bidi capable terminal emulator. started within a Bidi capable terminal emulator.
Arabic Fonts *arabicfonts* Arabic Fonts *arabicfonts*
------------ ------------
VIM requires monospaced fonts of which there are many out there. Vim requires monospaced fonts of which there are many out there.
Arabic requires ISO-8859-6 as well as Presentation Form-B fonts Arabic requires ISO-8859-6 as well as Presentation Form-B fonts
(without Form-B, Arabic will _NOT_ be usable). It is highly (without Form-B, Arabic will _NOT_ be usable). It is highly
recommended that users search for so-called 'ISO-10646-1' fonts. recommended that users search for so-called 'ISO-10646-1' fonts.
@ -96,13 +96,13 @@ o Installation of fonts for X Window systems (Unix/Linux)
Usage Usage
----- -----
Prior to the actual usage of Arabic within VIM, a number of settings Prior to the actual usage of Arabic within Vim, a number of settings
need to be accounted for and invoked. need to be accounted for and invoked.
o Setting the Arabic fonts o Setting the Arabic fonts
+ For VIM GUI set the 'guifont' to your_ARABIC_FONT. This is done + For Vim GUI set the 'guifont' to your_ARABIC_FONT. This is done
by entering the following command in the VIM window. by entering the following command in the Vim window.
> >
:set guifont=your_ARABIC_FONT :set guifont=your_ARABIC_FONT
< <
@ -115,7 +115,7 @@ o Setting the Arabic fonts
you can include ':set guifont=your_ARABIC_FONT' to your .vimrc you can include ':set guifont=your_ARABIC_FONT' to your .vimrc
file. file.
+ Under the X Window environment, you can also start VIM with + Under the X Window environment, you can also start Vim with
'-fn your_ARABIC_FONT' option. '-fn your_ARABIC_FONT' option.
o Setting the appropriate character Encoding o Setting the appropriate character Encoding
@ -124,7 +124,7 @@ o Setting the appropriate character Encoding
> >
:set encoding=utf-8 :set encoding=utf-8
< <
to your .vimrc file (entering the command manually into you VIM to your .vimrc file (entering the command manually into you Vim
window is highly discouraged). In short, include ':set window is highly discouraged). In short, include ':set
encoding=utf-8' to your .vimrc file. encoding=utf-8' to your .vimrc file.
@ -137,11 +137,11 @@ o Setting the appropriate character Encoding
o Enable Arabic settings [short-cut] o Enable Arabic settings [short-cut]
In order to simplify and streamline things, you can either invoke In order to simplify and streamline things, you can either invoke
VIM with the command-line option, Vim with the command-line option,
% vim -A my_utf8_arabic_file ... % vim -A my_utf8_arabic_file ...
or enable 'arabic' via the following command within VIM or enable 'arabic' via the following command within Vim
> >
:set arabic :set arabic
< <
@ -189,7 +189,7 @@ o Enable Arabic settings [short-cut]
> >
:set keymap=arabic :set keymap=arabic
< <
in your VIM window. You can also append the 'keymap' set command to in your Vim window. You can also append the 'keymap' set command to
your .vimrc file. In other words, you can include ':set keymap=arabic' your .vimrc file. In other words, you can include ':set keymap=arabic'
to your .vimrc file. to your .vimrc file.
@ -202,7 +202,7 @@ o Enable Arabic settings [short-cut]
+ Arabic deletion of a combined pair character + Arabic deletion of a combined pair character
By default VIM has the 'delcombine' option disabled. This option By default Vim has the 'delcombine' option disabled. This option
allows the deletion of ALEF in a LAM_ALEF (LAA) combined character allows the deletion of ALEF in a LAM_ALEF (LAA) combined character
and still retain the LAM (i.e. it reverts to treating the combined and still retain the LAM (i.e. it reverts to treating the combined
character as its natural two characters form -- this also pertains character as its natural two characters form -- this also pertains
@ -211,13 +211,13 @@ o Enable Arabic settings [short-cut]
> >
:set delcombine :set delcombine
< <
in our VIM window. You can also append the 'delcombine' set command in our Vim window. You can also append the 'delcombine' set command
to your .vimrc file. In other words, you can include ':set delcombine' to your .vimrc file. In other words, you can include ':set delcombine'
to your .vimrc file. to your .vimrc file.
+ Arabic right-to-left Mode + Arabic right-to-left Mode
By default VIM starts in Left-to-right mode. 'rightleft' is the By default Vim starts in Left-to-right mode. 'rightleft' is the
command that allows one to alter a window's orientation - that can command that allows one to alter a window's orientation - that can
be accomplished via, be accomplished via,
@ -253,7 +253,7 @@ o Enable Arabic settings [short-cut]
> >
:set arabicshape :set arabicshape
< <
in our VIM window. You can also append the 'arabicshape' set in our Vim window. You can also append the 'arabicshape' set
command to your .vimrc file. In other words, you can include command to your .vimrc file. In other words, you can include
':set arabicshape' to your .vimrc file. ':set arabicshape' to your .vimrc file.
@ -261,7 +261,7 @@ o Enable Arabic settings [short-cut]
Keymap/Keyboard *arabickeymap* Keymap/Keyboard *arabickeymap*
--------------- ---------------
The character/letter encoding used in VIM is the standard UTF-8. The character/letter encoding used in Vim is the standard UTF-8.
It is widely discouraged that any other encoding be used or even It is widely discouraged that any other encoding be used or even
attempted. attempted.
@ -294,7 +294,7 @@ o Keyboard
Restrictions Restrictions
------------ ------------
o VIM in its GUI form does not currently support Bi-directionality o Vim in its GUI form does not currently support Bi-directionality
(i.e. the ability to see both Arabic and Latin intermixed within (i.e. the ability to see both Arabic and Latin intermixed within
the same line). the same line).

View File

@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 8.0. Last change: 2017 Jan 14 *autocmd.txt* For Vim version 8.0. Last change: 2017 Apr 07
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -610,7 +610,7 @@ FileChangedShell When Vim notices that the modification time of
|timestamp| |timestamp|
Mostly triggered after executing a shell Mostly triggered after executing a shell
command, but also with a |:checktime| command command, but also with a |:checktime| command
or when Gvim regains input focus. or when gvim regains input focus.
This autocommand is triggered for each changed This autocommand is triggered for each changed
file. It is not used when 'autoread' is set file. It is not used when 'autoread' is set
and the buffer was not changed. If a and the buffer was not changed. If a
@ -621,7 +621,7 @@ FileChangedShell When Vim notices that the modification time of
to tell Vim what to do next. to tell Vim what to do next.
NOTE: When this autocommand is executed, the NOTE: When this autocommand is executed, the
current buffer "%" may be different from the current buffer "%" may be different from the
buffer that was changed "<afile>". buffer that was changed, which is in "<afile>".
NOTE: The commands must not change the current NOTE: The commands must not change the current
buffer, jump to another buffer or delete a buffer, jump to another buffer or delete a
buffer. *E246* *E811* buffer. *E246* *E811*

View File

@ -1,4 +1,4 @@
*editing.txt* For Vim version 8.0. Last change: 2016 Nov 24 *editing.txt* For Vim version 8.0. Last change: 2017 Apr 10
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -276,7 +276,7 @@ If you want to keep the changed buffer without saving it, switch on the
*:vie* *:view* *:vie* *:view*
:vie[w][!] [++opt] [+cmd] file :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 Normal mode. Otherwise same as |:edit|, but set
'readonly' option for this buffer. {not in Vi} 'readonly' option for this buffer. {not in Vi}
@ -1558,6 +1558,13 @@ If you want to automatically reload a file when it has been changed outside of
Vim, set the 'autoread' option. This doesn't work at the moment you write the Vim, set the 'autoread' option. This doesn't work at the moment you write the
file though, only when the file wasn't changed inside of Vim. file though, only when the file wasn't changed inside of Vim.
If you do not want to be asked or automatically reload the file, you can use
this: >
set buftype=nofile
Or, when starting gvim from a shell: >
gvim file.log -c "set buftype=nofile"
Note that if a FileChangedShell autocommand is defined you will not get a Note that if a FileChangedShell autocommand is defined you will not get a
warning message or prompt. The autocommand is expected to handle this. warning message or prompt. The autocommand is expected to handle this.

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.0. Last change: 2017 Mar 04 *eval.txt* For Vim version 8.0. Last change: 2017 Jun 04
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -1904,6 +1904,8 @@ v:termresponse The escape sequence returned by the terminal for the |t_RV|
*v:testing* *testing-variable* *v:testing* *testing-variable*
v:testing Must be set before using `test_garbagecollect_now()`. 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* *this_session-variable*
v:this_session Full filename of the last loaded or saved session file. See v:this_session Full filename of the last loaded or saved session file. See
@ -1984,16 +1986,23 @@ argidx() Number current index in the argument list
arglistid([{winnr} [, {tabnr}]]) Number argument list id arglistid([{winnr} [, {tabnr}]]) Number argument list id
argv({nr}) String {nr} entry of the argument list argv({nr}) String {nr} entry of the argument list
argv() List the argument list argv() List the argument list
assert_equal({exp}, {act} [, {msg}]) none assert {exp} is equal to {act} assert_equal({exp}, {act} [, {msg}])
assert_exception({error} [, {msg}]) none assert {error} is in v:exception none assert {exp} is equal to {act}
assert_fails({cmd} [, {error}]) none assert {cmd} fails assert_exception({error} [, {msg}])
assert_false({actual} [, {msg}]) none assert {actual} is false none assert {error} is in v:exception
assert_fails({cmd} [, {error}]) none assert {cmd} fails
assert_false({actual} [, {msg}])
none assert {actual} is false
assert_inrange({lower}, {upper}, {actual} [, {msg}]) assert_inrange({lower}, {upper}, {actual} [, {msg}])
none assert {actual} is inside the range none assert {actual} is inside the range
assert_match({pat}, {text} [, {msg}]) none assert {pat} matches {text} assert_match({pat}, {text} [, {msg}])
assert_notequal({exp}, {act} [, {msg}]) none assert {exp} is not equal {act} none assert {pat} matches {text}
assert_notmatch({pat}, {text} [, {msg}]) none assert {pat} not matches {text} assert_notequal({exp}, {act} [, {msg}])
assert_true({actual} [, {msg}]) none assert {actual} is true none assert {exp} is not equal {act}
assert_notmatch({pat}, {text} [, {msg}])
none assert {pat} not matches {text}
assert_report({msg}) none report a test failure
assert_true({actual} [, {msg}]) none assert {actual} is true
asin({expr}) Float arc sine of {expr} asin({expr}) Float arc sine of {expr}
atan({expr}) Float arc tangent of {expr} atan({expr}) Float arc tangent of {expr}
atan2({expr1}, {expr2}) Float arc tangent of {expr1} / {expr2} atan2({expr1}, {expr2}) Float arc tangent of {expr1} / {expr2}
@ -2252,14 +2261,17 @@ readfile({fname} [, {binary} [, {max}]])
reltime([{start} [, {end}]]) List get time value reltime([{start} [, {end}]]) List get time value
reltimefloat({time}) Float turn the time value into a Float reltimefloat({time}) Float turn the time value into a Float
reltimestr({time}) String turn time value into a String reltimestr({time}) String turn time value into a String
remote_expr({server}, {string} [, {idvar}]) remote_expr({server}, {string} [, {idvar} [, {timeout}]])
String send expression String send expression
remote_foreground({server}) Number bring Vim server to the foreground remote_foreground({server}) Number bring Vim server to the foreground
remote_peek({serverid} [, {retvar}]) remote_peek({serverid} [, {retvar}])
Number check for reply string Number check for reply string
remote_read({serverid}) String read reply string remote_read({serverid} [, {timeout}])
String read reply string
remote_send({server}, {string} [, {idvar}]) remote_send({server}, {string} [, {idvar}])
String send key sequence String send key sequence
remote_startserver({name}) none become server {name}
String send key sequence
remove({list}, {idx} [, {end}]) any remove items {idx}-{end} from {list} remove({list}, {idx} [, {end}]) any remove items {idx}-{end} from {list}
remove({dict}, {key}) any remove entry {key} from {dict} remove({dict}, {key}) any remove entry {key} from {dict}
rename({from}, {to}) Number rename (move) file from {from} to {to} rename({from}, {to}) Number rename (move) file from {from} to {to}
@ -2352,7 +2364,7 @@ systemlist({expr} [, {input}]) List output of shell command/filter {expr}
tabpagebuflist([{arg}]) List list of buffer numbers in tab page tabpagebuflist([{arg}]) List list of buffer numbers in tab page
tabpagenr([{arg}]) Number number of current or last tab page tabpagenr([{arg}]) Number number of current or last tab page
tabpagewinnr({tabarg}[, {arg}]) Number number of current window in tab page tabpagewinnr({tabarg}[, {arg}]) Number number of current window in tab page
taglist({expr}) List list of tags matching {expr} taglist({expr}[, {filename}]) List list of tags matching {expr}
tagfiles() List tags files used tagfiles() List tags files used
tan({expr}) Float tangent of {expr} tan({expr}) Float tangent of {expr}
tanh({expr}) Float hyperbolic tangent of {expr} tanh({expr}) Float hyperbolic tangent of {expr}
@ -2579,7 +2591,10 @@ assert_notmatch({pattern}, {actual} [, {msg}])
The opposite of `assert_match()`: add an error message to The opposite of `assert_match()`: add an error message to
|v:errors| when {pattern} matches {actual}. |v:errors| when {pattern} matches {actual}.
assert_true({actual} [, {msg}]) *assert_true()* assert_report({msg}) *assert_report()*
Report a test failure directly, using {msg}.
assert_true({actual} [, {msg}]) *assert_true()*
When {actual} is not true an error message is added to When {actual} is not true an error message is added to
|v:errors|, like with |assert_equal()|. |v:errors|, like with |assert_equal()|.
A value is TRUE when it is a non-zero number. When {actual} A value is TRUE when it is a non-zero number. When {actual}
@ -3358,6 +3373,7 @@ did_filetype() Returns |TRUE| when autocommands are being executed and the
FileType event has been triggered at least once. Can be used FileType event has been triggered at least once. Can be used
to avoid triggering the FileType event again in the scripts to avoid triggering the FileType event again in the scripts
that detect the file type. |FileType| that detect the file type. |FileType|
Returns |FALSE| when `:setf FALLBACK` was used.
When editing another file, the counter is reset, thus this When editing another file, the counter is reset, thus this
really checks if the FileType event has been triggered for the really checks if the FileType event has been triggered for the
current buffer. This allows an autocommand that starts current buffer. This allows an autocommand that starts
@ -3921,11 +3937,14 @@ foldtext() Returns a String, to be displayed for a closed fold. This is
|v:foldstart|, |v:foldend| and |v:folddashes| variables. |v:foldstart|, |v:foldend| and |v:folddashes| variables.
The returned string looks like this: > The returned string looks like this: >
+-- 45 lines: abcdef +-- 45 lines: abcdef
< The number of dashes depends on the foldlevel. The "45" is < The number of leading dashes depends on the foldlevel. The
the number of lines in the fold. "abcdef" is the text in the "45" is the number of lines in the fold. "abcdef" is the text
first non-blank line of the fold. Leading white space, "//" in the first non-blank line of the fold. Leading white space,
or "/*" and the text from the 'foldmarker' and 'commentstring' "//" or "/*" and the text from the 'foldmarker' and
options is removed. 'commentstring' options is removed.
When used to draw the actual foldtext, the rest of the line
will be filled with the fold char from the 'fillchars'
setting.
{not available when compiled without the |+folding| feature} {not available when compiled without the |+folding| feature}
foldtextresult({lnum}) *foldtextresult()* foldtextresult({lnum}) *foldtextresult()*
@ -4361,12 +4380,14 @@ getcurpos() Get the position of the cursor. This is like getpos('.'), but
includes an extra item in the list: includes an extra item in the list:
[bufnum, lnum, col, off, curswant] ~ [bufnum, lnum, col, off, curswant] ~
The "curswant" number is the preferred column when moving the The "curswant" number is the preferred column when moving the
cursor vertically. cursor vertically. Also see |getpos()|.
This can be used to save and restore the cursor position: > This can be used to save and restore the cursor position: >
let save_cursor = getcurpos() let save_cursor = getcurpos()
MoveTheCursorAround MoveTheCursorAround
call setpos('.', save_cursor) call setpos('.', save_cursor)
< < Note that this only works within the window. See
|winrestview()| for restoring more state.
*getcwd()* *getcwd()*
getcwd([{winnr} [, {tabnr}]]) getcwd([{winnr} [, {tabnr}]])
The result is a String, which is the name of the current The result is a String, which is the name of the current
@ -4564,6 +4585,7 @@ getqflist([{what}]) *getqflist()*
If the optional {what} dictionary argument is supplied, then If the optional {what} dictionary argument is supplied, then
returns only the items listed in {what} as a dictionary. The returns only the items listed in {what} as a dictionary. The
following string items are supported in {what}: following string items are supported in {what}:
context get the context stored with |setqflist()|
nr get information for this quickfix list; zero nr get information for this quickfix list; zero
means the current quickfix list means the current quickfix list
title get the list title title get the list title
@ -4575,6 +4597,7 @@ getqflist([{what}]) *getqflist()*
returned. returned.
The returned dictionary contains the following entries: The returned dictionary contains the following entries:
context context information stored with |setqflist()|
nr quickfix list number nr quickfix list number
title quickfix list title text title quickfix list title text
winid quickfix |window-ID| (if opened) winid quickfix |window-ID| (if opened)
@ -4664,13 +4687,16 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()*
< <
*getwinposx()* *getwinposx()*
getwinposx() The result is a Number, which is the X coordinate in pixels of getwinposx() The result is a Number, which is the X coordinate in pixels of
the left hand side of the GUI Vim window. The result will be the left hand side of the GUI Vim window. Also works for an
-1 if the information is not available. xterm.
The result will be -1 if the information is not available.
The value can be used with `:winpos`.
*getwinposy()* *getwinposy()*
getwinposy() The result is a Number, which is the Y coordinate in pixels of getwinposy() The result is a Number, which is the Y coordinate in pixels of
the top of the GUI Vim window. The result will be -1 if the the top of the GUI Vim window. Also works for an xterm.
information is not available. The result will be -1 if the information is not available.
The value can be used with `:winpos`.
getwininfo([{winid}]) *getwininfo()* getwininfo([{winid}]) *getwininfo()*
Returns information about windows as a List with Dictionaries. Returns information about windows as a List with Dictionaries.
@ -5242,9 +5268,14 @@ job_stop({job} [, {how}]) *job_stop()*
0 if "how" is not supported on the system. 0 if "how" is not supported on the system.
Note that even when the operation was executed, whether the Note that even when the operation was executed, whether the
job was actually stopped needs to be checked with job was actually stopped needs to be checked with
job_status(). |job_status()|.
The status of the job isn't checked, the operation will even
be done when Vim thinks the job isn't running. If the status of the job is "dead", the signal will not be
sent. This is to avoid to stop the wrong job (esp. on Unix,
where process numbers are recycled).
When using "kill" Vim will assume the job will die and close
the channel.
{only available when compiled with the |+job| feature} {only available when compiled with the |+job| feature}
@ -5286,13 +5317,29 @@ json_decode({string}) *json_decode()*
in Vim values. See |json_encode()| for the relation between in Vim values. See |json_encode()| for the relation between
JSON and Vim values. JSON and Vim values.
The decoding is permissive: The decoding is permissive:
- A trailing comma in an array and object is ignored. - A trailing comma in an array and object is ignored, e.g.
"[1, 2, ]" is the same as "[1, 2]".
- More floating point numbers are recognized, e.g. "1." for - More floating point numbers are recognized, e.g. "1." for
"1.0". "1.0", or "001.2" for "1.2". Special floating point values
However, a duplicate key in an object is not allowed. *E938* "Infinity" and "NaN" (capitalization ignored) are accepted.
The result must be a valid Vim type: - Leading zeroes in integer numbers are ignored, e.g. "012"
- An empty object member name is not allowed. for "12" or "-012" for "-12".
- Duplicate object member names are not allowed. - Capitalization is ignored in literal names null, true or
false, e.g. "NULL" for "null", "True" for "true".
- Control characters U+0000 through U+001F which are not
escaped in strings are accepted, e.g. " " (tab
character in string) for "\t".
- Backslash in an invalid 2-character sequence escape is
ignored, e.g. "\a" is decoded as "a".
- A correct surrogate pair in JSON strings should normally be
a 12 character sequence such as "\uD834\uDD1E", but
json_decode() silently accepts truncated surrogate pairs
such as "\uD834" or "\uD834\u"
*E938*
A duplicate key in an object, valid in rfc7159, is not
accepted by json_decode() as the result must be a valid Vim
type, e.g. this fails: {"a":"b", "a":"c"}
json_encode({expr}) *json_encode()* json_encode({expr}) *json_encode()*
Encode {expr} as JSON and return this as a string. Encode {expr} as JSON and return this as a string.
@ -5395,8 +5442,10 @@ line({expr}) The result is a Number, which is the line number of the file
$ the last line in the current buffer $ the last line in the current buffer
'x position of mark x (if the mark is not set, 0 is 'x position of mark x (if the mark is not set, 0 is
returned) returned)
w0 first line visible in current window w0 first line visible in current window (one if the
w$ last line visible in current window display isn't updated, e.g. in silent Ex mode)
w$ last line visible in current window (this is one
less than "w0" if no lines are visible)
v In Visual mode: the start of the Visual area (the v In Visual mode: the start of the Visual area (the
cursor is the end). When not in Visual mode cursor is the end). When not in Visual mode
returns the cursor position. Differs from |'<| in returns the cursor position. Differs from |'<| in
@ -6303,15 +6352,17 @@ reltimestr({time}) *reltimestr()*
{only available when compiled with the |+reltime| feature} {only available when compiled with the |+reltime| feature}
*remote_expr()* *E449* *remote_expr()* *E449*
remote_expr({server}, {string} [, {idvar}]) remote_expr({server}, {string} [, {idvar} [, {timeout}]])
Send the {string} to {server}. The string is sent as an Send the {string} to {server}. The string is sent as an
expression and the result is returned after evaluation. expression and the result is returned after evaluation.
The result must be a String or a |List|. A |List| is turned The result must be a String or a |List|. A |List| is turned
into a String by joining the items with a line break in into a String by joining the items with a line break in
between (not at the end), like with join(expr, "\n"). between (not at the end), like with join(expr, "\n").
If {idvar} is present, it is taken as the name of a If {idvar} is present and not empty, it is taken as the name
variable and a {serverid} for later use with of a variable and a {serverid} for later use with
remote_read() is stored there. remote_read() is stored there.
If {timeout} is given the read times out after this many
seconds. Otherwise a timeout of 600 seconds is used.
See also |clientserver| |RemoteReply|. See also |clientserver| |RemoteReply|.
This function is not available in the |sandbox|. This function is not available in the |sandbox|.
{only available when compiled with the |+clientserver| feature} {only available when compiled with the |+clientserver| feature}
@ -6350,9 +6401,10 @@ remote_peek({serverid} [, {retvar}]) *remote_peek()*
:let repl = "" :let repl = ""
:echo "PEEK: ".remote_peek(id, "repl").": ".repl :echo "PEEK: ".remote_peek(id, "repl").": ".repl
remote_read({serverid}) *remote_read()* remote_read({serverid}, [{timeout}]) *remote_read()*
Return the oldest available reply from {serverid} and consume Return the oldest available reply from {serverid} and consume
it. It blocks until a reply is available. it. Unless a {timeout} in seconds is given, it blocks until a
reply is available.
See also |clientserver|. See also |clientserver|.
This function is not available in the |sandbox|. This function is not available in the |sandbox|.
{only available when compiled with the |+clientserver| feature} {only available when compiled with the |+clientserver| feature}
@ -6370,6 +6422,7 @@ remote_send({server}, {string} [, {idvar}])
See also |clientserver| |RemoteReply|. See also |clientserver| |RemoteReply|.
This function is not available in the |sandbox|. This function is not available in the |sandbox|.
{only available when compiled with the |+clientserver| feature} {only available when compiled with the |+clientserver| feature}
Note: Any errors will be reported in the server and may mess Note: Any errors will be reported in the server and may mess
up the display. up the display.
Examples: > Examples: >
@ -6381,6 +6434,12 @@ remote_send({server}, {string} [, {idvar}])
:echo remote_send("gvim", ":sleep 10 | echo ". :echo remote_send("gvim", ":sleep 10 | echo ".
\ 'server2client(expand("<client>"), "HELLO")<CR>') \ 'server2client(expand("<client>"), "HELLO")<CR>')
< <
*remote_startserver()* *E941* *E942*
remote_startserver({name})
Become the server {name}. This fails if already running as a
server, when |v:servername| is not empty.
{only available when compiled with the |+clientserver| feature}
remove({list}, {idx} [, {end}]) *remove()* remove({list}, {idx} [, {end}]) *remove()*
Without {end}: Remove the item at {idx} from |List| {list} and Without {end}: Remove the item at {idx} from |List| {list} and
return the item. return the item.
@ -6894,6 +6953,7 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
nr error number nr error number
text description of the error text description of the error
type single-character error type, 'E', 'W', etc. type single-character error type, 'E', 'W', etc.
valid recognized error message
The "col", "vcol", "nr", "type" and "text" entries are The "col", "vcol", "nr", "type" and "text" entries are
optional. Either "lnum" or "pattern" entry can be used to optional. Either "lnum" or "pattern" entry can be used to
@ -6903,21 +6963,26 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
item will not be handled as an error line. item will not be handled as an error line.
If both "pattern" and "lnum" are present then "pattern" will If both "pattern" and "lnum" are present then "pattern" will
be used. be used.
If the "valid" entry is not supplied, then the valid flag is
set when "bufnr" is a valid buffer or "filename" exists.
If you supply an empty {list}, the quickfix list will be If you supply an empty {list}, the quickfix list will be
cleared. cleared.
Note that the list is not exactly the same as what Note that the list is not exactly the same as what
|getqflist()| returns. |getqflist()| returns.
*E927* {action} values: *E927*
If {action} is set to 'a', then the items from {list} are 'a' The items from {list} are added to the existing
added to the existing quickfix list. If there is no existing quickfix list. If there is no existing list, then a
list, then a new list is created. new list is created.
If {action} is set to 'r', then the items from the current 'r' The items from the current quickfix list are replaced
quickfix list are replaced with the items from {list}. This with the items from {list}. This can also be used to
can also be used to clear the list: > clear the list: >
:call setqflist([], 'r') :call setqflist([], 'r')
< <
'f' All the quickfix lists in the quickfix stack are
freed.
If {action} is not present or is set to ' ', then a new list If {action} is not present or is set to ' ', then a new list
is created. is created.
@ -6925,6 +6990,7 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
only the items listed in {what} are set. The first {list} only the items listed in {what} are set. The first {list}
argument is ignored. The following items can be specified in argument is ignored. The following items can be specified in
{what}: {what}:
context any Vim type can be stored as a context
nr list number in the quickfix stack nr list number in the quickfix stack
title quickfix list title text title quickfix list title text
Unsupported keys in {what} are ignored. Unsupported keys in {what} are ignored.
@ -6939,7 +7005,7 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
This function can be used to create a quickfix list This function can be used to create a quickfix list
independent of the 'errorformat' setting. Use a command like independent of the 'errorformat' setting. Use a command like
":cc 1" to jump to the first position. `:cc 1` to jump to the first position.
*setreg()* *setreg()*
@ -7714,8 +7780,13 @@ tagfiles() Returns a |List| with the file names used to search for tags
for the current buffer. This is the 'tags' option expanded. for the current buffer. This is the 'tags' option expanded.
taglist({expr}) *taglist()* taglist({expr}[, {filename}]) *taglist()*
Returns a list of tags matching the regular expression {expr}. Returns a list of tags matching the regular expression {expr}.
If {filename} is passed it is used to prioritize the results
in the same way that |:tselect| does. See |tag-priority|.
{filename} should be the full path of the file.
Each list item is a dictionary with at least the following Each list item is a dictionary with at least the following
entries: entries:
name Name of the tag. name Name of the tag.
@ -7797,14 +7868,6 @@ test_autochdir() *test_autochdir()*
Set a flag to enable the effect of 'autochdir' before Vim Set a flag to enable the effect of 'autochdir' before Vim
startup has finished. 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()* test_garbagecollect_now() *test_garbagecollect_now()*
Like garbagecollect(), but executed right away. This must Like garbagecollect(), but executed right away. This must
only be called directly to avoid any structure to exist only be called directly to avoid any structure to exist
@ -7840,6 +7903,18 @@ test_null_partial() *test_null_partial()*
test_null_string() *test_null_string()* test_null_string() *test_null_string()*
Return a String that is null. Only useful for testing. 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()* test_settime({expr}) *test_settime()*
Set the time Vim uses internally. Currently only used for Set the time Vim uses internally. Currently only used for
timestamps in the history, as they are used in viminfo, and timestamps in the history, as they are used in viminfo, and
@ -8430,9 +8505,9 @@ listcmds Compiled with commands for the buffer list |:files|
and the argument list |arglist|. and the argument list |arglist|.
localmap Compiled with local mappings and abbr. |:map-local| localmap Compiled with local mappings and abbr. |:map-local|
lua Compiled with Lua interface |Lua|. lua Compiled with Lua interface |Lua|.
mac Any Macintosh version of Vim. mac Any Macintosh version of Vim, but not all OS X.
macunix Compiled for OS X, with darwin macunix Compiled for OS X, with |mac-darwin-feature|
osx Compiled for OS X, with or without darwin osx Compiled for OS X, with or w/o |mac-darwin-feature|
menu Compiled with support for |:menu|. menu Compiled with support for |:menu|.
mksession Compiled with support for |:mksession|. mksession Compiled with support for |:mksession|.
modify_fname Compiled with file name modifiers. |filename-modifiers| modify_fname Compiled with file name modifiers. |filename-modifiers|
@ -10607,6 +10682,17 @@ missing: >
: echo "You will _never_ see this message" : echo "You will _never_ see this message"
:endif :endif
To execute a command only when the |+eval| feature is disabled requires a trick,
as this example shows: >
silent! while 0
set history=111
silent! endwhile
When the |+eval| feature is available the command is skipped because of the
"while 0". Without the |+eval| feature the "while 0" is an error, which is
silently ignored, and the command is executed.
============================================================================== ==============================================================================
11. The sandbox *eval-sandbox* *sandbox* *E48* 11. The sandbox *eval-sandbox* *sandbox* *E48*

View File

@ -1,4 +1,4 @@
*filetype.txt* For Vim version 8.0. Last change: 2017 Jan 04 *filetype.txt* For Vim version 8.0. Last change: 2017 Mar 28
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -353,12 +353,12 @@ define yourself. There are a few ways to avoid this:
You need to define your own mapping before the plugin is loaded (before You need to define your own mapping before the plugin is loaded (before
editing a file of that type). The plugin will then skip installing the editing a file of that type). The plugin will then skip installing the
default mapping. default mapping.
*no_mail_maps*
3. Disable defining mappings for a specific filetype by setting a variable, 3. Disable defining mappings for a specific filetype by setting a variable,
which contains the name of the filetype. For the "mail" filetype this which contains the name of the filetype. For the "mail" filetype this
would be: > would be: >
:let no_mail_maps = 1 :let no_mail_maps = 1
< *no_plugin_maps*
4. Disable defining mappings for all filetypes by setting a variable: > 4. Disable defining mappings for all filetypes by setting a variable: >
:let no_plugin_maps = 1 :let no_plugin_maps = 1
< <
@ -663,6 +663,12 @@ Since the text for this plugin is rather long it has been put in a separate
file: |pi_spec.txt|. file: |pi_spec.txt|.
RUST *ft-rust*
Since the text for this plugin is rather long it has been put in a separate
file: |ft_rust.txt|.
SQL *ft-sql* SQL *ft-sql*
Since the text for this plugin is rather long it has been put in a separate Since the text for this plugin is rather long it has been put in a separate

View File

@ -1,4 +1,4 @@
*fold.txt* For Vim version 8.0. Last change: 2016 Jan 02 *fold.txt* For Vim version 8.0. Last change: 2017 Mar 18
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -79,7 +79,7 @@ This will call a function to compute the fold level: >
:set foldexpr=MyFoldLevel(v:lnum) :set foldexpr=MyFoldLevel(v:lnum)
This will make a fold out of paragraphs separated by blank lines: > This will make a fold out of paragraphs separated by blank lines: >
:set foldexpr=getline(v:lnum)=~'^\\s*$'&&getline(v:lnum+1)=~'\\S'?'<1':1 :set foldexpr=getline(v:lnum)=~'^\\s*$'&&getline(v:lnum+1)=~'\\S'?'<1':1
this does the same: > This does the same: >
:set foldexpr=getline(v:lnum-1)=~'^\\s*$'&&getline(v:lnum)=~'\\S'?'>1':1 :set foldexpr=getline(v:lnum-1)=~'^\\s*$'&&getline(v:lnum)=~'\\S'?'>1':1
Note that backslashes must be used to escape characters that ":set" handles Note that backslashes must be used to escape characters that ":set" handles
@ -203,7 +203,7 @@ and the level given by the marker:
1. If a marker with the same fold level is encountered, the previous fold 1. If a marker with the same fold level is encountered, the previous fold
ends and another fold with the same level starts. ends and another fold with the same level starts.
2. If a marker with a higher fold level is found, a nested fold is started. 2. If a marker with a higher fold level is found, a nested fold is started.
3. if a marker with a lower fold level is found, all folds up to and including 3. If a marker with a lower fold level is found, all folds up to and including
this level end and a fold with the specified level starts. this level end and a fold with the specified level starts.
The number indicates the fold level. A zero cannot be used (a marker with The number indicates the fold level. A zero cannot be used (a marker with

View File

@ -116,7 +116,7 @@ NOTE: "gnat xref -v" is very tricky to use as it has almost no diagnostic
then "gnat xref -v *.ad?" then "gnat xref -v *.ad?"
4) Project manager support is completely broken - don't even try "gnat xref 4) Project manager support is completely broken - don't even try "gnat xref
-Padacl.gpr". -Padacl.gpr".
5) VIM is faster when the tags file is sorted - use "sort --unique 5) Vim is faster when the tags file is sorted - use "sort --unique
--ignore-case --output=tags tags" . --ignore-case --output=tags tags" .
6) Remember to insert "!_TAG_FILE_SORTED 2 %sort ui" as first line to mark 6) Remember to insert "!_TAG_FILE_SORTED 2 %sort ui" as first line to mark
the file assorted. the file assorted.

237
runtime/doc/ft_rust.txt Normal file
View File

@ -0,0 +1,237 @@
*ft_rust.txt* Filetype plugin for Rust
==============================================================================
CONTENTS *rust*
1. Introduction |rust-intro|
2. Settings |rust-settings|
3. Commands |rust-commands|
4. Mappings |rust-mappings|
==============================================================================
INTRODUCTION *rust-intro*
This plugin provides syntax and supporting functionality for the Rust
filetype.
==============================================================================
SETTINGS *rust-settings*
This plugin has a few variables you can define in your vimrc that change the
behavior of the plugin.
*g:rustc_path*
g:rustc_path~
Set this option to the path to rustc for use in the |:RustRun| and
|:RustExpand| commands. If unset, "rustc" will be located in $PATH: >
let g:rustc_path = $HOME."/bin/rustc"
<
*g:rustc_makeprg_no_percent*
g:rustc_makeprg_no_percent~
Set this option to 1 to have 'makeprg' default to "rustc" instead of
"rustc %": >
let g:rustc_makeprg_no_percent = 1
<
*g:rust_conceal*
g:rust_conceal~
Set this option to turn on the basic |conceal| support: >
let g:rust_conceal = 1
<
*g:rust_conceal_mod_path*
g:rust_conceal_mod_path~
Set this option to turn on |conceal| for the path connecting token
"::": >
let g:rust_conceal_mod_path = 1
<
*g:rust_conceal_pub*
g:rust_conceal_pub~
Set this option to turn on |conceal| for the "pub" token: >
let g:rust_conceal_pub = 1
<
*g:rust_recommended_style*
g:rust_recommended_style~
Set this option to enable vim indentation and textwidth settings to
conform to style conventions of the rust standard library (i.e. use 4
spaces for indents and sets 'textwidth' to 99). This option is enabled
by default. To disable it: >
let g:rust_recommended_style = 0
<
*g:rust_fold*
g:rust_fold~
Set this option to turn on |folding|: >
let g:rust_fold = 1
<
Value Effect ~
0 No folding
1 Braced blocks are folded. All folds are open by
default.
2 Braced blocks are folded. 'foldlevel' is left at the
global value (all folds are closed by default).
*g:rust_bang_comment_leader*
g:rust_bang_comment_leader~
Set this option to 1 to preserve the leader on multi-line doc comments
using the /*! syntax: >
let g:rust_bang_comment_leader = 1
<
*g:ftplugin_rust_source_path*
g:ftplugin_rust_source_path~
Set this option to a path that should be prepended to 'path' for Rust
source files: >
let g:ftplugin_rust_source_path = $HOME.'/dev/rust'
<
*g:rustfmt_command*
g:rustfmt_command~
Set this option to the name of the 'rustfmt' executable in your $PATH. If
not specified it defaults to 'rustfmt' : >
let g:rustfmt_command = 'rustfmt'
<
*g:rustfmt_autosave*
g:rustfmt_autosave~
Set this option to 1 to run |:RustFmt| automatically when saving a
buffer. If not specified it defaults to 0 : >
let g:rustfmt_autosave = 0
<
*g:rustfmt_fail_silently*
g:rustfmt_fail_silently~
Set this option to 1 to prevent 'rustfmt' from populating the
|location-list| with errors. If not specified it defaults to 0: >
let g:rustfmt_fail_silently = 0
<
*g:rustfmt_options*
g:rustfmt_options~
Set this option to a string of options to pass to 'rustfmt'. The
write-mode is already set to 'overwrite'. If not specified it
defaults to '' : >
let g:rustfmt_options = ''
<
*g:rust_playpen_url*
g:rust_playpen_url~
Set this option to override the url for the playpen to use: >
let g:rust_playpen_url = 'https://play.rust-lang.org/'
<
*g:rust_shortener_url*
g:rust_shortener_url~
Set this option to override the url for the url shortener: >
let g:rust_shortener_url = 'https://is.gd/'
<
==============================================================================
COMMANDS *rust-commands*
:RustRun [args] *:RustRun*
:RustRun! [rustc-args] [--] [args]
Compiles and runs the current file. If it has unsaved changes,
it will be saved first using |:update|. If the current file is
an unnamed buffer, it will be written to a temporary file
first. The compiled binary is always placed in a temporary
directory, but is run from the current directory.
The arguments given to |:RustRun| will be passed to the
compiled binary.
If ! is specified, the arguments are passed to rustc instead.
A "--" argument will separate the rustc arguments from the
arguments passed to the binary.
If |g:rustc_path| is defined, it is used as the path to rustc.
Otherwise it is assumed rustc can be found in $PATH.
:RustExpand [args] *:RustExpand*
:RustExpand! [TYPE] [args]
Expands the current file using --pretty and displays the
results in a new split. If the current file has unsaved
changes, it will be saved first using |:update|. If the
current file is an unnamed buffer, it will be written to a
temporary file first.
The arguments given to |:RustExpand| will be passed to rustc.
This is largely intended for specifying various --cfg
configurations.
If ! is specified, the first argument is the expansion type to
pass to rustc --pretty. Otherwise it will default to
"expanded".
If |g:rustc_path| is defined, it is used as the path to rustc.
Otherwise it is assumed rustc can be found in $PATH.
:RustEmitIr [args] *:RustEmitIr*
Compiles the current file to LLVM IR and displays the results
in a new split. If the current file has unsaved changes, it
will be saved first using |:update|. If the current file is an
unnamed buffer, it will be written to a temporary file first.
The arguments given to |:RustEmitIr| will be passed to rustc.
If |g:rustc_path| is defined, it is used as the path to rustc.
Otherwise it is assumed rustc can be found in $PATH.
:RustEmitAsm [args] *:RustEmitAsm*
Compiles the current file to assembly and displays the results
in a new split. If the current file has unsaved changes, it
will be saved first using |:update|. If the current file is an
unnamed buffer, it will be written to a temporary file first.
The arguments given to |:RustEmitAsm| will be passed to rustc.
If |g:rustc_path| is defined, it is used as the path to rustc.
Otherwise it is assumed rustc can be found in $PATH.
:RustPlay *:RustPlay*
This command will only work if you have web-api.vim installed
(available at https://github.com/mattn/webapi-vim). It sends the
current selection, or if nothing is selected, the entirety of the
current buffer to the Rust playpen, and emits a message with the
shortened URL to the playpen.
|g:rust_playpen_url| is the base URL to the playpen, by default
"https://play.rust-lang.org/".
|g:rust_shortener_url| is the base url for the shorterner, by
default "https://is.gd/"
:RustFmt *:RustFmt*
Runs |g:rustfmt_command| on the current buffer. If
|g:rustfmt_options| is set then those will be passed to the
executable.
If |g:rustfmt_fail_silently| is 0 (the default) then it
will populate the |location-list| with the errors from
|g:rustfmt_command|. If |g:rustfmt_fail_silently| is set to 1
then it will not populate the |location-list|.
:RustFmtRange *:RustFmtRange*
Runs |g:rustfmt_command| with selected range. See
|:RustFmt| for any other information.
==============================================================================
MAPPINGS *rust-mappings*
This plugin defines mappings for |[[| and |]]| to support hanging indents.
It also has a few other mappings:
*rust_<D-r>*
<D-r> Executes |:RustRun| with no arguments.
Note: This binding is only available in MacVim.
*rust_<D-R>*
<D-R> Populates the command line with |:RustRun|! using the
arguments given to the last invocation, but does not
execute it.
Note: This binding is only available in MacVim.
==============================================================================
vim:tw=78:sw=4:noet:ts=8:ft=help:norl:

View File

@ -6,7 +6,7 @@
Introduction *hangul* Introduction *hangul*
------------ ------------
It is to input hangul, the Korean language, with VIM GUI version. It is to input hangul, the Korean language, with Vim GUI version.
If you have a XIM program, you can use another |+xim| feature. If you have a XIM program, you can use another |+xim| feature.
Basically, it is for anybody who has no XIM program. Basically, it is for anybody who has no XIM program.
@ -31,7 +31,7 @@ You should set LANG variable to Korean locale such as ko, ko_KR.eucKR
or ko_KR.UTF-8. or ko_KR.UTF-8.
If you set LC_ALL variable, it should be set to Korean locale also. If you set LC_ALL variable, it should be set to Korean locale also.
VIM resource Vim resource
------------ ------------
You may want to set 'encoding' and 'fileencodings'. You may want to set 'encoding' and 'fileencodings'.
Next are examples: > Next are examples: >
@ -53,12 +53,12 @@ If both are set, VIM_KEYBOARD has higher priority.
Hangul Fonts Hangul Fonts
------------ ------------
If you use GTK version of GVIM, you should set 'guifont' and 'guifontwide'. If you use GTK version of gvim, you should set 'guifont' and 'guifontwide'.
For example: > For example: >
set guifont=Courier\ 12 set guifont=Courier\ 12
set guifontwide=NanumGothicCoding\ 12 set guifontwide=NanumGothicCoding\ 12
If you use Motif or Athena version of GVIM, you should set 'guifontset' in If you use Motif or Athena version of gvim, you should set 'guifontset' in
your vimrc. You can set fontset in the .Xdefaults file. your vimrc. You can set fontset in the .Xdefaults file.
$HOME/.gvimrc: > $HOME/.gvimrc: >
@ -77,11 +77,11 @@ $HOME/.Xdefaults: >
attention! the , (comma) or ; (semicolon) attention! the , (comma) or ; (semicolon)
And there should be no ':set guifont'. If it exists, then Gvim ignores And there should be no ':set guifont'. If it exists, then gvim ignores
':set guifontset'. It means VIM runs without fontset supporting. ':set guifontset'. It means Vim runs without fontset supporting.
So, you can see only English. Hangul does not be correctly displayed. So, you can see only English. Hangul does not be correctly displayed.
After "fontset" feature is enabled, VIM does not allow using english After "fontset" feature is enabled, Vim does not allow using english
font only in "font" setting for syntax. font only in "font" setting for syntax.
For example, if you use > For example, if you use >
:set guifontset=eng_font,your_font :set guifontset=eng_font,your_font
@ -99,7 +99,7 @@ We don't support Johab font.
We don't support Hanja input. We don't support Hanja input.
And We don't have any plan to support them. And We don't have any plan to support them.
If you really need such features, you can use console version of VIM with a If you really need such features, you can use console version of Vim with a
capable terminal emulator. capable terminal emulator.
Bug or Comment Bug or Comment

View File

@ -31,7 +31,7 @@ Get specific help: It is possible to go directly to whatever you want help
help entries for "word". help entries for "word".
Or use ":helpgrep word". |:helpgrep| Or use ":helpgrep word". |:helpgrep|
VIM stands for Vi IMproved. Most of VIM was made by Bram Moolenaar, but only Vim stands for Vi IMproved. Most of Vim was made by Bram Moolenaar, but only
through the help of many others. See |credits|. through the help of many others. See |credits|.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*doc-file-list* *Q_ct* *doc-file-list* *Q_ct*

View File

@ -1,4 +1,4 @@
*helphelp.txt* For Vim version 8.0. Last change: 2017 Feb 09 *helphelp.txt* For Vim version 8.0. Last change: 2017 Mar 19
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -142,7 +142,8 @@ Help on help files *helphelp*
already opened, then the location list for that window already opened, then the location list for that window
is used. Otherwise, a new help window is opened and is used. Otherwise, a new help window is opened and
the location list for that window is set. The the location list for that window is set. The
location list for the current window is not changed. location list for the current window is not changed
then.
*:exu* *:exusage* *:exu* *:exusage*
:exu[sage] Show help on Ex commands. Added to simulate the Nvi :exu[sage] Show help on Ex commands. Added to simulate the Nvi

View File

@ -41,9 +41,9 @@ instance), code similar to the following should be used:
$vim = new Win32::OLE 'Vim.Application'; $vim = new Win32::OLE 'Vim.Application';
[C#] > [C#] >
// Add a reference to VIM in your project. // Add a reference to Vim in your project.
// Choose the COM tab. // Choose the COM tab.
// Select "VIM Ole Interface 1.1 Type Library" // Select "Vim Ole Interface 1.1 Type Library"
Vim.Vim vimobj = new Vim.Vim(); Vim.Vim vimobj = new Vim.Vim();
Vim does not support acting as a "hidden" OLE server, like some other OLE Vim does not support acting as a "hidden" OLE server, like some other OLE

View File

@ -7,7 +7,7 @@
Perl and Vim *perl* *Perl* Perl and Vim *perl* *Perl*
1. Editing Perl files |perl-editing| 1. Editing Perl files |perl-editing|
2. Compiling VIM with Perl interface |perl-compiling| 2. Compiling Vim with Perl interface |perl-compiling|
3. Using the Perl interface |perl-using| 3. Using the Perl interface |perl-using|
4. Dynamic loading |perl-dynamic| 4. Dynamic loading |perl-dynamic|
@ -33,7 +33,7 @@ Vim in the $VIMRUNTIME/tools directory. This script has currently more
features than Exuberant ctags' Perl support. features than Exuberant ctags' Perl support.
============================================================================== ==============================================================================
2. Compiling VIM with Perl interface *perl-compiling* 2. Compiling Vim with Perl interface *perl-compiling*
To compile Vim with Perl interface, you need Perl 5.004 (or later). Perl must To compile Vim with Perl interface, you need Perl 5.004 (or later). Perl must
be installed before you compile Vim. Vim's Perl interface does NOT work with be installed before you compile Vim. Vim's Perl interface does NOT work with

View File

@ -1,4 +1,4 @@
*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 VIM REFERENCE MANUAL by Paul Moore
@ -17,6 +17,7 @@ The Python Interface to Vim *python* *Python*
9. Dynamic loading |python-dynamic| 9. Dynamic loading |python-dynamic|
10. Python 3 |python3| 10. Python 3 |python3|
11. Python X |python_x| 11. Python X |python_x|
12. Building with Python support |python-building|
{Vi does not have any of these commands} {Vi does not have any of these commands}
@ -879,5 +880,27 @@ If a user prefers Python 2 and want to fallback to Python 3, he needs to set
set pyx=3 set pyx=3
endif 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: vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,4 +1,4 @@
*index.txt* For Vim version 8.0. Last change: 2017 Feb 23 *index.txt* For Vim version 8.0. Last change: 2017 Apr 22
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -309,10 +309,10 @@ tag char note action in Normal mode ~
|B| B 1 cursor N WORDS backward |B| B 1 cursor N WORDS backward
|C| ["x]C 2 change from the cursor position to the end |C| ["x]C 2 change from the cursor position to the end
of the line, and N-1 more lines [into of the line, and N-1 more lines [into
buffer x]; synonym for "c$" register x]; synonym for "c$"
|D| ["x]D 2 delete the characters under the cursor |D| ["x]D 2 delete the characters under the cursor
until the end of the line and N-1 more until the end of the line and N-1 more
lines [into buffer x]; synonym for "d$" lines [into register x]; synonym for "d$"
|E| E 1 cursor forward to the end of WORD N |E| E 1 cursor forward to the end of WORD N
|F| F{char} 1 cursor to the Nth occurrence of {char} to |F| F{char} 1 cursor to the Nth occurrence of {char} to
the left the left
@ -329,13 +329,13 @@ tag char note action in Normal mode ~
opposite direction opposite direction
|O| O 2 begin a new line above the cursor and |O| O 2 begin a new line above the cursor and
insert text, repeat N times insert text, repeat N times
|P| ["x]P 2 put the text [from buffer x] before the |P| ["x]P 2 put the text [from register x] before the
cursor N times cursor N times
|Q| Q switch to "Ex" mode |Q| Q switch to "Ex" mode
|R| R 2 enter replace mode: overtype existing |R| R 2 enter replace mode: overtype existing
characters, repeat the entered text N-1 characters, repeat the entered text N-1
times times
|S| ["x]S 2 delete N lines [into buffer x] and start |S| ["x]S 2 delete N lines [into register x] and start
insert; synonym for "cc". insert; synonym for "cc".
|T| T{char} 1 cursor till after Nth occurrence of {char} |T| T{char} 1 cursor till after Nth occurrence of {char}
to the left to the left
@ -343,8 +343,8 @@ tag char note action in Normal mode ~
|V| V start linewise Visual mode |V| V start linewise Visual mode
|W| W 1 cursor N WORDS forward |W| W 1 cursor N WORDS forward
|X| ["x]X 2 delete N characters before the cursor [into |X| ["x]X 2 delete N characters before the cursor [into
buffer x] register x]
|Y| ["x]Y yank N lines [into buffer x]; synonym for |Y| ["x]Y yank N lines [into register x]; synonym for
"yy" "yy"
|ZZ| ZZ store current file if modified, and exit |ZZ| ZZ store current file if modified, and exit
|ZQ| ZQ exit current file always |ZQ| ZQ exit current file always
@ -367,12 +367,12 @@ tag char note action in Normal mode ~
|`}| `} 1 cursor to the end of the current paragraph |`}| `} 1 cursor to the end of the current paragraph
|a| a 2 append text after the cursor N times |a| a 2 append text after the cursor N times
|b| b 1 cursor N words backward |b| b 1 cursor N words backward
|c| ["x]c{motion} 2 delete Nmove text [into buffer x] and start |c| ["x]c{motion} 2 delete Nmove text [into register x] and
start insert
|cc| ["x]cc 2 delete N lines [into register x] and start
insert insert
|cc| ["x]cc 2 delete N lines [into buffer x] and start |d| ["x]d{motion} 2 delete Nmove text [into register x]
insert |dd| ["x]dd 2 delete N lines [into register x]
|d| ["x]d{motion} 2 delete Nmove text [into buffer x]
|dd| ["x]dd 2 delete N lines [into buffer x]
|do| do 2 same as ":diffget" |do| do 2 same as ":diffget"
|dp| dp 2 same as ":diffput" |dp| dp 2 same as ":diffput"
|e| e 1 cursor forward to the end of word N |e| e 1 cursor forward to the end of word N
@ -398,16 +398,16 @@ tag char note action in Normal mode ~
|q?| q? edit ? command-line in command-line window |q?| q? edit ? command-line in command-line window
|r| r{char} 2 replace N chars with {char} |r| r{char} 2 replace N chars with {char}
|s| ["x]s 2 (substitute) delete N characters [into |s| ["x]s 2 (substitute) delete N characters [into
buffer x] and start insert register x] and start insert
|t| t{char} 1 cursor till before Nth occurrence of {char} |t| t{char} 1 cursor till before Nth occurrence of {char}
to the right to the right
|u| u 2 undo changes |u| u 2 undo changes
|v| v start characterwise Visual mode |v| v start characterwise Visual mode
|w| w 1 cursor N words forward |w| w 1 cursor N words forward
|x| ["x]x 2 delete N characters under and after the |x| ["x]x 2 delete N characters under and after the
cursor [into buffer x] cursor [into register x]
|y| ["x]y{motion} yank Nmove text [into buffer x] |y| ["x]y{motion} yank Nmove text [into register x]
|yy| ["x]yy yank N lines [into buffer x] |yy| ["x]yy yank N lines [into register x]
|z| z{char} commands starting with 'z', see |z| below |z| z{char} commands starting with 'z', see |z| below
|{| { 1 cursor N paragraphs backward |{| { 1 cursor N paragraphs backward
|bar| | 1 cursor to column N |bar| | 1 cursor to column N

View File

@ -1,4 +1,4 @@
*insert.txt* For Vim version 8.0. Last change: 2016 Jan 31 *insert.txt* For Vim version 8.0. Last change: 2017 May 30
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -159,7 +159,8 @@ CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*
CTRL-R CTRL-O {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-O* CTRL-R CTRL-O {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-O*
Insert the contents of a register literally and don't Insert the contents of a register literally and don't
auto-indent. Does the same as pasting with the mouse auto-indent. Does the same as pasting with the mouse
|<MiddleMouse>|. |<MiddleMouse>|. When the register is linewise this will
insert the text above the current line, like with `P`.
Does not replace characters! Does not replace characters!
The '.' register (last inserted text) is still inserted as The '.' register (last inserted text) is still inserted as
typed. {not in Vi} typed. {not in Vi}
@ -633,13 +634,13 @@ Completion can be done for:
10. User defined completion |i_CTRL-X_CTRL-U| 10. User defined completion |i_CTRL-X_CTRL-U|
11. omni completion |i_CTRL-X_CTRL-O| 11. omni completion |i_CTRL-X_CTRL-O|
12. Spelling suggestions |i_CTRL-X_s| 12. Spelling suggestions |i_CTRL-X_s|
13. keywords in 'complete' |i_CTRL-N| 13. keywords in 'complete' |i_CTRL-N| |i_CTRL-P|
All these (except 2) are done in CTRL-X mode. This is a sub-mode of Insert All these, except CTRL-N and CTRL-P, are done in CTRL-X mode. This is a
and Replace modes. You enter CTRL-X mode by typing CTRL-X and one of the sub-mode of Insert and Replace modes. You enter CTRL-X mode by typing CTRL-X
CTRL-X commands. You exit CTRL-X mode by typing a key that is not a valid and one of the CTRL-X commands. You exit CTRL-X mode by typing a key that is
CTRL-X mode command. Valid keys are the CTRL-X command itself, CTRL-N (next), not a valid CTRL-X mode command. Valid keys are the CTRL-X command itself,
and CTRL-P (previous). CTRL-N (next), and CTRL-P (previous).
Also see the 'infercase' option if you want to adjust the case of the match. Also see the 'infercase' option if you want to adjust the case of the match.

View File

@ -84,8 +84,8 @@ The Vim pages contain the most recent information about Vim. They also
contain links to the most recent version of Vim. The FAQ is a list of contain links to the most recent version of Vim. The FAQ is a list of
Frequently Asked Questions. Read this if you have problems. Frequently Asked Questions. Read this if you have problems.
VIM home page: http://www.vim.org/ Vim home page: http://www.vim.org/
VIM FAQ: http://vimdoc.sf.net/ Vim FAQ: http://vimdoc.sf.net/
Downloading: ftp://ftp.vim.org/pub/vim/MIRRORS Downloading: ftp://ftp.vim.org/pub/vim/MIRRORS

View File

@ -1,4 +1,4 @@
*map.txt* For Vim version 8.0. Last change: 2016 Oct 15 *map.txt* For Vim version 8.0. Last change: 2017 May 30
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -185,7 +185,7 @@ that starts with ",". Then you need to type another character for Vim to know
whether to use the "," mapping or the longer one. To avoid this add the whether to use the "," mapping or the longer one. To avoid this add the
<nowait> argument. Then the mapping will be used when it matches, Vim does <nowait> argument. Then the mapping will be used when it matches, Vim does
not wait for more characters to be typed. However, if the characters were not wait for more characters to be typed. However, if the characters were
already type they are used. already typed they are used.
*:map-<silent>* *:map-silent* *:map-<silent>* *:map-silent*
To define a mapping which will not be echoed on the command line, add To define a mapping which will not be echoed on the command line, add
@ -584,7 +584,8 @@ Upper and lowercase differences are ignored.
*map-comments* *map-comments*
It is not possible to put a comment after these commands, because the '"' 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* *map_bar* *map-bar*
Since the '|' character is used to separate a map command from the next Since the '|' character is used to separate a map command from the next
@ -797,7 +798,7 @@ Bear in mind that convert-meta has been reported to have troubles when used in
UTF-8 locales. On terminals like xterm, the "metaSendsEscape" resource can be UTF-8 locales. On terminals like xterm, the "metaSendsEscape" resource can be
toggled on the fly through the "Main Options" menu, by pressing Ctrl-LeftClick toggled on the fly through the "Main Options" menu, by pressing Ctrl-LeftClick
on the terminal; that's a good last resource in case you want to send ESC when on the terminal; that's a good last resource in case you want to send ESC when
using other applications but not when inside VIM. using other applications but not when inside Vim.
1.11 MAPPING AN OPERATOR *:map-operator* 1.11 MAPPING AN OPERATOR *:map-operator*

View File

@ -1,4 +1,4 @@
*message.txt* For Vim version 8.0. Last change: 2017 Jan 02 *message.txt* For Vim version 8.0. Last change: 2017 Mar 25
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -768,6 +768,13 @@ Example: >
You tried to execute a command that is neither an Ex command nor You tried to execute a command that is neither an Ex command nor
a user-defined command. a user-defined command.
*E943* >
Command table needs to be updated, run 'make cmdidxs'
This can only happen when changing the source code, when adding a command in
src/ex_cmds.h. The lookup table then needs to be updated, by running: >
make cmdidxs
============================================================================== ==============================================================================
3. Messages *messages* 3. Messages *messages*

View File

@ -1,4 +1,4 @@
*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 VIM REFERENCE MANUAL by Bram Moolenaar
@ -193,7 +193,7 @@ l or *l*
*$* *<End>* *<kEnd>* *$* *<End>* *<kEnd>*
$ or <End> To the end of the line. When a count is given also go $ 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 In Visual mode the cursor goes to just after the last
character in the line. character in the line.
When 'virtualedit' is active, "$" may move the cursor When 'virtualedit' is active, "$" may move the cursor

View File

@ -120,7 +120,7 @@ In case you do not want the NetBeans interface you can disable it by
uncommenting a line with "--disable-netbeans" in the Makefile. uncommenting a line with "--disable-netbeans" in the Makefile.
Currently the NetBeans interface is supported by Vim running in a terminal and Currently the NetBeans interface is supported by Vim running in a terminal and
by GVim when it is run with one of the following GUIs: GTK, GNOME, Windows, by gvim when it is run with one of the following GUIs: GTK, GNOME, Windows,
Athena and Motif. Athena and Motif.
If Motif support is required the user must supply XPM libraries. See If Motif support is required the user must supply XPM libraries. See
@ -996,7 +996,7 @@ to "Vim". In the Expert tab make sure the "Vim Command" is correct.
You should be careful if you change the "Vim Command". There are command You should be careful if you change the "Vim Command". There are command
line options there which must be there for the connection to be properly line options there which must be there for the connection to be properly
set up. You can change the command name but that's about it. If your gvim set up. You can change the command name but that's about it. If your gvim
can be found by your $PATH then the VIM Command can start with "gvim". If can be found by your $PATH then the Vim Command can start with "gvim". If
you don't want gvim searched from your $PATH then hard code in the full you don't want gvim searched from your $PATH then hard code in the full
Unix path name. At this point you should get a gvim for any source file Unix path name. At this point you should get a gvim for any source file
you open in NetBeans. you open in NetBeans.

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 8.0. Last change: 2017 Mar 05 *options.txt* For Vim version 8.0. Last change: 2017 Jun 04
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -370,7 +370,7 @@ Note: In the future more global options can be made global-local. Using
Setting the filetype Setting the filetype
:setf[iletype] {filetype} *:setf* *:setfiletype* :setf[iletype] [FALLBACK] {filetype} *:setf* *:setfiletype*
Set the 'filetype' option to {filetype}, but only if Set the 'filetype' option to {filetype}, but only if
not done yet in a sequence of (nested) autocommands. not done yet in a sequence of (nested) autocommands.
This is short for: > This is short for: >
@ -380,6 +380,13 @@ Setting the filetype
< This command is used in a filetype.vim file to avoid < This command is used in a filetype.vim file to avoid
setting the 'filetype' option twice, causing different setting the 'filetype' option twice, causing different
settings and syntax files to be loaded. settings and syntax files to be loaded.
When the optional FALLBACK argument is present, a
later :setfiletype command will override the
'filetype'. This is to used for filetype detections
that are just a guess. |did_filetype()| will return
false after this command.
{not in Vi} {not in Vi}
*option-window* *optwin* *option-window* *optwin*
@ -727,6 +734,7 @@ A jump table for the options with a short description can be found at |Q_op|.
which can be easier to read at certain sizes on certain displays. which can be easier to read at certain sizes on certain displays.
Setting this option can sometimes cause problems if 'guifont' is set Setting this option can sometimes cause problems if 'guifont' is set
to its default (empty string). to its default (empty string).
NOTE: This option is reset when 'compatible' is set.
*'autochdir'* *'acd'* *'noautochdir'* *'noacd'* *'autochdir'* *'acd'* *'noautochdir'* *'noacd'*
'autochdir' 'acd' boolean (default off) 'autochdir' 'acd' boolean (default off)
@ -760,6 +768,7 @@ A jump table for the options with a short description can be found at |Q_op|.
- Disable the use of 'keymap' (without changing its value). - Disable the use of 'keymap' (without changing its value).
Note that 'arabicshape' and 'delcombine' are not reset (it is a global Note that 'arabicshape' and 'delcombine' are not reset (it is a global
option). option).
NOTE: This option is reset when 'compatible' is set.
Also see |arabic.txt|. Also see |arabic.txt|.
*'arabicshape'* *'arshape'* *'arabicshape'* *'arshape'*
@ -781,6 +790,7 @@ A jump table for the options with a short description can be found at |Q_op|.
form. form.
Arabic is a complex language which requires other settings, for Arabic is a complex language which requires other settings, for
further details see |arabic.txt|. further details see |arabic.txt|.
NOTE: This option is set when 'compatible' is set.
*'autoindent'* *'ai'* *'noautoindent'* *'noai'* *'autoindent'* *'ai'* *'noautoindent'* *'noai'*
'autoindent' 'ai' boolean (default off) 'autoindent' 'ai' boolean (default off)
@ -859,6 +869,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, < 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. 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
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.
When starting the GUI, the default value for 'background' will be When starting the GUI, the default value for 'background' will be
"light". When the value is not set in the .gvimrc, and Vim detects "light". When the value is not set in the .gvimrc, and Vim detects
that the background is actually quite dark, 'background' is set to that the background is actually quite dark, 'background' is set to
@ -993,6 +1009,9 @@ A jump table for the options with a short description can be found at |Q_op|.
the system may refuse to do this. In that case the "auto" value will the system may refuse to do this. In that case the "auto" value will
again not rename the file. 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'*
'backupdir' 'bdir' string (default for Amiga: ".,t:", 'backupdir' 'bdir' string (default for Amiga: ".,t:",
for MS-DOS and Win32: ".,$TEMP,c:/tmp,c:/temp" for MS-DOS and Win32: ".,$TEMP,c:/tmp,c:/temp"
@ -1139,6 +1158,7 @@ A jump table for the options with a short description can be found at |Q_op|.
< When they are supported "\n" characters will start a new line. If the < 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 expression evaluates to a |List| this is equal to using each List item
as a string and putting "\n" in between them. as a string and putting "\n" in between them.
NOTE: This option is set to "" when 'compatible' is set.
*'belloff'* *'bo'* *'belloff'* *'bo'*
'belloff' 'bo' string (default "") 'belloff' 'bo' string (default "")
@ -1176,8 +1196,8 @@ A jump table for the options with a short description can be found at |Q_op|.
wildmode More matches in |cmdline-completion| available wildmode More matches in |cmdline-completion| available
(depends on the 'wildmode' setting). (depends on the 'wildmode' setting).
This is most useful, to fine tune when in insert mode the bell should 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 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 indicate that an error occurred. It can be silenced by adding the
"error" keyword. "error" keyword.
@ -1259,6 +1279,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Every wrapped line will continue visually indented (same amount of Every wrapped line will continue visually indented (same amount of
space as the beginning of that line), thus preserving horizontal blocks space as the beginning of that line), thus preserving horizontal blocks
of text. of text.
NOTE: This option is reset when 'compatible' is set.
*'breakindentopt'* *'briopt'* *'breakindentopt'* *'briopt'*
'breakindentopt' 'briopt' string (default empty) 'breakindentopt' 'briopt' string (default empty)
@ -1435,6 +1456,8 @@ A jump table for the options with a short description can be found at |Q_op|.
:exe "set cedit=\<Esc>" :exe "set cedit=\<Esc>"
< |Nvi| also has this option, but it only uses the first character. < |Nvi| also has this option, but it only uses the first character.
See |cmdwin|. See |cmdwin|.
NOTE: This option is set to the Vim default value when 'compatible'
is reset.
*'charconvert'* *'ccv'* *E202* *E214* *E513* *'charconvert'* *'ccv'* *E202* *E214* *E513*
'charconvert' 'ccv' string (default "") 'charconvert' 'ccv' string (default "")
@ -1743,7 +1766,7 @@ A jump table for the options with a short description can be found at |Q_op|.
set to its Vim default when 'compatible' is unset. set to its Vim default when 'compatible' is unset.
The {effect} column summarises the change when 'compatible' is set. The {effect} column summarises the change when 'compatible' is set.
option ? set value effect option ? set value effect ~
'allowrevins' + off no CTRL-_ command 'allowrevins' + off no CTRL-_ command
'antialias' + off don't use antialiased fonts 'antialias' + off don't use antialiased fonts
@ -1763,7 +1786,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'cscopepathcomp'+ 0 don't show directories in tags list 'cscopepathcomp'+ 0 don't show directories in tags list
'cscoperelative'+ off 'cscoperelative'+ off
'cscopetag' + off don't use cscope for ":tag" 'cscopetag' + off don't use cscope for ":tag"
'cscopetagorder' 0 see |cscopetagorder| 'cscopetagorder'+ 0 see |cscopetagorder|
'cscopeverbose' + off see |cscopeverbose| 'cscopeverbose' + off see |cscopeverbose|
'delcombine' + off unicode: delete whole char combination 'delcombine' + off unicode: delete whole char combination
'digraph' + off no digraphs 'digraph' + off no digraphs
@ -1813,7 +1836,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'tildeop' + off tilde is not an operator 'tildeop' + off tilde is not an operator
'ttimeout' + off no terminal timeout 'ttimeout' + off no terminal timeout
'undofile' + off don't use an undo file '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 'virtualedit' + "" cursor can only be placed on characters
'whichwrap' & "" left-right movements don't wrap 'whichwrap' & "" left-right movements don't wrap
'wildchar' & CTRL-E only when the current value is <Tab> 'wildchar' & CTRL-E only when the current value is <Tab>
@ -1993,7 +2016,7 @@ A jump table for the options with a short description can be found at |Q_op|.
existing line. 'expandtab' has no effect on these characters, a 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 remains a Tab. If the new indent is greater than on the existing
line, the remaining space is filled in the normal manner. 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'. Also see 'preserveindent'.
*'cpoptions'* *'cpo'* *cpo* *'cpoptions'* *'cpo'* *cpo*
@ -2354,6 +2377,7 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi} {not in Vi}
Determines how many components of the path to show in a list of tags. Determines how many components of the path to show in a list of tags.
See |cscopepathcomp|. See |cscopepathcomp|.
NOTE: This option is set to 0 when 'compatible' is set.
*'cscopeprg'* *'csprg'* *'cscopeprg'* *'csprg'*
'cscopeprg' 'csprg' string (default "cscope") 'cscopeprg' 'csprg' string (default "cscope")
@ -2383,6 +2407,7 @@ A jump table for the options with a short description can be found at |Q_op|.
In the absence of a prefix (-P) for cscope. setting this option enables In the absence of a prefix (-P) for cscope. setting this option enables
to use the basename of cscope.out path as the prefix. to use the basename of cscope.out path as the prefix.
See |cscoperelative|. See |cscoperelative|.
NOTE: This option is reset when 'compatible' is set.
*'cscopetag'* *'cst'* *'nocscopetag'* *'nocst'* *'cscopetag'* *'cst'* *'nocscopetag'* *'nocst'*
'cscopetag' 'cst' boolean (default off) 'cscopetag' 'cst' boolean (default off)
@ -2502,6 +2527,7 @@ A jump table for the options with a short description can be found at |Q_op|.
This is useful for Arabic, Hebrew and many other languages where one This is useful for Arabic, Hebrew and many other languages where one
may have combining characters overtop of base characters, and want may have combining characters overtop of base characters, and want
to remove only the combining ones. to remove only the combining ones.
NOTE: This option is reset when 'compatible' is set.
*'dictionary'* *'dict'* *'dictionary'* *'dict'*
'dictionary' 'dict' string (default "") 'dictionary' 'dict' string (default "")
@ -2687,7 +2713,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Makes the 'g' and 'c' flags of the ":substitute" command to be Makes the 'g' and 'c' flags of the ":substitute" command to be
toggled each time the flag is given. See |complex-change|. See toggled each time the flag is given. See |complex-change|. See
also 'gdefault' option. also 'gdefault' option.
Switching this option on is discouraged! Switching this option on may break plugins!
*'emoji'* *'emo'* *'noemoji'* *'noemo'* *'emoji'* *'emo'* *'noemoji'* *'noemo'*
'emoji' 'emo' boolean (default: on) 'emoji' 'emo' boolean (default: on)
@ -3422,6 +3448,7 @@ A jump table for the options with a short description can be found at |Q_op|.
The expression will be evaluated in the |sandbox| when set from a The expression will be evaluated in the |sandbox| when set from a
modeline, see |sandbox-option|. That stops the option from working, modeline, see |sandbox-option|. That stops the option from working,
since changing the buffer text is not allowed. since changing the buffer text is not allowed.
NOTE: This option is set to "" when 'compatible' is set.
*'formatoptions'* *'fo'* *'formatoptions'* *'fo'*
'formatoptions' 'fo' string (Vim default: "tcq", Vi default: "vt") 'formatoptions' 'fo' string (Vim default: "tcq", Vi default: "vt")
@ -4081,31 +4108,6 @@ A jump table for the options with a short description can be found at |Q_op|.
define one. The default uses a different group for each occasion. define one. The default uses a different group for each occasion.
See |highlight-default| for the default highlight groups. 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'*
'history' 'hi' number (Vim default: 50, Vi default: 0, 'history' 'hi' number (Vim default: 50, Vi default: 0,
set to 200 in |defaults.vim|) set to 200 in |defaults.vim|)
@ -4138,6 +4140,31 @@ A jump table for the options with a short description can be found at |Q_op|.
When on, phonetic keyboard mapping is used. 'hkmap' must also be on. When on, phonetic keyboard mapping is used. 'hkmap' must also be on.
This is useful if you have a non-Hebrew keyboard. This is useful if you have a non-Hebrew keyboard.
See |rileft.txt|. 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. NOTE: This option is reset when 'compatible' is set.
*'icon'* *'noicon'* *'icon'* *'noicon'*
@ -4419,7 +4446,7 @@ A jump table for the options with a short description can be found at |Q_op|.
< Error messages will be suppressed, unless the 'debug' option contains < Error messages will be suppressed, unless the 'debug' option contains
"msg". "msg".
See |indent-expression|. 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 The expression will be evaluated in the |sandbox| when set from a
modeline, see |sandbox-option|. modeline, see |sandbox-option|.
@ -5410,6 +5437,8 @@ A jump table for the options with a short description can be found at |Q_op|.
feature} feature}
The number of milliseconds between polls for MzScheme threads. The number of milliseconds between polls for MzScheme threads.
Negative or zero value means no thread scheduling. 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'*
'nrformats' 'nf' string (default "bin,octal,hex", 'nrformats' 'nf' string (default "bin,octal,hex",
@ -5475,7 +5504,8 @@ A jump table for the options with a short description can be found at |Q_op|.
is set. Thus with the Vim default of 4 there is room for a line number 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. up to 999. When the buffer has 1000 lines five columns will be used.
The minimum value is 1, the maximum value is 10. 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'*
'omnifunc' 'ofu' string (default: empty) 'omnifunc' 'ofu' string (default: empty)
@ -5715,7 +5745,7 @@ A jump table for the options with a short description can be found at |Q_op|.
a Tab. a Tab.
NOTE: When using ">>" multiple times the resulting indent is a mix of NOTE: When using ">>" multiple times the resulting indent is a mix of
tabs and spaces. You might not like this. 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'. Also see 'copyindent'.
Use |:retab| to clean up white space. Use |:retab| to clean up white space.
@ -6453,9 +6483,6 @@ A jump table for the options with a short description can be found at |Q_op|.
"-f" is not inside the quotes, because it is not part of the command "-f" is not inside the quotes, because it is not part of the command
name. And Vim automagically recognizes the backslashes that are path name. And Vim automagically recognizes the backslashes that are path
separators. 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 Under MS-Windows, when the executable ends in ".com" it must be
included. Thus setting the shell to "command.com" or "4dos.com" included. Thus setting the shell to "command.com" or "4dos.com"
works, but "command" and "4dos" do not work for all commands (e.g., works, but "command" and "4dos" do not work for all commands (e.g.,
@ -6475,8 +6502,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Flag passed to the shell to execute "!" and ":!" commands; e.g., Flag passed to the shell to execute "!" and ":!" commands; e.g.,
"bash.exe -c ls" or "command.com /c dir". For the MS-DOS-like "bash.exe -c ls" or "command.com /c dir". For the MS-DOS-like
systems, the default is set according to the value of 'shell', to systems, the default is set according to the value of 'shell', to
reduce the need to set this option by the user. It's not used for reduce the need to set this option by the user.
OS/2 (EMX figures this out itself).
On Unix it can have more than one flag. Each white space separated On Unix it can have more than one flag. Each white space separated
part is passed as an argument to the shell command. part is passed as an argument to the shell command.
See |option-backslash| about including spaces and backslashes. See |option-backslash| about including spaces and backslashes.
@ -6595,6 +6621,8 @@ A jump table for the options with a short description can be found at |Q_op|.
'shelltemp' is off. 'shelltemp' is off.
The `system()` function does not respect this option and always uses The `system()` function does not respect this option and always uses
temp files. temp files.
NOTE: This option is set to the Vim default value when 'compatible'
is reset.
*'shelltype'* *'st'* *'shelltype'* *'st'*
'shelltype' 'st' number (default 0) 'shelltype' 'st' number (default 0)
@ -6911,7 +6939,7 @@ A jump table for the options with a short description can be found at |Q_op|.
mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H. mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H.
When using the ">>" command, lines starting with '#' are not shifted When using the ">>" command, lines starting with '#' are not shifted
right. 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 This option is reset when 'paste' is set and restored when 'paste' is
reset. reset.
@ -7566,6 +7594,8 @@ A jump table for the options with a short description can be found at |Q_op|.
ignore Ignore case ignore Ignore case
match Match case match Match case
smart Ignore case unless an upper case letter is used 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'*
'taglength' 'tl' number (default 0) 'taglength' 'tl' number (default 0)
@ -7712,6 +7742,8 @@ A jump table for the options with a short description can be found at |Q_op|.
compatible terminal. compatible terminal.
If setting this option does not work (produces a colorless UI) If setting this option does not work (produces a colorless UI)
reading |xterm-true-color| might help. reading |xterm-true-color| might help.
Note that the "cterm" attributes are still used, not the "gui" ones.
NOTE: This option is reset when 'compatible' is set.
*'terse'* *'noterse'* *'terse'* *'noterse'*
'terse' boolean (default off) 'terse' boolean (default off)
@ -7787,7 +7819,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'timeout' 'to' boolean (default on) 'timeout' 'to' boolean (default on)
global global
*'ttimeout'* *'nottimeout'* *'ttimeout'* *'nottimeout'*
'ttimeout' boolean (default off, set in |defaults.vim|)) 'ttimeout' boolean (default off, set in |defaults.vim|)
global global
{not in Vi} {not in Vi}
These two options together determine the behavior when part of a These two options together determine the behavior when part of a
@ -7822,7 +7854,7 @@ A jump table for the options with a short description can be found at |Q_op|.
global global
{not in all versions of Vi} {not in all versions of Vi}
*'ttimeoutlen'* *'ttm'* *'ttimeoutlen'* *'ttm'*
'ttimeoutlen' 'ttm' number (default -1, set to 100 in |defaults.vim|)) 'ttimeoutlen' 'ttm' number (default -1, set to 100 in |defaults.vim|)
global global
{not in Vi} {not in Vi}
The time in milliseconds that is waited for a key code or mapped key The time in milliseconds that is waited for a key code or mapped key
@ -8122,6 +8154,7 @@ A jump table for the options with a short description can be found at |Q_op|.
The undo file is not read when 'undoreload' causes the buffer from The undo file is not read when 'undoreload' causes the buffer from
before a reload to be saved for undo. before a reload to be saved for undo.
When 'undofile' is turned off the undo file is NOT deleted. When 'undofile' is turned off the undo file is NOT deleted.
NOTE: This option is reset when 'compatible' is set.
*'undolevels'* *'ul'* *'undolevels'* *'ul'*
'undolevels' 'ul' number (default 100, 1000 for Unix, VMS, 'undolevels' 'ul' number (default 100, 1000 for Unix, VMS,
@ -8377,6 +8410,8 @@ A jump table for the options with a short description can be found at |Q_op|.
This option cannot be set from a |modeline| or in the |sandbox|, for This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons. security reasons.
NOTE: This option is set to the Vim default value when 'compatible'
is reset.
*'virtualedit'* *'ve'* *'virtualedit'* *'ve'*
'virtualedit' 've' string (default "") 'virtualedit' 've' string (default "")
@ -8405,6 +8440,7 @@ A jump table for the options with a short description can be found at |Q_op|.
The `g$` command will move to the end of the screen line. 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 It doesn't make sense to combine "all" with "onemore", but you will
not get a warning for it. not get a warning for it.
NOTE: This option is set to "" when 'compatible' is set.
*'visualbell'* *'vb'* *'novisualbell'* *'novb'* *beep* *'visualbell'* *'vb'* *'novisualbell'* *'novb'* *beep*
'visualbell' 'vb' boolean (default off) 'visualbell' 'vb' boolean (default off)

View File

@ -144,7 +144,7 @@ The default value for $VIM is set at compile time and can be determined with >
:version :version
The normal value is /boot/home/config/share/vim. If you don't like it you can The normal value is /boot/home/config/share/vim. If you don't like it you can
set the VIM environment variable to override this, or set 'helpfile' in your set the Vim environment variable to override this, or set 'helpfile' in your
.vimrc: > .vimrc: >
:if version >= 500 :if version >= 500

View File

@ -1,4 +1,4 @@
*os_mac.txt* For Vim version 8.0. Last change: 2006 Apr 30 *os_mac.txt* For Vim version 8.0. Last change: 2017 Apr 28
VIM REFERENCE MANUAL by Bram Moolenaar et al. VIM REFERENCE MANUAL by Bram Moolenaar et al.
@ -12,11 +12,13 @@ NOTE: This file is a bit outdated. You might find more useful info here:
http://macvim.org/ http://macvim.org/
1. Filename Convention |mac-filename| 1. Filename Convention |mac-filename|
2. .vimrc an .vim files |mac-vimfile| 2. .vimrc and .vim files |mac-vimfile|
3. FAQ |mac-faq| 3. Standard mappings |mac-standard-mappings|
4. Known Lack |mac-lack| 4. FAQ |mac-faq|
5. Mac Bug Report |mac-bug| 5. Known Lack |mac-lack|
6. Compiling Vim |mac-compile| 6. Mac Bug Report |mac-bug|
7. Compiling Vim |mac-compile|
8. The darwin feature |mac-darwin-feature|
There was a Mac port for version 3.0 of Vim. Here are the first few lines There was a Mac port for version 3.0 of Vim. Here are the first few lines
from the old file: from the old file:
@ -72,7 +74,18 @@ the |'nocompatible'| option is set, otherwise it will only handle mac format
files. files.
============================================================================== ==============================================================================
3. Mac FAQ *mac-faq* 3. Standard mappings *mac-standard-mappings*
The following mappings are available for cut/copy/paste from/to clipboard.
key Normal Visual Insert Description ~
Command-v "*P "-d"*P <C-R>* paste text *<D-v>*
Command-c "*y copy Visual text *<D-c>*
Command-x "*d cut Visual text *<D-x>*
Backspace "*d cut Visual text
==============================================================================
4. Mac FAQ *mac-faq*
On the internet: http://macvim.org/OSX/index.php#FAQ On the internet: http://macvim.org/OSX/index.php#FAQ
@ -95,13 +108,13 @@ A: The following trick works with most shells. Put it in your vimrc file.
let $PATH = matchstr(s:path, 'VIMPATH\zs.\{-}\ze\n') let $PATH = matchstr(s:path, 'VIMPATH\zs.\{-}\ze\n')
============================================================================== ==============================================================================
4. Mac Lack *mac-lack* 5. Mac Lack *mac-lack*
In a terminal CTRL-^ needs to be entered as Shift-Control-6. CTRL-@ as In a terminal CTRL-^ needs to be entered as Shift-Control-6. CTRL-@ as
Shift-Control-2. Shift-Control-2.
============================================================================== ==============================================================================
5. Mac Bug Report *mac-bug* 6. Mac Bug Report *mac-bug*
When reporting any Mac specific bug or feature change, please use the vim-mac When reporting any Mac specific bug or feature change, please use the vim-mac
maillist |vim-mac|. However, you need to be subscribed. An alternative is to maillist |vim-mac|. However, you need to be subscribed. An alternative is to
@ -110,9 +123,59 @@ send a message to the current MacVim maintainers:
mac@vim.org mac@vim.org
============================================================================== ==============================================================================
6. Compiling Vim *mac-compile* 7. Compiling Vim *mac-compile*
See the file "src/INSTALLmac.txt" that comes with the source files. See the file "src/INSTALLmac.txt" that comes with the source files.
==============================================================================
8. The Darwin Feature *mac-darwin-feature*
If you have a Mac that isn't very old, you will be running OS X, also called
Darwin. The last pre-Darwin OS was Mac OS 9. The darwin feature makes Vim
use Darwin-specific properties.
What is accomplished with this feature is two-fold:
- Make Vim interoperable with the system clipboard.
- Incorporate into Vim a converter module that bridges the gap between some
character encodings specific to the platform and those known to Vim.
Needless to say, both are not to be missed for any decent text editor to work
nicely with other applications running on the same desktop environment.
As Vim is not an application dedicated only to macOS, we need an extra feature
to add in order for it to offer the same user experience that our users on
other platforms enjoy to people on macOS.
For brevity, the feature is referred to as "darwin" to signify it one of the
Vim features that are specific to that particular platform.
The feature is a configuration option. Accordingly, whether it is enabled or
not is determined at build time; once it is selected to be enabled, it is
compiled in and hence cannot be disabled at runtime.
The feature is enabled by default. For most macOS users, that should be
sufficient unless they have specific needs mentioned briefly below.
If you want to disable it, pass `--disable-darwin` to the configure script: >
./configure --disable-darwin <other options>
and then run `make` to build Vim. The order of the options doesn't matter.
To make sure at runtime whether or not the darwin feature is compiled in, you
can use `has('macunix')` which returns 1 if the feature is compiled in; 0
otherwise.
Notable use cases where `--disable-darwin` is turned out to be useful are:
- When you want to use |x11-selection| instead of the system clipboard.
- When you want to use |x11-clientserver|.
Since both have to make use of X11 inter-client communication for them to work
properly, and since the communication mechanism can come into conflict with
the system clipboard, the darwin feature should be disabled to prevent Vim
from hanging at runtime.
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

View File

@ -539,7 +539,7 @@ More info under :help hardcopy
8.10 Setting up the symbols 8.10 Setting up the symbols
When I use GVIM this way and press CTRL-Y in the parent terminal, gvim exits. When I use gvim this way and press CTRL-Y in the parent terminal, gvim exits.
I now use a different symbol that seems to work OK and fixes the problem. I now use a different symbol that seems to work OK and fixes the problem.
I suggest this instead: > I suggest this instead: >
@ -547,7 +547,7 @@ I suggest this instead: >
The /INPUT=NLA0: separates the standard input of the gvim process from the The /INPUT=NLA0: separates the standard input of the gvim process from the
parent terminal, to block signals from the parent window. parent terminal, to block signals from the parent window.
Without the -GEOMETRY, the GVIM window size will be minimal and the menu Without the -GEOMETRY, the gvim window size will be minimal and the menu
will be confused after a window-resize. will be confused after a window-resize.
(Carlo Mekenkamp, Coen Engelbarts, Vim 6.0ac) (Carlo Mekenkamp, Coen Engelbarts, Vim 6.0ac)
@ -764,14 +764,14 @@ GNU_TOOLS.ZIP package downloadable from http://www.polarhome.com/vim/
9. VMS related changes *vms-changes* 9. VMS related changes *vms-changes*
Version 7.4 Version 7.4
- Undo: VMS can not handle more than one dot in the filenames use "dir/name" -> "dir/_un_name" - Undo: VMS can not handle more than one dot in the filenames use "dir/name" -> "dir/_un_name"
add _un_ at the beginning to keep the extension add _un_ at the beginning to keep the extension
- correct swap file name wildcard handling - correct swap file name wildcard handling
- handle iconv usage correctly - handle iconv usage correctly
- do not optimize on vax - otherwise it hangs compiling crypto files - do not optimize on vax - otherwise it hangs compiling crypto files
- fileio.c fix the comment - fileio.c fix the comment
- correct RealWaitForChar - correct RealWaitForChar
- after 7.4-119 use different functions lib$cvtf_to_internal_time because Alpha and VAX have - after 7.4-119 use different functions lib$cvtf_to_internal_time because Alpha and VAX have
G_FLOAT but IA64 uses IEEE float otherwise Vim crashes G_FLOAT but IA64 uses IEEE float otherwise Vim crashes
- guard against crashes that are caused by mixed filenames - guard against crashes that are caused by mixed filenames

View File

@ -1,4 +1,4 @@
*os_win32.txt* For Vim version 8.0. Last change: 2016 Oct 12 *os_win32.txt* For Vim version 8.0. Last change: 2017 Mar 21
VIM REFERENCE MANUAL by George Reilly VIM REFERENCE MANUAL by George Reilly
@ -135,7 +135,7 @@ you will need to get a version older than that.
6. Running under Windows 3.1 *win32-win3.1* 6. Running under Windows 3.1 *win32-win3.1*
*win32s* *windows-3.1* *gui-w32s* *win32s* *windows-3.1* *gui-w32s*
There was a special version of Gvim that runs under Windows 3.1 and 3.11. There was a special version of gvim that runs under Windows 3.1 and 3.11.
Support was removed in patch 7.4.1363. Support was removed in patch 7.4.1363.
============================================================================== ==============================================================================
@ -212,10 +212,19 @@ A. You can't! This is a limitation of the NT console. NT 5.0 is reported to
be able to set the blink rate for all console windows at the same time. be able to set the blink rate for all console windows at the same time.
*:!start* *:!start*
Q. How can I run an external command or program asynchronously? Q. How can I asynchronously run an external command or program, or open a
A. When using :! to run an external command, you can run it with "start": > document or URL with its default program?
:!start winfile.exe<CR> A. When using :! to run an external command, you can run it with "start". For
< Using "start" stops Vim switching to another screen, opening a new console, example, to run notepad: >
:!start notepad
< To open "image.jpg" with the default image viewer: >
:!start image.jpg
< To open the folder of the current file in Windows Explorer: >
:!start %:h
< To open the Vim home page with the default browser: >
:!start http://www.vim.org/
<
Using "start" stops Vim switching to another screen, opening a new console,
or waiting for the program to complete; it indicates that you are running a or waiting for the program to complete; it indicates that you are running a
program that does not affect the files you are editing. Programs begun program that does not affect the files you are editing. Programs begun
with :!start do not get passed Vim's open file handles, which means they do with :!start do not get passed Vim's open file handles, which means they do

View File

@ -1,4 +1,4 @@
*pattern.txt* For Vim version 8.0. Last change: 2017 Mar 05 *pattern.txt* For Vim version 8.0. Last change: 2017 Mar 29
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -872,8 +872,8 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
inside the Visual area put it at the start and just before the end of inside the Visual area put it at the start and just before the end of
the pattern, e.g.: > the pattern, e.g.: >
/\%Vfoo.*ba\%Vr /\%Vfoo.*ba\%Vr
< This works if "foo bar" (or more) was Visually selected. This: > < This also works if only "foo bar" was Visually selected. This: >
/\%Vfoo.*ba\%Vr /\%Vfoo.*bar\%V
< would match "foo bar" if the Visual selection continues after the "r". < would match "foo bar" if the Visual selection continues after the "r".
Only works for the current buffer. Only works for the current buffer.
@ -1085,25 +1085,27 @@ x A single character, with no special meaning, matches itself
- A character class expression is evaluated to the set of characters - A character class expression is evaluated to the set of characters
belonging to that character class. The following character classes belonging to that character class. The following character classes
are supported: are supported:
Name Contents ~ Name Func Contents ~
*[:alnum:]* [:alnum:] ASCII letters and digits *[:alnum:]* [:alnum:] isalnum ASCII letters and digits
*[:alpha:]* [:alpha:] ASCII letters *[:alpha:]* [:alpha:] isalpha ASCII letters
*[:blank:]* [:blank:] space and tab characters *[:blank:]* [:blank:] space and tab
*[:cntrl:]* [:cntrl:] control characters *[:cntrl:]* [:cntrl:] iscntrl ASCII control characters
*[:digit:]* [:digit:] decimal digits *[:digit:]* [:digit:] decimal digits '0' to '9'
*[:graph:]* [:graph:] printable characters excluding space *[:graph:]* [:graph:] isgraph ASCII printable characters excluding
*[:lower:]* [:lower:] lowercase letters (all letters when space
*[:lower:]* [:lower:] (1) lowercase letters (all letters when
'ignorecase' is used) 'ignorecase' is used)
*[:print:]* [:print:] printable characters including space *[:print:]* [:print:] (2) printable characters including space
*[:punct:]* [:punct:] ASCII punctuation characters *[:punct:]* [:punct:] ispunct ASCII punctuation characters
*[:space:]* [:space:] whitespace characters *[:space:]* [:space:] whitespace characters: space, tab, CR,
*[:upper:]* [:upper:] uppercase letters (all letters when NL, vertical tab, form feed
*[:upper:]* [:upper:] (3) uppercase letters (all letters when
'ignorecase' is used) 'ignorecase' is used)
*[:xdigit:]* [:xdigit:] hexadecimal digits *[:xdigit:]* [:xdigit:] hexadecimal digits: 0-9, a-f, A-F
*[:return:]* [:return:] the <CR> character *[:return:]* [:return:] the <CR> character
*[:tab:]* [:tab:] the <Tab> character *[:tab:]* [:tab:] the <Tab> character
*[:escape:]* [:escape:] the <Esc> character *[:escape:]* [:escape:] the <Esc> character
*[:backspace:]* [:backspace:] the <BS> character *[:backspace:]* [:backspace:] the <BS> character
The brackets in character class expressions are additional to the The brackets in character class expressions are additional to the
brackets delimiting a collection. For example, the following is a brackets delimiting a collection. For example, the following is a
plausible pattern for a UNIX filename: "[-./[:alnum:]_~]\+" That is, plausible pattern for a UNIX filename: "[-./[:alnum:]_~]\+" That is,
@ -1114,6 +1116,13 @@ x A single character, with no special meaning, matches itself
regexp engine. See |two-engines|. In the future these items may regexp engine. See |two-engines|. In the future these items may
work for multi-byte characters. For now, to get all "alpha" work for multi-byte characters. For now, to get all "alpha"
characters you can use: [[:lower:][:upper:]]. characters you can use: [[:lower:][:upper:]].
The "Func" column shows what library function is used. The
implementation depends on the system. Otherwise:
(1) Uses islower() for ASCII and Vim builtin rules for other
characters when built with the |+multi_byte| feature.
(2) Uses Vim builtin rules
(3) As with (1) but using isupper()
*/[[=* *[==]* */[[=* *[==]*
- An equivalence class. This means that characters are matched that - An equivalence class. This means that characters are matched that
have almost the same meaning, e.g., when ignoring accents. This have almost the same meaning, e.g., when ignoring accents. This

View File

@ -9,7 +9,7 @@ Copyright: (c) 2004-2012 by Charles E. Campbell *glvs-copyright*
The VIM LICENSE (see |copyright|) applies to the files in this The VIM LICENSE (see |copyright|) applies to the files in this
package, including getscriptPlugin.vim, getscript.vim, package, including getscriptPlugin.vim, getscript.vim,
GetLatestVimScripts.dist, and pi_getscript.txt, except use "getscript" GetLatestVimScripts.dist, and pi_getscript.txt, except use "getscript"
instead of "VIM". Like anything else that's free, getscript and its instead of "Vim". Like anything else that's free, getscript and its
associated files are provided *as is* and comes with no warranty of associated files are provided *as is* and comes with no warranty of
any kind, either expressed or implied. No guarantees of any kind, either expressed or implied. No guarantees of
merchantability. No guarantees of suitability for any purpose. By merchantability. No guarantees of suitability for any purpose. By
@ -68,7 +68,7 @@ Your computer needs to have wget or curl for GetLatestVimScripts to do its work.
mv GetLatestVimScripts.dist GetLatestVimScripts.dat mv GetLatestVimScripts.dist GetLatestVimScripts.dat
(edit GetLatestVimScripts.dat to install your own personal (edit GetLatestVimScripts.dat to install your own personal
list of desired plugins -- see |GetLatestVimScripts_dat|) list of desired plugins -- see |GetLatestVimScripts_dat|)
3. Windows: 3. Windows:
vim getscript.vba vim getscript.vba
:so % :so %

View File

@ -99,25 +99,25 @@ If the option is empty, then vim will use the system default printer for
HPUX: hp-roman8, HPUX: hp-roman8,
EBCDIC: ebcdic-uk) EBCDIC: ebcdic-uk)
global global
Sets the character encoding used when printing. This option tells VIM which Sets the character encoding used when printing. This option tells Vim which
print character encoding file from the "print" directory in 'runtimepath' to print character encoding file from the "print" directory in 'runtimepath' to
use. use.
This option will accept any value from |encoding-names|. Any recognized names This option will accept any value from |encoding-names|. Any recognized names
are converted to VIM standard names - see 'encoding' for more details. Names are converted to Vim standard names - see 'encoding' for more details. Names
not recognized by VIM will just be converted to lower case and underscores not recognized by Vim will just be converted to lower case and underscores
replaced with '-' signs. replaced with '-' signs.
If 'printencoding' is empty or VIM cannot find the file then it will use If 'printencoding' is empty or Vim cannot find the file then it will use
'encoding' (if VIM is compiled with |+multi_byte| and it is set an 8-bit 'encoding' (if Vim is compiled with |+multi_byte| and it is set an 8-bit
encoding) to find the print character encoding file. If VIM is unable to find encoding) to find the print character encoding file. If Vim is unable to find
a character encoding file then it will use the "latin1" print character a character encoding file then it will use the "latin1" print character
encoding file. encoding file.
When 'encoding' is set to a multi-byte encoding, VIM will try to convert When 'encoding' is set to a multi-byte encoding, Vim will try to convert
characters to the printing encoding for printing (if 'printencoding' is empty characters to the printing encoding for printing (if 'printencoding' is empty
then the conversion will be to latin1). Conversion to a printing encoding then the conversion will be to latin1). Conversion to a printing encoding
other than latin1 will require VIM to be compiled with the |+iconv| feature. other than latin1 will require Vim to be compiled with the |+iconv| feature.
If no conversion is possible then printing will fail. Any characters that If no conversion is possible then printing will fail. Any characters that
cannot be converted will be replaced with upside down question marks. cannot be converted will be replaced with upside down question marks.
@ -203,7 +203,7 @@ header is used when this option is empty.
'printmbcharset' 'pmbcs' string (default "") 'printmbcharset' 'pmbcs' string (default "")
global global
Sets the CJK character set to be used when generating CJK output from Sets the CJK character set to be used when generating CJK output from
|:hardcopy|. The following predefined values are currently recognised by VIM: |:hardcopy|. The following predefined values are currently recognised by Vim:
Value Description ~ Value Description ~
Chinese GB_2312-80 Chinese GB_2312-80
@ -270,7 +270,7 @@ Japanese text you would do the following; >
If 'printmbcharset' is not one of the above values then it is assumed to If 'printmbcharset' is not one of the above values then it is assumed to
specify a custom multi-byte character set and no check will be made that it is specify a custom multi-byte character set and no check will be made that it is
compatible with the value for 'printencoding'. VIM will look for a file compatible with the value for 'printencoding'. Vim will look for a file
defining the character set in the "print" directory in 'runtimepath'. defining the character set in the "print" directory in 'runtimepath'.
*pmbfn-option* *pmbfn-option*
@ -420,10 +420,10 @@ There are currently a number of limitations with PostScript printing:
possible to get all the characters in an encoding to print by installing a possible to get all the characters in an encoding to print by installing a
new version of the Courier font family. new version of the Courier font family.
- Multi-byte support - Currently VIM will try to convert multi-byte characters - Multi-byte support - Currently Vim will try to convert multi-byte characters
to the 8-bit encoding specified by 'printencoding' (or latin1 if it is to the 8-bit encoding specified by 'printencoding' (or latin1 if it is
empty). Any characters that are not successfully converted are shown as empty). Any characters that are not successfully converted are shown as
unknown characters. Printing will fail if VIM cannot convert the multi-byte unknown characters. Printing will fail if Vim cannot convert the multi-byte
to the 8-bit encoding. to the 8-bit encoding.
============================================================================== ==============================================================================
@ -434,11 +434,11 @@ you need to define your own PostScript font encoding vector. Details on how
to define a font encoding vector is beyond the scope of this help file, but to define a font encoding vector is beyond the scope of this help file, but
you can find details in the PostScript Language Reference Manual, 3rd Edition, you can find details in the PostScript Language Reference Manual, 3rd Edition,
published by Addison-Wesley and available in PDF form at published by Addison-Wesley and available in PDF form at
http://www.adobe.com/. The following describes what you need to do for VIM to http://www.adobe.com/. The following describes what you need to do for Vim to
locate and use your print character encoding. locate and use your print character encoding.
i. Decide on a unique name for your encoding vector, one that does not clash i. Decide on a unique name for your encoding vector, one that does not clash
with any of the recognized or standard encoding names that VIM uses (see with any of the recognized or standard encoding names that Vim uses (see
|encoding-names| for a list), and that no one else is likely to use. |encoding-names| for a list), and that no one else is likely to use.
ii. Copy $VIMRUNTIME/print/latin1.ps to the print subdirectory in your ii. Copy $VIMRUNTIME/print/latin1.ps to the print subdirectory in your
'runtimepath' and rename it with your unique name. 'runtimepath' and rename it with your unique name.
@ -446,23 +446,23 @@ iii. Edit your renamed copy of latin1.ps, replacing all occurrences of latin1
with your unique name (don't forget the line starting %%Title:), and with your unique name (don't forget the line starting %%Title:), and
modify the array of glyph names to define your new encoding vector. The modify the array of glyph names to define your new encoding vector. The
array must have exactly 256 entries or you will not be able to print! array must have exactly 256 entries or you will not be able to print!
iv. Within VIM, set 'printencoding' to your unique encoding name and then iv. Within Vim, set 'printencoding' to your unique encoding name and then
print your file. VIM will now use your custom print character encoding. print your file. Vim will now use your custom print character encoding.
VIM will report an error with the resource file if you change the order or Vim will report an error with the resource file if you change the order or
content of the first 3 lines, other than the name of the encoding on the line content of the first 3 lines, other than the name of the encoding on the line
starting %%Title: or the version number on the line starting %%Version:. starting %%Title: or the version number on the line starting %%Version:.
[Technical explanation for those that know PostScript - VIM looks for a file [Technical explanation for those that know PostScript - Vim looks for a file
with the same name as the encoding it will use when printing. The file with the same name as the encoding it will use when printing. The file
defines a new PostScript Encoding resource called /VIM-name, where name is the defines a new PostScript Encoding resource called /VIM-name, where name is the
print character encoding VIM will use.] print character encoding Vim will use.]
============================================================================== ==============================================================================
5. PostScript CJK Printing *postscript-cjk-printing* 5. PostScript CJK Printing *postscript-cjk-printing*
*E673* *E674* *E675* *E673* *E674* *E675*
VIM supports printing of Chinese, Japanese, and Korean files. Setting up VIM Vim supports printing of Chinese, Japanese, and Korean files. Setting up Vim
to correctly print CJK files requires setting up a few more options. to correctly print CJK files requires setting up a few more options.
Each of these countries has many standard character sets and encodings which Each of these countries has many standard character sets and encodings which
@ -483,7 +483,7 @@ option allows you to specify different fonts to use when printing characters
which are syntax highlighted with the font styles normal, italic, bold and which are syntax highlighted with the font styles normal, italic, bold and
bold-italic. bold-italic.
No CJK fonts are supplied with VIM. There are some free Korean, Japanese, and No CJK fonts are supplied with Vim. There are some free Korean, Japanese, and
Traditional Chinese fonts available at: Traditional Chinese fonts available at:
http://examples.oreilly.com/cjkvinfo/adobe/samples/ http://examples.oreilly.com/cjkvinfo/adobe/samples/
@ -498,7 +498,7 @@ CJK fonts can be large containing several thousand glyphs, and it is not
uncommon to find that they only contain a subset of a national standard. It uncommon to find that they only contain a subset of a national standard. It
is not unusual to find the fonts to not include characters for codes in the is not unusual to find the fonts to not include characters for codes in the
ASCII code range. If you find half-width Roman characters are not appearing ASCII code range. If you find half-width Roman characters are not appearing
in your printout then you should configure VIM to use the Courier font the in your printout then you should configure Vim to use the Courier font the
half-width ASCII characters with 'printmbfont'. If your font does not include half-width ASCII characters with 'printmbfont'. If your font does not include
other characters then you will need to find another font that does. other characters then you will need to find another font that does.
@ -506,7 +506,7 @@ Another issue with ASCII characters, is that the various national character
sets specify a couple of different glyphs in the ASCII code range. If you sets specify a couple of different glyphs in the ASCII code range. If you
print ASCII text using the national character set you may see some unexpected print ASCII text using the national character set you may see some unexpected
characters. If you want true ASCII code printing then you need to configure characters. If you want true ASCII code printing then you need to configure
VIM to output ASCII characters for the ASCII code range with 'printmbfont'. Vim to output ASCII characters for the ASCII code range with 'printmbfont'.
It is possible to define your own multi-byte character set although this It is possible to define your own multi-byte character set although this
should not be attempted lightly. A discussion on the process if beyond the should not be attempted lightly. A discussion on the process if beyond the
@ -525,13 +525,13 @@ print job completing.
There are a number of possible causes as to why the printing may have failed: There are a number of possible causes as to why the printing may have failed:
- Wrong version of the prolog resource file. The prolog resource file - Wrong version of the prolog resource file. The prolog resource file
contains some PostScript that VIM needs to be able to print. Each version contains some PostScript that Vim needs to be able to print. Each version
of VIM needs one particular version. Make sure you have correctly installed of Vim needs one particular version. Make sure you have correctly installed
the runtime files, and don't have any old versions of a file called prolog the runtime files, and don't have any old versions of a file called prolog
in the print directory in your 'runtimepath' directory. in the print directory in your 'runtimepath' directory.
- Paper size. Some PostScript printers will abort printing a file if they do - Paper size. Some PostScript printers will abort printing a file if they do
not support the requested paper size. By default VIM uses A4 paper. Find not support the requested paper size. By default Vim uses A4 paper. Find
out what size paper your printer normally uses and set the appropriate paper out what size paper your printer normally uses and set the appropriate paper
size with 'printoptions'. If you cannot find the name of the paper used, size with 'printoptions'. If you cannot find the name of the paper used,
measure a sheet and compare it with the table of supported paper sizes listed measure a sheet and compare it with the table of supported paper sizes listed
@ -668,7 +668,7 @@ complex print document creation.
N-UP PRINTING N-UP PRINTING
The psnup utility takes an existing PostScript file generated from VIM and The psnup utility takes an existing PostScript file generated from Vim and
convert it to an n-up version. The simplest way to create a 2-up printout is convert it to an n-up version. The simplest way to create a 2-up printout is
to first create a PostScript file with: > to first create a PostScript file with: >
@ -724,16 +724,16 @@ There are a couple of points to bear in mind:
============================================================================== ==============================================================================
8. Formfeed Characters *printing-formfeed* 8. Formfeed Characters *printing-formfeed*
By default VIM does not do any special processing of |formfeed| control By default Vim does not do any special processing of |formfeed| control
characters. Setting the 'printoptions' formfeed item will make VIM recognize characters. Setting the 'printoptions' formfeed item will make Vim recognize
formfeed characters and continue printing the current line at the beginning formfeed characters and continue printing the current line at the beginning
of the first line on a new page. The use of formfeed characters provides of the first line on a new page. The use of formfeed characters provides
rudimentary print control but there are certain things to be aware of. rudimentary print control but there are certain things to be aware of.
VIM will always start printing a line (including a line number if enabled) Vim will always start printing a line (including a line number if enabled)
containing a formfeed character, even if it is the first character on the containing a formfeed character, even if it is the first character on the
line. This means if a line starting with a formfeed character is the first line. This means if a line starting with a formfeed character is the first
line of a page then VIM will print a blank page. line of a page then Vim will print a blank page.
Since the line number is printed at the start of printing the line containing Since the line number is printed at the start of printing the line containing
the formfeed character, the remainder of the line printed on the new page the formfeed character, the remainder of the line printed on the new page
@ -742,7 +742,7 @@ lines of a long line when wrap in 'printoptions' is enabled).
If the formfeed character is the last character on a line, then printing will If the formfeed character is the last character on a line, then printing will
continue on the second line of the new page, not the first. This is due to continue on the second line of the new page, not the first. This is due to
VIM processing the end of the line after the formfeed character and moving Vim processing the end of the line after the formfeed character and moving
down a line to continue printing. down a line to continue printing.
Due to the points made above it is recommended that when formfeed character Due to the points made above it is recommended that when formfeed character

View File

@ -1,4 +1,4 @@
*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 VIM REFERENCE MANUAL by Bram Moolenaar
@ -45,10 +45,13 @@ The 'errorformat' option should be set to match the error messages from your
compiler (see |errorformat| below). compiler (see |errorformat| below).
*location-list* *E776* *location-list* *E776*
A location list is similar to a quickfix list and contains a list of positions A location list is a window-local quickfix list. You get one after commands
in files. A location list is associated with a window and each window can like `:lvimgrep`, `:lgrep`, `:lhelpgrep`, `:lmake`, etc., which create a
have a separate location list. A location list can be associated with only location list instead of a quickfix list as the corresponding `:vimgrep`,
one window. The location list is independent of the quickfix list. `: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 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, location list. When there are no longer any references to a location list,

View File

@ -63,53 +63,53 @@ versions of 'emacs' in the late 1970's and was relieved by finding 'vi' in the
first UNIX I came across in 1983). In my opinion, it's about time 'VIM' first UNIX I came across in 1983). In my opinion, it's about time 'VIM'
replace 'emacs' as the standard for top editors. (Bo Thide', Sweden) replace 'emacs' as the standard for top editors. (Bo Thide', Sweden)
I love and use VIM heavily too. (Larry Wall) I love and use Vim heavily too. (Larry Wall)
Vi is like a Ferrari, if you're a beginner, it handles like a bitch, but once Vi is like a Ferrari, if you're a beginner, it handles like a bitch, but once
you get the hang of it, it's small, powerful and FAST! (Unknown) you get the hang of it, it's small, powerful and FAST! (Unknown)
VIM is like a new model Ferrari, and sounds like one too - "VIIIIIIMMM!" Vim is like a new model Ferrari, and sounds like one too - "VIIIIIIMMM!"
(Stephen Riehm, Germany) (Stephen Riehm, Germany)
Schon bei Nutzung eines Bruchteils der VIM-Funktionen wird der Benutzer recht Schon bei Nutzung eines Bruchteils der Vim-Funktionen wird der Benutzer recht
schnell die Vorzuege dieses Editors kennen- und schaetzenlernen. schnell die Vorzuege dieses Editors kennen- und schaetzenlernen.
Translated: Even when only using a fraction of VIM-functions, the user will Translated: Even when only using a fraction of Vim-functions, the user will
quickly get used to and appreciate the advantages of this editor. (Garry quickly get used to and appreciate the advantages of this editor. (Garry
Glendown, conclusion of an article on VIM in iX magazine 9/1998) Glendown, conclusion of an article on Vim in iX magazine 9/1998)
I've recently acquired the O'Reilly book on VI (it also discusses VIM I've recently acquired the O'Reilly book on Vi (it also discusses Vim
in-depth), and I'm amazed at just how powerful this application is. (Jeffrey in-depth), and I'm amazed at just how powerful this application is. (Jeffrey
Rankin) Rankin)
This guide was written using the Windows 9.x distribution of GVIM, which is This guide was written using the Windows 9.x distribution of gvim, which is
quite possibly the greatest thing to come along since God created the naked quite possibly the greatest thing to come along since God created the naked
girl. (Michael DiBernardo) girl. (Michael DiBernardo)
Boy, I thought I knew almost everything about VIM, but every time I browse the Boy, I thought I knew almost everything about Vim, but every time I browse the
online documentation, I hit upon a minor but cool aspect of a VIM feature that online documentation, I hit upon a minor but cool aspect of a Vim feature that
I didn't know before! I must say the documentation is one the finest I've I didn't know before! I must say the documentation is one the finest I've
ever seen in a product -- even better than most commercial products. ever seen in a product -- even better than most commercial products.
(Gautam Mudunuri) (Gautam Mudunuri)
VIM 4.5 is really a fantastic editor. It has sooooo many features and more Vim 4.5 is really a fantastic editor. It has sooooo many features and more
importantly, the defaults are so well thought out that you really don't have importantly, the defaults are so well thought out that you really don't have
to change anything!! Words cannot express my amazement and gratitude to the to change anything!! Words cannot express my amazement and gratitude to the
creators of VIM. Keep it up. (Vikas, USA) creators of Vim. Keep it up. (Vikas, USA)
I wonder how long it will be before people will refer to other Vi editors as I wonder how long it will be before people will refer to other Vi editors as
VIM clones? (Darren Hiebert) Vim clones? (Darren Hiebert)
I read about [auto-positioning-in-file-based-on-the-errors-from-make] in one I read about [auto-positioning-in-file-based-on-the-errors-from-make] in one
of those "Perfect Programmer's Editor" threads and was delighted to discover of those "Perfect Programmer's Editor" threads and was delighted to discover
that VIM already supports it. (Brendan Macmillan, Australia) that Vim already supports it. (Brendan Macmillan, Australia)
I just discovered VIM (5.0) and I'm telling everyone I know about it! I just discovered Vim (5.0) and I'm telling everyone I know about it!
I tell them VIM stands for VI for the new (M)illenium. Thanks so much! I tell them Vim stands for Vi for the new (M)illenium. Thanks so much!
(Matt F. Valentine) (Matt F. Valentine)
I think from now on "vi" should be called "Vim Imitation", not the other way I think from now on "vi" should be called "Vim Imitation", not the other way
around. (Rungun Ramanathan) around. (Rungun Ramanathan)
The Law of VIM: The Law of Vim:
For each member b of the possible behaviour space B of program P, there exists For each member b of the possible behaviour space B of program P, there exists
a finite time t before which at least one user u in the total user space U of a finite time t before which at least one user u in the total user space U of
program P will request b becomes a member of the allowed behaviour space B' program P will request b becomes a member of the allowed behaviour space B'
@ -118,42 +118,42 @@ In other words: Sooner or later everyone wants everything as an option.
(Negri) (Negri)
Whenever I move to a new computing platform, the first thing I do is to port Whenever I move to a new computing platform, the first thing I do is to port
VIM. Lately, I am simply stunned by its ease of compilation using the Vim. Lately, I am simply stunned by its ease of compilation using the
configure facility. (A.M. Sabuncu, Turkey) configure facility. (A.M. Sabuncu, Turkey)
The options are really excellent and very powerful. (Anish Maharaj) The options are really excellent and very powerful. (Anish Maharaj)
The Spring user-interface designs are in, and word from the boutiques is that The Spring user-interface designs are in, and word from the boutiques is that
80x24 text-only mode is back with a *vengeance! Vi editor clone VIM burst onto 80x24 text-only mode is back with a *vengeance! Vi editor clone Vim burst onto
March desk-tops with a dazzling show of pastel syntax highlights for its 5.0 March desk-tops with a dazzling show of pastel syntax highlights for its 5.0
look. Strident and customizable, VIM raises eyebrows with its interpretation look. Strident and customizable, Vim raises eyebrows with its interpretation
of the classic Vi single-key macro collection. of the classic Vi single-key macro collection.
http://www.ntk.net/index.cgi?back=archive98/now0327.txt&line=179#l http://www.ntk.net/index.cgi?back=archive98/now0327.txt&line=179#l
I just wanted to take this opportunity to let you know that VIM 5 ROCKS! I just wanted to take this opportunity to let you know that Vim 5 ROCKS!
Syntax highlighting: how did I survive without it?! Thank you for creating Syntax highlighting: how did I survive without it?! Thank you for creating
mankind's best editor! (Mun Johl, USA) mankind's best editor! (Mun Johl, USA)
Thanks again for VIM. I use it every day on Linux. (Eric Foster-Johnson, Thanks again for Vim. I use it every day on Linux. (Eric Foster-Johnson,
author of the book "UNIX Programming Tools") author of the book "UNIX Programming Tools")
The BEST EDITOR EVER (Stuart Woolford) The BEST EDITOR EVER (Stuart Woolford)
I have used most of VIM's fancy features at least once, many frequently, and I I have used most of Vim's fancy features at least once, many frequently, and I
can honestly say that I couldn't live with anything less anymore. My can honestly say that I couldn't live with anything less anymore. My
productivity has easily doubled compared to what it was when I used vi. productivity has easily doubled compared to what it was when I used vi.
(Sitaram Chamarty) (Sitaram Chamarty)
I luv VIM. It is incredible. I'm naming my first-born Vimberly. (Jose I luv Vim. It is incredible. I'm naming my first-born Vimberly. (Jose
Unpingco, USA) Unpingco, USA)
Hint: "VIM" is "vi improved" - much better! (Sven Guckes, Germany) Hint: "Vim" is "vi improved" - much better! (Sven Guckes, Germany)
I use VIM every day. I spend more time in VIM than in any other program... I use Vim every day. I spend more time in Vim than in any other program...
It's the best vi clone there is. I think it's great. (Craig Sanders, It's the best vi clone there is. I think it's great. (Craig Sanders,
Australia) Australia)
I strongly advise using VIM--its infinite undo/redo saved me much grief. I strongly advise using Vim--its infinite undo/redo saved me much grief.
(Terry Brown) (Terry Brown)
Thanks very much for writing what in my opinion is the finest text editor on Thanks very much for writing what in my opinion is the finest text editor on
@ -163,98 +163,98 @@ the planet. If I were to get another cat, I would name it "Vim".
I typed :set all and the screen FILLED up with options. A whole screen of I typed :set all and the screen FILLED up with options. A whole screen of
things to be set and unset. I saw some of my old friends like wrapmargin, things to be set and unset. I saw some of my old friends like wrapmargin,
modelines and showmode, but the screen was FILLED with new friends! I love modelines and showmode, but the screen was FILLED with new friends! I love
them all! I love VIM! I'm so happy that I've found this editor! I feel them all! I love Vim! I'm so happy that I've found this editor! I feel
like how I once felt when I started using vi after a couple of years of using like how I once felt when I started using vi after a couple of years of using
ed. I never thought I'd forsake my beloved ed, but vi ... oh god, vi was ed. I never thought I'd forsake my beloved ed, but vi ... oh god, vi was
great. And now, VIM. (Peter Jay Salzman, USA) great. And now, Vim. (Peter Jay Salzman, USA)
I am really happy with such a wonderful software package. Much better than I am really happy with such a wonderful software package. Much better than
almost any expensive, off the shelf program. (Jeff Walker) almost any expensive, off the shelf program. (Jeff Walker)
Whenever I reread the VIM documentation I'm overcome with excitement at the Whenever I reread the Vim documentation I'm overcome with excitement at the
power of the editor. (William Edward Webber, Australia) power of the editor. (William Edward Webber, Australia)
Hurrah for VIM!! It is "at your fingertips" like vi, and has the extensions Hurrah for Vim!! It is "at your fingertips" like vi, and has the extensions
that vi sorely needs: highlighting for executing commands on blocks, an easily that vi sorely needs: highlighting for executing commands on blocks, an easily
navigable and digestible help screen, and more. (Paul Pax) navigable and digestible help screen, and more. (Paul Pax)
The reason WHY I don't have this amazingly useful macro anymore, is that I The reason WHY I don't have this amazingly useful macro anymore, is that I
now use VIM - and this is built in!! (Stephen Riehm, Germany) now use Vim - and this is built in!! (Stephen Riehm, Germany)
I am a user of VIM and I love it. I use it to do all my programming, C, I am a user of Vim and I love it. I use it to do all my programming, C,
C++, HTML what ever. (Tim Allwine) C++, HTML what ever. (Tim Allwine)
I discovered VIM after years of struggling with the original vi, and I just I discovered Vim after years of struggling with the original vi, and I just
can't live without it anymore. (Emmanuel Mogenet, USA) can't live without it anymore. (Emmanuel Mogenet, USA)
Emacs has not a bit of chance to survive so long as VIM is around. Besides, Emacs has not a bit of chance to survive so long as Vim is around. Besides,
it also has the most detailed software documentation I have ever seen---much it also has the most detailed software documentation I have ever seen---much
better than most commercial software! (Leiming Qian) better than most commercial software! (Leiming Qian)
This version of VIM will just blow people apart when they discover just how This version of Vim will just blow people apart when they discover just how
fantastic it is! (Tony Nugent, Australia) fantastic it is! (Tony Nugent, Australia)
I took your advice & finally got VIM & I'm really impressed. Instant convert. I took your advice & finally got Vim & I'm really impressed. Instant convert.
(Patrick Killelea, USA) (Patrick Killelea, USA)
VIM is by far my favorite piece of shareware and I have been particularly Vim is by far my favorite piece of shareware and I have been particularly
pleased with version 3.0. This is really a solid piece of work. (Robert pleased with version 3.0. This is really a solid piece of work. (Robert
Colon, USA) Colon, USA)
VIM is a joy to use, it is so well thought and practical that I wonder why Vim is a joy to use, it is so well thought and practical that I wonder why
anybody would use visual development tools. VIM is powerful and elegant, it anybody would use visual development tools. Vim is powerful and elegant, it
looks deceptively simple but is almost as complex as a 747 (especially when I looks deceptively simple but is almost as complex as a 747 (especially when I
look at my growing .vimrc), keep up that wonderful job, VIM is a centerpiece look at my growing .vimrc), keep up that wonderful job, Vim is a centerpiece
of the free software world. (Louis-David Mitterand, USA) of the free software world. (Louis-David Mitterand, USA)
I cannot believe how great it is to use VIM. I think the guys at work are I cannot believe how great it is to use Vim. I think the guys at work are
getting tired of hearing me bragging about it. Others eyes are lighting up. getting tired of hearing me bragging about it. Others eyes are lighting up.
(Rick Croote) (Rick Croote)
Emacs takes way too much time to start up and run, it is too big and bulky for Emacs takes way too much time to start up and run, it is too big and bulky for
effective use and the interface is more confusing than it is of any help. VIM effective use and the interface is more confusing than it is of any help. Vim
however is short, it is fast, it is powerful, it has a good interface and it however is short, it is fast, it is powerful, it has a good interface and it
is all purpose. (Paal Ditlefsen Ekran) is all purpose. (Paal Ditlefsen Ekran)
From the first time I got VIM3.0, I was very enthusiastic. It has almost no From the first time I got Vim3.0, I was very enthusiastic. It has almost no
problems. The swapfile handling and the backup possibilities are robust, also problems. The swapfile handling and the backup possibilities are robust, also
the protection against editing one file twice. It is very compatible to the the protection against editing one file twice. It is very compatible to the
real VI (and that is a MUST, because my brain is trained over years in using real VI (and that is a MUST, because my brain is trained over years in using
it). (Gert van Antwerpen, Holland) it). (Gert van Antwerpen, Holland)
Visual mode in VIM is a very powerful thing! (Tony Nugent, Australia) Visual mode in Vim is a very powerful thing! (Tony Nugent, Australia)
I have to say that VIM is =THE= single greatest piece of source code to ever I have to say that Vim is =THE= single greatest piece of source code to ever
come across the net (Jim Battle, USA). come across the net (Jim Battle, USA).
In fact, if you do want to get a new vi I'd suggest VIM-3.0. This is, by In fact, if you do want to get a new vi I'd suggest Vim-3.0. This is, by
far, the best version of vi I've ever seen (Albert W. Schueller). far, the best version of vi I've ever seen (Albert W. Schueller).
I should mention that VIM is a very good editor and can compete with anything I should mention that Vim is a very good editor and can compete with anything
(Ilya Beloozerov). (Ilya Beloozerov).
To tell the truth sometimes I used elvis, vile, xvi, calvin, etc. And this is To tell the truth sometimes I used elvis, vile, xvi, calvin, etc. And this is
the reason that I can state that VIM is the best! (Ferenc Deak, Hungary) the reason that I can state that Vim is the best! (Ferenc Deak, Hungary)
VIM is by far the best editor that I have used in a long time, and I have Vim is by far the best editor that I have used in a long time, and I have
looked at just about every thing that is available for every platform that I looked at just about every thing that is available for every platform that I
use. VIM is the best on all of them. (Guy L. Oliver) use. Vim is the best on all of them. (Guy L. Oliver)
VIM is the greatest editor since the stone chisel. (Jose Unpingco, USA) Vim is the greatest editor since the stone chisel. (Jose Unpingco, USA)
I would like to say that with VIM I am finally making the 'emacs to vi' I would like to say that with Vim I am finally making the 'emacs to vi'
transition - as an Editor it is so much better in many ways: keyboard layout, transition - as an Editor it is so much better in many ways: keyboard layout,
memory usage, text alteration to name 3. (Mark Adam) memory usage, text alteration to name 3. (Mark Adam)
In fact, now if I want to know what a particular setting does in vi, I fire up In fact, now if I want to know what a particular setting does in vi, I fire up
VIM and check out its help! (Nikhil Patel, USA) Vim and check out its help! (Nikhil Patel, USA)
As a vi user, VIM has made working with text a far more pleasant task than As a vi user, Vim has made working with text a far more pleasant task than
before I encountered this program. (Steinar Knutsen, Norway) before I encountered this program. (Steinar Knutsen, Norway)
I use VIM since version 3.0. Since that time, it is the ONLY editor I use, I use Vim since version 3.0. Since that time, it is the ONLY editor I use,
with Solaris, Linux and OS/2 Warp. I suggest all my friends to use VIM, they with Solaris, Linux and OS/2 Warp. I suggest all my friends to use Vim, they
try, and they continue using it. VIM is really the best software I have ever try, and they continue using it. Vim is really the best software I have ever
downloaded from the Internet, and the best editor I know of. (Marco downloaded from the Internet, and the best editor I know of. (Marco
Eccettuato, Italy) Eccettuato, Italy)

View File

@ -1,4 +1,4 @@
*remote.txt* For Vim version 8.0. Last change: 2015 Mar 01 *remote.txt* For Vim version 8.0. Last change: 2017 Mar 18
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -149,6 +149,7 @@ the description in |eval.txt| or use CTRL-] on the function name to jump to
the full explanation. the full explanation.
synopsis explanation ~ synopsis explanation ~
remote_startserver( name) run a server
remote_expr( server, string, idvar) send expression remote_expr( server, string, idvar) send expression
remote_send( server, string, idvar) send key sequence remote_send( server, string, idvar) send key sequence
serverlist() get a list of available servers serverlist() get a list of available servers

View File

@ -1,4 +1,4 @@
*repeat.txt* For Vim version 8.0. Last change: 2017 Feb 06 *repeat.txt* For Vim version 8.0. Last change: 2017 Jun 10
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -46,7 +46,7 @@ of area is used, see |visual-repeat|.
============================================================================== ==============================================================================
2. Multiple repeats *multi-repeat* 2. Multiple repeats *multi-repeat*
*:g* *:global* *E147* *E148* *:g* *:global* *E148*
:[range]g[lobal]/{pattern}/[cmd] :[range]g[lobal]/{pattern}/[cmd]
Execute the Ex command [cmd] (default ":p") on the Execute the Ex command [cmd] (default ":p") on the
lines within [range] where {pattern} matches. lines within [range] where {pattern} matches.
@ -79,8 +79,15 @@ The default for [range] is the whole buffer (1,$). Use "CTRL-C" to interrupt
the command. If an error message is given for a line, the command for that the command. If an error message is given for a line, the command for that
line is aborted and the global command continues with the next marked or line is aborted and the global command continues with the next marked or
unmarked line. unmarked line.
*E147*
When the command is used recursively, it only works on one line. Giving a
range is then not allowed. This is useful to find all lines that match a
pattern and do not match another pattern: >
:g/found/v/notfound/{cmd}
This first finds all lines containing "found", but only executes {cmd} when
there is no match for "notfound".
To repeat a non-Ex command, you can use the ":normal" command: > To execute a non-Ex command, you can use the `:normal` command: >
:g/pat/normal {commands} :g/pat/normal {commands}
Make sure that {commands} ends with a whole command, otherwise Vim will wait Make sure that {commands} ends with a whole command, otherwise Vim will wait
for you to type the rest of the command for each match. The screen will not for you to type the rest of the command for each match. The screen will not

View File

@ -478,7 +478,7 @@ Vim uses a binary file format for spelling. This greatly speeds up loading
the word list and keeps it small. the word list and keeps it small.
*.aff* *.dic* *Myspell* *.aff* *.dic* *Myspell*
You can create a Vim spell file from the .aff and .dic files that Myspell You can create a Vim spell file from the .aff and .dic files that Myspell
uses. Myspell is used by OpenOffice.org and Mozilla. The OpenOffice .oxt uses. Myspell is used by OpenOffice.org and Mozilla. The OpenOffice .oxt
files are zip files which contain the .aff and .dic files. You should be able files are zip files which contain the .aff and .dic files. You should be able
to find them here: to find them here:
http://extensions.services.openoffice.org/dictionary http://extensions.services.openoffice.org/dictionary
@ -1614,7 +1614,7 @@ COMPOUNDSYLLABLE (Hunspell) *spell-COMPOUNDSYLLABLE*
KEY (Hunspell) *spell-KEY* KEY (Hunspell) *spell-KEY*
Define characters that are close together on the keyboard. Define characters that are close together on the keyboard.
Used to give better suggestions. Not supported. Used to give better suggestions. Not supported.
LANG (Hunspell) *spell-LANG* LANG (Hunspell) *spell-LANG*
This specifies language-specific behavior. This actually This specifies language-specific behavior. This actually
moves part of the language knowledge into the program, moves part of the language knowledge into the program,

View File

@ -1,4 +1,4 @@
*syntax.txt* For Vim version 8.0. Last change: 2017 Feb 06 *syntax.txt* For Vim version 8.0. Last change: 2017 Jun 04
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -4812,10 +4812,11 @@ ctermbg={color-nr} *highlight-ctermbg*
Example: > Example: >
:highlight Normal ctermfg=grey ctermbg=darkblue :highlight Normal ctermfg=grey ctermbg=darkblue
< When setting the "ctermbg" color for the Normal group, the < When setting the "ctermbg" color for the Normal group, the
'background' option will be adjusted automatically. This causes the 'background' option will be adjusted automatically, under the
highlight groups that depend on 'background' to change! This means condition that the color is recognized and 'background' was not set
you should set the colors for Normal first, before setting other explicitly. This causes the highlight groups that depend on
colors. 'background' to change! This means you should set the colors for
Normal first, before setting other colors.
When a colorscheme is being used, changing 'background' causes it to When a colorscheme is being used, changing 'background' causes it to
be reloaded, which may reset all colors (including Normal). First be reloaded, which may reset all colors (including Normal). First
delete the "g:colors_name" variable when you don't want this. delete the "g:colors_name" variable when you don't want this.

View File

@ -427,6 +427,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'macatsui' options.txt /*'macatsui'* 'macatsui' options.txt /*'macatsui'*
'magic' options.txt /*'magic'* 'magic' options.txt /*'magic'*
'makeef' options.txt /*'makeef'* 'makeef' options.txt /*'makeef'*
'makeencoding' options.txt /*'makeencoding'*
'makeprg' options.txt /*'makeprg'* 'makeprg' options.txt /*'makeprg'*
'mat' options.txt /*'mat'* 'mat' options.txt /*'mat'*
'matchpairs' options.txt /*'matchpairs'* 'matchpairs' options.txt /*'matchpairs'*
@ -439,6 +440,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'maxmemtot' options.txt /*'maxmemtot'* 'maxmemtot' options.txt /*'maxmemtot'*
'mco' options.txt /*'mco'* 'mco' options.txt /*'mco'*
'mef' options.txt /*'mef'* 'mef' options.txt /*'mef'*
'menc' options.txt /*'menc'*
'menuitems' options.txt /*'menuitems'* 'menuitems' options.txt /*'menuitems'*
'mesg' vi_diff.txt /*'mesg'* 'mesg' vi_diff.txt /*'mesg'*
'mfd' options.txt /*'mfd'* 'mfd' options.txt /*'mfd'*
@ -943,6 +945,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
't_F7' term.txt /*'t_F7'* 't_F7' term.txt /*'t_F7'*
't_F8' term.txt /*'t_F8'* 't_F8' term.txt /*'t_F8'*
't_F9' term.txt /*'t_F9'* 't_F9' term.txt /*'t_F9'*
't_GP' term.txt /*'t_GP'*
't_IE' term.txt /*'t_IE'* 't_IE' term.txt /*'t_IE'*
't_IS' term.txt /*'t_IS'* 't_IS' term.txt /*'t_IS'*
't_K1' term.txt /*'t_K1'* 't_K1' term.txt /*'t_K1'*
@ -1925,6 +1928,13 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:Print various.txt /*:Print* :Print various.txt /*:Print*
:Rexplore pi_netrw.txt /*:Rexplore* :Rexplore pi_netrw.txt /*:Rexplore*
:RmVimball pi_vimball.txt /*:RmVimball* :RmVimball pi_vimball.txt /*:RmVimball*
:RustEmitAsm ft_rust.txt /*:RustEmitAsm*
:RustEmitIr ft_rust.txt /*:RustEmitIr*
:RustExpand ft_rust.txt /*:RustExpand*
:RustFmt ft_rust.txt /*:RustFmt*
:RustFmtRange ft_rust.txt /*:RustFmtRange*
:RustPlay ft_rust.txt /*:RustPlay*
:RustRun ft_rust.txt /*:RustRun*
:Sexplore pi_netrw.txt /*:Sexplore* :Sexplore pi_netrw.txt /*:Sexplore*
:TOhtml syntax.txt /*:TOhtml* :TOhtml syntax.txt /*:TOhtml*
:TarDiff pi_tar.txt /*:TarDiff* :TarDiff pi_tar.txt /*:TarDiff*
@ -3268,6 +3278,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
<Char> map.txt /*<Char>* <Char> map.txt /*<Char>*
<CursorHold> autocmd.txt /*<CursorHold>* <CursorHold> autocmd.txt /*<CursorHold>*
<D- intro.txt /*<D-* <D- intro.txt /*<D-*
<D-c> os_mac.txt /*<D-c>*
<D-v> os_mac.txt /*<D-v>*
<D-x> os_mac.txt /*<D-x>*
<Del> change.txt /*<Del>* <Del> change.txt /*<Del>*
<Down> motion.txt /*<Down>* <Down> motion.txt /*<Down>*
<Drop> change.txt /*<Drop>* <Drop> change.txt /*<Drop>*
@ -4503,6 +4516,9 @@ E938 eval.txt /*E938*
E939 change.txt /*E939* E939 change.txt /*E939*
E94 windows.txt /*E94* E94 windows.txt /*E94*
E940 eval.txt /*E940* E940 eval.txt /*E940*
E941 eval.txt /*E941*
E942 eval.txt /*E942*
E943 message.txt /*E943*
E95 message.txt /*E95* E95 message.txt /*E95*
E96 diff.txt /*E96* E96 diff.txt /*E96*
E97 diff.txt /*E97* E97 diff.txt /*E97*
@ -5011,6 +5027,7 @@ assert_inrange() eval.txt /*assert_inrange()*
assert_match() eval.txt /*assert_match()* assert_match() eval.txt /*assert_match()*
assert_notequal() eval.txt /*assert_notequal()* assert_notequal() eval.txt /*assert_notequal()*
assert_notmatch() eval.txt /*assert_notmatch()* assert_notmatch() eval.txt /*assert_notmatch()*
assert_report() eval.txt /*assert_report()*
assert_true() eval.txt /*assert_true()* assert_true() eval.txt /*assert_true()*
at motion.txt /*at* at motion.txt /*at*
atan() eval.txt /*atan()* atan() eval.txt /*atan()*
@ -5348,6 +5365,7 @@ cino-: indent.txt /*cino-:*
cino-= indent.txt /*cino-=* cino-= indent.txt /*cino-=*
cino-> indent.txt /*cino->* cino-> indent.txt /*cino->*
cino-C indent.txt /*cino-C* cino-C indent.txt /*cino-C*
cino-E indent.txt /*cino-E*
cino-J indent.txt /*cino-J* cino-J indent.txt /*cino-J*
cino-L indent.txt /*cino-L* cino-L indent.txt /*cino-L*
cino-M indent.txt /*cino-M* cino-M indent.txt /*cino-M*
@ -6125,6 +6143,7 @@ ft-rexx-syntax syntax.txt /*ft-rexx-syntax*
ft-rst-syntax syntax.txt /*ft-rst-syntax* ft-rst-syntax syntax.txt /*ft-rst-syntax*
ft-ruby-omni insert.txt /*ft-ruby-omni* ft-ruby-omni insert.txt /*ft-ruby-omni*
ft-ruby-syntax syntax.txt /*ft-ruby-syntax* ft-ruby-syntax syntax.txt /*ft-ruby-syntax*
ft-rust filetype.txt /*ft-rust*
ft-scheme-syntax syntax.txt /*ft-scheme-syntax* ft-scheme-syntax syntax.txt /*ft-scheme-syntax*
ft-sdl-syntax syntax.txt /*ft-sdl-syntax* ft-sdl-syntax syntax.txt /*ft-sdl-syntax*
ft-sed-syntax syntax.txt /*ft-sed-syntax* ft-sed-syntax syntax.txt /*ft-sed-syntax*
@ -6157,6 +6176,7 @@ ft-xpm-syntax syntax.txt /*ft-xpm-syntax*
ft-yaml-syntax syntax.txt /*ft-yaml-syntax* ft-yaml-syntax syntax.txt /*ft-yaml-syntax*
ft-zsh-syntax syntax.txt /*ft-zsh-syntax* ft-zsh-syntax syntax.txt /*ft-zsh-syntax*
ft_ada.txt ft_ada.txt /*ft_ada.txt* ft_ada.txt ft_ada.txt /*ft_ada.txt*
ft_rust.txt ft_rust.txt /*ft_rust.txt*
ft_sql.txt ft_sql.txt /*ft_sql.txt* ft_sql.txt ft_sql.txt /*ft_sql.txt*
ftdetect filetype.txt /*ftdetect* ftdetect filetype.txt /*ftdetect*
ftp pi_netrw.txt /*ftp* ftp pi_netrw.txt /*ftp*
@ -6234,6 +6254,7 @@ g:decada.Make_Command ft_ada.txt /*g:decada.Make_Command*
g:decada.Unit_Name() ft_ada.txt /*g:decada.Unit_Name()* g:decada.Unit_Name() ft_ada.txt /*g:decada.Unit_Name()*
g:filetype_csh syntax.txt /*g:filetype_csh* g:filetype_csh syntax.txt /*g:filetype_csh*
g:filetype_r syntax.txt /*g:filetype_r* g:filetype_r syntax.txt /*g:filetype_r*
g:ftplugin_rust_source_path ft_rust.txt /*g:ftplugin_rust_source_path*
g:gnat ft_ada.txt /*g:gnat* g:gnat ft_ada.txt /*g:gnat*
g:gnat.Error_Format ft_ada.txt /*g:gnat.Error_Format* g:gnat.Error_Format ft_ada.txt /*g:gnat.Error_Format*
g:gnat.Find() ft_ada.txt /*g:gnat.Find()* g:gnat.Find() ft_ada.txt /*g:gnat.Find()*
@ -6363,6 +6384,20 @@ g:netrw_win95ftp pi_netrw.txt /*g:netrw_win95ftp*
g:netrw_winsize pi_netrw.txt /*g:netrw_winsize* g:netrw_winsize pi_netrw.txt /*g:netrw_winsize*
g:netrw_wiw pi_netrw.txt /*g:netrw_wiw* g:netrw_wiw pi_netrw.txt /*g:netrw_wiw*
g:netrw_xstrlen pi_netrw.txt /*g:netrw_xstrlen* g:netrw_xstrlen pi_netrw.txt /*g:netrw_xstrlen*
g:rust_bang_comment_leader ft_rust.txt /*g:rust_bang_comment_leader*
g:rust_conceal ft_rust.txt /*g:rust_conceal*
g:rust_conceal_mod_path ft_rust.txt /*g:rust_conceal_mod_path*
g:rust_conceal_pub ft_rust.txt /*g:rust_conceal_pub*
g:rust_fold ft_rust.txt /*g:rust_fold*
g:rust_playpen_url ft_rust.txt /*g:rust_playpen_url*
g:rust_recommended_style ft_rust.txt /*g:rust_recommended_style*
g:rust_shortener_url ft_rust.txt /*g:rust_shortener_url*
g:rustc_makeprg_no_percent ft_rust.txt /*g:rustc_makeprg_no_percent*
g:rustc_path ft_rust.txt /*g:rustc_path*
g:rustfmt_autosave ft_rust.txt /*g:rustfmt_autosave*
g:rustfmt_command ft_rust.txt /*g:rustfmt_command*
g:rustfmt_fail_silently ft_rust.txt /*g:rustfmt_fail_silently*
g:rustfmt_options ft_rust.txt /*g:rustfmt_options*
g:syntax_on syntax.txt /*g:syntax_on* g:syntax_on syntax.txt /*g:syntax_on*
g:tar_browseoptions pi_tar.txt /*g:tar_browseoptions* g:tar_browseoptions pi_tar.txt /*g:tar_browseoptions*
g:tar_cmd pi_tar.txt /*g:tar_cmd* g:tar_cmd pi_tar.txt /*g:tar_cmd*
@ -7145,9 +7180,11 @@ m` motion.txt /*m`*
mac os_mac.txt /*mac* mac os_mac.txt /*mac*
mac-bug os_mac.txt /*mac-bug* mac-bug os_mac.txt /*mac-bug*
mac-compile os_mac.txt /*mac-compile* mac-compile os_mac.txt /*mac-compile*
mac-darwin-feature os_mac.txt /*mac-darwin-feature*
mac-faq os_mac.txt /*mac-faq* mac-faq os_mac.txt /*mac-faq*
mac-filename os_mac.txt /*mac-filename* mac-filename os_mac.txt /*mac-filename*
mac-lack os_mac.txt /*mac-lack* mac-lack os_mac.txt /*mac-lack*
mac-standard-mappings os_mac.txt /*mac-standard-mappings*
mac-vimfile os_mac.txt /*mac-vimfile* mac-vimfile os_mac.txt /*mac-vimfile*
macintosh os_mac.txt /*macintosh* macintosh os_mac.txt /*macintosh*
macro map.txt /*macro* macro map.txt /*macro*
@ -7658,6 +7695,8 @@ nice todo.txt /*nice*
no-eval-feature eval.txt /*no-eval-feature* no-eval-feature eval.txt /*no-eval-feature*
no-type-checking eval.txt /*no-type-checking* no-type-checking eval.txt /*no-type-checking*
no_buffers_menu gui.txt /*no_buffers_menu* no_buffers_menu gui.txt /*no_buffers_menu*
no_mail_maps filetype.txt /*no_mail_maps*
no_plugin_maps filetype.txt /*no_plugin_maps*
non-greedy pattern.txt /*non-greedy* non-greedy pattern.txt /*non-greedy*
non-zero-arg eval.txt /*non-zero-arg* non-zero-arg eval.txt /*non-zero-arg*
none-variable eval.txt /*none-variable* none-variable eval.txt /*none-variable*
@ -7887,6 +7926,7 @@ python-bindeval if_pyth.txt /*python-bindeval*
python-bindeval-objects if_pyth.txt /*python-bindeval-objects* python-bindeval-objects if_pyth.txt /*python-bindeval-objects*
python-buffer if_pyth.txt /*python-buffer* python-buffer if_pyth.txt /*python-buffer*
python-buffers if_pyth.txt /*python-buffers* python-buffers if_pyth.txt /*python-buffers*
python-building if_pyth.txt /*python-building*
python-chdir if_pyth.txt /*python-chdir* python-chdir if_pyth.txt /*python-chdir*
python-command if_pyth.txt /*python-command* python-command if_pyth.txt /*python-command*
python-commands if_pyth.txt /*python-commands* python-commands if_pyth.txt /*python-commands*
@ -8015,6 +8055,7 @@ remote_foreground() eval.txt /*remote_foreground()*
remote_peek() eval.txt /*remote_peek()* remote_peek() eval.txt /*remote_peek()*
remote_read() eval.txt /*remote_read()* remote_read() eval.txt /*remote_read()*
remote_send() eval.txt /*remote_send()* remote_send() eval.txt /*remote_send()*
remote_startserver() eval.txt /*remote_startserver()*
remove() eval.txt /*remove()* remove() eval.txt /*remove()*
remove-filetype filetype.txt /*remove-filetype* remove-filetype filetype.txt /*remove-filetype*
remove-option-flags options.txt /*remove-option-flags* remove-option-flags options.txt /*remove-option-flags*
@ -8070,6 +8111,13 @@ russian-issues russian.txt /*russian-issues*
russian-keymap russian.txt /*russian-keymap* russian-keymap russian.txt /*russian-keymap*
russian-l18n russian.txt /*russian-l18n* russian-l18n russian.txt /*russian-l18n*
russian.txt russian.txt /*russian.txt* russian.txt russian.txt /*russian.txt*
rust ft_rust.txt /*rust*
rust-commands ft_rust.txt /*rust-commands*
rust-intro ft_rust.txt /*rust-intro*
rust-mappings ft_rust.txt /*rust-mappings*
rust-settings ft_rust.txt /*rust-settings*
rust_<D-R> ft_rust.txt /*rust_<D-R>*
rust_<D-r> ft_rust.txt /*rust_<D-r>*
rview starting.txt /*rview* rview starting.txt /*rview*
rvim starting.txt /*rvim* rvim starting.txt /*rvim*
rxvt syntax.txt /*rxvt* rxvt syntax.txt /*rxvt*
@ -8481,6 +8529,7 @@ t_F6 term.txt /*t_F6*
t_F7 term.txt /*t_F7* t_F7 term.txt /*t_F7*
t_F8 term.txt /*t_F8* t_F8 term.txt /*t_F8*
t_F9 term.txt /*t_F9* t_F9 term.txt /*t_F9*
t_GP term.txt /*t_GP*
t_IE term.txt /*t_IE* t_IE term.txt /*t_IE*
t_IS term.txt /*t_IS* t_IS term.txt /*t_IS*
t_K1 term.txt /*t_K1* t_K1 term.txt /*t_K1*
@ -8744,7 +8793,6 @@ termresponse-variable eval.txt /*termresponse-variable*
test-functions usr_41.txt /*test-functions* test-functions usr_41.txt /*test-functions*
test_alloc_fail() eval.txt /*test_alloc_fail()* test_alloc_fail() eval.txt /*test_alloc_fail()*
test_autochdir() eval.txt /*test_autochdir()* 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_garbagecollect_now() eval.txt /*test_garbagecollect_now()*
test_ignore_error() eval.txt /*test_ignore_error()* test_ignore_error() eval.txt /*test_ignore_error()*
test_null_channel() eval.txt /*test_null_channel()* test_null_channel() eval.txt /*test_null_channel()*
@ -8753,6 +8801,7 @@ test_null_job() eval.txt /*test_null_job()*
test_null_list() eval.txt /*test_null_list()* test_null_list() eval.txt /*test_null_list()*
test_null_partial() eval.txt /*test_null_partial()* test_null_partial() eval.txt /*test_null_partial()*
test_null_string() eval.txt /*test_null_string()* test_null_string() eval.txt /*test_null_string()*
test_override() eval.txt /*test_override()*
test_settime() eval.txt /*test_settime()* test_settime() eval.txt /*test_settime()*
testing eval.txt /*testing* testing eval.txt /*testing*
testing-variable eval.txt /*testing-variable* testing-variable eval.txt /*testing-variable*

View File

@ -1,4 +1,4 @@
*term.txt* For Vim version 8.0. Last change: 2017 Feb 02 *term.txt* For Vim version 8.0. Last change: 2017 Apr 11
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -314,6 +314,7 @@ Added by Vim (there are no standard codes for these):
t_IS set icon text start *t_IS* *'t_IS'* t_IS set icon text start *t_IS* *'t_IS'*
t_IE set icon text end *t_IE* *'t_IE'* t_IE set icon text end *t_IE* *'t_IE'*
t_WP set window position (Y, X) in pixels *t_WP* *'t_WP'* t_WP set window position (Y, X) in pixels *t_WP* *'t_WP'*
t_GP get window position (Y, X) in pixels *t_GP* *'t_GP'*
t_WS set window size (height, width) in characters *t_WS* *'t_WS'* t_WS set window size (height, width) in characters *t_WS* *'t_WS'*
t_SI start insert mode (bar cursor shape) *t_SI* *'t_SI'* t_SI start insert mode (bar cursor shape) *t_SI* *'t_SI'*
t_SR start replace mode (underline cursor shape) *t_SR* *'t_SR'* t_SR start replace mode (underline cursor shape) *t_SR* *'t_SR'*

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.0. Last change: 2017 Mar 05 *todo.txt* For Vim version 8.0. Last change: 2017 Jun 05
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -36,6 +36,8 @@ entered there will not be repeated below, unless there is extra information.
-------------------- Known bugs and current work ----------------------- -------------------- Known bugs and current work -----------------------
+channel: +channel:
- When redrawing for the channel buffer, command line completion is cleared.
(Ramel Eshed, 2017 May 4)
- Try out background make plugin: - Try out background make plugin:
https://github.com/AndrewVos/vim-make-background https://github.com/AndrewVos/vim-make-background
- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026) - Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
@ -104,14 +106,128 @@ Regexp problems:
had_endbrace[] is set but not initialized or used. had_endbrace[] is set but not initialized or used.
- Difference between two engines: ".*\zs\/\@>\/" on text "///" - Difference between two engines: ".*\zs\/\@>\/" on text "///"
(Chris Paul, 2016 Nov 13) New engine not greedy enough? (Chris Paul, 2016 Nov 13) New engine not greedy enough?
Another one: echom matchstr(" sdfsfsf\n sfdsdfsdf",'[^\n]*')
(2017 May 15, #1252)
With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
(Marcin Szewczyk, 2017 Apr 26)
ml_get error when using a Python. (Yggdroot, 2017 Jun 1, #1737)
ml_get errors with buggy script. (Dominique, 2017 Apr 30)
Error in emsg with buggy script. (Dominique, 2017 Apr 30)
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.
Using freed memory with "qf" FileType autocommand that does :cclose.
(Lemonboy, 2017 May 28, #1730, fix in 1734, with test that doesn't fail, but
it fails when run manually) Add "starting" to test_override()?
Problem with three-piece comment. (Michael Lee, 2017 May 11, #1696)
When checking if a bufref is valid, also check the buffer number, to catch the
case of :bwipe followed by :new.
Files for Latvian language. (Vitolins, 2017 May 3, #1675)
Setting 'clipboard' to "unnamed" makes a global command very slow (Daniel
Drucker, 2017 May 8).
This was supposed to be fixed, did it break again somehow?
Christian cannot reproduce it.
Better TeX indent file. (Christian Brabandt, 2017 May 3)
Openhab syntax file (mueller, #1678)
Use gvimext.dll from the nightly build? (Issue #249)
Patch to remove HAVE_GTK_MULTIHEAD-relevant code. (Kazunobu Kuriyama, 2017 May
5) Update May 11
'synmaxcol' works with bytes instead of screen cells. (Llandon, 2017 May 31,
#1736)
Patch to pass quickfix list index to functions. (Yegappan Lakshmanan, 2017 May
31)
Problem with using :cd when remotely editing a file. (Gerd Wachsmuth, 2017 May
8, #1690)
'equalalways' only works for one column. (Glacambre, 2017 May 15, #1707)
Include solarized color scheme?
Updates to GTK help. (Kazunobu Kuriyama, 2017 May 4)
Running test_gui and test_gui_init with Motif sometimes kills the window Running test_gui and test_gui_init with Motif sometimes kills the window
manager. Problem with Motif? manager. Problem with Motif?
Bogus characters inserted when triggering indent while changing text.
(Vitor Antunes, 2016 Nov 22, #1269)
Patch to have ":stag" respect 'switchbuf'. (Ingo Karkat, 2017 May 5, #1681)
Patch to improve building with MSVC. (Leonardo Manera, #1747)
Wrong selection of quoted text (Guraga, #1687)
Patch to fix selection of quoted text. (Christian Brabandt, 2017 May 7, #1687)
Patch to use separate error message for regex range. (Itchyny, Ken Hamada,
2017 May 16)
Segmentation fault with complete(). (Lifepillar, 2017 Apr 29, #1668)
Check for "pat" to be NULL in search_for_exact_line()?
How did it get NULL? Comment by Christian, Apr 30.
Is it possible to keep the complete menu open when calling complete()?
(Prabir Shrestha, 2017 May 19, #1713)
Calling may_req_ambiguous_char_width() and may_req_bg_color() only after
executing command line commands may not work properly.
(Rastislav Barlink, 2017 May 18)
Set "starting" to 0 earlier, and move the may_req calls above exe_commands()?
No, that's a problem with using "-c quit", not running Vim interactive.
Memory leak in test97? The string is actually freed. Weird. Memory leak in test97? The string is actually freed. Weird.
Patch for shellescape(). (Christian Brabandt, 2017 Apr 20, #1590)
Patch for flickering redraw. (Hirohito Higashi, 2017 Apr 23, #1637)
New value "uselast" for 'switchbuf'. (Lemonboy, 2017 Apr 23, #1652)
Add a toolbar in the terminal. Can be global, above all windows, or specific Add a toolbar in the terminal. Can be global, above all windows, or specific
for one window. for one window.
Make maparg() also return the raw rhs, so that it doesn't depend on 'cpo'.
(Brett Stahlman, 2017 May 23)
Even better: add a way to disable a mapping temporarily and re-enable it
later. This is for a sub-mode that is active for a short while (one buffer).
Still need maplist() to find the mappings. What can we use to identify a
mapping? Something unique would be better than the LHS.
Perhaps simpler: actually delete the mappings. Use maplist() to list matching
mappings (with a lhs prefix, like maparg()), mapdelete() to delete,
maprestore() to restore (using the output of maplist().
Patch to support chinese wordcount in utf-8. (Rain, 2017 May 24, #1722)
Or not?
"gn" selects one character instead of the searched text. (keyboardfire, #1683)
Patch by Christian, 2017 May 7.
Wrong memory access using p_fdm, found in patch to add tests for diff mode
(#1658) (Dominique Pelle, 2017 May 6)
Patch to improve test coverage for diff mode. (Dominique Pelle, 2017 May 11,
#1685)
Add an argument to :mkvimrc (or add aother command) to skip mappings from
plugins (source is a Vim script). No need to put these in a .vimrc, they will
be defined when the plugin is loaded.
Use tb_set(winid, [{'text': 'stop', 'cb': callback, 'hi': 'Green'}]) Use tb_set(winid, [{'text': 'stop', 'cb': callback, 'hi': 'Green'}])
tb_highlight(winid, 'ToolBar') tb_highlight(winid, 'ToolBar')
tb_get(winid) tb_get(winid)
@ -121,15 +237,10 @@ What if there is an invalid character?
Json string with trailing \u should be an error. (Lcd) Json string with trailing \u should be an error. (Lcd)
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 When session file has name in argument list but the buffer was deleted, the
buffer is not deleted when using the session file. (#1393) buffer is not deleted when using the session file. (#1393)
Should add the buffer in hidden state. 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 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. like the item was not a match for :cnext.
@ -140,27 +251,20 @@ Another example in #1309
Patch to change all use of &sw to shiftwidth(). (Tyru, 2017 Feb 19) Patch to change all use of &sw to shiftwidth(). (Tyru, 2017 Feb 19)
Wait until maintainers integrate it. Wait until maintainers integrate it.
Completion for user-defined commands does not work if a few characters were
already typed. (Dominique, 2017 Jan 26)
When deleting a mark or register, leave a tombstone, so that it's also deleted 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 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, Suggestion to improve pt-br spell checking. (Marcelo D Montu, 2016 Dec 15,
#1330) #1330)
Error in test_startup_utf8 on Solaris. (Danek Duvall, 2016 Aug 17) 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 Completion for :!cmd shows each match twice. #1435
Patch to change GUI behavior: instead of changing the window size change the
lines/columns when menu/toolbar/etc. is added/removed. (Ychin, 2016 Mar 20,
#703)
GTK: When adding a timer from 'balloonexpr' it won't fire, because GTK: When adding a timer from 'balloonexpr' it won't fire, because
g_main_context_iteration() doesn't return. Need to trigger an event when the g_main_context_iteration() doesn't return. Need to trigger an event when the
timer expires. timer expires.
@ -176,14 +280,18 @@ highlighting for both stl and stlnc. Patch by Ken Hamada (itchyny, 2016 Dec 11)
Using CTRL-G_U in InsertCharPre causes trouble for redo. (Israel Chauca Using CTRL-G_U in InsertCharPre causes trouble for redo. (Israel Chauca
Fuentes, 2017 Feb 12, #1470) 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. Screen updated delayed when using CTRL-O u in Insert mode.
(Barlik, #1191) Perhaps because status message? (Barlik, #1191) Perhaps because status message?
Patch to add buffer name argument to taglist(). Implement optional arguments for functions.
Ordering of tags in result of taglist call. (Duncan McDougall, #1194) func Foo(start, count = 1 all = 1)
call Foo(12)
Patch to fix that b_ind_has_comment is not correctly reset. (Christian call Foo(12, all = 0)
Brabandt, 2017 Feb 14, closes #1475) call Foo(12, 15, 0)
writefile() does not abort as soon as an error is found. (Nikolai Pavlov, writefile() does not abort as soon as an error is found. (Nikolai Pavlov,
2017 Feb 14, #1476) 2017 Feb 14, #1476)
@ -191,6 +299,10 @@ writefile() does not abort as soon as an error is found. (Nikolai Pavlov,
Patch to support on-the-spot and over-the-spot input method. (Ken Takata, 2017 Patch to support on-the-spot and over-the-spot input method. (Ken Takata, 2017
Feb 14). Feb 14).
Change the Farsi code to work with UTF-8. Possibly combined with the Arabic
support, or similar.
Invalid read error in Farsi mode. (Dominique Pelle, 2009 Aug 2)
Add a command to take a range of lines, filter them and put the output Add a command to take a range of lines, filter them and put the output
somewhere else. :{range}copy {dest} !cmd somewhere else. :{range}copy {dest} !cmd
@ -203,6 +315,9 @@ Patch for restoring wide characters in the console buffer.
Patch to fix escaping of job arguments. (Yasuhiro Matsumoto, 2016 Oct 5) Patch to fix escaping of job arguments. (Yasuhiro Matsumoto, 2016 Oct 5)
Update Oct 14: https://gist.github.com/mattn/d47e7d3bfe5ade4be86062b565a4bfca Update Oct 14: https://gist.github.com/mattn/d47e7d3bfe5ade4be86062b565a4bfca
Characters deleted on completion. (Adrià Farrés, 2017 Apr 20, #1645)
Remarks from Christian Brabandt (Apr 21)
The TermResponse event is not triggered when a plugin has set 'eventignore' to The TermResponse event is not triggered when a plugin has set 'eventignore' to
"all". Netrw does this. (Gary Johnson, 2017 Jan 24) "all". Netrw does this. (Gary Johnson, 2017 Jan 24)
Postpone the event until 'eventignore' is reset. Postpone the event until 'eventignore' is reset.
@ -210,6 +325,8 @@ Postpone the event until 'eventignore' is reset.
Patch to make urxvt mouse work better, recognize Esc[*M termcap code. Patch to make urxvt mouse work better, recognize Esc[*M termcap code.
(Maurice Bos, 2017 Feb 17, #1486) (Maurice Bos, 2017 Feb 17, #1486)
Expanding /**/ is slow. Idea by Luc Hermitte, 2017 Apr 14.
Once .exe with updated installer is available: Add remark to download page Once .exe with updated installer is available: Add remark to download page
about /S and /D options (Ken Takata, 2016 Apr 13) about /S and /D options (Ken Takata, 2016 Apr 13)
Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
@ -237,15 +354,15 @@ Useful to restore it. Is there another solution?
"ci[" does not look for next [ like ci" does look for next ". "ci[" does not look for next [ like ci" does look for next ".
(J.F. 2017 Jan 7) (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. Patch for wrong cursor position on wrapped line, involving breakindent.
(Ozaki Kiichi, 2016 Nov 25) (Ozaki Kiichi, 2016 Nov 25)
Does this also fix #1408 ? Does this also fix #1408 ?
Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30) Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30)
When 'completeopt' has "noselect" does not insert a newline. (Lifepillar, 2017
Apr 23, #1653)
Window resizing with 'winfixheight': With a vertical split the height changes Window resizing with 'winfixheight': With a vertical split the height changes
anyway. (Tommy allen, 2017 Feb 21, #1502) anyway. (Tommy allen, 2017 Feb 21, #1502)
@ -261,9 +378,6 @@ Patch to make it possible to extend a list with itself.
Patch to add Zstandard compressed file support. (Nick Terrell, 2016 Oct 24) 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 trim() function. (Bukn, 2016 Nov 25, #1280)
Patch to add MODIFIED_BY to MSVC build file. (Chen Lei, 2016 Nov 24, #1275) Patch to add MODIFIED_BY to MSVC build file. (Chen Lei, 2016 Nov 24, #1275)
@ -293,11 +407,21 @@ Patch to add "cmdline" completion to getcompletion(). (Shougo, Oct 1, #1140)
Feature request: Complete members of a dictionary. (Luc Hermitte, 2017 Jan 4, Feature request: Complete members of a dictionary. (Luc Hermitte, 2017 Jan 4,
#1350) #1350)
Undo message is not always properly displayed. Patch by Ken Takata, 2013 oct
3. Doesn't work properly according to Yukihiro Nakadaira.
Also see #1635.
Patch for systemlist(), add empty item. (thinca, Sep 30, #1135) Patch for systemlist(), add empty item. (thinca, Sep 30, #1135)
Add an argument to choose binary or non-binary (like readfile()), when omitted Add an argument to choose binary or non-binary (like readfile()), when omitted
use the current behavior. use the current behavior.
Include the test. Include the test.
Patch to add tagfunc(). Cleaned up by Christian Brabandt, 2013 Jun 22.
New update 2017 Apr 10, #1628
Unnamed register only contains the last deleted text when appending deleted
text to a register. (Wolfgang Jeltsch, reproduced by Ben Fritz, 2017 Apr 10)
When 'keywordprg' starts with ":" the argument is still escaped as a shell When 'keywordprg' starts with ":" the argument is still escaped as a shell
command argument. (Romain Lafourcade, 2016 Oct 16, #1175) command argument. (Romain Lafourcade, 2016 Oct 16, #1175)
@ -343,30 +467,20 @@ Jul 25, #948)
Patch to fix wrong encoding of error message on Cygwin/MSYS terminal. Patch to fix wrong encoding of error message on Cygwin/MSYS terminal.
(Ken Takata, 2016 Oct 4) (Ken Takata, 2016 Oct 4)
Patch to introduce 'cmdencoding'. (Ken Takata, Aug 18?)
Better help Aug 19.
Problem: applies to too many commands, such as :cbuffer.
Updated patch with three options, 2016 Sep 8.
Win32: When running ":make" and 'encoding' differs from the system locale,
the output should be converted. Esp. when 'encoding' is "utf-8". (Yongwei
Wu) Should we use 'termencoding' for this?
Patch to add 'systemencoding', convert between 'encoding' and this for file Patch to add 'systemencoding', convert between 'encoding' and this for file
names, shell commands and the like. (Kikuchan, 2010 Oct 14) names, shell commands and the like. (Kikuchan, 2010 Oct 14)
Assume the system converts between the actual encoding of the filesystem to Assume the system converts between the actual encoding of the filesystem to
the system encoding (usually utf-8). the system encoding (usually utf-8).
'hlsearch' interferes with a Conceal match. (Rom Grk, 2016 Aug 9) Using ":tab drop file" does not trigger BufEnter or TabEnter events.
(Andy Stewart, 2017 Apr 27, #1660)
Autocommands blocked in do_arg_all(). Supposed to happen later?
Patch to add context information to quickfix/location list. (Yegappan 'hlsearch' interferes with a Conceal match. (Rom Grk, 2016 Aug 9)
Lakshmanan, 2016 Aug 25, #1012)
MS-Windows: use WS_HIDE instead of SW_SHOWMINNOACTIVE in os_win32.c? MS-Windows: use WS_HIDE instead of SW_SHOWMINNOACTIVE in os_win32.c?
Otherwise task flickers in taskbar. Otherwise task flickers in taskbar.
Bogus characters inserted when triggering indent while changing test.
(Vitor Antunes, 2016 Nov 22, #1269)
Should make ":@r" handle line continuation. (Cesar Romani, 2016 Jun 26) Should make ":@r" handle line continuation. (Cesar Romani, 2016 Jun 26)
Also for ":@.". Also for ":@.".
@ -423,7 +537,7 @@ When doing "vi buf.md" a BufNew autocommand for *.md is not triggered.
Because of using the initial buffer? (Dun Peal, 2016 May 12) Because of using the initial buffer? (Dun Peal, 2016 May 12)
Patch to add the :bvimgrep command. (Christian Brabandt, 2014 Nov 12) Patch to add the :bvimgrep command. (Christian Brabandt, 2014 Nov 12)
Updated 2016 Jun 10, #858 Updated 2016 Jun 10, #858 Update 2017 Mar 28: use <buffer>
Add redrawtabline command. (Naruhiko Nishino, 2016 Jun 11) Add redrawtabline command. (Naruhiko Nishino, 2016 Jun 11)
@ -433,6 +547,8 @@ No test, needs some work to include.
Patch to improve indenting for C++ constructor with initializer list. Patch to improve indenting for C++ constructor with initializer list.
(Hirohito Higashi, 2016 Mar 31) (Hirohito Higashi, 2016 Mar 31)
Zero-out krypt key information when no longer in use. (Ben Fritz, 2017 May 15)
Add stronger encryption. Could use libsodium (NaCl). Add stronger encryption. Could use libsodium (NaCl).
https://github.com/jedisct1/libsodium/ https://github.com/jedisct1/libsodium/
Possibly include the needed code so that it can be build everywhere. Possibly include the needed code so that it can be build everywhere.
@ -482,10 +598,6 @@ When command names are very long :command output is difficult to read. Use a
maximum for the column width? (#871) maximum for the column width? (#871)
Patcy by varmanishant, 2016 Jun 18, #876 Patcy by varmanishant, 2016 Jun 18, #876
Patch to change GUI behavior: instead of changing the window size change the
lines/columns when menu/toolbar/etc. is added/removed. (Ychin, 2016 Mar 20,
#703)
Installation of .desktop files does not work everywhere. Installation of .desktop files does not work everywhere.
It's now fixed, but the target directory probably isn't right. It's now fixed, but the target directory probably isn't right.
Add configure check? Add configure check?
@ -604,7 +716,8 @@ Value of virtcol() for '[ and '] depend on multi-byte character.
(Luchr, #277) (Luchr, #277)
Can we cache the syntax attributes, so that updates for 'relativenumber' and Can we cache the syntax attributes, so that updates for 'relativenumber' and
'cursorline'/'cursorcolumn' are a lot faster? 'cursorline'/'cursorcolumn' are a lot faster? Thus store the attributes
before combining them.
C highlighting: modern C allows: /* comment */ #ifdef C highlighting: modern C allows: /* comment */ #ifdef
and also line continuation after #include. and also line continuation after #include.
@ -919,9 +1032,6 @@ Patch to handle integer overflow. (Aaron Burrow, 2013 Dec 12)
Patch to add "ntab" item in 'listchars' to repeat first character. (Nathaniel Patch to add "ntab" item in 'listchars' to repeat first character. (Nathaniel
Braun, pragm, 2013 Oct 13) A better solution 2014 Mar 5. Braun, pragm, 2013 Oct 13) A better solution 2014 Mar 5.
Undo message is not always properly displayed. Patch by Ken Takata, 2013 oct
3. Doesn't work properly according to Yukihiro Nakadaira.
/[b-a] gives error E16, should probably be E769. /[b-a] gives error E16, should probably be E769.
7 Windows XP: When using "ClearType" for text smoothing, a column of yellow 7 Windows XP: When using "ClearType" for text smoothing, a column of yellow
@ -1061,6 +1171,9 @@ Patch for :tabcloseleft, after closing a tab go to left tab. (William Bowers,
Patch to improve equivalence classes in regexp patterns. Patch to improve equivalence classes in regexp patterns.
(Christian Brabandt, 2013 Jan 16, update Jan 17) (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) Patch with suggestions for starting.txt. (Tony Mechelynck, 2012 Oct 24)
But use Gnome instead of GTK? But use Gnome instead of GTK?
@ -1083,8 +1196,6 @@ MS-Windows resizing problems:
Patch to append regexp to tag commands to make it possible to select one out Patch to append regexp to tag commands to make it possible to select one out
of many matches. (Cody Cutler, 2013 Mar 28) of many matches. (Cody Cutler, 2013 Mar 28)
Patch to add tagfunc(). Cleaned up by Christian Brabandt, 2013 Jun 22.
The input map for CTRL-O in mswin.vim causes problems after CTRL-X CTRL-O. The input map for CTRL-O in mswin.vim causes problems after CTRL-X CTRL-O.
Suggestion for another map. (Philip Mat, 2012 Jun 18) Suggestion for another map. (Philip Mat, 2012 Jun 18)
But use "gi" instead of "a". Or use CTRL-\ CTRL-O. But use "gi" instead of "a". Or use CTRL-\ CTRL-O.
@ -1510,8 +1621,6 @@ When a:base in 'completefunc' starts with a number it's passed as a number,
not a string. (Sean Ma) Need to add flag to call_func_retlist() to force a not a string. (Sean Ma) Need to add flag to call_func_retlist() to force a
string value. string value.
Invalid read error in Farsi mode. (Dominique Pelle, 2009 Aug 2)
For running gvim on a USB stick: avoid the OLE registration. Use a command For running gvim on a USB stick: avoid the OLE registration. Use a command
line argument -noregister. line argument -noregister.

View File

@ -1,4 +1,4 @@
*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 VIM USER MANUAL - by Bram Moolenaar
@ -554,7 +554,7 @@ Summary: *help-summary* >
8) Ex-commands always start with ":", so to go to the :s command help: > 8) Ex-commands always start with ":", so to go to the :s command help: >
:help :s :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: > for the "cont" debug command: >
:help >cont :help >cont

View File

@ -191,7 +191,7 @@ mouse button. The selected text will be inserted.
The "current selection" will only remain valid until some other text is The "current selection" will only remain valid until some other text is
selected. After doing the paste in the other gVim, now select some characters selected. After doing the paste in the other gVim, now select some characters
in that window. You will notice that the words that were previously selected in that window. You will notice that the words that were previously selected
in the other gVim window are displayed differently. This means that it no in the other gvim window are displayed differently. This means that it no
longer is the current selection. longer is the current selection.
You don't need to select text with the mouse, using the keyboard commands for You don't need to select text with the mouse, using the keyboard commands for
@ -215,7 +215,7 @@ USING BOTH
This use of both the "current selection" and the "real clipboard" might sound This use of both the "current selection" and the "real clipboard" might sound
a bit confusing. But it is very useful. Let's show this with an example. a bit confusing. But it is very useful. Let's show this with an example.
Use one gVim with a text file and perform these actions: Use one gvim with a text file and perform these actions:
- Select two words in Visual mode. - Select two words in Visual mode.
- Use the Edit/Copy menu to get these words onto the clipboard. - Use the Edit/Copy menu to get these words onto the clipboard.

View File

@ -1,4 +1,4 @@
*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 28
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@ -889,6 +889,7 @@ GUI: *gui-functions*
Vim server: *server-functions* Vim server: *server-functions*
serverlist() return the list of server names serverlist() return the list of server names
remote_startserve() run a server
remote_send() send command characters to a Vim server remote_send() send command characters to a Vim server
remote_expr() evaluate an expression in a Vim server remote_expr() evaluate an expression in a Vim server
server2client() send a reply to a client of a Vim server server2client() send a reply to a client of a Vim server
@ -920,10 +921,11 @@ Testing: *test-functions*
assert_true() assert that an expression is true assert_true() assert that an expression is true
assert_exception() assert that a command throws an exception assert_exception() assert that a command throws an exception
assert_fails() assert that a function call fails assert_fails() assert that a function call fails
assert_report() report a test failure
test_alloc_fail() make memory allocation fail test_alloc_fail() make memory allocation fail
test_autochdir() enable 'autochdir' during startup test_autochdir() enable 'autochdir' during startup
test_disable_char_avail() test without typeahead test_override() test with Vim internal overrides
test_garbagecollect_now() free memory right now test_garbagecollect_now() free memory right now
test_ignore_error() ignore a specific error message test_ignore_error() ignore a specific error message
test_null_channel() return a null Channel test_null_channel() return a null Channel
test_null_dict() return a null Dict test_null_dict() return a null Dict
@ -2275,8 +2277,8 @@ plugin for the mail filetype: >
endif endif
Two global variables are used: Two global variables are used:
no_plugin_maps disables mappings for all filetype plugins |no_plugin_maps| disables mappings for all filetype plugins
no_mail_maps disables mappings for a specific filetype |no_mail_maps| disables mappings for the "mail" filetype
USER COMMANDS USER COMMANDS

View File

@ -1,4 +1,4 @@
*usr_44.txt* For Vim version 8.0. Last change: 2008 Dec 28 *usr_44.txt* For Vim version 8.0. Last change: 2017 May 06
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@ -686,7 +686,7 @@ that included files do this too, you might have to reset "b:current_syntax" if
you include two files. you include two files.
If you want your syntax file to work with Vim 5.x, add a check for v:version. If you want your syntax file to work with Vim 5.x, add a check for v:version.
See yacc.vim for an example. Find an syntax file in the Vim 7.2 distribution for an example.
Do not include anything that is a user preference. Don't set 'tabstop', Do not include anything that is a user preference. Don't set 'tabstop',
'expandtab', etc. These belong in a filetype plugin. 'expandtab', etc. These belong in a filetype plugin.

View File

@ -9250,7 +9250,7 @@ Files: runtime/doc/various.txt, src/ex_cmds.h, src/ex_docmd.c,
src/proto/quickfix.pro, src/quickfix.c src/proto/quickfix.pro, src/quickfix.c
Patch 6.1.424 (extra) Patch 6.1.424 (extra)
Problem: Win32: Gvim compiled with VC++ 7.0 run on Windows 95 does not show Problem: Win32: gvim compiled with VC++ 7.0 run on Windows 95 does not show
menu items. menu items.
Solution: Define $WINVER to avoid an extra item is added to MENUITEMINFO. Solution: Define $WINVER to avoid an extra item is added to MENUITEMINFO.
(Muraoka Taro) (Muraoka Taro)
@ -12319,7 +12319,7 @@ Solution: Don't ignore the WM_SYSKEYUP event when the menu is disabled.
Files: src/gui_w32.c Files: src/gui_w32.c
Patch 6.2.362 (extra, after 6.2.347) Patch 6.2.362 (extra, after 6.2.347)
Problem: Win32: The manifest causes Gvim not to work. (Dave Roberts) Problem: Win32: The manifest causes gvim not to work. (Dave Roberts)
Solution: Change "x86" to "X86". (Serge Pirotte) Solution: Change "x86" to "X86". (Serge Pirotte)
Files: src/gvim.exe.mnf Files: src/gvim.exe.mnf

View File

@ -4151,7 +4151,7 @@ Patch 7.0.173
Problem: ":call f().TT()" doesn't work. (Richard Emberson) Problem: ":call f().TT()" doesn't work. (Richard Emberson)
Solution: When a function returns a Dictionary or another composite continue Solution: When a function returns a Dictionary or another composite continue
evaluating what follows. evaluating what follows.
Files: src/eval.c Files: src/eval.c
Patch 7.0.174 Patch 7.0.174
Problem: ":mksession" doesn't restore window layout correctly in tab pages Problem: ":mksession" doesn't restore window layout correctly in tab pages
@ -4265,7 +4265,7 @@ Problem: When 'swapfile' is switched off in an empty file it is possible
that not all blocks are loaded into memory, causing ml_get errors that not all blocks are loaded into memory, causing ml_get errors
later. later.
Solution: Rename "dont_release" to "mf_dont_release" and also use it to Solution: Rename "dont_release" to "mf_dont_release" and also use it to
avoid using the cached line and locked block. avoid using the cached line and locked block.
Files: src/globals.h, src/memfile.c, src/memline.c Files: src/globals.h, src/memfile.c, src/memline.c
Patch 7.0.193 Patch 7.0.193
@ -6031,7 +6031,7 @@ Solution: Add type casts. (Ben Schmidt)
Files: src/version.c Files: src/version.c
Patch 7.1.207 Patch 7.1.207
Problem: Netbeans: "remove" cannot delete one line. Problem: Netbeans: "remove" cannot delete one line.
Solution: Remove partial lines and whole lines properly. Avoid a memory Solution: Remove partial lines and whole lines properly. Avoid a memory
leak. (Xavier de Gaye) leak. (Xavier de Gaye)
Files: src/netbeans.c Files: src/netbeans.c
@ -7991,7 +7991,7 @@ Files: src/ex_cmds.c
Patch 7.2.097 Patch 7.2.097
Problem: "!xterm&" doesn't work when 'shell' is "bash". Problem: "!xterm&" doesn't work when 'shell' is "bash".
Solution: Ignore SIGHUP after calling setsid(). (Simon Schubert) Solution: Ignore SIGHUP after calling setsid(). (Simon Schubert)
Files: src/os_unix.c Files: src/os_unix.c
Patch 7.2.098 Patch 7.2.098
@ -8740,7 +8740,7 @@ Files: src/gui_gtk_x11.c, src/message.c, src/ops.c, src/proto/ui.pro,
src/ui.c src/ui.c
Patch 7.2.222 Patch 7.2.222
Problem: ":mksession" doesn't work properly with 'acd' set. Problem: ":mksession" doesn't work properly with 'acd' set.
Solution: Make it work. (Yakov Lerner) Solution: Make it work. (Yakov Lerner)
Files: src/ex_docmd.c Files: src/ex_docmd.c
@ -9150,7 +9150,7 @@ Solution: Add the missing "else". (Lech Lorens)
Files: src/ops.c Files: src/ops.c
Patch 7.2.293 Patch 7.2.293
Problem: When setting 'comments' option it may be used in a wrong way. Problem: When setting 'comments' option it may be used in a wrong way.
Solution: Don't increment after skipping over digits. (Yukihiro Nakadaira) Solution: Don't increment after skipping over digits. (Yukihiro Nakadaira)
Files: src/misc1.c Files: src/misc1.c
@ -10191,32 +10191,32 @@ More information here: |two-engines|
Better Python interface *better-python-interface* Better Python interface *better-python-interface*
----------------------- -----------------------
Added |python-bindeval| function. Unlike |python-eval| this one returns Added |python-bindeval| function. Unlike |python-eval| this one returns
|python-Dictionary|, |python-List| and |python-Function| objects for |python-Dictionary|, |python-List| and |python-Function| objects for
dictionaries lists and functions respectively in place of their Python dictionaries lists and functions respectively in place of their Python
built-in equivalents (or None if we are talking about function references). built-in equivalents (or None if we are talking about function references).
For simple types this function returns Python built-in types and not only For simple types this function returns Python built-in types and not only
Python `str()` like |python-eval| does. On Python 3 it will return `bytes()` Python `str()` like |python-eval| does. On Python 3 it will return `bytes()`
objects in place of `str()` ones avoiding possibility of UnicodeDecodeError. objects in place of `str()` ones avoiding possibility of UnicodeDecodeError.
Interface of new objects mimics standard Python `dict()` and `list()` Interface of new objects mimics standard Python `dict()` and `list()`
interfaces to some extent. Extent will be improved in the future. interfaces to some extent. Extent will be improved in the future.
Added special |python-vars| objects also available for |python-buffer| and Added special |python-vars| objects also available for |python-buffer| and
|python-window|. They ease access to Vim script variables from Python. |python-window|. They ease access to Vim script variables from Python.
Now you no longer need to alter `sys.path` to import your module: special Now you no longer need to alter `sys.path` to import your module: special
hooks are responsible for importing from {rtp}/python2, {rtp}/python3 and hooks are responsible for importing from {rtp}/python2, {rtp}/python3 and
{rtp}/pythonx directories (for Python 2, Python 3 and both respectively). {rtp}/pythonx directories (for Python 2, Python 3 and both respectively).
See |python-special-path|. See |python-special-path|.
Added possibility to work with |tabpage|s through |python-tabpage| object. Added possibility to work with |tabpage|s through |python-tabpage| object.
Added automatic conversion of Vim errors and exceptions to Python Added automatic conversion of Vim errors and exceptions to Python
exceptions. exceptions.
Changed the behavior of the |python-buffers| object: it now uses buffer numbers Changed the behavior of the |python-buffers| object: it now uses buffer numbers
as keys in place of the index of the buffer in the internal buffer list. as keys in place of the index of the buffer in the internal buffer list.
This should not break anything as the only way to get this index was This should not break anything as the only way to get this index was
iterating over |python-buffers|. iterating over |python-buffers|.
Added |:pydo| and |:py3do| commands. Added |:pydo| and |:py3do| commands.
@ -10226,7 +10226,7 @@ Added the |pyeval()| and |py3eval()| functions.
Now in all places which previously accepted `str()` objects, `str()` and Now in all places which previously accepted `str()` objects, `str()` and
`unicode()` (Python 2) or `bytes()` and `str()` (Python 3) are accepted. `unicode()` (Python 2) or `bytes()` and `str()` (Python 3) are accepted.
|python-window| has gained `.col` and `.row` attributes that are currently |python-window| has gained `.col` and `.row` attributes that are currently
the only way to get internal window positions. the only way to get internal window positions.
Added or fixed support for `dir()` in Vim Python objects. Added or fixed support for `dir()` in Vim Python objects.
@ -10235,12 +10235,12 @@ Added or fixed support for `dir()` in Vim Python objects.
Changed *changed-7.4* Changed *changed-7.4*
------- -------
Old Python versions (≤2.2) are no longer supported. Building with them did Old Python versions (≤2.2) are no longer supported. Building with them did
not work anyway. not work anyway.
Options: Options:
Added ability to automatically save the selection into the system Added ability to automatically save the selection into the system
clipboard when using non-GUI version of Vim (autoselectplus in clipboard when using non-GUI version of Vim (autoselectplus in
'clipboard'). Also added ability to use the system clipboard as 'clipboard'). Also added ability to use the system clipboard as
default register (previously only primary selection could be used). default register (previously only primary selection could be used).
(Ivan Krasilnikov, Christian Brabandt, Bram Moolenaar) (Ivan Krasilnikov, Christian Brabandt, Bram Moolenaar)
@ -10255,12 +10255,12 @@ Options:
'relativenumber'. (Christian Brabandt) 'relativenumber'. (Christian Brabandt)
Commands: Commands:
|:diffoff| now saves the local values of some settings and restores |:diffoff| now saves the local values of some settings and restores
them in place of blindly resetting them to the defaults. (Christian them in place of blindly resetting them to the defaults. (Christian
Brabandt) Brabandt)
Other: Other:
Lua interface now also uses userdata binded to Vim structures. (Taro Lua interface now also uses userdata binded to Vim structures. (Taro
Muraoka, Luis Carvalho) Muraoka, Luis Carvalho)
glob() and autocommand patterns used to work with the undocumented glob() and autocommand patterns used to work with the undocumented
@ -10285,74 +10285,74 @@ Functions:
Added |wildmenumode()| function. (Christian Brabandt) Added |wildmenumode()| function. (Christian Brabandt)
Debugging functions: |screenattr()|, |screenchar()|, |screencol()|, Debugging functions: |screenattr()|, |screenchar()|, |screencol()|,
|screenrow()|. (Simon Ruderich, Bram Moolenaar) |screenrow()|. (Simon Ruderich, Bram Moolenaar)
Added ability to use |Dictionary-function|s for |sort()|ing, via Added ability to use |Dictionary-function|s for |sort()|ing, via
optional third argument. (Nikolay Pavlov) optional third argument. (Nikolay Pavlov)
Added special |expand()| argument that expands to the current line Added special |expand()| argument that expands to the current line
number. number.
Made it possible to force |char2nr()| to always give unicode codepoints Made it possible to force |char2nr()| to always give unicode codepoints
regardless of current encoding. (Yasuhiro Matsumoto) regardless of current encoding. (Yasuhiro Matsumoto)
Made it possible for functions generating file list generate |List| Made it possible for functions generating file list generate |List|
and not NL-separated string. (e.g. |glob()|, |expand()|) (Christian and not NL-separated string. (e.g. |glob()|, |expand()|) (Christian
Brabandt) Brabandt)
Functions that obtain variables from the specific window, tabpage or Functions that obtain variables from the specific window, tabpage or
buffer scope dictionary can now return specified default value in buffer scope dictionary can now return specified default value in
place of empty string in case variable is not found. (|gettabvar()|, place of empty string in case variable is not found. (|gettabvar()|,
|getwinvar()|, |getbufvar()|) (Shougo Matsushita, Hirohito Higashi) |getwinvar()|, |getbufvar()|) (Shougo Matsushita, Hirohito Higashi)
Autocommands: Autocommands:
Added |InsertCharPre| event launched before inserting character. Added |InsertCharPre| event launched before inserting character.
(Jakson A. Aquino) (Jakson A. Aquino)
Added |CompleteDone| event launched after finishing completion in Added |CompleteDone| event launched after finishing completion in
insert mode. (idea by Florian Klein) insert mode. (idea by Florian Klein)
Added |QuitPre| event launched when commands that can either close Vim Added |QuitPre| event launched when commands that can either close Vim
or only some window(s) are launched. or only some window(s) are launched.
Added |TextChanged| and |TextChangedI| events launched when text is Added |TextChanged| and |TextChangedI| events launched when text is
changed. changed.
Commands: Commands:
|:syntime| command useful for debugging. |:syntime| command useful for debugging.
Made it possible to remove all signs from the current buffer using Made it possible to remove all signs from the current buffer using
|:sign-unplace|. (Christian Brabandt) |:sign-unplace|. (Christian Brabandt)
Added |:language| autocompletion. (Dominique Pelle) Added |:language| autocompletion. (Dominique Pelle)
Added more |:command-complete| completion types: |:behave| suboptions, Added more |:command-complete| completion types: |:behave| suboptions,
color schemes, compilers, |:cscope| suboptions, files from 'path', color schemes, compilers, |:cscope| suboptions, files from 'path',
|:history| suboptions, locale names, |:syntime| suboptions, user |:history| suboptions, locale names, |:syntime| suboptions, user
names. (Dominique Pelle) names. (Dominique Pelle)
Added |:map-nowait| creating mapping which when having lhs that is the Added |:map-nowait| creating mapping which when having lhs that is the
prefix of another mappings lhs will not allow Vim to wait for user to prefix of another mappings lhs will not allow Vim to wait for user to
type more characters to resolve ambiguity, forcing Vim to take the type more characters to resolve ambiguity, forcing Vim to take the
shorter alternative: one with <nowait>. shorter alternative: one with <nowait>.
Options: Options:
Made it possible to ignore case when completing: 'wildignorecase'. Made it possible to ignore case when completing: 'wildignorecase'.
Added ability to delete comment leader when using |J| by `j` flag in Added ability to delete comment leader when using |J| by `j` flag in
'formatoptions' (|fo-table|). (Lech Lorens) 'formatoptions' (|fo-table|). (Lech Lorens)
Added ability to control indentation inside namespaces: |cino-N|. Added ability to control indentation inside namespaces: |cino-N|.
(Konstantin Lepa) (Konstantin Lepa)
Added ability to control alignment inside `if` condition separately Added ability to control alignment inside `if` condition separately
from alignment inside function arguments: |cino-k|. (Lech Lorens) from alignment inside function arguments: |cino-k|. (Lech Lorens)
Other: Other:
Improved support for cmd.exe. (Ben Fritz, Bram Moolenaar) Improved support for cmd.exe. (Ben Fritz, Bram Moolenaar)
Added |v:windowid| variable containing current window number in GUI Added |v:windowid| variable containing current window number in GUI
Vim. (Christian J. Robinson, Lech Lorens) Vim. (Christian J. Robinson, Lech Lorens)
Added rxvt-unicode and SGR mouse support. (Yiding Jia, Hayaki Saito) Added rxvt-unicode and SGR mouse support. (Yiding Jia, Hayaki Saito)
@ -11923,7 +11923,7 @@ Solution: Pass the separator character to in_history(). (Taro Muraoka)
Files: src/ex_getln.c Files: src/ex_getln.c
Patch 7.3.266 Patch 7.3.266
Problem: In Gvim with iBus typing space in Insert mode doesn't work. Problem: In gvim with iBus typing space in Insert mode doesn't work.
Solution: Clear xim_expected_char after checking it. Solution: Clear xim_expected_char after checking it.
Files: src/mbyte.c Files: src/mbyte.c
@ -11938,7 +11938,7 @@ Solution: Use O_NOCTTY both in the master and slave. (Bjorn Winckler)
Files: src/os_unix.c Files: src/os_unix.c
Patch 7.3.269 Patch 7.3.269
Problem: 'shellcmdflag' only works with one flag. Problem: 'shellcmdflag' only works with one flag.
Solution: Split into multiple arguments. (Gary Johnson) Solution: Split into multiple arguments. (Gary Johnson)
Files: src/os_unix.c Files: src/os_unix.c
@ -13118,7 +13118,7 @@ Files: src/ops.c
Patch 7.3.477 Patch 7.3.477
Problem: Using ":echo" to output enough lines to scroll, then using "j" and Problem: Using ":echo" to output enough lines to scroll, then using "j" and
"k" at the more prompt, displays the command on top of the output. "k" at the more prompt, displays the command on top of the output.
(Marcin Szamotulski) (Marcin Szamotulski)
Solution: Put the output below the command. (Christian Brabandt) Solution: Put the output below the command. (Christian Brabandt)
Files: src/eval.c Files: src/eval.c
@ -13371,7 +13371,7 @@ Solution: Recognize completefunction returning -3. (Matsushita Shougo)
Files: src/edit.c Files: src/edit.c
Patch 7.3.520 Patch 7.3.520
Problem: Gvim starts up slow on Ubuntu 12.04. Problem: gvim starts up slow on Ubuntu 12.04.
Solution: Move the call to gui_mch_init_check() to after fork(). (Yasuhiro Solution: Move the call to gui_mch_init_check() to after fork(). (Yasuhiro
Matsumoto) Do check $DISPLAY being set. Matsumoto) Do check $DISPLAY being set.
Files: src/gui.c, src/gui_gtk_x11.c, src/proto/gui_gtk_x11.pro Files: src/gui.c, src/gui_gtk_x11.c, src/proto/gui_gtk_x11.pro
@ -13424,7 +13424,7 @@ Solution: Make the count select that many characters or lines. (Christian
Files: src/normal.c Files: src/normal.c
Patch 7.3.530 (after 7.3.520) Patch 7.3.530 (after 7.3.520)
Problem: Gvim does not work when 'guioptions' includes "f". (Davido) Problem: gvim does not work when 'guioptions' includes "f". (Davido)
Solution: Call gui_mch_init_check() when running GUI in the foreground. Solution: Call gui_mch_init_check() when running GUI in the foreground.
(Yasuhiro Matsumoto) (Yasuhiro Matsumoto)
Files: src/gui.c Files: src/gui.c
@ -14287,7 +14287,7 @@ Files: Filelist
Patch 7.3.682 (after 7.3.677) Patch 7.3.682 (after 7.3.677)
Problem: Compiler complains about incompatible types. Problem: Compiler complains about incompatible types.
Solution: Remove type casts. (hint by Danek Duvall) Solution: Remove type casts. (hint by Danek Duvall)
Files: src/edit.c Files: src/edit.c
Patch 7.3.683 Patch 7.3.683
Problem: ":python" may crash when vimbindeval() returns None. Problem: ":python" may crash when vimbindeval() returns None.
@ -16340,7 +16340,7 @@ Solution: Avoid negative argument to vim_strncpy(). (Narendran
Files: src/if_cscope.c Files: src/if_cscope.c
Patch 7.3.1039 Patch 7.3.1039
Problem: New regexp engine does not support \%23c, \%<23c and the like. Problem: New regexp engine does not support \%23c, \%<23c and the like.
Solution: Implement them. (partly by Yasuhiro Matsumoto) Solution: Implement them. (partly by Yasuhiro Matsumoto)
Files: src/regexp.h, src/regexp_nfa.c, src/testdir/test64.in, Files: src/regexp.h, src/regexp_nfa.c, src/testdir/test64.in,
src/testdir/test64.ok src/testdir/test64.ok
@ -17552,9 +17552,9 @@ Solution: Specify a separate viminfo file.
Files: src/testdir/test61.in Files: src/testdir/test61.in
Patch 7.3.1252 Patch 7.3.1252
Problem: Gvim does not find the toolbar bitmap files in ~/vimfiles/bitmaps Problem: gvim does not find the toolbar bitmap files in ~/vimfiles/bitmaps
if the corresponding menu command contains additional characters if the corresponding menu command contains additional characters
like the shortcut marker '&' or if you use a non-english locale. like the shortcut marker '&' or if you use a non-english locale.
Solution: Use menu->en_dname or menu->dname. (Martin Gieseking) Solution: Use menu->en_dname or menu->dname. (Martin Gieseking)
Files: src/gui_w32.c Files: src/gui_w32.c
@ -18175,7 +18175,7 @@ Files: src/window.c
Patch 7.4a.045 Patch 7.4a.045
Problem: Configure does not always find the right library for Lua. Missing Problem: Configure does not always find the right library for Lua. Missing
support for LuaJit. support for LuaJit.
Solution: Improve the configure detection of Lua. (Hiroshi Shirosaki) Solution: Improve the configure detection of Lua. (Hiroshi Shirosaki)
Files: src/Makefile, src/configure.in, src/auto/configure Files: src/Makefile, src/configure.in, src/auto/configure

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
" Vim support file to detect file types " Vim support file to detect file types
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2017 Mar 04 " Last Change: 2017 Jun 04
" Listen very carefully, I will say this only once " Listen very carefully, I will say this only once
if exists("did_load_filetypes") if exists("did_load_filetypes")
@ -288,7 +288,8 @@ au BufNewFile,BufRead *.bib setf bib
au BufNewFile,BufRead *.bst setf bst au BufNewFile,BufRead *.bst setf bst
" BIND configuration " BIND configuration
au BufNewFile,BufRead named.conf,rndc.conf setf named " sudoedit uses namedXXXX.conf
au BufNewFile,BufRead named*.conf,rndc*.conf setf named
" BIND zone " BIND zone
au BufNewFile,BufRead named.root setf bindzone au BufNewFile,BufRead named.root setf bindzone
@ -309,9 +310,10 @@ au BufNewFile,BufRead *.bl setf blank
au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
" Bazel (http://bazel.io) " Bazel (http://bazel.io)
autocmd BufRead,BufNewFile *.bzl,WORKSPACE setfiletype bzl autocmd BufRead,BufNewFile *.bzl,WORKSPACE setf bzl
if has("fname_case") if has("fname_case")
autocmd BufRead,BufNewFile BUILD setfiletype bzl " There is another check for BUILD further below.
autocmd BufRead,BufNewFile BUILD setf bzl
endif endif
" C or lpc " C or lpc
@ -979,7 +981,7 @@ au BufNewFile,BufRead */etc/initng/*/*.i,*.ii setf initng
" Innovation Data Processing " Innovation Data Processing
au BufRead,BufNewFile upstream.dat\c,upstream.*.dat\c,*.upstream.dat\c setf upstreamdat au BufRead,BufNewFile upstream.dat\c,upstream.*.dat\c,*.upstream.dat\c setf upstreamdat
au BufRead,BufNewFile upstream.log\c,upstream.*.log\c,*.upstream.log\c setf upstreamlog au BufRead,BufNewFile fdrupstream.log,upstream.log\c,upstream.*.log\c,*.upstream.log\c,UPSTREAM-*.log\c setf upstreamlog
au BufRead,BufNewFile upstreaminstall.log\c,upstreaminstall.*.log\c,*.upstreaminstall.log\c setf upstreaminstalllog au BufRead,BufNewFile upstreaminstall.log\c,upstreaminstall.*.log\c,*.upstreaminstall.log\c setf upstreaminstalllog
au BufRead,BufNewFile usserver.log\c,usserver.*.log\c,*.usserver.log\c setf usserverlog au BufRead,BufNewFile usserver.log\c,usserver.*.log\c,*.usserver.log\c setf usserverlog
au BufRead,BufNewFile usw2kagt.log\c,usw2kagt.*.log\c,*.usw2kagt.log\c setf usw2kagtlog au BufRead,BufNewFile usw2kagt.log\c,usw2kagt.*.log\c,*.usw2kagt.log\c setf usw2kagtlog
@ -1179,14 +1181,21 @@ au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md setf markdown
" Mason " Mason
au BufNewFile,BufRead *.mason,*.mhtml,*.comp setf mason au BufNewFile,BufRead *.mason,*.mhtml,*.comp setf mason
" Matlab or Objective C " Mathematica, Matlab, Murphi or Objective C
au BufNewFile,BufRead *.m call s:FTm() au BufNewFile,BufRead *.m call s:FTm()
func! s:FTm() func! s:FTm()
let n = 1 let n = 1
while n < 10 let saw_comment = 0 " Whether we've seen a multiline comment leader.
while n < 100
let line = getline(n) let line = getline(n)
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\|//\)' if line =~ '^\s*/\*'
" /* ... */ is a comment in Objective C and Murphi, so we can't conclude
" it's either of them yet, but track this as a hint in case we don't see
" anything more definitive.
let saw_comment = 1
endif
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|//\)'
setf objc setf objc
return return
endif endif
@ -1198,11 +1207,23 @@ func! s:FTm()
setf mma setf mma
return return
endif endif
if line =~ '^\c\s*\(\(type\|var\)\>\|--\)'
setf murphi
return
endif
let n = n + 1 let n = n + 1
endwhile endwhile
if exists("g:filetype_m")
if saw_comment
" We didn't see anything definitive, but this looks like either Objective C
" or Murphi based on the comment leader. Assume the former as it is more
" common.
setf objc
elseif exists("g:filetype_m")
" Use user specified default filetype for .m
exe "setf " . g:filetype_m exe "setf " . g:filetype_m
else else
" Default is matlab
setf matlab setf matlab
endif endif
endfunc endfunc
@ -1366,6 +1387,9 @@ endfunc
" Not Quite C " Not Quite C
au BufNewFile,BufRead *.nqc setf nqc au BufNewFile,BufRead *.nqc setf nqc
" NSE - Nmap Script Engine - uses Lua syntax
au BufNewFile,BufRead *.nse setf lua
" NSIS " NSIS
au BufNewFile,BufRead *.nsi,*.nsh setf nsis au BufNewFile,BufRead *.nsi,*.nsh setf nsis
@ -1414,7 +1438,7 @@ if has("fname_case")
else else
au BufNewFile,BufRead *.pl call s:FTpl() au BufNewFile,BufRead *.pl call s:FTpl()
endif endif
au BufNewFile,BufRead *.plx,*.al setf perl au BufNewFile,BufRead *.plx,*.al,*.psgi setf perl
au BufNewFile,BufRead *.p6,*.pm6,*.pl6 setf perl6 au BufNewFile,BufRead *.p6,*.pm6,*.pl6 setf perl6
func! s:FTpl() func! s:FTpl()
@ -1802,6 +1826,9 @@ au BufNewFile,BufRead *.sa setf sather
" Scala " Scala
au BufNewFile,BufRead *.scala setf scala au BufNewFile,BufRead *.scala setf scala
" SBT - Scala Build Tool
au BufNewFile,BufRead *.sbt setf sbt
" Scilab " Scilab
au BufNewFile,BufRead *.sci,*.sce setf scilab au BufNewFile,BufRead *.sci,*.sce setf scilab
@ -2128,7 +2155,10 @@ au BufNewFile,BufRead ssh_config,*/.ssh/config setf sshconfig
au BufNewFile,BufRead sshd_config setf sshdconfig au BufNewFile,BufRead sshd_config setf sshdconfig
" Stata " Stata
au BufNewFile,BufRead *.ado,*.class,*.do,*.imata,*.mata setf stata au BufNewFile,BufRead *.ado,*.do,*.imata,*.mata setf stata
" Also *.class, but not when it's a Java bytecode file
au BufNewFile,BufRead *.class
\ if getline(1) !~ "^\xca\xfe\xba\xbe" | setf stata | endif
" SMCL " SMCL
au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl setf smcl au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl setf smcl
@ -2281,7 +2311,7 @@ au BufNewFile,BufRead .tidyrc,tidyrc setf tidy
au BufNewFile,BufRead *.tf,.tfrc,tfrc setf tf au BufNewFile,BufRead *.tf,.tfrc,tfrc setf tf
" tmux configuration " tmux configuration
au BufNewFile,BufRead tmux*.conf setf tmux au BufNewFile,BufRead {.,}tmux*.conf setf tmux
" TPP - Text Presentation Program " TPP - Text Presentation Program
au BufNewFile,BufReadPost *.tpp setf tpp au BufNewFile,BufReadPost *.tpp setf tpp
@ -2598,6 +2628,11 @@ au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm')
" Bazaar version control " Bazaar version control
au BufNewFile,BufRead bzr_log.* setf bzr au BufNewFile,BufRead bzr_log.* setf bzr
" Bazel build file
if !has("fname_case")
au BufNewFile,BufRead BUILD setf bzl
endif
" BIND zone " BIND zone
au BufNewFile,BufRead */named/db.*,*/bind/db.* call s:StarSetf('bindzone') au BufNewFile,BufRead */named/db.*,*/bind/db.* call s:StarSetf('bindzone')
@ -2761,12 +2796,12 @@ runtime! ftdetect/*.vim
" state. " state.
augroup END augroup END
" Generic configuration file (check this last, it's just guessing!) " Generic configuration file. Use FALLBACK, it's just guessing!
au filetypedetect BufNewFile,BufRead,StdinReadPost * au filetypedetect BufNewFile,BufRead,StdinReadPost *
\ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat \ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
\ && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#' \ && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
\ || getline(4) =~ '^#' || getline(5) =~ '^#') | \ || getline(4) =~ '^#' || getline(5) =~ '^#') |
\ setf conf | \ setf FALLBACK conf |
\ endif \ endif

View File

@ -1,8 +1,8 @@
" Vim filetype plugin " Vim filetype plugin
" Language: Hamster Script " Language: Hamster Script
" Version: 2.0.6.0 " Version: 2.0.6.0
" Maintainer: David Fishburn <fishburn@ianywhere.com> " Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
" Last Change: Wed Nov 08 2006 12:03:09 PM " Last Change: 2017 Mar 18
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
@ -13,7 +13,7 @@ endif
let b:did_ftplugin = 1 let b:did_ftplugin = 1
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo-=C set cpo&vim
let b:undo_ftplugin = "setl fo< com< tw< commentstring<" let b:undo_ftplugin = "setl fo< com< tw< commentstring<"
\ . "| unlet! b:match_ignorecase b:match_words b:match_skip" \ . "| unlet! b:match_ignorecase b:match_words b:match_skip"

197
runtime/ftplugin/rust.vim Normal file
View File

@ -0,0 +1,197 @@
" Language: Rust
" Description: Vim ftplugin for Rust
" Maintainer: Chris Morgan <me@chrismorgan.info>
" Maintainer: Kevin Ballard <kevin@sb.org>
" Last Change: June 08, 2016
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:save_cpo = &cpo
set cpo&vim
augroup rust.vim
autocmd!
" Variables {{{1
" The rust source code at present seems to typically omit a leader on /*!
" comments, so we'll use that as our default, but make it easy to switch.
" This does not affect indentation at all (I tested it with and without
" leader), merely whether a leader is inserted by default or not.
if exists("g:rust_bang_comment_leader") && g:rust_bang_comment_leader != 0
" Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why,
" but without it, */ gets indented one space even if there were no
" leaders. I'm fairly sure that's a Vim bug.
setlocal comments=s1:/*,mb:*,ex:*/,s0:/*,mb:\ ,ex:*/,:///,://!,://
else
setlocal comments=s0:/*!,m:\ ,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,://
endif
setlocal commentstring=//%s
setlocal formatoptions-=t formatoptions+=croqnl
" j was only added in 7.3.541, so stop complaints about its nonexistence
silent! setlocal formatoptions+=j
" smartindent will be overridden by indentexpr if filetype indent is on, but
" otherwise it's better than nothing.
setlocal smartindent nocindent
if !exists("g:rust_recommended_style") || g:rust_recommended_style != 0
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
setlocal textwidth=99
endif
" This includeexpr isn't perfect, but it's a good start
setlocal includeexpr=substitute(v:fname,'::','/','g')
setlocal suffixesadd=.rs
if exists("g:ftplugin_rust_source_path")
let &l:path=g:ftplugin_rust_source_path . ',' . &l:path
endif
if exists("g:loaded_delimitMate")
if exists("b:delimitMate_excluded_regions")
let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions
endif
let s:delimitMate_extra_excluded_regions = ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
" For this buffer, when delimitMate issues the `User delimitMate_map`
" event in the autocommand system, add the above-defined extra excluded
" regions to delimitMate's state, if they have not already been added.
autocmd User <buffer>
\ if expand('<afile>') ==# 'delimitMate_map' && match(
\ delimitMate#Get("excluded_regions"),
\ s:delimitMate_extra_excluded_regions) == -1
\| let b:delimitMate_excluded_regions =
\ delimitMate#Get("excluded_regions")
\ . s:delimitMate_extra_excluded_regions
\|endif
" For this buffer, when delimitMate issues the `User delimitMate_unmap`
" event in the autocommand system, delete the above-defined extra excluded
" regions from delimitMate's state (the deletion being idempotent and
" having no effect if the extra excluded regions are not present in the
" targeted part of delimitMate's state).
autocmd User <buffer>
\ if expand('<afile>') ==# 'delimitMate_unmap'
\| let b:delimitMate_excluded_regions = substitute(
\ delimitMate#Get("excluded_regions"),
\ '\C\V' . s:delimitMate_extra_excluded_regions,
\ '', 'g')
\|endif
endif
if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
let b:rust_set_foldmethod=1
setlocal foldmethod=syntax
if g:rust_fold == 2
setlocal foldlevel<
else
setlocal foldlevel=99
endif
endif
if has('conceal') && exists('g:rust_conceal') && g:rust_conceal != 0
let b:rust_set_conceallevel=1
setlocal conceallevel=2
endif
" Motion Commands {{{1
" Bind motion commands to support hanging indents
nnoremap <silent> <buffer> [[ :call rust#Jump('n', 'Back')<CR>
nnoremap <silent> <buffer> ]] :call rust#Jump('n', 'Forward')<CR>
xnoremap <silent> <buffer> [[ :call rust#Jump('v', 'Back')<CR>
xnoremap <silent> <buffer> ]] :call rust#Jump('v', 'Forward')<CR>
onoremap <silent> <buffer> [[ :call rust#Jump('o', 'Back')<CR>
onoremap <silent> <buffer> ]] :call rust#Jump('o', 'Forward')<CR>
" Commands {{{1
" See |:RustRun| for docs
command! -nargs=* -complete=file -bang -buffer RustRun call rust#Run(<bang>0, <q-args>)
" See |:RustExpand| for docs
command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -buffer RustExpand call rust#Expand(<bang>0, <q-args>)
" See |:RustEmitIr| for docs
command! -nargs=* -buffer RustEmitIr call rust#Emit("llvm-ir", <q-args>)
" See |:RustEmitAsm| for docs
command! -nargs=* -buffer RustEmitAsm call rust#Emit("asm", <q-args>)
" See |:RustPlay| for docs
command! -range=% RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>)
" See |:RustFmt| for docs
command! -buffer RustFmt call rustfmt#Format()
" See |:RustFmtRange| for docs
command! -range -buffer RustFmtRange call rustfmt#FormatRange(<line1>, <line2>)
" Mappings {{{1
" Bind ⌘R in MacVim to :RustRun
nnoremap <silent> <buffer> <D-r> :RustRun<CR>
" Bind ⌘⇧R in MacVim to :RustRun! pre-filled with the last args
nnoremap <buffer> <D-R> :RustRun! <C-r>=join(b:rust_last_rustc_args)<CR><C-\>erust#AppendCmdLine(' -- ' . join(b:rust_last_args))<CR>
if !exists("b:rust_last_rustc_args") || !exists("b:rust_last_args")
let b:rust_last_rustc_args = []
let b:rust_last_args = []
endif
" Cleanup {{{1
let b:undo_ftplugin = "
\ setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<
\|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth<
\|if exists('b:rust_original_delimitMate_excluded_regions')
\|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions
\|unlet b:rust_original_delimitMate_excluded_regions
\|else
\|unlet! b:delimitMate_excluded_regions
\|endif
\|if exists('b:rust_set_foldmethod')
\|setlocal foldmethod< foldlevel<
\|unlet b:rust_set_foldmethod
\|endif
\|if exists('b:rust_set_conceallevel')
\|setlocal conceallevel<
\|unlet b:rust_set_conceallevel
\|endif
\|unlet! b:rust_last_rustc_args b:rust_last_args
\|delcommand RustRun
\|delcommand RustExpand
\|delcommand RustEmitIr
\|delcommand RustEmitAsm
\|delcommand RustPlay
\|nunmap <buffer> <D-r>
\|nunmap <buffer> <D-R>
\|nunmap <buffer> [[
\|nunmap <buffer> ]]
\|xunmap <buffer> [[
\|xunmap <buffer> ]]
\|ounmap <buffer> [[
\|ounmap <buffer> ]]
\|set matchpairs-=<:>
\"
" }}}1
" Code formatting on save
if get(g:, "rustfmt_autosave", 0)
autocmd BufWritePre *.rs silent! call rustfmt#Format()
endif
augroup END
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set noet sw=8 ts=8:

15
runtime/ftplugin/sbt.vim Normal file
View File

@ -0,0 +1,15 @@
" Vim filetype plugin file
" Language: sbt
" Maintainer: Steven Dobay <stevendobay at protonmail.com>
" License: Same as Vim
" Last Change: 2017.04.30
" ----------------------------------------------------------------------------
if exists('b:did_ftplugin') || &cp
finish
endif
let b:did_ftplugin = 1
runtime! ftplugin/scala.vim

View File

@ -1,8 +1,8 @@
" SQL filetype plugin file " SQL filetype plugin file
" Language: SQL (Common for Oracle, Microsoft SQL Server, Sybase) " 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> " 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 " Download: http://vim.sourceforge.net/script.php?script_id=454
" For more details please use: " For more details please use:
@ -36,6 +36,14 @@
" "
" History " 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) " Version 11.0 (May 2013)
" "
" NF: Updated to use SyntaxComplete's new regex support for syntax groups. " NF: Updated to use SyntaxComplete's new regex support for syntax groups.
@ -80,15 +88,17 @@
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if exists("b:did_ftplugin") " This ftplugin can be used with other ftplugins. So ensure loading
finish " 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 endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
" Disable autowrapping for code, but enable for comments " 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 " c Auto-wrap comments using textwidth, inserting the current comment
" leader automatically. " leader automatically.
setlocal formatoptions-=t setlocal formatoptions-=t
@ -171,6 +181,9 @@ if !exists("*SQL_SetType")
if exists("b:current_syntax") if exists("b:current_syntax")
" echomsg 'SQLSetType - clearing syntax' " echomsg 'SQLSetType - clearing syntax'
syntax clear syntax clear
if exists("b:current_syntax")
unlet b:current_syntax
endif
endif endif
if exists("b:did_indent") if exists("b:did_indent")
" echomsg 'SQLSetType - clearing indent' " echomsg 'SQLSetType - clearing indent'
@ -187,7 +200,7 @@ if !exists("*SQL_SetType")
" Do not specify a buffer local variable if it is " Do not specify a buffer local variable if it is
" the default value " the default value
if new_sql_type == 'sql' if new_sql_type == 'sql'
let new_sql_type = 'sqloracle' let new_sql_type = 'sqloracle'
endif endif
let b:sql_type_override = new_sql_type let b:sql_type_override = new_sql_type
@ -234,25 +247,26 @@ if exists("b:sql_type_override")
" echo 'sourcing buffer ftplugin/'.b:sql_type_override.'.vim' " echo 'sourcing buffer ftplugin/'.b:sql_type_override.'.vim'
if globpath(&runtimepath, 'ftplugin/'.b:sql_type_override.'.vim') != '' if globpath(&runtimepath, 'ftplugin/'.b:sql_type_override.'.vim') != ''
exec 'runtime ftplugin/'.b:sql_type_override.'.vim' exec 'runtime ftplugin/'.b:sql_type_override.'.vim'
" else " else
" echomsg 'ftplugin/'.b:sql_type_override.' not exist, using default' " echomsg 'ftplugin/'.b:sql_type_override.' not exist, using default'
endif endif
elseif exists("g:sql_type_default") elseif exists("g:sql_type_default")
" echo 'sourcing global ftplugin/'.g:sql_type_default.'.vim' " echo 'sourcing global ftplugin/'.g:sql_type_default.'.vim'
if globpath(&runtimepath, 'ftplugin/'.g:sql_type_default.'.vim') != '' if globpath(&runtimepath, 'ftplugin/'.g:sql_type_default.'.vim') != ''
exec 'runtime ftplugin/'.g:sql_type_default.'.vim' exec 'runtime ftplugin/'.g:sql_type_default.'.vim'
" else " else
" echomsg 'ftplugin/'.g:sql_type_default.'.vim not exist, using default' " echomsg 'ftplugin/'.g:sql_type_default.'.vim not exist, using default'
endif endif
endif endif
" If the above runtime command succeeded, do not load the default settings " If the above runtime command succeeded, do not load the default settings
if exists("b:did_ftplugin") " as they should have already been loaded from a previous run.
finish if exists("b:did_ftplugin") && exists("b:current_ftplugin") && b:current_ftplugin == 'sql'
finish
endif endif
let b:undo_ftplugin = "setl comments< formatoptions< define< omnifunc<" . 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 " Don't load another plugin for this buffer
let b:did_ftplugin = 1 let b:did_ftplugin = 1
@ -261,7 +275,7 @@ let b:current_ftplugin = 'sql'
" Win32 can filter files in the browse dialog " Win32 can filter files in the browse dialog
if has("gui_win32") && !exists("b:browsefilter") if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "SQL Files (*.sql)\t*.sql\n" . let b:browsefilter = "SQL Files (*.sql)\t*.sql\n" .
\ "All Files (*.*)\t*.*\n" \ "All Files (*.*)\t*.*\n"
endif endif
" Some standard expressions for use with the matchit strings " Some standard expressions for use with the matchit strings
@ -312,14 +326,24 @@ if !exists("b:match_words")
" WHEN column_not_found THEN " WHEN column_not_found THEN
" WHEN OTHERS THEN " WHEN OTHERS THEN
" "
" begin try
" end try
" begin catch
" end catch
"
" create[ or replace] procedure|function|event " create[ or replace] procedure|function|event
" \ '^\s*\<\%(do\|for\|while\|loop\)\>.*:'. " \ '^\s*\<\%(do\|for\|while\|loop\)\>.*:'.
" For ColdFusion support " For ColdFusion support
setlocal matchpairs+=<:> setlocal matchpairs+=<:>
let b:match_words = &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\>:'. \ s:notend . '\<if\>:'.
\ '\<elsif\>\|\<elseif\>\|\<else\>:'. \ '\<elsif\>\|\<elseif\>\|\<else\>:'.
\ '\<end\s\+if\>,'. \ '\<end\s\+if\>,'.
@ -339,14 +363,14 @@ if !exists("b:match_words")
\ '\%(\<create\s\+' . s:or_replace . '\)\?'. \ '\%(\<create\s\+' . s:or_replace . '\)\?'.
\ '\%(function\|procedure\|event\):'. \ '\%(function\|procedure\|event\):'.
\ '\<returns\?\>' \ '\<returns\?\>'
" \ '\<begin\>\|\<returns\?\>:'. " \ '\<begin\>\|\<returns\?\>:'.
" \ '\<end\>\(;\)\?\s*$' " \ '\<end\>\(;\)\?\s*$'
" \ '\<exception\>:'.s:when_no_matched_or_others. " \ '\<exception\>:'.s:when_no_matched_or_others.
" \ ':\<when\s\+others\>,'. " \ ':\<when\s\+others\>,'.
" "
" \ '\%(\<exception\>\|\%('. s:notend . '\<case\>\)\):'. " \ '\%(\<exception\>\|\%('. s:notend . '\<case\>\)\):'.
" \ '\%(\<default\>\|'.s:when_no_matched_or_others.'\):'. " \ '\%(\<default\>\|'.s:when_no_matched_or_others.'\):'.
" \ '\%(\%(\<when\s\+others\>\)\|\<end\s\+case\>\),' . " \ '\%(\%(\<when\s\+others\>\)\|\<end\s\+case\>\),' .
endif endif
" Define how to find the macro definition of a variable using the various " Define how to find the macro definition of a variable using the various

View File

@ -1,7 +1,8 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: Tmux config " Language: tmux(1) configuration file
" Maintainer: Eric Pruitt <eric.pruitt@gmail.com> " URL: https://github.com/ericpruitt/tmux.vim/
" Last Change: 2017 Mar 04 " Maintainer: Eric Pruitt <eric.pruitt@gmail.com>
" Last Changed: 2017 Mar 10
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish

View File

@ -84,7 +84,7 @@ function GetDTDIndent()
let [declaration, end] = s:lex1(line, col) let [declaration, end] = s:lex1(line, col)
if declaration == "" if declaration == ""
return indent + &sw return indent + shiftwidth()
elseif declaration == '--' elseif declaration == '--'
" Were looking at a comment. Now, simply determine if the comment is " Were looking at a comment. Now, simply determine if the comment is
" terminated or not. If it isnt, let Vim take care of that using " terminated or not. If it isnt, let Vim take care of that using
@ -100,7 +100,7 @@ function GetDTDIndent()
" Check for element name. If none exists, indent one level. " Check for element name. If none exists, indent one level.
let [name, end] = s:lex(line, end) let [name, end] = s:lex(line, end)
if name == "" if name == ""
return indent + &sw return indent + shiftwidth()
endif endif
" Check for token following element name. This can be a specification of " Check for token following element name. This can be a specification of
@ -113,7 +113,7 @@ function GetDTDIndent()
let n += 1 let n += 1
endwhile endwhile
if token == "" if token == ""
return indent + &sw return indent + shiftwidth()
endif endif
" Next comes the content model. If the token weve found isnt a " Next comes the content model. If the token weve found isnt a
@ -148,7 +148,7 @@ function GetDTDIndent()
return indent return indent
endif endif
" TODO: Should use s:lex here on getline(v:lnum) and check for >. " 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 endif
" If weve seen an addition or exception already and this is of the same " If weve seen an addition or exception already and this is of the same
@ -167,7 +167,7 @@ function GetDTDIndent()
" Check for element name. If none exists, indent one level. " Check for element name. If none exists, indent one level.
let [name, end] = s:lex(line, end) let [name, end] = s:lex(line, end)
if name == "" if name == ""
return indent + &sw return indent + shiftwidth()
endif endif
" Check for any number of attributes. " Check for any number of attributes.
@ -180,7 +180,7 @@ function GetDTDIndent()
let [name, end] = s:lex(line, end) let [name, end] = s:lex(line, end)
if name == "" if name == ""
" TODO: Should use s:lex here on getline(v:lnum) and check for >. " 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 == ">" elseif name == ">"
return indent return indent
endif endif
@ -194,14 +194,14 @@ function GetDTDIndent()
" (CDATA|NMTOKEN|NMTOKENS|ID|IDREF|IDREFS|ENTITY|ENTITIES)? " (CDATA|NMTOKEN|NMTOKENS|ID|IDREF|IDREFS|ENTITY|ENTITIES)?
let [value, end] = s:lex(line, end, '^\%((\|[^[:space:]]\+\)') let [value, end] = s:lex(line, end, '^\%((\|[^[:space:]]\+\)')
if value == "" if value == ""
return indent + &sw * 2 return indent + shiftwidth() * 2
elseif value == 'NOTATION' elseif value == 'NOTATION'
" If this is a enumerated value based on notations, read another token " If this is a enumerated value based on notations, read another token
" for the actual value. If it doesnt exist, indent three levels. " for the actual value. If it doesnt exist, indent three levels.
" TODO: If validating according to above, value must be equal to '('. " TODO: If validating according to above, value must be equal to '('.
let [value, end] = s:lex(line, end, '^\%((\|[^[:space:]]\+\)') let [value, end] = s:lex(line, end, '^\%((\|[^[:space:]]\+\)')
if value == "" if value == ""
return indent + &sw * 3 return indent + shiftwidth() * 3
endif endif
endif endif
@ -216,13 +216,13 @@ function GetDTDIndent()
" two levels. " two levels.
let [default, end] = s:lex(line, end, '^\%("\_[^"]*"\|#\(REQUIRED\|IMPLIED\|FIXED\)\)') let [default, end] = s:lex(line, end, '^\%("\_[^"]*"\|#\(REQUIRED\|IMPLIED\|FIXED\)\)')
if default == "" if default == ""
return indent + &sw * 2 return indent + shiftwidth() * 2
elseif default == '#FIXED' elseif default == '#FIXED'
" We need to look for the fixed value. If non exists, indent three " We need to look for the fixed value. If non exists, indent three
" levels. " levels.
let [default, end] = s:lex(line, end, '^"\_[^"]*"') let [default, end] = s:lex(line, end, '^"\_[^"]*"')
if default == "" if default == ""
return indent + &sw * 3 return indent + shiftwidth() * 3
endif endif
endif endif
endwhile endwhile
@ -233,11 +233,11 @@ function GetDTDIndent()
" again, if none exists, indent one level. " again, if none exists, indent one level.
let [name, end] = s:lex(line, end) let [name, end] = s:lex(line, end)
if name == "" if name == ""
return indent + &sw return indent + shiftwidth()
elseif name == '%' elseif name == '%'
let [name, end] = s:lex(line, end) let [name, end] = s:lex(line, end)
if name == "" if name == ""
return indent + &sw return indent + shiftwidth()
endif endif
endif endif
@ -256,27 +256,27 @@ function GetDTDIndent()
" were now done with this entity. " were now done with this entity.
let [value, end] = s:lex(line, end) let [value, end] = s:lex(line, end)
if value == "" if value == ""
return indent + &sw return indent + shiftwidth()
elseif value == 'SYSTEM' || value == 'PUBLIC' elseif value == 'SYSTEM' || value == 'PUBLIC'
let [quoted_string, end] = s:lex(line, end, '\%("[^"]\+"\|''[^'']\+''\)') let [quoted_string, end] = s:lex(line, end, '\%("[^"]\+"\|''[^'']\+''\)')
if quoted_string == "" if quoted_string == ""
return indent + &sw * 2 return indent + shiftwidth() * 2
endif endif
if value == 'PUBLIC' if value == 'PUBLIC'
let [quoted_string, end] = s:lex(line, end, '\%("[^"]\+"\|''[^'']\+''\)') let [quoted_string, end] = s:lex(line, end, '\%("[^"]\+"\|''[^'']\+''\)')
if quoted_string == "" if quoted_string == ""
return indent + &sw * 2 return indent + shiftwidth() * 2
endif endif
endif endif
let [ndata, end] = s:lex(line, end) let [ndata, end] = s:lex(line, end)
if ndata == "" if ndata == ""
return indent + &sw return indent + shiftwidth()
endif endif
let [name, end] = s:lex(line, end) let [name, end] = s:lex(line, end)
return name == "" ? (indent + &sw * 2) : indent return name == "" ? (indent + shiftwidth() * 2) : indent
else else
return indent return indent
endif endif
@ -284,24 +284,24 @@ function GetDTDIndent()
" Check for notation name. If none exists, indent one level. " Check for notation name. If none exists, indent one level.
let [name, end] = s:lex(line, end) let [name, end] = s:lex(line, end)
if name == "" if name == ""
return indent + &sw return indent + shiftwidth()
endif endif
" Now check for the external ID. If none exists, indent one level. " Now check for the external ID. If none exists, indent one level.
let [id, end] = s:lex(line, end) let [id, end] = s:lex(line, end)
if id == "" if id == ""
return indent + &sw return indent + shiftwidth()
elseif id == 'SYSTEM' || id == 'PUBLIC' elseif id == 'SYSTEM' || id == 'PUBLIC'
let [quoted_string, end] = s:lex(line, end, '\%("[^"]\+"\|''[^'']\+''\)') let [quoted_string, end] = s:lex(line, end, '\%("[^"]\+"\|''[^'']\+''\)')
if quoted_string == "" if quoted_string == ""
return indent + &sw * 2 return indent + shiftwidth() * 2
endif endif
if id == 'PUBLIC' if id == 'PUBLIC'
let [quoted_string, end] = s:lex(line, end, '\%("[^"]\+"\|''[^'']\+''\|>\)') let [quoted_string, end] = s:lex(line, end, '\%("[^"]\+"\|''[^'']\+''\|>\)')
if quoted_string == "" if quoted_string == ""
" TODO: Should use s:lex here on getline(v:lnum) and check for >. " 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 == '>' elseif quoted_string == '>'
return indent return indent
endif endif

View File

@ -2,9 +2,10 @@
" Language: Eiffel " Language: Eiffel
" Maintainer: Jocelyn Fiat <jfiat@eiffel.com> " Maintainer: Jocelyn Fiat <jfiat@eiffel.com>
" Previous-Maintainer: David Clarke <gadicath@dishevelled.net> " Previous-Maintainer: David Clarke <gadicath@dishevelled.net>
" Contributions from: Takuya Fujiwara
" Contributions from: Thilo Six " Contributions from: Thilo Six
" $Date: 2004/12/09 21:33:52 $ " $Date: 2017/03/08 06:00:00 $
" $Revision: 1.3 $ " $Revision: 1.4 $
" URL: https://github.com/eiffelhub/vim-eiffel " URL: https://github.com/eiffelhub/vim-eiffel
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
@ -28,7 +29,7 @@ let b:undo_indent = "setl smartindent< indentkeys< indentexpr< autoindent< comme
" Define some stuff " Define some stuff
" keywords grouped by indenting " keywords grouped by indenting
let s:trust_user_indent = '\(+\)\(\s*\(--\).*\)\=$' 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:outdent = '^\s*\(else\|invariant\|variant\|do\|require\|until\|loop\|local\)\>'
let s:no_indent = '^\s*\(class\|feature\|creation\|inherit\)\>' let s:no_indent = '^\s*\(class\|feature\|creation\|inherit\)\>'
let s:single_dent = '^[^-]\+[[:alnum:]]\+ is\(\s*\(--\).*\)\=$' let s:single_dent = '^[^-]\+[[:alnum:]]\+ is\(\s*\(--\).*\)\=$'
@ -63,23 +64,23 @@ function GetEiffelIndent()
" Add a 'shiftwidth' after lines that start with an indent word " Add a 'shiftwidth' after lines that start with an indent word
let ind = indent(lnum) let ind = indent(lnum)
if getline(lnum) =~ s:relative_indent if getline(lnum) =~ s:relative_indent
let ind = ind + &sw let ind = ind + shiftwidth()
endif endif
" Indent to single indent " Indent to single indent
if getline(v:lnum) =~ s:single_dent && getline(v:lnum) !~ s:relative_indent if getline(v:lnum) =~ s:single_dent && getline(v:lnum) !~ s:relative_indent
\ && getline(v:lnum) !~ '\s*\<\(and\|or\|implies\)\>' \ && getline(v:lnum) !~ '\s*\<\(and\|or\|implies\)\>'
let ind = &sw let ind = shiftwidth()
endif endif
" Indent to double indent " Indent to double indent
if getline(v:lnum) =~ s:inheritance_dent if getline(v:lnum) =~ s:inheritance_dent
let ind = 2 * &sw let ind = 2 * shiftwidth()
endif endif
" Indent line after the first line of the function definition " Indent line after the first line of the function definition
if getline(lnum) =~ s:single_dent if getline(lnum) =~ s:single_dent
let ind = ind + &sw let ind = ind + shiftwidth()
endif endif
" The following should always be at the start of a line, no indenting " The following should always be at the start of a line, no indenting
@ -91,17 +92,17 @@ function GetEiffelIndent()
" or first thing after the 'do' " or first thing after the 'do'
if getline(v:lnum) =~ s:outdent && getline(v:lnum - 1) !~ s:single_dent if getline(v:lnum) =~ s:outdent && getline(v:lnum - 1) !~ s:single_dent
\ && getline(v:lnum - 1) !~ '^\s*do\>' \ && getline(v:lnum - 1) !~ '^\s*do\>'
let ind = ind - &sw let ind = ind - shiftwidth()
endif endif
" Subtract a shiftwidth for end statements " Subtract a shiftwidth for end statements
if getline(v:lnum) =~ '^\s*end\>' if getline(v:lnum) =~ '^\s*end\>'
let ind = ind - &sw let ind = ind - shiftwidth()
endif endif
" set indent of zero end statements that are at an indent of 3, this should " set indent of zero end statements that are at an indent of 3, this should
" only ever be the class's end. " 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 let ind = 0
endif endif

View File

@ -25,11 +25,11 @@ function GetEtermIndent()
let ind = indent(lnum) let ind = indent(lnum)
if getline(lnum) =~ '^\s*begin\>' if getline(lnum) =~ '^\s*begin\>'
let ind = ind + &sw let ind = ind + shiftwidth()
endif endif
if getline(v:lnum) =~ '^\s*end\>' if getline(v:lnum) =~ '^\s*end\>'
let ind = ind - &sw let ind = ind - shiftwidth()
endif endif
return ind return ind

View File

@ -30,11 +30,11 @@ function GetFrameScriptIndent()
let ind = indent(lnum) let ind = indent(lnum)
if getline(lnum) =~? '^\s*\%(If\|Loop\|Sub\)' if getline(lnum) =~? '^\s*\%(If\|Loop\|Sub\)'
let ind = ind + &sw let ind = ind + shiftwidth()
endif endif
if getline(v:lnum) =~? '^\s*\%(Else\|End\%(If\|Loop\|Sub\)\)' if getline(v:lnum) =~? '^\s*\%(Else\|End\%(If\|Loop\|Sub\)\)'
let ind = ind - &sw let ind = ind - shiftwidth()
endif endif
return ind return ind

View File

@ -1,12 +1,14 @@
" Vim indent file " Vim indent file
" Language: Java " Language: Java
" Previous Maintainer: Toby Allsopp <toby.allsopp@peace.com> " Previous Maintainer: Toby Allsopp <toby.allsopp@peace.com>
" Current Maintainer: Hong Xu <xuhdev@gmail.com> " Current Maintainer: Hong Xu <hong@topbug.net>
" Last Change: 2012 May 18 " Homepage: http://www.vim.org/scripts/script.php?script_id=3899
" Version: 1.0 " https://github.com/xuhdev/indent-java.vim
" Last Change: 2016 Mar 7
" Version: 1.1
" License: Same as Vim. " License: Same as Vim.
" Copyright (c) 2012 Hong Xu " Copyright (c) 2012-2016 Hong Xu
" Before 2012, this file is maintained by Toby Allsopp. " Before 2012, this file was maintained by Toby Allsopp.
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
if exists("b:did_indent") if exists("b:did_indent")
@ -29,6 +31,7 @@ let b:undo_indent = "set cin< cino< indentkeys< indentexpr<"
if exists("*GetJavaIndent") if exists("*GetJavaIndent")
finish finish
endif endif
let s:keepcpo= &cpo let s:keepcpo= &cpo
set cpo&vim set cpo&vim
@ -70,7 +73,7 @@ function GetJavaIndent()
" If the previous line starts with '@', we should have the same indent as " If the previous line starts with '@', we should have the same indent as
" the previous one " the previous one
if getline(lnum) =~ '^\s*@\S\+\s*$' if getline(lnum) =~ '^\s*@.*$'
return indent(lnum) return indent(lnum)
endif endif
@ -85,9 +88,9 @@ function GetJavaIndent()
" Try to align "throws" lines for methods and "extends" and "implements" for " Try to align "throws" lines for methods and "extends" and "implements" for
" classes. " classes.
if getline(v:lnum) =~ '^\s*\(extends\|implements\)\>' if getline(v:lnum) =~ '^\s*\(throws\|extends\|implements\)\>'
\ && getline(lnum) !~ '^\s*\(extends\|implements\)\>' \ && getline(lnum) !~ '^\s*\(throws\|extends\|implements\)\>'
let theIndent = theIndent + &sw let theIndent = theIndent + shiftwidth()
endif endif
" correct for continuation lines of "throws", "implements" and "extends" " correct for continuation lines of "throws", "implements" and "extends"
@ -96,27 +99,27 @@ function GetJavaIndent()
if strlen(cont_kw) > 0 if strlen(cont_kw) > 0
let amount = strlen(cont_kw) + 1 let amount = strlen(cont_kw) + 1
if getline(lnum) !~ ',\s*$' if getline(lnum) !~ ',\s*$'
let theIndent = theIndent - (amount + &sw) let theIndent = theIndent - (amount + shiftwidth())
if theIndent < 0 if theIndent < 0
let theIndent = 0 let theIndent = 0
endif endif
elseif prev == lnum elseif prev == lnum
let theIndent = theIndent + amount let theIndent = theIndent + amount
if cont_kw ==# 'throws' if cont_kw ==# 'throws'
let theIndent = theIndent + &sw let theIndent = theIndent + shiftwidth()
endif endif
endif endif
elseif getline(prev) =~ '^\s*\(throws\|implements\|extends\)\>' elseif getline(prev) =~ '^\s*\(throws\|implements\|extends\)\>'
\ && (getline(prev) =~ '{\s*$' \ && (getline(prev) =~ '{\s*$'
\ || getline(v:lnum) =~ '^\s*{\s*$') \ || getline(v:lnum) =~ '^\s*{\s*$')
let theIndent = theIndent - &sw let theIndent = theIndent - shiftwidth()
endif endif
" When the line starts with a }, try aligning it with the matching {, " When the line starts with a }, try aligning it with the matching {,
" skipping over "throws", "extends" and "implements" clauses. " skipping over "throws", "extends" and "implements" clauses.
if getline(v:lnum) =~ '^\s*}\s*\(//.*\|/\*.*\)\=$' if getline(v:lnum) =~ '^\s*}\s*\(//.*\|/\*.*\)\=$'
call cursor(v:lnum, 1) call cursor(v:lnum, 1)
silent normal % silent normal! %
let lnum = line('.') let lnum = line('.')
if lnum < v:lnum if lnum < v:lnum
while lnum > 1 while lnum > 1

View File

@ -2,7 +2,7 @@
" Language: Javascript " Language: Javascript
" Maintainer: Chris Paul ( https://github.com/bounceme ) " Maintainer: Chris Paul ( https://github.com/bounceme )
" URL: https://github.com/pangloss/vim-javascript " URL: https://github.com/pangloss/vim-javascript
" Last Change: December 31, 2016 " Last Change: March 21, 2017
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
if exists('b:did_indent') if exists('b:did_indent')
@ -14,6 +14,10 @@ let b:did_indent = 1
setlocal indentexpr=GetJavascriptIndent() setlocal indentexpr=GetJavascriptIndent()
setlocal autoindent nolisp nosmartindent setlocal autoindent nolisp nosmartindent
setlocal indentkeys+=0],0) setlocal indentkeys+=0],0)
" Testable with something like:
" vim -eNs "+filetype plugin indent on" "+syntax on" "+set ft=javascript" \
" "+norm! gg=G" '+%print' '+:q!' testfile.js \
" | diff -uBZ testfile.js -
let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<' let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<'
@ -32,10 +36,14 @@ if exists('*shiftwidth')
endfunction endfunction
else else
function s:sw() function s:sw()
return &sw return &l:shiftwidth == 0 ? &l:tabstop : &l:shiftwidth
endfunction endfunction
endif endif
" Performance for forwards search(): start search at pos rather than masking
" matches before pos.
let s:z = has('patch-7.4.984') ? 'z' : ''
" searchpair() wrapper " searchpair() wrapper
if has('reltime') if has('reltime')
function s:GetPair(start,end,flags,skip,time,...) function s:GetPair(start,end,flags,skip,time,...)
@ -48,34 +56,41 @@ else
endif endif
" Regex of syntax group names that are or delimit string or are comments. " Regex of syntax group names that are or delimit string or are comments.
let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template' let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template\%(braces\)\@!'
let s:syng_str = 'string\|template' let s:syng_str = 'string\|template\|special'
let s:syng_com = 'comment\|doc' let s:syng_com = 'comment\|doc'
" Expression used to check whether we should skip a match with searchpair(). " 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."'" 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() function s:skip_func()
if !s:free || search('\m`\|\*\/','nW',s:looksyn) if getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$'
let s:free = !eval(s:skip_expr) return eval(s:skip_expr)
let s:looksyn = s:free ? line('.') : s:looksyn elseif s:checkIn || search('\m`\|\${\|\*\/','nW'.s:z,s:looksyn)
return !s:free let s:checkIn = eval(s:skip_expr)
endif endif
let s:looksyn = line('.') let s:looksyn = line('.')
return (search('\m\/','nbW',s:looksyn) || search('\m[''"]\|\\$','nW',s:looksyn)) && eval(s:skip_expr) return s:checkIn
endfunction endfunction
function s:alternatePair(stop) function s:alternatePair(stop)
let pos = getpos('.')[1:2] let pos = getpos('.')[1:2]
while search('\m[][(){}]','bW',a:stop) let pat = '[][(){};]'
if !s:skip_func() while search('\m'.pat,'bW',a:stop)
let idx = stridx('])}',s:looking_at()) if s:skip_func() | continue | endif
if idx + 1 let idx = stridx('])};',s:looking_at())
if !s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,a:stop) if idx is 3 | let pat = '[{}()]' | continue | endif
break if idx + 1
endif if s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,a:stop) <= 0
else break
return
endif endif
else
return
endif endif
endwhile endwhile
call call('cursor',pos) call call('cursor',pos)
@ -100,93 +115,91 @@ function s:token()
return s:looking_at() =~ '\k' ? expand('<cword>') : s:looking_at() return s:looking_at() =~ '\k' ? expand('<cword>') : s:looking_at()
endfunction endfunction
function s:b_token()
if s:looking_at() =~ '\k'
call search('\m\<','cbW')
endif
return search('\m\S','bW')
endfunction
function s:previous_token() function s:previous_token()
let l:n = line('.') let l:pos = getpos('.')[1:2]
while s:b_token() if search('\m\k\{1,}\zs\k\|\S','bW')
if (s:looking_at() == '/' || line('.') != l:n && search('\m\/\/','nbW', if (getline('.')[col('.')-2:col('.')-1] == '*/' || line('.') != l:pos[0] &&
\ line('.'))) && s:syn_at(line('.'),col('.')) =~? s:syng_com \ getline('.') =~ '\%<'.col('.').'c\/\/') && s:syn_at(line('.'),col('.')) =~? s:syng_com
call search('\m\_[^/]\zs\/[/*]','bW') while search('\m\S\ze\_s*\/[/*]','bW')
if s:syn_at(line('.'),col('.')) !~? s:syng_com
return s:token()
endif
endwhile
else else
return s:token() return s:token()
endif endif
endwhile endif
call call('cursor',l:pos)
return '' return ''
endfunction endfunction
function s:others(p) function s:expr_col()
return "((line2byte(line('.')) + col('.')) <= ".(line2byte(a:p[0]) + a:p[1]).") || ".s:skip_expr if getline('.')[col('.')-2] == ':'
endfunction return 1
function s:tern_skip(p)
return s:GetPair('{','}','nbW',s:others(a:p),200,a:p[0]) > 0
endfunction
function s:tern_col(p)
return s:GetPair('?',':\@<!::\@!','nbW',s:others(a:p)
\ .' || s:tern_skip('.string(a:p).')',200,a:p[0]) > 0
endfunction
function s:label_col()
let pos = getpos('.')[1:2]
let [s:looksyn,s:free] = pos
call s:alternatePair(0)
if s:save_pos('s:IsBlock')
let poss = getpos('.')[1:2]
return call('cursor',pos) || !s:tern_col(poss)
elseif s:looking_at() == ':'
return !s:tern_col([0,0])
endif endif
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()]
endwhile
endfunction endfunction
" configurable regexes that define continuation lines, not including (, {, or [. " configurable regexes that define continuation lines, not including (, {, or [.
let s:opfirst = '^' . get(g:,'javascript_opfirst', let s:opfirst = '^' . get(g:,'javascript_opfirst',
\ '\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)') \ '\C\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)')
let s:continuation = get(g:,'javascript_continuation', let s:continuation = get(g:,'javascript_continuation',
\ '\%([<=,.~!?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<\%(typeof\|delete\|void\|in\|instanceof\)\)') . '$' \ '\C\%([-+<>=,.~!?/*^%|&:]\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$'
function s:continues(ln,con) function s:continues(ln,con)
return !cursor(a:ln, match(' '.a:con,s:continuation)) && if !cursor(a:ln, match(' '.a:con,s:continuation))
\ eval((['s:syn_at(line("."),col(".")) !~? "regex"'] + let teol = s:looking_at()
\ repeat(['s:previous_token() != "."'],5) + [1])[ if teol == '/'
\ index(split('/ typeof in instanceof void delete'),s:token())]) 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
endif
endfunction endfunction
" get the line of code stripped of comments and move cursor to the last " get the line of code stripped of comments and move cursor to the last
" non-comment char. " non-comment char.
function s:Trim(ln) function s:Trim(ln)
let pline = substitute(getline(a:ln),'\s*$','','') let pline = substitute(getline(a:ln),'\s*$','','')
let l:max = max([match(pline,'.*[^/]\zs\/[/*]'),0]) let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
while l:max && s:syn_at(a:ln, strlen(pline)) =~? s:syng_com while l:max != -1 && s:syn_at(a:ln, strlen(pline)) =~? s:syng_com
let pline = substitute(strpart(pline, 0, l:max),'\s*$','','') let pline = pline[: l:max]
let l:max = max([match(pline,'.*[^/]\zs\/[/*]'),0]) let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
let pline = substitute(pline[:-2],'\s*$','','')
endwhile endwhile
return cursor(a:ln,strlen(pline)) ? pline : pline return pline is '' || cursor(a:ln,strlen(pline)) ? pline : pline
endfunction endfunction
" Find line above 'lnum' that isn't empty or in a comment " Find line above 'lnum' that isn't empty or in a comment
function s:PrevCodeLine(lnum) function s:PrevCodeLine(lnum)
let l:n = prevnonblank(a:lnum) let [l:pos, l:n] = [getpos('.')[1:2], prevnonblank(a:lnum)]
while l:n while l:n
if getline(l:n) =~ '^\s*\/[/*]' if getline(l:n) =~ '^\s*\/[/*]'
if (stridx(getline(l:n),'`') > 0 || getline(l:n-1)[-1:] == '\') &&
\ s:syn_at(l:n,1) =~? s:syng_str
return l:n
endif
let l:n = prevnonblank(l:n-1) let l:n = prevnonblank(l:n-1)
elseif s:syn_at(l:n,1) =~? s:syng_com elseif stridx(getline(l:n), '*/') + 1 && s:syn_at(l:n,1) =~? s:syng_com
let l:n = s:save_pos('eval', call cursor(l:n,1)
\ 'cursor('.l:n.',1) + search(''\m\/\*'',"bW")') keepjumps norm! [*
let l:n = search('\m\S','nbW')
else else
return l:n break
endif endif
endwhile endwhile
call call('cursor',l:pos)
return l:n
endfunction endfunction
" Check if line 'lnum' has a balanced amount of parentheses. " Check if line 'lnum' has a balanced amount of parentheses.
@ -201,7 +214,9 @@ function s:Balanced(lnum)
return return
endif endif
endif endif
let pos = match(l:line, '[][(){}]', pos + 1) let pos = match(l:line, (l:open ?
\ '['.escape(tr(l:line[pos],'({[]})',')}][{(').l:line[pos],']').']' :
\ '[][(){}]'), pos + 1)
endwhile endwhile
return !l:open return !l:open
endfunction endfunction
@ -210,11 +225,11 @@ function s:OneScope(lnum)
let pline = s:Trim(a:lnum) let pline = s:Trim(a:lnum)
let kw = 'else do' let kw = 'else do'
if pline[-1:] == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0 if pline[-1:] == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
call s:previous_token() if s:previous_token() =~# '^\%(await\|each\)$'
let kw = 'for if let while with'
if index(split('await each'),s:token()) + 1
call s:previous_token() call s:previous_token()
let kw = 'for' let kw = 'for'
else
let kw = 'for if let while with'
endif endif
endif endif
return pline[-2:] == '=>' || index(split(kw),s:token()) + 1 && return pline[-2:] == '=>' || index(split(kw),s:token()) + 1 &&
@ -246,18 +261,23 @@ function s:IsBlock()
if s:looking_at() == '{' if s:looking_at() == '{'
let l:n = line('.') let l:n = line('.')
let char = s:previous_token() let char = s:previous_token()
let syn = char =~ '[{>/]' ? s:syn_at(line('.'),col('.')-(char == '{')) : '' if match(s:stack,'\cxml\|jsx') + 1 && s:syn_at(line('.'),col('.')-1) =~? 'xml\|jsx'
if syn =~? 'xml\|jsx'
return char != '{' return char != '{'
elseif char =~ '\k' elseif char =~ '\k'
return index(split('return const let import export yield default delete var await void typeof throw case new in instanceof') if char ==# 'type'
\ ,char) < (line('.') != l:n) || s:previous_token() == '.' 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 == '>' elseif char == '>'
return getline('.')[col('.')-2] == '=' || syn =~? '^jsflow' return getline('.')[col('.')-2] == '=' || s:syn_at(line('.'),col('.')) =~? '^jsflow'
elseif char == ':' elseif char == ':'
return getline('.')[col('.')-2] != ':' && s:label_col() return !s:save_pos('s:expr_col')
elseif char == '/'
return s:syn_at(line('.'),col('.')) =~? 'regex'
endif endif
return syn =~? 'regex' || char !~ '[-=~!<*+,/?^%|&([]' return char !~ '[=~!<*,?^%|&([]' &&
\ (char !~ '[-+]' || l:n != line('.') && getline('.')[col('.')-2] == char)
endif endif
endfunction endfunction
@ -266,7 +286,9 @@ function GetJavascriptIndent()
" Get the current line. " Get the current line.
call cursor(v:lnum,1) call cursor(v:lnum,1)
let l:line = getline('.') let l:line = getline('.')
let syns = s:syn_at(v:lnum, 1) " 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,'')
" start with strings,comments,etc. " start with strings,comments,etc.
if syns =~? s:syng_com if syns =~? s:syng_com
@ -275,7 +297,7 @@ function GetJavascriptIndent()
elseif l:line !~ '^\s*\/[/*]' elseif l:line !~ '^\s*\/[/*]'
return -1 return -1
endif endif
elseif syns =~? s:syng_str && l:line !~ '^[''"]' elseif syns =~? s:syng_str
if b:js_cache[0] == v:lnum - 1 && s:Balanced(v:lnum-1) if b:js_cache[0] == v:lnum - 1 && s:Balanced(v:lnum-1)
let b:js_cache[0] = v:lnum let b:js_cache[0] = v:lnum
endif endif
@ -295,69 +317,60 @@ function GetJavascriptIndent()
endif endif
" the containing paren, bracket, or curly. Many hacks for performance " the containing paren, bracket, or curly. Many hacks for performance
let idx = strlen(l:line) ? stridx('])}',l:line[0]) : -1 let idx = index([']',')','}'],l:line[0])
if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum && if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum)) \ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))
call call('cursor',b:js_cache[1:]) call call('cursor',b:js_cache[1:])
else else
let [s:looksyn, s:free, top] = [v:lnum - 1, 1, (!indent(l:lnum) && let [s:looksyn, s:checkIn, top] = [v:lnum - 1, 0, (!indent(l:lnum) &&
\ s:syn_at(l:lnum,1) !~? s:syng_str) * l:lnum] \ s:syn_at(l:lnum,1) !~? s:syng_str) * l:lnum]
if idx + 1 if idx + 1
call s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,top) call s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:skip_func()',2000,top)
elseif indent(v:lnum) && syns =~? 'block' elseif getline(v:lnum) !~ '^\S' && syns =~? 'block'
call s:GetPair('{','}','bW','s:skip_func()',2000,top) call s:GetPair('{','}','bW','s:skip_func()',2000,top)
else else
call s:alternatePair(top) call s:alternatePair(top)
endif endif
endif endif
if idx + 1 || l:line[:1] == '|}'
if idx == 2 && search('\m\S','bW',line('.')) && s:looking_at() == ')'
call s:GetPair('(',')','bW',s:skip_expr,200)
endif
return indent('.')
endif
let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [0,0] : getpos('.')[1:2]) let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [0,0] : getpos('.')[1:2])
let num = b:js_cache[1] let num = b:js_cache[1]
let [s:W, isOp, bL, switch_offset] = [s:sw(),0,0,0] let [s:W, isOp, bL, switch_offset] = [s:sw(),0,0,0]
if !num || s:IsBlock() if !num || s:IsBlock()
let ilnum = line('.')
let pline = s:save_pos('s:Trim',l:lnum) let pline = s:save_pos('s:Trim',l:lnum)
if num && s:looking_at() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0 if num && s:looking_at() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
let num = line('.') let num = ilnum == num ? line('.') : num
if s:previous_token() ==# 'switch' && s:previous_token() != '.' if idx < 0 && s:previous_token() ==# 'switch' && s:previous_token() != '.'
if &cino !~ ':' || !has('float') if &cino !~ ':'
let switch_offset = s:W let switch_offset = s:W
else else
let cinc = matchlist(&cino,'.*:\(-\)\=\([0-9.]*\)\(s\)\=\C') let switch_offset = max([-indent(num),s:parse_cino(':')])
let switch_offset = float2nr(str2float(cinc[1].(strlen(cinc[2]) ? cinc[2] : strlen(cinc[3])))
\ * (strlen(cinc[3]) ? s:W : 1))
endif endif
if pline[-1:] != '.' && l:line =~# '^\%(default\|case\)\>' if pline[-1:] != '.' && l:line =~# '^\%(default\|case\)\>'
return indent(num) + switch_offset return indent(num) + switch_offset
endif endif
endif endif
endif endif
if pline[-1:] !~ '[{;]' if idx < 0 && pline[-1:] !~ '[{;]'
if pline =~# ':\@<!:$' let isOp = (l:line =~# s:opfirst || s:continues(l:lnum,pline)) * s:W
call cursor(l:lnum,strlen(pline)) let bL = s:iscontOne(l:lnum,b:js_cache[1],isOp)
let isOp = s:tern_col(b:js_cache[1:2])
else
let isOp = l:line =~# s:opfirst || s:continues(l:lnum,pline)
endif
let bL = s:iscontOne(l:lnum,num,isOp)
let bL -= (bL && l:line[0] == '{') * s:W let bL -= (bL && l:line[0] == '{') * s:W
endif 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])
endif endif
" main return " main return
if isOp if l:line =~ '^\%([])}]\||}\)'
return (num ? indent(num) : -s:W) + (s:W * 2) + switch_offset + bL return max([indent(num),0])
elseif num elseif num
return indent(num) + s:W + switch_offset + bL return indent(num) + s:W + switch_offset + bL + isOp
endif endif
return bL return bL + isOp
endfunction endfunction
let &cpo = s:cpo_save let &cpo = s:cpo_save

View File

@ -65,7 +65,7 @@ function GetLDIndent()
if line =~ '^\s*\*' if line =~ '^\s*\*'
return cindent(v:lnum) return cindent(v:lnum)
elseif line =~ '^\s*}' elseif line =~ '^\s*}'
return indent(v:lnum) - &sw return indent(v:lnum) - shiftwidth()
endif endif
let pnum = s:prevnonblanknoncomment(v:lnum - 1) let pnum = s:prevnonblanknoncomment(v:lnum - 1)
@ -73,11 +73,11 @@ function GetLDIndent()
return 0 return 0
endif 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) let pline = getline(pnum)
if pline =~ '}\s*$' 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 endif
return ind return ind

View File

@ -48,14 +48,14 @@ function GetMakeIndent()
if prev_prev_line =~ s:continuation_rx if prev_prev_line =~ s:continuation_rx
return indent(prev_lnum) return indent(prev_lnum)
elseif prev_line =~ s:rule_rx elseif prev_line =~ s:rule_rx
return &sw return shiftwidth()
elseif prev_line =~ s:assignment_rx elseif prev_line =~ s:assignment_rx
call cursor(prev_lnum, 1) call cursor(prev_lnum, 1)
if search(s:assignment_rx, 'W') != 0 if search(s:assignment_rx, 'W') != 0
return virtcol('.') - 1 return virtcol('.') - 1
else else
" TODO: ? " TODO: ?
return &sw return shiftwidth()
endif endif
else else
" TODO: OK, this might be a continued shell command, so perhaps indent " TODO: OK, this might be a continued shell command, so perhaps indent
@ -66,7 +66,7 @@ function GetMakeIndent()
" return indent(prev_lnum) + 2 " return indent(prev_lnum) + 2
" endif " endif
"endif "endif
return indent(prev_lnum) + &sw return indent(prev_lnum) + shiftwidth()
endif endif
elseif prev_prev_line =~ s:continuation_rx elseif prev_prev_line =~ s:continuation_rx
let folded_line = s:remove_continuation(prev_prev_line) . ' ' . s:remove_continuation(prev_line) let folded_line = s:remove_continuation(prev_prev_line) . ' ' . s:remove_continuation(prev_line)
@ -102,13 +102,13 @@ function GetMakeIndent()
return &ts return &ts
endif endif
elseif prev_line =~ s:conditional_directive_rx elseif prev_line =~ s:conditional_directive_rx
return &sw return shiftwidth()
else else
let line = getline(v:lnum) let line = getline(v:lnum)
if line =~ s:just_inserted_rule_rx if line =~ s:just_inserted_rule_rx
return 0 return 0
elseif line =~ s:end_conditional_directive_rx 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 else
return v:lnum - 1 == 0 ? 0 : indent(v:lnum - 1) return v:lnum - 1 == 0 ? 0 : indent(v:lnum - 1)
endif endif

View File

@ -3,8 +3,8 @@
" Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr> " Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr>
" URL: http://www.2072productions.com/vim/indent/php.vim " URL: http://www.2072productions.com/vim/indent/php.vim
" Home: https://github.com/2072/PHP-Indenting-for-VIm " Home: https://github.com/2072/PHP-Indenting-for-VIm
" Last Change: 2015 September 8th " Last Change: 2017 March 12th
" Version: 1.60 " Version: 1.62
" "
" "
" Type :help php-indent for available options " Type :help php-indent for available options
@ -141,11 +141,13 @@ let s:PHP_validVariable = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)' let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)'
let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|\%(}\s*\)\?else\>\|do\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|trait\>\|use\>\|interface\>\|abstract\>\|final\>\|try\>\|\%(}\s*\)\=catch\>\|\%(}\s*\)\=finally\>\)' let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|\%(}\s*\)\?else\>\|do\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|trait\>\|use\>\|interface\>\|abstract\>\|final\>\|try\>\|\%(}\s*\)\=catch\>\|\%(}\s*\)\=finally\>\)'
let s:functionDecl = '\<function\>\%(\s\+'.s:PHP_validVariable.'\)\=\s*(.*' let s:functionDecl = '\<function\>\%(\s\+'.s:PHP_validVariable.'\)\=\s*(.*'
let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$' let s:endline = '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
let s:unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.s:endline
let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<\s*[''"]\=\a\w*[''"]\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)\|^[^''"`]*[''"`]$' let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<\s*[''"]\=\a\w*[''"]\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)'
let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!' let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
let s:structureHead = '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline . '\|\<new\s\+class\>'
@ -214,10 +216,28 @@ function! GetLastRealCodeLNum(startline) " {{{
let lnum = lnum - 1 let lnum = lnum - 1
endwhile endwhile
elseif lastline =~ '^[^''"`]*[''"`][;,]'.s:endline elseif lastline =~ '^[^''"`]*[''"`][;,]'.s:endline
let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$', '')
while getline(lnum) !~? tofind && lnum > 1 let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$\\|^[^\1]\\+[=([]\\s*[\1]', '')
let lnum = lnum - 1 let trylnum = lnum
while getline(trylnum) !~? tofind && trylnum > 1
let trylnum = trylnum - 1
endwhile endwhile
if trylnum == 1
break
else
if lastline =~ ';'.s:endline
while getline(trylnum) !~? s:terminated && getline(trylnum) !~? '{'.s:endline && trylnum > 1
let trylnum = prevnonblank(trylnum - 1)
endwhile
if trylnum == 1
break
end
end
let lnum = trylnum
end
else else
break break
endif endif
@ -262,7 +282,7 @@ function! FindOpenBracket(lnum, blockStarter) " {{{
while line > 1 while line > 1
let linec = getline(line) let linec = getline(line)
if linec =~ s:terminated || linec =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline if linec =~ s:terminated || linec =~ s:structureHead
break break
endif endif
@ -273,6 +293,20 @@ function! FindOpenBracket(lnum, blockStarter) " {{{
return line return line
endfun " }}} endfun " }}}
let s:blockChars = {'{':1, '[': 1, '(': 1, ')':-1, ']':-1, '}':-1}
function! BalanceDirection (str)
let balance = 0
for c in split(a:str, '\zs')
if has_key(s:blockChars, c)
let balance += s:blockChars[c]
endif
endfor
return balance
endfun
function! FindTheIfOfAnElse (lnum, StopAfterFirstPrevElse) " {{{ function! FindTheIfOfAnElse (lnum, StopAfterFirstPrevElse) " {{{
if getline(a:lnum) =~# '^\s*}\s*else\%(if\)\=\>' if getline(a:lnum) =~# '^\s*}\s*else\%(if\)\=\>'
@ -457,7 +491,7 @@ function! GetPhpIndent()
if synname!="" if synname!=""
if synname == "SpecStringEntrails" if synname == "SpecStringEntrails"
let b:InPHPcode = -1 let b:InPHPcode = -1 " thumb down
let b:InPHPcode_tofind = "" let b:InPHPcode_tofind = ""
elseif synname != "phpHereDoc" && synname != "phpHereDocDelimiter" elseif synname != "phpHereDoc" && synname != "phpHereDocDelimiter"
let b:InPHPcode = 1 let b:InPHPcode = 1
@ -540,7 +574,7 @@ function! GetPhpIndent()
let b:InPHPcode_and_script = 1 let b:InPHPcode_and_script = 1
endif endif
elseif last_line =~ '^[^''"`]\+[''"`]$' elseif last_line =~ '^[^''"`]\+[''"`]$' " a string identifier with nothing after it and no other string identifier before
let b:InPHPcode = -1 let b:InPHPcode = -1
let b:InPHPcode_tofind = substitute( last_line, '^.*\([''"`]\).*$', '^[^\1]*\1[;,]$', '') let b:InPHPcode_tofind = substitute( last_line, '^.*\([''"`]\).*$', '^[^\1]*\1[;,]$', '')
elseif last_line =~? '<<<\s*[''"]\=\a\w*[''"]\=$' elseif last_line =~? '<<<\s*[''"]\=\a\w*[''"]\=$'
@ -660,7 +694,8 @@ function! GetPhpIndent()
let terminated = s:terminated let terminated = s:terminated
let unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.endline let unstated = s:unstated
if ind != b:PHP_default_indenting && cline =~# '^\s*else\%(if\)\=\>' if ind != b:PHP_default_indenting && cline =~# '^\s*else\%(if\)\=\>'
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
@ -673,7 +708,7 @@ function! GetPhpIndent()
while last_line_num > 1 while last_line_num > 1
if previous_line =~ terminated || previous_line =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . endline if previous_line =~ terminated || previous_line =~ s:structureHead
let ind = indent(last_line_num) let ind = indent(last_line_num)
@ -689,7 +724,7 @@ function! GetPhpIndent()
endwhile endwhile
elseif last_line =~# unstated && cline !~ '^\s*);\='.endline elseif last_line =~# unstated && cline !~ '^\s*);\='.endline
let ind = ind + s:sw() let ind = ind + s:sw() " we indent one level further when the preceding line is not stated
return ind + addSpecial return ind + addSpecial
elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated
@ -699,7 +734,7 @@ function! GetPhpIndent()
let isSingleLineBlock = 0 let isSingleLineBlock = 0
while 1 while 1
if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline " XXX
call cursor(last_line_num, 1) call cursor(last_line_num, 1)
if previous_line !~ '^}' if previous_line !~ '^}'
@ -780,10 +815,10 @@ function! GetPhpIndent()
if !LastLineClosed if !LastLineClosed
if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline && BalanceDirection(last_line) > 0
let dontIndent = 0 let dontIndent = 0
if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*)\s*{'.endline && last_line !~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*[)\]]\+\s*{'.endline && last_line !~ s:structureHead
let dontIndent = 1 let dontIndent = 1
endif endif
@ -797,9 +832,9 @@ function! GetPhpIndent()
return ind + addSpecial return ind + addSpecial
endif endif
elseif last_line =~ '\S\+\s*),'.endline elseif last_line =~ '\S\+\s*),'.endline && BalanceDirection(last_line) < 0
call cursor(lnum, 1) call cursor(lnum, 1)
call search('),'.endline, 'W') call search('),'.endline, 'W') " line never begins with ) so no need for 'c' flag
let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()') let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()')
if openedparent != lnum if openedparent != lnum
let ind = indent(openedparent) let ind = indent(openedparent)
@ -809,7 +844,7 @@ function! GetPhpIndent()
let ind = ind + s:sw() let ind = ind + s:sw()
elseif AntepenultimateLine =~ '{'.endline || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase elseif AntepenultimateLine =~ '{'.endline && AntepenultimateLine !~? '^\s*use\>' || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase
let ind = ind + s:sw() let ind = ind + s:sw()
endif endif

View File

@ -274,7 +274,7 @@ function GetRIndent()
let nlnum = s:Get_prev_line(nlnum) let nlnum = s:Get_prev_line(nlnum)
let nline = SanitizeRLine(getline(nlnum)) . nline let nline = SanitizeRLine(getline(nlnum)) . nline
endwhile endwhile
if nline =~ '^\s*function\s*(' && indent(nlnum) == &sw if nline =~ '^\s*function\s*(' && indent(nlnum) == shiftwidth()
return 0 return 0
endif endif
endif endif
@ -285,7 +285,7 @@ function GetRIndent()
" line is an incomplete command: " line is an incomplete command:
if line =~ '\<\(if\|while\|for\|function\)\s*()$' || line =~ '\<else$' || line =~ '<-$' || line =~ '->$' if line =~ '\<\(if\|while\|for\|function\)\s*()$' || line =~ '\<else$' || line =~ '<-$' || line =~ '->$'
return indent(lnum) + &sw return indent(lnum) + shiftwidth()
endif endif
" Deal with () and [] " Deal with () and []
@ -293,14 +293,14 @@ function GetRIndent()
let pb = s:Get_paren_balance(line, '(', ')') let pb = s:Get_paren_balance(line, '(', ')')
if line =~ '^\s*{$' || line =~ '(\s*{' || (pb == 0 && (line =~ '{$' || line =~ '(\s*{$')) if line =~ '^\s*{$' || line =~ '(\s*{' || (pb == 0 && (line =~ '{$' || line =~ '(\s*{$'))
return indent(lnum) + &sw return indent(lnum) + shiftwidth()
endif endif
let s:curtabstop = repeat(' ', &tabstop) let s:curtabstop = repeat(' ', &tabstop)
if g:r_indent_align_args == 1 if g:r_indent_align_args == 1
if pb > 0 && line =~ '{$' if pb > 0 && line =~ '{$'
return s:Get_last_paren_idx(line, '(', ')', pb) + &sw return s:Get_last_paren_idx(line, '(', ')', pb) + shiftwidth()
endif endif
let bb = s:Get_paren_balance(line, '[', ']') let bb = s:Get_paren_balance(line, '[', ']')
@ -364,11 +364,11 @@ function GetRIndent()
if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0 if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
return indent(lnum) return indent(lnum)
else else
return indent(lnum) + &sw return indent(lnum) + shiftwidth()
endif endif
else else
if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0 if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
return indent(lnum) - &sw return indent(lnum) - shiftwidth()
endif endif
endif endif
endif endif
@ -383,7 +383,7 @@ function GetRIndent()
let line = linepiece . line let line = linepiece . line
endwhile endwhile
if line =~ '{$' && post_block == 0 if line =~ '{$' && post_block == 0
return indent(lnum) + &sw return indent(lnum) + shiftwidth()
endif endif
" Now we can do some tests again " Now we can do some tests again
@ -393,19 +393,19 @@ function GetRIndent()
if post_block == 0 if post_block == 0
let newl = SanitizeRLine(line) let newl = SanitizeRLine(line)
if newl =~ '\<\(if\|while\|for\|function\)\s*()$' || newl =~ '\<else$' || newl =~ '<-$' if newl =~ '\<\(if\|while\|for\|function\)\s*()$' || newl =~ '\<else$' || newl =~ '<-$'
return indent(lnum) + &sw return indent(lnum) + shiftwidth()
endif endif
endif endif
endif endif
if cline =~ '^\s*else' if cline =~ '^\s*else'
if line =~ '<-\s*if\s*()' if line =~ '<-\s*if\s*()'
return indent(lnum) + &sw return indent(lnum) + shiftwidth()
else else
if line =~ '\<if\s*()' if line =~ '\<if\s*()'
return indent(lnum) return indent(lnum)
else else
return indent(lnum) - &sw return indent(lnum) - shiftwidth()
endif endif
endif endif
endif endif
@ -474,12 +474,12 @@ function GetRIndent()
let ind = indent(lnum) let ind = indent(lnum)
if g:r_indent_align_args == 0 && pb != 0 if g:r_indent_align_args == 0 && pb != 0
let ind += pb * &sw let ind += pb * shiftwidth()
return ind return ind
endif endif
if g:r_indent_align_args == 0 && bb != 0 if g:r_indent_align_args == 0 && bb != 0
let ind += bb * &sw let ind += bb * shiftwidth()
return ind return ind
endif endif
@ -489,7 +489,7 @@ function GetRIndent()
let pind = 0 let pind = 0
endif endif
if ind == pind || (ind == (pind + &sw) && pline =~ '{$' && ppost_else == 0) if ind == pind || (ind == (pind + shiftwidth()) && pline =~ '{$' && ppost_else == 0)
return ind return ind
endif endif
@ -509,7 +509,7 @@ function GetRIndent()
let pbb = s:Get_paren_balance(pline, '[', ']') let pbb = s:Get_paren_balance(pline, '[', ']')
endwhile endwhile
let pind = indent(plnum) let pind = indent(plnum)
if ind == (pind + &sw) && pline =~ '{$' if ind == (pind + shiftwidth()) && pline =~ '{$'
return ind return ind
endif endif
endwhile endwhile

View File

@ -25,11 +25,11 @@ function GetReadlineIndent()
let ind = indent(lnum) let ind = indent(lnum)
if getline(lnum) =~ '^\s*$\(if\|else\)\>' if getline(lnum) =~ '^\s*$\(if\|else\)\>'
let ind = ind + &sw let ind = ind + shiftwidth()
endif endif
if getline(v:lnum) =~ '^\s*$\(else\|endif\)\>' if getline(v:lnum) =~ '^\s*$\(else\|endif\)\>'
let ind = ind - &sw let ind = ind - shiftwidth()
endif endif
return ind return ind

View File

@ -82,7 +82,7 @@ function GetRHelpIndent()
let closeb = strlen(line2) - strlen(line3) let closeb = strlen(line2) - strlen(line3)
let bb = openb - closeb let bb = openb - closeb
let ind = indent(lnum) + (bb * &sw) let ind = indent(lnum) + (bb * shiftwidth())
if line =~ '^\s*}\s*$' if line =~ '^\s*}\s*$'
let ind = indent(lnum) let ind = indent(lnum)

213
runtime/indent/rust.vim Normal file
View File

@ -0,0 +1,213 @@
" Vim indent file
" Language: Rust
" Author: Chris Morgan <me@chrismorgan.info>
" Last Change: 2017 Mar 21
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal cindent
setlocal cinoptions=L0,(0,Ws,J1,j1
setlocal cinkeys=0{,0},!^F,o,O,0[,0]
" Don't think cinwords will actually do anything at all... never mind
setlocal cinwords=for,if,else,while,loop,impl,mod,unsafe,trait,struct,enum,fn,extern
" Some preliminary settings
setlocal nolisp " Make sure lisp indenting doesn't supersede us
setlocal autoindent " indentexpr isn't much help otherwise
" Also do indentkeys, otherwise # gets shoved to column 0 :-/
setlocal indentkeys=0{,0},!^F,o,O,0[,0]
setlocal indentexpr=GetRustIndent(v:lnum)
" Only define the function once.
if exists("*GetRustIndent")
finish
endif
let s:save_cpo = &cpo
set cpo&vim
" Come here when loading the script the first time.
function! s:get_line_trimmed(lnum)
" Get the line and remove a trailing comment.
" Use syntax highlighting attributes when possible.
" NOTE: this is not accurate; /* */ or a line continuation could trick it
let line = getline(a:lnum)
let line_len = strlen(line)
if has('syntax_items')
" If the last character in the line is a comment, do a binary search for
" the start of the comment. synID() is slow, a linear search would take
" too long on a long line.
if synIDattr(synID(a:lnum, line_len, 1), "name") =~ 'Comment\|Todo'
let min = 1
let max = line_len
while min < max
let col = (min + max) / 2
if synIDattr(synID(a:lnum, col, 1), "name") =~ 'Comment\|Todo'
let max = col
else
let min = col + 1
endif
endwhile
let line = strpart(line, 0, min - 1)
endif
return substitute(line, "\s*$", "", "")
else
" Sorry, this is not complete, nor fully correct (e.g. string "//").
" Such is life.
return substitute(line, "\s*//.*$", "", "")
endif
endfunction
function! s:is_string_comment(lnum, col)
if has('syntax_items')
for id in synstack(a:lnum, a:col)
let synname = synIDattr(id, "name")
if synname == "rustString" || synname =~ "^rustComment"
return 1
endif
endfor
else
" without syntax, let's not even try
return 0
endif
endfunction
function GetRustIndent(lnum)
" Starting assumption: cindent (called at the end) will do it right
" normally. We just want to fix up a few cases.
let line = getline(a:lnum)
if has('syntax_items')
let synname = synIDattr(synID(a:lnum, 1, 1), "name")
if synname == "rustString"
" If the start of the line is in a string, don't change the indent
return -1
elseif synname =~ '\(Comment\|Todo\)'
\ && line !~ '^\s*/\*' " not /* opening line
if synname =~ "CommentML" " multi-line
if line !~ '^\s*\*' && getline(a:lnum - 1) =~ '^\s*/\*'
" This is (hopefully) the line after a /*, and it has no
" leader, so the correct indentation is that of the
" previous line.
return GetRustIndent(a:lnum - 1)
endif
endif
" If it's in a comment, let cindent take care of it now. This is
" for cases like "/*" where the next line should start " * ", not
" "* " as the code below would otherwise cause for module scope
" Fun fact: " /*\n*\n*/" takes two calls to get right!
return cindent(a:lnum)
endif
endif
" cindent gets second and subsequent match patterns/struct members wrong,
" as it treats the comma as indicating an unfinished statement::
"
" match a {
" b => c,
" d => e,
" f => g,
" };
" Search backwards for the previous non-empty line.
let prevlinenum = prevnonblank(a:lnum - 1)
let prevline = s:get_line_trimmed(prevlinenum)
while prevlinenum > 1 && prevline !~ '[^[:blank:]]'
let prevlinenum = prevnonblank(prevlinenum - 1)
let prevline = s:get_line_trimmed(prevlinenum)
endwhile
" Handle where clauses nicely: subsequent values should line up nicely.
if prevline[len(prevline) - 1] == ","
\ && prevline =~# '^\s*where\s'
return indent(prevlinenum) + 6
endif
if prevline[len(prevline) - 1] == ","
\ && s:get_line_trimmed(a:lnum) !~ '^\s*[\[\]{}]'
\ && prevline !~ '^\s*fn\s'
\ && prevline !~ '([^()]\+,$'
\ && s:get_line_trimmed(a:lnum) !~ '^\s*\S\+\s*=>'
" Oh ho! The previous line ended in a comma! I bet cindent will try to
" take this too far... For now, let's normally use the previous line's
" indent.
" One case where this doesn't work out is where *this* line contains
" square or curly brackets; then we normally *do* want to be indenting
" further.
"
" Another case where we don't want to is one like a function
" definition with arguments spread over multiple lines:
"
" fn foo(baz: Baz,
" baz: Baz) // <-- cindent gets this right by itself
"
" Another case is similar to the previous, except calling a function
" instead of defining it, or any conditional expression that leaves
" an open paren:
"
" foo(baz,
" baz);
"
" if baz && (foo ||
" bar) {
"
" Another case is when the current line is a new match arm.
"
" There are probably other cases where we don't want to do this as
" well. Add them as needed.
return indent(prevlinenum)
endif
if !has("patch-7.4.355")
" cindent before 7.4.355 doesn't do the module scope well at all; e.g.::
"
" static FOO : &'static [bool] = [
" true,
" false,
" false,
" true,
" ];
"
" uh oh, next statement is indented further!
" Note that this does *not* apply the line continuation pattern properly;
" that's too hard to do correctly for my liking at present, so I'll just
" start with these two main cases (square brackets and not returning to
" column zero)
call cursor(a:lnum, 1)
if searchpair('{\|(', '', '}\|)', 'nbW',
\ 's:is_string_comment(line("."), col("."))') == 0
if searchpair('\[', '', '\]', 'nbW',
\ 's:is_string_comment(line("."), col("."))') == 0
" Global scope, should be zero
return 0
else
" At the module scope, inside square brackets only
"if getline(a:lnum)[0] == ']' || search('\[', '', '\]', 'nW') == a:lnum
if line =~ "^\\s*]"
" It's the closing line, dedent it
return 0
else
return &shiftwidth
endif
endif
endif
endif
" Fall back on cindent, which does it mostly right
return cindent(a:lnum)
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo

138
runtime/indent/sas.vim Normal file
View File

@ -0,0 +1,138 @@
" 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

View File

@ -412,24 +412,24 @@ function! GetScalaIndent()
if prevline =~ '^\s*\.' if prevline =~ '^\s*\.'
return ind return ind
else else
return ind + &shiftwidth return ind + shiftwidth()
endif endif
endif endif
" Indent html literals " Indent html literals
if prevline !~ '/>\s*$' && prevline =~ '^\s*<[a-zA-Z][^>]*>\s*$' if prevline !~ '/>\s*$' && prevline =~ '^\s*<[a-zA-Z][^>]*>\s*$'
call scala#ConditionalConfirm("3") call scala#ConditionalConfirm("3")
return ind + &shiftwidth return ind + shiftwidth()
endif endif
" assumes curly braces around try-block " assumes curly braces around try-block
if curline =~ '^\s*}\s*\<catch\>' if curline =~ '^\s*}\s*\<catch\>'
return ind - &shiftwidth return ind - shiftwidth()
elseif curline =~ '^\s*\<catch\>' elseif curline =~ '^\s*\<catch\>'
return ind return ind
endif 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 '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 '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) if (prevline =~ '^\s*\<\%(\%(}\?\s*else\s\+\)\?if\|for\|while\)\>.*[)=]\s*$' && scala#NumberOfBraceGroups(prevline) <= 1)
@ -438,7 +438,7 @@ function! GetScalaIndent()
\ || prevline =~ '^\s*\%(}\s*\)\?\<else\>\s*$' \ || prevline =~ '^\s*\%(}\s*\)\?\<else\>\s*$'
\ || prevline =~ '=\s*$' \ || prevline =~ '=\s*$'
call scala#ConditionalConfirm("4") call scala#ConditionalConfirm("4")
let ind = ind + &shiftwidth let ind = ind + shiftwidth()
elseif prevline =~ '^\s*\<\%(}\?\s*else\s\+\)\?if\>' && curline =~ '^\s*}\?\s*\<else\>' elseif prevline =~ '^\s*\<\%(}\?\s*else\s\+\)\?if\>' && curline =~ '^\s*}\?\s*\<else\>'
return ind return ind
endif endif
@ -447,7 +447,7 @@ function! GetScalaIndent()
let bracketCount = scala#CountBrackets(prevline, '{', '}') let bracketCount = scala#CountBrackets(prevline, '{', '}')
if bracketCount > 0 || prevline =~ '.*{\s*$' if bracketCount > 0 || prevline =~ '.*{\s*$'
call scala#ConditionalConfirm("5b") call scala#ConditionalConfirm("5b")
let ind = ind + &shiftwidth let ind = ind + shiftwidth()
elseif bracketCount < 0 elseif bracketCount < 0
call scala#ConditionalConfirm("6b") call scala#ConditionalConfirm("6b")
" if the closing brace actually completes the braces entirely, then we " if the closing brace actually completes the braces entirely, then we
@ -475,7 +475,7 @@ function! GetScalaIndent()
let bracketCount = scala#CountBrackets(prevline, '(', ')') let bracketCount = scala#CountBrackets(prevline, '(', ')')
if bracketCount > 0 || prevline =~ '.*(\s*$' if bracketCount > 0 || prevline =~ '.*(\s*$'
call scala#ConditionalConfirm("5a") call scala#ConditionalConfirm("5a")
let ind = ind + &shiftwidth let ind = ind + shiftwidth()
elseif bracketCount < 0 elseif bracketCount < 0
call scala#ConditionalConfirm("6a") call scala#ConditionalConfirm("6a")
" if the closing brace actually completes the braces entirely, then we " if the closing brace actually completes the braces entirely, then we
@ -497,7 +497,7 @@ function! GetScalaIndent()
else else
" This is the only part that's different from from the '{', '}' one below " This is the only part that's different from from the '{', '}' one below
" Yup... some refactoring is necessary at some point. " Yup... some refactoring is necessary at some point.
let ind = ind + (bracketCount * &shiftwidth) let ind = ind + (bracketCount * shiftwidth())
let lineCompletedBrackets = 1 let lineCompletedBrackets = 1
endif endif
endif endif
@ -506,10 +506,10 @@ function! GetScalaIndent()
if curline =~ '^\s*}\?\s*\<else\>\%(\s\+\<if\>\s*(.*)\)\?\s*{\?\s*$' && if curline =~ '^\s*}\?\s*\<else\>\%(\s\+\<if\>\s*(.*)\)\?\s*{\?\s*$' &&
\ ! scala#LineIsCompleteIf(prevline) && \ ! scala#LineIsCompleteIf(prevline) &&
\ prevline !~ '^.*}\s*$' \ prevline !~ '^.*}\s*$'
let ind = ind - &shiftwidth let ind = ind - shiftwidth()
endif endif
" Subtract a 'shiftwidth' on '}' or html " Subtract a shiftwidth()' on '}' or html
let curCurlyCount = scala#CountCurlies(curline) let curCurlyCount = scala#CountCurlies(curline)
if curCurlyCount < 0 if curCurlyCount < 0
call scala#ConditionalConfirm("14a") call scala#ConditionalConfirm("14a")
@ -517,7 +517,7 @@ function! GetScalaIndent()
return indent(matchline) return indent(matchline)
elseif curline =~ '^\s*</[a-zA-Z][^>]*>' elseif curline =~ '^\s*</[a-zA-Z][^>]*>'
call scala#ConditionalConfirm("14c") call scala#ConditionalConfirm("14c")
return ind - &shiftwidth return ind - shiftwidth()
endif endif
let prevParenCount = scala#CountParens(prevline) let prevParenCount = scala#CountParens(prevline)
@ -529,7 +529,7 @@ function! GetScalaIndent()
let prevCurlyCount = scala#CountCurlies(prevline) let prevCurlyCount = scala#CountCurlies(prevline)
if prevCurlyCount == 0 && prevline =~ '^.*\%(=>\|⇒\)\s*$' && prevline !~ '^\s*this\s*:.*\%(=>\|⇒\)\s*$' && curline !~ '^\s*\<case\>' if prevCurlyCount == 0 && prevline =~ '^.*\%(=>\|⇒\)\s*$' && prevline !~ '^\s*this\s*:.*\%(=>\|⇒\)\s*$' && curline !~ '^\s*\<case\>'
call scala#ConditionalConfirm("16") call scala#ConditionalConfirm("16")
let ind = ind + &shiftwidth let ind = ind + shiftwidth()
endif endif
if ind == originalIndentValue && curline =~ '^\s*\<case\>' if ind == originalIndentValue && curline =~ '^\s*\<case\>'
@ -555,7 +555,7 @@ function! GetScalaIndent()
if scala#LineIsAClosingXML(prevline) if scala#LineIsAClosingXML(prevline)
if scala#LineCompletesXML(prevlnum, prevline) if scala#LineCompletesXML(prevlnum, prevline)
call scala#ConditionalConfirm("20a") call scala#ConditionalConfirm("20a")
return ind - &shiftwidth return ind - shiftwidth()
else else
call scala#ConditionalConfirm("20b") call scala#ConditionalConfirm("20b")
return ind return ind
@ -566,7 +566,7 @@ function! GetScalaIndent()
"let indentMultiplier = scala#LineCompletesDefValr(prevlnum, prevline) "let indentMultiplier = scala#LineCompletesDefValr(prevlnum, prevline)
"if indentMultiplier != 0 "if indentMultiplier != 0
" call scala#ConditionalConfirm("19a") " call scala#ConditionalConfirm("19a")
" let ind = ind - (indentMultiplier * &shiftwidth) " let ind = ind - (indentMultiplier * shiftwidth())
let defValrLine = scala#Test(prevlnum, prevline, '{', '}') let defValrLine = scala#Test(prevlnum, prevline, '{', '}')
if defValrLine != -1 if defValrLine != -1
call scala#ConditionalConfirm("21a") call scala#ConditionalConfirm("21a")
@ -575,10 +575,10 @@ function! GetScalaIndent()
call scala#ConditionalConfirm("21b") call scala#ConditionalConfirm("21b")
if scala#GetLine(prevnonblank(prevlnum - 1)) =~ '^.*\<else\>\s*\%(//.*\)\?$' if scala#GetLine(prevnonblank(prevlnum - 1)) =~ '^.*\<else\>\s*\%(//.*\)\?$'
call scala#ConditionalConfirm("21c") call scala#ConditionalConfirm("21c")
let ind = ind - &shiftwidth let ind = ind - shiftwidth()
elseif scala#LineCompletesIfElse(prevlnum, prevline) elseif scala#LineCompletesIfElse(prevlnum, prevline)
call scala#ConditionalConfirm("21d") call scala#ConditionalConfirm("21d")
let ind = ind - &shiftwidth let ind = ind - shiftwidth()
elseif scala#CountParens(curline) < 0 && curline =~ '^\s*)' && scala#GetLine(scala#GetLineThatMatchesBracket('(', ')')) =~ '.*(\s*$' elseif scala#CountParens(curline) < 0 && curline =~ '^\s*)' && scala#GetLine(scala#GetLineThatMatchesBracket('(', ')')) =~ '.*(\s*$'
" Handles situations that look like this: " Handles situations that look like this:
" "
@ -592,7 +592,7 @@ function! GetScalaIndent()
" 10 " 10
" ).somethingHere() " ).somethingHere()
call scala#ConditionalConfirm("21e") call scala#ConditionalConfirm("21e")
let ind = ind - &shiftwidth let ind = ind - shiftwidth()
endif endif
endif endif
endif endif

View File

@ -3,10 +3,12 @@
" Maintainer: Christian Brabandt <cb@256bit.org> " Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Peter Aronoff <telemachus@arpinum.org> " Previous Maintainer: Peter Aronoff <telemachus@arpinum.org>
" Original Author: Nikolai Weibull <now@bitwi.se> " Original Author: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2016-06-27 " Latest Revision: 2017-05-02
" License: Vim (see :h license) " License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-sh-indent " Repository: https://github.com/chrisbra/vim-sh-indent
" Changelog: " Changelog:
" 20170502: - get rid of buffer-shiftwidth function
" 20160912: - preserve indentation of here-doc blocks
" 20160627: - detect heredocs correctly " 20160627: - detect heredocs correctly
" 20160213: - detect function definition correctly " 20160213: - detect function definition correctly
" 20160202: - use shiftwidth() function " 20160202: - use shiftwidth() function
@ -33,15 +35,11 @@ endif
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo&vim set cpo&vim
function s:buffer_shiftwidth()
return shiftwidth()
endfunction
let s:sh_indent_defaults = { let s:sh_indent_defaults = {
\ 'default': function('s:buffer_shiftwidth'), \ 'default': function('shiftwidth'),
\ 'continuation-line': function('s:buffer_shiftwidth'), \ 'continuation-line': function('shiftwidth'),
\ 'case-labels': function('s:buffer_shiftwidth'), \ 'case-labels': function('shiftwidth'),
\ 'case-statements': function('s:buffer_shiftwidth'), \ 'case-statements': function('shiftwidth'),
\ 'case-breaks': 0 } \ 'case-breaks': 0 }
function! s:indent_value(option) function! s:indent_value(option)
@ -110,6 +108,9 @@ function! GetShIndent()
let ind -= s:indent_value('case-breaks') let ind -= s:indent_value('case-breaks')
elseif s:is_here_doc(line) elseif s:is_here_doc(line)
let ind = 0 let ind = 0
" statements, executed within a here document. Keep the current indent
elseif match(map(synstack(v:lnum, 1), 'synIDattr(v:val, "name")'), '\c\mheredoc') > -1
return indent(v:lnum)
endif endif
return ind return ind

View File

@ -56,7 +56,7 @@ function GetTclIndent()
if line =~ '^\s*\*' if line =~ '^\s*\*'
return cindent(v:lnum) return cindent(v:lnum)
elseif line =~ '^\s*}' elseif line =~ '^\s*}'
return indent(v:lnum) - &sw return indent(v:lnum) - shiftwidth()
endif endif
let pnum = s:prevnonblanknoncomment(v:lnum - 1) let pnum = s:prevnonblanknoncomment(v:lnum - 1)
@ -64,11 +64,11 @@ function GetTclIndent()
return 0 return 0
endif 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) let pline = getline(pnum)
if pline =~ '}\s*$' 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 endif
return ind return ind

View File

@ -32,17 +32,17 @@ function TcshGetIndent()
let ind = indent(lnum) let ind = indent(lnum)
let line = getline(lnum) let line = getline(lnum)
if line =~ '\v^\s*%(while|foreach)>|^\s*%(case\s.*:|default:|else)\s*$|%(<then|\\)$' if line =~ '\v^\s*%(while|foreach)>|^\s*%(case\s.*:|default:|else)\s*$|%(<then|\\)$'
let ind = ind + &sw let ind = ind + shiftwidth()
endif endif
if line =~ '\v^\s*breaksw>' if line =~ '\v^\s*breaksw>'
let ind = ind - &sw let ind = ind - shiftwidth()
endif endif
" Subtract indent if current line has on end, endif, case commands " Subtract indent if current line has on end, endif, case commands
let line = getline(v:lnum) let line = getline(v:lnum)
if line =~ '\v^\s*%(else|end|endif)\s*$' if line =~ '\v^\s*%(else|end|endif)\s*$'
let ind = ind - &sw let ind = ind - shiftwidth()
endif endif
return ind return ind

View File

@ -1,8 +1,8 @@
" Vim indent file " Vim indent file
" Language: LaTeX " Language: LaTeX
" Maintainer: YiChao Zhou <broken.zhou AT gmail.com> " Maintainer: Yichao Zhou <broken.zhou AT gmail.com>
" Created: Sat, 16 Feb 2002 16:50:19 +0100 " Created: Sat, 16 Feb 2002 16:50:19 +0100
" Version: 0.9.2 " Version: 0.9.4
" Please email me if you found something I can do. Comments, bug report and " Please email me if you found something I can do. Comments, bug report and
" feature request are welcome. " feature request are welcome.
@ -15,49 +15,53 @@
" 2005/06/15, Moshe Kaminsky <kaminsky AT math.huji.ac.il> " 2005/06/15, Moshe Kaminsky <kaminsky AT math.huji.ac.il>
" (*) New variables: " (*) New variables:
" g:tex_items, g:tex_itemize_env, g:tex_noindent_env " g:tex_items, g:tex_itemize_env, g:tex_noindent_env
" 2011/3/6, by Zhou YiChao <broken.zhou AT gmail.com> " 2011/3/6, by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Don't change indentation of lines starting with '%' " (*) Don't change indentation of lines starting with '%'
" I don't see any code with '%' and it doesn't work properly " I don't see any code with '%' and it doesn't work properly
" so I add some code. " so I add some code.
" (*) New features: Add smartindent-like indent for "{}" and "[]". " (*) New features: Add smartindent-like indent for "{}" and "[]".
" (*) New variables: g:tex_indent_brace " (*) New variables: g:tex_indent_brace
" 2011/9/25, by Zhou Yichao <broken.zhou AT gmail.com> " 2011/9/25, by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Bug fix: smartindent-like indent for "[]" " (*) Bug fix: smartindent-like indent for "[]"
" (*) New features: Align with "&". " (*) New features: Align with "&".
" (*) New variable: g:tex_indent_and. " (*) New variable: g:tex_indent_and.
" 2011/10/23 by Zhou Yichao <broken.zhou AT gmail.com> " 2011/10/23 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Bug fix: improve the smartindent-like indent for "{}" and " (*) Bug fix: improve the smartindent-like indent for "{}" and
" "[]". " "[]".
" 2012/02/27 by Zhou Yichao <broken.zhou AT gmail.com> " 2012/02/27 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Bug fix: support default folding marker. " (*) Bug fix: support default folding marker.
" (*) Indent with "&" is not very handy. Make it not enable by " (*) Indent with "&" is not very handy. Make it not enable by
" default. " default.
" 2012/03/06 by Zhou Yichao <broken.zhou AT gmail.com> " 2012/03/06 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Modify "&" behavior and make it default again. Now "&" " (*) Modify "&" behavior and make it default again. Now "&"
" won't align when there are more then one "&" in the previous " won't align when there are more then one "&" in the previous
" line. " line.
" (*) Add indent "\left(" and "\right)" " (*) Add indent "\left(" and "\right)"
" (*) Trust user when in "verbatim" and "lstlisting" " (*) Trust user when in "verbatim" and "lstlisting"
" 2012/03/11 by Zhou Yichao <broken.zhou AT gmail.com> " 2012/03/11 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Modify "&" so that only indent when current line start with " (*) Modify "&" so that only indent when current line start with
" "&". " "&".
" 2012/03/12 by Zhou Yichao <broken.zhou AT gmail.com> " 2012/03/12 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Modify indentkeys. " (*) Modify indentkeys.
" 2012/03/18 by Zhou Yichao <broken.zhou AT gmail.com> " 2012/03/18 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Add &cpo " (*) Add &cpo
" 2013/05/02 by Zhou Yichao <broken.zhou AT gmail.com> " 2013/05/02 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Fix problem about GetTeXIndent checker. Thank Albert Netymk " (*) Fix problem about GetTeXIndent checker. Thank Albert Netymk
" for reporting this. " for reporting this.
" 2014/06/23 by Zhou Yichao <broken.zhou AT gmail.com> " 2014/06/23 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Remove the feature g:tex_indent_and because it is buggy. " (*) Remove the feature g:tex_indent_and because it is buggy.
" (*) If there is not any obvious indentation hints, we do not " (*) If there is not any obvious indentation hints, we do not
" alert our user's current indentation. " alert our user's current indentation.
" (*) g:tex_indent_brace now only works if the open brace is the " (*) g:tex_indent_brace now only works if the open brace is the
" last character of that line. " last character of that line.
" 2014/08/03 by Zhou Yichao <broken.zhou AT gmail.com> " 2014/08/03 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Indent current line if last line has larger indentation " (*) Indent current line if last line has larger indentation
" 2014/08/09 by Zhou Yichao <broken.zhou AT gmail.com> " 2016/11/08 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Add missing return value for s:GetEndIndentation(...) " (*) Fix problems for \[ and \]. Thanks Bruno for reporting.
" 2017/04/30 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Fix a bug between g:tex_noindent_env and g:tex_indent_items
" Now g:tex_noindent_env='document\|verbatim\|itemize' (Emacs
" style) is supported. Thanks Miles Wheeler for reporting.
" "
" }}} " }}}
@ -81,44 +85,44 @@
" % Example 2 " % Example 2
" \tikzexternalize[ " \tikzexternalize[
" prefix=tikz] " prefix=tikz]
" "
" * g:tex_indent_items " * g:tex_indent_items
" "
" If this variable is set, item-environments are indented like Emacs does " If this variable is set, item-environments are indented like Emacs does
" it, i.e., continuation lines are indented with a shiftwidth. " it, i.e., continuation lines are indented with a shiftwidth.
" "
" NOTE: I've already set the variable below; delete the corresponding line " NOTE: I've already set the variable below; delete the corresponding line
" if you don't like this behaviour. " if you don't like this behaviour.
" "
" Per default, it is unset. " Per default, it is unset.
" "
" set unset " set unset
" ---------------------------------------------------------------- " ----------------------------------------------------------------
" \begin{itemize} \begin{itemize} " \begin{itemize} \begin{itemize}
" \item blablabla \item blablabla " \item blablabla \item blablabla
" bla bla bla bla bla bla " bla bla bla bla bla bla
" \item blablabla \item blablabla " \item blablabla \item blablabla
" bla bla bla bla bla bla " bla bla bla bla bla bla
" \end{itemize} \end{itemize} " \end{itemize} \end{itemize}
" "
" "
" * g:tex_items " * g:tex_items
" "
" A list of tokens to be considered as commands for the beginning of an item " A list of tokens to be considered as commands for the beginning of an item
" command. The tokens should be separated with '\|'. The initial '\' should " command. The tokens should be separated with '\|'. The initial '\' should
" be escaped. The default is '\\bibitem\|\\item'. " be escaped. The default is '\\bibitem\|\\item'.
" "
" * g:tex_itemize_env " * g:tex_itemize_env
" "
" A list of environment names, separated with '\|', where the items (item " A list of environment names, separated with '\|', where the items (item
" commands matching g:tex_items) may appear. The default is " commands matching g:tex_items) may appear. The default is
" 'itemize\|description\|enumerate\|thebibliography'. " 'itemize\|description\|enumerate\|thebibliography'.
" "
" * g:tex_noindent_env " * g:tex_noindent_env
" "
" A list of environment names. separated with '\|', where no indentation is " A list of environment names. separated with '\|', where no indentation is
" required. The default is 'document\|verbatim'. " required. The default is 'document\|verbatim'.
" }}} " }}}
" Only define the function once " Only define the function once
if exists("b:did_indent") if exists("b:did_indent")
@ -146,7 +150,7 @@ if g:tex_indent_items
let g:tex_itemize_env = 'itemize\|description\|enumerate\|thebibliography' let g:tex_itemize_env = 'itemize\|description\|enumerate\|thebibliography'
endif endif
if !exists('g:tex_items') if !exists('g:tex_items')
let g:tex_items = '\\bibitem\|\\item' let g:tex_items = '\\bibitem\|\\item'
endif endif
else else
let g:tex_items = '' let g:tex_items = ''
@ -177,7 +181,7 @@ function! GetTeXIndent() " {{{
" At the start of the file use zero indent. " At the start of the file use zero indent.
if lnum == 0 if lnum == 0
return 0 return 0
endif endif
let line = substitute(getline(lnum), '\s*%.*', '','g') " last line let line = substitute(getline(lnum), '\s*%.*', '','g') " last line
@ -191,9 +195,9 @@ function! GetTeXIndent() " {{{
return indent(v:lnum) return indent(v:lnum)
end end
endif endif
if lnum == 0 if lnum == 0
return 0 return 0
endif endif
let ind = indent(lnum) let ind = indent(lnum)
@ -206,12 +210,14 @@ function! GetTeXIndent() " {{{
" Add a 'shiftwidth' after beginning of environments. " Add a 'shiftwidth' after beginning of environments.
" Don't add it for \begin{document} and \begin{verbatim} " Don't add it for \begin{document} and \begin{verbatim}
""if line =~ '^\s*\\begin{\(.*\)}' && line !~ 'verbatim' " if line =~ '^\s*\\begin{\(.*\)}' && line !~ 'verbatim'
" LH modification : \begin does not always start a line " LH modification : \begin does not always start a line
" ZYC modification : \end after \begin won't cause wrong indent anymore " ZYC modification : \end after \begin won't cause wrong indent anymore
if line =~ '\\begin{.*}' && line !~ g:tex_noindent_env if line =~ '\\begin{.*}'
let ind = ind + &sw if line !~ g:tex_noindent_env
let stay = 0 let ind = ind + &sw
let stay = 0
endif
if g:tex_indent_items if g:tex_indent_items
" Add another sw for item-environments " Add another sw for item-environments
@ -245,29 +251,27 @@ function! GetTeXIndent() " {{{
endif endif
if g:tex_indent_brace if g:tex_indent_brace
let char = line[strlen(line)-1] if line =~ '[[{]$'
if char == '[' || char == '{'
let ind += &sw let ind += &sw
let stay = 0 let stay = 0
endif endif
let cind = indent(v:lnum) if cline =~ '^\s*\\\?[\]}]' && s:CheckPairedIsLastCharacter(v:lnum, indent(v:lnum))
let char = cline[cind]
if (char == ']' || char == '}') &&
\ s:CheckPairedIsLastCharacter(v:lnum, cind)
let ind -= &sw let ind -= &sw
let stay = 0 let stay = 0
endif endif
for i in range(indent(lnum)+1, strlen(line)-1) if line !~ '^\s*\\\?[\]}]'
let char = line[i] for i in range(indent(lnum)+1, strlen(line)-1)
if char == ']' || char == '}' let char = line[i]
if s:CheckPairedIsLastCharacter(lnum, i) if char == ']' || char == '}'
let ind -= &sw if s:CheckPairedIsLastCharacter(lnum, i)
let stay = 0 let ind -= &sw
let stay = 0
endif
endif endif
endif endfor
endfor endif
endif endif
" Special treatment for 'item' " Special treatment for 'item'
@ -309,12 +313,12 @@ function! s:GetLastBeginIndentation(lnum) " {{{
let matchend -= 1 let matchend -= 1
endif endif
if matchend == 0 if matchend == 0
if line =~ g:tex_itemize_env
return indent(lnum) + 2 * &sw
endif
if line =~ g:tex_noindent_env if line =~ g:tex_noindent_env
return indent(lnum) return indent(lnum)
endif endif
if line =~ g:tex_itemize_env
return indent(lnum) + 2 * &sw
endif
return indent(lnum) + &sw return indent(lnum) + &sw
endif endif
endfor endfor
@ -348,12 +352,15 @@ endfunction
" Most of the code is from matchparen.vim " Most of the code is from matchparen.vim
function! s:CheckPairedIsLastCharacter(lnum, col) "{{{ function! s:CheckPairedIsLastCharacter(lnum, col) "{{{
" Get the character under the cursor and check if it's in 'matchpairs'.
let c_lnum = a:lnum let c_lnum = a:lnum
let c_col = a:col+1 let c_col = a:col+1
let line = getline(c_lnum)
if line[c_col-1] == '\'
let c_col = c_col + 1
endif
let c = line[c_col-1]
let c = getline(c_lnum)[c_col-1]
let plist = split(&matchpairs, '.\zs[:,]') let plist = split(&matchpairs, '.\zs[:,]')
let i = index(plist, c) let i = index(plist, c)
if i < 0 if i < 0

View File

@ -26,12 +26,12 @@ function GetTreetopIndent()
let line = getline(pnum) let line = getline(pnum)
if line =~ '^\s*\%(grammar\|module\|rule\)\>' if line =~ '^\s*\%(grammar\|module\|rule\)\>'
let ind += &sw let ind += shiftwidth()
endif endif
let line = getline(v:lnum) let line = getline(v:lnum)
if line =~ '^\s*end\>' if line =~ '^\s*end\>'
let ind -= &sw let ind -= shiftwidth()
end end
retur ind retur ind

View File

@ -26,11 +26,11 @@ function GetXF86ConfIndent()
let ind = indent(lnum) let ind = indent(lnum)
if getline(lnum) =~? '^\s*\(Sub\)\=Section\>' if getline(lnum) =~? '^\s*\(Sub\)\=Section\>'
let ind = ind + &sw let ind = ind + shiftwidth()
endif endif
if getline(v:lnum) =~? '^\s*End\(Sub\)\=Section\>' if getline(v:lnum) =~? '^\s*End\(Sub\)\=Section\>'
let ind = ind - &sw let ind = ind - shiftwidth()
endif endif
return ind return ind

View File

@ -47,8 +47,8 @@ function GetXinetdIndent()
return 0 return 0
endif endif
return indent(pnum) + s:count_braces(pnum, 1) * &sw return indent(pnum) + s:count_braces(pnum, 1) * shiftwidth()
\ - s:count_braces(v:lnum, 0) * &sw \ - s:count_braces(v:lnum, 0) * shiftwidth()
endfunction endfunction
let &cpo = s:keepcpo let &cpo = s:keepcpo

View File

@ -1,6 +1,6 @@
" Vim script to work like "less" " Vim script to work like "less"
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2015 Nov 15 " Last Change: 2017 Mar 31
" Avoid loading this file twice, allow the user to define his own script. " Avoid loading this file twice, allow the user to define his own script.
if exists("loaded_less") if exists("loaded_less")
@ -81,6 +81,10 @@ fun! s:Help()
echo "\n" echo "\n"
echo "/pattern Search for pattern ?pattern Search backward for pattern" echo "/pattern Search for pattern ?pattern Search backward for pattern"
echo "n next pattern match N Previous pattern match" echo "n next pattern match N Previous pattern match"
if &foldmethod != "manual"
echo "\n"
echo "zR open all folds zm increase fold level"
endif
echo "\n" echo "\n"
echo ":n<Enter> Next file :p<Enter> Previous file" echo ":n<Enter> Next file :p<Enter> Previous file"
echo "\n" echo "\n"
@ -96,7 +100,11 @@ map <C-F> <Space>
map <PageDown> <Space> map <PageDown> <Space>
map <kPageDown> <Space> map <kPageDown> <Space>
map <S-Down> <Space> map <S-Down> <Space>
map z <Space> " If 'foldmethod' was changed keep the "z" commands, e.g. "zR" to open all
" folds.
if &foldmethod == "manual"
map z <Space>
endif
map <Esc><Space> <Space> map <Esc><Space> <Space>
fun! s:NextPage() fun! s:NextPage()
if line(".") == line("$") if line(".") == line("$")

View File

@ -4,7 +4,7 @@ For instructions on installing this file, type
:help matchit-install :help matchit-install
inside Vim. inside Vim.
For Vim version 6.3. Last change: 2016 Mar 28 For Vim version 6.3. Last change: 2017 May 14
VIM REFERENCE MANUAL by Benji Fisher VIM REFERENCE MANUAL by Benji Fisher
@ -242,7 +242,7 @@ Examples:
In LaTeX, since "%" is used as the comment character, you can > In LaTeX, since "%" is used as the comment character, you can >
:let b:match_skip = 'r:%' :let b:match_skip = 'r:%'
< Unfortunately, this will skip anything after "\%", an escaped "%". To < Unfortunately, this will skip anything after "\%", an escaped "%". To
allow for this, and also "\\%" (an excaped backslash followed by the allow for this, and also "\\%" (an escaped backslash followed by the
comment character) you can > comment character) you can >
:let b:match_skip = 'r:\(^\|[^\\]\)\(\\\\\)*%' :let b:match_skip = 'r:\(^\|[^\\]\)\(\\\\\)*%'
< <
@ -392,7 +392,8 @@ a while. Moral: if a bug (known or not) bothers you, let me know.
The various |:vmap|s defined in the script (%, |g%|, |[%|, |]%|, |a%|) may The various |:vmap|s defined in the script (%, |g%|, |[%|, |]%|, |a%|) may
have undesired effects in Select mode |Select-mode-mapping|. At least, if you have undesired effects in Select mode |Select-mode-mapping|. At least, if you
want to replace the selection with any character in "ag%[]" there will be a want to replace the selection with any character in "ag%[]" there will be a
pause of |'updatetime'| first. pause of |'updatetime'| first. E.g., "yV%" would normally work linewise, but
the plugin mapping makes it characterwise.
It would be nice if "\0" were recognized as the entire pattern. That is, it It would be nice if "\0" were recognized as the entire pattern. That is, it
would be nice if "foo:\end\0" had the same effect as "\(foo\):\end\1". I may would be nice if "foo:\end\0" had the same effect as "\(foo\):\end\1". I may

View File

@ -1,7 +1,7 @@
" matchit.vim: (global plugin) Extended "%" matching " matchit.vim: (global plugin) Extended "%" matching
" Last Change: 2016 Aug 21 " Last Change: 2017 March 26
" Maintainer: Benji Fisher PhD <benji@member.AMS.org> " Maintainer: Benji Fisher PhD <benji@member.AMS.org>
" Version: 1.13.2, for Vim 6.3+ " Version: 1.13.3, for Vim 6.3+
" Fix from Fernando Torres included. " Fix from Fernando Torres included.
" Improvement from Ken Takata included. " Improvement from Ken Takata included.
" URL: http://www.vim.org/script.php?script_id=39 " URL: http://www.vim.org/script.php?script_id=39
@ -89,12 +89,15 @@ let s:notslash = '\\\@<!\%(\\\\\)*'
function! s:Match_wrapper(word, forward, mode) range function! s:Match_wrapper(word, forward, mode) range
" In s:CleanUp(), :execute "set" restore_options . " In s:CleanUp(), :execute "set" restore_options .
let restore_options = (&ic ? " " : " no") . "ignorecase" let restore_options = ""
if exists("b:match_ignorecase") if exists("b:match_ignorecase") && b:match_ignorecase != &ic
let restore_options .= (&ic ? " " : " no") . "ignorecase"
let &ignorecase = b:match_ignorecase let &ignorecase = b:match_ignorecase
endif endif
let restore_options = " ve=" . &ve . restore_options if &ve != ''
set ve= let restore_options = " ve=" . &ve . restore_options
set ve=
endif
" If this function was called from Visual mode, make sure that the cursor " If this function was called from Visual mode, make sure that the cursor
" is at the correct end of the Visual range: " is at the correct end of the Visual range:
if a:mode == "v" if a:mode == "v"
@ -287,7 +290,9 @@ endfun
" Restore options and do some special handling for Operator-pending mode. " Restore options and do some special handling for Operator-pending mode.
" The optional argument is the tail of the matching group. " The optional argument is the tail of the matching group.
fun! s:CleanUp(options, mode, startline, startcol, ...) fun! s:CleanUp(options, mode, startline, startcol, ...)
execute "set" a:options if strlen(a:options)
execute "set" a:options
endif
" Open folds, if appropriate. " Open folds, if appropriate.
if a:mode != "o" if a:mode != "o"
if &foldopen =~ "percent" if &foldopen =~ "percent"
@ -639,8 +644,9 @@ fun! s:MultiMatch(spflag, mode)
if !exists("b:match_words") || b:match_words == "" if !exists("b:match_words") || b:match_words == ""
return "" return ""
end end
let restore_options = (&ic ? "" : "no") . "ignorecase" let restore_options = ""
if exists("b:match_ignorecase") if exists("b:match_ignorecase") && b:match_ignorecase != &ic
let restore_options .= (&ic ? " " : " no") . "ignorecase"
let &ignorecase = b:match_ignorecase let &ignorecase = b:match_ignorecase
endif endif
let startline = line(".") let startline = line(".")

View File

@ -2,7 +2,7 @@
" Language: AutoHotkey script file " Language: AutoHotkey script file
" Maintainer: Michael Wong " Maintainer: Michael Wong
" https://github.com/mmikeww/autohotkey.vim " https://github.com/mmikeww/autohotkey.vim
" Latest Revision: 2017-01-23 " Latest Revision: 2017-04-03
" Previous Maintainers: SungHyun Nam <goweol@gmail.com> " Previous Maintainers: SungHyun Nam <goweol@gmail.com>
" Nikolai Weibull <now@bitwi.se> " Nikolai Weibull <now@bitwi.se>
@ -106,6 +106,7 @@ syn keyword autohotkeyCommand
\ FormatTime IfInString IfNotInString Sort StringCaseSense StringGetPos \ FormatTime IfInString IfNotInString Sort StringCaseSense StringGetPos
\ StringLeft StringRight StringLower StringUpper StringMid StringReplace \ StringLeft StringRight StringLower StringUpper StringMid StringReplace
\ StringSplit StringTrimLeft StringTrimRight StringLen \ StringSplit StringTrimLeft StringTrimRight StringLen
\ StrSplit StrReplace Throw
\ Control ControlClick ControlFocus ControlGet ControlGetFocus \ Control ControlClick ControlFocus ControlGet ControlGetFocus
\ ControlGetPos ControlGetText ControlMove ControlSend ControlSendRaw \ ControlGetPos ControlGetText ControlMove ControlSend ControlSendRaw
\ ControlSetText Menu PostMessage SendMessage SetControlDelay \ ControlSetText Menu PostMessage SendMessage SetControlDelay
@ -119,17 +120,18 @@ syn keyword autohotkeyCommand
\ SetCapsLockState SetNumLockState SetScrollLockState \ SetCapsLockState SetNumLockState SetScrollLockState
syn keyword autohotkeyFunction syn keyword autohotkeyFunction
\ InStr RegExMatch RegExReplace StrLen SubStr Asc Chr \ InStr RegExMatch RegExReplace StrLen SubStr Asc Chr Func
\ DllCall VarSetCapacity WinActive WinExist IsLabel OnMessage \ DllCall VarSetCapacity WinActive WinExist IsLabel OnMessage
\ Abs Ceil Exp Floor Log Ln Mod Round Sqrt Sin Cos Tan ASin ACos ATan \ Abs Ceil Exp Floor Log Ln Mod Round Sqrt Sin Cos Tan ASin ACos ATan
\ FileExist GetKeyState NumGet NumPut StrGet StrPut RegisterCallback \ FileExist GetKeyState NumGet NumPut StrGet StrPut RegisterCallback
\ IsFunc Trim LTrim RTrim IsObject Object Array FileOpen \ IsFunc Trim LTrim RTrim IsObject Object Array FileOpen
\ ComObjActive ComObjArray ComObjConnect ComObjCreate ComObjGet \ ComObjActive ComObjArray ComObjConnect ComObjCreate ComObjGet
\ ComObjError ComObjFlags ComObjQuery ComObjType ComObjValue ComObject \ ComObjError ComObjFlags ComObjQuery ComObjType ComObjValue ComObject
\ Format Exception
syn keyword autohotkeyStatement syn keyword autohotkeyStatement
\ Break Continue Exit ExitApp Gosub Goto OnExit Pause Return \ Break Continue Exit ExitApp Gosub Goto OnExit Pause Return
\ Suspend Reload \ Suspend Reload new class extends
syn keyword autohotkeyRepeat syn keyword autohotkeyRepeat
\ Loop \ Loop
@ -138,7 +140,7 @@ syn keyword autohotkeyConditional
\ IfExist IfNotExist If IfEqual IfLess IfGreater Else \ IfExist IfNotExist If IfEqual IfLess IfGreater Else
\ IfWinExist IfWinNotExist IfWinActive IfWinNotActive \ IfWinExist IfWinNotExist IfWinActive IfWinNotActive
\ IfNotEqual IfLessOrEqual IfGreaterOrEqual \ IfNotEqual IfLessOrEqual IfGreaterOrEqual
\ while until for in \ while until for in try catch finally
syn match autohotkeyPreProcStart syn match autohotkeyPreProcStart
\ nextgroup= \ nextgroup=
@ -178,7 +180,7 @@ syn keyword autohotkeyPreProc
\ Warn \ Warn
syn keyword autohotkeyMatchClass syn keyword autohotkeyMatchClass
\ ahk_group ahk_class ahk_id ahk_pid \ ahk_group ahk_class ahk_id ahk_pid ahk_exe
syn match autohotkeyNumbers syn match autohotkeyNumbers
\ display \ display
@ -217,7 +219,7 @@ syn match autohotkeyHotkey
\ contains=autohotkeyKey, \ contains=autohotkeyKey,
\ autohotkeyHotkeyDelimiter \ autohotkeyHotkeyDelimiter
\ display \ display
\ '^.\{-}::' \ '^\s*\S*\%( Up\)\?::'
syn match autohotkeyKey syn match autohotkeyKey
\ contained \ contained

View File

@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: C " Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2016 Nov 18 " Last Change: 2017 Apr 30
" Quit when a (custom) syntax file was already loaded " Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax") if exists("b:current_syntax")
@ -311,44 +311,32 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
syn keyword cConstant PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX syn keyword cConstant PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX
syn keyword cConstant SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX syn keyword cConstant SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX
endif endif
syn keyword cConstant FLT_RADIX FLT_ROUNDS syn keyword cConstant FLT_RADIX FLT_ROUNDS FLT_DIG FLT_MANT_DIG FLT_EPSILON DBL_DIG DBL_MANT_DIG DBL_EPSILON
syn keyword cConstant FLT_DIG FLT_MANT_DIG FLT_EPSILON syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP FLT_MIN_10_EXP FLT_MAX_10_EXP
syn keyword cConstant DBL_DIG DBL_MANT_DIG DBL_EPSILON syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP DBL_MIN_10_EXP DBL_MAX_10_EXP LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP
syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON syn keyword cConstant LDBL_MIN_10_EXP LDBL_MAX_10_EXP HUGE_VAL CLOCKS_PER_SEC NULL LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY
syn keyword cConstant FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP syn keyword cConstant LC_NUMERIC LC_TIME SIG_DFL SIG_ERR SIG_IGN SIGABRT SIGFPE SIGILL SIGHUP SIGINT SIGSEGV SIGTERM
syn keyword cConstant FLT_MIN_10_EXP FLT_MAX_10_EXP
syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP
syn keyword cConstant DBL_MIN_10_EXP DBL_MAX_10_EXP
syn keyword cConstant LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP
syn keyword cConstant LDBL_MIN_10_EXP LDBL_MAX_10_EXP
syn keyword cConstant HUGE_VAL CLOCKS_PER_SEC NULL
syn keyword cConstant LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY
syn keyword cConstant LC_NUMERIC LC_TIME
syn keyword cConstant SIG_DFL SIG_ERR SIG_IGN
syn keyword cConstant SIGABRT SIGFPE SIGILL SIGHUP SIGINT SIGSEGV SIGTERM
" Add POSIX signals as well... " Add POSIX signals as well...
syn keyword cConstant SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP syn keyword cConstant SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV
syn keyword cConstant SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU SIGUSR1 SIGUSR2
syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF FOPEN_MAX FILENAME_MAX L_tmpnam
syn keyword cConstant SIGUSR1 SIGUSR2 syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET TMP_MAX stderr stdin stdout EXIT_FAILURE EXIT_SUCCESS RAND_MAX
syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF
syn keyword cConstant FOPEN_MAX FILENAME_MAX L_tmpnam
syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
syn keyword cConstant TMP_MAX stderr stdin stdout
syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
" POSIX 2001 " POSIX 2001
syn keyword cConstant SIGBUS SIGPOLL SIGPROF SIGSYS SIGURG syn keyword cConstant SIGBUS SIGPOLL SIGPROF SIGSYS SIGURG SIGVTALRM SIGXCPU SIGXFSZ
syn keyword cConstant SIGVTALRM SIGXCPU SIGXFSZ
" non-POSIX signals " non-POSIX signals
syn keyword cConstant SIGWINCH SIGINFO syn keyword cConstant SIGWINCH SIGINFO
" Add POSIX errors as well " Add POSIX errors as well. List comes from:
syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY " http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html
syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT syn keyword cConstant E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY EBADF
syn keyword cConstant EFBIG EILSEQ EINPROGRESS EINTR EINVAL EIO EISDIR syn keyword cConstant EBADMSG EBUSY ECANCELED ECHILD ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK
syn keyword cConstant EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENFILE ENODEV syn keyword cConstant EDESTADDRREQ EDOM EDQUOT EEXIST EFAULT EFBIG EHOSTUNREACH EIDRM EILSEQ
syn keyword cConstant ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS syn keyword cConstant EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE
syn keyword cConstant ENOTDIR ENOTEMPTY ENOTSUP ENOTTY ENXIO EPERM syn keyword cConstant EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA
syn keyword cConstant EPIPE ERANGE EROFS ESPIPE ESRCH ETIMEDOUT EXDEV syn keyword cConstant ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENOPROTOOPT ENOSPC ENOSR
syn keyword cConstant ENOSTR ENOSYS ENOTCONN ENOTDIR ENOTEMPTY ENOTRECOVERABLE ENOTSOCK ENOTSUP
syn keyword cConstant ENOTTY ENXIO EOPNOTSUPP EOVERFLOW EOWNERDEAD EPERM EPIPE EPROTO
syn keyword cConstant EPROTONOSUPPORT EPROTOTYPE ERANGE EROFS ESPIPE ESRCH ESTALE ETIME ETIMEDOUT
syn keyword cConstant ETXTBSY EWOULDBLOCK EXDEV
" math.h " math.h
syn keyword cConstant M_E M_LOG2E M_LOG10E M_LN2 M_LN10 M_PI M_PI_2 M_PI_4 syn keyword cConstant M_E M_LOG2E M_LOG10E M_LN2 M_LN10 M_PI M_PI_2 M_PI_4
syn keyword cConstant M_1_PI M_2_PI M_2_SQRTPI M_SQRT2 M_SQRT1_2 syn keyword cConstant M_1_PI M_2_PI M_2_SQRTPI M_SQRT2 M_SQRT1_2

View File

@ -2,7 +2,7 @@
" Language: C++ " Language: C++
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp) " Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu> " Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
" Last Change: 2016 Oct 28 " Last Change: 2017 Jun 05
" quit when a syntax file was already loaded " quit when a syntax file was already loaded
if exists("b:current_syntax") if exists("b:current_syntax")
@ -48,7 +48,7 @@ endif
if !exists("cpp_no_cpp14") if !exists("cpp_no_cpp14")
syn case ignore syn case ignore
syn match cppNumber display "\<0b[01]\('\=[01]\+\)*\(u\=l\{0,2}\|ll\=u\)\>" syn match cppNumber display "\<0b[01]\('\=[01]\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
syn match cppNumber display "\<[1-9]\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>" syn match cppNumber display "\<[1-9]\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>" contains=cFloat
syn match cppNumber display "\<0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>" syn match cppNumber display "\<0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
syn case match syn case match
endif endif

View File

@ -1,9 +1,10 @@
" Vim syntax file " Vim syntax file
" Language: Erlang (http://www.erlang.org) " Language: Erlang (http://www.erlang.org)
" Maintainer: Csaba Hoch <csaba.hoch@gmail.com> " 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 " 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]. " Acknowledgements: This script was originally created by Kresimir Marzic [1].
" The script was then revamped by Csaba Hoch [2]. During the revamp, the new " The script was then revamped by Csaba Hoch [2]. During the revamp, the new
@ -46,7 +47,6 @@ syn match erlangComment '%.*$' contains=erlangCommentAnnotation,erlang
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 ' \@<=@\%(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 match erlangCommentAnnotation /`[^']*'/ contained
syn keyword erlangTodo TODO FIXME XXX contained syn keyword erlangTodo TODO FIXME XXX contained
syn match erlangShebang '^#!.*'
" Numbers (minimum base is 2, maximum is 36.) " Numbers (minimum base is 2, maximum is 36.)
syn match erlangNumberInteger '\<\d\+\>' syn match erlangNumberInteger '\<\d\+\>'
@ -56,12 +56,12 @@ syn match erlangNumberFloat '\<\d\+\.\d\+\%([eE][+-]\=\d\+\)\=\>'
" Strings, atoms, characters " Strings, atoms, characters
syn region erlangString start=/"/ end=/"/ contains=erlangStringModifier syn region erlangString start=/"/ end=/"/ contains=erlangStringModifier
syn region erlangQuotedAtom start=/'/ end=/'/ contains=erlangQuotedAtomModifier syn region erlangQuotedAtom start=/'/ end=/'/ contains=erlangQuotedAtomModifier
syn match erlangStringModifier '\~\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 '\~\a\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' contained syn match erlangQuotedAtomModifier '\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' contained
syn match erlangModifier '\$\%([^\\]\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\)' syn match erlangModifier '\$\%([^\\]\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\)'
" Operators, separators " 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 keyword erlangOperator div rem or xor bor bxor bsl bsr and band not bnot andalso orelse
syn match erlangBracket '{\|}\|\[\|]\||\|||' syn match erlangBracket '{\|}\|\[\|]\||\|||'
syn match erlangPipe '|' syn match erlangPipe '|'
@ -72,14 +72,19 @@ syn match erlangAtom '\<\l[[:alnum:]_@]*' contains=erlangBoolean
syn keyword erlangBoolean true false contained syn keyword erlangBoolean true false contained
syn match erlangLocalFuncCall '\<\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangBIF syn match erlangLocalFuncCall '\<\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangBIF
syn match erlangLocalFuncRef '\<\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@=' 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 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 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 erlangVariable '\<[A-Z_][[:alnum:]_@]*'
syn match erlangMacro '??\=[[:alnum:]_@]\+' syn match erlangMacro '??\=[[:alnum:]_@]\+'
syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+' syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+'
syn match erlangMap '#'
syn match erlangRecord '#\s*\l[[:alnum:]_@]*' 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 " 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 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
@ -94,7 +99,7 @@ syn match erlangPreCondit '^\s*-\%(\s\|\n\|%.*\n\)*\%(ifdef\|ifndef\|else\|endif
syn match erlangType '^\s*-\%(\s\|\n\|%.*\n\)*\%(spec\|type\|opaque\|callback\)\>' contains=erlangComment syn match erlangType '^\s*-\%(\s\|\n\|%.*\n\)*\%(spec\|type\|opaque\|callback\)\>' contains=erlangComment
" Keywords " 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 syn keyword erlangKeyword receive when try
" Build-in-functions (BIFs) " Build-in-functions (BIFs)
@ -142,7 +147,6 @@ let b:erlang_syntax_synced = 1
let s:old_style = (exists("g:erlang_old_style_highlight") && let s:old_style = (exists("g:erlang_old_style_highlight") &&
\g:erlang_old_style_highlight == 1) \g:erlang_old_style_highlight == 1)
" Only when an item doesn't have highlighting yet
" Comments " Comments
hi def link erlangComment Comment hi def link erlangComment Comment
@ -188,6 +192,8 @@ hi def link erlangGlobalFuncRef Function
hi def link erlangVariable Normal hi def link erlangVariable Normal
hi def link erlangMacro Normal hi def link erlangMacro Normal
hi def link erlangRecord Normal hi def link erlangRecord Normal
hi def link erlangQuotedRecord Normal
hi def link erlangMap Normal
else else
hi def link erlangAtom String hi def link erlangAtom String
hi def link erlangLocalFuncCall Normal hi def link erlangLocalFuncCall Normal
@ -197,6 +203,8 @@ hi def link erlangGlobalFuncRef Normal
hi def link erlangVariable Identifier hi def link erlangVariable Identifier
hi def link erlangMacro Macro hi def link erlangMacro Macro
hi def link erlangRecord Structure hi def link erlangRecord Structure
hi def link erlangQuotedRecord Structure
hi def link erlangMap Structure
endif endif
" Bitstrings " Bitstrings

View File

@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: Haskell " Language: Haskell
" Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org> " Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org>
" Last Change: 2008 Dec 15 " Last Change: 2017 Jun 04
" Original Author: John Williams <jrw@pobox.com> " Original Author: John Williams <jrw@pobox.com>
" "
" Thanks to Ryan Crumley for suggestions and John Meacham for " Thanks to Ryan Crumley for suggestions and John Meacham for
@ -62,7 +62,7 @@ syn match hsCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=hsSpecialChar,hs
syn match hsNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>" syn match hsNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>"
syn match hsFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>" syn match hsFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
" Keyword definitions. These must be patters instead of keywords " Keyword definitions. These must be patterns instead of keywords
" because otherwise they would match as keywords at the start of a " because otherwise they would match as keywords at the start of a
" "literate" comment (see lhs.vim). " "literate" comment (see lhs.vim).
syn match hsModule "\<module\>" syn match hsModule "\<module\>"

View File

@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: php PHP 3/4/5/7 " Language: php PHP 3/4/5/7
" Maintainer: Jason Woofenden <jason@jasonwoof.com> " Maintainer: Jason Woofenden <jason@jasonwoof.com>
" Last Change: Dec 11, 2016 " Last Change: Apr 28, 2017
" URL: https://jasonwoof.com/gitweb/?p=vim-syntax.git;a=blob;f=php.vim;hb=HEAD " URL: https://jasonwoof.com/gitweb/?p=vim-syntax.git;a=blob;f=php.vim;hb=HEAD
" Former Maintainers: Peter Hodge <toomuchphp-vim@yahoo.com> " Former Maintainers: Peter Hodge <toomuchphp-vim@yahoo.com>
" Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> " Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
@ -11,32 +11,28 @@
" colourscheme, because elflord's colours will better highlight the break-points " colourscheme, because elflord's colours will better highlight the break-points
" (Statements) in your code. " (Statements) in your code.
" "
" Options: php_sql_query = 1 for SQL syntax highlighting inside strings " Options:
" php_htmlInStrings = 1 for HTML syntax highlighting inside strings " Set to anything to enable:
" php_baselib = 1 for highlighting baselib functions " php_sql_query SQL syntax highlighting inside strings
" php_asp_tags = 1 for highlighting ASP-style short tags " php_htmlInStrings HTML syntax highlighting inside strings
" php_parent_error_close = 1 for highlighting parent error ] or ) " php_baselib highlighting baselib functions
" php_parent_error_open = 1 for skipping an php end tag, if there exists an open ( or [ without a closing one " php_asp_tags highlighting ASP-style short tags
" php_oldStyle = 1 for using old colorstyle " php_parent_error_close highlighting parent error ] or )
" php_noShortTags = 1 don't sync <? ?> as php " php_parent_error_open skipping an php end tag, if there exists
" php_folding = 1 for folding classes and functions " an open ( or [ without a closing one
" php_folding = 2 for folding all { } regions " php_oldStyle use old colorstyle
" php_sync_method = x " php_noShortTags don't sync <? ?> as php
" x=-1 to sync by search ( default ) " Set to a specific value:
" x>0 to sync at least x lines backwards " php_folding = 1 fold classes and functions
" x=0 to sync from start " php_folding = 2 fold all { } regions
" " php_sync_method = x where x is an integer:
" Added by Peter Hodge On June 9, 2006: " -1 sync by search ( default )
" php_special_functions = 1|0 to highlight functions with abnormal behaviour " >0 sync at least x lines backwards
" php_alt_comparisons = 1|0 to highlight comparison operators in an alternate colour " 0 sync from start
" php_alt_assignByReference = 1|0 to highlight '= &' in an alternate colour " Set to 0 to _disable_: (Added by Peter Hodge On June 9, 2006)
" " php_special_functions = 0 highlight functions with abnormal behaviour
" Note: these all default to 1 (On), so you would set them to '0' to turn them off. " php_alt_comparisons = 0 comparison operators in an alternate colour
" E.g., in your .vimrc or _vimrc file: " php_alt_assignByReference = 0 '= &' in an alternate colour
" let php_special_functions = 0
" let php_alt_comparisons = 0
" let php_alt_assignByReference = 0
" Unletting these variables will revert back to their default (On).
" "
" "
" Note: " Note:

View File

@ -5,10 +5,10 @@
" Tom Payne <tom@tompayne.org> " Tom Payne <tom@tompayne.org>
" Contributor: Johannes Ranke <jranke@uni-bremen.de> " Contributor: Johannes Ranke <jranke@uni-bremen.de>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Thu Aug 25, 2016 08:52PM " Last Change: Sat Apr 08, 2017 07:01PM
" Filenames: *.R *.r *.Rhistory *.Rt " Filenames: *.R *.r *.Rhistory *.Rt
" "
" NOTE: The highlighting of R functions is defined in " NOTE: The highlighting of R functions might be defined in
" runtime files created by a filetype plugin, if installed. " runtime files created by a filetype plugin, if installed.
" "
" CONFIGURATION: " CONFIGURATION:
@ -18,7 +18,7 @@
" "
" ROxygen highlighting can be turned off by " ROxygen highlighting can be turned off by
" "
" let r_hl_roxygen = 0 " let r_syntax_hl_roxygen = 0
" "
" Some lines of code were borrowed from Zhuojun Chen. " Some lines of code were borrowed from Zhuojun Chen.
@ -26,13 +26,25 @@ if exists("b:current_syntax")
finish finish
endif endif
syn iskeyword @,48-57,_,. if has("patch-7.4.1142")
syn iskeyword @,48-57,_,.
else
setlocal iskeyword=@,48-57,_,.
endif
" The variables g:r_hl_roxygen and g:r_syn_minlines were renamed on April 8, 2017.
if exists("g:r_hl_roxygen")
let g:r_syntax_hl_roxygen = g:r_hl_roxygen
endif
if exists("g:r_syn_minlines")
let g:r_syntax_minlines = g:r_syn_minlines
endif
if exists("g:r_syntax_folding") && g:r_syntax_folding if exists("g:r_syntax_folding") && g:r_syntax_folding
setlocal foldmethod=syntax setlocal foldmethod=syntax
endif endif
if !exists("g:r_hl_roxygen") if !exists("g:r_syntax_hl_roxygen")
let g:r_hl_roxygen = 1 let g:r_syntax_hl_roxygen = 1
endif endif
syn case match syn case match
@ -42,19 +54,106 @@ syn match rCommentTodo contained "\(BUG\|FIXME\|NOTE\|TODO\):"
syn match rComment contains=@Spell,rCommentTodo,rOBlock "#.*" syn match rComment contains=@Spell,rCommentTodo,rOBlock "#.*"
" Roxygen " Roxygen
if g:r_hl_roxygen if g:r_syntax_hl_roxygen
syn region rOBlock start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\)\@!" contains=rOTitle,rOKeyword,rOExamples,@Spell keepend " A roxygen block can start at the beginning of a file (first version) and
syn region rOTitle start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\s*$\)\@=" contained contains=rOCommentKey " after a blank line (second version). It ends when a line that does not
syn match rOCommentKey "#\{1,2}'" containedin=rOTitle contained " contain a roxygen comment. In the following comments, any line containing
" a roxygen comment marker (one or two hash signs # followed by a single
" quote ' and preceded only by whitespace) is called a roxygen line. A
" roxygen line containing only a roxygen comment marker, optionally followed
" by whitespace is called an empty roxygen line.
syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOKeyword " First we match all roxygen blocks as containing only a title. In case an
" empty roxygen line ending the title or a tag is found, this will be
" overriden later by the definitions of rOBlock.
syn match rOTitleBlock "\%^\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag
syn match rOTitleBlock "^\s*\n\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag
syn match rOKeyword contained "@\(param\|return\|name\|rdname\|examples\|example\|include\|docType\)" " When a roxygen block has a title and additional content, the title
syn match rOKeyword contained "@\(S3method\|TODO\|aliases\|alias\|assignee\|author\|callGraphDepth\|callGraph\)" " consists of one or more roxygen lines (as little as possible are matched),
syn match rOKeyword contained "@\(callGraphPrimitives\|concept\|exportClass\|exportMethod\|exportPattern\|export\|formals\)" " followed either by an empty roxygen line
syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\|useDynLib\)" syn region rOBlock start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
syn match rOKeyword contained "@\(method\|noRd\|note\|references\|seealso\|setClass\|slot\|source\|title\|usage\)" syn region rOBlock start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritParams\|field\)"
" or by a roxygen tag (we match everything starting with @ but not @@ which is used as escape sequence for a literal @).
syn region rOBlock start="\%^\(\s*#\{1,2}' .*\n\)\{-}\s*#\{1,2}' @\(@\)\@!" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
syn region rOBlock start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-}\s*#\{1,2}' @\(@\)\@!" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
" If a block contains an @rdname, @describeIn tag, it may have paragraph breaks, but does not have a title
syn region rOBlockNoTitle start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @rdname" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
syn region rOBlockNoTitle start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @rdname" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
syn region rOBlockNoTitle start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @describeIn" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
syn region rOBlockNoTitle start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @describeIn" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
" A title as part of a block is always at the beginning of the block, i.e.
" either at the start of a file or after a completely empty line.
syn match rOTitle "\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag
syn match rOTitle "^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag
syn match rOTitleTag contained "@title"
syn match rOCommentKey "#\{1,2}'" contained
syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOTag fold
" rOTag list generated from the lists in
" https://github.com/klutometis/roxygen/R/rd.R and
" https://github.com/klutometis/roxygen/R/namespace.R
" using s/^ \([A-Za-z0-9]*\) = .*/ syn match rOTag contained "@\1"/
" Plus we need the @include tag
" rd.R
syn match rOTag contained "@aliases"
syn match rOTag contained "@author"
syn match rOTag contained "@backref"
syn match rOTag contained "@concept"
syn match rOTag contained "@describeIn"
syn match rOTag contained "@description"
syn match rOTag contained "@details"
syn match rOTag contained "@docType"
syn match rOTag contained "@encoding"
syn match rOTag contained "@evalRd"
syn match rOTag contained "@example"
syn match rOTag contained "@examples"
syn match rOTag contained "@family"
syn match rOTag contained "@field"
syn match rOTag contained "@format"
syn match rOTag contained "@inherit"
syn match rOTag contained "@inheritParams"
syn match rOTag contained "@inheritDotParams"
syn match rOTag contained "@inheritSection"
syn match rOTag contained "@keywords"
syn match rOTag contained "@method"
syn match rOTag contained "@name"
syn match rOTag contained "@md"
syn match rOTag contained "@noMd"
syn match rOTag contained "@noRd"
syn match rOTag contained "@note"
syn match rOTag contained "@param"
syn match rOTag contained "@rdname"
syn match rOTag contained "@rawRd"
syn match rOTag contained "@references"
syn match rOTag contained "@return"
syn match rOTag contained "@section"
syn match rOTag contained "@seealso"
syn match rOTag contained "@slot"
syn match rOTag contained "@source"
syn match rOTag contained "@template"
syn match rOTag contained "@templateVar"
syn match rOTag contained "@title"
syn match rOTag contained "@usage"
" namespace.R
syn match rOTag contained "@export"
syn match rOTag contained "@exportClass"
syn match rOTag contained "@exportMethod"
syn match rOTag contained "@exportPattern"
syn match rOTag contained "@import"
syn match rOTag contained "@importClassesFrom"
syn match rOTag contained "@importFrom"
syn match rOTag contained "@importMethodsFrom"
syn match rOTag contained "@rawNamespace"
syn match rOTag contained "@S3method"
syn match rOTag contained "@useDynLib"
" other
syn match rOTag contained "@include"
endif endif
@ -168,12 +267,28 @@ syn match rBraceError "[)}]" contained
syn match rCurlyError "[)\]]" contained syn match rCurlyError "[)\]]" contained
syn match rParenError "[\]}]" contained syn match rParenError "[\]}]" contained
if !exists("g:R_hi_fun") " Use Nvim-R to highlight functions dynamically if it is installed
let g:R_hi_fun = 1 if !exists("g:r_syntax_fun_pattern")
let s:ff = split(substitute(globpath(&rtp, "R/functions.vim"), "functions.vim", "", "g"), "\n")
if len(s:ff) > 0
let g:r_syntax_fun_pattern = 0
else
let g:r_syntax_fun_pattern = 1
endif
endif endif
if g:R_hi_fun
" Nvim-R: " Only use Nvim-R to highlight functions if they should not be highlighted
runtime R/functions.vim " according to a generic pattern
if g:r_syntax_fun_pattern == 1
syn match rFunction '[0-9a-zA-Z_\.]\+\s*\ze('
else
if !exists("g:R_hi_fun")
let g:R_hi_fun = 1
endif
if g:R_hi_fun
" Nvim-R:
runtime R/functions.vim
endif
endif endif
syn match rDollar display contained "\$" syn match rDollar display contained "\$"
@ -205,8 +320,8 @@ if &filetype == "rhelp"
syn match rhSection "\\dontrun\>" syn match rhSection "\\dontrun\>"
endif endif
if exists("r_syn_minlines") if exists("r_syntax_minlines")
exe "syn sync minlines=" . r_syn_minlines exe "syn sync minlines=" . r_syntax_minlines
else else
syn sync minlines=40 syn sync minlines=40
endif endif
@ -243,15 +358,17 @@ hi def link rStatement Statement
hi def link rString String hi def link rString String
hi def link rStrError Error hi def link rStrError Error
hi def link rType Type hi def link rType Type
if g:r_hl_roxygen if g:r_syntax_hl_roxygen
hi def link rOKeyword Title hi def link rOTitleTag Operator
hi def link rOBlock Comment hi def link rOTag Operator
hi def link rOTitleBlock Title
hi def link rOBlock Comment
hi def link rOBlockNoTitle Comment
hi def link rOTitle Title hi def link rOTitle Title
hi def link rOCommentKey Comment hi def link rOCommentKey Comment
hi def link rOExamples SpecialComment hi def link rOExamples SpecialComment
endif endif
let b:current_syntax="r" let b:current_syntax="r"
" vim: ts=8 sw=2 " vim: ts=8 sw=2

View File

@ -1,17 +1,26 @@
" markdown Text with R statements " markdown Text with R statements
" Language: markdown with R code chunks " Language: markdown with R code chunks
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Tue Jun 28, 2016 10:09AM " Last Change: Sat Jan 28, 2017 10:06PM
" "
" CONFIGURATION: " CONFIGURATION:
" To highlight chunk headers as R code, put in your vimrc: " To highlight chunk headers as R code, put in your vimrc (e.g. .config/nvim/init.vim):
" let rmd_syn_hl_chunk = 1 " let rmd_syn_hl_chunk = 1
"
" For highlighting pandoc extensions to markdown like citations and TeX and
" many other advanced features like folding of markdown sections, it is
" recommended to install the vim-pandoc filetype plugin as well as the
" vim-pandoc-syntax filetype plugin from https://github.com/vim-pandoc.
"
" TODO:
" - Provide highlighting for rmarkdown parameters in yaml header
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
endif endif
" load all of pandoc info " load all of pandoc info, e.g. from
" https://github.com/vim-pandoc/vim-pandoc-syntax
runtime syntax/pandoc.vim runtime syntax/pandoc.vim
if exists("b:current_syntax") if exists("b:current_syntax")
let rmdIsPandoc = 1 let rmdIsPandoc = 1
@ -22,28 +31,54 @@ else
if exists("b:current_syntax") if exists("b:current_syntax")
unlet b:current_syntax unlet b:current_syntax
endif endif
" load all of the yaml syntax highlighting rules into @yaml
syntax include @yaml syntax/yaml.vim
if exists("b:current_syntax")
unlet b:current_syntax
endif
" highlight yaml block commonly used for front matter
syntax region rmdYamlBlock matchgroup=rmdYamlBlockDelim start="^---" matchgroup=rmdYamlBlockDelim end="^---" contains=@yaml keepend fold
endif endif
" load all of the r syntax highlighting rules into @R if !exists("g:rmd_syn_langs")
syntax include @R syntax/r.vim let g:rmd_syn_langs = ["r"]
if exists("b:current_syntax")
unlet b:current_syntax
endif
if exists("g:rmd_syn_hl_chunk")
" highlight R code inside chunk header
syntax match rmdChunkDelim "^[ \t]*```{r" contained
syntax match rmdChunkDelim "}$" contained
else else
syntax match rmdChunkDelim "^[ \t]*```{r.*}$" contained let s:hasr = 0
for s:lng in g:rmd_syn_langs
if s:lng == "r"
let s:hasr = 1
endif
endfor
if s:hasr == 0
let g:rmd_syn_langs += ["r"]
endif
endif endif
syntax match rmdChunkDelim "^[ \t]*```$" contained
syntax region rmdChunk start="^[ \t]*``` *{r.*}$" end="^[ \t]*```$" contains=@R,rmdChunkDelim keepend fold for s:lng in g:rmd_syn_langs
exe 'syntax include @' . toupper(s:lng) . ' syntax/'. s:lng . '.vim'
if exists("b:current_syntax")
unlet b:current_syntax
endif
exe 'syntax region rmd' . toupper(s:lng) . 'Chunk start="^[ \t]*``` *{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\).*}$" end="^[ \t]*```$" contains=@' . toupper(s:lng) . ',rmd' . toupper(s:lng) . 'ChunkDelim keepend fold'
if exists("g:rmd_syn_hl_chunk") && s:lng == "r"
" highlight R code inside chunk header
syntax match rmdRChunkDelim "^[ \t]*```{r" contained
syntax match rmdRChunkDelim "}$" contained
else
exe 'syntax match rmd' . toupper(s:lng) . 'ChunkDelim "^[ \t]*```{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\).*}$" contained'
endif
exe 'syntax match rmd' . toupper(s:lng) . 'ChunkDelim "^[ \t]*```$" contained'
endfor
" also match and syntax highlight in-line R code " also match and syntax highlight in-line R code
syntax match rmdEndInline "`" contained syntax region rmdrInline matchgroup=rmdInlineDelim start="`r " end="`" contains=@R containedin=pandocLaTeXRegion,yamlFlowString keepend
syntax match rmdBeginInline "`r " contained " I was not able to highlight rmdrInline inside a pandocLaTeXCommand, although
syntax region rmdrInline start="`r " end="`" contains=@R,rmdBeginInline,rmdEndInline keepend " highlighting works within pandocLaTeXRegion and yamlFlowString.
syntax cluster texMathZoneGroup add=rmdrInline
" match slidify special marker " match slidify special marker
syntax match rmdSlidifySpecial "\*\*\*" syntax match rmdSlidifySpecial "\*\*\*"
@ -56,8 +91,6 @@ if rmdIsPandoc == 0
if exists("b:current_syntax") if exists("b:current_syntax")
unlet b:current_syntax unlet b:current_syntax
endif endif
" Extend cluster
syn cluster texMathZoneGroup add=rmdrInline
" Inline " Inline
syntax match rmdLaTeXInlDelim "\$" syntax match rmdLaTeXInlDelim "\$"
syntax match rmdLaTeXInlDelim "\\\$" syntax match rmdLaTeXInlDelim "\\\$"
@ -65,19 +98,24 @@ if rmdIsPandoc == 0
" Region " Region
syntax match rmdLaTeXRegDelim "\$\$" contained syntax match rmdLaTeXRegDelim "\$\$" contained
syntax match rmdLaTeXRegDelim "\$\$latex$" contained syntax match rmdLaTeXRegDelim "\$\$latex$" contained
syntax region rmdLaTeXRegion start="^\$\$" skip="\\\$" end="\$\$$" contains=@LaTeX,rmdLaTeXSt,rmdLaTeXRegDelim keepend syntax match rmdLaTeXSt "\\[a-zA-Z]\+"
syntax region rmdLaTeXRegion2 start="^\\\[" end="\\\]" contains=@LaTeX,rmdLaTeXSt,rmdLaTeXRegDelim keepend syntax region rmdLaTeXRegion start="^\$\$" skip="\\\$" end="\$\$$" contains=@LaTeX,rmdLaTeXRegDelim keepend
syntax region rmdLaTeXRegion2 start="^\\\[" end="\\\]" contains=@LaTeX,rmdLaTeXRegDelim keepend
hi def link rmdBlockQuote Comment
hi def link rmdLaTeXSt Statement hi def link rmdLaTeXSt Statement
hi def link rmdLaTeXInlDelim Special hi def link rmdLaTeXInlDelim Special
hi def link rmdLaTeXRegDelim Special hi def link rmdLaTeXRegDelim Special
endif endif
syn sync match rmdSyncChunk grouphere rmdChunk "^[ \t]*``` *{r" for s:lng in g:rmd_syn_langs
exe 'syn sync match rmd' . toupper(s:lng) . 'SyncChunk grouphere rmd' . toupper(s:lng) . 'Chunk /^[ \t]*``` *{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\)/'
endfor
hi def link rmdChunkDelim Special hi def link rmdYamlBlockDelim Delim
hi def link rmdBeginInline Special for s:lng in g:rmd_syn_langs
hi def link rmdEndInline Special exe 'hi def link rmd' . toupper(s:lng) . 'ChunkDelim Special'
hi def link rmdBlockQuote Comment endfor
hi def link rmdInlineDelim Special
hi def link rmdSlidifySpecial Special hi def link rmdSlidifySpecial Special
let b:current_syntax = "rmd" let b:current_syntax = "rmd"

295
runtime/syntax/rust.vim Normal file
View File

@ -0,0 +1,295 @@
" Vim syntax file
" Language: Rust
" Maintainer: Patrick Walton <pcwalton@mozilla.com>
" Maintainer: Ben Blum <bblum@cs.cmu.edu>
" Maintainer: Chris Morgan <me@chrismorgan.info>
" Last Change: Feb 24, 2016
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" Syntax definitions {{{1
" Basic keywords {{{2
syn keyword rustConditional match if else
syn keyword rustRepeat for loop while
syn keyword rustTypedef type nextgroup=rustIdentifier skipwhite skipempty
syn keyword rustStructure struct enum nextgroup=rustIdentifier skipwhite skipempty
syn keyword rustUnion union nextgroup=rustIdentifier skipwhite skipempty contained
syn match rustUnionContextual /\<union\_s\+\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*/ transparent contains=rustUnion
syn keyword rustOperator as
syn match rustAssert "\<assert\(\w\)*!" contained
syn match rustPanic "\<panic\(\w\)*!" contained
syn keyword rustKeyword break
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
syn keyword rustKeyword continue
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
syn keyword rustKeyword in impl let
syn keyword rustKeyword pub nextgroup=rustPubScope skipwhite skipempty
syn keyword rustKeyword return
syn keyword rustSuper super
syn keyword rustKeyword unsafe where
syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty
" FIXME: Scoped impl's name is also fallen in this category
syn keyword rustKeyword mod trait nextgroup=rustIdentifier skipwhite skipempty
syn keyword rustStorage move mut ref static const
syn match rustDefault /\<default\ze\_s\+\(impl\|fn\|type\|const\)\>/
syn keyword rustInvalidBareKeyword crate
syn keyword rustPubScopeCrate crate contained
syn match rustPubScopeDelim /[()]/ contained
syn match rustPubScope /([^()]*)/ contained contains=rustPubScopeDelim,rustPubScopeCrate,rustSuper,rustModPath,rustModPathSep,rustSelf transparent
syn keyword rustExternCrate crate contained nextgroup=rustIdentifier,rustExternCrateString skipwhite skipempty
" This is to get the `bar` part of `extern crate "foo" as bar;` highlighting.
syn match rustExternCrateString /".*"\_s*as/ contained nextgroup=rustIdentifier skipwhite transparent skipempty contains=rustString,rustOperator
syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipwhite skipempty
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
syn region rustBoxPlacement matchgroup=rustBoxPlacementParens start="(" end=")" contains=TOP contained
" Ideally we'd have syntax rules set up to match arbitrary expressions. Since
" we don't, we'll just define temporary contained rules to handle balancing
" delimiters.
syn region rustBoxPlacementBalance start="(" end=")" containedin=rustBoxPlacement transparent
syn region rustBoxPlacementBalance start="\[" end="\]" containedin=rustBoxPlacement transparent
" {} are handled by rustFoldBraces
syn region rustMacroRepeat matchgroup=rustMacroRepeatDelimiters start="$(" end=")" contains=TOP nextgroup=rustMacroRepeatCount
syn match rustMacroRepeatCount ".\?[*+]" contained
syn match rustMacroVariable "$\w\+"
" Reserved (but not yet used) keywords {{{2
syn keyword rustReservedKeyword alignof become do offsetof priv pure sizeof typeof unsized yield abstract virtual final override macro
" Built-in types {{{2
syn keyword rustType isize usize char bool u8 u16 u32 u64 u128 f32
syn keyword rustType f64 i8 i16 i32 i64 i128 str Self
" Things from the libstd v1 prelude (src/libstd/prelude/v1.rs) {{{2
" This section is just straight transformation of the contents of the prelude,
" to make it easy to update.
" Reexported core operators {{{3
syn keyword rustTrait Copy Send Sized Sync
syn keyword rustTrait Drop Fn FnMut FnOnce
" Reexported functions {{{3
" Theres no point in highlighting these; when one writes drop( or drop::< it
" gets the same highlighting anyway, and if someone writes `let drop = …;` we
" dont really want *that* drop to be highlighted.
"syn keyword rustFunction drop
" Reexported types and traits {{{3
syn keyword rustTrait Box
syn keyword rustTrait ToOwned
syn keyword rustTrait Clone
syn keyword rustTrait PartialEq PartialOrd Eq Ord
syn keyword rustTrait AsRef AsMut Into From
syn keyword rustTrait Default
syn keyword rustTrait Iterator Extend IntoIterator
syn keyword rustTrait DoubleEndedIterator ExactSizeIterator
syn keyword rustEnum Option
syn keyword rustEnumVariant Some None
syn keyword rustEnum Result
syn keyword rustEnumVariant Ok Err
syn keyword rustTrait SliceConcatExt
syn keyword rustTrait String ToString
syn keyword rustTrait Vec
" Other syntax {{{2
syn keyword rustSelf self
syn keyword rustBoolean true false
" If foo::bar changes to foo.bar, change this ("::" to "\.").
" If foo::bar changes to Foo::bar, change this (first "\w" to "\u").
syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3
syn match rustModPathSep "::"
syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1
syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::<T>();
" This is merely a convention; note also the use of [A-Z], restricting it to
" latin identifiers rather than the full Unicode uppercase. I have not used
" [:upper:] as it depends upon 'noignorecase'
"syn match rustCapsIdent display "[A-Z]\w\(\w\)*"
syn match rustOperator display "\%(+\|-\|/\|*\|=\|\^\|&\||\|!\|>\|<\|%\)=\?"
" This one isn't *quite* right, as we could have binary-& with a reference
syn match rustSigil display /&\s\+[&~@*][^)= \t\r\n]/he=e-1,me=e-1
syn match rustSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1
" This isn't actually correct; a closure with no arguments can be `|| { }`.
" Last, because the & in && isn't a sigil
syn match rustOperator display "&&\|||"
" This is rustArrowCharacter rather than rustArrow for the sake of matchparen,
" so it skips the ->; see http://stackoverflow.com/a/30309949 for details.
syn match rustArrowCharacter display "->"
syn match rustQuestionMark display "?\([a-zA-Z]\+\)\@!"
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic
syn match rustEscapeError display contained /\\./
syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/
syn match rustEscapeUnicode display contained /\\u{\x\{1,6}}/
syn match rustStringContinuation display contained /\\\n\s*/
syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive,rustCommentLine,rustCommentBlock,rustCommentLineDocError,rustCommentBlockDocError
syn region rustDerive start="derive(" end=")" contained contains=rustDeriveTrait
" This list comes from src/libsyntax/ext/deriving/mod.rs
" Some are deprecated (Encodable, Decodable) or to be removed after a new snapshot (Show).
syn keyword rustDeriveTrait contained Clone Hash RustcEncodable RustcDecodable Encodable Decodable PartialEq Eq PartialOrd Ord Rand Show Debug Default FromPrimitive Send Sync Copy
" Number literals
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
" Special case for numbers of the form "1." which are float literals, unless followed by
" an identifier, which makes them integer literals with a method call or field access,
" or by another ".", which makes them integer literals followed by the ".." token.
" (This must go first so the others take precedence.)
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\|\.\)\@!"
" To mark a number as a normal float, it must have at least one of the three things integral values don't have:
" a decimal point and more numbers; an exponent; and a type suffix.
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\="
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\="
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)"
" For the benefit of delimitMate
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt0\\\"]\|x\x\{2}\|u{\x\{1,6}}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
syn region rustGenericRegion display start=/<\%('\|[^[cntrl:][:space:][:punct:]]\)\@=')\S\@=/ end=/>/ contains=rustGenericLifetimeCandidate
syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
syn match rustLabel display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*:"
syn match rustCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/
" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII).
syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u{\x\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
syn match rustShebang /\%^#![^[].*/
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
syn region rustCommentLineDocError start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell contained
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell
syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell
syn region rustCommentBlockDocError matchgroup=rustCommentBlockDocError start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNestError,@Spell contained
syn region rustCommentBlockNest matchgroup=rustCommentBlock start="/\*" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell contained transparent
syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent
syn region rustCommentBlockDocNestError matchgroup=rustCommentBlockDocError start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNestError,@Spell contained transparent
" FIXME: this is a really ugly and not fully correct implementation. Most
" importantly, a case like ``/* */*`` should have the final ``*`` not being in
" a comment, but in practice at present it leaves comments open two levels
" deep. But as long as you stay away from that particular case, I *believe*
" the highlighting is correct. Due to the way Vim's syntax engine works
" (greedy for start matches, unlike Rust's tokeniser which is searching for
" the earliest-starting match, start or end), I believe this cannot be solved.
" Oh you who would fix it, don't bother with things like duplicating the Block
" rules and putting ``\*\@<!`` at the start of them; it makes it worse, as
" then you must deal with cases like ``/*/**/*/``. And don't try making it
" worse with ``\%(/\@<!\*\)\@<!``, either...
syn keyword rustTodo contained TODO FIXME XXX NB NOTE
" Folding rules {{{2
" Trivial folding rules to begin with.
" FIXME: use the AST to make really good folding
syn region rustFoldBraces start="{" end="}" transparent fold
" Default highlighting {{{1
hi def link rustDecNumber rustNumber
hi def link rustHexNumber rustNumber
hi def link rustOctNumber rustNumber
hi def link rustBinNumber rustNumber
hi def link rustIdentifierPrime rustIdentifier
hi def link rustTrait rustType
hi def link rustDeriveTrait rustTrait
hi def link rustMacroRepeatCount rustMacroRepeatDelimiters
hi def link rustMacroRepeatDelimiters Macro
hi def link rustMacroVariable Define
hi def link rustSigil StorageClass
hi def link rustEscape Special
hi def link rustEscapeUnicode rustEscape
hi def link rustEscapeError Error
hi def link rustStringContinuation Special
hi def link rustString String
hi def link rustCharacterInvalid Error
hi def link rustCharacterInvalidUnicode rustCharacterInvalid
hi def link rustCharacter Character
hi def link rustNumber Number
hi def link rustBoolean Boolean
hi def link rustEnum rustType
hi def link rustEnumVariant rustConstant
hi def link rustConstant Constant
hi def link rustSelf Constant
hi def link rustFloat Float
hi def link rustArrowCharacter rustOperator
hi def link rustOperator Operator
hi def link rustKeyword Keyword
hi def link rustTypedef Keyword " More precise is Typedef, but it doesn't feel right for Rust
hi def link rustStructure Keyword " More precise is Structure
hi def link rustUnion rustStructure
hi def link rustPubScopeDelim Delimiter
hi def link rustPubScopeCrate rustKeyword
hi def link rustSuper rustKeyword
hi def link rustReservedKeyword Error
hi def link rustRepeat Conditional
hi def link rustConditional Conditional
hi def link rustIdentifier Identifier
hi def link rustCapsIdent rustIdentifier
hi def link rustModPath Include
hi def link rustModPathSep Delimiter
hi def link rustFunction Function
hi def link rustFuncName Function
hi def link rustFuncCall Function
hi def link rustShebang Comment
hi def link rustCommentLine Comment
hi def link rustCommentLineDoc SpecialComment
hi def link rustCommentLineDocError Error
hi def link rustCommentBlock rustCommentLine
hi def link rustCommentBlockDoc rustCommentLineDoc
hi def link rustCommentBlockDocError Error
hi def link rustAssert PreCondit
hi def link rustPanic PreCondit
hi def link rustMacro Macro
hi def link rustType Type
hi def link rustTodo Todo
hi def link rustAttribute PreProc
hi def link rustDerive PreProc
hi def link rustDefault StorageClass
hi def link rustStorage StorageClass
hi def link rustObsoleteStorage Error
hi def link rustLifetime Special
hi def link rustLabel Label
hi def link rustInvalidBareKeyword Error
hi def link rustExternCrate rustKeyword
hi def link rustObsoleteExternMod Error
hi def link rustBoxPlacementParens Delimiter
hi def link rustQuestionMark Special
" Other Suggestions:
" hi rustAttribute ctermfg=cyan
" hi rustDerive ctermfg=cyan
" hi rustAssert ctermfg=yellow
" hi rustPanic ctermfg=red
" hi rustMacro ctermfg=magenta
syn sync minlines=200
syn sync maxlines=500
let b:current_syntax = "rust"

View File

@ -1,262 +1,259 @@
" Vim syntax file " Vim syntax file
" Language: SAS " Language: SAS
" Maintainer: James Kidd <james.kidd@covance.com> " Maintainer: Zhen-Huan Hu <wildkeny@gmail.com>
" Last Change: 2012 Apr 20 " Original Maintainer: James Kidd <james.kidd@covance.com>
" Corrected bug causing some keywords to appear as strings instead " Version: 3.0.0
" 18 Jul 2008 by Paulo Tanimoto <ptanimoto@gmail.com> " Last Change: Mar 10, 2017
" Fixed comments with * taking multiple lines. "
" Fixed highlighting of macro keywords. " 2017 Mar 7
" Added words to cases that didn't fit anywhere. "
" 02 Jun 2003 " Upgrade version number to 3.0. Improvements include:
" Added highlighting for additional keywords and such; " - Improve sync speed
" Attempted to match SAS default syntax colors; " - Largely enhance precision
" Changed syncing so it doesn't lose colors on large blocks; " - Update keywords in the latest SAS (as of Mar 2017)
" Much thanks to Bob Heckel for knowledgeable tweaking. " - Add syntaxes for date/time constants
" quit when a syntax file was already loaded " - Add syntax for data lines
if exists("b:current_syntax") " - Add (back) syntax for TODO in comments
finish "
" 2017 Feb 9
"
" Add syntax folding
"
" 2016 Oct 10
"
" Add highlighting for functions
"
" 2016 Sep 14
"
" Change the implementation of syntaxing
" macro function names so that macro parameters same
" as SAS keywords won't be highlighted
" (Thank Joug Raw for the suggestion)
" Add section highlighting:
" - Use /** and **/ to define a section
" - It functions the same as a comment but
" with different highlighting
"
" 2016 Jun 14
"
" Major changes so upgrade version number to 2.0
" Overhaul the entire script (again). Improvements include:
" - Higher precision
" - Faster synchronization
" - Separate color for control statements
" - Highlight hash and java objects
" - Highlight macro variables in double quoted strings
" - Update all syntaxes based on SAS 9.4
" - Add complete SAS/GRAPH and SAS/STAT procedure syntaxes
" - Add Proc TEMPLATE and GTL syntaxes
" - Add complete DS2 syntaxes
" - Add basic IML syntaxes
" - Many other improvements and bug fixes
" Drop support for VIM version < 600
if version < 600
syntax clear
elseif exists('b:current_syntax')
finish
endif endif
let s:cpo_save = &cpo
set cpo&vim
syn case ignore syn case ignore
syn region sasString start=+"+ skip=+\\\\\|\\"+ end=+"+ " Basic SAS syntaxes
syn region sasString start=+'+ skip=+\\\\\|\\"+ end=+'+ syn keyword sasOperator and eq ge gt in le lt ne not of or
syn keyword sasReserved _all_ _automatic_ _char_ _character_ _data_ _infile_ _last_ _n_ _name_ _null_ _num_ _numeric_ _temporary_ _user_ _webout_
" Strings
syn region sasString start=+'+ skip=+''+ end=+'+ contains=@Spell
syn region sasString start=+"+ skip=+""+ end=+"+ contains=sasMacroVariable,@Spell
" Constants
syn match sasNumber /\v<\d+%(\.\d+)=%(>|e[\-+]=\d+>)/ display
syn match sasDateTime /\v(['"])\d{2}%(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d{2}%(\d{2})=:\d{2}:\d{2}%(:\d{2})=%(am|pm)\1dt>/ display
syn match sasDateTime /\v(['"])\d{2}%(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d{2}%(\d{2})=\1d>/ display
syn match sasDateTime /\v(['"])\d{2}:\d{2}%(:\d{2})=%(am|pm)\1t>/ display
" Comments
syn keyword sasTodo todo tbd fixme contained
syn region sasComment start='/\*' end='\*/' contains=sasTodo
syn region sasComment start='\v%(^|;)\s*\zs\%=\*' end=';'me=s-1 contains=sasTodo
syn region sasSectLbl matchgroup=sasSectLblEnds start='/\*\*\s*' end='\s*\*\*/' concealends
" Macros
syn match sasMacroVariable '\v\&+\w+%(\.\w+)=' display
syn match sasMacroReserved '\v\%%(abort|by|copy|display|do|else|end|global|goto|if|include|input|let|list|local|macro|mend|put|return|run|symdel|syscall|sysexec|syslput|sysrput|then|to|until|window|while)>' display
syn region sasMacroFunction matchgroup=sasMacroFunctionName start='\v\%\w+\ze\(' end=')'he=s-1 contains=@sasBasicSyntax,sasMacroFunction
syn region sasMacroFunction matchgroup=sasMacroFunctionName start='\v\%q=sysfunc\ze\(' end=')'he=s-1 contains=@sasBasicSyntax,sasMacroFunction,sasDataStepFunction
" Syntax cluster for basic SAS syntaxes
syn cluster sasBasicSyntax contains=sasOperator,sasReserved,sasNumber,sasDateTime,sasString,sasComment,sasMacroReserved,sasMacroFunction,sasMacroVariable,sasSectLbl
" Want region from 'cards;' to ';' to be captured (Bob Heckel) " Formats
syn region sasCards start="^\s*CARDS.*" end="^\s*;\s*$" syn match sasFormat '\v\$\w+\.' display contained
syn region sasCards start="^\s*DATALINES.*" end="^\s*;\s*$" syn match sasFormat '\v<\w+\.%(\d+>)=' display contained
syn region sasFormatContext start='.' end=';'me=s-1 contained contains=@sasBasicSyntax,sasFormat
syn match sasNumber "-\=\<\d*\.\=[0-9_]\>" " Define global statements that can be accessed out of data step or procedures
syn keyword sasGlobalStatementKeyword catname dm endsas filename footnote footnote1 footnote2 footnote3 footnote4 footnote5 footnote6 footnote7 footnote8 footnote9 footnote10 missing libname lock ods options page quit resetline run sasfile skip sysecho title title1 title2 title3 title4 title5 title6 title7 title8 title9 title10 contained
syn keyword sasGlobalStatementODSKeyword chtml csvall docbook document escapechar epub epub2 epub3 exclude excel graphics html html3 html5 htmlcss imode listing markup output package path pcl pdf preferences phtml powerpoint printer proclabel proctitle ps results rtf select show tagsets trace usegopt verify wml contained
syn match sasGlobalStatement '\v%(^|;)\s*\zs\h\w*>' display transparent contains=sasGlobalStatementKeyword
syn match sasGlobalStatement '\v%(^|;)\s*\zsods>' display transparent contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
" Block comment " Data step statements, 9.4
syn region sasComment start="/\*" end="\*/" contains=sasTodo syn keyword sasDataStepFunctionName abs addr addrlong airy allcomb allperm anyalnum anyalpha anycntrl anydigit anyfirst anygraph anylower anyname anyprint anypunct anyspace anyupper anyxdigit arcos arcosh arsin arsinh artanh atan atan2 attrc attrn band beta betainv blackclprc blackptprc blkshclprc blkshptprc blshift bnot bor brshift bxor byte cat catq cats catt catx cdf ceil ceilz cexist char choosec choosen cinv close cmiss cnonct coalesce coalescec collate comb compare compbl compfuzz compged complev compound compress constant convx convxp cos cosh cot count countc countw csc css cumipmt cumprinc curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datdif date datejul datepart datetime day dclose dcreate depdb depdbsl depsl depsyd deptab dequote deviance dhms dif digamma dim dinfo divide dnum dopen doptname doptnum dosubl dread dropnote dsname dsncatlgd dur durp effrate envlen erf erfc euclid exist exp fact fappend fclose fcol fcopy fdelete fetch fetchobs fexist fget fileexist filename fileref finance find findc findw finfo finv fipname fipnamel fipstate first floor floorz fmtinfo fnonct fnote fopen foptname foptnum fpoint fpos fput fread frewind frlen fsep fuzz fwrite gaminv gamma garkhclprc garkhptprc gcd geodist geomean geomeanz getoption getvarc getvarn graycode harmean harmeanz hbound hms holiday holidayck holidaycount holidayname holidaynx holidayny holidaytest hour htmldecode htmlencode ibessel ifc ifn index indexc indexw input inputc inputn int intcindex intck intcycle intfit intfmt intget intindex intnx intrr intseas intshift inttest intz iorcmsg ipmt iqr irr jbessel juldate juldate7 kurtosis lag largest lbound lcm lcomb left length lengthc lengthm lengthn lexcomb lexcombi lexperk lexperm lfact lgamma libname libref log log1px log10 log2 logbeta logcdf logistic logpdf logsdf lowcase lperm lpnorm mad margrclprc margrptprc max md5 mdy mean median min minute missing mod modexist module modulec modulen modz month mopen mort msplint mvalid contained
syn keyword sasDataStepFunctionName n netpv nliteral nmiss nomrate normal notalnum notalpha notcntrl notdigit note notfirst notgraph notlower notname notprint notpunct notspace notupper notxdigit npv nvalid nwkdom open ordinal pathname pctl pdf peek peekc peekclong peeklong perm pmt point poisson ppmt probbeta probbnml probbnrm probchi probf probgam probhypr probit probmc probnegb probnorm probt propcase prxchange prxmatch prxparen prxparse prxposn ptrlongadd put putc putn pvp qtr quantile quote ranbin rancau rand ranexp rangam range rank rannor ranpoi rantbl rantri ranuni rename repeat resolve reverse rewind right rms round rounde roundz saving savings scan sdf sec second sha256 sha256hex sha256hmachex sign sin sinh skewness sleep smallest soapweb soapwebmeta soapwipservice soapwipsrs soapws soapwsmeta soundex spedis sqrt squantile std stderr stfips stname stnamel strip subpad substr substrn sum sumabs symexist symget symglobl symlocal sysexist sysget sysmsg sysparm sysprocessid sysprocessname sysprod sysrc system tan tanh time timepart timevalue tinv tnonct today translate transtrn tranwrd trigamma trim trimn trunc tso typeof tzoneid tzonename tzoneoff tzones2u tzoneu2s uniform upcase urldecode urlencode uss uuidgen var varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vtype vtypex vvalue vvaluex week weekday whichc whichn wto year yieldp yrdif yyq zipcity zipcitydistance zipfips zipname zipnamel zipstate contained
syn keyword sasDataStepCallRoutineName allcomb allcombi allperm cats catt catx compcost execute graycode is8601_convert label lexcomb lexcombi lexperk lexperm logistic missing module poke pokelong prxchange prxdebug prxfree prxnext prxposn prxsubstr ranbin rancau rancomb ranexp rangam rannor ranperk ranperm ranpoi rantbl rantri ranuni scan set sleep softmax sortc sortn stdize streaminit symput symputx system tanh tso vname vnext wto contained
syn region sasDataStepFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction
syn region sasDataStepFunctionFormatContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction,sasFormat
syn match sasDataStepFunction '\v<\w+\ze\(' contained contains=sasDataStepFunctionName,sasDataStepCallRoutineName nextgroup=sasDataStepFunctionContext
syn match sasDataStepFunction '\v%(input|put)\ze\(' contained contains=sasDataStepFunctionName nextgroup=sasDataStepFunctionFormatContext
syn keyword sasDataStepHashMethodName add check clear definedata definedone definekey delete do_over equals find find_next find_prev first has_next has_prev last next output prev ref remove removedup replace replacedup reset_dup setcur sum sumdup contained
syn region sasDataStepHashMethodContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction
syn match sasDataStepHashMethod '\v\.\w+\ze\(' contained contains=sasDataStepHashMethodName nextgroup=sasDataStepHashMethodContext
syn keyword sasDataStepHashAttributeName item_size num_items contained
syn match sasDataStepHashAttribute '\v\.\w+>\ze\_[^(]' display contained contains=sasDataStepHashAttributeName
syn keyword sasDataStepControl continue do end go goto if leave link otherwise over return select to until when while contained
syn keyword sasDataStepControl else then contained nextgroup=sasDataStepStatementKeyword skipwhite skipnl skipempty
syn keyword sasDataStepHashOperator _new_ contained
syn keyword sasDataStepStatementKeyword abort array attrib by call cards cards4 datalines datalines4 dcl declare delete describe display drop error execute file format infile informat input keep label length lines lines4 list lostcard merge modify output put putlog redirect remove rename replace retain set stop update where window contained
syn keyword sasDataStepStatementHashKeyword hash hiter javaobj contained
syn match sasDataStepStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasDataStepStatementKeyword,sasGlobalStatementKeyword
syn match sasDataStepStatement '\v%(^|;)\s*\zs%(dcl|declare)>' display contained contains=sasDataStepStatementKeyword nextgroup=sasDataStepStatementHashKeyword skipwhite skipnl skipempty
syn match sasDataStepStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn match sasDataStepStatement '\v%(^|;)\s*\zs%(format|informat|input|put)>' display contained contains=sasDataStepStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
syn match sasDataStepStatement '\v%(^|;)\s*\zs%(cards|datalines|lines)4=\s*;' display contained contains=sasDataStepStatementKeyword nextgroup=sasDataLine skipwhite skipnl skipempty
syn region sasDataLine start='^' end='^;'me=s-1 contained
syn region sasDataStep matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsdata>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,@sasDataStepSyntax
syn cluster sasDataStepSyntax contains=sasDataStepFunction,sasDataStepHashOperator,sasDataStepHashAttribute,sasDataStepHashMethod,sasDataStepControl,sasDataStepStatement
" Ignore misleading //JCL SYNTAX... (Bob Heckel) " Procedures, base SAS, 9.4
syn region sasComment start="[^/][^/]/\*" end="\*/" contains=sasTodo syn keyword sasProcStatementKeyword abort age append array attrib audit block break by calid cdfplot change checkbox class classlev column compute contents copy create datarow dbencoding define delete deletefunc deletesubr delimiter device dialog dur endcomp exact exchange exclude explore fin fmtlib fontfile fontpath format formats freq function getnames guessingrows hbar hdfs histogram holidur holifin holistart holivar id idlabel informat inset invalue item key keylabel keyword label line link listfunc listsubr mapmiss mapreduce mean menu messages meta modify opentype outargs outdur outfin output outstart pageby partial picture pie pig plot ppplot printer probplot profile prompter qqplot radiobox ranks rbreak rbutton rebuild record remove rename repair report roptions save select selection separator source star start statistics struct submenu subroutine sum sumby table tables test text trantab truetype type1 types value var vbar ways weight where with write contained
syn match sasProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcStatementKeyword,sasGlobalStatementKeyword
syn match sasProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn match sasProcStatement '\v%(^|;)\s*\zs%(format|informat)>' display contained contains=sasProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
syn region sasProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc%(\s+\h\w*)=>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasProcStatement
syn region sasProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(catalog|chart|datasets|document|plot)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasProcStatement
" Previous code for comments was written by Bob Heckel " Procedures, SAS/GRAPH, 9.4
" Comments with * may take multiple lines (Paulo Tanimoto) syn keyword sasGraphProcStatementKeyword add area axis bar block bubble2 byline cc ccopy cdef cdelete chart cmap choro copy delete device dial donut exclude flow format fs goptions gout grid group hbar hbar3d hbullet hslider htrafficlight id igout label legend list modify move nobyline note pattern pie pie3d plot plot2 preview prism quit rename replay select scatter speedometer star surface symbol tc tcopy tdef tdelete template tile toggle treplay vbar vbar3d vtrafficlight vbullet vslider where contained
syn region sasComment start=";\s*\*"hs=s+1 end=";" contains=sasTodo syn match sasGraphProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasGraphProcStatementKeyword,sasGlobalStatementKeyword
syn match sasGraphProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasGraphProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
syn region sasGraphProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(g3d|g3grid|ganno|gcontour|gdevice|geocode|gfont|ginside|goptions|gproject|greduce|gremove|mapimport)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasGraphProcStatement
syn region sasGraphProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(gareabar|gbarline|gchart|gkpi|gmap|gplot|gradar|greplay|gslide|gtile)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasGraphProcStatement
" Comments with * starting after a semicolon (Paulo Tanimoto) " Procedures, SAS/STAT, 14.1
syn region sasComment start="^\s*\*" end=";" contains=sasTodo syn keyword sasAnalyticalProcStatementKeyword absorb add array assess baseline bayes beginnodata bivar bootstrap bounds by cdfplot cells class cluster code compute condition contrast control coordinates copy cosan cov covtest coxreg der design determ deviance direct directions domain effect effectplot effpart em endnodata equality estimate exact exactoptions factor factors fcs filter fitindex format freq fwdlink gender grid group grow hazardratio height hyperprior id impjoint inset insetgroup invar invlink ippplot lincon lineqs lismod lmtests location logistic loglin lpredplot lsmeans lsmestimate manova matings matrix mcmc mean means missmodel mnar model modelaverage modeleffects monotone mstruct mtest multreg name nlincon nloptions oddsratio onecorr onesamplefreq onesamplemeans onewayanova outfiles output paired pairedfreq pairedmeans parameters parent parms partial partition path pathdiagram pcov performance plot population poststrata power preddist predict predpplot priors process probmodel profile prune pvar ram random ratio reference refit refmodel renameparm repeated replicate repweights response restore restrict retain reweight ridge rmsstd roc roccontrast rules samplesize samplingunit seed size scale score selection show simtests simulate slice std stderr store strata structeq supplementary table tables test testclass testfreq testfunc testid time transform treatments trend twosamplefreq twosamplemeans towsamplesurvival twosamplewilcoxon uds units univar var variance varnames weight where with zeromodel contained
syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasAnalyticalProcStatementKeyword,sasGlobalStatementKeyword
syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasAnalyticalProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
syn region sasAnalyticalProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(aceclus|adaptivereg|bchoice|boxplot|calis|cancorr|candisc|cluster|corresp|discrim|distance|factor|fastclus|fmm|freq|gam|gampl|gee|genmod|glimmix|glmmod|glmpower|glmselect|hpcandisc|hpfmm|hpgenselect|hplmixed|hplogistic|hpmixed|hpnlmod|hppls|hpprincomp|hpquantselect|hpreg|hpsplit|iclifetest|icphreg|inbreed|irt|kde|krige2d|lattice|lifereg|lifetest|loess|logistic|mcmc|mds|mi|mianalyze|mixed|modeclus|multtest|nested|nlin|nlmixed|npar1way|orthoreg|phreg|plm|pls|power|princomp|prinqual|probit|quantlife|quantreg|quantselect|robustreg|rsreg|score|seqdesign|seqtest|sim2d|simnormal|spp|stdize|stdrate|stepdisc|surveyfreq|surveyimpute|surveylogistic|surveymeans|surveyphreg|surveyreg|surveyselect|tpspline|transreg|tree|ttest|varclus|varcomp|variogram)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepControl,sasDataStepFunction,sasAnalyticalProcStatement
syn region sasAnalyticalProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(anova|arima|catmod|factex|glm|model|optex|plan|reg)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepControl,sasDataStepFunction,sasAnalyticalProcStatement
" This line defines macro variables in code. "hi def link" at end of file " Procedures, ODS graphics, 9.4
" defines the color scheme. Begin region with ampersand and end with syn keyword sasODSGraphicsProcStatementKeyword band block bubble by colaxis compare dattrvar density dot dropline dynamic ellipse ellipseparm format fringe gradlegend hbar hbarbasic hbarparm hbox heatmap heatmapparm highlow histogram hline inset keylegend label lineparm loess matrix needle parent panelby pbspline plot polygon refline reg rowaxis scatter series spline step style styleattrs symbolchar symbolimage text vbar vbarbasic vbarparm vbox vector vline waterfall where xaxis x2axis yaxis y2axis yaxistable contained
" any non-word character offset by -1; put ampersand in the skip list syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasODSGraphicsProcStatementKeyword,sasGlobalStatementKeyword
" just in case it is used to concatenate macro variable values. syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasODSGraphicsProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
syn region sasODSGraphicsProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(sgdesign|sgpanel|sgplot|sgrender|sgscatter)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasODSGraphicsProcStatement
" Thanks to ronald h<>llwarth for this fix to an intra-versioning " Proc TEMPLATE, 9.4
" problem with this little feature syn keyword sasProcTemplateClause as into
syn keyword sasProcTemplateStatementKeyword block break cellstyle class close column compute continue define delete delstream do done dynamic edit else end eval flush footer header import iterate link list mvar ndent next nmvar notes open path put putl putlog putq putstream putvars replace set source stop style test text text2 text3 translate trigger unblock unset xdent contained
syn keyword sasProcTemplateStatementComplexKeyword cellvalue column crosstabs event footer header statgraph style table tagset contained
syn keyword sasProcTemplateGTLStatementKeyword axislegend axistable bandplot barchart barchartparm begingraph beginpolygon beginpolyline bihistogram3dparm blockplot boxplot boxplotparm bubbleplot continuouslegend contourplotparm dendrogram discretelegend drawarrow drawimage drawline drawoval drawrectangle drawtext dropline ellipse ellipseparm endgraph endinnermargin endlayout endpolygon endpolyline endsidebar entry entryfootnote entrytitle fringeplot heatmap heatmapparm highlowplot histogram histogramparm innermargin layout legenditem legendtextitems linechart lineparm loessplot mergedlegend modelband needleplot pbsplineplot polygonplot referenceline regressionplot scatterplot seriesplot sidebar stepplot surfaceplotparm symbolchar symbolimage textplot vectorplot waterfallchart contained
syn keyword sasProcTemplateGTLComplexKeyword datalattice datapanel globallegend gridded lattice overlay overlayequated overlay3d region contained
syn match sasProcTemplateStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcTemplateStatementKeyword,sasProcTemplateGTLStatementKeyword,sasGlobalStatementKeyword
syn match sasProcTemplateStatement '\v%(^|;)\s*\zsdefine>' display contained contains=sasProcTemplateStatementKeyword nextgroup=sasProcTemplateStatementComplexKeyword skipwhite skipnl skipempty
syn match sasProcTemplateStatement '\v%(^|;)\s*\zslayout>' display contained contains=sasProcTemplateGTLStatementKeyword nextgroup=sasProcTemplateGTLComplexKeyword skipwhite skipnl skipempty
syn match sasProcTemplateStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn region sasProcTemplate matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+template>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasProcTemplateClause,sasProcTemplateStatement
syn region sasMacroVar start="&" skip="[_&]" end="\W"he=e-1 " Proc SQL, 9.4
syn keyword sasProcSQLFunctionName avg count css cv freq max mean median min n nmiss prt range std stderr sum sumwgt t uss var contained
syn region sasProcSQLFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasProcSQLFunction
syn match sasProcSQLFunction '\v<\w+\ze\(' contained contains=sasProcSQLFunctionName,sasDataStepFunctionName nextgroup=sasProcSQLFunctionContext
syn keyword sasProcSQLClause add asc between by calculated cascade case check connection constraint cross desc distinct drop else end escape except exists foreign from full group having in inner intersect into is join key left libname like modify natural newline notrim null on order outer primary references restrict right separated set then to trimmed union unique user using values when where contained
syn keyword sasProcSQLClause as contained nextgroup=sasProcSQLStatementKeyword skipwhite skipnl skipempty
syn keyword sasProcSQLStatementKeyword connect delete disconnect execute insert reset select update validate contained
syn keyword sasProcSQLStatementComplexKeyword alter create describe drop contained nextgroup=sasProcSQLStatementNextKeyword skipwhite skipnl skipempty
syn keyword sasProcSQLStatementNextKeyword index table view contained
syn match sasProcSQLStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcSQLStatementKeyword,sasGlobalStatementKeyword
syn match sasProcSQLStatement '\v%(^|;)\s*\zs%(alter|create|describe|drop)>' display contained contains=sasProcSQLStatementComplexKeyword nextgroup=sasProcSQLStatementNextKeyword skipwhite skipnl skipempty
syn match sasProcSQLStatement '\v%(^|;)\s*\zsvalidate>' display contained contains=sasProcSQLStatementKeyword nextgroup=sasProcSQLStatementKeyword,sasProcSQLStatementComplexKeyword skipwhite skipnl skipempty
syn match sasProcSQLStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn region sasProcSQL matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+sql>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasProcSQLFunction,sasProcSQLClause,sasProcSQLStatement
" SAS/DS2, 9.4
syn keyword sasDS2FunctionName abs anyalnum anyalpha anycntrl anydigit anyfirst anygraph anylower anyname anyprint anypunct anyspace anyupper anyxdigit arcos arcosh arsin arsinh artanh atan atan2 band beta betainv blackclprc blackptprc blkshclprc blkshptprc blshift bnot bor brshift bxor byte cat cats catt catx ceil ceilz choosec choosen cmp cmpt coalesce coalescec comb compare compbl compfuzz compound compress constant convx convxp cos cosh count countc countw css cumipmt cumprinc cv datdif date datejul datepart datetime day dequote deviance dhms dif digamma dim divide dur durp effrate erf erfc exp fact find findc findw floor floorz fmtinfo fuzz gaminv gamma garkhclprc garkhptprc gcd geodist geomean geomeanz harmean harmeanz hbound hms holiday hour index indexc indexw inputc inputn int intcindex intck intcycle intdt intfit intget intindex intnest intnx intrr intseas intshift inttest intts intz ipmt iqr irr juldate juldate7 kcount kstrcat kstrip kupdate kupdates kurtosis lag largest lbound lcm left length lengthc lengthm lengthn lgamma log logbeta log10 log1px log2 lowcase mad margrclprc margrptprc max md5 mdy mean median min minute missing mod modz month mort n ndims netpv nmiss nomrate notalnum notalpha notcntrl notdigit notfirst notgraph notlower notname notprint notpunct notspace notupper notxdigit npv null nwkdom ordinal pctl perm pmt poisson power ppmt probbeta probbnml probbnrm probchi probdf probf probgam probhypr probit probmc probmed probnegb probnorm probt prxchange prxmatch prxparse prxposn put pvp qtr quote ranbin rancau rand ranexp rangam range rank rannor ranpoi rantbl rantri ranuni repeat reverse right rms round rounde roundz savings scan sec second sha256hex sha256hmachex sign sin sinh skewness sleep smallest sqlexec sqrt std stderr streaminit strip substr substrn sum sumabs tan tanh time timepart timevalue tinv to_date to_double to_time to_timestamp today translate transtrn tranwrd trigamma trim trimn trunc uniform upcase uss uuidgen var verify vformat vinarray vinformat vlabel vlength vname vtype week weekday whichc whichn year yieldp yrdif yyq contained
syn region sasDS2FunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasDS2Function
syn match sasDS2Function '\v<\w+\ze\(' contained contains=sasDS2FunctionName nextgroup=sasDS2FunctionContext
syn keyword sasDS2Control continue data dcl declare do drop else end enddata endpackage endthread from go goto if leave method otherwise package point return select then thread to until when while contained
syn keyword sasDS2StatementKeyword array by forward keep merge output put rename retain set stop vararray varlist contained
syn keyword sasDS2StatementComplexKeyword package thread contained
syn match sasDS2Statement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasDS2StatementKeyword,sasGlobalStatementKeyword
syn match sasDS2Statement '\v%(^|;)\s*\zs%(dcl|declare|drop)>' display contained contains=sasDS2StatementKeyword nextgroup=sasDS2StatementComplexKeyword skipwhite skipnl skipempty
syn match sasDS2Statement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn region sasDS2 matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+ds2>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDS2Function,sasDS2Control,sasDS2Statement
" I dont think specific PROCs need to be listed if use this line (Bob Heckel). " SAS/IML, 14.1
syn match sasProc "^\s*PROC \w\+" syn keyword sasIMLFunctionName abs all allcomb allperm any apply armasim bin blankstr block branks bspline btran byte char choose col colvec concat contents convexit corr corr2cov countmiss countn countunique cov cov2corr covlag cshape cusum cuprod cv cvexhull datasets design designf det diag dif dimension distance do duration echelon eigval eigvec element exp expmatrix expandgrid fft forward froot full gasetup geomean ginv hadamard half hankel harmean hdir hermite homogen i ifft insert int inv invupdt isempty isskipped j jroot kurtosis lag length loc log logabsdet mad magic mahalanobis max mean median min mod moduleic modulein name ncol ndx2sub nleng norm normal nrow num opscal orpol parentname palette polyroot prod product pv quartile rancomb randdirichlet randfun randmultinomial randmvt randnormal randwishart ranperk ranperm range rank ranktie rates ratio remove repeat root row rowcat rowcatc rowvec rsubstr sample setdif shape shapecol skewness solve sparse splinev spot sqrsym sqrt sqrvech ssq standard std storage sub2ndx substr sum sweep symsqr t toeplitz trace trisolv type uniform union unique uniqueby value var vecdiag vech xmult xsect yield contained
syn keyword sasStep RUN QUIT DATA syn keyword sasIMLCallRoutineName appcort armacov armalik bar box change comport delete eigen execute exportdatasettor exportmatrixtor farmacov farmafit farmalik farmasim fdif gaend gagetmem gagetval gainit gareeval garegen gasetcro gasetmut gasetobj gasetsel gblkvp gblkvpd gclose gdelete gdraw gdrawl geneig ggrid ginclude gopen gpie gpiexy gpoint gpoly gport gportpop gportstk gscale gscript gset gshow gsorth gstart gstop gstrlen gtext gvtext gwindow gxaxis gyaxis heatmapcont heatmapdisc histogram importdatasetfromr importmatrixfromr ipf itsolver kalcvf kalcvs kaldff kaldfs lav lcp lms lp lpsolve lts lupdt marg maxqform mcd milpsolve modulei mve nlpcg nlpdd nlpfdd nlpfea nlphqn nlplm nlpnms nlpnra nlpnrr nlpqn nlpqua nlptr ode odsgraph ortvec pgraf push qntl qr quad queue randgen randseed rdodt rupdt rename rupdt rzlind scatter seq seqscale seqshift seqscale seqshift series solvelin sort sortndx sound spline splinec svd tabulate tpspline tpsplnev tsbaysea tsdecomp tsmlocar tsmlomar tsmulmar tspears tspred tsroot tstvcar tsunimar valset varmacov varmalik varmasim vnormal vtsroot wavft wavget wavift wavprint wavthrsh contained
syn region sasIMLFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasIMLFunction
syn match sasIMLFunction '\v<\w+\ze\(' contained contains=sasIMLFunctionName,sasDataStepFunction nextgroup=sasIMLFunctionContext
syn keyword sasIMLControl abort by do else end finish goto if link pause quit resume return run start stop then to until while contained
syn keyword sasIMLStatementKeyword append call close closefile create delete display edit file find force free index infile input list load mattrib print purge read remove replace reset save setin setout show sort store summary use window contained
syn match sasIMLStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasIMLStatementKeyword,sasGlobalStatementKeyword
syn match sasIMLStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
syn region sasIML matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+iml>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasIMLFunction,sasIMLControl,sasIMLStatement
" Macro definition
syn region sasMacro start='\v\%macro>' end='\v\%mend>' fold keepend contains=@sasBasicSyntax,@sasDataStepSyntax,sasDataStep,sasProc,sasODSGraphicsProc,sasGraphProc,sasAnalyticalProc,sasProcTemplate,sasProcSQL,sasDS2,sasIML
" Base SAS Procs - version 8.1 " Define default highlighting
hi def link sasComment Comment
syn keyword sasConditional DO ELSE END IF THEN UNTIL WHILE hi def link sasTodo Delimiter
hi def link sasSectLbl Title
syn keyword sasStatement ABORT ARRAY ATTRIB BY CALL CARDS CARDS4 CATNAME hi def link sasSectLblEnds Comment
syn keyword sasStatement CONTINUE DATALINES DATALINES4 DELETE DISPLAY hi def link sasNumber Number
syn keyword sasStatement DM DROP ENDSAS ERROR FILE FILENAME FOOTNOTE hi def link sasDateTime Constant
syn keyword sasStatement FORMAT GOTO INFILE INFORMAT INPUT KEEP hi def link sasString String
syn keyword sasStatement LABEL LEAVE LENGTH LIBNAME LINK LIST LOSTCARD hi def link sasDataStepControl Keyword
syn keyword sasStatement MERGE MISSING MODIFY OPTIONS OUTPUT PAGE hi def link sasProcTemplateClause Keyword
syn keyword sasStatement PUT REDIRECT REMOVE RENAME REPLACE RETAIN hi def link sasProcSQLClause Keyword
syn keyword sasStatement RETURN SELECT SET SKIP STARTSAS STOP TITLE hi def link sasDS2Control Keyword
syn keyword sasStatement UPDATE WAITSAS WHERE WINDOW X SYSTASK hi def link sasIMLControl Keyword
hi def link sasOperator Operator
" Keywords that are used in Proc SQL hi def link sasGlobalStatementKeyword Statement
" I left them as statements because SAS's enhanced editor highlights hi def link sasGlobalStatementODSKeyword Statement
" them the same as normal statements used in data steps (Jim Kidd) hi def link sasSectionKeyword Statement
hi def link sasDataStepFunctionName Function
syn keyword sasStatement ADD AND ALTER AS CASCADE CHECK CREATE hi def link sasDataStepCallRoutineName Function
syn keyword sasStatement DELETE DESCRIBE DISTINCT DROP FOREIGN hi def link sasDataStepStatementKeyword Statement
syn keyword sasStatement FROM GROUP HAVING INDEX INSERT INTO IN hi def link sasDataStepStatementHashKeyword Statement
syn keyword sasStatement KEY LIKE MESSAGE MODIFY MSGTYPE NOT hi def link sasDataStepHashOperator Operator
syn keyword sasStatement NULL ON OR ORDER PRIMARY REFERENCES hi def link sasDataStepHashMethodName Function
syn keyword sasStatement RESET RESTRICT SELECT SET TABLE hi def link sasDataStepHashAttributeName Identifier
syn keyword sasStatement UNIQUE UPDATE VALIDATE VIEW WHERE hi def link sasProcStatementKeyword Statement
hi def link sasODSGraphicsProcStatementKeyword Statement
" Match declarations have to appear one per line (Paulo Tanimoto) hi def link sasGraphProcStatementKeyword Statement
syn match sasStatement "FOOTNOTE\d" hi def link sasAnalyticalProcStatementKeyword Statement
syn match sasStatement "TITLE\d" hi def link sasProcTemplateStatementKeyword Statement
hi def link sasProcTemplateStatementComplexKeyword Statement
" Match declarations have to appear one per line (Paulo Tanimoto) hi def link sasProcTemplateGTLStatementKeyword Statement
syn match sasMacro "%BQUOTE" hi def link sasProcTemplateGTLComplexKeyword Statement
syn match sasMacro "%NRBQUOTE" hi def link sasProcSQLFunctionName Function
syn match sasMacro "%CMPRES" hi def link sasProcSQLStatementKeyword Statement
syn match sasMacro "%QCMPRES" hi def link sasProcSQLStatementComplexKeyword Statement
syn match sasMacro "%COMPSTOR" hi def link sasProcSQLStatementNextKeyword Statement
syn match sasMacro "%DATATYP" hi def link sasDS2FunctionName Function
syn match sasMacro "%DISPLAY" hi def link sasDS2StatementKeyword Statement
syn match sasMacro "%DO" hi def link sasIMLFunctionName Function
syn match sasMacro "%ELSE" hi def link sasIMLCallRoutineName Function
syn match sasMacro "%END" hi def link sasIMLStatementKeyword Statement
syn match sasMacro "%EVAL" hi def link sasMacroReserved PreProc
syn match sasMacro "%GLOBAL" hi def link sasMacroVariable Define
syn match sasMacro "%GOTO" hi def link sasMacroFunctionName Define
syn match sasMacro "%IF" hi def link sasDataLine SpecialChar
syn match sasMacro "%INDEX" hi def link sasFormat SpecialChar
syn match sasMacro "%INPUT" hi def link sasReserved Special
syn match sasMacro "%KEYDEF"
syn match sasMacro "%LABEL"
syn match sasMacro "%LEFT"
syn match sasMacro "%LENGTH"
syn match sasMacro "%LET"
syn match sasMacro "%LOCAL"
syn match sasMacro "%LOWCASE"
syn match sasMacro "%MACRO"
syn match sasMacro "%MEND"
syn match sasMacro "%NRBQUOTE"
syn match sasMacro "%NRQUOTE"
syn match sasMacro "%NRSTR"
syn match sasMacro "%PUT"
syn match sasMacro "%QCMPRES"
syn match sasMacro "%QLEFT"
syn match sasMacro "%QLOWCASE"
syn match sasMacro "%QSCAN"
syn match sasMacro "%QSUBSTR"
syn match sasMacro "%QSYSFUNC"
syn match sasMacro "%QTRIM"
syn match sasMacro "%QUOTE"
syn match sasMacro "%QUPCASE"
syn match sasMacro "%SCAN"
syn match sasMacro "%STR"
syn match sasMacro "%SUBSTR"
syn match sasMacro "%SUPERQ"
syn match sasMacro "%SYSCALL"
syn match sasMacro "%SYSEVALF"
syn match sasMacro "%SYSEXEC"
syn match sasMacro "%SYSFUNC"
syn match sasMacro "%SYSGET"
syn match sasMacro "%SYSLPUT"
syn match sasMacro "%SYSPROD"
syn match sasMacro "%SYSRC"
syn match sasMacro "%SYSRPUT"
syn match sasMacro "%THEN"
syn match sasMacro "%TO"
syn match sasMacro "%TRIM"
syn match sasMacro "%UNQUOTE"
syn match sasMacro "%UNTIL"
syn match sasMacro "%UPCASE"
syn match sasMacro "%VERIFY"
syn match sasMacro "%WHILE"
syn match sasMacro "%WINDOW"
" SAS Functions
syn keyword sasFunction ABS ADDR AIRY ARCOS ARSIN ATAN ATTRC ATTRN
syn keyword sasFunction BAND BETAINV BLSHIFT BNOT BOR BRSHIFT BXOR
syn keyword sasFunction BYTE CDF CEIL CEXIST CINV CLOSE CNONCT COLLATE
syn keyword sasFunction COMPBL COMPOUND COMPRESS COS COSH CSS CUROBS
syn keyword sasFunction CV DACCDB DACCDBSL DACCSL DACCSYD DACCTAB
syn keyword sasFunction DAIRY DATE DATEJUL DATEPART DATETIME DAY
syn keyword sasFunction DCLOSE DEPDB DEPDBSL DEPDBSL DEPSL DEPSL
syn keyword sasFunction DEPSYD DEPSYD DEPTAB DEPTAB DEQUOTE DHMS
syn keyword sasFunction DIF DIGAMMA DIM DINFO DNUM DOPEN DOPTNAME
syn keyword sasFunction DOPTNUM DREAD DROPNOTE DSNAME ERF ERFC EXIST
syn keyword sasFunction EXP FAPPEND FCLOSE FCOL FDELETE FETCH FETCHOBS
syn keyword sasFunction FEXIST FGET FILEEXIST FILENAME FILEREF FINFO
syn keyword sasFunction FINV FIPNAME FIPNAMEL FIPSTATE FLOOR FNONCT
syn keyword sasFunction FNOTE FOPEN FOPTNAME FOPTNUM FPOINT FPOS
syn keyword sasFunction FPUT FREAD FREWIND FRLEN FSEP FUZZ FWRITE
syn keyword sasFunction GAMINV GAMMA GETOPTION GETVARC GETVARN HBOUND
syn keyword sasFunction HMS HOSTHELP HOUR IBESSEL INDEX INDEXC
syn keyword sasFunction INDEXW INPUT INPUTC INPUTN INT INTCK INTNX
syn keyword sasFunction INTRR IRR JBESSEL JULDATE KURTOSIS LAG LBOUND
syn keyword sasFunction LEFT LENGTH LGAMMA LIBNAME LIBREF LOG LOG10
syn keyword sasFunction LOG2 LOGPDF LOGPMF LOGSDF LOWCASE MAX MDY
syn keyword sasFunction MEAN MIN MINUTE MOD MONTH MOPEN MORT N
syn keyword sasFunction NETPV NMISS NORMAL NOTE NPV OPEN ORDINAL
syn keyword sasFunction PATHNAME PDF PEEK PEEKC PMF POINT POISSON POKE
syn keyword sasFunction PROBBETA PROBBNML PROBCHI PROBF PROBGAM
syn keyword sasFunction PROBHYPR PROBIT PROBNEGB PROBNORM PROBT PUT
syn keyword sasFunction PUTC PUTN QTR QUOTE RANBIN RANCAU RANEXP
syn keyword sasFunction RANGAM RANGE RANK RANNOR RANPOI RANTBL RANTRI
syn keyword sasFunction RANUNI REPEAT RESOLVE REVERSE REWIND RIGHT
syn keyword sasFunction ROUND SAVING SCAN SDF SECOND SIGN SIN SINH
syn keyword sasFunction SKEWNESS SOUNDEX SPEDIS SQRT STD STDERR STFIPS
syn keyword sasFunction STNAME STNAMEL SUBSTR SUM SYMGET SYSGET SYSMSG
syn keyword sasFunction SYSPROD SYSRC SYSTEM TAN TANH TIME TIMEPART
syn keyword sasFunction TINV TNONCT TODAY TRANSLATE TRANWRD TRIGAMMA
syn keyword sasFunction TRIM TRIMN TRUNC UNIFORM UPCASE USS VAR
syn keyword sasFunction VARFMT VARINFMT VARLABEL VARLEN VARNAME
syn keyword sasFunction VARNUM VARRAY VARRAYX VARTYPE VERIFY VFORMAT
syn keyword sasFunction VFORMATD VFORMATDX VFORMATN VFORMATNX VFORMATW
syn keyword sasFunction VFORMATWX VFORMATX VINARRAY VINARRAYX VINFORMAT
syn keyword sasFunction VINFORMATD VINFORMATDX VINFORMATN VINFORMATNX
syn keyword sasFunction VINFORMATW VINFORMATWX VINFORMATX VLABEL
syn keyword sasFunction VLABELX VLENGTH VLENGTHX VNAME VNAMEX VTYPE
syn keyword sasFunction VTYPEX WEEKDAY YEAR YYQ ZIPFIPS ZIPNAME ZIPNAMEL
syn keyword sasFunction ZIPSTATE
" Handy settings for using vim with log files
syn keyword sasLogMsg NOTE
syn keyword sasWarnMsg WARNING
syn keyword sasErrMsg ERROR
" Always contained in a comment (Bob Heckel)
syn keyword sasTodo TODO TBD FIXME contained
" These don't fit anywhere else (Bob Heckel).
" Added others that were missing.
syn keyword sasUnderscore _ALL_ _AUTOMATIC_ _CHARACTER_ _INFILE_ _N_ _NAME_ _NULL_ _NUMERIC_ _USER_ _WEBOUT_
" End of SAS Functions
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
" Default sas enhanced editor color syntax
hi sComment term=bold cterm=NONE ctermfg=Green ctermbg=Black gui=NONE guifg=DarkGreen guibg=White
hi sCard term=bold cterm=NONE ctermfg=Black ctermbg=Yellow gui=NONE guifg=Black guibg=LightYellow
hi sDate_Time term=NONE cterm=bold ctermfg=Green ctermbg=Black gui=bold guifg=SeaGreen guibg=White
hi sKeyword term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=NONE guifg=Blue guibg=White
hi sFmtInfmt term=NONE cterm=NONE ctermfg=LightGreen ctermbg=Black gui=NONE guifg=SeaGreen guibg=White
hi sString term=NONE cterm=NONE ctermfg=Magenta ctermbg=Black gui=NONE guifg=Purple guibg=White
hi sText term=NONE cterm=NONE ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
hi sNumber term=NONE cterm=bold ctermfg=Green ctermbg=Black gui=bold guifg=SeaGreen guibg=White
hi sProc term=NONE cterm=bold ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
hi sSection term=NONE cterm=bold ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
hi mDefine term=NONE cterm=bold ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
hi mKeyword term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=NONE guifg=Blue guibg=White
hi mReference term=NONE cterm=bold ctermfg=White ctermbg=Black gui=bold guifg=Blue guibg=White
hi mSection term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
hi mText term=NONE cterm=NONE ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
" Colors that closely match SAS log colors for default color scheme
hi lError term=NONE cterm=NONE ctermfg=Red ctermbg=Black gui=none guifg=Red guibg=White
hi lWarning term=NONE cterm=NONE ctermfg=Green ctermbg=Black gui=none guifg=Green guibg=White
hi lNote term=NONE cterm=NONE ctermfg=Cyan ctermbg=Black gui=none guifg=Blue guibg=White
" Special hilighting for the SAS proc section
hi def link sasComment sComment
hi def link sasConditional sKeyword
hi def link sasStep sSection
hi def link sasFunction sKeyword
hi def link sasMacro mKeyword
hi def link sasMacroVar NonText
hi def link sasNumber sNumber
hi def link sasStatement sKeyword
hi def link sasString sString
hi def link sasProc sProc
" (Bob Heckel)
hi def link sasTodo Todo
hi def link sasErrMsg lError
hi def link sasWarnMsg lWarning
hi def link sasLogMsg lNote
hi def link sasCards sCard
" (Bob Heckel)
hi def link sasUnderscore PreProc
" Syncronize from beginning to keep large blocks from losing " Syncronize from beginning to keep large blocks from losing
" syntax coloring while moving through code. " syntax coloring while moving through code.
@ -264,4 +261,5 @@ syn sync fromstart
let b:current_syntax = "sas" let b:current_syntax = "sas"
" vim: ts=8 let &cpo = s:cpo_save
unlet s:cpo_save

32
runtime/syntax/sbt.vim Normal file
View File

@ -0,0 +1,32 @@
" Vim syntax file
" Language: sbt
" Maintainer: Steven Dobay <stevendobay at protonmail.com>
" Last Change: 2017.04.30
if exists("b:current_syntax")
finish
endif
runtime! syntax/scala.vim
syn region sbtString start="\"[^"]" skip="\\\"" end="\"" contains=sbtStringEscape
syn match sbtStringEscape "\\u[0-9a-fA-F]\{4}" contained
syn match sbtStringEscape "\\[nrfvb\\\"]" contained
syn match sbtIdentitifer "^\S\+\ze\s*\(:=\|++=\|+=\|<<=\|<+=\)"
syn match sbtBeginningSeq "^[Ss]eq\>"
syn match sbtSpecial "\(:=\|++=\|+=\|<<=\|<+=\)"
syn match sbtLineComment "//.*"
syn region sbtComment start="/\*" end="\*/"
syn region sbtDocComment start="/\*\*" end="\*/" keepend
hi link sbtString String
hi link sbtIdentitifer Keyword
hi link sbtBeginningSeq Keyword
hi link sbtSpecial Special
hi link sbtComment Comment
hi link sbtLineComment Comment
hi link sbtDocComment Comment

View File

@ -71,6 +71,8 @@ hi link scalaUnicodeChar Special
syn match scalaOperator "||" syn match scalaOperator "||"
syn match scalaOperator "&&" syn match scalaOperator "&&"
syn match scalaOperator "|"
syn match scalaOperator "&"
hi link scalaOperator Special hi link scalaOperator Special
syn match scalaNameDefinition /\<[_A-Za-z0-9$]\+\>/ contained nextgroup=scalaPostNameDefinition,scalaVariableDeclarationList syn match scalaNameDefinition /\<[_A-Za-z0-9$]\+\>/ contained nextgroup=scalaPostNameDefinition,scalaVariableDeclarationList
@ -142,7 +144,7 @@ hi link scalaString String
hi link scalaStringEmbeddedQuote String 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 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 scalaIString String
hi link scalaTripleIString String hi link scalaTripleIString String

View File

@ -4,18 +4,16 @@
" Maintainer: Eric Pruitt <eric.pruitt@gmail.com> " Maintainer: Eric Pruitt <eric.pruitt@gmail.com>
" License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause) " License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause)
if version < 600 if exists("b:current_syntax")
syntax clear
elseif exists("b:current_syntax")
finish finish
else
let b:current_syntax = "tmux"
endif endif
" this file uses line continuations " Explicitly change compatiblity options to Vim's defaults because this file
let s:cpo_sav = &cpo " uses line continuations.
let s:original_cpo = &cpo
set cpo&vim set cpo&vim
let b:current_syntax = "tmux"
setlocal iskeyword+=- setlocal iskeyword+=-
syntax case match syntax case match
@ -62,7 +60,6 @@ for s:i in range(0, 255)
exec "syn match tmuxColour" . s:i . " /\\<colour" . s:i . "\\>/ display" exec "syn match tmuxColour" . s:i . " /\\<colour" . s:i . "\\>/ display"
\ " | highlight tmuxColour" . s:i . " ctermfg=" . s:i . " ctermbg=" . s:bg \ " | highlight tmuxColour" . s:i . " ctermfg=" . s:i . " ctermbg=" . s:bg
endfor endfor
unlet s:bg s:i
syn keyword tmuxOptions syn keyword tmuxOptions
\ buffer-limit command-alias default-terminal escape-time exit-unattached \ buffer-limit command-alias default-terminal escape-time exit-unattached
@ -123,5 +120,5 @@ syn keyword tmuxCommands
\ swapp swap-window swapw switch-client switchc unbind-key unbind wait-for \ swapp swap-window swapw switch-client switchc unbind-key unbind wait-for
\ wait \ wait
let &cpo = s:cpo_sav let &cpo = s:original_cpo
unlet! s:cpo_sav unlet! s:original_cpo s:bg s:i

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More