aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MAINTAIN.md48
-rw-r--r--man/nvim.1123
-rw-r--r--runtime/doc/api.txt27
-rw-r--r--runtime/doc/channel.txt18
-rw-r--r--runtime/doc/develop.txt63
-rw-r--r--runtime/doc/eval.txt59
-rw-r--r--runtime/doc/filetype.txt4
-rw-r--r--runtime/doc/gui.txt236
-rw-r--r--runtime/doc/if_pyth.txt2
-rw-r--r--runtime/doc/insert.txt3
-rw-r--r--runtime/doc/job_control.txt10
-rw-r--r--runtime/doc/nvim.txt27
-rw-r--r--runtime/doc/options.txt80
-rw-r--r--runtime/doc/provider.txt83
-rw-r--r--runtime/doc/starting.txt42
-rw-r--r--runtime/doc/term.txt94
-rw-r--r--runtime/doc/vim_diff.txt27
-rw-r--r--runtime/filetype.vim4
-rw-r--r--runtime/ftplugin/python.vim14
-rw-r--r--runtime/ftplugin/vim.vim5
-rw-r--r--runtime/ftplugin/zsh.vim6
-rw-r--r--runtime/syntax/cf.vim1445
-rw-r--r--runtime/syntax/debcontrol.vim79
-rw-r--r--runtime/syntax/debsources.vim10
-rw-r--r--runtime/syntax/forth.vim142
-rw-r--r--runtime/syntax/fstab.vim20
-rw-r--r--runtime/syntax/haskell.vim20
-rw-r--r--runtime/syntax/zsh.vim6
-rw-r--r--runtime/tutor/en/vim-01-beginner.tutor6
-rw-r--r--src/nvim/README.md34
-rw-r--r--src/nvim/event/loop.c1
-rw-r--r--src/nvim/testdir/test_getcwd.vim9
-rw-r--r--test/README.md4
33 files changed, 1580 insertions, 1171 deletions
diff --git a/MAINTAIN.md b/MAINTAIN.md
new file mode 100644
index 0000000000..ed0df76e36
--- /dev/null
+++ b/MAINTAIN.md
@@ -0,0 +1,48 @@
+Maintaining the Neovim project
+==============================
+
+Notes on maintaining the Neovim project.
+
+See also: https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
+
+Ticket Triage
+-------------
+
+In practice we haven't found a meaningful way to forecast more precisely than
+"next" and "after next". That means there are usually one or two (at most)
+planned milestones:
+
+- Next bugfix-release (1.0.x)
+- Next feature-release (1.x.0)
+
+The forecasting problem might be solved with an explicit priority system (like
+Bram's todo.txt). Meanwhile the Neovim priority system is defined by:
+
+- PRs nearing completion (RDY).
+- Issue labels. E.g. the +plan label increases the ticket's priority merely for
+ having a plan written down: it is _closer to completion_ than tickets without
+ a plan.
+- Comment activity or new information.
+
+Anything that isn't in the next milestone, and doesn't have a RDY PR ... is
+just not something you care very much about, by construction. Post-release you
+can review open issues, but chances are your next milestone is already getting
+full :)
+
+Release Policy
+--------------
+
+The goal is "early and often".
+
+Up to now we use only one branch, the `master` branch.
+
+- If `master` is unstable we don't release.
+- If the last release has a major bug, we:
+ 1. Fix the bug on `master`.
+ 2. Disable or remove any known risks present on `master`.
+ 3. Cut a release from `master`.
+
+This is a bit silly, but it works ok. And it keeps `master` from biting off
+more feature-creep than it can chew.
+
+See also: https://github.com/neovim/neovim/issues/862
diff --git a/man/nvim.1 b/man/nvim.1
index 0040af2865..cfaa3ef3aa 100644
--- a/man/nvim.1
+++ b/man/nvim.1
@@ -20,14 +20,17 @@
.Sh DESCRIPTION
.Nm
is a text editor based on Vim.
-To enter commands in
-.Nm ,
-type a colon
-.Pq Sq \&:
-which is also used in this manual to denote commands.
-For more information, consult the online help with the
-.Ic :help
-command.
+Commands in this program start with colon
+.Pq Sq \&: .
+Use the :help command to get help, for example ":help quickref"
+is a condensed overview of almost all commands.
+.Pp
+If you are new to Vim/Nvim, start with the 30-minute tutorial:
+.Dl :Tutor
+.Pp
+After installing/updating Nvim, it's a good idea to run the self-check:
+.Dl :checkhealth
+.Pp
.Bl -tag -width Fl
.It Ar file ...
File(s) to edit.
@@ -42,7 +45,7 @@ commands.
Read text from standard input until
.Dv EOF ,
then open a buffer with that text.
-Commands are read from standard error, which should be a terminal.
+User input is read from standard error, which should be a terminal.
.It Fl t Ar tag
The file to edit and the initial cursor position depends on a
tag, a sort of goto label.
@@ -53,8 +56,7 @@ If
.Ar tag
is a function name, the file containing that function is opened
with the cursor positioned at the start of the function.
-See
-.Ic ":help tag-commands" .
+.Ic ":help tag-commands"
.It Fl q Op Ar errorfile
QuickFix mode.
Display the first error in
@@ -66,31 +68,29 @@ is omitted, the value of the 'errorfile' option is used (defaults to
Further errors can be jumped to with the
.Ic :cnext
command.
-See
-.Ic ":help quickfix" .
+.Ic ":help quickfix"
.It There are a number of other options:
.It Fl -
-Interpret all further arguments as files.
-Can be used to edit files starting with a hyphen
+End of options.
+Remaining arguments are treated as literal file names, including filenames starting with hyphen
.Pq Sq - .
.It Fl e
-Ex mode. Reads stdin as Ex commands.
-See
-.Ic ":help Ex-mode" .
+Ex mode, reading stdin as Ex commands.
+.Ic ":help Ex-mode"
.It Fl E
-Ex mode. Reads stdin as text.
-See
-.Ic :help gQ .
+Ex mode, reading stdin as text.
+.Ic :help Ex-mode
.It Fl es
-Silent (batch) mode. Reads stdin as Ex commands.
+Silent/batch mode, reading stdin as Ex commands.
+.Ic :help silent-mode
.It Fl \&Es
-Silent (batch) mode. Reads stdin as text.
+Silent/batch mode, reading stdin as text.
+.Ic :help silent-mode
.It Fl d
Diff mode.
Show the difference between two to four files, similar to
.Xr sdiff 1 .
-See
-.Ic ":help diff" .
+.Ic ":help diff"
.It Fl R
Read-only mode.
Sets the 'readonly' option.
@@ -100,8 +100,7 @@ Buffers can still be edited, but cannot be written to disk if already
associated with a file.
To overwrite a file, add an exclamation mark to the relevant Ex command, such as
.Ic :w! .
-See
-.Ic ":help 'readonly'" .
+.Ic ":help 'readonly'"
.It Fl Z
Restricted mode.
Disable commands that make use of an external shell.
@@ -113,8 +112,7 @@ Resets the 'write' and 'modifiable' options, to disable file and buffer
modifications.
.It Fl b
Binary mode.
-See
-.Ic ":help edit-binary" .
+.Ic ":help edit-binary"
.It Fl l
Lisp mode.
Sets the 'lisp' and 'showmatch' options.
@@ -126,19 +124,20 @@ Hebrew mode.
Sets the 'hkmap' and 'rightleft' options.
.It Fl V Ns Oo Ar N Oc Ns Op Ar file
Verbose mode.
-Print messages about which files are being sourced and for reading and
-writing a ShaDa file.
+Prints debug messages.
.Ar N
-is the 'verbose' level; defaults to
-.Cm 10.
+is the 'verbose' level, defaults to
+.Cm 10 .
If
.Ar file
is specified, append messages to
.Ar file
instead of printing them.
+.Ic ":help 'verbose'"
.It Fl D
-Debugging mode.
+Debug mode for VimL (Vim script).
Started when executing the first command from a script.
+:help debug-mode
.It Fl n
Disable the use of swap files.
Sets the 'updatecount' option to
@@ -156,8 +155,7 @@ is used to recover a crashed session.
The swap file has the same name as the file it's associated with, but with
.Sq .swp
appended.
-See
-.Ic ":help recovery" .
+.Ic ":help recovery"
.It Fl L Op Ar file
Alias for
.Fl r .
@@ -177,8 +175,7 @@ If
is
.Cm NONE ,
loading plugins is also skipped.
-See
-.Ic ":help initialization" .
+.Ic ":help initialization"
.It Fl i Ar shada
Use
.Ar shada
@@ -189,8 +186,7 @@ If
is
.Cm NONE ,
do not read or write a ShaDa file.
-See
-.Ic ":help shada" .
+.Ic ":help shada"
.It Fl -noplugin
Skip loading plugins.
Implied by
@@ -243,17 +239,12 @@ and
.Ic :/foo
inside
.Nm .
-See
-.Ic ":help search-pattern" .
-.It Fl c Ar command
+.Ic ":help search-pattern"
+.It \fB\+\fR\fI\,command\/\fR , Fl c Ar command
Execute
.Ar command
after reading the first file.
-Up to 10 instances of
-.Fl c
-or
-.Cm +
-can be used.
+Up to 10 instances allowed.
.Qq Cm +foo
and
.Cm -c \(dqfoo\(dq
@@ -280,8 +271,7 @@ If
is omitted then
.Pa Session.vim
is used, if found.
-See
-.Ic ":help session-file" .
+.Ic ":help session-file"
.It Fl s Ar scriptin
Read normal mode commands from
.Ar scriptin .
@@ -310,10 +300,12 @@ Can be used to diagnose slow startup times.
Dump API metadata serialized to msgpack and exit.
.It Fl -embed
Use standard input and standard output as a msgpack-rpc channel.
-Implies
-.Fl -headless .
+:help --embed
.It Fl -headless
-Do not start a user interface.
+Do not start a UI.
+When supplied with --embed this implies that the embedding application does not intend to (immediately) start a UI.
+Also useful for "scraping" messages in a pipe.
+:help --headless
.It Fl -listen Ar address
Start RPC server on this pipe or TCP socket.
.It Fl h , -help
@@ -324,11 +316,12 @@ Print version information and exit.
.Sh ENVIRONMENT
.Bl -tag -width Fl
.It Ev NVIM_LOG_FILE
-Low-level log file, usually found at ~/.local/share/nvim/log. See :help
-$NVIM_LOG_FILE.
+Low-level log file, usually found at ~/.local/share/nvim/log.
+:help $NVIM_LOG_FILE
.It Ev VIM
Used to locate user files, such as init.vim.
-System-dependent, see :help $VIM.
+System-dependent.
+:help $VIM
.It Ev VIMRUNTIME
Used to locate runtime files (documentation, syntax highlighting, etc.).
.It Ev XDG_CONFIG_HOME
@@ -336,7 +329,7 @@ Path to the user-local configuration directory, see
.Sx FILES .
Defaults to
.Pa ~/.config .
-See :help xdg.
+:help xdg
.It Ev XDG_DATA_HOME
Like
.Ev XDG_CONFIG_HOME ,
@@ -344,19 +337,10 @@ but used to store data not generally edited by the user,
namely swap, backup, and ShaDa files.
Defaults to
.Pa ~/.local/share .
-See :help xdg.
+:help xdg
.It Ev VIMINIT
Ex commands to be executed at startup.
-For example, the command to quit is
-.Ic :q ,
-so to have
-.Nm
-quit immediately after starting, set
-.Ev VIMINIT
-to
-.Cm q .
-See
-.Ic ":help VIMINIT" .
+.Ic ":help VIMINIT"
.It Ev SHELL
Used to initialize the 'shell' option, which decides the default shell used by
features like
@@ -391,10 +375,9 @@ Nvim was started by
Most of Vim was written by
.An -nosplit
.An Bram Moolenaar .
-See
-.Ic ":help credits" .
Vim is based on Stevie, worked on by
.An Tim Thompson ,
.An Tony Andrews ,
and
.An G.R. (Fred) Walter .
+.Ic ":help credits"
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 9fabc1cf8b..e816d0ae76 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -1120,6 +1120,33 @@ nvim_buf_clear_highlight({buffer}, {src_id}, {line_start}, {line_end})
{line_end} End of range of lines to clear (exclusive)
or -1 to clear to end of file.
+ *nvim_buf_set_virtual_text()*
+nvim_buf_set_virtual_text({buffer}, {src_id}, {line}, {chunks},
+ {opts})
+ Set the virtual text (annotation) for a buffer line.
+
+ By default (and currently the only option) the text will be
+ placed after the buffer text. Virtual text will never cause
+ reflow, rather virtual text will be truncated at the end of
+ the screen line. The virtual text will begin after one cell to
+ the right of the ordinary text, this will contain the |lcs-
+ eol| char if set, otherwise just be a space.
+
+ Parameters: ~
+ {buffer} Buffer handle
+ {src_id} Source group to use or 0 to use a new group, or
+ -1 for a ungrouped annotation
+ {line} Line to annotate with virtual text (zero-
+ indexed)
+ {chunks} A list of [text, hl_group] arrays, each
+ representing a text chunk with specified
+ highlight. `hl_group` element can be omitted for
+ no highlight.
+ {opts} Optional parameters. Currently not used.
+
+ Return: ~
+ The src_id that was used
+
==============================================================================
Window Functions *api-window*
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt
index 1e4d643e95..be3efb371f 100644
--- a/runtime/doc/channel.txt
+++ b/runtime/doc/channel.txt
@@ -32,8 +32,13 @@ Channels support multiple modes or protocols. In the most basic
mode of operation, raw bytes are read and written to the channel.
The |rpc| protocol, based on the msgpack-rpc standard, enables nvim and the
process at the other end to send remote calls and events to each other.
-Additionally, the builtin |terminal-emulator|, is implemented on top of PTY
-channels.
+The builtin |terminal-emulator| is also implemented on top of PTY channels.
+
+Channel Id *channel-id*
+
+Each channel is identified by an integer id, unique for the life of the
+current Nvim session. Functions like |stdioopen()| return channel ids;
+functions like |chansend()| consume channel ids.
==============================================================================
2. Reading and writing raw bytes *channel-bytes*
@@ -64,8 +69,8 @@ be raised.
- The arguments passed to the callback function are:
- 0: The channel id
- 1: the raw data read from the channel, formatted as a |readfile()|-style
+ 0: |channel-id|
+ 1: Raw data read from the channel, formatted as a |readfile()|-style
list. If EOF occured, a single empty string `['']` will be passed in.
Note that the items in this list do not directly correspond to actual
lines in the output. See |channel-lines|
@@ -150,9 +155,8 @@ Nvim uses stdin/stdout to interact with the user over the terminal interface
(TUI). If Nvim is |--headless| the TUI is not started and stdin/stdout can be
used as a channel. See also |--embed|.
-Call |stdioopen()| during |startup| to open the stdio channel as channel-id 1.
-Nvim's stderr is always available as channel-id 2 (|v:stderr| to be explicit),
-a write-only bytes channel.
+Call |stdioopen()| during |startup| to open the stdio channel as |channel-id| 1.
+Nvim's stderr is always available as |v:stderr|, a write-only bytes channel.
Example: >
func! OnEvent(id, data, event)
diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt
index b3b60cbab8..bd195b78b2 100644
--- a/runtime/doc/develop.txt
+++ b/runtime/doc/develop.txt
@@ -4,7 +4,7 @@
NVIM REFERENCE MANUAL
-Development of Nvim. *development*
+Development of Nvim *development*
Nvim is open source software. Everybody is encouraged to contribute.
https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md
@@ -23,37 +23,17 @@ Note that some items conflict; this is intentional. A balance must be found.
NVIM IS... IMPROVED *design-improved*
-The IMproved bits of Vim should make it a better Vi, without becoming a
-completely different editor. Extensions are done with a "Vi spirit".
-- Use the keyboard as much as feasible. The mouse requires a third hand,
- which we don't have. Many terminals don't have a mouse.
-- When the mouse is used anyway, avoid the need to switch back to the
- keyboard. Avoid mixing mouse and keyboard handling.
-- Add commands and options in a consistent way. Otherwise people will have a
- hard time finding and remembering them. Keep in mind that more commands and
- options will be added later.
+The Neo bits of Nvim should make it a better Vim, without becoming a
+completely different editor.
+- In matters of taste, prefer Vim/Unix tradition. If there is no relevant
+ Vim/Unix tradition, consider the "common case".
- A feature that people do not know about is a useless feature. Don't add
obscure features, or at least add hints in documentation that they exist.
-- Minimize using CTRL and other modifiers, they are more difficult to type.
-- There are many first-time and inexperienced Vim users. Make it easy for
- them to start using Vim and learn more over time.
- There is no limit to the features that can be added. Selecting new features
is based on (1) what users ask for, (2) how much effort it takes to
implement and (3) someone actually implementing it.
-
-
-NVIM IS... MULTI PLATFORM *design-multi-platform*
-
-Vim tries to help as many users on as many platforms as possible.
-- Support many kinds of terminals. The minimal demands are cursor positioning
- and clear-screen. Commands should only use key strokes that most keyboards
- have. Support all the keys on the keyboard for mapping.
-- Support many platforms. A condition is that there is someone willing to do
- Vim development on that platform, and it doesn't mean messing up the code.
-- Support many compilers and libraries. Not everybody is able or allowed to
- install another compiler or GUI library.
-- People switch from one platform to another, and from GUI to terminal
- version. Features should be present in all versions.
+- Backwards compatibility is a feature. The RPC API in particular should
+ never break.
NVIM IS... WELL DOCUMENTED *design-documented*
@@ -90,15 +70,6 @@ NVIM IS... MAINTAINABLE *design-maintain*
knowledge spread to other parts of the code.
-NVIM IS... FLEXIBLE *design-flexible*
-
-Vim should make it easy for users to work in their preferred styles rather
-than coercing its users into particular patterns of work. This can be for
-items with a large impact or for details. The defaults are carefully chosen
-such that most users will enjoy using Vim as it is. Commands and options can
-be used to adjust Vim to the desire of the user and its environment.
-
-
NVIM IS... NOT *design-not*
Nvim is not an operating system; instead it should be composed with other
@@ -239,7 +210,14 @@ Example: `nvim_buf_changedtick_event`.
API-CLIENT *dev-api-client*
+Standard Features ~
+
+- Clients should call |nvim_set_client_info()| after connecting, so users and
+ plugins can detect the client by handling the |ChanInfo| event. This
+ avoids the need for special variables or other client hints.
+
Package Naming ~
+
API client packages should NOT be named something ambiguous like "neovim" or
"python-client". Use "nvim" as a prefix/suffix to some other identifier
following ecosystem conventions.
@@ -255,10 +233,11 @@ Examples of API-client package names:
BAD: neovim
Implementation ~
-Consider using libmpack instead of the msgpack.org C/C++ library. libmpack is
-small, efficient, and C89-compatible. It can be easily inlined in your
-C project source, too. https://github.com/libmpack/libmpack/
+Consider using libmpack instead of the msgpack.org C/C++ library. libmpack is
+small (can be inlined into your C/C++ project) and efficient (no allocations).
+It also implements msgpack-RPC.
+https://github.com/libmpack/libmpack/
EXTERNAL UI *dev-ui*
@@ -267,7 +246,13 @@ versions of Nvim may add new items to existing events. The API is strongly
backwards-compatible, but clients must not break if new (optional) fields are
added to existing events.
+Standard Features ~
+
External UIs are expected to implement these common features:
+
+- Call |nvim_set_client_info()| after connecting, so users and plugins can
+ detect the UI by handling the |ChanInfo| event. This avoids the need for
+ special variables and UI-specific config files (gvimrc, macvimrc, …).
- Cursor style (shape, color) should conform to the 'guicursor' properties
delivered with the mode_info_set UI event.
- Send the ALT/META ("Option" on macOS) key as a |<M-| chord.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 2e1d89c524..3f02365dab 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1817,11 +1817,11 @@ v:shell_error Result of the last shell command. When non-zero, the last
v:statusmsg Last given status message. It's allowed to set this variable.
*v:stderr* *stderr-variable*
-v:stderr Channel id for stderr. Unlike stdin and stdout (see
- |stdioopen()|), stderr is always open for writing. This channel
- ID is always 2, but this variable can be used to be explicit.
- Example: >
- :call chansend(v:stderr, "something bad happened\n")
+v:stderr |channel-id| corresponding to stderr. The value is always 2;
+ use this variable to make your code more descriptive.
+ Unlike stdin and stdout (see |stdioopen()|), stderr is always
+ open for writing. Example: >
+ :call chansend(v:stderr, "error: toaster empty\n")
<
*v:swapname* *swapname-variable*
v:swapname Only valid when executing |SwapExists| autocommands: Name of
@@ -4336,11 +4336,11 @@ getqflist([{what}]) *getqflist()*
following string items are supported in {what}:
context get the context stored with |setqflist()|
efm errorformat to use when parsing "lines". If
- not present, then the 'erroformat' option
+ not present, then the 'errorformat' option
value is used.
id get information for the quickfix list with
|quickfix-ID|; zero means the id for the
- current list or the list specifed by "nr"
+ current list or the list specified by "nr"
items quickfix list entries
lines use 'errorformat' to extract items from a list
of lines and return the resulting entries.
@@ -5024,11 +5024,10 @@ jobstart({cmd}[, {opts}]) *jobstart()*
<
Returns |job-id| on success, 0 on invalid arguments (or job
table is full), -1 if {cmd}[0] or 'shell' is not executable.
- For communication over the job's stdio, it is represented as a
- |channel|, and a channel ID is returned on success. Use
- |chansend()| (or |rpcnotify()| and |rpcrequest()| if "rpc" option
- was used) to send data to stdin and |chanclose()| to close stdio
- streams without stopping the job explicitly.
+ The returned job-id is a valid |channel-id| representing the
+ job's stdio streams. Use |chansend()| (or |rpcnotify()| and
+ |rpcrequest()| if "rpc" was enabled) to send data to stdin and
+ |chanclose()| to close the streams without stopping the job.
See |job-control| and |RPC|.
@@ -5082,18 +5081,24 @@ jobstop({id}) *jobstop()*
See |job-control|.
jobwait({ids}[, {timeout}]) *jobwait()*
- Wait for a set of jobs to finish. The {ids} argument is a list
- of |job-id|s to wait for. {timeout} is the maximum number of
- milliseconds to wait. During jobwait(), callbacks for jobs not
- in the {ids} list may be invoked. The screen will not redraw
- unless |:redraw| is invoked by a callback.
+ Wait for a set of jobs to complete.
+
+ {ids} is a list of |job-id|s to wait for.
+ {timeout} is the maximum number of milliseconds to wait.
+ {timeout} of zero can be used to check if a job-id is valid,
+ without waiting.
+
+ During jobwait() callbacks for jobs not in the {ids} list may
+ be invoked. The screen will not redraw unless |:redraw| is
+ invoked by a callback.
Returns a list of len({ids}) integers, where each integer is
- the wait-result of the corresponding job. Each wait-result is:
- Job exit-code, if the job exited
- -1 if the wait timed out for the job
- -2 if the job was interrupted
- -3 if the |job-id| is invalid.
+ the wait-result of the corresponding job. Each wait-result is
+ one of the following:
+ * Exit-code, if the job exited
+ * -1 if the timeout was exceeded
+ * -2 if the job was interrupted
+ * -3 if the |job-id| is invalid
join({list} [, {sep}]) *join()*
Join the items in {list} together into one String.
@@ -7325,8 +7330,8 @@ stdpath({what}) *stdpath()* *E6100*
directories.
{what} Type Description ~
- cache String Cache directory. Useful for plugins
- that need temporary files to work.
+ cache String Cache directory. Arbitrary temporary
+ storage for plugins, etc.
config String User configuration directory. The
|init.vim| is stored here.
config_dirs List Additional configuration directories.
@@ -7334,6 +7339,9 @@ stdpath({what}) *stdpath()* *E6100*
is stored here.
data_dirs List Additional data directories.
+ Example: >
+ :echo stdpath("config")
+
str2float({expr}) *str2float()*
Convert String {expr} to a Float. This mostly works the same
@@ -7555,8 +7563,9 @@ submatch({nr} [, {list}]) *submatch()* *E935*
When substitute() is used recursively only the submatches in
the current (deepest) call can be obtained.
- Example: >
+ Examples: >
:s/\d\+/\=submatch(0) + 1/
+ :echo substitute(text, '\d\+', '\=submatch(0) + 1', '')
< This finds the first number in the line and adds one to it.
A line break is included as a newline character.
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index 74c453f79a..302370b4cc 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -152,8 +152,8 @@ file. It will be overwritten when installing a new version of Vim.
A. If you want to overrule all default file type checks.
This works by writing one file for each filetype. The disadvantage is that
- means there can be many files. The advantage is that you can simply drop
- this file in the right directory to make it work.
+ there can be many files. The advantage is that you can simply drop this
+ file in the right directory to make it work.
*ftdetect*
1. Create your user runtime directory. You would normally use the first
item of the 'runtimepath' option. Then create the directory "ftdetect"
diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt
index 904c4be19c..0c2cc9c865 100644
--- a/runtime/doc/gui.txt
+++ b/runtime/doc/gui.txt
@@ -9,7 +9,7 @@ Vim's Graphical User Interface *gui* *GUI*
Type |gO| to see the table of contents.
==============================================================================
-1. Starting the GUI *gui-start* *E229* *E233*
+Starting the GUI *gui-start* *E229* *E233*
*ginit.vim* *gui-init* *gvimrc* *$MYGVIMRC*
The gvimrc file is where GUI-specific startup commands should be placed. It
@@ -87,7 +87,7 @@ and only the first one that is found is read.
Obsolete, use ":set lines=11 columns=22".
==============================================================================
-2. Scrollbars *gui-scrollbars*
+Scrollbars *gui-scrollbars*
There are vertical scrollbars and a horizontal scrollbar. You may
configure which ones appear with the 'guioptions' option.
@@ -155,167 +155,7 @@ include the 'h' flag in 'guioptions'. Then the scrolling is limited by the
text of the current cursor line.
==============================================================================
-3. Mouse Control *gui-mouse*
-
-The mouse only works if the appropriate flag in the 'mouse' option is set.
-When the GUI is switched on, and 'mouse' wasn't set yet, the 'mouse' option is
-automatically set to "a", enabling it for all modes except for the
-|hit-enter| prompt. If you don't want this, a good place to change the
-'mouse' option is the "gvimrc" file.
-
-Other options that are relevant:
-'mousefocus' window focus follows mouse pointer |gui-mouse-focus|
-'mousemodel' what mouse button does which action
-'mousehide' hide mouse pointer while typing text
-'selectmode' whether to start Select mode or Visual mode
-
-A quick way to set these is with the ":behave" command.
- *:behave* *:be*
-:be[have] {model} Set behavior for mouse and selection. Valid
- arguments are:
- mswin MS-Windows behavior
- xterm Xterm behavior
-
- Using ":behave" changes these options:
- option mswin xterm ~
- 'selectmode' "mouse,key" ""
- 'mousemodel' "popup" "extend"
- 'keymodel' "startsel,stopsel" ""
- 'selection' "exclusive" "inclusive"
-
-In the $VIMRUNTIME directory, there is a script called |mswin.vim|, which will
-also map a few keys to the MS-Windows cut/copy/paste commands. This is NOT
-compatible, since it uses the CTRL-V, CTRL-X and CTRL-C keys. If you don't
-mind, use this command: >
- :so $VIMRUNTIME/mswin.vim
-
-For scrolling with a wheel on a mouse, see |scroll-mouse-wheel|.
-
-
-3.1 Moving Cursor with Mouse *gui-mouse-move*
-
-Click the left mouse button somewhere in a text buffer where you want the
-cursor to go, and it does!
-This works in when 'mouse' contains ~
-Normal mode 'n' or 'a'
-Visual mode 'v' or 'a'
-Insert mode 'i' or 'a'
-
-Select mode is handled like Visual mode.
-
-You may use this with an operator such as 'd' to delete text from the current
-cursor position to the position you point to with the mouse. That is, you hit
-'d' and then click the mouse somewhere.
-
- *gui-mouse-focus*
-The 'mousefocus' option can be set to make the keyboard focus follow the
-mouse pointer. This means that the window where the mouse pointer is, is the
-active window. Warning: this doesn't work very well when using a menu,
-because the menu command will always be applied to the top window.
-
-If you are on the ':' line (or '/' or '?'), then clicking the left or right
-mouse button will position the cursor on the ':' line (if 'mouse' contains
-'c', 'a' or 'A').
-
-In any situation the middle mouse button may be clicked to paste the current
-selection.
-
-
-3.2 Selection with Mouse *gui-mouse-select*
-
-The mouse can be used to start a selection. How depends on the 'mousemodel'
-option:
-'mousemodel' is "extend": use the right mouse button
-'mousemodel' is "popup": use the left mouse button, while keeping the Shift
-key pressed.
-
-If there was no selection yet, this starts a selection from the old cursor
-position to the position pointed to with the mouse. If there already is a
-selection then the closest end will be extended.
-
-If 'selectmode' contains "mouse", then the selection will be in Select mode.
-This means that typing normal text will replace the selection. See
-|Select-mode|. Otherwise, the selection will be in Visual mode.
-
-Double clicking may be done to make the selection word-wise, triple clicking
-makes it line-wise, and quadruple clicking makes it rectangular block-wise.
-
-See |gui-selections| on how the selection is used.
-
-
-3.3 Other Text Selection with Mouse *gui-mouse-modeless*
- *modeless-selection*
-A different kind of selection is used when:
-- in Command-line mode
-- in the Command-line window and pointing in another window
-- at the |hit-enter| prompt
-- whenever the current mode is not in the 'mouse' option
-- when holding the CTRL and SHIFT keys in the GUI
-
-Since Vim continues like the selection isn't there, and there is no mode
-associated with the selection, this is called modeless selection. Any text in
-the Vim window can be selected. Select the text by pressing the left mouse
-button at the start, drag to the end and release. To extend the selection,
-use the right mouse button when 'mousemodel' is "extend", or the left mouse
-button with the shift key pressed when 'mousemodel' is "popup".
-The selection is removed when the selected text is scrolled or changed.
-
-On the command line CTRL-Y can be used to copy the selection into the
-clipboard. To do this from Insert mode, use CTRL-O : CTRL-Y <CR>. When
-'guioptions' contains a or A (default on X11), the selection is automatically
-copied to the "* register.
-
-The middle mouse button can then paste the text. On non-X11 systems, you can
-use CTRL-R +.
-
-
-3.4 Using Mouse on Status Lines *gui-mouse-status*
-
-Clicking the left or right mouse button on the status line below a Vim
-window makes that window the current window. This actually happens on button
-release (to be able to distinguish a click from a drag action).
-
-With the left mouse button a status line can be dragged up and down, thus
-resizing the windows above and below it. This does not change window focus.
-
-The same can be used on the vertical separator: click to give the window left
-of it focus, drag left and right to make windows wider and narrower.
-
-
-3.5 Various Mouse Clicks *gui-mouse-various*
-
- <S-LeftMouse> Search forward for the word under the mouse click.
- When 'mousemodel' is "popup" this starts or extends a
- selection.
- <S-RightMouse> Search backward for the word under the mouse click.
- <C-LeftMouse> Jump to the tag name under the mouse click.
- <C-RightMouse> Jump back to position before the previous tag jump
- (same as "CTRL-T")
-
-
-3.6 Mouse Mappings *gui-mouse-mapping*
-
-The mouse events, complete with modifiers, may be mapped. Eg: >
- :map <S-LeftMouse> <RightMouse>
- :map <S-LeftDrag> <RightDrag>
- :map <S-LeftRelease> <RightRelease>
- :map <2-S-LeftMouse> <2-RightMouse>
- :map <2-S-LeftDrag> <2-RightDrag>
- :map <2-S-LeftRelease> <2-RightRelease>
- :map <3-S-LeftMouse> <3-RightMouse>
- :map <3-S-LeftDrag> <3-RightDrag>
- :map <3-S-LeftRelease> <3-RightRelease>
- :map <4-S-LeftMouse> <4-RightMouse>
- :map <4-S-LeftDrag> <4-RightDrag>
- :map <4-S-LeftRelease> <4-RightRelease>
-These mappings make selection work the way it probably should in a Motif
-application, with shift-left mouse allowing for extending the visual area
-rather than the right mouse button.
-
-Mouse mapping with modifiers does not work for modeless selection.
-
-
-3.7 Drag and drop *drag-n-drop*
+Drag and drop *drag-n-drop*
You can drag and drop one or more files into the Vim window, where they will
be opened as if a |:drop| command was used.
@@ -334,47 +174,12 @@ names with any Ex command. Special characters (space, tab, double quote and
'|'; backslash on non-MS-Windows systems) will be escaped.
==============================================================================
-4. Making GUI Selections *gui-selections*
-
- *quotestar*
-You may make selections with the mouse (see |gui-mouse-select|), or by using
-Vim's Visual mode (see |v|). If 'a' is present in 'guioptions', then
-whenever a selection is started (Visual or Select mode), or when the selection
-is changed, Vim becomes the owner of the windowing system's primary selection
-(on MS-Windows the |clipboard| is used).
-
- *primary-selection*
-There is a special register for storing this selection, it is the "*
-register. Nothing is put in here unless the information about what text is
-selected is about to change (e.g. with a left mouse click somewhere), or when
-another application wants to paste the selected text. Then the text is put
-in the "* register. For example, to cut a line and make it the current
-selection/put it on the clipboard: >
-
- "*dd
-
-Similarly, when you want to paste a selection from another application, e.g.,
-by clicking the middle mouse button, the selection is put in the "* register
-first, and then 'put' like any other register. For example, to put the
-selection (contents of the clipboard): >
-
- "*p
-
-Note that when pasting text from one Vim into another separate Vim, the type
-of selection (character, line, or block) will also be copied. For other
-applications the type is always character.
-
-When the "unnamed" string is included in the 'clipboard' option, the unnamed
-register is the same as the "* register. Thus you can yank to and paste the
-selection without prepending "* to commands.
-
-==============================================================================
-5. Menus *menus*
+Menus *menus*
For an introduction see |usr_42.txt| in the user manual.
-5.1 Using Menus *using-menus*
+Using Menus *using-menus*
Basically, menus can be used just like mappings. You can define your own
menus, as many as you like.
@@ -420,7 +225,7 @@ Pressing <F4> will start the menu. You can now use the cursor keys to select
a menu entry. Hit <Enter> to execute it. Hit <Esc> if you want to cancel.
This does require the |+menu| feature enabled at compile time.
-5.2 Creating New Menus *creating-menus*
+Creating New Menus *creating-menus*
*:me* *:menu* *:noreme* *:noremenu*
*:am* *:amenu* *:an* *:anoremenu*
@@ -662,7 +467,7 @@ when the right mouse button is pressed, if 'mousemodel' is set to popup or
popup_setpos.
-5.3 Showing What Menus Are Mapped To *showing-menus*
+Showing What Menus Are Mapped To *showing-menus*
To see what an existing menu is mapped to, use just one argument after the
menu commands (just like you would with the ":map" commands). If the menu
@@ -680,7 +485,7 @@ Note that hitting <Tab> while entering a menu name after a menu command may
be used to complete the name of the menu item.
-5.4 Executing Menus *execute-menus*
+Executing Menus *execute-menus*
*:em* *:emenu* *E334* *E335*
:[range]em[enu] {menu} Execute {menu} from the command line.
@@ -700,7 +505,7 @@ When using a range, if the lines match with '<,'>, then the menu is executed
using the last visual selection.
-5.5 Deleting Menus *delete-menus*
+Deleting Menus *delete-menus*
*:unme* *:unmenu*
*:aun* *:aunmenu*
@@ -730,7 +535,7 @@ If you want to get rid of the menu bar: >
:set guioptions-=m
-5.6 Disabling Menus *disable-menus*
+Disabling Menus *disable-menus*
*:menu-disable* *:menu-enable*
If you do not want to remove a menu, but disable it for a moment, this can be
@@ -746,7 +551,7 @@ When the argument is "*", all menus are affected. Otherwise the given menu
name and all existing submenus below it are affected.
-5.7 Examples for Menus *menu-examples*
+Examples for Menus *menu-examples*
Here is an example on how to add menu items with menu's! You can add a menu
item for the keyword under the cursor. The register "z" is used. >
@@ -763,7 +568,7 @@ mappings, or put these lines in your gvimrc; "<C-R>" is CTRL-R, "<CR>" is
the <CR> key. |<>|)
-5.8 Tooltips & Menu tips
+Tooltips & Menu tips
See section |42.4| in the user manual.
@@ -833,22 +638,5 @@ This creates a popup menu that doesn't exist on the main menu-bar.
Note that a menu that starts with ']' will not be displayed.
-==============================================================================
-6. Extras *gui-extras*
-
-This section describes other features which are related to the GUI.
-
-- With the GUI, there is no wait for one second after hitting escape, because
- the key codes don't start with <Esc>.
-
-- Typing ^V followed by a special key in the GUI will insert "<Key>", since
- the internal string used is meaningless. Modifiers may also be held down to
- get "<Modifiers-Key>".
-
-- In the GUI, the modifiers SHIFT, CTRL, and ALT (or META) may be used within
- mappings of special keys and mouse events. E.g.: :map <M-LeftDrag> <LeftDrag>
-
-- In the GUI, several normal keys may have modifiers in mappings etc, these
- are <Space>, <Tab>, <NL>, <CR>, <Esc>.
vim:tw=78:sw=4:ts=8:ft=help:norl:
diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt
index 6769dd87e8..e33f89e771 100644
--- a/runtime/doc/if_pyth.txt
+++ b/runtime/doc/if_pyth.txt
@@ -118,7 +118,7 @@ Instead, put the Python command in a function and call that function:
Note that "EOF" must be at the start of the line.
==============================================================================
-2. The vim module *python-vim*
+2. The vim module *python-vim* *python2*
Python code gets all of its access to vim (with one exception - see
|python-output| below) via the "vim" module. The vim module implements two
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index d612f038a6..ef4e211d16 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1275,7 +1275,8 @@ it here: http://ctags.sourceforge.net/ Version 5.6 or later is recommended.
For version 5.5.4 you should add a patch that adds the "typename:" field:
ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
A compiled .exe for MS-Windows can be found at:
- http://georgevreilly.com/vim/ctags.html
+ http://ctags.sourceforge.net/
+ https://github.com/universal-ctags/ctags-win32
If you want to complete system functions you can do something like this. Use
ctags to generate a tags file for all the system header files: >
diff --git a/runtime/doc/job_control.txt b/runtime/doc/job_control.txt
index ed5f16902a..e5cd765e83 100644
--- a/runtime/doc/job_control.txt
+++ b/runtime/doc/job_control.txt
@@ -16,12 +16,14 @@ Concepts
Job Id *job-id*
-When a job starts it is assigned a number, unique for the life of the current
-Nvim session. Functions like |jobstart()| return job ids. Functions like
+Each job is identified by an integer id, unique for the life of the current
+Nvim session. Each job-id is a valid |channel-id|: they share the same "key
+space". Functions like |jobstart()| return job ids; functions like
|jobsend()|, |jobstop()|, |rpcnotify()|, and |rpcrequest()| take job ids.
-The job's stdio streams are represented as a |channel|. It is possible to send
-and recieve raw bytes, or use |msgpack-rpc|.
+Job stdio streams form a |channel| which can send and receive raw bytes or
+|msgpack-rpc| messages.
+
==============================================================================
Usage *job-control-usage*
diff --git a/runtime/doc/nvim.txt b/runtime/doc/nvim.txt
index b8a481a016..07eb48aea3 100644
--- a/runtime/doc/nvim.txt
+++ b/runtime/doc/nvim.txt
@@ -8,7 +8,9 @@ Nvim *nvim* *nvim-intro*
Nvim is based on Vim by Bram Moolenaar.
-If you are new to Vim see |help.txt|, or type ":Tutor".
+If you are new to Vim, try the 30-minute tutorial: >
+ :Tutor<Enter>
+
If you already use Vim see |nvim-from-vim| for a quickstart.
Nvim is emphatically a fork of Vim, not a clone: compatibility with Vim is
@@ -20,29 +22,24 @@ differences from Vim.
==============================================================================
Transitioning from Vim *nvim-from-vim*
-To start the transition, create init.vim in the correct directory for your
-platform.
-
-For Linux, macOS and other Unixes, create the file at ~/.config/nvim/init.vim.
+1. To start the transition, create your |init.vim| (user config) file: >
-For Windows, create the file at %LOCALAPPDATA%\nvim\init.vim. `%LOCALAPPDATA%`
-usually expands to `C:\Users\<username>\AppData\Local`.
+ :call mkdir(stdpath('config'), 'p')
+ :exe 'edit '.stdpath('config').'/init.vim'
-Note: If your system sets `$XDG_CONFIG_HOME`, use that instead of `~/.config`
-or `%LOCALAPPDATA%` in the paths above. Nvim follows the XDG |base-directories|
-convention.
+2. Add these contents to the file: >
-Next, add these contents to the file:
->
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc
-<
+
+3. Restart Nvim, your existing Vim config will be loaded.
+
See |provider-python| and |provider-clipboard| for additional software you
might need to use some features.
-Your Vim configuration might not be entirely compatible with Nvim. For a
-full list of differences between Vim and Nvim see |vim-differences|.
+Your Vim configuration might not be entirely Nvim-compatible.
+See |vim-differences| for the full list of changes.
The |'ttymouse'| option, for example, was removed from Nvim (mouse support
should work without it). If you use the same |vimrc| for Vim and Nvim,
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 2f2db844e8..ab866da320 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -3316,8 +3316,8 @@ A jump table for the options with a short description can be found at |Q_op|.
pattern and/or a lot of text the match may not be found. This is to
avoid that Vim hangs while you are typing the pattern.
The |hl-IncSearch| highlight group determines the highlighting.
- When 'hlsearch' is on, all matched strings are highlighted too while typing
- a search command. See also: 'hlsearch'.
+ When 'hlsearch' is on, all matched strings are highlighted too while
+ typing a search command. See also: 'hlsearch'.
If you don't want turn 'hlsearch' on, but want to highlight all matches
while searching, you can turn on and off 'hlsearch' with autocmd.
Example: >
@@ -4036,9 +4036,14 @@ A jump table for the options with a short description can be found at |Q_op|.
'mouse' string (default "")
global
- Enable the use of the mouse. Only works for certain terminals.
- For using the mouse in the GUI, see |gui-mouse|. The mouse can be
- enabled for different modes:
+ Enables mouse support. For example, to enable the mouse in Normal mode
+ and Visual mode: >
+ :set mouse=nv
+<
+ To temporarily disable mouse support, hold the shift key while using
+ the mouse.
+
+ Mouse support can be enabled for different modes:
n Normal mode
v Visual mode
i Insert mode
@@ -4046,17 +4051,42 @@ A jump table for the options with a short description can be found at |Q_op|.
h all previous modes when editing a help file
a all previous modes
r for |hit-enter| and |more-prompt| prompt
- Normally you would enable the mouse in all four modes with: >
- :set mouse=a
-< When the mouse is not enabled, the GUI will still use the mouse for
- modeless selection. This doesn't move the text cursor.
- See |mouse-using|. Also see |'clipboard'|.
+ Left-click anywhere in a text buffer to place the cursor there. This
+ works with operators too, e.g. type |d| then left-click to delete text
+ from the current cursor position to the position where you clicked.
+
+ Drag the |status-line| or vertical separator of a window to resize it.
+
+ If enabled for "v" (Visual mode) then double-click selects word-wise,
+ triple-click makes it line-wise, and quadruple-click makes it
+ rectangular block-wise.
+
+ For scrolling with a mouse wheel see |scroll-mouse-wheel|.
Note: When enabling the mouse in a terminal, copy/paste will use the
- "* register if there is access to an X-server. The xterm handling of
- the mouse buttons can still be used by keeping the shift key pressed.
- Also see the 'clipboard' option.
+ "* register if possible. See also 'clipboard'.
+
+ Related options:
+ 'mousefocus' window focus follows mouse pointer
+ 'mousemodel' what mouse button does which action
+ 'mousehide' hide mouse pointer while typing text
+ 'selectmode' whether to start Select mode or Visual mode
+
+ The :behave command provides some "profiles" for mouse behavior.
+ *:behave* *:be*
+ :be[have] {model} Set behavior for mouse and selection. Valid
+ arguments are:
+ mswin MS-Windows behavior
+ xterm Xterm behavior
+
+ Using ":behave" changes these options:
+ option mswin xterm ~
+ 'selectmode' "mouse,key" ""
+ 'mousemodel' "popup" "extend"
+ 'keymodel' "startsel,stopsel" ""
+ 'selection' "exclusive" "inclusive"
+
*'mousefocus'* *'mousef'* *'nomousefocus'* *'nomousef'*
'mousefocus' 'mousef' boolean (default off)
@@ -4076,7 +4106,7 @@ A jump table for the options with a short description can be found at |Q_op|.
The mouse pointer is restored when the mouse is moved.
*'mousemodel'* *'mousem'*
-'mousemodel' 'mousem' string (default "extend", "popup" for Windows)
+'mousemodel' 'mousem' string (default "extend")
global
Sets the model to use for the mouse. The name mostly specifies what
the right mouse button is used for:
@@ -4105,8 +4135,26 @@ A jump table for the options with a short description can be found at |Q_op|.
You need to define this first, see |popup-menu|.
Note that you can further refine the meaning of buttons with mappings.
- See |gui-mouse-mapping|. But mappings are NOT used for modeless
- selection (because that's handled in the GUI code directly).
+ See |mouse-overview|. But mappings are NOT used for modeless selection.
+
+ Example: >
+ :map <S-LeftMouse> <RightMouse>
+ :map <S-LeftDrag> <RightDrag>
+ :map <S-LeftRelease> <RightRelease>
+ :map <2-S-LeftMouse> <2-RightMouse>
+ :map <2-S-LeftDrag> <2-RightDrag>
+ :map <2-S-LeftRelease> <2-RightRelease>
+ :map <3-S-LeftMouse> <3-RightMouse>
+ :map <3-S-LeftDrag> <3-RightDrag>
+ :map <3-S-LeftRelease> <3-RightRelease>
+ :map <4-S-LeftMouse> <4-RightMouse>
+ :map <4-S-LeftDrag> <4-RightDrag>
+ :map <4-S-LeftRelease> <4-RightRelease>
+<
+ Mouse commands requiring the CTRL modifier can be simulated by typing
+ the "g" key before using the mouse:
+ "g<LeftMouse>" is "<C-LeftMouse> (jump to tag under mouse click)
+ "g<RightMouse>" is "<C-RightMouse> ("CTRL-T")
The 'mousemodel' option is set by the |:behave| command.
diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt
index 8b5798a5a5..0e26dc4515 100644
--- a/runtime/doc/provider.txt
+++ b/runtime/doc/provider.txt
@@ -13,44 +13,44 @@ Nvim delegates some features to dynamic "providers".
==============================================================================
Python integration *provider-python*
-Nvim supports Python |remote-plugin|s and the Vim legacy |python-vim| and
+Nvim supports Python |remote-plugin|s and the Vim legacy |python2| and
|python3| interfaces (which are implemented as remote-plugins).
Note: Only the Vim 7.3 API is supported; bindeval (Vim 7.4) is not.
PYTHON QUICKSTART ~
-If you used a package manager to install Nvim, you might already have the
-required "neovim" Python package. Run |:checkhealth| to verify.
+Install the "neovim" Python package:
-To install the package with "pip":
+- Run |:checkhealth| to see if you already have the package (some package
+ managers install the "neovim" Python package with Nvim itself).
- For Python 2 plugins, make sure Python 2.7 is available in your $PATH, then
- install the "neovim" Python package systemwide: >
+ install the package systemwide: >
sudo pip2 install --upgrade neovim
-<
- or for the current user: >
+< or for the current user: >
pip2 install --user --upgrade neovim
-<
+< If "pip2" is missing, try "pip".
+
- For Python 3 plugins, make sure Python 3.4+ is available in your $PATH, then
- install the "neovim" Python package systemwide: >
+ install the package systemwide: >
sudo pip3 install --upgrade neovim
-<
- or for the current user: >
+< or for the current user: >
pip3 install --user --upgrade neovim
-<
-Note: "pip" may refer to Python 2 or Python 3, so the steps above mention
-"pip2" and "pip3" explicitly. If one is missing, try "pip".
+< If "pip3" is missing, try "pip".
-Note: The `--upgrade` flag ensures you have the latest version even if
-a previous version was already installed.
+- The `--upgrade` flag ensures you have the latest version even if a previous
+ version was already installed.
PYTHON PROVIDER CONFIGURATION ~
*g:python_host_prog*
+Path to Python 2 interpreter. Setting this makes startup faster. Also useful
+for working with virtualenvs. >
+ let g:python_host_prog = '/path/to/python' " Python 2
+<
*g:python3_host_prog*
-Program to use for evaluating Python code. Setting this makes startup faster.
-Also useful for working with virtualenvs. >
- let g:python_host_prog = '/path/to/python'
- let g:python3_host_prog = '/path/to/python3'
+Path to Python 3 interpreter. Setting this makes startup faster. Also useful
+for working with virtualenvs. >
+ let g:python3_host_prog = '/path/to/python3' " Python 3
<
*g:loaded_python_provider*
To disable Python 2 support: >
@@ -62,21 +62,21 @@ To disable Python 3 support: >
PYTHON VIRTUALENVS ~
-If you plan to use per-project virtualenvs often, you should assign
-a virtualenv for Neovim and hard-code the interpreter path via
-|g:python_host_prog| (or |g:python3_host_prog|) so that the "neovim" python
-package is not required for each Environment. Example using pyenv: >
+If you plan to use per-project virtualenvs often, you should assign one
+virtualenv for Neovim and hard-code the interpreter path via
+|g:python3_host_prog| (or |g:python_host_prog|) so that the "neovim" package
+is not required for each virtualenv.
+
+Example using pyenv: >
pyenv install 3.4.4
- pyenv virtualenv 3.4.4 py3neovim
- pyenv activate py3neovim
+ pyenv virtualenv 3.4.4 py3nvim
+ pyenv activate py3nvim
pip install neovim
pyenv which python # Note the path
+The last command reports the interpreter path, add it to your init.vim: >
+ let g:python3_host_prog = '/path/to/py3nvim/bin/python'
-The last command reports the interpreter path. Add it to your init.vim: >
- let g:python3_host_prog = '/full/path/to/py3neovim/bin/python'
-
-More information:
-https://github.com/zchee/deoplete-jedi/wiki/Setting-up-Python-for-Neovim
+See also: https://github.com/zchee/deoplete-jedi/wiki/Setting-up-Python-for-Neovim
==============================================================================
Ruby integration *provider-ruby*
@@ -84,13 +84,13 @@ Ruby integration *provider-ruby*
Nvim supports Ruby |remote-plugin|s and the Vim legacy |ruby-vim| interface
(which is itself implemented as a Nvim remote-plugin).
-Run |:checkhealth| to see if your system is up-to-date.
-
RUBY QUICKSTART ~
To use Ruby plugins with Nvim, install the latest "neovim" RubyGem: >
gem install neovim
+Run |:checkhealth| to see if your system is up-to-date.
+
RUBY PROVIDER CONFIGURATION ~
*g:loaded_ruby_provider*
To disable Ruby support: >
@@ -103,11 +103,10 @@ avoid the need to install the "neovim" gem in every project.
To use an absolute path (e.g. to an rbenv installation): >
let g:ruby_host_prog = '~/.rbenv/versions/2.4.1/bin/neovim-ruby-host'
-<
To use the RVM "system" Ruby installation: >
let g:ruby_host_prog = 'rvm system do neovim-ruby-host'
-<
+
==============================================================================
Node.js integration *provider-nodejs*
@@ -130,7 +129,7 @@ To disable Node.js support: >
Command to start the Node.js host. Setting this makes startup faster.
By default, Nvim searches for "neovim-node-host" using "npm root -g", which
-can be slow. To avoid this, set g:node_host_prog to an absolute path: >
+can be slow. To avoid this, set g:node_host_prog to the host path: >
let g:node_host_prog = '/usr/local/bin/neovim-node-host'
<
==============================================================================
@@ -187,15 +186,15 @@ The contents of selections are held by the originating application (e.g., upon
a copy), and only passed to another application when that other application
requests them (e.g., upon a paste).
- *quoteplus* *quote+*
+ *primary-selection* *quotestar* *quoteplus* *quote+*
-There are three documented X11 selections: `PRIMARY`, `SECONDARY`, and `CLIPBOARD`.
-`CLIPBOARD` is typically used in X11 applications for copy/paste operations
-(`Ctrl-c`/`v`), while `PRIMARY` is used for the last selected text, which is
+There are three documented X11 selections: PRIMARY, SECONDARY, and CLIPBOARD.
+CLIPBOARD is typically used in X11 applications for copy/paste operations
+(CTRL-c/CTRL-v), while PRIMARY is used for the last selected text, which is
generally inserted with the middle mouse button.
-Nvim's X11 clipboard providers only utilize the `PRIMARY` and `CLIPBOARD`
-selections, used for the '*' and '+' registers, respectively.
+Nvim's X11 clipboard providers only use the PRIMARY and CLIPBOARD selections,
+for the "*" and "+" registers, respectively.
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 34c4db4047..aebb0ef6ec 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -699,27 +699,25 @@ greps in the help files) you might be able to use this: >
4. Suspending *suspend*
*iconize* *iconise* *CTRL-Z* *v_CTRL-Z*
-CTRL-Z Suspend Vim, like ":stop".
+CTRL-Z Suspend Nvim, like ":stop".
Works in Normal and in Visual mode. In Insert and
Command-line mode, the CTRL-Z is inserted as a normal
- character. In Visual mode Vim goes back to Normal
+ character. In Visual mode Nvim goes back to Normal
mode.
:sus[pend][!] or *:sus* *:suspend* *:st* *:stop*
-:st[op][!] Suspend Vim. Vim will continue if you make it the
- foreground job again.
- If the '!' is not given and 'autowrite' is set, every
+:st[op][!] Suspend Nvim using OS "job control"; it will continue
+ if you make it the foreground job again. Triggers
+ |VimSuspend| before suspending and |VimResume| when
+ resumed.
+ If "!" is not given and 'autowrite' is set, every
buffer with changes and a file name is written out.
- If the '!' is given or 'autowrite' is not set, changed
- buffers are not written, don't forget to bring Vim
+ If "!" is given or 'autowrite' is not set, changed
+ buffers are not written, don't forget to bring Nvim
back to the foreground later!
In the GUI, suspending is implementation-defined.
-In X-windows the selection is disowned when Vim suspends. this means you
-can't paste it in another application (since Vim is going to sleep an attempt
-to get the selection would make the program hang).
-
==============================================================================
5. Exiting *exiting*
@@ -1373,7 +1371,7 @@ file when reading and include:
9. Standard Paths *standard-path*
Nvim stores configuration and data in standard locations. Plugins are strongly
-encouraged to follow this pattern also.
+encouraged to follow this pattern also. Use |stdpath()| to get the paths.
*base-directories* *xdg*
The "base" (root) directories conform to the XDG Base Directory Specification.
@@ -1381,18 +1379,18 @@ https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
The $XDG_CONFIG_HOME and $XDG_DATA_HOME environment variables are used if they
exist, otherwise default values (listed below) are used.
-Note: Throughout the user manual these defaults are used as placeholders, e.g.
-"~/.config" is understood to mean "$XDG_CONFIG_HOME or ~/.config".
+CONFIG DIRECTORY (DEFAULT) ~
+ *$XDG_CONFIG_HOME* Nvim: stdpath("config")
+ Unix: ~/.config ~/.config/nvim
+ Windows: ~/AppData/Local ~/AppData/Local/nvim
-CONFIG DIRECTORY *$XDG_CONFIG_HOME*
- Base Nvim ~
-Unix: ~/.config ~/.config/nvim
-Windows: ~/AppData/Local ~/AppData/Local/nvim
+DATA DIRECTORY (DEFAULT) ~
+ *$XDG_DATA_HOME* Nvim: stdpath("data")
+ Unix: ~/.local/share ~/.local/share/nvim
+ Windows: ~/AppData/Local ~/AppData/Local/nvim-data
-DATA DIRECTORY *$XDG_DATA_HOME*
- Base Nvim ~
-Unix: ~/.local/share ~/.local/share/nvim
-Windows: ~/AppData/Local ~/AppData/Local/nvim-data
+Note: Throughout the user manual these defaults are used as placeholders, e.g.
+"~/.config" is understood to mean "$XDG_CONFIG_HOME or ~/.config".
LOG FILE *$NVIM_LOG_FILE*
Besides 'debug' and 'verbose', Nvim keeps a general log file for internal
diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt
index 418623687f..9de5745e92 100644
--- a/runtime/doc/term.txt
+++ b/runtime/doc/term.txt
@@ -257,90 +257,14 @@ effect on some UIs.
==============================================================================
Using the mouse *mouse-using*
-This section is about using the mouse on a terminal or a terminal window. How
-to use the mouse in a GUI window is explained in |gui-mouse|. For scrolling
-with a mouse wheel see |scroll-mouse-wheel|.
-
-These characters in the 'mouse' option tell in which situations the mouse will
-be used by Vim:
- n Normal mode
- v Visual mode
- i Insert mode
- c Command-line mode
- h all previous modes when in a help file
- a all previous modes
- r for |hit-enter| prompt
-
-If you only want to use the mouse in a few modes or also want to use it for
-the two questions you will have to concatenate the letters for those modes.
-For example: >
- :set mouse=nv
-Will make the mouse work in Normal mode and Visual mode. >
- :set mouse=h
-Will make the mouse work in help files only (so you can use "g<LeftMouse>" to
-jump to tags).
-
-Whether the selection that is started with the mouse is in Visual mode or
-Select mode depends on whether "mouse" is included in the 'selectmode'
-option.
-
-In an xterm, with the currently active mode included in the 'mouse' option,
-normal mouse clicks are used by Vim, mouse clicks with the shift or ctrl key
-pressed go to the xterm. With the currently active mode not included in
-'mouse' all mouse clicks go to the xterm.
-
- *xterm-clipboard*
-The middle mouse button will insert the unnamed register. In that case, here
-is how you copy and paste a piece of text:
-
-Copy/paste with the mouse and Visual mode ('mouse' option must be set, see
-above):
-1. Press left mouse button on first letter of text, move mouse pointer to last
- letter of the text and release the button. This will start Visual mode and
- highlight the selected area.
-2. Press "y" to yank the Visual text in the unnamed register.
-3. Click the left mouse button at the insert position.
-4. Click the middle mouse button.
-
-Shortcut: If the insert position is on the screen at the same time as the
-Visual text, you can do 2, 3 and 4 all in one: Click the middle mouse button
-at the insert position.
-
- *xterm-copy-paste*
-NOTE: In some (older) xterms, it's not possible to move the cursor past column
-95 or 223. This is an xterm problem, not Vim's. Get a newer xterm
-|color-xterm|.
-
-Copy/paste in xterm with (current mode NOT included in 'mouse'):
-1. Press left mouse button on first letter of text, move mouse pointer to last
- letter of the text and release the button.
-2. Use normal Vim commands to put the cursor at the insert position.
-3. Press "a" to start Insert mode.
-4. Click the middle mouse button.
-5. Press ESC to end Insert mode.
-(The same can be done with anything in 'mouse' if you keep the shift key
-pressed while using the mouse.)
-
-Note: if you lose the 8th bit when pasting (special characters are translated
-into other characters), you may have to do "stty cs8 -istrip -parenb" in your
-shell before starting Vim.
-
-Thus in an xterm the shift and ctrl keys cannot be used with the mouse. Mouse
-commands requiring the CTRL modifier can be simulated by typing the "g" key
-before using the mouse:
- "g<LeftMouse>" is "<C-LeftMouse> (jump to tag under mouse click)
- "g<RightMouse>" is "<C-RightMouse> ("CTRL-T")
-
*bracketed-paste-mode*
-Bracketed paste mode allows terminal applications to distinguish between typed
-text and pasted text. Thus you can paste text without Nvim trying to format or
-indent the text. See also https://cirw.in/blog/bracketed-paste
-
-Nvim enables bracketed paste by default. If it does not work in your terminal,
-try the 'paste' option instead.
+Nvim enables bracketed paste by default. Bracketed paste mode allows terminal
+applications to distinguish between typed text and pasted text. Thus you can
+paste text without Nvim trying to format or indent the text.
+See also https://cirw.in/blog/bracketed-paste
*mouse-mode-table* *mouse-overview*
-A short overview of what the mouse buttons do, when 'mousemodel' is "extend":
+Overview of what the mouse buttons do, when 'mousemodel' is "extend":
Normal Mode:
event position selection change action ~
@@ -451,14 +375,6 @@ In Insert mode, when a selection is started, Vim goes into Normal mode
temporarily. When Visual or Select mode ends, it returns to Insert mode.
This is like using CTRL-O in Insert mode. Select mode is used when the
'selectmode' option contains "mouse".
- *drag-status-line*
-When working with several windows, the size of the windows can be changed by
-dragging the status line with the mouse. Point the mouse at a status line,
-press the left button, move the mouse to the new position of the status line,
-release the button. Just clicking the mouse in a status line makes that window
-the current window, without moving the cursor. If by selecting a window it
-will change position or size, the dragging of the status line will look
-confusing, but it will work (just try it).
*<MiddleRelease>* *<MiddleDrag>*
Mouse clicks can be mapped. The codes for mouse clicks are:
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 3b5ba26b02..2615d8a108 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -205,19 +205,8 @@ certain features removed/added at compile-time. |feature-compile|
If a Python interpreter is available on your `$PATH`, |:python| and |:python3|
are always available and may be used simultaneously. See |provider-python|.
-|:!| does not support "interactive" commands. Use |:terminal| instead.
-(GUI Vim has a similar limitation, see ":help gui-pty" in Vim.)
-
-:!start is not special-cased on Windows.
-
-|system()| does not support writing/reading "backgrounded" commands. |E5677|
-
|:redir| nested in |execute()| works.
-Nvim may throttle (skip) messages from shell commands (|:!|, |:grep|, |:make|)
-if there is too much output. No data is lost, this only affects display and
-makes things faster. |:terminal| output is never throttled.
-
|mkdir()| behaviour changed:
1. Assuming /tmp/foo does not exist and /tmp can be written to
mkdir('/tmp/foo/bar', 'p', 0700) will create both /tmp/foo and /tmp/foo/bar
@@ -323,6 +312,22 @@ Normal commands:
Options:
'ttimeout', 'ttimeoutlen' behavior was simplified
+Shell:
+ Shell output (|:!|, |:make|, …) is always routed through the UI, so it
+ cannot "mess up" the screen. (You can still use "chansend(v:stderr,…)" if
+ you want to mess up the screen :)
+
+ Nvim throttles (skips) messages from shell commands (|:!|, |:grep|, |:make|)
+ if there is too much output. No data is lost, this only affects display and
+ improves performance. |:terminal| output is never throttled.
+
+ |:!| does not support "interactive" commands. Use |:terminal| instead.
+ (GUI Vim has a similar limitation, see ":help gui-pty" in Vim.)
+
+ :!start is not special-cased on Windows.
+
+ |system()| does not support writing/reading "backgrounded" commands. |E5677|
+
Startup:
|-e| and |-es| invoke the same "improved Ex mode" as -E and -Es.
|-E| and |-Es| reads stdin as text (into buffer 1).
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index f8a29fa2b3..3c158d9012 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1877,8 +1877,8 @@ au BufNewFile,BufRead *.yy,*.yxx,*.y++ setf yacc
" Yacc or racc
au BufNewFile,BufRead *.y call dist#ft#FTy()
-" Yaml
-au BufNewFile,BufRead *.yaml,*.yml setf yaml
+" Yaml or Raml
+au BufNewFile,BufRead *.yaml,*.yml,*.raml setf yaml
" yum conf (close enough to dosini)
au BufNewFile,BufRead */etc/yum.conf setf dosini
diff --git a/runtime/ftplugin/python.vim b/runtime/ftplugin/python.vim
index d52a338b5b..54926418de 100644
--- a/runtime/ftplugin/python.vim
+++ b/runtime/ftplugin/python.vim
@@ -3,7 +3,7 @@
" Maintainer: Tom Picton <tom@tompicton.co.uk>
" Previous Maintainer: James Sully <sullyj3@gmail.com>
" Previous Maintainer: Johannes Zellner <johannes@zellner.org>
-" Last Change: Fri, 20 October 2017
+" Last Change: Thur, 09 November 2017
" https://github.com/tpict/vim-ftplugin-python
if exists("b:did_ftplugin") | finish | endif
@@ -29,8 +29,8 @@ let b:next_endtoplevel='\v%$\|\S.*\n+(def\|class)'
let b:prev_endtoplevel='\v\S.*\n+(def\|class)'
let b:next='\v%$\|^\s*(class\|def\|async def)>'
let b:prev='\v^\s*(class\|def\|async def)>'
-let b:next_end='\v\S\n*(%$\|^\s*(class\|def\|async def)\|^\S)'
-let b:prev_end='\v\S\n*(^\s*(class\|def\|async def)\|^\S)'
+let b:next_end='\v\S\n*(%$\|^(\s*\n*)*(class\|def\|async def)\|^\S)'
+let b:prev_end='\v\S\n*(^(\s*\n*)*(class\|def\|async def)\|^\S)'
execute "nnoremap <silent> <buffer> ]] :call <SID>Python_jump('n', '". b:next_toplevel."', 'W')<cr>"
execute "nnoremap <silent> <buffer> [[ :call <SID>Python_jump('n', '". b:prev_toplevel."', 'Wb')<cr>"
@@ -43,8 +43,8 @@ execute "nnoremap <silent> <buffer> [M :call <SID>Python_jump('n', '". b:prev_en
execute "onoremap <silent> <buffer> ]] :call <SID>Python_jump('o', '". b:next_toplevel."', 'W')<cr>"
execute "onoremap <silent> <buffer> [[ :call <SID>Python_jump('o', '". b:prev_toplevel."', 'Wb')<cr>"
-execute "onoremap <silent> <buffer> ][ :call <SID>Python_jump('n', '". b:next_endtoplevel."', 'W', 0)<cr>"
-execute "onoremap <silent> <buffer> [] :call <SID>Python_jump('n', '". b:prev_endtoplevel."', 'Wb', 0)<cr>"
+execute "onoremap <silent> <buffer> ][ :call <SID>Python_jump('o', '". b:next_endtoplevel."', 'W', 0)<cr>"
+execute "onoremap <silent> <buffer> [] :call <SID>Python_jump('o', '". b:prev_endtoplevel."', 'Wb', 0)<cr>"
execute "onoremap <silent> <buffer> ]m :call <SID>Python_jump('o', '". b:next."', 'W')<cr>"
execute "onoremap <silent> <buffer> [m :call <SID>Python_jump('o', '". b:prev."', 'Wb')<cr>"
execute "onoremap <silent> <buffer> ]M :call <SID>Python_jump('o', '". b:next_end."', 'W', 0)<cr>"
@@ -52,8 +52,8 @@ execute "onoremap <silent> <buffer> [M :call <SID>Python_jump('o', '". b:prev_en
execute "xnoremap <silent> <buffer> ]] :call <SID>Python_jump('x', '". b:next_toplevel."', 'W')<cr>"
execute "xnoremap <silent> <buffer> [[ :call <SID>Python_jump('x', '". b:prev_toplevel."', 'Wb')<cr>"
-execute "xnoremap <silent> <buffer> ][ :call <SID>Python_jump('n', '". b:next_endtoplevel."', 'W', 0)<cr>"
-execute "xnoremap <silent> <buffer> [] :call <SID>Python_jump('n', '". b:prev_endtoplevel."', 'Wb', 0)<cr>"
+execute "xnoremap <silent> <buffer> ][ :call <SID>Python_jump('x', '". b:next_endtoplevel."', 'W', 0)<cr>"
+execute "xnoremap <silent> <buffer> [] :call <SID>Python_jump('x', '". b:prev_endtoplevel."', 'Wb', 0)<cr>"
execute "xnoremap <silent> <buffer> ]m :call <SID>Python_jump('x', '". b:next."', 'W')<cr>"
execute "xnoremap <silent> <buffer> [m :call <SID>Python_jump('x', '". b:prev."', 'Wb')<cr>"
execute "xnoremap <silent> <buffer> ]M :call <SID>Python_jump('x', '". b:next_end."', 'W', 0)<cr>"
diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim
index ba9ed76169..f34655f330 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: 2014 Sep 07
+" Last Change: 2017 Nov 06
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -25,6 +25,9 @@ setlocal fo-=t fo+=croql
" keyword character. E.g., for netrw#Nread().
setlocal isk+=#
+" Use :help to lookup the keyword under the cursor with K.
+setlocal keywordprg=:help
+
" Set 'comments' to format dashed lists in comments
setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"
diff --git a/runtime/ftplugin/zsh.vim b/runtime/ftplugin/zsh.vim
index c03a9466a1..fe8efc59ab 100644
--- a/runtime/ftplugin/zsh.vim
+++ b/runtime/ftplugin/zsh.vim
@@ -2,7 +2,7 @@
" Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2015-05-29
+" Latest Revision: 2017-11-22
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh
@@ -18,9 +18,7 @@ let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
-let b:match_words =
- \ &matchpairs
- \ . ',\<if\>:\<elif\>:\<else\>:\<fi\>'
+let b:match_words = ',\<if\>:\<elif\>:\<else\>:\<fi\>'
\ . ',\<case\>:^\s*([^)]*):\<esac\>'
\ . ',\<\%(select\|while\|until\|repeat\|for\%(each\)\=\)\>:\<done\>'
let b:match_skip = 's:comment\|string\|heredoc\|subst'
diff --git a/runtime/syntax/cf.vim b/runtime/syntax/cf.vim
index 6310bc3bde..04f9f5967b 100644
--- a/runtime/syntax/cf.vim
+++ b/runtime/syntax/cf.vim
@@ -1,437 +1,1018 @@
" Vim syntax file
-" Language: CFML
-" Maintainer: Toby Woodwark (toby.woodwark+vim@gmail.com)
-" Last Change: 2010-03-02
-" Filenames: *.cfc *.cfm
-" Version: Adobe ColdFusion 9
-" Usage: This file contains both syntax definitions
-" and a list of known builtin tags, functions and keywords.
-" Refs -
-" http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS8f0cc78011fffa71866534d11cdad96e4e-8000.html
-" http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec17324-8000.html
-" TODO:
-" Support the limited array literal and struct literal syntax in CF8+.
-" Highlight namespaced tags fom cfimport.
-" Complete CF9+ cfscript support.
-" Railo support.
-" Options:
-" d_noinclude_html - set to prevent HTML highlighting. Use this if you are not working on HTML.
-
-" Quit if a syntax file is already loaded.
+"
+" Language: CFML (ColdFusion)
+" Author: Ernst M. van der Linden <ernst.vanderlinden@ernestoz.com>
+" License: The MIT License (MIT)
+"
+" Maintainer: Ernst M. van der Linden <ernst.vanderlinden@ernestoz.com>
+" URL: https://github.com/ernstvanderlinden/vim-coldfusion
+" Last Change: 2017 Nov 28
+"
+" Filenames: *.cfc *.cfm
+
+" Quit when a syntax file was already loaded.
if exists("b:current_syntax")
finish
endif
-if exists("d_noinclude_html")
- " Define alternatives to the HTML syntax file.
-
- " Copied from html.vim - the rules for matching a CF tag match those for HTML/SGML.
- " CFML syntax is more permissive when it comes to superfluous <> chars.
- syn region htmlString contained start=+"+ end=+"+ contains=@htmlPreproc
- syn region htmlString contained start=+'+ end=+'+ contains=@htmlPreproc
- syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=@htmlPreproc
- " Hacked htmlTag so that it only matches cf tags and not random <> chars.
- syn region htmlEndTag start=+</cf+ end=+>+ contains=htmlTagN,htmlTagError
- syn region htmlTag start=+<\s*cf[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,@htmlPreproc,@htmlArgCluster
- syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,@htmlTagNameCluster
- syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,@htmlTagNameCluster
- syn match htmlTagError contained "[^>]<"ms=s+1
-else
- " Use all the stuff from the HTML syntax file.
- " This means eg HTML comments are highlighted as comments, even if they include cf tags.
- runtime! syntax/html.vim
-endif
-
-syn sync fromstart
-syn sync maxlines=200
-syn case ignore
-
-" Scopes and keywords.
-syn keyword cfScope contained cgi cffile cookie request caller this thistag
-syn keyword cfScope contained cfcatch variables application server session client form url local
-syn keyword cfScope contained arguments super cfhttp attributes error
-syn keyword cfBool contained yes no true false
-
-" Operator strings.
-" ColdFusion <=7:
-syn keyword cfOperator contained xor eqv and or lt le lte gt ge gte equal eq neq not is mod contains
-syn match cfOperatorMatch contained "+"
-syn match cfOperatorMatch contained "\-"
-syn match cfOperatorMatch contained "[\*\/\\\^\&][\+\-\*\/\\\^\&]\@!"
-syn match cfOperatorMatch contained "\<\(not\_s\+\)\?equal\>"
-syn match cfOperatorMatch contained "\<does\_s\+not\_s\+contain\>"
-syn match cfOperatorMatch contained "\<\(greater\|less\)\_s\+than\(\_s\+or\_s\+equal\_s\+to\)\?\>"
-" ColdFusion 8:
-syn keyword cfOperator contained imp
-syn match cfOperatorMatch contained "[?%:!]"
-syn match cfOperatorMatch contained "[\+\-\*\/\&]="
-syn match cfOperatorMatch contained "++"
-syn match cfOperatorMatch contained "--"
-syn match cfOperatorMatch contained "&&"
-syn match cfOperatorMatch contained "||"
-
-syn cluster cfOperatorCluster contains=cfOperator,cfOperatorMatch
-
-" Custom tags called with the <cf_xxx> syntax.
-syn match cfCustomTagName contained "\<cf_[a-zA-Z0-9_]\+\>"
-" (TODO match namespaced tags imported using cfimport, similarly.)
-
-" Tag names.
-" ColdFusion <=7:
-syn keyword cfTagName contained cfabort cfapplet cfapplication cfargument cfassociate
-syn keyword cfTagName contained cfbreak cfcache cfcalendar cfcase cfcatch
-syn keyword cfTagName contained cfchart cfchartdata cfchartseries cfcol cfcollection
-syn keyword cfTagName contained cfcomponent cfcontent cfcookie cfdefaultcase cfdirectory
-syn keyword cfTagName contained cfdocument cfdocumentitem cfdocumentsection cfdump cfelse
-syn keyword cfTagName contained cfelseif cferror cfexecute cfexit cffile cfflush cfform
-syn keyword cfTagName contained cfformgroup cfformitem cfftp cffunction
-syn keyword cfTagName contained cfgrid cfgridcolumn cfgridrow cfgridupdate cfheader
-syn keyword cfTagName contained cfhtmlhead cfhttp cfhttpparam cfif cfimport
-syn keyword cfTagName contained cfinclude cfindex cfinput cfinsert cfinvoke cfinvokeargument
-syn keyword cfTagName contained cfldap cflocation cflock cflog cflogin cfloginuser cflogout
-syn keyword cfTagName contained cfloop cfmail cfmailparam cfmailpart cfmodule
-syn keyword cfTagName contained cfNTauthenticate cfobject cfobjectcache cfoutput cfparam
-syn keyword cfTagName contained cfpop cfprocessingdirective cfprocparam cfprocresult
-syn keyword cfTagName contained cfproperty cfquery cfqueryparam cfregistry cfreport
-syn keyword cfTagName contained cfreportparam cfrethrow cfreturn cfsavecontent cfschedule
-syn keyword cfTagName contained cfscript cfsearch cfselect cfservletparam cfset
-syn keyword cfTagName contained cfsetting cfsilent cfslider cfstoredproc cfswitch cftable
-syn keyword cfTagName contained cftextarea cftextinput cfthrow cftimer cftrace cftransaction
-syn keyword cfTagName contained cftree cftreeitem cftry cfupdate cfwddx cfxml
-" ColdFusion 8:
-syn keyword cfTagName contained cfajaximport cfajaxproxy cfdbinfo cfdiv cfexchangecalendar
-syn keyword cfTagName contained cfexchangeconnection cfexchangecontact cfexchangefilter
-syn keyword cfTagName contained cfexchangemail cfexchangetask cffeed
-syn keyword cfTagName contained cfinterface cflayout cflayoutarea cfmenu cfmenuitem
-syn keyword cfTagName contained cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod
-syn keyword cfTagName contained cfpresentation cfpresentationslide cfpresenter cfprint
-syn keyword cfTagName contained cfsprydataset cfthread cftooltip cfwindow cfzip cfzipparam
-" ColdFusion 9:
-syn keyword cfTagName contained cfcontinue cffileupload cffinally
-syn keyword cfTagName contained cfimage cfimap
-syn keyword cfTagName contained cfmap cfmapitem cfmediaplayer cfmessagebox
-syn keyword cfTagName contained cfprocparam cfprogressbar
-syn keyword cfTagName contained cfsharepoint cfspreadsheet
-
-" Tag attributes.
-" XXX Not updated for ColdFusion 8/9.
-" These are becoming a headache to maintain, so might be removed.
-syn keyword cfArg contained abort accept access accessible action addnewline addtoken
-syn keyword cfArg contained agentname align appendkey appletsource application
-syn keyword cfArg contained applicationtimeout applicationtoken archive
-syn keyword cfArg contained argumentcollection arguments asciiextensionlist
-syn keyword cfArg contained attachmentpath attributecollection attributes autowidth
-syn keyword cfArg contained backgroundvisible basetag bcc bgcolor bind bindingname
-syn keyword cfArg contained blockfactor body bold border branch cachedafter cachedwithin
-syn keyword cfArg contained casesensitive category categorytree cc cfsqltype charset
-syn keyword cfArg contained chartheight chartwidth checked class clientmanagement
-syn keyword cfArg contained clientstorage codebase colheaderalign colheaderbold
-syn keyword cfArg contained colheaderfont colheaderfontsize colheaderitalic colheaders
-syn keyword cfArg contained colheadertextcolor collection colorlist colspacing columns
-syn keyword cfArg contained completepath component condition connection contentid
-syn keyword cfArg contained context contextbytes contexthighlightbegin
-syn keyword cfArg contained contexthighlightend contextpassages cookiedomain criteria
-syn keyword cfArg contained custom1 custom2 custom3 custom4 data dataalign
-syn keyword cfArg contained databackgroundcolor datacollection datasource daynames
-syn keyword cfArg contained dbname dbserver dbtype dbvarname debug default delete
-syn keyword cfArg contained deletebutton deletefile delimiter delimiters description
-syn keyword cfArg contained destination detail directory disabled display displayname
-syn keyword cfArg contained disposition dn domain editable enablecab enablecfoutputonly
-syn keyword cfArg contained enabled encoded encryption enctype enddate endrange endtime
-syn keyword cfArg contained entry errorcode exception existing expand expires expireurl
-syn keyword cfArg contained expression extendedinfo extends extensions external
-syn keyword cfArg contained failifexists failto file filefield filename filter
-syn keyword cfArg contained firstdayofweek firstrowasheaders fixnewline font fontbold
-syn keyword cfArg contained fontembed fontitalic fontsize foregroundcolor format
-syn keyword cfArg contained formfields formula from generateuniquefilenames getasbinary
-syn keyword cfArg contained grid griddataalign gridlines groovecolor group
-syn keyword cfArg contained groupcasesensitive header headeralign headerbold headerfont
-syn keyword cfArg contained headerfontsize headeritalic headerlines headertextcolor
-syn keyword cfArg contained height highlighthref hint href hrefkey hscroll hspace html
-syn keyword cfArg contained htmltable id idletimeout img imgopen imgstyle index inline
-syn keyword cfArg contained input insert insertbutton interval isolation italic item
-syn keyword cfArg contained itemcolumn key keyonly label labelformat language list
-syn keyword cfArg contained listgroups locale localfile log loginstorage lookandfeel
-syn keyword cfArg contained mailerid mailto marginbottom marginleft marginright
-syn keyword cfArg contained margintop markersize markerstyle mask max maxlength maxrows
-syn keyword cfArg contained message messagenumber method mimeattach mimetype min mode
-syn keyword cfArg contained modifytype monthnames multipart multiple name nameconflict
-syn keyword cfArg contained namespace new newdirectory notsupported null numberformat
-syn keyword cfArg contained object omit onblur onchange onclick onerror onfocus
-syn keyword cfArg contained onkeydown onkeyup onload onmousedown onmouseup onreset
-syn keyword cfArg contained onsubmit onvalidate operation orderby orientation output
-syn keyword cfArg contained outputfile overwrite ownerpassword pageencoding pageheight
-syn keyword cfArg contained pagetype pagewidth paintstyle param_1 param_2 param_3
-syn keyword cfArg contained param_4 param_5 param_6 param_7 param_8 param_9 parent
-syn keyword cfArg contained parrent passive passthrough password path pattern
-syn keyword cfArg contained permissions picturebar pieslicestyle port porttypename
-syn keyword cfArg contained prefix preloader preservedata previouscriteria procedure
-syn keyword cfArg contained protocol provider providerdsn proxybypass proxypassword
-syn keyword cfArg contained proxyport proxyserver proxyuser publish query queryasroot
-syn keyword cfArg contained queryposition range rebind recurse redirect referral
-syn keyword cfArg contained refreshlabel remotefile replyto report requesttimeout
-syn keyword cfArg contained required reset resoleurl resolveurl result resultset
-syn keyword cfArg contained retrycount returnasbinary returncode returntype
-syn keyword cfArg contained returnvariable roles rotated rowheaderalign rowheaderbold
-syn keyword cfArg contained rowheaderfont rowheaderfontsize rowheaderitalic rowheaders
-syn keyword cfArg contained rowheadertextcolor rowheaderwidth rowheight scale scalefrom
-syn keyword cfArg contained scaleto scope scriptprotect scriptsrc secure securitycontext
-syn keyword cfArg contained select selectcolor selected selecteddate selectedindex
-syn keyword cfArg contained selectmode separator seriescolor serieslabel seriesplacement
-syn keyword cfArg contained server serviceport serviceportname sessionmanagement
-syn keyword cfArg contained sessiontimeout setclientcookies setcookie setdomaincookies
-syn keyword cfArg contained show3d showborder showdebugoutput showerror showlegend
-syn keyword cfArg contained showmarkers showxgridlines showygridlines size skin sort
-syn keyword cfArg contained sortascendingbutton sortcontrol sortdescendingbutton
-syn keyword cfArg contained sortxaxis source spoolenable sql src srcfile start startdate
-syn keyword cfArg contained startrange startrow starttime status statuscode statustext
-syn keyword cfArg contained step stoponerror style subject suggestions
-syn keyword cfArg contained suppresswhitespace tablename tableowner tablequalifier
-syn keyword cfArg contained taglib target task template text textcolor textqualifier
-syn keyword cfArg contained throwonerror throwonerror throwonfailure throwontimeout
-syn keyword cfArg contained timeout timespan tipbgcolor tipstyle title to tooltip
-syn keyword cfArg contained toplevelvariable transfermode type uid unit url urlpath
-syn keyword cfArg contained useragent username userpassword usetimezoneinfo validate
-syn keyword cfArg contained validateat value valuecolumn values valuesdelimiter
-syn keyword cfArg contained valuesdisplay var variable vertical visible vscroll vspace
-syn keyword cfArg contained webservice width wmode wraptext wsdlfile xaxistitle
-syn keyword cfArg contained xaxistype xoffset yaxistitle yaxistype yoffset
-
-" Functions.
-" ColdFusion <=7:
-syn keyword cfFunctionName contained ACos ASin Abs AddSOAPRequestHeader AddSOAPResponseHeader
-syn keyword cfFunctionName contained ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ArrayInsertAt
-syn keyword cfFunctionName contained ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArrayNew
-syn keyword cfFunctionName contained ArrayPrepend ArrayResize ArraySet ArraySort ArraySum
-syn keyword cfFunctionName contained ArraySwap ArrayToList Asc Atn AuthenticatedContext
-syn keyword cfFunctionName contained AuthenticatedUser BinaryDecode BinaryEncode BitAnd
-syn keyword cfFunctionName contained BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN
-syn keyword cfFunctionName contained BitSHRN BitXor CJustify Ceiling CharsetDecode CharsetEncode
-syn keyword cfFunctionName contained Chr Compare CompareNoCase Cos CreateDate CreateDateTime
-syn keyword cfFunctionName contained CreateODBCDate CreateODBCDateTime CreateODBCTime
-syn keyword cfFunctionName contained CreateObject CreateTime CreateTimeSpan CreateUUID DE DateAdd
-syn keyword cfFunctionName contained DateCompare DateConvert DateDiff DateFormat DatePart Day
-syn keyword cfFunctionName contained DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear
-syn keyword cfFunctionName contained DecimalFormat DecrementValue Decrypt DecryptBinary
-syn keyword cfFunctionName contained DeleteClientVariable DirectoryExists DollarFormat Duplicate
-syn keyword cfFunctionName contained Encrypt EncryptBinary Evaluate Exp ExpandPath FileExists
-syn keyword cfFunctionName contained Find FindNoCase FindOneOf FirstDayOfMonth Fix FormatBaseN
-syn keyword cfFunctionName contained GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList
-syn keyword cfFunctionName contained GetBaseTemplatePath GetClientVariablesList GetContextRoot
-syn keyword cfFunctionName contained GetCurrentTemplatePath GetDirectoryFromPath GetEncoding
-syn keyword cfFunctionName contained GetException GetFileFromPath GetFunctionList
-syn keyword cfFunctionName contained GetGatewayHelper GetHttpRequestData GetHttpTimeString
-syn keyword cfFunctionName contained GetLocalHostIP
-syn keyword cfFunctionName contained GetLocale GetLocaleDisplayName GetMetaData GetMetricData
-syn keyword cfFunctionName contained GetPageContext GetProfileSections GetProfileString
-syn keyword cfFunctionName contained GetSOAPRequest GetSOAPRequestHeader GetSOAPResponse
-syn keyword cfFunctionName contained GetSOAPResponseHeader GetTempDirectory GetTempFile
-syn keyword cfFunctionName contained GetTickCount GetTimeZoneInfo GetToken
-syn keyword cfFunctionName contained HTMLCodeFormat HTMLEditFormat Hash Hour IIf IncrementValue
-syn keyword cfFunctionName contained InputBaseN Insert Int IsArray IsAuthenticated IsAuthorized
-syn keyword cfFunctionName contained IsBinary IsBoolean IsCustomFunction IsDate IsDebugMode
-syn keyword cfFunctionName contained IsDefined
-syn keyword cfFunctionName contained IsLeapYear IsLocalHost IsNumeric
-syn keyword cfFunctionName contained IsNumericDate IsObject IsProtected IsQuery IsSOAPRequest
-syn keyword cfFunctionName contained IsSimpleValue IsStruct IsUserInRole IsValid IsWDDX IsXML
-syn keyword cfFunctionName contained IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot
-syn keyword cfFunctionName contained JSStringFormat JavaCast LCase LJustify LSCurrencyFormat
-syn keyword cfFunctionName contained LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate
-syn keyword cfFunctionName contained LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime
-syn keyword cfFunctionName contained LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Left
-syn keyword cfFunctionName contained Len ListAppend ListChangeDelims ListContains
-syn keyword cfFunctionName contained ListContainsNoCase ListDeleteAt ListFind ListFindNoCase
-syn keyword cfFunctionName contained ListFirst ListGetAt ListInsertAt ListLast ListLen
-syn keyword cfFunctionName contained ListPrepend ListQualify ListRest ListSetAt ListSort
-syn keyword cfFunctionName contained ListToArray ListValueCount ListValueCountNoCase Log Log10
-syn keyword cfFunctionName contained Max Mid Min Minute Month MonthAsString Now NumberFormat
-syn keyword cfFunctionName contained ParagraphFormat ParseDateTime Pi
-syn keyword cfFunctionName contained PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow
-syn keyword cfFunctionName contained QueryNew QuerySetCell QuotedValueList REFind REFindNoCase
-syn keyword cfFunctionName contained REReplace REReplaceNoCase RJustify RTrim Rand RandRange
-syn keyword cfFunctionName contained Randomize ReleaseComObject RemoveChars RepeatString Replace
-syn keyword cfFunctionName contained ReplaceList ReplaceNoCase Reverse Right Round Second
-syn keyword cfFunctionName contained SendGatewayMessage SetEncoding SetLocale SetProfileString
-syn keyword cfFunctionName contained SetVariable Sgn Sin SpanExcluding SpanIncluding Sqr StripCR
-syn keyword cfFunctionName contained StructAppend StructClear StructCopy StructCount StructDelete
-syn keyword cfFunctionName contained StructFind StructFindKey StructFindValue StructGet
-syn keyword cfFunctionName contained StructInsert StructIsEmpty StructKeyArray StructKeyExists
-syn keyword cfFunctionName contained StructKeyList StructNew StructSort StructUpdate Tan
-syn keyword cfFunctionName contained TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase
-syn keyword cfFunctionName contained URLDecode URLEncodedFormat URLSessionFormat Val ValueList
-syn keyword cfFunctionName contained Week Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat
-syn keyword cfFunctionName contained XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform
-syn keyword cfFunctionName contained XmlValidate Year YesNoFormat
-" ColdFusion 8:
-syn keyword cfFunctionName contained AjaxLink AjaxOnLoad ArrayIsDefined BinaryDecode BinaryEncode CharsetDecode CharsetEncode
-syn keyword cfFunctionName contained DecryptBinary DeserializeJSON DotNetToCFType EncryptBinary FileClose FileCopy FileDelete
-syn keyword cfFunctionName contained FileIsEOF FileMove FileOpen FileRead FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute
-syn keyword cfFunctionName contained FileSetLastModified FileWrite GenerateSecretKey GetGatewayHelper GetAuthUser GetComponentMetaData
-syn keyword cfFunctionName contained GetContextRoot GetEncoding GetFileInfo GetLocaleDisplayName GetLocalHostIP GetMetaData
-syn keyword cfFunctionName contained GetPageContext GetPrinterInfo GetProfileSections GetReadableImageFormats GetSOAPRequest
-syn keyword cfFunctionName contained GetSOAPRequestHeader GetSOAPResponse GetSOAPResponseHeader GetUserRoles GetWriteableImageFormats
-syn keyword cfFunctionName contained ImageAddBorder ImageBlur ImageClearRect ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect
-syn keyword cfFunctionName contained ImageDrawCubicCurve ImageDrawPoint ImageDrawLine ImageDrawLines ImageDrawOval
-syn keyword cfFunctionName contained ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob
-syn keyword cfFunctionName contained ImageGetBufferedImage ImageGetEXIFMetadata ImageGetEXIFTag ImageGetHeight ImageGetIPTCMetadata
-syn keyword cfFunctionName contained ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay
-syn keyword cfFunctionName contained ImagePaste ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit
-" ColdFusion 9:
-syn keyword cfFunctionName contained ApplicationStop ArrayContains ArrayDelete ArrayFind ArrayFindNoCase IsSpreadsheetFile
-syn keyword cfFunctionName contained IsSpreadsheetObject FileSkipBytes Location ObjectLoad SpreadsheetFormatColumn
-syn keyword cfFunctionName contained SpreadsheetFormatColumns SpreadsheetFormatRow SpreadsheetFormatRows SpreadsheetGetCellComment
-syn keyword cfFunctionName contained CacheGetAllIds CacheGetMetadata CacheGetProperties CacheGet CachePut ObjectSave ORMClearSession
-syn keyword cfFunctionName contained ORMCloseSession ORMEvictQueries ORMEvictCollection SpreadsheetGetCellFormula SpreadsheetGetCellValue
-syn keyword cfFunctionName contained SpreadsheetInfo SpreadsheetMergeCells SpreadsheetNew CacheRemove CacheSetProperties DirectoryCreate
-syn keyword cfFunctionName contained DirectoryDelete DirectoryExists ORMEvictEntity ORMEvictQueries ORMExecuteQuery ORMFlush
-syn keyword cfFunctionName contained ORMGetSession SpreadsheetRead SpreadsheetReadBinary SpreadsheetSetActiveSheetNumber
-syn keyword cfFunctionName contained SpreadsheetSetCellComment SpreadsheetSetCellFormula DirectoryList DirectoryRename EntityDelete
-syn keyword cfFunctionName contained EntityLoad EntityLoadByExample ORMGetSessionFactory ORMReload ObjectEquals SpreadsheetAddColumn
-syn keyword cfFunctionName contained SpreadsheetAddFreezePane SpreadsheetSetCellValue SpreadsheetSetActiveSheet SpreadsheetSetFooter
-syn keyword cfFunctionName contained SpreadsheetSetHeader SpreadsheetSetColumnWidth EntityLoadByPK EntityMerge EntityNew EntityReload
-syn keyword cfFunctionName contained EntitySave SpreadsheetAddImage SpreadsheetAddInfo SpreadsheetAddRow SpreadsheetAddRows
-syn keyword cfFunctionName contained SpreadsheetAddSplitPane SpreadsheetShiftColumns SpreadsheetShiftRows SpreadsheetSetRowHeight
-syn keyword cfFunctionName contained SpreadsheetWrite Trace FileDelete FileSeek FileWriteLine GetFunctionCalledName GetVFSMetaData IsIPv6
-syn keyword cfFunctionName contained IsNull SpreadsheetCreateSheet SpreadsheetDeleteColumn SpreadsheetDeleteColumns SpreadsheetDeleteRow
-syn keyword cfFunctionName contained SpreadsheetDeleteRows SpreadsheetFormatCell TransactionCommit TransactionRollback
-syn keyword cfFunctionName contained TransactionSetSavePoint ThreadTerminate ThreadJoin Throw Writedump Writelog
-
-" Deprecated or obsoleted tags and functions.
-syn keyword cfDeprecatedTag contained cfauthenticate cfimpersonate cfgraph cfgraphdata
-syn keyword cfDeprecatedTag contained cfservlet cfservletparam cftextinput
-syn keyword cfDeprecatedTag contained cfinternaladminsecurity cfnewinternaladminsecurity
-syn keyword cfDeprecatedFunction contained GetK2ServerDocCount GetK2ServerDocCountLimit GetTemplatePath
-syn keyword cfDeprecatedFunction contained IsK2ServerABroker IsK2ServerDocCountExceeded IsK2ServerOnline
-syn keyword cfDeprecatedFunction contained ParameterExists AuthenticatedContext AuthenticatedUser
-syn keyword cfDeprecatedFunction contained isAuthenticated isAuthorized isProtected
-
-" Add to the HTML clusters.
-syn cluster htmlTagNameCluster add=cfTagName,cfCustomTagName,cfDeprecatedTag
-syn cluster htmlArgCluster add=cfArg,cfHashRegion,cfScope
-syn cluster htmlPreproc add=cfHashRegion
-
-syn cluster cfExpressionCluster contains=cfFunctionName,cfScope,@cfOperatorCluster,cfScriptStringD,cfScriptStringS,cfScriptNumber,cfBool,cfComment
-
-" Evaluation; skip strings ( this helps with cases like nested IIf() )
-" containedin to add to the TOP of cfOutputRegion.
-syn region cfHashRegion start=+#+ skip=+"[^"]*"\|'[^']*'+ end=+#+ contained containedin=cfOutputRegion contains=@cfExpressionCluster,cfScriptParenError
-
-" Hashmarks are significant inside cfoutput tags.
-" cfoutput tags may be nested indefinitely.
-syn region cfOutputRegion matchgroup=NONE transparent start=+<cfoutput>+ end=+</cfoutput>+ contains=TOP
-
-" <cfset>, <cfif>, <cfelseif>, <cfreturn> are analogous to hashmarks (implicit
-" evaluation) and have 'var'
-syn region cfSetRegion start="<cfset\>" start="<cfreturn\>" start="<cfelseif\>" start="<cfif\>" end='>' keepend contains=@cfExpressionCluster,cfSetLHSRegion,cfSetTagEnd,cfScriptStatement
-syn region cfSetLHSRegion contained start="<cfreturn" start="<cfelseif" start="<cfif" start="<cfset" end="." keepend contains=cfTagName,htmlTag
-syn match cfSetTagEnd contained '>'
-
-" CF comments: similar to SGML comments, but can be nested.
-syn region cfComment start='<!---' end='--->' contains=cfCommentTodo,cfComment
-syn keyword cfCommentTodo contained TODO FIXME XXX TBD WTF
-
-" CFscript
-" TODO better support for new component/function def syntax
-" TODO better support for 'new'
-" TODO highlight metadata (@ ...) inside comments.
-syn match cfScriptLineComment contained "\/\/.*$" contains=cfCommentTodo
-syn region cfScriptComment contained start="/\*" end="\*/" contains=cfCommentTodo
-syn match cfScriptBraces contained "[{}]"
-syn keyword cfScriptStatement contained return var
-" in CF, quotes are escaped by doubling
-syn region cfScriptStringD contained start=+"+ skip=+\\\\\|""+ end=+"+ extend contains=@htmlPreproc,cfHashRegion
-syn region cfScriptStringS contained start=+'+ skip=+\\\\\|''+ end=+'+ extend contains=@htmlPreproc,cfHashRegion
-syn match cfScriptNumber contained "\<\d\+\>"
-syn keyword cfScriptConditional contained if else
-syn keyword cfScriptRepeat contained while for in
-syn keyword cfScriptBranch contained break switch case default try catch continue finally
-syn keyword cfScriptKeyword contained function
-" argumentCollection is a special argument to function calls
-syn keyword cfScriptSpecial contained argumentcollection
-" ColdFusion 9:
-syn keyword cfScriptStatement contained new import
-" CFscript equivalents of some tags
-syn keyword cfScriptKeyword contained abort component exit import include
-syn keyword cfScriptKeyword contained interface param pageencoding property rethrow thread transaction
-" function/component syntax
-syn keyword cfScriptSpecial contained required extends
-
-
-syn cluster cfScriptCluster contains=cfScriptParen,cfScriptLineComment,cfScriptComment,cfScriptStringD,cfScriptStringS,cfScriptFunction,cfScriptNumber,cfScriptRegexpString,cfScriptBoolean,cfScriptBraces,cfHashRegion,cfFunctionName,cfDeprecatedFunction,cfScope,@cfOperatorCluster,cfScriptConditional,cfScriptRepeat,cfScriptBranch,@cfExpressionCluster,cfScriptStatement,cfScriptSpecial,cfScriptKeyword
-
-" Errors caused by wrong parenthesis; skip strings
-syn region cfScriptParen contained transparent skip=+"[^"]*"\|'[^']*'+ start=+(+ end=+)+ contains=@cfScriptCluster
-syn match cfScrParenError contained +)+
-
-syn region cfscriptBlock matchgroup=NONE start="<cfscript>" end="<\/cfscript>"me=s-1 keepend contains=@cfScriptCluster,cfscriptTag,cfScrParenError
-syn region cfscriptTag contained start='<cfscript' end='>' keepend contains=cfTagName,htmlTag
-
-" CFML
-syn cluster cfmlCluster contains=cfComment,@htmlTagNameCluster,@htmlPreproc,cfSetRegion,cfscriptBlock,cfOutputRegion
-
-" cfquery = sql syntax
-if exists("b:current_syntax")
- unlet b:current_syntax
-endif
-syn include @cfSql $VIMRUNTIME/syntax/sql.vim
-unlet b:current_syntax
-syn region cfqueryTag contained start=+<cfquery+ end=+>+ keepend contains=cfTagName,htmlTag
-syn region cfSqlregion start=+<cfquery\_[^>]*>+ keepend end=+</cfquery>+me=s-1 matchgroup=NONE contains=@cfSql,cfComment,@htmlTagNameCluster,cfqueryTag,cfHashRegion
-
-" Define the highlighting.
-
-if exists("d_noinclude_html")
- " The default html-style highlighting copied from html.vim.
- hi def link htmlTag Function
- hi def link htmlEndTag Identifier
- hi def link htmlArg Type
- hi def link htmlTagName htmlStatement
- hi def link htmlValue String
- hi def link htmlPreProc PreProc
- hi def link htmlString String
- hi def link htmlStatement Statement
- hi def link htmlValue String
- hi def link htmlTagError htmlError
- hi def link htmlError Error
-endif
-
-hi def link cfTagName Statement
-hi def link cfCustomTagName Statement
-hi def link cfArg Type
-hi def link cfFunctionName Function
-hi def link cfHashRegion PreProc
-hi def link cfComment Comment
-hi def link cfCommentTodo Todo
-hi def link cfOperator Operator
-hi def link cfOperatorMatch Operator
-hi def link cfScope Title
-hi def link cfBool Constant
-
-hi def link cfscriptBlock Special
-hi def link cfscriptTag htmlTag
-hi def link cfSetRegion PreProc
-hi def link cfSetLHSRegion htmlTag
-hi def link cfSetTagEnd htmlTag
-
-hi def link cfScriptLineComment Comment
-hi def link cfScriptComment Comment
-hi def link cfScriptStringS String
-hi def link cfScriptStringD String
-hi def link cfScriptNumber cfScriptValue
-hi def link cfScriptConditional Conditional
-hi def link cfScriptRepeat Repeat
-hi def link cfScriptBranch Conditional
-hi def link cfScriptSpecial Type
-hi def link cfScriptStatement Statement
-hi def link cfScriptBraces Function
-hi def link cfScriptKeyword Function
-hi def link cfScriptError Error
-hi def link cfDeprecatedTag Error
-hi def link cfDeprecatedFunction Error
-hi def link cfScrParenError cfScriptError
-
-hi def link cfqueryTag htmlTag
-
-let b:current_syntax = "cf"
-
-" vim: nowrap sw=2 ts=8 noet
+" Using line continuation here.
+let s:cpo_save=&cpo
+set cpo-=C
+
+sy sync fromstart
+" 20171126: disabled as we have fast computers now.
+"sy sync maxlines=2000
+sy case ignore
+
+" INCLUDES {{{
+sy include @sqlSyntax $VIMRUNTIME/syntax/sql.vim
+" 20161010: Disabled include html highlighting as it contains huge keywords
+" regex, so it will have impact on performance. Use own simple SGML tag
+" coloring instead.
+"runtime! syntax/html.vim
+" / INCLUDES }}}
+
+" NUMBER {{{
+sy match cfmlNumber
+ \ "\v<\d+>"
+" / NUMBER }}}
+
+" EQUAL SIGN {{{
+sy match cfmlEqualSign
+ \ "\v\="
+" / EQUAL SIGN }}}
+
+" BOOLEAN {{{
+sy match cfmlBoolean
+ \ "\v<(true|false)>"
+" / BOOLEAN }}}
+
+" HASH SURROUNDED {{{
+sy region cfmlHashSurround
+ \ keepend
+ \ oneline
+ \ start="#"
+ \ end="#"
+ \ skip="##"
+ \ contains=
+ \@cfmlOperator,
+ \@cfmlPunctuation,
+ \cfmlBoolean,
+ \cfmlCoreKeyword,
+ \cfmlCoreScope,
+ \cfmlCustomKeyword,
+ \cfmlCustomScope,
+ \cfmlEqualSign,
+ \cfmlFunctionName,
+ \cfmlNumber
+" / HASH SURROUNDED }}}
+
+" OPERATOR {{{
+
+" OPERATOR - ARITHMETIC {{{
+" +7 -7
+" ++i --i
+" i++ i--
+" + - * / %
+" += -= *= /= %=
+" ^ mod
+sy match cfmlArithmeticOperator
+ \ "\v
+ \(\+|-)\ze\d
+ \|(\+\+|--)\ze\w
+ \|\w\zs(\+\+|--)
+ \|(\s(
+ \(\+|-|\*|\/|\%){1}\={,1}
+ \|\^
+ \|mod
+ \)\s)
+ \"
+" / OPERATOR - ARITHMETIC }}}
+
+" OPERATOR - BOOLEAN {{{
+" not and or xor eqv imp
+" ! && ||
+sy match cfmlBooleanOperator
+ \ "\v\s
+ \(not|and|or|xor|eqv|imp
+ \|\!|\&\&|\|\|
+ \)(\s|\))
+ \|\s\!\ze\w
+ \"
+" / OPERATOR - BOOLEAN }}}
+
+" OPERATOR - DECISION {{{
+"is|equal|eq
+"is not|not equal|neq
+"contains|does not contain
+"greater than|gt
+"less than|lt
+"greater than or equal to|gte|ge
+"less than or equal to|lte|le
+"==|!=|>|<|>=|<=
+sy match cfmlDecisionOperator
+ \ "\v\s
+ \(is|equal|eq
+ \|is not|not equal|neq
+ \|contains|does not contain
+ \|greater than|gt
+ \|less than|lt
+ \|greater than or equal to|gte|ge
+ \|less than or equal to|lte|le
+ \|(!|\<|\>|\=){1}\=
+ \|\<
+ \|\>
+ \)\s"
+" / OPERATOR - DECISION }}}
+
+" OPERATOR - STRING {{{
+" &
+" &=
+sy match cfmlStringOperator
+ \ "\v\s\&\={,1}\s"
+" / OPERATOR - STRING }}}
+
+" OPERATOR - TERNARY {{{
+" ? :
+sy match cfmlTernaryOperator
+ \ "\v\s
+ \\?|\:
+ \\s"
+" / OPERATOR - TERNARY }}}
+
+sy cluster cfmlOperator
+ \ contains=
+ \cfmlArithmeticOperator,
+ \cfmlBooleanOperator,
+ \cfmlDecisionOperator,
+ \cfmlStringOperator,
+ \cfmlTernaryOperator
+" / OPERATOR }}}
+
+" PARENTHESIS {{{
+sy cluster cfmlParenthesisRegionContains
+ \ contains=
+ \@cfmlAttribute,
+ \@cfmlComment,
+ \@cfmlFlowStatement,
+ \@cfmlOperator,
+ \@cfmlPunctuation,
+ \cfmlBoolean,
+ \cfmlBrace,
+ \cfmlCoreKeyword,
+ \cfmlCoreScope,
+ \cfmlCustomKeyword,
+ \cfmlCustomScope,
+ \cfmlEqualSign,
+ \cfmlFunctionName,
+ \cfmlNumber,
+ \cfmlStorageKeyword,
+ \cfmlStorageType
+
+sy region cfmlParenthesisRegion1
+ \ extend
+ \ matchgroup=cfmlParenthesis1
+ \ transparent
+ \ start=/(/
+ \ end=/)/
+ \ contains=
+ \cfmlParenthesisRegion2,
+ \@cfmlParenthesisRegionContains
+sy region cfmlParenthesisRegion2
+ \ matchgroup=cfmlParenthesis2
+ \ transparent
+ \ start=/(/
+ \ end=/)/
+ \ contains=
+ \cfmlParenthesisRegion3,
+ \@cfmlParenthesisRegionContains
+sy region cfmlParenthesisRegion3
+ \ matchgroup=cfmlParenthesis3
+ \ transparent
+ \ start=/(/
+ \ end=/)/
+ \ contains=
+ \cfmlParenthesisRegion1,
+ \@cfmlParenthesisRegionContains
+sy cluster cfmlParenthesisRegion
+ \ contains=
+ \cfmlParenthesisRegion1,
+ \cfmlParenthesisRegion2,
+ \cfmlParenthesisRegion3
+" / PARENTHESIS }}}
+
+" BRACE {{{
+sy match cfmlBrace
+ \ "{\|}"
+
+sy region cfmlBraceRegion
+ \ extend
+ \ fold
+ \ keepend
+ \ transparent
+ \ start="{"
+ \ end="}"
+" / BRACE }}}
+
+" PUNCTUATION {{{
+
+" PUNCTUATION - BRACKET {{{
+sy match cfmlBracket
+ \ "\(\[\|\]\)"
+ \ contained
+" / PUNCTUATION - BRACKET }}}
+
+" PUNCTUATION - CHAR {{{
+sy match cfmlComma ","
+sy match cfmlDot "\."
+sy match cfmlSemiColon ";"
+
+" / PUNCTUATION - CHAR }}}
+
+" PUNCTUATION - QUOTE {{{
+sy region cfmlSingleQuotedValue
+ \ matchgroup=cfmlSingleQuote
+ \ start=/'/
+ \ skip=/''/
+ \ end=/'/
+ \ contains=
+ \cfmlHashSurround
+
+sy region cfmlDoubleQuotedValue
+ \ matchgroup=cfmlDoubleQuote
+ \ start=/"/
+ \ skip=/""/
+ \ end=/"/
+ \ contains=
+ \cfmlHashSurround
+
+sy cluster cfmlQuotedValue
+ \ contains=
+ \cfmlDoubleQuotedValue,
+ \cfmlSingleQuotedValue
+
+sy cluster cfmlQuote
+ \ contains=
+ \cfmlDoubleQuote,
+ \cfmlSingleQuote
+" / PUNCTUATION - QUOTE }}}
+
+sy cluster cfmlPunctuation
+ \ contains=
+ \@cfmlQuote,
+ \@cfmlQuotedValue,
+ \cfmlBracket,
+ \cfmlComma,
+ \cfmlDot,
+ \cfmlSemiColon
+
+" / PUNCTUATION }}}
+
+" TAG START AND END {{{
+" tag start
+" <cf...>
+" s^^ e
+sy region cfmlTagStart
+ \ keepend
+ \ transparent
+ \ start="\c<cf_*"
+ \ end=">"
+\ contains=
+ \@cfmlAttribute,
+ \@cfmlComment,
+ \@cfmlOperator,
+ \@cfmlParenthesisRegion,
+ \@cfmlPunctuation,
+ \@cfmlQuote,
+ \@cfmlQuotedValue,
+ \cfmlAttrEqualSign,
+ \cfmlBoolean,
+ \cfmlBrace,
+ \cfmlCoreKeyword,
+ \cfmlCoreScope,
+ \cfmlCustomKeyword,
+ \cfmlCustomScope,
+ \cfmlEqualSign,
+ \cfmlFunctionName,
+ \cfmlNumber,
+ \cfmlStorageKeyword,
+ \cfmlStorageType,
+ \cfmlTagBracket,
+ \cfmlTagName
+
+" tag end
+" </cf...>
+" s^^^ e
+sy match cfmlTagEnd
+ \ transparent
+ \ "\c</cf_*[^>]*>"
+ \ contains=
+ \cfmlTagBracket,
+ \cfmlTagName
+
+" tag bracket
+" </...>
+" ^^ ^
+sy match cfmlTagBracket
+ \ contained
+ \ "\(<\|>\|\/\)"
+
+" tag name
+" <cf...>
+" s^^^e
+sy match cfmlTagName
+ \ contained
+ \ "\v<\/*\zs\ccf\w*"
+" / TAG START AND END }}}
+
+" ATTRIBUTE NAME AND VALUE {{{
+sy match cfmlAttrName
+ \ contained
+ \ "\v(var\s)@<!\w+\ze\s*\=([^\=])+"
+
+sy match cfmlAttrValue
+ \ contained
+ \ "\v(\=\"*)\zs\s*\w*"
+
+sy match cfmlAttrEqualSign
+ \ contained
+ \ "\v\="
+
+sy cluster cfmlAttribute
+\ contains=
+ \@cfmlQuotedValue,
+ \cfmlAttrEqualSign,
+ \cfmlAttrName,
+ \cfmlAttrValue,
+ \cfmlCoreKeyword,
+ \cfmlCoreScope
+" / ATTRIBUTE NAME AND VALUE }}}
+
+" TAG REGION AND FOLDING {{{
+
+" CFCOMPONENT REGION AND FOLD {{{
+" <cfcomponent
+" s^^^^^^^^^^^
+" </cfcomponent>
+" ^^^^^^^^^^^^^e
+sy region cfmlComponentTagRegion
+ \ fold
+ \ keepend
+ \ transparent
+ \ start="\c<cfcomponent"
+ \ end="\c</cfcomponent>"
+
+" / CFCOMPONENT REGION AND FOLD }}}
+
+" CFFUNCTION REGION AND FOLD {{{
+" <cffunction
+" s^^^^^^^^^^
+" </cffunction>
+" ^^^^^^^^^^^^e
+sy region cfmlFunctionTagRegion
+ \ fold
+ \ keepend
+ \ transparent
+ \ start="\c<cffunction"
+ \ end="\c</cffunction>"
+" / CFFUNCTION REGION AND FOLD }}}
+
+" CFIF REGION AND FOLD {{{
+" <cfif
+" s^^^^
+" </cfif>
+" ^^^^^^e
+sy region cfmlIfTagRegion
+ \ fold
+ \ keepend
+ \ transparent
+ \ start="\c<cfif"
+ \ end="\c</cfif>"
+" / CFIF REGION AND FOLD }}}
+
+" CFLOOP REGION AND FOLD {{{
+" <cfloop
+" s^^^^^^
+" </cfloop>
+" ^^^^^^^^e
+sy region cfmlLoopTagRegion
+ \ fold
+ \ keepend
+ \ transparent
+ \ start="\c<cfloop"
+ \ end="\c</cfloop>"
+" / CFLOOP REGION AND FOLD }}}
+
+" CFOUTPUT REGION AND FOLD {{{
+" <cfoutput
+" s^^^^^^^^
+" </cfoutput>
+" ^^^^^^^^^^e
+sy region cfmlOutputTagRegion
+ \ fold
+ \ keepend
+ \ transparent
+ \ start="\c<cfoutput"
+ \ end="\c</cfoutput>"
+" / CFOUTPUT REGION AND FOLD }}}
+
+" CFQUERY REGION AND FOLD {{{
+" <cfquery
+" s^^^^^^^
+" </cfquery>
+" ^^^^^^^^^e
+ "\@cfmlSqlStatement,
+sy region cfmlQueryTagRegion
+ \ fold
+ \ keepend
+ \ transparent
+ \ start="\c<cfquery"
+ \ end="\c</cfquery>"
+ \ contains=
+ \@cfmlSqlStatement,
+ \cfmlTagStart,
+ \cfmlTagEnd,
+ \cfmlTagComment
+" / CFQUERY REGION AND FOLD }}}
+
+" SAVECONTENT REGION AND FOLD {{{
+" <savecontent
+" s^^^^^^^^^^^
+" </savecontent>
+" ^^^^^^^^^^^^^e
+sy region cfmlSavecontentTagRegion
+ \ fold
+ \ keepend
+ \ transparent
+ \ start="\c<cfsavecontent"
+ \ end="\c</cfsavecontent>"
+" / SAVECONTENT REGION AND FOLD }}}
+
+" CFSCRIPT REGION AND FOLD {{{
+" <cfscript>
+" s^^^^^^^^^
+" </cfscript>
+" ^^^^^^^^^^e
+"\cfmlCustomScope,
+sy region cfmlScriptTagRegion
+ \ fold
+ \ keepend
+ \ transparent
+ \ start="\c<cfscript>"
+ \ end="\c</cfscript>"
+ \ contains=
+ \@cfmlComment,
+ \@cfmlFlowStatement,
+ \cfmlHashSurround,
+ \@cfmlOperator,
+ \@cfmlParenthesisRegion,
+ \@cfmlPunctuation,
+ \cfmlBoolean,
+ \cfmlBrace,
+ \cfmlCoreKeyword,
+ \cfmlCoreScope,
+ \cfmlCustomKeyword,
+ \cfmlCustomScope,
+ \cfmlEqualSign,
+ \cfmlFunctionDefinition,
+ \cfmlFunctionName,
+ \cfmlNumber,
+ \cfmlOddFunction,
+ \cfmlStorageKeyword,
+ \cfmlTagEnd,
+ \cfmlTagStart
+" / CFSCRIPT REGION AND FOLD }}}
+
+" CFSWITCH REGION AND FOLD {{{
+" <cfswitch
+" s^^^^^^^^
+" </cfswitch>
+" ^^^^^^^^^^e
+sy region cfmlSwitchTagRegion
+ \ fold
+ \ keepend
+ \ transparent
+ \ start="\c<cfswitch"
+ \ end="\c</cfswitch>"
+" / CFSWITCH REGION AND FOLD }}}
+
+" CFTRANSACTION REGION AND FOLD {{{
+" <cftransaction
+" s^^^^^^^^^^^^^
+" </cftransaction>
+" ^^^^^^^^^^^^^^^e
+sy region cfmlTransactionTagRegion
+ \ fold
+ \ keepend
+ \ transparent
+ \ start="\c<cftransaction"
+ \ end="\c</cftransaction>"
+" / CFTRANSACTION REGION AND FOLD }}}
+
+" CUSTOM TAG REGION AND FOLD {{{
+" <cf_...>
+" s^^^ ^
+" </cf_...>
+" ^^^^^ e
+sy region cfmlCustomTagRegion
+ \ fold
+ \ keepend
+ \ transparent
+ \ start="\c<cf_[^>]*>"
+ \ end="\c</cf_[^>]*>"
+" / CUSTOM TAG REGION AND FOLD }}}
+
+" / TAG REGION AND FOLDING }}}
+
+" COMMENT {{{
+
+" COMMENT BLOCK {{{
+" /*...*/
+" s^ ^e
+sy region cfmlCommentBlock
+ \ keepend
+ \ start="/\*"
+ \ end="\*/"
+ \ contains=
+ \cfmlMetaData
+" / COMMENT BLOCK }}}
+
+" COMMENT LINE {{{
+" //...
+" s^
+sy match cfmlCommentLine
+ \ "\/\/.*"
+" / COMMENT LINE }}}
+
+sy cluster cfmlComment
+ \ contains=
+ \cfmlCommentBlock,
+ \cfmlCommentLine
+" / COMMENT }}}
+
+" TAG COMMENT {{{
+" <!---...--->
+" s^^^^ ^^^e
+sy region cfmlTagComment
+ \ keepend
+ \ start="<!---"
+ \ end="--->"
+ \ contains=
+ \cfmlTagComment
+" / TAG COMMENT }}}
+
+" FLOW STATEMENT {{{
+" BRANCH FLOW KEYWORD {{{
+sy keyword cfmlBranchFlowKeyword
+ \ break
+ \ continue
+ \ return
+
+" / BRANCH KEYWORD }}}
+
+" DECISION FLOW KEYWORD {{{
+sy keyword cfmlDecisionFlowKeyword
+ \ case
+ \ defaultcase
+ \ else
+ \ if
+ \ switch
+
+" / DECISION FLOW KEYWORD }}}
+
+" LOOP FLOW KEYWORD {{{
+sy keyword cfmlLoopFlowKeyword
+ \ do
+ \ for
+ \ in
+ \ while
+
+" / LOOP FLOW KEYWORD }}}
+
+" TRY FLOW KEYWORD {{{
+sy keyword cfmlTryFlowKeyword
+ \ catch
+ \ finally
+ \ rethrow
+ \ throw
+ \ try
+
+" / TRY FLOW KEYWORD }}}
+
+sy cluster cfmlFlowStatement
+ \ contains=
+ \cfmlBranchFlowKeyword,
+ \cfmlDecisionFlowKeyword,
+ \cfmlLoopFlowKeyword,
+ \cfmlTryFlowKeyword
+
+" / FLOW STATEMENT }}}
+
+" STORAGE KEYWORD {{{
+sy keyword cfmlStorageKeyword
+ \ var
+" / STORAGE KEYWORD }}}
+
+" STORAGE TYPE {{{
+sy match cfmlStorageType
+ \ contained
+ \ "\v<
+ \(any
+ \|array
+ \|binary
+ \|boolean
+ \|date
+ \|numeric
+ \|query
+ \|string
+ \|struct
+ \|uuid
+ \|void
+ \|xml
+ \){1}\ze(\s*\=)@!"
+" / STORAGE TYPE }}}
+
+" CORE KEYWORD {{{
+sy match cfmlCoreKeyword
+ \ "\v<
+ \(new
+ \|required
+ \)\ze\s"
+" / CORE KEYWORD }}}
+
+" CORE SCOPE {{{
+sy match cfmlCoreScope
+ \ "\v<
+ \(application
+ \|arguments
+ \|attributes
+ \|caller
+ \|cfcatch
+ \|cffile
+ \|cfhttp
+ \|cgi
+ \|client
+ \|cookie
+ \|form
+ \|local
+ \|request
+ \|server
+ \|session
+ \|super
+ \|this
+ \|thisTag
+ \|thread
+ \|variables
+ \|url
+ \){1}\ze(,|\.|\[|\)|\s)"
+" / CORE SCOPE }}}
+
+" SQL STATEMENT {{{
+sy cluster cfmlSqlStatement
+ \ contains=
+ \@cfmlParenthesisRegion,
+ \@cfmlQuote,
+ \@cfmlQuotedValue,
+ \@sqlSyntax,
+ \cfmlBoolean,
+ \cfmlDot,
+ \cfmlEqualSign,
+ \cfmlFunctionName,
+ \cfmlHashSurround,
+ \cfmlNumber
+" / SQL STATEMENT }}}
+
+" TAG IN SCRIPT {{{
+sy match cfmlTagNameInScript
+ \ "\vcf_*\w+\s*\ze\("
+" / TAG IN SCRIPT }}}
+
+" METADATA {{{
+sy region cfmlMetaData
+ \ contained
+ \ keepend
+ \ start="@\w\+"
+ \ end="$"
+ \ contains=
+ \cfmlMetaDataName
+
+sy match cfmlMetaDataName
+ \ contained
+ \ "@\w\+"
+" / METADATA }}}
+
+" COMPONENT DEFINITION {{{
+sy region cfmlComponentDefinition
+ \ start="component"
+ \ end="{"me=e-1
+ \ contains=
+ \@cfmlAttribute,
+ \cfmlComponentKeyword
+
+sy match cfmlComponentKeyword
+ \ contained
+ \ "\v<component>"
+" / COMPONENT DEFINITION }}}
+
+" INTERFACE DEFINITION {{{
+sy match cfmlInterfaceDefinition
+ \ "interface\s.*{"me=e-1
+ \ contains=
+ \cfmlInterfaceKeyword
+
+sy match cfmlInterfaceKeyword
+ \ contained
+ \ "\v<interface>"
+" / INTERFACE DEFINITION }}}
+
+" PROPERTY {{{
+sy region cfmlProperty
+ \ transparent
+ \ start="\v<property>"
+ \ end=";"me=e-1
+ \ contains=
+ \@cfmlQuotedValue,
+ \cfmlAttrEqualSign,
+ \cfmlAttrName,
+ \cfmlAttrValue,
+ \cfmlPropertyKeyword
+
+sy match cfmlPropertyKeyword
+ \ contained
+ \ "\v<property>"
+" / PROPERTY }}}
+
+" FUNCTION DEFINITION {{{
+sy match cfmlFunctionDefinition
+ \ "\v
+ \(<(public|private|package)\s){,1}
+ \(<
+ \(any
+ \|array
+ \|binary
+ \|boolean
+ \|date
+ \|numeric
+ \|query
+ \|string
+ \|struct
+ \|uuid
+ \|void
+ \|xml
+ \)\s){,1}
+ \<function\s\w+\s*\("me=e-1
+ \ contains=
+ \cfmlFunctionKeyword,
+ \cfmlFunctionModifier,
+ \cfmlFunctionName,
+ \cfmlFunctionReturnType
+
+" FUNCTION KEYWORD {{{
+sy match cfmlFunctionKeyword
+ \ contained
+ \ "\v<function>"
+" / FUNCTION KEYWORD }}}
+
+" FUNCTION MODIFIER {{{
+sy match cfmlFunctionModifier
+ \ contained
+ \ "\v<
+ \(public
+ \|private
+ \|package
+ \)>"
+" / FUNCTION MODIFIER }}}
+
+" FUNCTION RETURN TYPE {{{
+sy match cfmlFunctionReturnType
+ \ contained
+ \ "\v
+ \(any
+ \|array
+ \|binary
+ \|boolean
+ \|date
+ \|numeric
+ \|query
+ \|string
+ \|struct
+ \|uuid
+ \|void
+ \|xml
+ \)"
+" / FUNCTION RETURN TYPE }}}
+
+" FUNCTION NAME {{{
+" specific regex for core functions decreases performance
+" so use the same highlighting for both function types
+sy match cfmlFunctionName
+ \ "\v<(cf|if|elseif|throw)@!\w+\s*\ze\("
+" / FUNCTION NAME }}}
+
+" / FUNCTION DEFINITION }}}
+
+" ODD FUNCTION {{{
+sy region cfmlOddFunction
+ \ transparent
+ \ start="\v<
+ \(abort
+ \|exit
+ \|import
+ \|include
+ \|lock
+ \|pageencoding
+ \|param
+ \|savecontent
+ \|thread
+ \|transaction
+ \){1}"
+ \ end="\v(\{|;)"me=e-1
+ \ contains=
+ \@cfmlQuotedValue,
+ \cfmlAttrEqualSign,
+ \cfmlAttrName,
+ \cfmlAttrValue,
+ \cfmlCoreKeyword,
+ \cfmlOddFunctionKeyword,
+ \cfmlCoreScope
+
+" ODD FUNCTION KEYWORD {{{
+sy match cfmlOddFunctionKeyword
+ \ contained
+ \ "\v<
+ \(abort
+ \|exit
+ \|import
+ \|include
+ \|lock
+ \|pageencoding
+ \|param
+ \|savecontent
+ \|thread
+ \|transaction
+ \)\ze(\s|$|;)"
+" / ODD FUNCTION KEYWORD }}}
+
+" / ODD FUNCTION }}}
+
+" CUSTOM {{{
+
+" CUSTOM KEYWORD {{{
+sy match cfmlCustomKeyword
+ \ contained
+ \ "\v<
+ \(customKeyword1
+ \|customKeyword2
+ \|customKeyword3
+ \)>"
+" / CUSTOM KEYWORD }}}
+
+" CUSTOM SCOPE {{{
+sy match cfmlCustomScope
+ \ contained
+ \ "\v<
+ \(prc
+ \|rc
+ \|event
+ \|(\w+Service)
+ \){1}\ze(\.|\[)"
+" / CUSTOM SCOPE }}}
+
+" / CUSTOM }}}
+
+" SGML TAG START AND END {{{
+" SGML tag start
+" <...>
+" s^^^e
+sy region cfmlSGMLTagStart
+ \ keepend
+ \ transparent
+ \ start="\v(\<cf)@!\zs\<\w+"
+ \ end=">"
+ \ contains=
+ \@cfmlAttribute,
+ \@cfmlComment,
+ \@cfmlOperator,
+ \@cfmlParenthesisRegion,
+ \@cfmlPunctuation,
+ \@cfmlQuote,
+ \@cfmlQuotedValue,
+ \cfmlAttrEqualSign,
+ \cfmlBoolean,
+ \cfmlBrace,
+ \cfmlCoreKeyword,
+ \cfmlCoreScope,
+ \cfmlCustomKeyword,
+ \cfmlCustomScope,
+ \cfmlEqualSign,
+ \cfmlFunctionName,
+ \cfmlNumber,
+ \cfmlStorageKeyword,
+ \cfmlStorageType,
+ \cfmlTagBracket,
+ \cfmlSGMLTagName
+
+" SGML tag end
+" </...>
+" s^^^^e
+sy match cfmlSGMLTagEnd
+ \ transparent
+ \ "\v(\<\/cf)@!\zs\<\/\w+\>"
+ \ contains=
+ \cfmlTagBracket,
+ \cfmlSGMLTagName
+
+" SGML tag name
+" <...>
+" s^^^e
+sy match cfmlSGMLTagName
+ \ contained
+ \ "\v(\<\/*)\zs\w+"
+
+" / SGML TAG START AND END }}}
+
+" HIGHLIGHTING {{{
+
+hi link cfmlNumber Number
+hi link cfmlBoolean Boolean
+hi link cfmlEqualSign Keyword
+" HASH SURROUND
+hi link cfmlHash PreProc
+hi link cfmlHashSurround PreProc
+" OPERATOR
+hi link cfmlArithmeticOperator Function
+hi link cfmlBooleanOperator Function
+hi link cfmlDecisionOperator Function
+hi link cfmlStringOperator Function
+hi link cfmlTernaryOperator Function
+" PARENTHESIS
+hi link cfmlParenthesis1 Statement
+hi link cfmlParenthesis2 String
+hi link cfmlParenthesis3 Delimiter
+" BRACE
+hi link cfmlBrace PreProc
+" PUNCTUATION - BRACKET
+hi link cfmlBracket Statement
+" PUNCTUATION - CHAR
+hi link cfmlComma Comment
+hi link cfmlDot Comment
+hi link cfmlSemiColon Comment
+" PUNCTUATION - QUOTE
+hi link cfmlDoubleQuote String
+hi link cfmlDoubleQuotedValue String
+hi link cfmlSingleQuote String
+hi link cfmlSingleQuotedValue String
+" TAG START AND END
+hi link cfmlTagName Function
+hi link cfmlTagBracket Comment
+" ATTRIBUTE NAME AND VALUE
+hi link cfmlAttrName Type
+hi link cfmlAttrValue Special
+" COMMENT
+hi link cfmlCommentBlock Comment
+hi link cfmlCommentLine Comment
+hi link cfmlTagComment Comment
+" FLOW STATEMENT
+hi link cfmlDecisionFlowKeyword Conditional
+hi link cfmlLoopFlowKeyword Repeat
+hi link cfmlTryFlowKeyword Exception
+hi link cfmlBranchFlowKeyword Keyword
+" STORAGE KEYWORD
+hi link cfmlStorageKeyword Keyword
+" STORAGE TYPE
+hi link cfmlStorageType Keyword
+" CORE KEYWORD
+hi link cfmlCoreKeyword PreProc
+" CORE SCOPE
+hi link cfmlCoreScope Keyword
+" TAG IN SCRIPT
+hi link cfmlTagNameInScript Function
+" METADATA
+" meta data value = cfmlMetaData
+hi link cfmlMetaData String
+hi link cfmlMetaDataName Type
+" COMPONENT DEFINITION
+hi link cfmlComponentKeyword Keyword
+" INTERFACE DEFINITION
+hi link cfmlInterfaceKeyword Keyword
+" PROPERTY
+hi link cfmlPropertyKeyword Keyword
+" FUNCTION DEFINITION
+hi link cfmlFunctionKeyword Keyword
+hi link cfmlFunctionModifier Keyword
+hi link cfmlFunctionReturnType Keyword
+hi link cfmlFunctionName Function
+" ODD FUNCTION
+hi link cfmlOddFunctionKeyword Function
+" CUSTOM
+hi link cfmlCustomKeyword Keyword
+hi link cfmlCustomScope Structure
+" SGML TAG
+hi link cfmlSGMLTagName Ignore
+
+" / HIGHLIGHTING }}}
+
+let b:current_syntax = "cfml"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/syntax/debcontrol.vim b/runtime/syntax/debcontrol.vim
index 1131c9e12f..b8790747aa 100644
--- a/runtime/syntax/debcontrol.vim
+++ b/runtime/syntax/debcontrol.vim
@@ -3,7 +3,7 @@
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
" Wichert Akkerman <wakkerma@debian.org>
-" Last Change: 2017 Aug 18
+" Last Change: 2017 Nov 04
" URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debcontrol.vim
" Standard syntax initialization
@@ -17,6 +17,8 @@ set cpo&vim
" Should match case except for the keys of each field
syn case match
+syn iskeyword @,48-57,-,/
+
" Everything that is not explicitly matched by the rules below
syn match debcontrolElse "^.*$"
@@ -24,24 +26,50 @@ syn match debcontrolElse "^.*$"
syn match debControlComma ",[ \t]*"
syn match debControlSpace "[ \t]"
-let s:kernels = '\%(linux\|hurd\|kfreebsd\|knetbsd\|kopensolaris\|netbsd\)'
-let s:archs = '\%(alpha\|amd64\|armeb\|armel\|armhf\|arm64\|avr32\|hppa\|i386'
- \ . '\|ia64\|lpia\|m32r\|m68k\|mipsel\|mips64el\|mips\|powerpcspe\|powerpc\|ppc64el'
- \ . '\|ppc64\|s390x\|s390\|sh3eb\|sh3\|sh4eb\|sh4\|sh\|sparc64\|sparc\|x32\)'
-let s:pairs = 'hurd-i386\|kfreebsd-i386\|kfreebsd-amd64\|knetbsd-i386\|kopensolaris-i386\|netbsd-alpha\|netbsd-i386'
+let s:kernels = ['linux', 'hurd', 'kfreebsd', 'knetbsd', 'kopensolaris', 'netbsd']
+let s:archs = [
+ \ 'alpha', 'amd64', 'armeb', 'armel', 'armhf', 'arm64', 'avr32', 'hppa'
+ \, 'i386', 'ia64', 'lpia', 'm32r', 'm68k', 'mipsel', 'mips64el', 'mips'
+ \, 'powerpcspe', 'powerpc', 'ppc64el', 'ppc64', 's390x', 's390', 'sh3eb'
+ \, 'sh3', 'sh4eb', 'sh4', 'sh', 'sparc64', 'sparc', 'x32'
+ \ ]
+let s:pairs = [
+ \ 'hurd-i386', 'kfreebsd-i386', 'kfreebsd-amd64', 'knetbsd-i386'
+ \, 'kopensolaris-i386', 'netbsd-alpha', 'netbsd-i386'
+ \ ]
" Define some common expressions we can use later on
-exe 'syn match debcontrolArchitecture contained "\%(all\|'. s:kernels .'-any\|\%(any-\)\='. s:archs .'\|'. s:pairs .'\|any\)"'
+syn keyword debcontrolArchitecture contained all any
+exe 'syn keyword debcontrolArchitecture contained '. join(map(s:kernels, {k,v -> v .'-any'}))
+exe 'syn keyword debcontrolArchitecture contained '. join(map(s:archs, {k,v -> 'any-'.v}))
+exe 'syn keyword debcontrolArchitecture contained '. join(s:archs)
+exe 'syn keyword debcontrolArchitecture contained '. join(s:pairs)
unlet s:kernels s:archs s:pairs
-syn match debcontrolMultiArch contained "\%(no\|foreign\|allowed\|same\)"
+let s:sections = [
+ \ 'admin', 'cli-mono', 'comm', 'database', 'debian-installer', 'debug'
+ \, 'devel', 'doc', 'editors', 'education', 'electronics', 'embedded'
+ \, 'fonts', 'games', 'gnome', 'gnustep', 'gnu-r', 'golang', 'graphics'
+ \, 'hamradio', 'haskell', 'httpd', 'interpreters', 'introspection'
+ \, 'java', 'javascript', 'kde', 'kernel', 'libs', 'libdevel', 'lisp'
+ \, 'localization', 'mail', 'math', 'metapackages', 'misc', 'net'
+ \, 'news', 'ocaml', 'oldlibs', 'otherosfs', 'perl', 'php', 'python'
+ \, 'ruby', 'rust', 'science', 'shells', 'sound', 'text', 'tex'
+ \, 'utils', 'vcs', 'video', 'web', 'x11', 'xfce', 'zope'
+ \ ]
+
+syn keyword debcontrolMultiArch contained no foreign allowed same
syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+"
-syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)"
-syn match debcontrolSection contained "\v((contrib|non-free|non-US/main|non-US/contrib|non-US/non-free|restricted|universe|multiverse)/)?(admin|cli-mono|comm|database|debian-installer|debug|devel|doc|editors|education|electronics|embedded|fonts|games|gnome|gnustep|gnu-r|graphics|hamradio|haskell|httpd|interpreters|introspection|java%(script)=|kde|kernel|libs|libdevel|lisp|localization|mail|math|metapackages|misc|net|news|ocaml|oldlibs|otherosfs|perl|php|python|ruby|rust|science|shells|sound|text|tex|utils|vcs|video|web|x11|xfce|zope)"
-syn match debcontrolPackageType contained "u\?deb"
+syn keyword debcontrolPriority contained extra important optional required standard
+exe 'syn match debcontrolSection contained "\%(\%(contrib\|non-free\|non-US/main\|non-US/contrib\|non-US/non-free\|restricted\|universe\|multiverse\)/\)\=\%('.join(s:sections, '\|').'\)"'
+syn keyword debcontrolPackageType contained udeb deb
syn match debcontrolVariable contained "\${.\{-}}"
-syn match debcontrolDmUpload contained "\cyes"
+syn keyword debcontrolDmUpload contained yes
+syn keyword debcontrolYesNo contained yes no
+syn match debcontrolR3 contained "\<\%(no\|binary-targets\|[[:graph:]]\+/[[:graph:]]\+\%( \+[[:graph:]]\+/[[:graph:]]\+\)*\)\>"
+
+unlet s:sections
" A URL (using the domain name definitions from RFC 1034 and 1738), right now
" only enforce protocol and some sanity on the server/path part;
@@ -59,15 +87,28 @@ syn match debcontrolComment "^#.*$" contains=@Spell
syn case ignore
-" List of all legal keys
-syn match debcontrolKey contained "^\%(Source\|Package\|Section\|Priority\|\%(XSBC-Original-\)\=Maintainer\|Uploaders\|Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|Standards-Version\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Enhances\|Breaks\|Essential\|Architecture\|Multi-Arch\|Description\|Bugs\|Origin\|X[SB]-Python-Version\|Homepage\|\(XS-\)\=Vcs-\(Browser\|Arch\|Bzr\|Cvs\|Darcs\|Git\|Hg\|Mtn\|Svn\)\|\%(XC-\)\=Package-Type\|\%(XS-\)\=Testsuite\): *"
+" List of all legal keys, in order, from deb-src-control(5)
+" Source fields
+syn match debcontrolKey contained "^\%(Source\|Maintainer\|Uploaders\|Standards-Version\|Description\|Homepage\|Bugs\|Rules-Requires-Root\): *"
+syn match debcontrolKey contained "^\%(XS-\)\=Vcs-\%(Arch\|Bzr\|Cvs\|Darcs\|Git\|Hg\|Mtn\|Svn\|Browser\): *"
+syn match debcontrolKey contained "^\%(Origin\|Section\|Priority\): *"
+syn match debcontrolKey contained "^Build-\%(Depends\|Conflicts\)\%(-Arch\|-Indep\)\=: *"
+
+" Binary fields
+syn match debcontrolKey contained "^\%(Package\%(-Type\)\=\|Architecture\|Build-Profiles\): *"
+syn match debcontrolKey contained "^\%(\%(Build-\)\=Essential\|Multi-Arch\|Tag\): *"
+syn match debcontrolKey contained "^\%(\%(Pre-\)\=Depends\|Recommends\|Suggests\|Breaks\|Enhances\|Replaces\|Conflicts\|Provides\|Built-Using\): *"
+syn match debcontrolKey contained "^\%(Subarchitecture\|Kernel-Version\|Installer-Menu-Item\): *"
+
+" User-defined fields
+syn match debcontrolKey contained "^X[SBC]\{0,3\}\%(-Private\)\=-[-a-zA-Z0-9]\+: *"
syn match debcontrolDeprecatedKey contained "^\%(\%(XS-\)\=DM-Upload-Allowed\): *"
" Fields for which we do strict syntax checking
syn region debcontrolStrictField start="^Architecture" end="$" contains=debcontrolKey,debcontrolArchitecture,debcontrolSpace oneline
syn region debcontrolStrictField start="^Multi-Arch" end="$" contains=debcontrolKey,debcontrolMultiArch oneline
-syn region debcontrolStrictField start="^\(Package\|Source\)" end="$" contains=debcontrolKey,debcontrolName oneline
+syn region debcontrolStrictField start="^\%(Package\|Source\)" end="$" contains=debcontrolKey,debcontrolName oneline
syn region debcontrolStrictField start="^Priority" end="$" contains=debcontrolKey,debcontrolPriority oneline
syn region debcontrolStrictField start="^Section" end="$" contains=debcontrolKey,debcontrolSection oneline
syn region debcontrolStrictField start="^\%(XC-\)\=Package-Type" end="$" contains=debcontrolKey,debcontrolPackageType oneline
@@ -77,10 +118,12 @@ syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Svn" end="$" contains=deb
syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Cvs" end="$" contains=debcontrolKey,debcontrolVcsCvs oneline keepend
syn region debcontrolStrictField start="^\%(XS-\)\=Vcs-Git" end="$" contains=debcontrolKey,debcontrolVcsGit oneline keepend
syn region debcontrolStrictField start="^\%(XS-\)\=DM-Upload-Allowed" end="$" contains=debcontrolDeprecatedKey,debcontrolDmUpload oneline
+syn region debcontrolStrictField start="^Rules-Requires-Root" end="$" contains=debcontrolKey,debcontrolR3 oneline
+syn region debcontrolStrictField start="^\%(Build-\)\=Essential" end="$" contains=debcontrolKey,debcontrolYesNo oneline
" Catch-all for the other legal fields
-syn region debcontrolField start="^\%(\%(XSBC-Original-\)\=Maintainer\|Standards-Version\|Essential\|Bugs\|Origin\|X[SB]-Python-Version\|\%(XS-\)\=Vcs-Mtn\|\%(XS-\)\=Testsuite\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline
-syn region debcontrolMultiField start="^\%(Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Enhances\|Breaks\|Uploaders\|Description\):" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment
+syn region debcontrolField start="^\%(\%(XSBC-Original-\)\=Maintainer\|Standards-Version\|Bugs\|Origin\|X[SB]-Python-Version\|\%(XS-\)\=Vcs-Mtn\|\%(XS-\)\=Testsuite\|Build-Profiles\|Tag\|Subarchitecture\|Kernel-Version\|Installer-Menu-Item\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline
+syn region debcontrolMultiField start="^\%(Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Breaks\|Enhances\|Replaces\|Conflicts\|Provides\|Built-Using\|Uploaders\|X[SBC]\{0,3\}\%(Private-\)\=-[-a-zA-Z0-9]\+\):" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment
syn region debcontrolMultiFieldSpell start="^\%(Description\):" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment,@Spell
" Associate our matches and regions with pretty colours
@@ -102,6 +145,8 @@ hi def link debcontrolVcsCvs Identifier
hi def link debcontrolVcsGit Identifier
hi def link debcontrolHTTPUrl Identifier
hi def link debcontrolDmUpload Identifier
+hi def link debcontrolYesNo Identifier
+hi def link debcontrolR3 Identifier
hi def link debcontrolComment Comment
hi def link debcontrolElse Special
diff --git a/runtime/syntax/debsources.vim b/runtime/syntax/debsources.vim
index 4fa80debec..6791ece294 100644
--- a/runtime/syntax/debsources.vim
+++ b/runtime/syntax/debsources.vim
@@ -2,7 +2,7 @@
" Language: Debian sources.list
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
-" Last Change: 2017 Apr 22
+" Last Change: 2017 Oct 28
" URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debsources.vim
" Standard syntax initialization
@@ -23,18 +23,18 @@ let s:cpo = &cpo
set cpo-=C
let s:supported = [
\ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
- \ 'squeeze', 'wheezy', 'jessie', 'stretch', 'sid', 'rc-buggy',
+ \ 'wheezy', 'jessie', 'stretch', 'sid', 'rc-buggy',
\
- \ 'trusty', 'xenial', 'yakkety', 'zesty', 'artful', 'devel'
+ \ 'trusty', 'xenial', 'zesty', 'artful', 'bionic', 'devel'
\ ]
let s:unsupported = [
\ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
- \ 'woody', 'sarge', 'etch', 'lenny',
+ \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze',
\
\ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
\ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
\ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
- \ 'utopic', 'vivid', 'wily'
+ \ 'utopic', 'vivid', 'wily', 'yakkety'
\ ]
let &cpo=s:cpo
diff --git a/runtime/syntax/forth.vim b/runtime/syntax/forth.vim
index 35fafd4349..a1912461e6 100644
--- a/runtime/syntax/forth.vim
+++ b/runtime/syntax/forth.vim
@@ -1,84 +1,10 @@
" Vim syntax file
" Language: FORTH
-" Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
-" Last Change: So 27 Mai 2012 15:56:28 CEST
+" Current Maintainer: Johan Kotlinski <kotlinski@gmail.com>
+" Previous Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
+" Last Change: 2018-03-29
" Filenames: *.fs,*.ft
-" URL: http://www.cvjb.de/comp/vim/forth.vim
-
-" $Id: forth.vim,v 1.14 2012/05/27 15:57:22 bruessow Exp $
-
-" The list of keywords is incomplete, compared with the official ANS
-" wordlist. If you use this language, please improve it, and send me
-" the patches.
-"
-" Before sending me patches, please download the newest version of this file
-" from http://www.cvjb.de/comp/vim/forth.vim or http://www.vim.org/ (search
-" for forth.vim).
-
-" Many Thanks to...
-"
-" 2012-05-13:
-" Dominique Pellé <dominique dot pelle at gmail dot com> for sending the
-" patch to allow spellchecking of strings, comments, ...
-"
-" 2012-01-07:
-" Thilo Six <T.Six at gmx dot de> send a patch for cpoptions.
-" See the discussion at http://thread.gmane.org/gmane.editors.vim.devel/32151
-"
-" 2009-06-28:
-" Josh Grams send a patch to allow the parenthesis comments at the
-" beginning of a line. That patch also fixed a typo in one of the
-" comments.
-"
-" 2008-02-09:
-" Shawn K. Quinn <sjquinn at speakeasy dot net> send a big patch with
-" new words commonly used in Forth programs or defined by GNU Forth.
-"
-" 2007-07-11:
-" Benjamin Krill <ben at codiert dot org> send me a patch
-" to highlight space errors.
-" You can toggle this feature on through setting the
-" flag forth_space_errors in you vimrc. If you have switched it on,
-" you can turn off highlighting of trailing spaces in comments by
-" setting forth_no_trail_space_error in your vimrc. If you do not want
-" the highlighting of a tabulator following a space in comments, you
-" can turn this off by setting forth_no_tab_space_error.
-"
-" 2006-05-25:
-" Bill McCarthy <WJMc@...> and Ilya Sher <ilya-vim@...>
-" Who found a bug in the ccomment line in 2004!!!
-" I'm really very sorry, that it has taken two years to fix that
-" in the official version of this file. Shame on me.
-" I think my face will be red the next ten years...
-"
-" 2006-05-21:
-" Thomas E. Vaughan <tevaugha at ball dot com> send me a patch
-" for the parenthesis comment word, so words with a trailing
-" parenthesis will not start the highlighting for such comments.
-"
-" 2003-05-10:
-" Andrew Gaul <andrew at gaul.org> send me a patch for
-" forthOperators.
-"
-" 2003-04-03:
-" Ron Aaron <ron at ronware dot org> made updates for an
-" improved Win32Forth support.
-"
-" 2002-04-22:
-" Charles Shattuck <charley at forth dot org> helped me to settle up with the
-" binary and hex number highlighting.
-"
-" 2002-04-20:
-" Charles Shattuck <charley at forth dot org> send me some code for correctly
-" highlighting char and [char] followed by an opening paren. He also added
-" some words for operators, conditionals, and definitions; and added the
-" highlighting for s" and c".
-"
-" 2000-03-28:
-" John Providenza <john at probo dot com> made improvements for the
-" highlighting of strings, and added the code for highlighting hex numbers.
-"
-
+" URL: https://github.com/jkotlinski/forth.vim
" quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -129,7 +55,10 @@ syn keyword forthOperators F~REL F~ABS F~
syn keyword forthOperators 0< 0<= 0<> 0= 0> 0>= < <= <> = > >= U< U<=
syn keyword forthOperators U> U>= D0< D0<= D0<> D0= D0> D0>= D< D<= D<>
syn keyword forthOperators D= D> D>= DU< DU<= DU> DU>= WITHIN ?NEGATE
-syn keyword forthOperators ?DNEGATE
+syn keyword forthOperators ?DNEGATE TRUE FALSE
+
+" various words that take an input and do something with it
+syn keyword forthFunction . U. .R U.R
" stack manipulations
syn keyword forthStack DROP NIP DUP OVER TUCK SWAP ROT -ROT ?DUP PICK ROLL
@@ -141,7 +70,7 @@ syn keyword forthRstack 4>R 4R> 4R@ 4RDROP
syn keyword forthFStack FDROP FNIP FDUP FOVER FTUCK FSWAP FROT
" stack pointer manipulations
-syn keyword forthSP SP@ SP! FP@ FP! RP@ RP! LP@ LP!
+syn keyword forthSP SP@ SP! FP@ FP! RP@ RP! LP@ LP! DEPTH
" address operations
syn keyword forthMemory @ ! +! C@ C! 2@ 2! F@ F! SF@ SF! DF@ DF!
@@ -150,7 +79,7 @@ syn keyword forthAdrArith FLOAT+ FLOAT FALIGN FALIGNED SFLOATS SFLOAT+
syn keyword forthAdrArith SFALIGN SFALIGNED DFLOATS DFLOAT+ DFALIGN DFALIGNED
syn keyword forthAdrArith MAXALIGN MAXALIGNED CFALIGN CFALIGNED
syn keyword forthAdrArith ADDRESS-UNIT-BITS ALLOT ALLOCATE HERE
-syn keyword forthMemBlks MOVE ERASE CMOVE CMOVE> FILL BLANK
+syn keyword forthMemBlks MOVE ERASE CMOVE CMOVE> FILL BLANK UNUSED
" conditionals
syn keyword forthCond IF ELSE ENDIF THEN CASE OF ENDOF ENDCASE ?DUP-IF
@@ -159,7 +88,7 @@ syn keyword forthCond ?DUP-0=-IF AHEAD CS-PICK CS-ROLL CATCH THROW WITHIN
" iterations
syn keyword forthLoop BEGIN WHILE REPEAT UNTIL AGAIN
syn keyword forthLoop ?DO LOOP I J K +DO U+DO -DO U-DO DO +LOOP -LOOP
-syn keyword forthLoop UNLOOP LEAVE ?LEAVE EXIT DONE FOR NEXT
+syn keyword forthLoop UNLOOP LEAVE ?LEAVE EXIT DONE FOR NEXT RECURSE
" new words
syn match forthClassDef '\<:class\s*[^ \t]\+\>'
@@ -174,8 +103,8 @@ syn keyword forthDefine COMPILE-ONLY COMPILE RESTRICT INTERPRET POSTPONE EXECUTE
syn keyword forthDefine LITERAL CREATE-INTERPRET/COMPILE INTERPRETATION>
syn keyword forthDefine <INTERPRETATION COMPILATION> <COMPILATION ] LASTXT
syn keyword forthDefine COMP' POSTPONE, FIND-NAME NAME>INT NAME?INT NAME>COMP
-syn keyword forthDefine NAME>STRING STATE C; CVARIABLE
-syn keyword forthDefine , 2, F, C,
+syn keyword forthDefine NAME>STRING STATE C; CVARIABLE BUFFER: MARKER
+syn keyword forthDefine , 2, F, C, COMPILE,
syn match forthDefine "\[IFDEF]"
syn match forthDefine "\[IFUNDEF]"
syn match forthDefine "\[THEN]"
@@ -196,6 +125,7 @@ syn match forthDefine "'"
syn match forthDefine '\<\[\>'
syn match forthDefine "\[']"
syn match forthDefine '\[COMPILE]'
+syn match forthDefine '\[CHAR]'
" debugging
syn keyword forthDebug PRINTDEBUGDATA PRINTDEBUGLINE
@@ -206,7 +136,7 @@ syn keyword forthAssembler ASSEMBLER CODE END-CODE ;CODE FLUSH-ICACHE C,
" basic character operations
syn keyword forthCharOps (.) CHAR EXPECT FIND WORD TYPE -TRAILING EMIT KEY
-syn keyword forthCharOps KEY? TIB CR
+syn keyword forthCharOps KEY? TIB CR BL COUNT SPACE SPACES
" recognize 'char (' or '[char] (' correctly, so it doesn't
" highlight everything after the paren as a comment till a closing ')'
syn match forthCharOps '\<char\s\S\s'
@@ -216,12 +146,15 @@ syn region forthCharOps start=+."\s+ skip=+\\"+ end=+"+
" char-number conversion
syn keyword forthConversion <<# <# # #> #>> #S (NUMBER) (NUMBER?) CONVERT D>F
syn keyword forthConversion D>S DIGIT DPL F>D HLD HOLD NUMBER S>D SIGN >NUMBER
-syn keyword forthConversion F>S S>F
+syn keyword forthConversion F>S S>F HOLDS
" interpreter, wordbook, compiler
syn keyword forthForth (LOCAL) BYE COLD ABORT >BODY >NEXT >LINK CFA >VIEW HERE
syn keyword forthForth PAD WORDS VIEW VIEW> N>LINK NAME> LINK> L>NAME FORGET
syn keyword forthForth BODY> ASSERT( ASSERT0( ASSERT1( ASSERT2( ASSERT3( )
+syn keyword forthForth >IN ACCEPT ENVIRONMENT? EVALUATE QUIT SOURCE ACTION-OF
+syn keyword forthForth DEFER! DEFER@ PARSE PARSE-NAME REFILL RESTORE-INPUT
+syn keyword forthForth SAVE-INPUT SOURCE-ID
syn region forthForth start=+ABORT"\s+ skip=+\\"+ end=+"+
" vocabularies
@@ -236,16 +169,17 @@ syn keyword forthFileWords KEY?-FILE WRITE-FILE WRITE-LINE EMIT-FILE
syn keyword forthFileWords FLUSH-FILE FILE-STATUS FILE-POSITION
syn keyword forthFileWords REPOSITION-FILE FILE-SIZE RESIZE-FILE
syn keyword forthFileWords SLURP-FILE SLURP-FID STDIN STDOUT STDERR
+syn keyword forthFileWords INCLUDE-FILE INCLUDED REQUIRED
syn keyword forthBlocks OPEN-BLOCKS USE LOAD --> BLOCK-OFFSET
syn keyword forthBlocks GET-BLOCK-FID BLOCK-POSITION LIST SCR BLOCK
syn keyword forthBlocks BUFER EMPTY-BUFFERS EMPTY-BUFFER UPDATE UPDATED?
syn keyword forthBlocks SAVE-BUFFERS SAVE-BUFFER FLUSH THRU +LOAD +THRU
-syn keyword forthBlocks BLOCK-INCLUDED
+syn keyword forthBlocks BLOCK-INCLUDED BLK
" numbers
syn keyword forthMath DECIMAL HEX BASE
-syn match forthInteger '\<-\=[0-9.]*[0-9.]\+\>'
-syn match forthInteger '\<&-\=[0-9.]*[0-9.]\+\>'
+syn match forthInteger '\<-\=[0-9]\+.\=\>'
+syn match forthInteger '\<&-\=[0-9]\+.\=\>'
" recognize hex and binary numbers, the '$' and '%' notation is for gforth
syn match forthInteger '\<\$\x*\x\+\>' " *1* --- dont't mess
syn match forthInteger '\<\x*\d\x*\>' " *2* --- this order!
@@ -253,28 +187,29 @@ syn match forthInteger '\<%[0-1]*[0-1]\+\>'
syn match forthFloat '\<-\=\d*[.]\=\d\+[DdEe]\d\+\>'
syn match forthFloat '\<-\=\d*[.]\=\d\+[DdEe][-+]\d\+\>'
-" XXX If you find this overkill you can remove it. This has to come after the
+" XXX If you find this overkill you can remove it. this has to come after the
" highlighting for numbers otherwise it has no effect.
syn region forthComment start='0 \[if\]' end='\[endif\]' end='\[then\]' contains=forthTodo
" Strings
-syn region forthString start=+\.*\"+ end=+"+ end=+$+ contains=@Spell
+syn region forthString start=+\.*\"+ end=+"+ end=+$+
" XXX
-syn region forthString start=+s\"+ end=+"+ end=+$+ contains=@Spell
-syn region forthString start=+c\"+ end=+"+ end=+$+ contains=@Spell
+syn region forthString start=+s\"+ end=+"+ end=+$+
+syn region forthString start=+s\\\"+ end=+"+ end=+$+
+syn region forthString start=+c\"+ end=+"+ end=+$+
" Comments
-syn match forthComment '\\\s.*$' contains=@Spell,forthTodo,forthSpaceError
-syn region forthComment start='\\S\s' end='.*' contains=@Spell,forthTodo,forthSpaceError
-syn match forthComment '\.(\s[^)]*)' contains=@Spell,forthTodo,forthSpaceError
-syn region forthComment start='\(^\|\s\)\zs(\s' skip='\\)' end=')' contains=@Spell,forthTodo,forthSpaceError
-syn region forthComment start='/\*' end='\*/' contains=@Spell,forthTodo,forthSpaceError
+syn match forthComment '\\\s.*$' contains=forthTodo,forthSpaceError
+syn region forthComment start='\\S\s' end='.*' contains=forthTodo,forthSpaceError
+syn match forthComment '\.(\s[^)]*)' contains=forthTodo,forthSpaceError
+syn region forthComment start='\(^\|\s\)\zs(\s' skip='\\)' end=')' contains=forthTodo,forthSpaceError
+syn region forthComment start='/\*' end='\*/' contains=forthTodo,forthSpaceError
" Include files
syn match forthInclude '^INCLUDE\s\+\k\+'
-syn match forthInclude '^require\s\+\k\+'
-syn match forthInclude '^fload\s\+'
-syn match forthInclude '^needs\s\+'
+syn match forthInclude '^REQUIRE\s\+\k\+'
+syn match forthInclude '^FLOAD\s\+'
+syn match forthInclude '^NEEDS\s\+'
" Locals definitions
syn region forthLocals start='{\s' start='{$' end='\s}' end='^}'
@@ -282,9 +217,6 @@ syn match forthLocals '{ }' " otherwise, at least two spaces between
syn region forthDeprecated start='locals|' end='|'
" Define the default highlighting.
-" Only when an item doesn't have highlighting yet
-
-" The default methods for highlighting. Can be overridden later.
hi def link forthTodo Todo
hi def link forthOperators Operator
hi def link forthMath Number
@@ -318,11 +250,11 @@ hi def link forthInclude Include
hi def link forthLocals Type " nothing else uses type and locals must stand out
hi def link forthDeprecated Error " if you must, change to Type
hi def link forthFileMode Function
+hi def link forthFunction Function
hi def link forthFileWords Statement
hi def link forthBlocks Statement
hi def link forthSpaceError Error
-
let b:current_syntax = "forth"
let &cpo = s:cpo_save
diff --git a/runtime/syntax/fstab.vim b/runtime/syntax/fstab.vim
index 39c1a00b39..56237c0770 100644
--- a/runtime/syntax/fstab.vim
+++ b/runtime/syntax/fstab.vim
@@ -2,8 +2,8 @@
" Language: fstab file
" Maintainer: Radu Dineiu <radu.dineiu@gmail.com>
" URL: https://raw.github.com/rid9/vim-fstab/master/fstab.vim
-" Last Change: 2013 May 21
-" Version: 1.0
+" Last Change: 2017 Nov 09
+" Version: 1.2
"
" Credits:
" David Necas (Yeti) <yeti@physics.muni.cz>
@@ -38,10 +38,14 @@ syn match fsDeviceError /\%([^a-zA-Z0-9_\/#@:\.-]\|^\w\{-}\ze\W\)/ contained
syn keyword fsDeviceKeyword contained none proc linproc tmpfs devpts devtmpfs sysfs usbfs
syn keyword fsDeviceKeyword contained LABEL nextgroup=fsDeviceLabel
syn keyword fsDeviceKeyword contained UUID nextgroup=fsDeviceUUID
+syn keyword fsDeviceKeyword contained PARTLABEL nextgroup=fsDevicePARTLABEL
+syn keyword fsDeviceKeyword contained PARTUUID nextgroup=fsDevicePARTUUID
syn keyword fsDeviceKeyword contained sshfs nextgroup=fsDeviceSshfs
syn match fsDeviceKeyword contained /^[a-zA-Z0-9.\-]\+\ze:/
syn match fsDeviceLabel contained /=[^ \t]\+/hs=s+1 contains=fsOperator
syn match fsDeviceUUID contained /=[^ \t]\+/hs=s+1 contains=fsOperator
+syn match fsDevicePARTLABEL contained /=[^ \t]\+/hs=s+1 contains=fsOperator
+syn match fsDevicePARTUUID contained /=[^ \t]\+/hs=s+1 contains=fsOperator
syn match fsDeviceSshfs contained /#[_=[:alnum:]\.\/+-]\+@[a-z0-9._-]\+\a\{2}:[^ \t]\+/hs=s+1 contains=fsOperator
" Mount Point
@@ -64,7 +68,7 @@ syn match fsOptionsString /[a-zA-Z0-9_-]\+/
syn keyword fsOptionsYesNo yes no
syn cluster fsOptionsCheckCluster contains=fsOptionsExt2Check,fsOptionsFatCheck
syn keyword fsOptionsSize 512 1024 2048
-syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand nosuid nosymfollow nouser owner rbind rdonly remount ro rq rw suid suiddir supermount sw sync union update user users xx
+syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand norelatime nosuid nosymfollow nouser owner rbind rdonly relatime remount ro rq rw suid suiddir supermount sw sync union update user users wxallowed xx
syn match fsOptionsGeneral /_netdev/
" Options: adfs
@@ -137,7 +141,7 @@ syn match fsOptionsKeywords contained /\<\%(dir\|file\|\)_umask=/ nextgroup=fsOp
syn match fsOptionsKeywords contained /\<\%(session\|part\)=/ nextgroup=fsOptionsNumber
" Options: ffs
-syn keyword fsOptionsKeyWords contained softdep
+syn keyword fsOptionsKeyWords contained noperm softdep
" Options: hpfs
syn match fsOptionsKeywords contained /\<case=/ nextgroup=fsOptionsHpfsCase
@@ -228,7 +232,6 @@ syn match fsFreqPass /\s\+.\{-}$/ contains=@fsFreqPassCluster,@fsGeneralCluster
" Whole line comments
syn match fsCommentLine /^#.*$/ contains=@Spell
-
hi def link fsOperator Operator
hi def link fsComment Comment
hi def link fsCommentLine Comment
@@ -237,15 +240,17 @@ hi def link fsTypeKeyword Type
hi def link fsDeviceKeyword Identifier
hi def link fsDeviceLabel String
hi def link fsDeviceUUID String
+hi def link fsDevicePARTLABEL String
+hi def link fsDevicePARTUUID String
hi def link fsDeviceSshfs String
hi def link fsFreqPassNumber Number
if exists('fstab_unknown_fs_errors') && fstab_unknown_fs_errors == 1
-hi def link fsTypeUnknown Error
+ hi def link fsTypeUnknown Error
endif
if !exists('fstab_unknown_device_errors') || fstab_unknown_device_errors == 1
-hi def link fsDeviceError Error
+ hi def link fsDeviceError Error
endif
hi def link fsMountPointError Error
@@ -278,7 +283,6 @@ hi def link fsOptionsUfsError String
hi def link fsOptionsVfatShortname String
-
let b:current_syntax = "fstab"
let &cpo = s:cpo_save
diff --git a/runtime/syntax/haskell.vim b/runtime/syntax/haskell.vim
index e398085ba8..e5128a12ab 100644
--- a/runtime/syntax/haskell.vim
+++ b/runtime/syntax/haskell.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Haskell
" Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org>
-" Last Change: 2017 Jun 04
+" Last Change: 2018 Mar 29 by Marcin Szamotulski
" Original Author: John Williams <jrw@pobox.com>
"
" Thanks to Ryan Crumley for suggestions and John Meacham for
@@ -38,8 +38,8 @@ if exists("b:current_syntax")
endif
" (Qualified) identifiers (no default highlighting)
-syn match ConId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[A-Z][a-zA-Z0-9_']*\>"
-syn match VarId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[a-z][a-zA-Z0-9_']*\>"
+syn match ConId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[A-Z][a-zA-Z0-9_']*\>" contains=@NoSpell
+syn match VarId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[a-z][a-zA-Z0-9_']*\>" contains=@NoSpell
" Infix operators--most punctuation characters and any (qualified) identifier
" enclosed in `backquotes`. An operator starting with : is a constructor,
@@ -56,18 +56,18 @@ syn match hsDelimiter "(\|)\|\[\|\]\|,\|;\|_\|{\|}"
syn match hsSpecialChar contained "\\\([0-9]\+\|o[0-7]\+\|x[0-9a-fA-F]\+\|[\"\\'&\\abfnrtv]\|^[A-Z^_\[\\\]]\)"
syn match hsSpecialChar contained "\\\(NUL\|SOH\|STX\|ETX\|EOT\|ENQ\|ACK\|BEL\|BS\|HT\|LF\|VT\|FF\|CR\|SO\|SI\|DLE\|DC1\|DC2\|DC3\|DC4\|NAK\|SYN\|ETB\|CAN\|EM\|SUB\|ESC\|FS\|GS\|RS\|US\|SP\|DEL\)"
syn match hsSpecialCharError contained "\\&\|'''\+"
-syn region hsString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=hsSpecialChar
+syn region hsString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=hsSpecialChar,@NoSpell
syn match hsCharacter "[^a-zA-Z0-9_']'\([^\\]\|\\[^']\+\|\\'\)'"lc=1 contains=hsSpecialChar,hsSpecialCharError
syn match hsCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=hsSpecialChar,hsSpecialCharError
-syn match hsNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>"
-syn match hsFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
+syn match hsNumber "\v<[0-9]%(_*[0-9])*>|<0[xX]_*[0-9a-fA-F]%(_*[0-9a-fA-F])*>|<0[oO]_*%(_*[0-7])*>|<0[bB]_*[01]%(_*[01])*>"
+syn match hsFloat "\v<[0-9]%(_*[0-9])*\.[0-9]%(_*[0-9])*%(_*[eE][-+]?[0-9]%(_*[0-9])*)?>|<[0-9]%(_*[0-9])*_*[eE][-+]?[0-9]%(_*[0-9])*>|<0[xX]_*[0-9a-fA-F]%(_*[0-9a-fA-F])*\.[0-9a-fA-F]%(_*[0-9a-fA-F])*%(_*[pP][-+]?[0-9]%(_*[0-9])*)?>|<0[xX]_*[0-9a-fA-F]%(_*[0-9a-fA-F])*_*[pP][-+]?[0-9]%(_*[0-9])*>"
" Keyword definitions. These must be patterns instead of keywords
" because otherwise they would match as keywords at the start of a
" "literate" comment (see lhs.vim).
syn match hsModule "\<module\>"
-syn match hsImport "\<import\>.*"he=s+6 contains=hsImportMod,hsLineComment,hsBlockComment
-syn match hsImportMod contained "\<\(as\|qualified\|hiding\)\>"
+syn match hsImport "\<import\>.*"he=s+6 contains=hsImportMod,hsLineComment,hsBlockComment,@NoSpell
+syn match hsImportMod contained "\<\(as\|qualified\|hiding\)\>" contains=@NoSpell
syn match hsInfix "\<\(infix\|infixl\|infixr\)\>"
syn match hsStructure "\<\(class\|data\|deriving\|instance\|default\|where\)\>"
syn match hsTypedef "\<\(type\|newtype\)\>"
@@ -97,8 +97,8 @@ endif
" Comments
-syn match hsLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$"
-syn region hsBlockComment start="{-" end="-}" contains=hsBlockComment
+syn match hsLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=@Spell
+syn region hsBlockComment start="{-" end="-}" contains=hsBlockComment,@Spell
syn region hsPragma start="{-#" end="#-}"
" C Preprocessor directives. Shamelessly ripped from c.vim and trimmed
diff --git a/runtime/syntax/zsh.vim b/runtime/syntax/zsh.vim
index e16e74e0c2..b4efcdcbdf 100644
--- a/runtime/syntax/zsh.vim
+++ b/runtime/syntax/zsh.vim
@@ -2,7 +2,7 @@
" Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2017-07-11
+" Latest Revision: 2017-11-22
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh
@@ -324,9 +324,9 @@ syn match zshOption /
\ \%(\%(\<no_\?\)\?vi\>\)\|
\ \%(\%(\<no_\?\)\?warncreateglobal\>\)\|\%(\%(no_\?\)\?warn_create_global\>\)\|
\ \%(\%(\<no_\?\)\?xtrace\>\)\|
- \ \%(\%(\<no_\?\)\?zle\>\)/ nextgroup=zshOption skipwhite contained
+ \ \%(\%(\<no_\?\)\?zle\>\)/ nextgroup=zshOption,zshComment skipwhite contained
-syn keyword zshTypes float integer local typeset declare private
+syn keyword zshTypes float integer local typeset declare private readonly
" XXX: this may be too much
" syn match zshSwitches '\s\zs--\=[a-zA-Z0-9-]\+'
diff --git a/runtime/tutor/en/vim-01-beginner.tutor b/runtime/tutor/en/vim-01-beginner.tutor
index 0d03103bca..2b30ccb5f8 100644
--- a/runtime/tutor/en/vim-01-beginner.tutor
+++ b/runtime/tutor/en/vim-01-beginner.tutor
@@ -18,9 +18,9 @@ won't be saved. Don't worry about messing things up; just remember that
pressing [<Esc>](<Esc>) and then [u](u) will undo the latest change.
This tutorial is interactive, and there are a few things you should know.
-Pressing [<Enter>](<Enter>) over text highlighted [like this](holy-grail )
-will take you to some relevant help (hopefully), and pressing K over any
-word will try to do so too. Sometimes you will be required to modify text like
+- Type [<Enter>](<Enter>) on links [like this](holy-grail ) to open the linked help section.
+- Or simply type [K](K) on any word to find its documentation!
+- Sometimes you will be required to modify text like
this here
Once you have done the changes correctly, the ✗ sign at the left will change
to ✓. I imagine you can already see how neat Vim can be. ;)
diff --git a/src/nvim/README.md b/src/nvim/README.md
index d668db0cdc..02464c2500 100644
--- a/src/nvim/README.md
+++ b/src/nvim/README.md
@@ -23,15 +23,19 @@ Logs
Low-level log messages sink to `$NVIM_LOG_FILE`.
-You can use `LOG_CALLSTACK();` anywhere in the source to log the current
-stacktrace. To log in an alternate file, e.g. stderr, use
-`LOG_CALLSTACK_TO_FILE(FILE*)`. (Currently Linux-only.)
+Use `LOG_CALLSTACK()` (Linux only) to log the current stacktrace. To log to an
+alternate file (e.g. stderr) use `LOG_CALLSTACK_TO_FILE(FILE*)`.
-UI events are logged at level 0 (`DEBUG_LOG_LEVEL`).
+UI events are logged at DEBUG level (`DEBUG_LOG_LEVEL`).
rm -rf build/
make CMAKE_EXTRA_FLAGS="-DMIN_LOG_LEVEL=0"
+Many log messages have a shared prefix, such as "UI" or "RPC". Use the shell to
+filter the log, e.g. at DEBUG level you might want to exclude UI messages:
+
+ tail -F ~/.local/share/nvim/log | cat -v | stdbuf -o0 grep -v UI | stdbuf -o0 tee -a log
+
Build with ASAN
---------------
@@ -276,3 +280,25 @@ Since Nvim inherited its code from Vim, the states are not prepared to receive
"arbitrary events", so we use a special key to represent those (When a state
receives an "arbitrary event", it normally doesn't do anything other update the
screen).
+
+Main loop
+---------
+
+The `Loop` structure (which describes `main_loop`) abstracts multiple queues
+into one loop:
+
+ uv_loop_t uv;
+ MultiQueue *events;
+ MultiQueue *thread_events;
+ MultiQueue *fast_events;
+
+`loop_poll_events` checks `Loop.uv` and `Loop.fast_events` whenever Nvim is
+idle, and also at `os_breakcheck` intervals.
+
+MultiQueue is cool because you can attach throw-away "child queues" trivially.
+For example `do_os_system()` does this (for every spawned process!) to
+automatically route events onto the `main_loop`:
+
+ Process *proc = &uvproc.process;
+ MultiQueue *events = multiqueue_new_child(main_loop.events);
+ proc->events = events;
diff --git a/src/nvim/event/loop.c b/src/nvim/event/loop.c
index 7998e0b8d0..609c723c57 100644
--- a/src/nvim/event/loop.c
+++ b/src/nvim/event/loop.c
@@ -34,6 +34,7 @@ void loop_init(Loop *loop, void *data)
/// Processes one `Loop.uv` event (at most).
/// Processes all `Loop.fast_events` events.
+/// Does NOT process `Loop.events`, that is an application-specific decision.
///
/// @returns true if `ms` timeout was reached
bool loop_poll_events(Loop *loop, int ms)
diff --git a/src/nvim/testdir/test_getcwd.vim b/src/nvim/testdir/test_getcwd.vim
index 194963f694..5d97295e9a 100644
--- a/src/nvim/testdir/test_getcwd.vim
+++ b/src/nvim/testdir/test_getcwd.vim
@@ -37,6 +37,7 @@ function SetUp()
new
call mkdir('Xtopdir')
cd Xtopdir
+ let g:topdir = getcwd()
call mkdir('Xdir1')
call mkdir('Xdir2')
call mkdir('Xdir3')
@@ -56,38 +57,46 @@ function Test_GetCwd()
3wincmd w
lcd Xdir1
call assert_equal("a Xdir1 1", GetCwdInfo(0, 0))
+ call assert_equal(g:topdir, getcwd(-1))
wincmd W
call assert_equal("b Xtopdir 0", GetCwdInfo(0, 0))
+ call assert_equal(g:topdir, getcwd(-1))
wincmd W
lcd Xdir3
call assert_equal("c Xdir3 1", GetCwdInfo(0, 0))
call assert_equal("a Xdir1 1", GetCwdInfo(bufwinnr("a"), 0))
call assert_equal("b Xtopdir 0", GetCwdInfo(bufwinnr("b"), 0))
call assert_equal("c Xdir3 1", GetCwdInfo(bufwinnr("c"), 0))
+ call assert_equal(g:topdir, getcwd(-1))
wincmd W
call assert_equal("a Xdir1 1", GetCwdInfo(bufwinnr("a"), tabpagenr()))
call assert_equal("b Xtopdir 0", GetCwdInfo(bufwinnr("b"), tabpagenr()))
call assert_equal("c Xdir3 1", GetCwdInfo(bufwinnr("c"), tabpagenr()))
+ call assert_equal(g:topdir, getcwd(-1))
tabnew x
new y
new z
3wincmd w
call assert_equal("x Xtopdir 0", GetCwdInfo(0, 0))
+ call assert_equal(g:topdir, getcwd(-1))
wincmd W
lcd Xdir2
call assert_equal("y Xdir2 1", GetCwdInfo(0, 0))
+ call assert_equal(g:topdir, getcwd(-1))
wincmd W
lcd Xdir3
call assert_equal("z Xdir3 1", GetCwdInfo(0, 0))
call assert_equal("x Xtopdir 0", GetCwdInfo(bufwinnr("x"), 0))
call assert_equal("y Xdir2 1", GetCwdInfo(bufwinnr("y"), 0))
call assert_equal("z Xdir3 1", GetCwdInfo(bufwinnr("z"), 0))
+ call assert_equal(g:topdir, getcwd(-1))
let tp_nr = tabpagenr()
tabrewind
call assert_equal("x Xtopdir 0", GetCwdInfo(3, tp_nr))
call assert_equal("y Xdir2 1", GetCwdInfo(2, tp_nr))
call assert_equal("z Xdir3 1", GetCwdInfo(1, tp_nr))
+ call assert_equal(g:topdir, getcwd(-1))
endfunc
function Test_GetCwd_lcd_shellslash()
diff --git a/test/README.md b/test/README.md
index 3ac8531ba8..0999f412ac 100644
--- a/test/README.md
+++ b/test/README.md
@@ -64,9 +64,9 @@ To run a *specific* functional test:
TEST_FILE=test/functional/foo.lua make functionaltest
-To *repeat* a test many times:
+To *repeat* a test:
- .deps/usr/bin/busted --filter 'foo' --repeat 1000 test/functional/ui/foo_spec.lua
+ .deps/usr/bin/busted --lpath='build/?.lua' --filter 'foo' --repeat 1000 test/functional/ui/foo_spec.lua
### Filter by tag