diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/cmdline.txt | 4 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 33 | ||||
-rw-r--r-- | runtime/doc/job_control.txt | 48 | ||||
-rw-r--r-- | runtime/doc/msgpack_rpc.txt | 66 | ||||
-rw-r--r-- | runtime/doc/options.txt | 12 | ||||
-rw-r--r-- | runtime/doc/os_win32.txt | 2 | ||||
-rw-r--r-- | runtime/doc/pattern.txt | 4 | ||||
-rw-r--r-- | runtime/doc/syntax.txt | 28 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 60 | ||||
-rw-r--r-- | runtime/doc/usr_04.txt | 4 | ||||
-rw-r--r-- | runtime/filetype.vim | 8 | ||||
-rw-r--r-- | runtime/ftplugin/dockerfile.vim | 16 | ||||
-rw-r--r-- | runtime/ftplugin/vim.vim | 11 | ||||
-rw-r--r-- | runtime/indent/json.vim | 169 | ||||
-rw-r--r-- | runtime/scripts.vim | 6 | ||||
-rw-r--r-- | runtime/syntax/asciidoc.vim | 4 | ||||
-rw-r--r-- | runtime/syntax/dockerfile.vim | 24 | ||||
-rw-r--r-- | runtime/syntax/tex.vim | 113 |
18 files changed, 430 insertions, 182 deletions
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 8b5a6b2f5c..db338a2a56 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 7.4. Last change: 2014 Aug 16 +*cmdline.txt* For Vim version 7.4. Last change: 2014 Sep 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -56,7 +56,7 @@ history tables: These are completely separate. Each history can only be accessed when entering the same type of line. Use the 'history' option to set the number of lines that are remembered -(default: 20). +(default: 50). Notes: - When you enter a command-line that is exactly the same as an older one, the old one is removed (to avoid repeated commands moving older commands out of diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index a62fa82d12..65b1f2aa3c 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.4. Last change: 2014 Aug 16 +*eval.txt* For Vim version 7.4. Last change: 2014 Sep 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1102,9 +1102,9 @@ are known inside the current Vim session. Using expand() will first try using the environment variables known inside the current Vim session. If that fails, a shell will be used to expand the variable. This can be slow, but it does expand all variables that the shell knows about. Example: > - :echo $version - :echo expand("$version") -The first one probably doesn't echo anything, the second echoes the $version + :echo $shell + :echo expand("$shell") +The first one probably doesn't echo anything, the second echoes the $shell variable (if your shell supports it). @@ -2632,7 +2632,7 @@ cursor({list}) line. If {col} is zero, the cursor will stay in the current column. If {curswant} is given it is used to set the preferred column - for vertical movment. Otherwise {col} is used. + for vertical movement. Otherwise {col} is used. When 'virtualedit' is used {off} specifies the offset in screen columns from the start of the character. E.g., a position within a <Tab> or after the last character. @@ -2923,7 +2923,8 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()* < Expand() can also be used to expand variables and environment variables that are only known in a shell. But this can be - slow, because a shell must be started. See |expr-env-expand|. + slow, because a shell may be used to do the expansion. See + |expr-env-expand|. The expanded variable is still handled like a list of file names. When an environment variable cannot be expanded, it is left unchanged. Thus ":echo expand('$FOOBAR')" results in @@ -3355,6 +3356,7 @@ getcmdtype() *getcmdtype()* ? backward search command @ |input()| command - |:insert| or |:append| command + = |i_CTRL-R_=| Only works when editing the command line, thus requires use of |c_CTRL-\_e| or |c_CTRL-R_=| or an expression mapping. Returns an empty string otherwise. @@ -5098,12 +5100,12 @@ rpcnotify({channel}, {event}[, {args}...]) {Nvim} *rpcnotify()* rpcrequest({channel}, {method}[, {args}...]) {Nvim} *rpcrequest()* Sends a request to {channel} to invoke {method} via |msgpack-rpc| and blocks until a response is received. - Example: > + Example: > :let result = rpcrequest(rpc_chan, "func", 1, 2, 3) rpcstart({prog}[, {argv}]) {Nvim} *rpcstart()* - Spawns {prog} as a job(optionally passing the {argv} list), - and opens a |msgpack-rpc| channel with the spawned process + Spawns {prog} as a job (optionally passing the list {argv}), + and opens a |msgpack-rpc| channel with the spawned process's stdin/stdout. It returns: - The channel id on success, which is used by |rpcrequest()|, |rpcnotify()| and |rpcstop()| @@ -5112,10 +5114,9 @@ rpcstart({prog}[, {argv}]) {Nvim} *rpcstart()* :let rpc_chan = rpcstart('prog', ['arg1', 'arg2']) rpcstop({channel}) {Nvim} *rpcstop()* - Closes a |msgpack-rpc| channel, possibly created via - |rpcstart()| (Though it will also close channels created by - connections to |$NVIM_LISTEN_ADDRESS|). It accepts the rpc - channel id as only argument. + Closes a |msgpack-rpc| {channel}, possibly created via + |rpcstart()|. Also closes channels created by connections to + |$NVIM_LISTEN_ADDRESS|. screenattr(row, col) *screenattr()* Like screenchar(), but return the attribute. This is a rather @@ -5558,7 +5559,7 @@ setreg({regname}, {value} [,{options}]) Returns zero for success, non-zero for failure. *E883* - Note: you may not use |List| containing more then one item to + Note: you may not use |List| containing more than one item to set search and expression registers. Lists containing no items act like empty strings. @@ -5707,7 +5708,7 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702* after Strings, |Lists| after Numbers. For sorting text in the current buffer use |:sort|. - When {func} is given and it is is '1' or 'i' then case is + When {func} is given and it is '1' or 'i' then case is ignored. When {func} is given and it is 'n' then all items will be @@ -6746,7 +6747,6 @@ mouse Compiled with support mouse. mouse_dec Compiled with support for Dec terminal mouse. mouse_gpm Compiled with support for gpm (Linux console mouse) mouse_netterm Compiled with support for netterm mouse. -mouse_pterm Compiled with support for qnx pterm mouse. mouse_sysmouse Compiled with support for sysmouse (*BSD console mouse) mouse_sgr Compiled with support for sgr mouse. mouse_urxvt Compiled with support for urxvt mouse. @@ -6766,7 +6766,6 @@ printer Compiled with |:hardcopy| support. profile Compiled with |:profile| support. python Compiled with Python 2.x interface. |has-python| python3 Compiled with Python 3.x interface. |has-python| -qnx QNX version of Vim. quickfix Compiled with |quickfix| support. reltime Compiled with |reltime()| support. rightleft Compiled with 'rightleft' support. diff --git a/runtime/doc/job_control.txt b/runtime/doc/job_control.txt index f381d5ad66..000409597f 100644 --- a/runtime/doc/job_control.txt +++ b/runtime/doc/job_control.txt @@ -13,7 +13,7 @@ Nvim's facilities for job control *job-control* 1. Introduction *job-control-intro* Job control is a simple way to perform multitasking in vimscript. Wikipedia -contains a more generic/detailed description: +contains a more generic/detailed description: "Job control in computing refers to the control of multiple tasks or Jobs on a computer system, ensuring that they each have access to adequate resources to @@ -27,8 +27,8 @@ control multiple processes without blocking the current Nvim instance. Nvim's job control was designed to be simple and familiar to vimscript programmers, instead of being very powerful but complex. Unlike Vim's -facilities for calling with external commands, job control does not depend -on installed shells, calling OS functions for process management directly. +facilities for calling with external commands, job control does not depend on +available shells, instead relying on OS functionality for process management. Internally, Nvim job control is powered by libuv, which has a nice cross-platform API for managing processes. See https://github.com/libuv/libuv @@ -43,8 +43,8 @@ event. The best way to understand is with a complete example: > set nocp let job1 = jobstart('shell1', 'bash') - let job2 = jobstart('shell2', 'bash', ['-c', 'for ((i = 0; i < 10; i++)); do echo -n hello $i!; sleep 2; done']) - + let job2 = jobstart('shell2', 'bash', ['-c', 'for ((i = 0; i < 10; i++)); do echo hello $i!; sleep 1; done']) + function JobHandler() if v:job_data[1] == 'stdout' let str = 'shell '. v:job_data[0].' stdout: '.join(v:job_data[2]) @@ -53,27 +53,27 @@ event. The best way to understand is with a complete example: else let str = 'shell '.v:job_data[0].' exited' endif - + call append(line('$'), str) endfunction - + au JobActivity shell* call JobHandler() < -To test the above, copy it to the ~/jobcontrol.vim file and start with a clean +To test the above, copy it to the file ~/jobcontrol.vim and start with a clean nvim instance: - > - nvim -u NONE -S ~/jobcontrol.vim +> + nvim -u NONE -S ~/jobcontrol.vim < Here's what is happening: -- Two bash instances are spawned by |jobstart()| and their stdin/stdout/stderr - are connected to nvim. -- The first shell is idle, waiting to read commands from it's stdin -- The second shell is passed the -c option to execute a command and exit. In - our case, the command is a for loop that will print numbers and exit after - a while. -- The JobHandler function is called by the JobActivity autocommand(notice how - the shell* pattern matches the `shell1` and `shell2` names passed to +- Two bash instances are spawned by |jobstart()| with their stdin/stdout/stderr + connected to nvim. +- The first shell is idle, waiting to read commands from its stdin. +- The second shell is started with the -c argument, causing it to execute a + command then exit. In this case, the command is a for loop that will print 0 + through 9 then exit. +- The |JobHandler()| function is called by the `JobActivity` autocommand (notice + how the shell* pattern matches the names `shell1` and `shell2` passed to |jobstart()|), and it takes care of displaying stdout/stderr received from the shells. - The v:job_data is an array set by the JobActivity event. It has the @@ -86,16 +86,16 @@ Here's what is happening: To send data to the job's stdin, one can use the |jobsend()| function, like this: > - :call jobsend(job1, 'ls\n') - :call jobsend(job1, 'invalid-command\n') - :call jobsend(job1, 'exit\n') + :call jobsend(job1, "ls\n") + :call jobsend(job1, "invalid-command\n") + :call jobsend(job1, "exit\n") < A job may be killed at any time with the |jobstop()| function: > :call jobstop(job1) < -When |jobstop()| is called, it will send `SIGTERM` to the job. If a job -doesn't exit after a while, `SIGKILL` will be sent. - +When |jobstop()| is called, `SIGTERM` will be sent to the job. If a job does +not exit after 2 seconds, `SIGKILL` will be sent. + ============================================================================== vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index 0fb419e5d5..af4ef3e132 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -4,10 +4,10 @@ NVIM REFERENCE MANUAL by Thiago de Arruda -The Msgpack-RPC Interface to Nvim *msgpack-rpc* +The Msgpack-RPC Interface to Nvim *msgpack-rpc* 1. Introduction |msgpack-rpc-intro| -2. API |msgpack-rpc-api| +2. API |msgpack-rpc-api| 3. Connecting |msgpack-rpc-connecting| 4. Clients |msgpack-rpc-clients| 5. Types |msgpack-rpc-types| @@ -40,9 +40,9 @@ Nvim's msgpack-rpc interface can be seen as a more powerful version of Vim's The Nvim C API is automatically exposed to the msgpack-rpc interface by the build system, which parses headers at src/nvim/api from the project root. A -dispatch function is generated, which matches msgpack-rpc method names -with non-static API functions, converting/validating arguments and return -values back to msgpack. +dispatch function is generated, which matches msgpack-rpc method names with +non-static API functions, converting/validating arguments and return values +back to msgpack. Client libraries will normally provide wrappers that hide msgpack-rpc details from programmers, which can be automatically generated by reading bundled API @@ -60,7 +60,7 @@ There are two ways to obtain API metadata: separate compilation step. Here's a simple way to get human-readable description of the API (requires -python and the pyyaml/msgpack-python pip packages): +python and the `pyyaml`/`msgpack-python` pip packages): > nvim --api-info | python -c 'import msgpack, sys, yaml; print yaml.dump(msgpack.unpackb(sys.stdin.read()))' > api.yaml @@ -69,21 +69,19 @@ python and the pyyaml/msgpack-python pip packages): There are four ways to open msgpack-rpc streams to nvim: -1. Through nvim's stdin/stdout when started with the `--embed` option. This is +1. Through Nvim's stdin/stdout when started with the `--embed` option. This is how other programs can embed nvim. -2. Through stdin/stdout of a program spawned by the |rpcstart()| function. +2. Through the stdin/stdout of a program spawned by the |rpcstart()| function. 3. Through the socket automatically created with each instance. To find out the socket location (which is random by default) from a running nvim - instance, one can inspect the *$NVIM_LISTEN_ADDRESS* environment variable - like this: + instance, one can inspect the |$NVIM_LISTEN_ADDRESS| environment variable: > :echo $NVIM_LISTEN_ADDRESS < -4. Through a TCP/IP socket. To make nvim listen on a TCP/IP socket, you need - to set the $NVIM_LISTEN_ADDRESS environment variable before starting, like - this: +4. Through a TCP/IP socket. To make nvim listen on a TCP/IP socket, set the + |$NVIM_LISTEN_ADDRESS| environment variable in a shell before starting: > NVIM_LISTEN_ADDRESS=127.0.0.1:6666 nvim < @@ -120,34 +118,34 @@ functions can be called interactively: ============================================================================== 4. Implementing new clients *msgpack-rpc-clients* -Nvim is still alpha and there's no in-depth documentation explaining how to -properly implement a client library. The python client (neovim pip package) -will be always up-to-date with the latest API changes, so its source code is -the best documentation currently available. There are some guidelines however: +Nvim is still in alpha, so there's no in-depth documentation explaining how to +properly implement a client library yet. The python client (the pip package +"neovim") will always be up-to-date with the latest API changes, so its source +code is the best documentation currently available. There are some guidelines +however: -- Separate the transport layer from the rest of the library (see - |msgpack-rpc-connecting| for details of how a client can connect to nvim). -- Use a msgpack library that implements the spec version 5, Nvim uses the - BIN/EXT types. +- Separate the transport layer from the rest of the library. See + |msgpack-rpc-connecting| for details on how clients can connect to nvim. +- Use a MessagePack library that implements at least version 5 of the + MessagePack spec, which supports the `bin` and `ext` types used by nvim. - Read API metadata in order to create client-side wrappers for all msgpack-rpc methods. - Use a single-threaded event loop library/pattern. -- Use a fiber/coroutine library for the language you are implementing a client - for. These greatly simplify concurrency and allow the library to expose a - blocking API on top of a non-blocking event loop without the complexity - that comes with preemptive multitasking. +- Use a fiber/coroutine library for the language being used for implementing a + client. These greatly simplify concurrency and allow the library to expose a + blocking API on top of a non-blocking event loop without the complexity that + comes with preemptive multitasking. - Don't assume anything about the order that responses to msgpack-rpc requests will arrive. - Clients should expect to receive msgpack-rpc requests, which need to be handled immediately because Nvim is blocked while waiting for the client response. - Clients should expect to receive msgpack-rpc notifications, but these don't - need to be handled immediately because they won't block Nvim (though you - probably want to handle them immediately anyway). - + need to be handled immediately because they won't block Nvim (although they + should probably be handled immediately anyway). Most of the complexity could be handled by a msgpack-rpc library that supports -server->client requests and notifications, but it's not clear if this is part +server to client requests and notifications, but it's not clear if this is part of the msgpack-rpc spec. At least the ruby msgpack-rpc library does not seem to support it: https://github.com/msgpack-rpc/msgpack-rpc-ruby/blob/master/lib/msgpack/rpc/transport/tcp.rb#L150-L158 @@ -217,7 +215,7 @@ that makes this task easier: - Methods that operate instances of Nvim's types are prefixed with the type name in lower case, e.g. `buffer_get_line` represents the `get_line` method of a Buffer instance. -- Global methods are prefixed with `vim`, e.g.`vim_list_buffers`. +- Global methods are prefixed with `vim`, e.g. `vim_list_buffers`. So, for an object-oriented language, a client library would have the classes that represent Nvim's types, and the methods of each class could be defined @@ -227,13 +225,13 @@ class with methods mapped to functions prefixed with `vim_` ============================================================================== 7. Vimscript functions *msgpack-rpc-vim-functions* -Four functions related to msgpack-rpc are available to vimscript: +Four functions related to msgpack-rpc are available in vimscript: 1. |rpcstart()|: Similarly to |jobstart()|, this will spawn a co-process with its standard handles connected to Nvim. The difference is that it's not - possible to process raw data to/from the process stdin/stdout/stderr (since - the job's stdin/stdout combo are used as a msgpack channel that is - processed directly by Nvim C code). + possible to process raw data to/from the process's stdin/stdout/stderr. + This is because the job's stdin and stdout are used as a single msgpack + channel that is processed directly by Nvim. 2. |rpcstop()|: Same as |jobstop()|, but operates on handles returned by |rpcstart()|. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 6e097fc040..8152c3d3c4 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.4. Last change: 2014 Aug 09 +*options.txt* For Vim version 7.4. Last change: 2014 Sep 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -3300,7 +3300,7 @@ A jump table for the options with a short description can be found at |Q_op|. NOTE: This option is reset when 'compatible' is set. *'grepformat'* *'gfm'* -'grepformat' 'gfm' string (default "%f:%l%m,%f %l%m") +'grepformat' 'gfm' string (default "%f:%l:%m,%f:%l%m,%f %l%m") global {not in Vi} Format to recognize for the ":grep" command output. @@ -4935,9 +4935,8 @@ A jump table for the options with a short description can be found at |Q_op|. global {not in Vi} Enable the use of the mouse. Only works for certain terminals - (xterm, MS-DOS, Win32 |win32-mouse|, QNX pterm, *BSD console with - sysmouse and Linux console with gpm). For using the mouse in the - GUI, see |gui-mouse|. + (xterm, Win32 |win32-mouse|, *BSD console with sysmouse and Linux + console with gpm). For using the mouse in the GUI, see |gui-mouse|. The mouse can be enabled for different modes: n Normal mode v Visual mode @@ -7402,8 +7401,6 @@ A jump table for the options with a short description can be found at |Q_op|. rather complex sequence, starting with "<Esc>[". This is also available for an Xterm, if it was configured with "--enable-dec-locator". - *pterm-mouse* - pterm QNX pterm mouse handling. *urxvt-mouse* urxvt Mouse handling for the urxvt (rxvt-unicode) terminal. The mouse works only if the terminal supports this @@ -7601,6 +7598,7 @@ A jump table for the options with a short description can be found at |Q_op|. fold options options options and mappings local to a window or buffer (not global values for local options) + localoptions same as "options" slash backslashes in file names replaced with forward slashes unix with Unix end-of-line format (single <NL>), even when diff --git a/runtime/doc/os_win32.txt b/runtime/doc/os_win32.txt index 2c25850116..14e524e319 100644 --- a/runtime/doc/os_win32.txt +++ b/runtime/doc/os_win32.txt @@ -1,4 +1,4 @@ -*os_win32.txt* For Vim version 7.4. Last change: 2012 May 18 +*os_win32.txt* For Vim version 7.4. Last change: 2014 Aug 29 VIM REFERENCE MANUAL by George Reilly diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index f66ac170ae..322811b7cf 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1,4 +1,4 @@ -*pattern.txt* For Vim version 7.4. Last change: 2014 Jul 30 +*pattern.txt* For Vim version 7.4. Last change: 2014 Sep 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -829,6 +829,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): branch is used. Example: > /\(.\{-}\zsFab\)\{3} < Finds the third occurrence of "Fab". + This cannot be followed by a multi. *E888* {not in Vi} {not available when compiled without the |+syntax| feature} */\ze* \ze Matches at any position, and sets the end of the match there: The @@ -837,6 +838,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): branch is used. Example: "end\ze\(if\|for\)" matches the "end" in "endif" and "endfor". + This cannot be followed by a multi. |E888| {not in Vi} {not available when compiled without the |+syntax| feature} */\%^* *start-of-file* diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 35ea3ad7bc..5cd4bd5447 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 7.4. Last change: 2014 Jun 27 +*syntax.txt* For Vim version 7.4. Last change: 2014 Sep 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -501,7 +501,7 @@ inserted for that purpose if no line numbers are shown. This ID attribute takes the form of L123 for single-buffer HTML pages, or W2L123 for diff-view pages, and is used to jump to a specific line (in a specific window of a diff view). Javascript is inserted to open any closed dynamic folds -(|g:html_dynamic_folds|) containing the specificed line before jumping. The +(|g:html_dynamic_folds|) containing the specified line before jumping. The javascript also allows omitting the window ID in the url, and the leading L. For example: > @@ -2975,6 +2975,7 @@ TEX *tex.vim* *ft-tex-syntax* *latex-syntax* Tex: Taking Advantage of Conceal Mode |tex-conceal| Tex: Selective Conceal Mode |g:tex_conceal| Tex: Controlling iskeyword |g:tex_isk| + Tex: Fine Subscript and Superscript Control |tex-supersub| *tex-folding* *g:tex_fold_enabled* Tex: Want Syntax Folding? ~ @@ -3068,6 +3069,7 @@ selectively to enable just some syntax highlighting: > < As an example, let g:tex_fast= "M" will allow math-associated highlighting but suppress all the other region-based syntax highlighting. +(also see: |g:tex_conceal| and |tex-supersub|) *tex-morecommands* *tex-package* Tex: Want To Highlight More Commands? ~ @@ -3169,6 +3171,28 @@ syntax highlighting script handles this with the following logic: * If g:tex_isk exists, then it will be used for the local 'iskeyword' * Else the local 'iskeyword' will be set to 48-57,a-z,A-Z,192-255 + *tex-supersub* *g:tex_superscripts* *g:tex_subscripts* + Tex: Fine Subscript and Superscript Control~ + + See |tex-conceal| for how to enable concealed character replacement. + + See |g:tex_conceal| for selectively concealing accents, bold/italic, + math, Greek, and superscripts/subscripts. + + One may exert fine control over which superscripts and subscripts one + wants syntax-based concealment for (see |:syn-cchar|). Since not all + fonts support all characters, one may override the + concealed-replacement lists; by default these lists are given by: > + + let g:tex_superscripts= "[0-9a-zA-W.,:;+-<>/()=]" + let g:tex_subscripts= "[0-9aehijklmnoprstuvx,+-/().]" +< + For example, I use Luxi Mono Bold; it doesn't support subscript + characters for "hklmnpst", so I put > + let g:tex_subscripts= "[0-9aeijoruvx,+-/().]" +< in ~/.vim/ftplugin/tex/tex.vim in order to avoid having inscrutable + utf-8 glyphs appear. + TF *tf.vim* *ft-tf-syntax* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index e4ac9a55a9..2d5a89ce8e 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.4. Last change: 2014 Aug 23 +*todo.txt* For Vim version 7.4. Last change: 2014 Sep 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -58,30 +58,27 @@ Patch to make getregtype() return the right size for non-linux systems. (Yasuhiro Matsumoto, 2014 Jul 8) Breaks test_eval. Inefficient, can we only compute y_width when needed? -Patch to fix a problem with breakindent. (Christian Brabandt, 2014 Aug 17) -It's actually not a breakindent problem. With test: Aug 19. -With renamed test: Aug 20 - Problem that a previous silent ":throw" causes a following try/catch not to work. (ZyX, 2013 Sep 28) -ml_get error when using Python, issue 248. - -Patch to fix typos in help files. (Dominique, 2014 Aug 9) - -Way to reproduce problem that characters are put on the screen twice in Insert -mode when using system(). (Jacob Niehus, 2014 Aug 9) -Related to setting TMODE_COOK. Perhaps we can omit that for system()? - Update for Romanian spell file. (Vanilla Ice, 2014 Aug 13) +Still produces errors. +Add flag to ignore fifth argument of SFX. +Conversion from utf-8 to cp1250 can't be without errors. Patch to remove ETO_IGNORELANGUAGE, it causes Chinese characters not to show up. (Paul Moore, 2014 Jul 30) Should it depend on the Windows version? Waiting for feedback. No longer needed after including DirectX patch? +Related to issue 255? + +Problem with linebreak, adds a test that fails. (Nazri Ramliy, 2014 Sep 6) + +Patch to avoid problems with encoding conversion with diff.vim. +(Yasuhiro Matsumoto, 2014 Sep 1. Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug -14) +14, Aug 30) Make ":1close" close the first window. Make ":+1close" close the next window. Make ":-1close" close the previous window. @@ -89,9 +86,16 @@ Can't easily close the help window, like ":pc" closes the preview window and ":ccl" closes the quickfix window. Add ":hclose". (Chris Gaal) Patch for :helpclose, Christian Brabandt, 2010 Sep 6. +Patch to fix line formatting bug. (Christian Brabandt, 2014 Sep 7) + +Patch to fix ml_get error. (Christian Brabandt, 2014 Sep 7) + Patch by Marcin Szamotulski to add +cmd to buffer commands. (2014 Aug 18) +Patch to fix encoding of arguments when setting 'encoding'. (Yasuhiro +Matsumoto, 2014 Sep 4) + Patch to fix that system() with empty input fails. (Olaf Dabrunz, 2014 Aug 19) When using a visual selection of multiple words and doing CTRL-W_] it jumps to @@ -104,6 +108,8 @@ Completion for :buf does not use 'wildignorecase'. (Akshay H, 2014 May 31) Patch to handle list with some items locked. (ZyX, 2014 Aug 17) Prefer the second solution. +Issue 252. Patch by Christian, 2014 Aug 26. + ":cd C:\Windows\System32\drivers\etc*" does not work, even though the directory exists. (Sergio Gallelli, 2013 Dec 29) @@ -118,13 +124,16 @@ Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15) Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) Value returned by virtcol() changes depending on how lines wrap. This is -inconsistant with the documentation. +inconsistent with the documentation. MS-Windows: Crash opening very long file name starting with "\\". (Christian Brock, 2012 Jun 29) Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21) +Patch to allow for a different icon on MS-Windows. (Yasuhiro Matsumoto, 2014 +Sep 7). + Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19) "hi link" does not respect groups with GUI settings only. (Mark Lodato, 2014 @@ -141,20 +150,18 @@ Spell files use a latin single quote. Unicode also has another single quote: New OpenOffice spell files support this with ICONV. But they are not compatible with Vim spell files. The old files can no longer be downloaded. -Win32: use different args for SearchPath()? (Yasuhiro Matsumoto, 2009 Jan 30) -Also fixes wrong result from executable(). -Update from Ken Takata, 2014 Jan 10. Newer 2014 Apr 3. - Win32: patch to use 64 bit stat() if possible. (Ken Takata, 2014 May 12) More tests May 14. Update May 29. Update Aug 10. The garbage collector may use too much stack. Make set_ref_in_item() iterative instead of recursive. Test program by Marc Weber (2013 Dec 10) Patch by Ben Fritz, 2014 Jun 22. +Related: Vim hangs when freeing a lot of objects. Patch by Yasuhiro +Matsumoto, 2014 Aug 26. Idea: For a window in the middle (has window above and below it), use right-mouse-drag on the status line to move a window up/down without changing -it's height? It's like dragging the status bar above it at the same time. +its height? It's like dragging the status bar above it at the same time. Can we make ":unlet $VAR" use unsetenv() to delete the env var? What for systems that don't have unsetenv()? @@ -236,7 +243,7 @@ Or should we add a more general mechanism, like lambda functions? Patch for XDG base directory support. (Jean François Bignolles, 2014 Mar 4) Remark on the docs. Should not be a compile time feature. But then what? -Completion of ":e" is ":earlier", whould be ":edit". Complete to the matching +Completion of ":e" is ":earlier", should be ":edit". Complete to the matching command instead of doing this alphabetically. (Mikel Jorgensen) Patch to add v:completed_item. (Shougo Matsu, 2013 Nov 29). @@ -262,9 +269,6 @@ possible. (Christian Brabandt, 2014 Mar 12, update Aug 22) Updated spec ftplugin. (Matěj Cepl, 2013 Oct 16) -Some quickfix messages appear twice. (Gary Johnson, 2014 Feb 16) -Patch by Christian Brabandt, 2014 Feb 17. - Patch to right-align signs. (James Kolb (email james), 2013 Sep 23) Patch to handle integer overflow. (Aaron Burrow, 2013 Dec 12) @@ -1437,8 +1441,8 @@ files with "foo/**" in 'path'. (Kalisiak, 2006 July 15) Additional info: When using the |wildcards| ** globing, vim hangs indefinitely on lots of directories. The |file-searching| globing, like in ":set path=/**" does not hang as often as with globing with |wildcards|, like -in ":1find /**/file". This is for a files that unix "find" can find very -quick. Merging the 2 kinds of globing might make this an easier fix. (Ian +in ":1find /**/file". This is for files that unix "find" can find very +quickly. Merging the 2 kinds of globing might make this an easier fix. (Ian Kelling, 2008 July 4) When the file name has parenthesis, e.g., "foo (bar).txt", ":!ls '%'" has the @@ -1886,6 +1890,10 @@ restored. (Luc St-Louis) Patch to support horizontal scroll wheel in GTK. Untested. (Bjorn Winckler, 2010 Jun 30) +Add an option for a minimal text length before inserting a line break for +'textwidth'. Avoids very short lines when a very long word follows. +(Kartik Agaram) + At next release: - Build a huge version by default. diff --git a/runtime/doc/usr_04.txt b/runtime/doc/usr_04.txt index c09cb204c5..5f24c8c6f5 100644 --- a/runtime/doc/usr_04.txt +++ b/runtime/doc/usr_04.txt @@ -1,4 +1,4 @@ -*usr_04.txt* For Vim version 7.4. Last change: 2008 Sep 06 +*usr_04.txt* For Vim version 7.4. Last change: 2014 Aug 29 VIM USER MANUAL - by Bram Moolenaar @@ -186,7 +186,7 @@ commands: /four<Enter> find the first string "four" cwfive<Esc> change the word to "five" n find the next "four" - . repeat the change to "five' + . repeat the change to "five" n find the next "four" . repeat the change etc. diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 40ccee960d..3fc109ac0d 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2014 Aug 23 +" Last Change: 2014 Sep 05 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -526,6 +526,9 @@ au BufNewFile,BufRead configure.in,configure.ac setf config " CUDA Cumpute Unified Device Architecture au BufNewFile,BufRead *.cu setf cuda +" Dockerfile +au BufNewFile,BufRead Dockerfile setf dockerfile + " WildPackets EtherPeek Decoder au BufNewFile,BufRead *.dcd setf dcd @@ -1097,6 +1100,9 @@ au BufNewFile,BufRead *.lou,*.lout setf lout " Lua au BufNewFile,BufRead *.lua setf lua +" Luarocks +au BufNewFile,BufRead *.rockspec setf lua + " Linden Scripting Language (Second Life) au BufNewFile,BufRead *.lsl setf lsl diff --git a/runtime/ftplugin/dockerfile.vim b/runtime/ftplugin/dockerfile.vim new file mode 100644 index 0000000000..2e3c447b59 --- /dev/null +++ b/runtime/ftplugin/dockerfile.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin +" Language: Dockerfile +" Maintainer: Honza Pokorny <http://honza.ca> +" Last Change: 2014 Aug 29 + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif + +" Don't load another plugin for this buffer +let b:did_ftplugin = 1 + +let b:undo_ftplugin = "setl commentstring<" + +setlocal commentstring=#\ %s diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index edba37b896..f355d2837d 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Vim " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2013 Jun 26 +" Last Change: 2014 Sep 07 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -62,9 +62,12 @@ if exists("loaded_matchit") \ '\<try\>:\<cat\%[ch]\>:\<fina\%[lly]\>:\<endt\%[ry]\>,' . \ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' . \ '(:)' - " Ignore ":syntax region" commands, the 'end' argument clobbers if-endif - let b:match_skip = 'getline(".") =~ "^\\s*sy\\%[ntax]\\s\\+region" || - \ synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string"' + " Ignore syntax region commands and settings, any 'en*' would clobber + " if-endif. + " - set spl=de,en + " - au! FileType javascript syntax region foldBraces start=/{/ end=/}/ … + let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name") + \ =~? "comment\\|string\\|vimSynReg\\|vimSet"' endif let &cpo = s:cpo_save diff --git a/runtime/indent/json.vim b/runtime/indent/json.vim index d50112b934..649f2b8aa5 100644 --- a/runtime/indent/json.vim +++ b/runtime/indent/json.vim @@ -1,13 +1,168 @@ " Vim indent file " Language: JSON -" Maintainer: David Barnett <daviebdawg+vim@gmail.com> -" Last Change: 2014 Jul 16 +" Mantainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json +" Last Change: 2014 Aug 29 +" https://github.com/jakar/vim-json/commit/20b650e22aa750c4ab6a66aa646bdd95d7cd548a#diff-e81fc111b2052e306d126bd9989f7b7c +" Original Author: Rogerz Zhang <rogerz.zhang at gmail.com> http://github.com/rogerz/vim-json +" Acknowledgement: Based off of vim-javascript maintained by Darrick Wiebe +" http://www.vim.org/scripts/script.php?script_id=2765 -if exists('b:did_indent') - finish +" 0. Initialization {{{1 +" ================= + +" Only load this indent file when no other was loaded. +if exists("b:did_indent") + finish endif +let b:did_indent = 1 -" JSON is a subset of JavaScript. JavaScript indenting should work fine. -runtime! indent/javascript.vim +setlocal nosmartindent -let b:did_indent = 1 +" Now, set up our indentation expression and keys that trigger it. +setlocal indentexpr=GetJSONIndent() +setlocal indentkeys=0{,0},0),0[,0],!^F,o,O,e + +" Only define the function once. +if exists("*GetJSONIndent") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +" 1. Variables {{{1 +" ============ + +let s:line_term = '\s*\%(\%(\/\/\).*\)\=$' +" Regex that defines blocks. +let s:block_regex = '\%({\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term + +" 2. Auxiliary Functions {{{1 +" ====================== + +" Check if the character at lnum:col is inside a string. +function s:IsInString(lnum, col) + return synIDattr(synID(a:lnum, a:col, 1), 'name') == 'jsonString' +endfunction + +" Find line above 'lnum' that isn't empty, or in a string. +function s:PrevNonBlankNonString(lnum) + let lnum = prevnonblank(a:lnum) + while lnum > 0 + " If the line isn't empty or in a string, end search. + let line = getline(lnum) + if !(s:IsInString(lnum, 1) && s:IsInString(lnum, strlen(line))) + break + endif + let lnum = prevnonblank(lnum - 1) + endwhile + return lnum +endfunction + +" Check if line 'lnum' has more opening brackets than closing ones. +function s:LineHasOpeningBrackets(lnum) + let open_0 = 0 + let open_2 = 0 + let open_4 = 0 + let line = getline(a:lnum) + let pos = match(line, '[][(){}]', 0) + while pos != -1 + let idx = stridx('(){}[]', line[pos]) + if idx % 2 == 0 + let open_{idx} = open_{idx} + 1 + else + let open_{idx - 1} = open_{idx - 1} - 1 + endif + let pos = match(line, '[][(){}]', pos + 1) + endwhile + return (open_0 > 0) . (open_2 > 0) . (open_4 > 0) +endfunction + +function s:Match(lnum, regex) + let col = match(getline(a:lnum), a:regex) + 1 + return col > 0 && !s:IsInString(a:lnum, col) ? col : 0 +endfunction + +" 3. GetJSONIndent Function {{{1 +" ========================= + +function GetJSONIndent() + " 3.1. Setup {{{2 + " ---------- + + " Set up variables for restoring position in file. Could use v:lnum here. + let vcol = col('.') + + " 3.2. Work on the current line {{{2 + " ----------------------------- + + " Get the current line. + let line = getline(v:lnum) + let ind = -1 + + " If we got a closing bracket on an empty line, find its match and indent + " according to it. + let col = matchend(line, '^\s*[]}]') + + if col > 0 && !s:IsInString(v:lnum, col) + call cursor(v:lnum, col) + let bs = strpart('{}[]', stridx('}]', line[col - 1]) * 2, 2) + + let pairstart = escape(bs[0], '[') + let pairend = escape(bs[1], ']') + let pairline = searchpair(pairstart, '', pairend, 'bW') + + if pairline > 0 + let ind = indent(pairline) + else + let ind = virtcol('.') - 1 + endif + + return ind + endif + + " If we are in a multi-line string, don't do anything to it. + if s:IsInString(v:lnum, matchend(line, '^\s*') + 1) + return indent('.') + endif + + " 3.3. Work on the previous line. {{{2 + " ------------------------------- + + let lnum = prevnonblank(v:lnum - 1) + + if lnum == 0 + return 0 + endif + + " Set up variables for current line. + let line = getline(lnum) + let ind = indent(lnum) + + " If the previous line ended with a block opening, add a level of indent. + " if s:Match(lnum, s:block_regex) + " return indent(lnum) + &sw + " endif + + " If the previous line contained an opening bracket, and we are still in it, + " add indent depending on the bracket type. + if line =~ '[[({]' + let counts = s:LineHasOpeningBrackets(lnum) + if counts[0] == '1' || counts[1] == '1' || counts[2] == '1' + return ind + &sw + else + call cursor(v:lnum, vcol) + end + endif + + " }}}2 + + return ind +endfunction + +" }}}1 + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim:set sw=2 sts=2 ts=8 noet: diff --git a/runtime/scripts.vim b/runtime/scripts.vim index 93206b8e6e..b62b0a5db8 100644 --- a/runtime/scripts.vim +++ b/runtime/scripts.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types in scripts " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last change: 2013 May 24 +" Last change: 2014 Aug 24 " This file is called by an autocommand for every file that has just been " loaded into a buffer. It checks if the type of file can be recognized by @@ -314,6 +314,10 @@ else elseif s:line1 =~ '^==\d\+== valgrind' || s:line3 =~ '^==\d\+== Using valgrind' set ft=valgrind + " Go docs + elseif s:line1 =~ '^PACKAGE DOCUMENTATION$' + set ft=godoc + " Renderman Interface Bytestream elseif s:line1 =~ '^##RenderMan' set ft=rib diff --git a/runtime/syntax/asciidoc.vim b/runtime/syntax/asciidoc.vim index 1303db7cf2..ccb079e06b 100644 --- a/runtime/syntax/asciidoc.vim +++ b/runtime/syntax/asciidoc.vim @@ -5,6 +5,7 @@ " URL: http://asciidoc.org/ " Licence: GPL (http://www.gnu.org) " Remarks: Vim 6 or greater +" Last Update: 2014 Aug 29 (see Issue 240) " Limitations: " " - Nested quoted text formatting is highlighted according to the outer @@ -155,7 +156,8 @@ hi def link asciidocQuotedAttributeList Special hi def link asciidocQuotedBold Special hi def link asciidocQuotedDoubleQuoted Label hi def link asciidocQuotedEmphasized2 Type -hi def link asciidocQuotedEmphasized Type +hi asciidocQuotedEmphasizedItalic term=italic cterm=italic gui=italic +hi def link asciidocQuotedEmphasized asciidocQuotedEmphasizedItalic hi def link asciidocQuotedMonospaced2 Identifier hi def link asciidocQuotedMonospaced Identifier hi def link asciidocQuotedSingleQuoted Label diff --git a/runtime/syntax/dockerfile.vim b/runtime/syntax/dockerfile.vim new file mode 100644 index 0000000000..d1693cba41 --- /dev/null +++ b/runtime/syntax/dockerfile.vim @@ -0,0 +1,24 @@ +" dockerfile.vim - Syntax highlighting for Dockerfiles +" Maintainer: Honza Pokorny <http://honza.ca> +" Version: 0.5 +" Last Change: 2014 Aug 29 +" License: BSD + + +if exists("b:current_syntax") + finish +endif + +let b:current_syntax = "dockerfile" + +syntax case ignore + +syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|CMD|ENTRYPOINT|ENV|EXPOSE|FROM|MAINTAINER|RUN|USER|VOLUME|WORKDIR|COPY)\s/ + +syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/ + +syntax match dockerfileComment "\v^\s*#.*$" + +hi def link dockerfileString String +hi def link dockerfileKeyword Keyword +hi def link dockerfileComment Comment diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim index 31114bc093..3f719e8244 100644 --- a/runtime/syntax/tex.vim +++ b/runtime/syntax/tex.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: TeX " Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM> -" Last Change: Mar 20, 2014 -" Version: 81 +" Last Change: Sep 09, 2014 +" Version: 82 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX " " Notes: {{{1 @@ -88,6 +88,12 @@ if !exists("g:tex_conceal") else let s:tex_conceal= g:tex_conceal endif +if !exists("g:tex_superscripts") + let g:tex_superscripts= "[0-9a-zA-W.,:;+-<>/()=]" +endif +if !exists("g:tex_subscripts") + let g:tex_subscripts= "[0-9aehijklmnoprstuvx,+-/().]" +endif " Determine whether or not to use "*.sty" mode {{{1 " The user may override the normal determination by setting @@ -331,22 +337,22 @@ syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)" contained if s:tex_fast =~ 'p' if !exists("g:tex_nospell") || !g:tex_nospell if g:tex_fold_enabled && has("folding") - syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup,@Spell + syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup,@Spell syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texPartGroup,@Spell syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texChapterGroup,@Spell syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSectionGroup,@Spell - syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup,@Spell + syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup,@Spell syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSubSectionGroup,@Spell syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texParaGroup,@Spell syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@Spell syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' fold contains=@texFoldGroup,@Spell syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' fold contains=@texFoldGroup,@Spell else - syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup,@Spell + syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup,@Spell syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup,@Spell syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup,@Spell syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup,@Spell - syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup,@Spell + syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup,@Spell syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup,@Spell syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup,@Spell syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@Spell @@ -355,22 +361,22 @@ if s:tex_fast =~ 'p' endif else if g:tex_fold_enabled && has("folding") - syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup + syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texPartGroup syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texChapterGroup syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSectionGroup - syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup + syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSubSectionGroup syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texParaGroup syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' fold contains=@texFoldGroup syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' fold contains=@texFoldGroup else - syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup + syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup - syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup + syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup @@ -620,7 +626,7 @@ if s:tex_fast =~ 'r' syn region texRefZone matchgroup=texStatement start="\\\(page\|eq\)ref{" end="}\|%stopzone\>" contains=@texRefGroup syn region texRefZone matchgroup=texStatement start="\\v\=ref{" end="}\|%stopzone\>" contains=@texRefGroup syn region texRefOption contained matchgroup=Delimiter start='\[' end=']' contains=@texRefGroup,texRefZone nextgroup=texRefOption,texCite - syn region texCite contained matchgroup=Delimiter start='{' end='}' contains=@texRefGroup,texRefZone,texCite + syn region texCite contained matchgroup=Delimiter start='{' end='}' contains=@texRefGroup,texRefZone,texCite endif syn match texRefZone '\\cite\%([tp]\*\=\)\=' nextgroup=texRefOption,texCite @@ -1045,8 +1051,11 @@ if has("conceal") && &enc == 'utf-8' syn region texSubscript matchgroup=Delimiter start='_{' skip="\\\\\|\\[{}]" end='}' contained concealends contains=texSpecialChar,texSubscripts,texStatement,texSubscript,texSuperscript,texMathMatcher endif fun! s:SuperSub(group,leader,pat,cchar) - exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar - exe 'syn match '.a:group."s '".a:pat."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s' + if a:pat =~ '^\\' || (a:leader == '\^' && a:pat =~ g:tex_superscripts) || (a:leader == '_' && a:pat =~ g:tex_subscripts) +" call Decho("SuperSub: group<".a:group."> leader<".a:leader."> pat<".a:pat."> cchar<".a:cchar.">") + exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar + exe 'syn match '.a:group."s '".a:pat."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s' + endif endfun call s:SuperSub('texSuperscript','\^','0','⁰') call s:SuperSub('texSuperscript','\^','1','¹') @@ -1170,44 +1179,44 @@ if has("conceal") && &enc == 'utf-8' let i= i + 1 endfor endfun - " \` \' \^ \" \~ \. \= \c \H \k \r \u \v - call s:Accents('a','à','á','â','ä','ã','ȧ','ā',' ',' ','ą','å','ă','ǎ') - call s:Accents('A','À','Á','Â','Ä','Ã','Ȧ','Ā',' ',' ','Ą','Å','Ă','Ǎ') - call s:Accents('c',' ','ć','ĉ',' ',' ','ċ',' ','ç',' ',' ',' ',' ','č') - call s:Accents('C',' ','Ć','Ĉ',' ',' ','Ċ',' ','Ç',' ',' ',' ',' ','Č') - call s:Accents('d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ď') - call s:Accents('D',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ď') - call s:Accents('e','è','é','ê','ë','ẽ','ė','ē','ȩ',' ','ę',' ','ĕ','ě') - call s:Accents('E','È','É','Ê','Ë','Ẽ','Ė','Ē','Ȩ',' ','Ę',' ','Ĕ','Ě') - call s:Accents('g',' ','ǵ','ĝ',' ',' ','ġ',' ','ģ',' ',' ',' ','ğ','ǧ') - call s:Accents('G',' ','Ǵ','Ĝ',' ',' ','Ġ',' ','Ģ',' ',' ',' ','Ğ','Ǧ') - call s:Accents('h',' ',' ','ĥ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ȟ') - call s:Accents('H',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ȟ') - call s:Accents('i','ì','í','î','ï','ĩ','į','ī',' ',' ','į',' ','ĭ','ǐ') - call s:Accents('I','Ì','Í','Î','Ï','Ĩ','İ','Ī',' ',' ','Į',' ','Ĭ','Ǐ') - call s:Accents('J',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ǰ') - call s:Accents('k',' ',' ',' ',' ',' ',' ',' ','ķ',' ',' ',' ',' ','ǩ') - call s:Accents('K',' ',' ',' ',' ',' ',' ',' ','Ķ',' ',' ',' ',' ','Ǩ') - call s:Accents('l',' ','ĺ','ľ',' ',' ',' ',' ','ļ',' ',' ',' ',' ','ľ') - call s:Accents('L',' ','Ĺ','Ľ',' ',' ',' ',' ','Ļ',' ',' ',' ',' ','Ľ') - call s:Accents('n',' ','ń',' ',' ','ñ',' ',' ','ņ',' ',' ',' ',' ','ň') - call s:Accents('N',' ','Ń',' ',' ','Ñ',' ',' ','Ņ',' ',' ',' ',' ','Ň') - call s:Accents('o','ò','ó','ô','ö','õ','ȯ','ō',' ','ő','ǫ',' ','ŏ','ǒ') - call s:Accents('O','Ò','Ó','Ô','Ö','Õ','Ȯ','Ō',' ','Ő','Ǫ',' ','Ŏ','Ǒ') - call s:Accents('r',' ','ŕ',' ',' ',' ',' ',' ','ŗ',' ',' ',' ',' ','ř') - call s:Accents('R',' ','Ŕ',' ',' ',' ',' ',' ','Ŗ',' ',' ',' ',' ','Ř') - call s:Accents('s',' ','ś','ŝ',' ',' ',' ',' ','ş',' ','ȿ',' ',' ','š') - call s:Accents('S',' ','Ś','Ŝ',' ',' ',' ',' ','Ş',' ',' ',' ',' ','Š') - call s:Accents('t',' ',' ',' ',' ',' ',' ',' ','ţ',' ',' ',' ',' ','ť') - call s:Accents('T',' ',' ',' ',' ',' ',' ',' ','Ţ',' ',' ',' ',' ','Ť') - call s:Accents('u','ù','ú','û','ü','ũ',' ','ū',' ','ű','ų','ů','ŭ','ǔ') - call s:Accents('U','Ù','Ú','Û','Ü','Ũ',' ','Ū',' ','Ű','Ų','Ů','Ŭ','Ǔ') - call s:Accents('w',' ',' ','ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ') - call s:Accents('W',' ',' ','Ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ') - call s:Accents('y','ỳ','ý','ŷ','ÿ','ỹ',' ',' ',' ',' ',' ',' ',' ',' ') - call s:Accents('Y','Ỳ','Ý','Ŷ','Ÿ','Ỹ',' ',' ',' ',' ',' ',' ',' ',' ') - call s:Accents('z',' ','ź',' ',' ',' ','ż',' ',' ',' ',' ',' ',' ','ž') - call s:Accents('Z',' ','Ź',' ',' ',' ','Ż',' ',' ',' ',' ',' ',' ','Ž') + " \` \' \^ \" \~ \. \= \c \H \k \r \u \v + call s:Accents('a','à','á','â','ä','ã','ȧ','ā',' ',' ','ą','å','ă','ǎ') + call s:Accents('A','À','Á','Â','Ä','Ã','Ȧ','Ā',' ',' ','Ą','Å','Ă','Ǎ') + call s:Accents('c',' ','ć','ĉ',' ',' ','ċ',' ','ç',' ',' ',' ',' ','č') + call s:Accents('C',' ','Ć','Ĉ',' ',' ','Ċ',' ','Ç',' ',' ',' ',' ','Č') + call s:Accents('d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ď') + call s:Accents('D',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ď') + call s:Accents('e','è','é','ê','ë','ẽ','ė','ē','ȩ',' ','ę',' ','ĕ','ě') + call s:Accents('E','È','É','Ê','Ë','Ẽ','Ė','Ē','Ȩ',' ','Ę',' ','Ĕ','Ě') + call s:Accents('g',' ','ǵ','ĝ',' ',' ','ġ',' ','ģ',' ',' ',' ','ğ','ǧ') + call s:Accents('G',' ','Ǵ','Ĝ',' ',' ','Ġ',' ','Ģ',' ',' ',' ','Ğ','Ǧ') + call s:Accents('h',' ',' ','ĥ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ȟ') + call s:Accents('H',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ȟ') + call s:Accents('i','ì','í','î','ï','ĩ','į','ī',' ',' ','į',' ','ĭ','ǐ') + call s:Accents('I','Ì','Í','Î','Ï','Ĩ','İ','Ī',' ',' ','Į',' ','Ĭ','Ǐ') + call s:Accents('J',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ǰ') + call s:Accents('k',' ',' ',' ',' ',' ',' ',' ','ķ',' ',' ',' ',' ','ǩ') + call s:Accents('K',' ',' ',' ',' ',' ',' ',' ','Ķ',' ',' ',' ',' ','Ǩ') + call s:Accents('l',' ','ĺ','ľ',' ',' ',' ',' ','ļ',' ',' ',' ',' ','ľ') + call s:Accents('L',' ','Ĺ','Ľ',' ',' ',' ',' ','Ļ',' ',' ',' ',' ','Ľ') + call s:Accents('n',' ','ń',' ',' ','ñ',' ',' ','ņ',' ',' ',' ',' ','ň') + call s:Accents('N',' ','Ń',' ',' ','Ñ',' ',' ','Ņ',' ',' ',' ',' ','Ň') + call s:Accents('o','ò','ó','ô','ö','õ','ȯ','ō',' ','ő','ǫ',' ','ŏ','ǒ') + call s:Accents('O','Ò','Ó','Ô','Ö','Õ','Ȯ','Ō',' ','Ő','Ǫ',' ','Ŏ','Ǒ') + call s:Accents('r',' ','ŕ',' ',' ',' ',' ',' ','ŗ',' ',' ',' ',' ','ř') + call s:Accents('R',' ','Ŕ',' ',' ',' ',' ',' ','Ŗ',' ',' ',' ',' ','Ř') + call s:Accents('s',' ','ś','ŝ',' ',' ',' ',' ','ş',' ','ȿ',' ',' ','š') + call s:Accents('S',' ','Ś','Ŝ',' ',' ',' ',' ','Ş',' ',' ',' ',' ','Š') + call s:Accents('t',' ',' ',' ',' ',' ',' ',' ','ţ',' ',' ',' ',' ','ť') + call s:Accents('T',' ',' ',' ',' ',' ',' ',' ','Ţ',' ',' ',' ',' ','Ť') + call s:Accents('u','ù','ú','û','ü','ũ',' ','ū',' ','ű','ų','ů','ŭ','ǔ') + call s:Accents('U','Ù','Ú','Û','Ü','Ũ',' ','Ū',' ','Ű','Ų','Ů','Ŭ','Ǔ') + call s:Accents('w',' ',' ','ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ') + call s:Accents('W',' ',' ','Ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ') + call s:Accents('y','ỳ','ý','ŷ','ÿ','ỹ',' ',' ',' ',' ',' ',' ',' ',' ') + call s:Accents('Y','Ỳ','Ý','Ŷ','Ÿ','Ỹ',' ',' ',' ',' ',' ',' ',' ',' ') + call s:Accents('z',' ','ź',' ',' ',' ','ż',' ',' ',' ',' ',' ',' ','ž') + call s:Accents('Z',' ','Ź',' ',' ',' ','Ż',' ',' ',' ',' ',' ',' ','Ž') call s:Accents('\\i','ì','í','î','ï','ĩ','į',' ',' ',' ',' ',' ','ĭ',' ') " \` \' \^ \" \~ \. \= \c \H \k \r \u \v delfun s:Accents @@ -1252,7 +1261,7 @@ endif if did_tex_syntax_inits == 1 let did_tex_syntax_inits= 2 " TeX highlighting groups which should share similar highlighting - if !exists("s:tex_no_error") + if !exists("g:tex_no_error") if !exists("g:tex_no_math") HiLink texBadMath texError HiLink texMathDelimBad texError |