diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-10-16 15:23:36 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-10-16 15:23:36 +0100 |
commit | 2286304cdbba53ceb52b3ba2ba4a521b0a2f8d0f (patch) | |
tree | 05a0b3be618b14dc1dd6e9ee6d6389c4923dfa50 | |
parent | 28b6a3bef6d25d36c049bb731ced496155f7f9c0 (diff) |
Update runtime files
-rw-r--r-- | .github/CODEOWNERS | 6 | ||||
-rw-r--r-- | runtime/doc/autocmd.txt | 10 | ||||
-rw-r--r-- | runtime/doc/change.txt | 6 | ||||
-rw-r--r-- | runtime/doc/cmdline.txt | 2 | ||||
-rw-r--r-- | runtime/doc/digraph.txt | 4 | ||||
-rw-r--r-- | runtime/doc/editing.txt | 23 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 4 | ||||
-rw-r--r-- | runtime/doc/help.txt | 1 | ||||
-rw-r--r-- | runtime/doc/options.txt | 6 | ||||
-rw-r--r-- | runtime/doc/pattern.txt | 17 | ||||
-rw-r--r-- | runtime/doc/testing.txt | 8 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 48 | ||||
-rw-r--r-- | runtime/doc/various.txt | 2 | ||||
-rw-r--r-- | runtime/doc/vim9.txt | 20 | ||||
-rw-r--r-- | runtime/ftplugin/context.vim | 67 | ||||
-rw-r--r-- | runtime/ftplugin/csh.vim | 49 | ||||
-rw-r--r-- | runtime/ftplugin/tcsh.vim | 21 | ||||
-rw-r--r-- | runtime/ftplugin/tmux.vim | 3 | ||||
-rw-r--r-- | runtime/ftplugin/toml.vim | 23 | ||||
-rw-r--r-- | runtime/indent/hamster.vim | 21 | ||||
-rw-r--r-- | runtime/indent/sqlanywhere.vim | 22 | ||||
-rw-r--r-- | runtime/indent/tcsh.vim | 13 | ||||
-rw-r--r-- | runtime/syntax/css.vim | 27 | ||||
-rw-r--r-- | runtime/syntax/tcsh.vim | 66 | ||||
-rw-r--r-- | runtime/syntax/tmux.vim | 103 | ||||
-rw-r--r-- | runtime/syntax/toml.vim | 81 |
26 files changed, 413 insertions, 240 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 139a1b6611..0bfb1a9937 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -73,6 +73,7 @@ runtime/ftplugin/awk.vim @dkearns runtime/ftplugin/basic.vim @dkearns runtime/ftplugin/bst.vim @tpope runtime/ftplugin/cfg.vim @chrisbra +runtime/ftplugin/csh.vim @dkearns runtime/ftplugin/css.vim @dkearns runtime/ftplugin/cucumber.vim @tpope runtime/ftplugin/eiffel.vim @dkearns @@ -111,8 +112,10 @@ runtime/ftplugin/sass.vim @tpope runtime/ftplugin/scss.vim @tpope runtime/ftplugin/spec.vim @ignatenkobrain runtime/ftplugin/systemverilog.vim @Kocha +runtime/ftplugin/tcsh.vim @dkearns runtime/ftplugin/tidy.vim @dkearns runtime/ftplugin/tmux.vim @ericpruitt +runtime/ftplugin/toml.vim @averms runtime/ftplugin/typescript.vim @dkearns runtime/ftplugin/typescriptreact.vim @dkearns runtime/ftplugin/xml.vim @chrisbra @@ -151,6 +154,7 @@ runtime/indent/scss.vim @tpope runtime/indent/sh.vim @chrisbra runtime/indent/systemverilog.vim @Kocha runtime/indent/tcl.vim @dkearns +runtime/indent/tcsh.vim @dkearns runtime/indent/teraterm.vim @k-takata runtime/indent/xml.vim @chrisbra runtime/indent/zsh.vim @chrisbra @@ -238,10 +242,12 @@ runtime/syntax/sshdconfig.vim @Jakuje runtime/syntax/sudoers.vim @e-kwsm runtime/syntax/systemverilog.vim @Kocha runtime/syntax/tags.vim @cecamp +runtime/syntax/tcsh.vim @dkearns runtime/syntax/teraterm.vim @k-takata runtime/syntax/tex.vim @cecamp runtime/syntax/tidy.vim @dkearns runtime/syntax/tmux.vim @ericpruitt +runtime/syntax/toml.vim @averms runtime/syntax/vim.vim @cecamp runtime/syntax/wget.vim @dkearns runtime/syntax/xbl.vim @dkearns diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 6f7f6c648b..bcc81ecdad 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -708,7 +708,7 @@ EncodingChanged Fires off after the 'encoding' option has been *FileAppendCmd* FileAppendCmd Before appending to a file. Should do the appending to the file. Use the '[ and '] - marks for the range of lines.|Cmd-event| + marks for the range of lines. |Cmd-event| *FileAppendPost* FileAppendPost After appending to a file. *FileAppendPre* @@ -836,7 +836,7 @@ FilterReadPre Before reading a file from a filter command. *FilterWritePost* FilterWritePost After writing a file for a filter command or making a diff with an external diff (see - DiffUpdated for internal diff). + |DiffUpdated| for internal diff). Vim checks the pattern against the name of the current buffer as with FilterWritePre. Not triggered when 'shelltemp' is off. @@ -1195,9 +1195,9 @@ TextYankPost After text has been yanked or deleted in the register, as a list of lines, like with: > getreg(r, 1, 1) -< regname Name of the |register| or - empty string for the unnamed - register. +< regname Name of the register or empty + string for the unnamed + register, see |registers|. regtype Type of the register, see |getregtype()|. visual True if the operation is diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 1a9ba7ac55..31843eea5c 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1184,9 +1184,6 @@ a register, a paste on a visual selected area will paste that single line on each of the selected lines (thus replacing the blockwise selected region by a block of the pasted line). -Use |zP|/|zp| to paste a blockwise yanked register without appending trailing -spaces. - *blockwise-register* If you use a blockwise Visual mode command to get the text into the register, the block of text will be inserted before ("P") or after ("p") the cursor @@ -1197,6 +1194,9 @@ this happen. However, if the width of the block is not a multiple of a <Tab> width and the text after the inserted block contains <Tab>s, that text may be misaligned. +Use |zP|/|zp| to paste a blockwise yanked register without appending trailing +spaces. + Note that after a characterwise yank command, Vim leaves the cursor on the first yanked character that is closest to the start of the buffer. This means that "yl" doesn't move the cursor, but "yh" moves the cursor one character diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 0c472bb61a..bf61024875 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -803,7 +803,7 @@ three lines: > 3:d<CR> is translated into: .,.+2d<CR> < -Visual Mode and Range +Visual Mode and Range *v_:* {Visual}: Starts a command-line with the Visual selected lines as a range. The code `:'<,'>` is used for this range, which makes diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt index 0801e3af15..3610380bee 100644 --- a/runtime/doc/digraph.txt +++ b/runtime/doc/digraph.txt @@ -351,8 +351,8 @@ $ DO 0x24 36 DOLLAR SIGN þ th 0xfe 254 LATIN SMALL LETTER THORN (Icelandic) ÿ y: 0xff 255 LATIN SMALL LETTER Y WITH DIAERESIS -If your Vim is compiled with |multibyte| support and you are using a multibyte -'encoding', Vim provides this enhanced set of additional digraphs: +If you are using a |multibyte| 'encoding', Vim provides this enhanced set of +additional digraphs: *digraph-table-mbyte* char digraph hex dec official name ~ diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 858fc427f9..cea0e443d8 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1,4 +1,4 @@ -*editing.txt* For Vim version 8.2. Last change: 2021 Oct 04 +*editing.txt* For Vim version 8.2. Last change: 2021 Oct 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1329,26 +1329,26 @@ present in 'cpoptions' and "!" is not used in the command. other tabs and for windows in the current tab that have their own window-local directory. - *:tch* *:tchdir* -:tch[dir][!] Same as |:tcd|. - *:tcd-* :tc[d][!] - Change to the previous current directory, before the last ":tcd {path}" command. + *:tch* *:tchdir* +:tch[dir][!] Same as |:tcd|. + *:lc* *:lcd* :lc[d][!] {path} Like |:cd|, but only set the current directory when the cursor is in the current window. The current directory for other windows is not changed, switching to another window will stop using {path}. - *:lch* *:lchdir* -:lch[dir][!] Same as |:lcd|. - *:lcd-* :lcd[!] - Change to the previous current directory, before the last ":lcd {path}" command. + *:lch* *:lchdir* +:lch[dir][!] Same as |:lcd|. + *:pw* *:pwd* *E187* :pw[d] Print the current directory name. Also see |getcwd()|. @@ -1375,14 +1375,14 @@ change anything for the current directory. When a |:lcd| command has been used for a window, the specified directory becomes the current directory for that window. Windows where the |:lcd| command has not been used stick to the global or tab-local current directory. -When jumping to another window the current directory will become the last +When jumping to another window the current directory is changed to the last specified local current directory. If none was specified, the global or tab-local current directory is used. When a |:tcd| command has been used for a tab page, the specified directory becomes the current directory for the current tab page and the current window. The current directory of other tab pages is not affected. When jumping to -another tab page, the current directory will become the last specified local +another tab page, the current directory is changed to the last specified local directory for that tab page. If the current tab has no local current directory the global current directory is used. @@ -1676,6 +1676,11 @@ It is also possible that you modified the file yourself, from another edit session or with another command (e.g., a filter command). Then you will know which version of the file you want to keep. +The accuracy of the time check depends on the filesystem. On Unix it is +usually sub-second. With old file sytems and on MS-Windows it is normally one +second. Use has('nanotime') check if sub-second time stamp checks are +available. + There is one situation where you get the message while there is nothing wrong: On a Win32 system on the day daylight saving time starts. There is something in the Win32 libraries that confuses Vim about the hour time difference. The diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 5a7e6ec31b..c3e894f26d 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 8.2. Last change: 2021 Oct 04 +*eval.txt* For Vim version 8.2. Last change: 2021 Oct 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2549,7 +2549,7 @@ deletebufline({buf}, {first} [, {last}]) did_filetype() Number |TRUE| if FileType autocmd event used diff_filler({lnum}) Number diff filler lines about {lnum} diff_hlID({lnum}, {col}) Number diff highlighting at {lnum}/{col} -digraph_get({chars}) String get the digraph of {chars} +digraph_get({chars}) String get the |digraph| of {chars} digraph_getlist([{listall}]) List get all |digraph|s digraph_set({chars}, {digraph}) Boolean register |digraph| digraph_setlist({digraphlist}) Boolean register multiple |digraph|s diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index f5c3e6d986..f339dadf00 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -88,6 +88,7 @@ Tuning Vim ~ |usr_43.txt| Using filetypes |usr_44.txt| Your own syntax highlighted |usr_45.txt| Select your language +|usr_46.txt| Write plugins using Vim9 script Making Vim Run ~ |usr_90.txt| Installing Vim diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 91df5df2e7..41d710529e 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2410,7 +2410,7 @@ A jump table for the options with a short description can be found at |Q_op|. xchacha20 XChaCha20 Cipher with Poly1305 Message Authentication Code. Medium strong till strong encryption. Encryption is provided by the libsodium library, it - requires Vim to be built with |+sodium| + requires Vim to be built with |+sodium|. It adds a seed and a message authentication code (MAC) to the file. This needs at least a Vim 8.2.3022 to read the encrypted file. @@ -7406,13 +7406,13 @@ A jump table for the options with a short description can be found at |Q_op|. return value of expr contains % items they will get expanded. The expression can contain the } character, the end of expression is denoted by %}. - The For example: > + For example: > func! Stl_filename() abort return "%t" endfunc < `stl=%{Stl_filename()}` results in `"%t"` `stl=%{%Stl_filename()%}` results in `"Name of current file"` - } - End of `{%` expression + %} - End of `{%` expression ( - Start of item group. Can be used for setting the width and alignment of a section. Must be followed by %) somewhere. ) - End of item group. No width fields allowed. diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index c52708e455..8f6d77e414 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -932,7 +932,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): \%.l Matches at the cursor line. \%<.l Matches above the cursor line. \%>.l Matches below the cursor line. - These three can be used to match specific lines in a buffer. The "23" + These six can be used to match specific lines in a buffer. The "23" can be any line number. The first line is 1. WARNING: When inserting or deleting lines Vim does not automatically update the matches. This means Syntax highlighting quickly becomes @@ -953,16 +953,15 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): \%.c Matches at the cursor column. \%<.c Matches before the cursor column. \%>.c Matches after the cursor column. - These three can be used to match specific columns in a buffer or - string. The "23" can be any column number. The first column is 1. - Actually, the column is the byte number (thus it's not exactly right - for multibyte characters). + These six can be used to match specific columns in a buffer or string. + The "23" can be any column number. The first column is 1. Actually, + the column is the byte number (thus it's not exactly right for + multibyte characters). WARNING: When inserting or deleting text Vim does not automatically update the matches. This means Syntax highlighting quickly becomes wrong. Also when referring to the cursor position (".") and the cursor moves the display isn't updated for this change. An update is done when using the |CTRL-L| command (the whole screen is updated). - Example, to highlight the column where the cursor currently is: > :exe '/\%' . col(".") . 'c' < Alternatively use: > @@ -980,8 +979,8 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): \%.v Matches at the current virtual column. \%<.v Matches before the current virtual column. \%>.v Matches after the current virtual column. - These three can be used to match specific virtual columns in a buffer - or string. When not matching with a buffer in a window, the option + These six can be used to match specific virtual columns in a buffer or + string. When not matching with a buffer in a window, the option values of the current window are used (e.g., 'tabstop'). The "23" can be any column number. The first column is 1. Note that some virtual column positions will never match, because they @@ -1012,7 +1011,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): /.*\%17v < Column 17 is highlighted by 'hlsearch' because there is another match where ".*" matches zero characters. -< + Character classes: \i identifier character (see 'isident' option) */\i* diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt index 5094d51fdc..d064dc1bf0 100644 --- a/runtime/doc/testing.txt +++ b/runtime/doc/testing.txt @@ -85,14 +85,14 @@ test_getvalue({name}) *test_getvalue()* test_gui_drop_files({list}, {row}, {col}, {mods}) Drop one or more files in {list} in the window at {row}, {col}. This function only works when the GUI is running and the - |drag-n-drop| feature is present. - + |drop_file| feature is present. + The supported values for {mods} are: 0x4 Shift 0x8 Alt 0x10 Ctrl - The files are added to the argument list and the first file in - {list} is edited in the window. See |drag-n-drop| for more + The files are added to the |argument-list| and the first file + in {list} is edited in the window. See |drag-n-drop| for more information. *test_gui_mouse_event()* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 5959de360d..558493b53e 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 8.2. Last change: 2021 Sep 22 +*todo.txt* For Vim version 8.2. Last change: 2021 Oct 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -38,12 +38,13 @@ browser use: https://github.com/vim/vim/issues/1234 *known-bugs* -------------------- Known bugs and current work ----------------------- -Flaky test op Windows: -From test_vim9_script.vim: - Found errors in Test_no_unknown_error_after_error(): - command line..script D:/a/vim/vim/src2/testdir/runtest.vim[486]..function RunTheTest[44]..Test_no_unknown_error_after_error line 22: Expected 'E1012:' but got 'E684: list index out of range: 0': so Xdef +Remove s:flaky_tests from runtest.vim, set g:test_is_flaky in each test. Vim9 - Make everything work: +- "filter #pat# ls" should work, #pat# is not a comment + vim9script + edit foobar + filter #foobar# ls - Check TODO items in vim9compile.c and vim9execute.c - use CheckLegacyAndVim9Success(lines) in many more places - For builtin functions using tv_get_string*() use check_for_string() to be @@ -629,24 +630,27 @@ Window size changes after closing a tab. (#4741) Problem with colors in terminal window. (Jason Franklin, 2019 May 12) -Lifepillar: Updated/cleaned up color schemes: -https://github.com/lifepillar/vim8-colorschemes. - -Include a few color schemes, based on popularity: -http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search +Color schemes: +NOTE: modernizing the default colorschemes _AND_ introducing new ones is now +a project in its own right: https://github.com/vim/colorschemes. Feel free to +reach out if you want to lend a hand. +- Lifepillar: Updated/cleaned up color schemes: + https://github.com/lifepillar/vim8-colorschemes. +- Include a few color schemes, based on popularity: + - http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search http://vimawesome.com/?q=tag:color-scheme -Use names that indicate their appearance (Christian Brabandt, 2017 Aug 3) -- monokai - Xia Crusoe (2017 Aug 4) -- seoul256 - Christian Brabandt (2017 Aug 3) -- gruvbox - Christian Brabandt (2017 Aug 3) (simplified version from - Lifepillar, 2018 Jan 22, #2573) -- janah - Marco Hinz (2017 Aug 4) -- apprentice - Romain Lafourcade (2017 Aug 6) remarks about help file #1964 -Suggested by Hiroki Kokubun: -- [Iceberg](https://github.com/cocopon/iceberg.vim) (my one) -- [hybrid](https://github.com/w0ng/vim-hybrid) -Include solarized color scheme?, it does not support termguicolors. -- Sanitized version of pablo (Lifepillar, 2017 Nov 21) +- Use names that indicate their appearance (Christian Brabandt, 2017 Aug 3) + - monokai - Xia Crusoe (2017 Aug 4) + - seoul256 - Christian Brabandt (2017 Aug 3) + - gruvbox - Christian Brabandt (2017 Aug 3) (simplified version from + Lifepillar, 2018 Jan 22, #2573) + - janah - Marco Hinz (2017 Aug 4) + - apprentice - Romain Lafourcade (2017 Aug 6) remarks about help file #1964 +- Suggested by Hiroki Kokubun: + - [Iceberg](https://github.com/cocopon/iceberg.vim) (my one) + - [hybrid](https://github.com/w0ng/vim-hybrid) +- Include solarized color scheme?, it does not support termguicolors. + - Sanitized version of pablo (Lifepillar, 2017 Nov 21) Bug: "vipgw" does not put cursor back where it belongs. (Jason Franklin, 2019 Mar 5) diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 7adff41d75..e9c6b7b55e 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -172,7 +172,7 @@ g8 Print the hex values of the bytes used in the *:z!* :[range]z![+-^.=][count] - Like ":z:", but when [count] is not specified, it + Like ":z", but when [count] is not specified, it defaults to the Vim window height minus one. :[range]z[!]#[+-^.=][count] *:z#* diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index b661097805..576456af0e 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -103,7 +103,7 @@ script and `:def` functions; details are below: writefile(['done'], 'file.txt') - You cannot use `:xit`, `:t`, `:k`, `:append`, `:change`, `:insert`, `:open`, and `:s` or `:d` with only flags. - or curly-braces names. +- You cannot use curly-braces names. - A range before a command must be prefixed with a colon: > :%s/this/that - Executing a register with "@r" does not work, you can prepend a colon or use @@ -206,7 +206,7 @@ When a function argument is optional (it has a default value) passing `v:none` as the argument results in using the default value. This is useful when you want to specify a value for an argument that comes after an argument that should use its default value. Example: > - def MyFunc(one = 'one', last = 'last) + def MyFunc(one = 'one', last = 'last') ... enddef MyFunc(v:none, 'LAST') # first argument uses default value 'one' @@ -631,7 +631,7 @@ at the start of the line indicates line continuation: > | echo 'match' | endif -Note that this means that in heredoc the first line cannot be a bar: > +Note that this means that in heredoc the first line cannot start with a bar: > var lines =<< trim END | this doesn't work END @@ -639,7 +639,7 @@ Either use an empty line at the start or do not use heredoc. Or temporarily add the "C" flag to 'cpoptions': > set cpo+=C var lines =<< trim END - | this doesn't work + | this works END set cpo-=C If the heredoc is inside a function 'cpoptions' must be set before :def and @@ -1118,7 +1118,7 @@ The map argument is a string expression, which is evaluated without the function scope. Instead, use a lambda: > def MapList(): list<string> var list = ['aa', 'bb', 'cc', 'dd'] - return range(1, 2)->map(( _, v) => list[v]) + return range(1, 2)->map((_, v) => list[v]) enddef The same is true for commands that are not compiled, such as `:global`. @@ -1322,16 +1322,16 @@ an error, thus breaking backwards compatibility. For example: - Using a string value when setting a number option. - Using a number where a string is expected. *E1024* -One consequence is that the item type of a list or dict given to map() must +One consequence is that the item type of a list or dict given to |map()| must not change. This will give an error in Vim9 script: > - vim9 echo map([1, 2, 3], (i, v) => 'item ' .. i) + echo map([1, 2, 3], (i, v) => 'item ' .. i) E1012: Type mismatch; expected number but got string -Instead use |mapnew(): > - vim9 echo mapnew([1, 2, 3], (i, v) => 'item ' .. i) +Instead use |mapnew()|: > + echo mapnew([1, 2, 3], (i, v) => 'item ' .. i) ['item 0', 'item 1', 'item 2'] If the item type was determined to be "any" it can change to a more specific -type. E.g. when a list of mixed types gets changed to a list of numbers: > +type. E.g. when a list of mixed types gets changed to a list of strings: > var mylist = [1, 2.0, '3'] # typename(mylist) == "list<any>" map(mylist, (i, v) => 'item ' .. i) diff --git a/runtime/ftplugin/context.vim b/runtime/ftplugin/context.vim index 10f1ae1648..37f7240d7b 100644 --- a/runtime/ftplugin/context.vim +++ b/runtime/ftplugin/context.vim @@ -2,7 +2,7 @@ " Language: ConTeXt typesetting engine " Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com> " Former Maintainers: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2016 Oct 30 +" Latest Revision: 2021 Oct 15 if exists("b:did_ftplugin") finish @@ -17,7 +17,6 @@ if !exists('current_compiler') endif let b:undo_ftplugin = "setl com< cms< def< inc< sua< fo< ofu<" - \ . "| unlet! b:match_ignorecase b:match_words b:match_skip" setlocal comments=b:%D,b:%C,b:%M,:% commentstring=%\ %s formatoptions+=tjcroql2 if get(b:, 'context_metapost', get(g:, 'context_metapost', 1)) @@ -35,11 +34,12 @@ let &l:include = '^\s*\\\%(input\|component\|product\|project\|environment\)' setlocal suffixesadd=.tex -if exists("loaded_matchit") +if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 0 let b:match_skip = 'r:\\\@<!\%(\\\\\)*%' let b:match_words = '(:),\[:],{:},\\(:\\),\\\[:\\],' . \ '\\start\(\a\+\):\\stop\1' + let b:undo_ftplugin .= " | unlet! b:match_ignorecase b:match_words b:match_skip" endif let s:context_regex = { @@ -57,19 +57,28 @@ function! s:move_around(count, what, flags, visual) call map(range(2, a:count), 'search(s:context_regex[a:what], a:flags)') endfunction -" Move around macros. -nnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:false) <CR> -vnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:true) <CR> -nnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:false) <CR> -vnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:true) <CR> -nnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:false) <CR> -vnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:true) <CR> -nnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:false) <CR> -vnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:true) <CR> -nnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:false) <CR> -vnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:true) <CR> -nnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:false) <CR> -vnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:true) <CR> +if !exists("no_plugin_maps") && !exists("no_context_maps") + " Move around macros. + nnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:false) <CR> + vnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:true) <CR> + nnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:false) <CR> + vnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:true) <CR> + nnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:false) <CR> + vnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:true) <CR> + nnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:false) <CR> + vnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:true) <CR> + nnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:false) <CR> + vnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:true) <CR> + nnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:false) <CR> + vnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:true) <CR> + + let b:undo_ftplugin .= " | sil! exe 'nunmap <buffer> [[' | sil! exe 'vunmap <buffer> [['" . + \ " | sil! exe 'nunmap <buffer> ]]' | sil! exe 'vunmap <buffer> ]]'" . + \ " | sil! exe 'nunmap <buffer> []' | sil! exe 'vunmap <buffer> []'" . + \ " | sil! exe 'nunmap <buffer> ][' | sil! exe 'vunmap <buffer> ]['" . + \ " | sil! exe 'nunmap <buffer> [{' | sil! exe 'vunmap <buffer> [{'" . + \ " | sil! exe 'nunmap <buffer> ]}' | sil! exe 'vunmap <buffer> ]}'" +end " Other useful mappings if get(g:, 'context_mappings', 1) @@ -81,16 +90,22 @@ if get(g:, 'context_mappings', 1) call cursor(search(s:tp_regex, 'W') - 1, 1) endf - " Reflow paragraphs with commands like gqtp ("gq TeX paragraph") - onoremap <silent><buffer> tp :<c-u>call <sid>tp()<cr> - " Select TeX paragraph - vnoremap <silent><buffer> tp <esc>:<c-u>call <sid>tp()<cr> - - " $...$ text object - onoremap <silent><buffer> i$ :<c-u>normal! T$vt$<cr> - onoremap <silent><buffer> a$ :<c-u>normal! F$vf$<cr> - vnoremap <buffer> i$ T$ot$ - vnoremap <buffer> a$ F$of$ + if !exists("no_plugin_maps") && !exists("no_context_maps") + " Reflow paragraphs with commands like gqtp ("gq TeX paragraph") + onoremap <silent><buffer> tp :<c-u>call <sid>tp()<cr> + " Select TeX paragraph + vnoremap <silent><buffer> tp <esc>:<c-u>call <sid>tp()<cr> + + " $...$ text object + onoremap <silent><buffer> i$ :<c-u>normal! T$vt$<cr> + onoremap <silent><buffer> a$ :<c-u>normal! F$vf$<cr> + vnoremap <buffer> i$ T$ot$ + vnoremap <buffer> a$ F$of$ + + let b:undo_ftplugin .= " | sil! exe 'ounmap <buffer> tp' | sil! exe 'vunmap <buffer> tp'" . + \ " | sil! exe 'ounmap <buffer> i$' | sil! exe 'vunmap <buffer> i$'" . + \ " | sil! exe 'ounmap <buffer> a$' | sil! exe 'vunmap <buffer> a$'" + endif endif " Commands for asynchronous typesetting diff --git a/runtime/ftplugin/csh.vim b/runtime/ftplugin/csh.vim index 4ae09f91be..929823219c 100644 --- a/runtime/ftplugin/csh.vim +++ b/runtime/ftplugin/csh.vim @@ -1,21 +1,23 @@ " Vim filetype plugin file -" Language: csh -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> -" Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin +" Language: csh +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" Contributor: Johannes Zellner <johannes@zellner.org> +" Last Change: 2021 Oct 15 if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 -" Make sure the continuation lines below do not cause problems in -" compatibility mode. let s:save_cpo = &cpo set cpo-=C +setlocal comments=:# setlocal commentstring=#%s setlocal formatoptions-=t setlocal formatoptions+=crql +let b:undo_ftplugin = "setlocal com< cms< fo<" + " Csh: thanks to Johannes Zellner " - Both foreach and end must appear alone on separate lines. " - The words else and endif must appear at the beginning of input lines; @@ -23,26 +25,27 @@ setlocal formatoptions+=crql " - Each case label and the default label must appear at the start of a " line. " - while and end must appear alone on their input lines. -if exists("loaded_matchit") - let b:match_words = - \ '^\s*\<if\>.*(.*).*\<then\>:'. - \ '^\s*\<else\>\s\+\<if\>.*(.*).*\<then\>:^\s*\<else\>:'. - \ '^\s*\<endif\>,'. - \ '\%(^\s*\<foreach\>\s\+\S\+\|^s*\<while\>\).*(.*):'. - \ '\<break\>:\<continue\>:^\s*\<end\>,'. - \ '^\s*\<switch\>.*(.*):^\s*\<case\>\s\+:^\s*\<default\>:^\s*\<endsw\>' +if exists("loaded_matchit") && !exists("b:match_words") + let s:line_start = '\%(^\s*\)\@<=' + let b:match_words = + \ s:line_start .. 'if\s*(.*)\s*then\>:' .. + \ s:line_start .. 'else\s\+if\s*(.*)\s*then\>:' .. s:line_start .. 'else\>:' .. + \ s:line_start .. 'endif\>,' .. + \ s:line_start .. '\%(\<foreach\s\+\h\w*\|while\)\s*(:' .. + \ '\<break\>:\<continue\>:' .. + \ s:line_start .. 'end\>,' .. + \ s: |