diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-03-04 22:22:32 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-03-04 22:22:32 +0100 |
commit | 328da0dcb7be34b594725eef6dc98d3ea6516d69 (patch) | |
tree | 25c1736e833fccd324ea566f527fe42e798fc9a9 /runtime | |
parent | 6300317b15eb33409f652c603fb402417fe4eed7 (diff) | |
download | vim-git-328da0dcb7be34b594725eef6dc98d3ea6516d69.tar.gz |
Update runtime files.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/channel.txt | 49 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 13 | ||||
-rw-r--r-- | runtime/doc/index.txt | 4 | ||||
-rw-r--r-- | runtime/doc/repeat.txt | 34 | ||||
-rw-r--r-- | runtime/doc/starting.txt | 4 | ||||
-rw-r--r-- | runtime/doc/tags | 8 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 46 | ||||
-rw-r--r-- | runtime/indent/tex.vim | 249 | ||||
-rw-r--r-- | runtime/syntax/sshconfig.vim | 85 | ||||
-rw-r--r-- | runtime/syntax/sshdconfig.vim | 76 |
10 files changed, 408 insertions, 160 deletions
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt index 80a269ad1..0c9f70d3a 100644 --- a/runtime/doc/channel.txt +++ b/runtime/doc/channel.txt @@ -1,4 +1,4 @@ -*channel.txt* For Vim version 7.4. Last change: 2016 Feb 27 +*channel.txt* For Vim version 7.4. Last change: 2016 Mar 03 VIM REFERENCE MANUAL by Bram Moolenaar @@ -103,6 +103,11 @@ when opening the channel: > let channel = ch_open('localhost:8765', {'callback': "MyHandler"}) call ch_sendexpr(channel, 'hello!') +When trying out channels it's useful to see what is going on. You can tell +Vim to write lines in log file: > + call ch_logfile('channellog', 'w') +See |ch_logfile()|. + ============================================================================== 3. Opening a channel *channel-open* @@ -130,7 +135,8 @@ Use |ch_status()| to see if the channel could be opened. overwritten. Therefore set "mode" first and the part specific mode later. - Note: when writing to a file or buffer NL mode is always used. + Note: when writing to a file or buffer and when reading from a + buffer NL mode is used by default. *channel-callback* "callback" A function that is called when a message is received that is @@ -191,6 +197,10 @@ For example, the handler can be added or changed: > call ch_setoptions(channel, {'callback': callback}) When "callback" is empty (zero or an empty string) the handler is removed. +After a callback has been invoked Vim will update the screen and put the +cursor back where it belongs. Thus the callback should not need to do +`:redraw`. + The timeout can be changed: > call ch_setoptions(channel, {'timeout': msec}) < @@ -259,9 +269,9 @@ message, it must use the number zero: Then channel handler will then get {response} converted to Vim types. If the channel does not have a handler the message is dropped. -On read error or ch_close(), when using a socket, the string "DETACH" is sent, -if still possible. The channel will then be inactive. For a JSON and JS mode -channel quotes are used around DETACH, otherwise there are no quotes. +On read error or ch_close(), when using a socket with RAW or NL mode, the +string "DETACH\n" is sent, if still possible. The channel will then be +inactive. It is also possible to use ch_sendraw() and ch_evalraw() on a JSON or JS channel. The caller is then completely responsible for correct encoding and @@ -457,6 +467,22 @@ For example, to start a job and write its output in buffer "dummy": > \ {'out-io': 'buffer', 'out-name': 'dummy'}) sbuf dummy +To run a job that reads from a buffer: > + let job = job_start({command}, + \ {'in-io': 'buffer', 'in-name': 'mybuffer'}) +< + *E915* *E918* +The buffer is found by name, similar to |bufnr()|. The buffer must exist and +be loaded when job_start() is called. + +By default this reads the whole buffer. This can be changed with the "in-top" +and "in-bot" options. + +TODO +A special mode is when "in-top" is set to zero and "in-bot" is not set: The +last-but-one line will be send to the job stdin. This allows for editing the +last line and sending it when pressing Enter. + TODO: To run a job and read its output once it is done: > let job = job_start({command}, {'exit-cb': 'MyHandler'}) @@ -470,7 +496,8 @@ To run a job and read its output once it is done: > 9. Starting a job without a channel *job-start-nochannel* To start another process without creating a channel: > - let job = job_start(command, {"in-io": "null", "out-io": "null"}) + let job = job_start(command, + \ {"in-io": "null", "out-io": "null", "err-io": "null"}) This starts {command} in the background, Vim does not wait for it to finish. @@ -538,7 +565,9 @@ TODO: *job-term* "in-io": "null" disconnect stdin TODO "in-io": "pipe" stdin is connected to the channel (default) "in-io": "file" stdin reads from a file TODO -"in-io": "buffer" stdin reads from a buffer TODO +"in-io": "buffer" stdin reads from a buffer +"in-top": number when using "buffer": first line to send (default: 1) +"in-bot": number when using "buffer": last line to send (default: last) "in-name": "/path/file" the name of he file or buffer to read from "in-buf": number the number of the buffer to read from TODO @@ -551,7 +580,7 @@ TODO: *job-term* "out-buf": number the number of the buffer to write to TODO *job-err-io* -"err-io": "out" same as stdout TODO +"err-io": "out" stderr messages to go to stdout "err-io": "null" disconnect stderr TODO "err-io": "pipe" stderr is connected to the channel (default) "err-io": "file" stderr writes to a file TODO @@ -562,6 +591,10 @@ TODO: *job-term* When the IO mode is "buffer" and there is a callback, the text is appended to the buffer before invoking the callback. +When using JS or JSON mode with "buffer", only messages with zero or negative +ID will be added to the buffer, after decoding + encoding. Messages with a +positive number will be handled by a callback, commands are handled as usual. + The name of the buffer is compared the full name of existing buffers. If there is a match that buffer is used. Otherwise a new buffer is created. Use an empty name to always create a new buffer. |ch_getbufnr()| can then be diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 4b672bbb5..7693ee399 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.4. Last change: 2016 Feb 27 +*eval.txt* For Vim version 7.4. Last change: 2016 Mar 03 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2695,6 +2695,14 @@ confirm({msg} [, {choices} [, {default} [, {type}]]]) ch_close({channel}) *ch_close()* Close {channel}. See |channel-close|. + + Note that a channel is closed in three stages: + - The I/O ends, log message: "Closing channel". There can + still be queued messages to read or callbacks to invoke. + - The readahead is cleared, log message: "Clearing channel". + Some variables may still reference the channel. + - The channel is freed, log message: "Freeing channel". + {only available when compiled with the |+channel| feature} ch_evalexpr({channel}, {expr} [, {options}]) *ch_evalexpr()* @@ -2703,7 +2711,7 @@ ch_evalexpr({channel}, {expr} [, {options}]) *ch_evalexpr()* with a raw channel. See |channel-use|. *E917* {options} must be a Dictionary. It must not have a "callback" - entry. + entry. It can have a "timeout" entry. ch_evalexpr() waits for a response and returns the decoded expression. When there is an error or timeout it returns an @@ -2753,6 +2761,7 @@ ch_logfile({fname} [, {mode}]) *ch_logfile()* The file is flushed after every message, on Unix you can use "tail -f" to see what is going on in real time. + ch_open({address} [, {options}]) *ch_open()* Open a channel to {address}. See |channel|. Returns a Channel. Use |ch_status()| to check for diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 581ee36cc..88abdd9f7 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1,4 +1,4 @@ -*index.txt* For Vim version 7.4. Last change: 2016 Feb 27 +*index.txt* For Vim version 7.4. Last change: 2016 Mar 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1324,7 +1324,6 @@ tag command action ~ |:lnfile| :lnf[ile] go to first location in next file |:lnoremap| :ln[oremap] like ":noremap!" but includes Lang-Arg mode |:loadkeymap| :loadk[eymap] load the following keymaps until EOF -|:loadplugin| :loadp[lugin] load a plugin from 'packpath' |:loadview| :lo[adview] load view for current window from a file |:lockmarks| :loc[kmarks] following command keeps marks where they are |:lockvar| :lockv[ar] lock variables @@ -1395,6 +1394,7 @@ tag command action ~ |:ounmap| :ou[nmap] like ":unmap" but for Operator-pending mode |:ounmenu| :ounme[nu] remove menu for Operator-pending mode |:ownsyntax| :ow[nsyntax] set new local syntax highlight for this window +|:packadd| :pa[ckadd] add a plugin from 'packpath' |:pclose| :pc[lose] close preview window |:pedit| :ped[it] edit file in the preview window |:perl| :pe[rl] execute Perl command diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 4a25f8d48..d5d78638a 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -1,4 +1,4 @@ -*repeat.txt* For Vim version 7.4. Last change: 2016 Feb 26 +*repeat.txt* For Vim version 7.4. Last change: 2016 Mar 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -213,23 +213,31 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. about each searched file. {not in Vi} - *:loadp* *:loadplugin* -:loadp[lugin] {name} Search for an optional plugin directory and source the - plugin files found. It is similar to: > - :runtime pack/*/opt/{name}/plugin/*.vim -< However, `:loadplugin` uses 'packpath' instead of - 'runtimepath'. And the directory found is added to - 'runtimepath'. - - If you have a directory under 'packpath' that doesn't - actually have a plugin file, just create an empty one. - This will still add the directory to 'runtimepath'. + *:pa* *:packadd* +:pa[ckadd][!] {name} Search for an optional plugin directory in 'packpath' + and source any plugin files found. The directory must + match: + pack/*/opt/{name} ~ + The directory is added to 'runtimepath' if it wasn't + there yet. Note that {name} is the directory name, not the name of the .vim file. If the "{name}/plugin" directory contains more than one file they are all sourced. - Also see |load-plugin|. + If the filetype detection was not enabled yet (this + is usually done with a "syntax enable" or "filetype + on" command in your .vimrc file), this will also look + for "{name}/ftdetect/*.vim" files. + + When the optional ! is added no plugin files or + ftdetect scripts are loaded, only the matching + directories are added to 'runtimepath'. This is + useful in your .vimrc. The plugins will then be + loaded during initialization, see |load-plugins|. + + Also see |pack-add|. + :scripte[ncoding] [encoding] *:scripte* *:scriptencoding* *E167* Specify the character encoding used in the script. diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index c982a99f6..450fdaf17 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1,4 +1,4 @@ -*starting.txt* For Vim version 7.4. Last change: 2016 Feb 27 +*starting.txt* For Vim version 7.4. Last change: 2016 Mar 03 VIM REFERENCE MANUAL by Bram Moolenaar @@ -832,6 +832,8 @@ accordingly. Vim proceeds in this order: - The user exrc file(s). Same as for the user vimrc file, but with "vimrc" replaced by "exrc". But only one of ".exrc" and "_exrc" is used, depending on the system. And without the (*)! + - You would usually have "syntax on" and/or "filetype on" commands, + which trigger initializing filetype detection, see |syntax-loading|. d. If the 'exrc' option is on (which is not the default), the current directory is searched for three files. The first that exists is used, diff --git a/runtime/doc/tags b/runtime/doc/tags index 061bc3195..8e822c6f3 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -2446,8 +2446,6 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* :lo starting.txt /*:lo* :loadk mbyte.txt /*:loadk* :loadkeymap mbyte.txt /*:loadkeymap* -:loadp repeat.txt /*:loadp* -:loadplugin repeat.txt /*:loadplugin* :loadview starting.txt /*:loadview* :loc motion.txt /*:loc* :lockmarks motion.txt /*:lockmarks* @@ -2620,6 +2618,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* :ounmenu gui.txt /*:ounmenu* :ownsyntax syntax.txt /*:ownsyntax* :p various.txt /*:p* +:pa repeat.txt /*:pa* +:packadd repeat.txt /*:packadd* :pc windows.txt /*:pc* :pclose windows.txt /*:pclose* :pe if_perl.txt /*:pe* @@ -4438,8 +4438,10 @@ E911 eval.txt /*E911* E912 eval.txt /*E912* E913 eval.txt /*E913* E914 eval.txt /*E914* +E915 channel.txt /*E915* E916 eval.txt /*E916* E917 eval.txt /*E917* +E918 channel.txt /*E918* E92 message.txt /*E92* E93 windows.txt /*E93* E94 windows.txt /*E94* @@ -6942,7 +6944,6 @@ list-repeat windows.txt /*list-repeat* lite.vim syntax.txt /*lite.vim* literal-string eval.txt /*literal-string* lnum-variable eval.txt /*lnum-variable* -load-plugin repeat.txt /*load-plugin* load-plugins starting.txt /*load-plugins* load-vim-script repeat.txt /*load-vim-script* local-additions help.txt /*local-additions* @@ -7573,6 +7574,7 @@ other-features vi_diff.txt /*other-features* out-cb channel.txt /*out-cb* out-timeout channel.txt /*out-timeout* p change.txt /*p* +pack-add repeat.txt /*pack-add* packages repeat.txt /*packages* page-down intro.txt /*page-down* page-up intro.txt /*page-up* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index ecfc9e517..5fed9ac60 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.4. Last change: 2016 Feb 27 +*todo.txt* For Vim version 7.4. Last change: 2016 Mar 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -35,26 +35,22 @@ not be repeated below, unless there is extra information. -------------------- Known bugs and current work ----------------------- +channel: -- A callback on ch_sendraw() should be put at the end of the list of callback - handlers. When a message arrives invoke the first one and remove it. - implement TODO items in ":help channel": + - Send last line of buffer when it's added. - job_start() options: - term - in-io - in-file - out-io - out-file - out-buffer - err-io - err-file - err-buffer + in-io: null, file (in-name), in-buf + out-io: null, file, out-buf + err-io: null, file (err-name), buffer (err-buf) existing channel to use - job_maystart() - add job_info(): process ID, run/dead, etc. - add ch_info(): in/out/err mode, timeout, callbacks, etc. - Move more details from eval.txt to channel.txt. Add tags in eval.txt. - When receiving malformed json starting with a quote it doesn't get - discarded. + discarded. Any invalid JSON or JSON that isn't a list will block further + parsing? +- When decoding json, don't read all the typeahead at once, use the reader + properly. - When a message in the queue but there is no callback, drop it after a while? Add timestamp to queued messages and callbacks with ID, remove after a minute. @@ -70,12 +66,11 @@ not be repeated below, unless there is extra information. - make sure errors lead to a useful error msg. ["ex","foobar"] - For connection to server, a "keep open" flag would be useful. Retry connecting in the main loop with zero timeout. +Later +- job_start(): run job in a newly opened terminal. + With xterm could use -S{pty}. -For Win32 isinf() should be inline. (ZyX) - -Add ":packadd"? Like :loadplugin but only adds the dir to 'runtimepath'. - -emoji patch from Yasuhiro Matsumoto. +emoji patch from Yasuhiro Matsumoto. Asked Thomas Dickey. More plugin support: - Have a way to install a callback from the main loop. Called every second or @@ -107,15 +102,17 @@ When running "make install" don't overwrite the doc/tags file, generate it elsewhere, so that the distributed file doesn't change. Fix to support --nofork for Windows batch files. (Kevin CantĂș, 2016 Feb 23, -#658) +#658, #659) Also add "setlocal" at top of batch file? -Patch to add GTK 3 support. (Kazunobu Kuriyama, 2016 Feb 13) +Patch to add matchstrpos(). (Ozaki Kiichi, 2016 Feb 28) Why does this: echo "a" . 1.1 result in: a11 Should recognize float (so long as it's not ".1.1"). -Allow for an empty dictionary key. +Allow for an empty dictionary key? + +Patch to improve I/O for Perl. (Damien, 2016 Jan 9, update Jan 22 2nd one) Regexp problems: - The regexp engines are not reentrant, causing havoc when interrupted by a @@ -170,6 +167,7 @@ Patch to put undo options together in undo window. Patch to have better check for {action} argument of setqflist(). Nikolai Pavlov, Feb 25, #661. Can be even more strict. +Also see patch from Hirohito Higash, Feb 25. Patch for clearing history. (Yegappan Lakshmanan, 2016 Jan 31, second message has tests) @@ -190,6 +188,10 @@ Two patches now? New update Feb 24. Patch to support 64 bit ints for Number. (Ken Takata, 2016 Jan 21) Also in update of Feb 24? +Patch to add setbufline(). (email from Yasuhiro Matsumoto, patch by Ozaki +Kiichi, 2016 Feb 28) +https://gist.github.com/ichizok/64bdc92aed19ec9001dd + Need to try out instructions in INSSTALLpc.txt about how to install all interfaces and how to build Vim with them. Appveyor build with self-installing executable, includes getting most @@ -382,8 +384,6 @@ Patch to add GUI colors to the terminal, when it supports it. (ZyX, 2013 Jan Patch for problem with restoring screen on Windows. (Nobuhiro Takasaki, 2015 Sep 10) -Patch to improve I/O for Perl. (Damien, 2015 Jan 9, update Jan 22 2nd one) - Patch to set antialiasing style on Windows. (Ondrej Balaz, 2013 Mar 14) Needs a different check for CLEARTYPE_QUALITY. Problem mentioned by Christian Brabandt, 2016 Jan 4. diff --git a/runtime/indent/tex.vim b/runtime/indent/tex.vim index 7e3a35108..0150bb962 100644 --- a/runtime/indent/tex.vim +++ b/runtime/indent/tex.vim @@ -2,10 +2,9 @@ " Language: LaTeX " Maintainer: YiChao Zhou <broken.zhou AT gmail.com> " Created: Sat, 16 Feb 2002 16:50:19 +0100 -" Last Change: 2012 Mar 18 19:19:50 -" Version: 0.7 -" Please email me if you found something we can do. Bug report and -" feature request is welcome. +" Version: 0.9.2 +" Please email me if you found something I can do. Comments, bug report and +" feature request are welcome. " Last Update: {{{ " 25th Sep 2002, by LH : @@ -41,7 +40,7 @@ " (*) Trust user when in "verbatim" and "lstlisting" " 2012/03/11 by Zhou Yichao <broken.zhou AT gmail.com> " (*) Modify "&" so that only indent when current line start with -" "&". +" "&". " 2012/03/12 by Zhou Yichao <broken.zhou AT gmail.com> " (*) Modify indentkeys. " 2012/03/18 by Zhou Yichao <broken.zhou AT gmail.com> @@ -49,6 +48,17 @@ " 2013/05/02 by Zhou Yichao <broken.zhou AT gmail.com> " (*) Fix problem about GetTeXIndent checker. Thank Albert Netymk " for reporting this. +" 2014/06/23 by Zhou Yichao <broken.zhou AT gmail.com> +" (*) Remove the feature g:tex_indent_and because it is buggy. +" (*) If there is not any obvious indentation hints, we do not +" alert our user's current indentation. +" (*) g:tex_indent_brace now only works if the open brace is the +" last character of that line. +" 2014/08/03 by Zhou Yichao <broken.zhou AT gmail.com> +" (*) Indent current line if last line has larger indentation +" 2014/08/09 by Zhou Yichao <broken.zhou AT gmail.com> +" (*) Add missing return value for s:GetEndIndentation(...) +" " }}} " Document: {{{ @@ -60,7 +70,17 @@ " * g:tex_indent_brace " " If this variable is unset or non-zero, it will use smartindent-like style -" for "{}" and "[]" +" for "{}" and "[]". Now this only works if the open brace is the last +" character of that line. +" +" % Example 1 +" \usetikzlibrary{ +" external +" } +" +" % Example 2 +" \tikzexternalize[ +" prefix=tikz] " " * g:tex_indent_items " @@ -98,14 +118,6 @@ " " A list of environment names. separated with '\|', where no indentation is " required. The default is 'document\|verbatim'. -" -" * g:tex_indent_and -" -" If this variable is unset or zero, vim will try to align the line with first -" "&". This is pretty useful when you use environment like table or align. -" Note that this feature need to search back some line, so vim may become -" a little slow. -" " }}} " Only define the function once @@ -126,8 +138,8 @@ endif if !exists("g:tex_indent_brace") let g:tex_indent_brace = 1 endif -if !exists("g:tex_indent_and") - let g:tex_indent_and = 1 +if !exists("g:tex_max_scan_line") + let g:tex_max_scan_line = 60 endif if g:tex_indent_items if !exists("g:tex_itemize_env") @@ -140,10 +152,6 @@ else let g:tex_items = '' endif -if !exists("g:tex_indent_paretheses") - let g:tex_indent_paretheses = 1 -endif - if !exists("g:tex_noindent_env") let g:tex_noindent_env = 'document\|verbatim\|lstlisting' endif "}}} @@ -160,6 +168,7 @@ let g:tex_items = '^\s*' . substitute(g:tex_items, '^\(\^\\s\*\)*', '', '') function! GetTeXIndent() " {{{ " Find a non-blank line above the current line. let lnum = prevnonblank(v:lnum - 1) + let cnum = v:lnum " Comment line is not what we need. while lnum != 0 && getline(lnum) =~ '^\s*%' @@ -171,8 +180,8 @@ function! GetTeXIndent() " {{{ return 0 endif - let line = substitute(getline(lnum), '%.*', ' ','g') " last line - let cline = substitute(getline(v:lnum), '%.*', ' ', 'g') " current line + let line = substitute(getline(lnum), '\s*%.*', '','g') " last line + let cline = substitute(getline(v:lnum), '\s*%.*', '', 'g') " current line " We are in verbatim, so do what our user what. if synIDattr(synID(v:lnum, indent(v:lnum), 1), "name") == "texZone" @@ -183,26 +192,12 @@ function! GetTeXIndent() " {{{ end endif - " You want to align with "&" - if g:tex_indent_and - " Align only when current line start with "&" - if line =~ '&.*\\\\' && cline =~ '^\s*&' - return indent(v:lnum) + stridx(line, "&") - stridx(cline, "&") - endif - - " set line & lnum to the line which doesn't contain "&" - while lnum != 0 && (stridx(line, "&") != -1 || line =~ '^\s*%') - let lnum = prevnonblank(lnum - 1) - let line = getline(lnum) - endwhile - endif - - if lnum == 0 return 0 endif let ind = indent(lnum) + let stay = 1 " New code for comment: retain the indent of current line if cline =~ '^\s*%' @@ -216,77 +211,197 @@ function! GetTeXIndent() " {{{ " ZYC modification : \end after \begin won't cause wrong indent anymore if line =~ '\\begin{.*}' && line !~ g:tex_noindent_env let ind = ind + &sw + let stay = 0 if g:tex_indent_items " Add another sw for item-environments if line =~ g:tex_itemize_env let ind = ind + &sw + let stay = 0 endif endif endif + if cline =~ '\\end{.*}' + let retn = s:GetEndIndentation(v:lnum) + if retn != -1 + return retn + endif + end " Subtract a 'shiftwidth' when an environment ends - if cline =~ '\\end{.*}' && cline !~ g:tex_noindent_env - + if cline =~ '\\end{.*}' + \ && cline !~ g:tex_noindent_env + \ && cline !~ '\\begin{.*}.*\\end{.*}' if g:tex_indent_items " Remove another sw for item-environments if cline =~ g:tex_itemize_env let ind = ind - &sw + let stay = 0 endif endif let ind = ind - &sw + let stay = 0 endif if g:tex_indent_brace - let sum1 = 0 - for i in range(0, strlen(line)-1) - if line[i] == "}" || line[i] == "]" || - \ strpart(line, i, 7) == '\right)' - let sum1 = max([0, sum1-1]) - endif - if line[i] == "{" || line[i] == "[" || - \ strpart(line, i, 6) == '\left(' - let sum1 += 1 - endif - endfor + let char = line[strlen(line)-1] + if char == '[' || char == '{' + let ind += &sw + let stay = 0 + endif - let sum2 = 0 - for i in reverse(range(0, strlen(cline)-1)) - if cline[i] == "{" || cline[i] == "[" || - \ strpart(cline, i, 6) == '\left(' - let sum2 = max([0, sum2-1]) - endif - if cline[i] == "}" || cline[i] == "]" || - \ strpart(cline, i, 7) == '\right)' - let sum2 += 1 + let cind = indent(v:lnum) + let char = cline[cind] + if (char == ']' || char == '}') && + \ s:CheckPairedIsLastCharacter(v:lnum, cind) + let ind -= &sw + let stay = 0 + endif + + for i in range(indent(lnum)+1, strlen(line)-1) + let char = line[i] + if char == ']' || char == '}' + if s:CheckPairedIsLastCharacter(lnum, i) + let ind -= &sw + let stay = 0 + endif endif endfor - - let ind += (sum1 - sum2) * &sw - endif - - if g:tex_indent_paretheses endif " Special treatment for 'item' " ---------------------------- if g:tex_indent_items - " '\item' or '\bibitem' itself: if cline =~ g:tex_items let ind = ind - &sw + let stay = 0 endif - " lines following to '\item' are intented once again: if line =~ g:tex_items let ind = ind + &sw + let stay = 0 + endif + endif + + if stay + " If there is no obvious indentation hint, we trust our user. + if empty(cline) + return ind + else + return max([indent(v:lnum), s:GetLastBeginIndentation(v:lnum)]) + endif + else + return ind + endif +endfunction "}}} + +function! s:GetLastBeginIndentation(lnum) " {{{ + let matchend = 1 + for lnum in range(a:lnum-1, max([a:lnum - g:tex_max_scan_line, 1]), -1) + let line = getline(lnum) + if line =~ '\\end{.*}' + let matchend += 1 + endif + if line =~ '\\begin{.*}' + let matchend -= 1 endif + if matchend == 0 + if line =~ g:tex_itemize_env + return indent(lnum) + 2 * &sw + endif + if line =~ g:tex_noindent_env + return indent(lnum) + endif + return indent(lnum) + &sw + endif + endfor + return -1 +endfunction + +function! s:GetEndIndentation(lnum) " {{{ + if getline(a:lnum) =~ '\\begin{.*}.*\\end{.*}' + return -1 + endif + + let min_indent = 100 + let matchend = 1 + for lnum in range(a:lnum-1, max([a:lnum-g:tex_max_scan_line, 1]), -1) + let line = getline(lnum) + if line =~ '\\end{.*}' + let matchend += 1 + endif + if line =~ '\\begin{.*}' + let matchend -= 1 + endif + if matchend == 0 + return indent(lnum) + endif + if !empty(line) + let min_indent = min([min_indent, indent(lnum)]) + endif + endfor + return min_indent - &sw +endfunction + +" Most of the code is from matchparen.vim +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_col = a:col+1 + + + let c = getline(c_lnum)[c_col-1] + let plist = split(&matchpairs, '.\zs[:,]') + let i = index(plist, c) + if i < 0 + return 0 + endif + + " Figure out the arguments for searchpairpos(). + if i % 2 == 0 + let s_flags = 'nW' + let c2 = plist[i + 1] + else + let s_flags = 'nbW' + let c2 = c + let c = plist[i - 1] + endif + if c == '[' + let c = '\[' + let c2 = '\]' + endif + + " Find the match. When it was just before the cursor move it there for a + " moment. + let save_cursor = winsaveview() + call cursor(c_lnum, c_col) + + " When not in a string or comment ignore matches inside them. + " We match "escape" for special items, such as lispEscapeSpecial. + let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' . + \ '=~? "string\\|character\\|singlequote\\|escape\\|comment"' + execute 'if' s_skip '| let s_skip = 0 | endif' + + let stopline = max([0, c_lnum - g:tex_max_scan_line]) + + " Limit the search time to 300 msec to avoid a hang on very long lines. + " This fails when a timeout is not supported. + try + let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, 100) + catch /E118/ + endtry + + call winrestview(save_cursor) + if m_lnum > 0 + let line = getline(m_lnum) + return strlen(line) == m_col endif - return ind + return 0 endfunction "}}} let &cpo = s:cpo_save diff --git a/runtime/syntax/sshconfig.vim b/runtime/syntax/sshconfig.vim index ef2ca0797..44b3c67a9 100644 --- a/runtime/syntax/sshconfig.vim +++ b/runtime/syntax/sshconfig.vim @@ -4,8 +4,8 @@ " Maintainer: Dominik Fischer <d dot f dot fischer at web dot de> " Contributor: Leonard Ehrenfried <leonard.ehrenfried@web.de> " Contributor: Karsten Hopp <karsten@redhat.com> -" Last Change: 2016 Jan 15 -" SSH Version: 7.1 +" Last Change: 2016 Mar 1 +" SSH Version: 7.2 " " Setup @@ -40,26 +40,57 @@ syn keyword sshconfigYesNo yes no ask syn keyword sshconfigYesNo any auto syn keyword sshconfigYesNo force autoask none -syn keyword sshconfigCipher 3des blowfish -syn keyword sshconfigCiphers aes128-cbc 3des-cbc blowfish blowfish-cbc cast128-cbc -syn keyword sshconfigCiphers aes192-cbc aes256-cbc aes128-ctr aes192-ctr aes256-ctr -syn keyword sshconfigCiphers arcfour arcfour128 arcfour256 cast128-cbc +syn keyword sshconfigCipher 3des blowfish -syn keyword sshconfigMAC hmac-md5 hmac-sha1 hmac-ripemd160 hmac-sha1-96 -syn keyword sshconfigMAC hmac-md5-96 -syn keyword sshconfigMAC hmac-sha2-256 hmac-sha2-256-96 hmac-sha2-512 -syn keyword sshconfigMAC hmac-sha2-512-96 +syn keyword sshconfigCiphers 3des-cbc +syn keyword sshconfigCiphers blowfish-cbc +syn keyword sshconfigCiphers cast128-cbc +syn keyword sshconfigCiphers arcfour +syn keyword sshconfigCiphers arcfour128 +syn keyword sshconfigCiphers arcfour256 +syn keyword sshconfigCiphers aes128-cbc +syn keyword sshconfigCiphers aes192-cbc +syn keyword sshconfigCiphers aes256-cbc +syn match sshconfigCiphers "\<rijndael-cbc@lysator\.liu.se\>" +syn keyword sshconfigCiphers aes128-ctr +syn keyword sshconfigCiphers aes192-ctr +syn keyword sshconfigCiphers aes256-ctr +syn match sshconfigCiphers "\<aes128-gcm@openssh\.com\>" +syn match sshconfigCiphers "\<aes256-gcm@openssh\.com\>" +syn match sshconfigCiphers "\<chacha20-poly1305@openssh\.com\>" + +syn keyword sshconfigMAC hmac-sha1 +syn keyword sshconfigMAC mac-sha1-96 +syn keyword sshconfigMAC mac-sha2-256 +syn keyword sshconfigMAC mac-sha2-512 +syn keyword sshconfigMAC mac-md5 +syn keyword sshconfigMAC mac-md5-96 +syn keyword sshconfigMAC mac-ripemd160 +syn match sshconfigMAC "\<hmac-ripemd160@openssh\.com\>" syn match sshconfigMAC "\<umac-64@openssh\.com\>" +syn match sshconfigMAC "\<umac-128@openssh\.com\>" +syn match sshconfigMAC "\<hmac-sha1-etm@openssh\.com\>" +syn match sshconfigMAC "\<hmac-sha1-96-etm@openssh\.com\>" +syn match sshconfigMAC "\<hmac-sha2-256-etm@openssh\.com\>" +syn match sshconfigMAC "\<hmac-sha2-512-etm@openssh\.com\>" +syn match sshconfigMAC "\<hmac-md5-etm@openssh\.com\>" +syn match sshconfigMAC "\<hmac-md5-96-etm@openssh\.com\>" +syn match sshconfigMAC "\<hmac-ripemd160-etm@openssh\.com\>" +syn match sshconfigMAC "\<umac-64-etm@openssh\.com\>" +syn match sshconfigMAC "\<umac-128-etm@openssh\.com\>" -syn keyword sshconfigHostKeyAlg ssh-rsa ssh-dss -syn match sshconfigHostKeyAlg "\<ecdsa-sha2-nistp256-cert-v01@openssh\.com\>" -syn match sshconfigHostKeyAlg "\<ecdsa-sha2-nistp384-cert-v01@openssh\.com\>" -syn match sshconfigHostKeyAlg "\<ecdsa-sha2-nistp521-cert-v01@openssh\.com\>" -syn match sshconfigHostKeyAlg "\<ssh-rsa-cert-v01@openssh\.com\>" -syn match sshconfigHostKeyAlg "\<ssh-dss-cert-v01@openssh\.com\>" -syn match sshconfigHostKeyAlg "\<ssh-rsa-cert-v00@openssh\.com\>" -syn match sshconfigHostKeyAlg "\<ssh-dss-cert-v00@openssh\.com\>" -syn keyword sshconfigHostKeyAlg ecdsa-sha2-nistp256 ecdsa-sha2-nistp384 ecdsa-sha2-nistp521 +syn keyword sshconfigHostKeyAlgo ssh-ed25519 +syn match sshconfigHostKeyAlgo "\<ssh-ed25519-cert-v01@openssh\.com\>" +syn keyword sshconfigHostKeyAlgo ssh-rsa +syn keyword sshconfigHostKeyAlgo ssh-dss +syn keyword sshconfigHostKeyAlgo ecdsa-sha2-nistp256 +syn keyword sshconfigHostKeyAlgo ecdsa-sha2-nistp384 +syn keyword sshconfigHostKeyAlgo ecdsa-sha2-nistp521 +syn match sshconfigHostKeyAlgo "\<ssh-rsa-cert-v01@openssh\.com\>" +syn match sshconfigHostKeyAlgo "\<ssh-dss-cert-v01@openssh\.com\>" +syn match sshconfigHostKeyAlgo "\<ecdsa-sha2-nistp256-cert-v01@openssh\.com\>" +syn match sshconfigHostKeyAlgo "\<ecdsa-sha2-nistp384-cert-v01@openssh\.com\>" +syn match sshconfigHostKeyAlgo "\<ecdsa-sha2-nistp521-cert-v01@openssh\.com\>" syn keyword sshconfigPreferredAuth hostbased publickey password gssapi-with-mic syn keyword sshconfigPreferredAuth keyboard-interactive @@ -78,11 +109,14 @@ syn match sshconfigIPQoS "cs[0-7]" syn keyword sshconfigIPQoS ef lowdelay throughput reliability syn keyword sshconfigKbdInteractive bsdauth pam skey -syn keyword sshconfigKexAlgo ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521 -syn keyword sshconfigKexAlgo diffie-hellman-group-exchange-sha256 -syn keyword sshconfigKexAlgo diffie-hellman-group-exchange-sha1 -syn keyword sshconfigKexAlgo diffie-hellman-group14-sha1 -syn keyword sshconfigKexAlgo diffie-hellman-group1-sha1 +syn keyword sshconfigKexAlgo diffie-hellman-group1-sha1 +syn keyword sshconfigKexAlgo diffie-hellman-group14-sha1 +syn keyword sshconfigKexAlgo diffie-hellman-group-exchange-sha1 +syn keyword sshconfigKexAlgo diffie-hellman-group-exchange-sha256 +syn keyword sshconfigKexAlgo ecdh-sha2-nistp256 +syn keyword sshconfigKexAlgo ecdh-sha2-nistp384 +syn keyword sshconfigKexAlgo ecdh-sha2-nistp521 +syn match sshconfigKexAlgo "\<curve25519-sha256@libssh\.org\>" syn keyword sshconfigTunnel point-to-point ethernet @@ -111,6 +145,7 @@ syn keyword sshconfigKeyword CanonicalDomains syn keyword sshconfigKeyword CanonicalizeFallbackLocal syn keyword sshconfigKeyword CanonicalizeHostname syn keyword sshconfigKeyword CanonicalizeMaxDots +syn keyword sshconfigKeyword CertificateFile syn keyword sshconfigKeyword ChallengeResponseAuthentication syn keyword sshconfigKeyword CheckHostIP syn keyword sshconfigKeyword Cipher @@ -212,7 +247,7 @@ if version >= 508 || !exists("did_sshconfig_syntax_inits") HiLink sshconfigCipher sshconfigEnum HiLink sshconfigCiphers sshconfigEnum HiLink sshconfigMAC sshconfigEnum - HiLink sshconfigHostKeyAlg sshconfigEnum + HiLink sshconfigHostKeyAlgo sshconfigEnum HiLink sshconfigLogLevel sshconfigEnum HiLink sshconfigSysLogFacility sshconfigEnum HiLink sshconfigAddressFamily sshconfigEnum diff --git a/runtime/syntax/sshdconfig.vim b/runtime/syntax/sshdconfig.vim index 4203047d2..6b7b98d89 100644 --- a/runtime/syntax/sshdconfig.vim +++ b/runtime/syntax/sshdconfig.vim @@ -6,8 +6,8 @@ " Contributor: Leonard Ehrenfried <leonard.ehrenfried@web.de> " Contributor: Karsten Hopp <karsten@redhat.com> " Originally: 2009-07-09 -" Last Change: 2016 Jan 12 -" SSH Version: 7.1 +" Last Change: 2016 Mar 1 +" SSH Version: 7.2 " " Setup @@ -47,15 +47,55 @@ syn keyword sshdconfigTcpForwarding local remote syn keyword sshdconfigRootLogin prohibit-password without-password forced-commands-only -syn keyword sshdconfigCipher aes128-cbc 3des-cbc blowfish-cbc cast128-cbc -syn keyword sshdconfigCipher aes192-cbc aes256-cbc aes128-ctr aes192-ctr aes256-ctr -syn keyword sshdconfigCipher arcfour arcfour128 arcfour256 cast128-cbc - -syn keyword sshdconfigMAC hmac-md5 hmac-sha1 hmac-ripemd160 hmac-sha1-96 -syn keyword sshdconfigMAC hmac-md5-96 -syn keyword sshdconfigMAC hmac-sha2-256 hmac-sha256-96 hmac-sha2-512 -syn keyword sshdconfigMAC hmac-sha2-512-96 +syn keyword sshdconfigCiphers 3des-cbc +syn keyword sshdconfigCiphers blowfish-cbc +syn keyword sshdconfigCiphers cast128-cbc +syn keyword sshdconfigCiphers arcfour +syn keyword sshdconfigCiphers arcfour128 +syn keyword sshdconfigCiphers arcfour256 +syn keyword sshdconfigCiphers aes128-cbc +syn keyword sshdconfigCiphers aes192-cbc +syn keyword sshdconfigCiphers aes256-cbc +syn match sshdconfigCiphers "\<rijndael-cbc@lysator\.liu.se\>" +syn keyword sshdconfigCiphers aes128-ctr +syn keyword sshdconfigCiphers aes192-ctr +syn keyword sshdconfigCiphers aes256-ctr +syn match sshdconfigCiphers "\<aes128-gcm@openssh\.com\>" +syn match sshdconfigCiphers "\<aes256-gcm@openssh\.com\>" +syn match sshdconfigCiphers "\<chacha20-poly1305@openssh\.com\>" + +syn keyword sshdconfigMAC hmac-sha1 +syn keyword sshdconfigMAC mac-sha1-96 +syn keyword sshdconfigMAC mac-sha2-256 +syn keyword sshdconfigMAC mac-sha2-512 +syn keyword sshdconfigMAC mac-md5 +syn keyword sshdconfigMAC mac-md5-96 +syn keyword sshdconfigMAC mac-ripemd160 +syn match sshdconfigMAC "\<hmac-ripemd160@openssh\.com\>" syn match sshdconfigMAC "\<umac-64@openssh\.com\>" +syn match sshdconfigMAC "\<umac-128@openssh\.com\>" +syn match sshdconfigMAC "\<hmac-sha1-etm@openssh\.com\>" +syn match sshdconfigMAC "\<hmac-sha1-96-etm@openssh\.com\>" +syn match sshdconfigMAC "\<hmac-sha2-256-etm@openssh\.com\>" +syn match sshdconfigMAC "\<hmac-sha2-512-etm@openssh\.com\>" +syn match sshdconfigMAC "\<hmac-md5-etm@openssh\.com\>" +syn match sshdconfigMAC "\<hmac-md5-96-etm@openssh\.com\>" +syn match sshdconfigMAC "\<hmac-ripemd160-etm@openssh\.com\>" +syn match sshdconfigMAC "\<umac-64-etm@openssh\.com\>" +syn match sshdconfigMAC "\<umac-128-etm@openssh\.com\>" + +syn keyword sshdconfigHostKeyAlgo ssh-ed25519 +syn match sshdconfigHostKeyAlgo "\<ssh-ed25519-cert-v01@openssh\.com\>" +syn keyword sshdconfigHostKeyAlgo ssh-rsa +syn keyword sshdconfigHostKeyAlgo ssh-dss +syn keyword sshdconfigHostKeyAlgo ecdsa-sha2-nistp256 +syn keyword sshdconfigHostKeyAlgo ecdsa-sha2-nistp384 +syn keyword sshdconfigHostKeyAlgo ecdsa-sha2-nistp521 +syn match sshdconfigHostKeyAlgo "\<ssh-rsa-cert-v01@openssh\.com\>" +syn match sshdconfigHostKeyAlgo "\<ssh-dss-cert-v01@openssh\.com\>" +syn match sshdconfigHostKeyAlgo "\<ecdsa-sha2-nistp256-cert-v01@openssh\.com\>" +syn match sshdconfigHostKeyAlgo "\<ecdsa-sha2-nistp384-cert-v01@openssh\.com\>" +syn match sshdconfigHostKeyAlgo "\<ecdsa-sha2-nistp521-cert-v01@openssh\.com\>" syn keyword sshdconfigRootLogin prohibit-password without-password forced-commands-only @@ -73,11 +113,14 @@ syn match sshdconfigIPQoS "af4[123]" syn match sshdconfigIPQoS "cs[0-7]" syn keyword sshdconfigIPQoS ef lowdelay throughput reliability -syn keyword sshdconfigKexAlgo ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521 -syn keyword sshdconfigKexAlgo diffie-hellman-group-exchange-sha256 -syn keyword sshdconfigKexAlgo diffie-hellman-group-exchange-sha1 -syn keyword sshdconfigKexAlgo diffie-hellman-group14-sha1 -syn keyword sshdconfigKexAlgo diffie-hellman-group1-sha1 +syn keyword sshdconfigKexAlgo diffie-hellman-group1-sha1 +syn keyword sshdconfigKexAlgo diffie-hellman-group14-sha1 +syn keyword sshdconfigKexAlgo diffie-hellman-group-exchange-sha1 +syn keyword sshdconfigKexAlgo diffie-hellman-group-exchange-sha256 +syn keyword sshdconfigKexAlgo ecdh-sha2-nistp256 +syn keyword sshdconfigKexAlgo ecdh-sha2-nistp384 +syn keyword sshdconfigKexAlgo ecdh-sha2-nistp521 +syn match sshdconfigKexAlgo "\<curve25519-sha256@libssh\.org\>" syn keyword sshdconfigTunnel point-to-point ethernet @@ -215,8 +258,9 @@ if version >= 508 || !exists("did_sshdconfig_syntax_inits") HiLink sshdconfigPrivilegeSeparation sshdconfigEnum HiLink sshdconfigTcpForwarding sshdconfigEnum HiLink sshdconfigRootLogin sshdconfigEnum - HiLink sshdconfigCipher sshdconfigEnum + HiLink sshdconfigCiphers sshdconfigEnum HiLink sshdconfigMAC sshdconfigEnum + HiLink sshdconfigHostKeyAlgo sshdconfigEnum HiLink sshdconfigRootLogin sshdconfigEnum HiLink sshdconfigLogLevel sshdconfigEnum HiLink sshdconfigSysLogFacility sshdconfigEnum |