Update runtime files.
diff --git a/runtime/autoload/RstFold.vim b/runtime/autoload/RstFold.vim
new file mode 100644
index 0000000..5becb04
--- /dev/null
+++ b/runtime/autoload/RstFold.vim
@@ -0,0 +1,48 @@
+" Author: Antony Lee <anntzer.lee@gmail.com>
+" Description: Helper functions for reStructuredText syntax folding
+" Last Modified: 2018-01-07
+
+function s:CacheRstFold()
+  let closure = {'header_types': {}, 'max_level': 0, 'levels': {}}
+  function closure.Process(match) dict
+    let curline = getcurpos()[1]
+    if has_key(self.levels, curline - 1)
+      " For over+under-lined headers, the regex will match both at the
+      " overline and at the title itself; in that case, skip the second match.
+      return
+    endif
+    let lines = split(a:match, '\n')
+    let key = repeat(lines[-1][0], len(lines))
+    if !has_key(self.header_types, key)
+      let self.max_level += 1
+      let self.header_types[key] = self.max_level
+    endif
+    let self.levels[curline] = self.header_types[key]
+  endfunction
+  let save_cursor = getcurpos()
+  silent keeppatterns %s/\v^%(%(([=`:.'"~^_*+#-])\1+\n)?.{1,2}\n([=`:.'"~^_*+#-])\2+)|%(%(([=`:.''"~^_*+#-])\3{2,}\n)?.{3,}\n([=`:.''"~^_*+#-])\4{2,})$/\=closure.Process(submatch(0))/gn
+  call setpos('.', save_cursor)
+  let b:RstFoldCache = closure.levels
+endfunction
+
+function RstFold#GetRstFold()
+  if !has_key(b:, 'RstFoldCache')
+    call s:CacheRstFold()
+  endif
+  if has_key(b:RstFoldCache, v:lnum)
+    return '>' . b:RstFoldCache[v:lnum]
+  else
+    return '='
+  endif
+endfunction
+
+function RstFold#GetRstFoldText()
+  if !has_key(b:, 'RstFoldCache')
+    call s:CacheRstFold()
+  endif
+  let indent = repeat('  ', b:RstFoldCache[v:foldstart] - 1)
+  let thisline = getline(v:foldstart)
+  " For over+under-lined headers, skip the overline.
+  let text = thisline =~ '^\([=`:.''"~^_*+#-]\)\1\+$' ? getline(v:foldstart + 1) : thisline
+  return indent . text
+endfunction
diff --git a/runtime/autoload/xmlformat.vim b/runtime/autoload/xmlformat.vim
index 83ba49a..f227b5e 100644
--- a/runtime/autoload/xmlformat.vim
+++ b/runtime/autoload/xmlformat.vim
@@ -2,9 +2,8 @@
 " Last Change: Thu, 22 May 2018 21:26:55 +0100
 " Version: 0.1
 " Author: Christian Brabandt <cb@256bit.org>
-" Script:  http://www.vim.org/scripts/script.php?script_id=
+" Repository:   https://github.com/chrisbra/vim-xml-ftplugin
 " License: VIM License
-" GetLatestVimScripts: ???? 18 :AutoInstall: xmlformat.vim
 " Documentation: see :h xmlformat.txt (TODO!)
 " ---------------------------------------------------------------------
 " Load Once: {{{1
diff --git a/runtime/doc/arabic.txt b/runtime/doc/arabic.txt
index 0572b85..2303a2b 100644
--- a/runtime/doc/arabic.txt
+++ b/runtime/doc/arabic.txt
@@ -319,4 +319,4 @@
 
 No other bugs are known to exist.
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 051dedb..8d1dca2 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1593,4 +1593,4 @@
 gzip plugin.
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index b59f28f..703d336 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1884,4 +1884,4 @@
 process you may end up with duplicated lines.  This also depends on the system
 library function used.
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt
index 72887fe..4cc3625 100644
--- a/runtime/doc/channel.txt
+++ b/runtime/doc/channel.txt
@@ -816,4 +816,4 @@
 start of the line.
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index ae364c3..df18ec6 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -1164,4 +1164,4 @@
 	@	string for |input()|
 	-	text for |:insert| or |:append|
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/debug.txt b/runtime/doc/debug.txt
index 6d2cea5..b03bf15 100644
--- a/runtime/doc/debug.txt
+++ b/runtime/doc/debug.txt
@@ -172,4 +172,4 @@
     http://msdn.microsoft.com/vstudio/express/visualC/default.aspx
 
 =========================================================================
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/debugger.txt b/runtime/doc/debugger.txt
index 9aa2fb8..3370cf0 100644
--- a/runtime/doc/debugger.txt
+++ b/runtime/doc/debugger.txt
@@ -139,4 +139,4 @@
 
 For Sun NetBeans support see |netbeans|.
 
- vim:tw=78:sw=4:ts=8:ft=help:norl:
+ vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt
index 20a623f..b1b3cc4 100644
--- a/runtime/doc/develop.txt
+++ b/runtime/doc/develop.txt
@@ -563,4 +563,4 @@
 Note that some compilers cannot handle long lines or strings.  The C89
 standard specifies a limit of 509 characters.
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt
index e263e6b..502fb49 100644
--- a/runtime/doc/diff.txt
+++ b/runtime/doc/diff.txt
@@ -441,4 +441,4 @@
 directory are accidentally patched.  Vim will also delete files starting with
 v:fname_in and ending in ".rej" and ".orig".
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt
index 2a23222..62f23a2 100644
--- a/runtime/doc/digraph.txt
+++ b/runtime/doc/digraph.txt
@@ -1488,4 +1488,4 @@
 ſt	ft	FB05	64261	LATIN SMALL LIGATURE LONG S T
 st	st	FB06	64262	LATIN SMALL LIGATURE ST
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 4e97457..04bf4b1 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1747,4 +1747,4 @@
    currently work with 'path' items that contain a URL or use the double star
    with depth limiter (/usr/**2) or upward search (;) notations.
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index fb9093e..964eab1 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -9265,6 +9265,7 @@
 arabic			Compiled with Arabic support |Arabic|.
 arp			Compiled with ARP support (Amiga).
 autocmd			Compiled with autocommand support. |autocommand|
+autochdir		Compiled with support for 'autochdir'
 autoservername		Automatically enable |clientserver|
 balloon_eval		Compiled with |balloon-eval| support.
 balloon_multiline	GUI supports multiline balloons.
@@ -11647,4 +11648,4 @@
 Find more information in the file src/testdir/README.txt.
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/farsi.txt b/runtime/doc/farsi.txt
index 1bb9f20..493714e 100644
--- a/runtime/doc/farsi.txt
+++ b/runtime/doc/farsi.txt
@@ -266,4 +266,4 @@
 
 For more information about the bugs refer to rileft.txt.
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index 0c33845..b08e3d7 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -695,4 +695,4 @@
 <
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt
index ad3f514..c3ee97e 100644
--- a/runtime/doc/fold.txt
+++ b/runtime/doc/fold.txt
@@ -601,4 +601,4 @@
 are used.
 
 ==============================================================================
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/ft_sql.txt b/runtime/doc/ft_sql.txt
index 9819c06..f461b7e 100644
--- a/runtime/doc/ft_sql.txt
+++ b/runtime/doc/ft_sql.txt
@@ -777,4 +777,4 @@
 as they were.
 
 
-vim:tw=78:ts=8:ft=help:norl:
+vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt
index c30aa33..603a4d4 100644
--- a/runtime/doc/gui.txt
+++ b/runtime/doc/gui.txt
@@ -1075,4 +1075,4 @@
 For the Win32 GUI the external commands are executed in a separate window.
 See |gui-shell-win32|.
 
- vim:tw=78:sw=4:ts=8:ft=help:norl:
+ vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt
index 7bd12aa..15dd275 100644
--- a/runtime/doc/gui_w32.txt
+++ b/runtime/doc/gui_w32.txt
@@ -451,4 +451,4 @@
 	:exe 'sign place 1 line=1 name=vimxpm file=' . expand('%:p')
 <
 
- vim:tw=78:sw=4:ts=8:ft=help:norl:
+ vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/gui_x11.txt b/runtime/doc/gui_x11.txt
index 8a5e9bf..6b7a773 100644
--- a/runtime/doc/gui_x11.txt
+++ b/runtime/doc/gui_x11.txt
@@ -721,4 +721,4 @@
 both by choosing to use either of the "* or "+ registers.
 
 
- vim:tw=78:sw=4:ts=8:ft=help:norl:
+ vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/hangulin.txt b/runtime/doc/hangulin.txt
index 56f188b..708cfe9 100644
--- a/runtime/doc/hangulin.txt
+++ b/runtime/doc/hangulin.txt
@@ -109,4 +109,4 @@
 				    SungHyun Nam <goweol@gmail.com>
 				    Chi-Deok Hwang <...>
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/hebrew.txt b/runtime/doc/hebrew.txt
index 5400b49..f2c3a3d 100644
--- a/runtime/doc/hebrew.txt
+++ b/runtime/doc/hebrew.txt
@@ -139,4 +139,4 @@
 problem, set isprint=@,128-255.
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt
index 4c8eb94..239de9d 100644
--- a/runtime/doc/help.txt
+++ b/runtime/doc/help.txt
@@ -225,4 +225,4 @@
 'compatible'.
 
 ------------------------------------------------------------------------------
- vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl:
+ vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt
index 29941c1..f6c6ab7 100644
--- a/runtime/doc/helphelp.txt
+++ b/runtime/doc/helphelp.txt
@@ -370,4 +370,4 @@
 
 You can find the details in $VIMRUNTIME/syntax/help.vim
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/howto.txt b/runtime/doc/howto.txt
index f697310..26d611e 100644
--- a/runtime/doc/howto.txt
+++ b/runtime/doc/howto.txt
@@ -93,4 +93,4 @@
 |2html.vim|		convert a colored file to HTML
 |less|			use Vim like less or more with syntax highlighting
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/if_cscop.txt b/runtime/doc/if_cscop.txt
index cf2aff2..ba0f1d5 100644
--- a/runtime/doc/if_cscop.txt
+++ b/runtime/doc/if_cscop.txt
@@ -484,4 +484,4 @@
 Win32 support was added by Sergey Khorev <sergey.khorev@gmail.com>.  Contact
 him if you have Win32-specific issues.
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/if_mzsch.txt b/runtime/doc/if_mzsch.txt
index f118b17..9d27683 100644
--- a/runtime/doc/if_mzsch.txt
+++ b/runtime/doc/if_mzsch.txt
@@ -312,4 +312,4 @@
   raco pkg install cext-lib         # raco ctool command
 <
 ======================================================================
-  vim:tw=78:ts=8:sts=4:ft=help:norl:
+  vim:tw=78:ts=8:noet:sts=4:ft=help:norl:
diff --git a/runtime/doc/if_ole.txt b/runtime/doc/if_ole.txt
index 4ec9ac5..e734df9 100644
--- a/runtime/doc/if_ole.txt
+++ b/runtime/doc/if_ole.txt
@@ -202,4 +202,4 @@
 [.Net remarks provided by Dave Fishburn and Brian Sturk]
 
 ==============================================================================
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/if_perl.txt b/runtime/doc/if_perl.txt
index a06954e..b82ee83 100644
--- a/runtime/doc/if_perl.txt
+++ b/runtime/doc/if_perl.txt
@@ -303,4 +303,4 @@
 with.
 
 ==============================================================================
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt
index 89baef4..30a3a72 100644
--- a/runtime/doc/if_pyth.txt
+++ b/runtime/doc/if_pyth.txt
@@ -924,4 +924,4 @@
 one you prefer, before running configure.
 
 ==============================================================================
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/if_ruby.txt b/runtime/doc/if_ruby.txt
index 572a6ec..b140476 100644
--- a/runtime/doc/if_ruby.txt
+++ b/runtime/doc/if_ruby.txt
@@ -234,4 +234,4 @@
 with.
 
 ==============================================================================
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/if_sniff.txt b/runtime/doc/if_sniff.txt
index cf6ed1c..d0e16a8 100644
--- a/runtime/doc/if_sniff.txt
+++ b/runtime/doc/if_sniff.txt
@@ -8,4 +8,4 @@
 The SNiFF+ support was removed at patch 7.4.1433.  If you want to check it out
 sync to before that.
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/if_tcl.txt b/runtime/doc/if_tcl.txt
index 979a19b..e822dfd 100644
--- a/runtime/doc/if_tcl.txt
+++ b/runtime/doc/if_tcl.txt
@@ -544,4 +544,4 @@
 the shared library must match the Tcl version Vim was compiled with.
 
 ==============================================================================
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt
index 180d932..54fb526 100644
--- a/runtime/doc/indent.txt
+++ b/runtime/doc/indent.txt
@@ -1156,4 +1156,4 @@
 Three times shiftwidth is the default value.
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index f569ec5..1a0d225 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1657,4 +1657,4 @@
 |:~|		:~		repeat last ":substitute"
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index ca19136..e145cac 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -2005,4 +2005,4 @@
 	[READ ERRORS]			not all of the file could be read
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
index 8325bb3..a000482 100644
--- a/runtime/doc/intro.txt
+++ b/runtime/doc/intro.txt
@@ -906,4 +906,4 @@
 				6. ~ 
 
 ==============================================================================
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 18b61df..d6dbd50 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1552,4 +1552,4 @@
 invokes the user command, it will run in the context of the script it was
 defined in.  This matters if |<SID>| is used in a command.
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt
index 99ce10f..24fed6d 100644
--- a/runtime/doc/mbyte.txt
+++ b/runtime/doc/mbyte.txt
@@ -1467,4 +1467,4 @@
 	Taro Muraoka  <koron@tka.att.ne.jp>
 	Yasuhiro Matsumoto <mattn@mail.goo.ne.jp>
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt
index b4a72ff..c23ae65 100644
--- a/runtime/doc/message.txt
+++ b/runtime/doc/message.txt
@@ -866,4 +866,4 @@
 This is especially useful if you accidentally typed <Space> at the hit-enter
 prompt.
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/mlang.txt b/runtime/doc/mlang.txt
index 3d590e0..4d85bbd 100644
--- a/runtime/doc/mlang.txt
+++ b/runtime/doc/mlang.txt
@@ -210,4 +210,4 @@
 	:endif
 <
 
- vim:tw=78:sw=4:ts=8:ft=help:norl:
+ vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt
index 2c0fd55..b210520 100644
--- a/runtime/doc/motion.txt
+++ b/runtime/doc/motion.txt
@@ -1341,4 +1341,4 @@
 			position is in a status line, that window is made the
 			active window and the cursor is not moved.  {not in Vi}
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/netbeans.txt b/runtime/doc/netbeans.txt
index 25fba4d..61e58c2 100644
--- a/runtime/doc/netbeans.txt
+++ b/runtime/doc/netbeans.txt
@@ -1007,4 +1007,4 @@
 Editor will only open MIME types specified in this property.
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 469c363..8645c47 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -9204,4 +9204,4 @@
 	screen.  When non-zero, characters are sent to the terminal one by
 	one.  For MS-DOS pcterm this does not work.  For debugging purposes.
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/os_390.txt b/runtime/doc/os_390.txt
index 5b4b9f7..ab88cc6 100644
--- a/runtime/doc/os_390.txt
+++ b/runtime/doc/os_390.txt
@@ -131,4 +131,4 @@
 
 
 ------------------------------------------------------------------------------
- vim:tw=78:fo=tcq2:ts=8:ft=help:norl:
+ vim:tw=78:fo=tcq2:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/os_amiga.txt b/runtime/doc/os_amiga.txt
index ad083b5..26aec5f 100644
--- a/runtime/doc/os_amiga.txt
+++ b/runtime/doc/os_amiga.txt
@@ -144,4 +144,4 @@
 	;End VIM
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/os_beos.txt b/runtime/doc/os_beos.txt
index 148f5fe..1356a6b 100644
--- a/runtime/doc/os_beos.txt
+++ b/runtime/doc/os_beos.txt
@@ -317,4 +317,4 @@
 <rhialto@polder.ubc.kun.nl>
 http://polder.ubc.kun.nl/~rhialto/be
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/os_dos.txt b/runtime/doc/os_dos.txt
index b950953..d24efdf 100644
--- a/runtime/doc/os_dos.txt
+++ b/runtime/doc/os_dos.txt
@@ -295,4 +295,4 @@
 option.  If it is present, Vim sets the 'shellcmdflag' and 'shellquote' or
 'shellxquote' options will be set as described above.
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/os_mac.txt b/runtime/doc/os_mac.txt
index 72c0c16..28ebe66 100644
--- a/runtime/doc/os_mac.txt
+++ b/runtime/doc/os_mac.txt
@@ -179,4 +179,4 @@
 from hanging at runtime.
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/os_mint.txt b/runtime/doc/os_mint.txt
index 96e139d..ed33491 100644
--- a/runtime/doc/os_mint.txt
+++ b/runtime/doc/os_mint.txt
@@ -36,4 +36,4 @@
 
 	Jens M. Felderhoff, e-mail: <jmf@infko.uni-koblenz.de>
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/os_msdos.txt b/runtime/doc/os_msdos.txt
index 50fb4e8..d5be05f 100644
--- a/runtime/doc/os_msdos.txt
+++ b/runtime/doc/os_msdos.txt
@@ -12,4 +12,4 @@
 work on older systems.
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/os_os2.txt b/runtime/doc/os_os2.txt
index 7891756..2f094cf 100644
--- a/runtime/doc/os_os2.txt
+++ b/runtime/doc/os_os2.txt
@@ -10,4 +10,4 @@
 The OS/2 support was removed in patch 7.4.1008.
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/os_qnx.txt b/runtime/doc/os_qnx.txt
index 466699f..4cbc7ea 100644
--- a/runtime/doc/os_qnx.txt
+++ b/runtime/doc/os_qnx.txt
@@ -135,4 +135,4 @@
 	- Replace usage of fork() with spawn() when launching external
 	  programs.
 
- vim:tw=78:sw=4:ts=8:ts=8:ft=help:norl:
+ vim:tw=78:sw=4:ts=8:noet:ts=8:ft=help:norl:
diff --git a/runtime/doc/os_risc.txt b/runtime/doc/os_risc.txt
index 095d5a9..d951b8e 100644
--- a/runtime/doc/os_risc.txt
+++ b/runtime/doc/os_risc.txt
@@ -9,4 +9,4 @@
 If you would like to use Vim on RISC OS get the files from before that patch.
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/os_unix.txt b/runtime/doc/os_unix.txt
index 4b69af5..5067b1e 100644
--- a/runtime/doc/os_unix.txt
+++ b/runtime/doc/os_unix.txt
@@ -57,4 +57,4 @@
 The file "tools/vim132" is a shell script that can be used to put Vim in 132
 column mode on a vt100 and lookalikes.
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/os_vms.txt b/runtime/doc/os_vms.txt
index 3e723b6..fc6da61 100644
--- a/runtime/doc/os_vms.txt
+++ b/runtime/doc/os_vms.txt
@@ -952,4 +952,4 @@
 	Bruce Hunsaker <BNHunsaker@chq.byu.edu>
 	Sandor Kopanyi <sandor.kopanyi@mailbox.hu>
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/os_win32.txt b/runtime/doc/os_win32.txt
index e995333..9a5f748 100644
--- a/runtime/doc/os_win32.txt
+++ b/runtime/doc/os_win32.txt
@@ -303,4 +303,4 @@
    'runtimepath'.  For example ~/vimfiles/bitmaps/vim.ico.
 
 
- vim:tw=78:fo=tcq2:ts=8:ft=help:norl:
+ vim:tw=78:fo=tcq2:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index 09b4c2c..e7e510f 100644
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -1417,4 +1417,4 @@
 		":2match" for another plugin.
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/pi_getscript.txt b/runtime/doc/pi_getscript.txt
index 4190706..ae38a3b 100644
--- a/runtime/doc/pi_getscript.txt
+++ b/runtime/doc/pi_getscript.txt
@@ -479,4 +479,4 @@
                      and they became numbers.  Fixes comparison.
 
 ==============================================================================
-vim:tw=78:ts=8:ft=help:fdm=marker
+vim:tw=78:ts=8:noet:ft=help:fdm=marker
diff --git a/runtime/doc/pi_gzip.txt b/runtime/doc/pi_gzip.txt
index 21b6520..6017efa 100644
--- a/runtime/doc/pi_gzip.txt
+++ b/runtime/doc/pi_gzip.txt
@@ -40,4 +40,4 @@
 decompression.  You have to rename the file if you want this.
 
 ==============================================================================
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/pi_logipat.txt b/runtime/doc/pi_logipat.txt
index f8d6662..8d33a56 100644
--- a/runtime/doc/pi_logipat.txt
+++ b/runtime/doc/pi_logipat.txt
@@ -118,4 +118,4 @@
 
 
 ==============================================================================
-vim:tw=78:ts=8:ft=help
+vim:tw=78:ts=8:noet:ft=help
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
index b4f2f26..478338e 100644
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -4267,4 +4267,4 @@
 
 ==============================================================================
 Modelines: {{{1
- vim:tw=78:ts=8:ft=help:norl:fdm=marker
+ vim:tw=78:ts=8:noet:ft=help:norl:fdm=marker
diff --git a/runtime/doc/pi_paren.txt b/runtime/doc/pi_paren.txt
index d4ab4a0..8c4f04a 100644
--- a/runtime/doc/pi_paren.txt
+++ b/runtime/doc/pi_paren.txt
@@ -57,4 +57,4 @@
 different mechanism.
 
 ==============================================================================
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/pi_spec.txt b/runtime/doc/pi_spec.txt
index abe5f11..aaede1e 100644
--- a/runtime/doc/pi_spec.txt
+++ b/runtime/doc/pi_spec.txt
@@ -108,4 +108,4 @@
 
 Good luck!!
 
-vim:tw=78:ts=8:ft=help:norl:
+vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/pi_tar.txt b/runtime/doc/pi_tar.txt
index 7a6faf1..f39e0c4 100644
--- a/runtime/doc/pi_tar.txt
+++ b/runtime/doc/pi_tar.txt
@@ -148,4 +148,4 @@
    v1 (original)   * Michael Toren (see http://michael.toren.net/code/)
 
 ==============================================================================
-vim:tw=78:ts=8:ft=help
+vim:tw=78:ts=8:noet:ft=help
diff --git a/runtime/doc/pi_vimball.txt b/runtime/doc/pi_vimball.txt
index 563b12a..fec16a4 100644
--- a/runtime/doc/pi_vimball.txt
+++ b/runtime/doc/pi_vimball.txt
@@ -273,4 +273,4 @@
 
 
 ==============================================================================
-vim:tw=78:ts=8:ft=help:fdm=marker
+vim:tw=78:ts=8:noet:ft=help:fdm=marker
diff --git a/runtime/doc/pi_zip.txt b/runtime/doc/pi_zip.txt
index c5fa391..3517735 100644
--- a/runtime/doc/pi_zip.txt
+++ b/runtime/doc/pi_zip.txt
@@ -149,4 +149,4 @@
    v1 Sep 15, 2005 * Initial release, had browsing, reading, and writing
 
 ==============================================================================
-vim:tw=78:ts=8:ft=help:fdm=marker
+vim:tw=78:ts=8:noet:ft=help:fdm=marker
diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt
index b93a230..07a9503 100644
--- a/runtime/doc/print.txt
+++ b/runtime/doc/print.txt
@@ -752,4 +752,4 @@
 accidental blank pages.
 
 ==============================================================================
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
index 2955eda..95bcfa0 100644
--- a/runtime/doc/quickfix.txt
+++ b/runtime/doc/quickfix.txt
@@ -1794,4 +1794,4 @@
 
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index f2c540b..03ac357 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -1447,4 +1447,4 @@
 |zN|		zN			fold normal set 'foldenable'
 |zi|		zi			invert 'foldenable'
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/quotes.txt b/runtime/doc/quotes.txt
index 063a314..04e2aec 100644
--- a/runtime/doc/quotes.txt
+++ b/runtime/doc/quotes.txt
@@ -272,4 +272,4 @@
 	    |____/ |_|	\___/|_|   |_|	 (_|_)	    (Tony Nugent, Australia) `
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt
index 89703fd..c4007db 100644
--- a/runtime/doc/recover.txt
+++ b/runtime/doc/recover.txt
@@ -234,4 +234,4 @@
 file.  Thus if you write the text file, you need to use that new key.
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/remote.txt b/runtime/doc/remote.txt
index 15219e0..03e0d97 100644
--- a/runtime/doc/remote.txt
+++ b/runtime/doc/remote.txt
@@ -204,4 +204,4 @@
 
 	start /w gvim --remote-wait file.txt
 <
- vim:tw=78:sw=4:ts=8:ft=help:norl:
+ vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index ff1d68d..55aed24 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -1010,4 +1010,4 @@
 - The "self" time is wrong when a function is used recursively.
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/rileft.txt b/runtime/doc/rileft.txt
index 17bfdba..f5ec8e8 100644
--- a/runtime/doc/rileft.txt
+++ b/runtime/doc/rileft.txt
@@ -121,4 +121,4 @@
 o  There is no full bidirectionality (bidi) support.
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/russian.txt b/runtime/doc/russian.txt
index cf64873..fae8690 100644
--- a/runtime/doc/russian.txt
+++ b/runtime/doc/russian.txt
@@ -71,4 +71,4 @@
    releases of gettext.
 
 ===============================================================================
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/scroll.txt b/runtime/doc/scroll.txt
index 971fec8..1415e2f 100644
--- a/runtime/doc/scroll.txt
+++ b/runtime/doc/scroll.txt
@@ -332,4 +332,4 @@
 	:map <M-Esc>[65~ <S-ScrollWheelDown>
 	:map! <M-Esc>[65~ <S-ScrollWheelDown>
 <
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt
index dab63b1..bd63ea9 100644
--- a/runtime/doc/sign.txt
+++ b/runtime/doc/sign.txt
@@ -202,4 +202,4 @@
 		have a name.
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt
index 6f42eb3..2b096e3 100644
--- a/runtime/doc/spell.txt
+++ b/runtime/doc/spell.txt
@@ -1646,4 +1646,4 @@
 		is no need to separate words before checking them (using a
 		trie instead of a hashtable).
 
- vim:tw=78:sw=4:ts=8:ft=help:norl:
+ vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/sponsor.txt b/runtime/doc/sponsor.txt
index 6e42d15..50148e1 100644
--- a/runtime/doc/sponsor.txt
+++ b/runtime/doc/sponsor.txt
@@ -213,4 +213,4 @@
 
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 7757088..3c2d868 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -1687,4 +1687,4 @@
 			Use ! to abandon a modified buffer. |abandon|
 			{not when compiled with tiny or small features}
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 526231f..b1a1e72 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -2876,17 +2876,17 @@
 shells such as bash, dash, posix, and the Korn shells.
 
 Vim attempts to determine which shell type is in use by specifying that
-various filenames are of specific types: >
+various filenames are of specific types, e.g.: >
 
     ksh : .kshrc* *.ksh
     bash: .bashrc* bashrc bash.bashrc .bash_profile* *.bash
 <
-If none of these cases pertain, then the first line of the file is examined
-(ex. looking for /bin/sh  /bin/ksh  /bin/bash).  If the first line specifies a
-shelltype, then that shelltype is used.  However some files (ex. .profile) are
-known to be shell files but the type is not apparent.  Furthermore, on many
-systems sh is symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh"
-(Posix).
+See $VIMRUNTIME/filetype.vim for the full list of patterns.  If none of these
+cases pertain, then the first line of the file is examined (ex. looking for
+/bin/sh  /bin/ksh  /bin/bash).  If the first line specifies a shelltype, then
+that shelltype is used.  However some files (ex. .profile) are known to be
+shell files but the type is not apparent.  Furthermore, on many systems sh is
+symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" (Posix).
 
 One may specify a global default by instantiating one of the following
 variables in your <.vimrc>:
@@ -5478,4 +5478,4 @@
 "<\@1<=span"	Matches the same, but only tries one byte before "span".
 
 
- vim:tw=78:sw=4:ts=8:ft=help:norl:
+ vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt
index 31fcc43..a80d7c3 100644
--- a/runtime/doc/tabpage.txt
+++ b/runtime/doc/tabpage.txt
@@ -472,4 +472,4 @@
 tab page local variable. |t:var|
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 859db21..135c390 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -4621,6 +4621,7 @@
 E954	options.txt	/*E954*
 E955	eval.txt	/*E955*
 E956	pattern.txt	/*E956*
+E957	eval.txt	/*E957*
 E96	diff.txt	/*E96*
 E97	diff.txt	/*E97*
 E98	diff.txt	/*E98*
diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt
index 555beb5..d3ceac6 100644
--- a/runtime/doc/tagsrch.txt
+++ b/runtime/doc/tagsrch.txt
@@ -854,4 +854,4 @@
 <	For a ":djump", ":dsplit", ":dlist" and ":dsearch" command the pattern
 	is used as a literal string, not as a search pattern.
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt
index dbf7e64..77cd933 100644
--- a/runtime/doc/term.txt
+++ b/runtime/doc/term.txt
@@ -977,4 +977,4 @@
 	:noremap!	<RightDrag>	<LeftDrag>
 	:noremap!	<RightRelease>	<LeftRelease>
 <
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt
index cd2c664..f9fc0ee 100644
--- a/runtime/doc/terminal.txt
+++ b/runtime/doc/terminal.txt
@@ -909,4 +909,4 @@
 
 
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt
index 619c955..bbe341c 100644
--- a/runtime/doc/tips.txt
+++ b/runtime/doc/tips.txt
@@ -530,4 +530,4 @@
 	autocmd InsertEnter * match none
 <
 
- vim:tw=78:ts=8:ft=help:norl:
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 9b08aef..6929417 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -50,14 +50,15 @@
   initializing mzscheme avoid the problem, thus it's not some #ifdef.
 
 Terminal emulator window:
+- When the job in the terminal doesn't use mouse events, let the scroll wheel
+  scroll the scrollback, like a terminal does at the shell prompt. #2490
+  And use modeless selection.  #2962
 - With a vertical split only one window is updated. (Linwei, 2018 Jun 2,
   #2977)
 - When pasting should call vterm_keyboard_start_paste(), e.g. when using
   K_MIDDLEMOUSE, calling insert_reg().
 - Users expect parsing the :term argument like a shell does, also support
   single quotes.  E.g. with:  :term grep 'alice says "hello"'  (#1999)
-- How to access selection in Terminal running a shell? (damnskippy, 2018 May
-  27, #29620  When terminal doesn't use the mouse, use modeless selection.
 - Win32: Redirecting input does not work, half of Test_terminal_redir_file()
   is disabled.
 - Win32: Redirecting output works but includes escape sequences.
@@ -78,6 +79,7 @@
 - WINVER conflict, should use 0x0600 by default?
 
 Patches for Python: #3162, #3263 (Ozaki Kiichi)
+    Needs update.
 
 Crash when mixing matchadd and substitute()? (Max Christian Pohle, 2018 May
 13, #2910)  Can't reproduce?
@@ -88,41 +90,65 @@
 Errors found with random data:
     heap-buffer-overflow in alist_add (#2472)
 
-Patch to fix that +packages is always in output of :version.
-(thinca, #3198)  reported by Takuya Fujiwara
+Improve fallback for menu translations, to avoid having to create lots of
+files that source the actual file.  E.g. menu_da_de -> menu_da
+Include part of #3242?
+
+Inlcude Chinese-Taiwan translations. (bystar, #3261)
+
+Using mouse for inputlist() doesn't work after patch 8.0.1756. (Dominique
+Pelle, 2018 Jul 22, #3239)  Also see 8.0.0722.  Check both console and GUI.
 
 More warnings from static analysis:
 https://lgtm.com/projects/g/vim/vim/alerts/?mode=list
 
-Patch for Perl 5.28 on Windows. (#3196)
+When handle_drop() is called while the updating_screen is true, it fails
+completely.  Should store the file list and use it when updating_screen is set
+to false in reset_updating_screen().
 
 Pasting foo} causes Vim to behave weird. (John Little, 2018 Jun 17)
 Related to bracketed paste.  I cannot reproduce it.
 
-Patch replacing imp with importlib. (#3163)
-
-Patch to make CTRL-S in mswin.vim work better. (#3211)
-But use "gi" instead of "a".
-
 Using ":file" in quickfix window during an autocommand doesn't work. 
 (Jason Franklin, 2018 May 23) Allow for using it when there is no argument.
 
 Patch in pull request #2967: Allow white space in sign text. (Ben Jackson)
+Test fails in AppVeyor.
 
 Removing flags from 'cpoptions' breaks the Winbar buttons in termdebug.
 (Dominique Pelle, 2018 Jul 16)
 
-Whenever the file name is "~" then expand('%:p') returns $HOME. (Aidan
-Shafran, 2018 Jun 23, #3072)  Proposed patch by Aidan, 2018 Jun 24.
-
-Patch to set w_set_curswant when setting the cursor in language interfaces.
-(David Hotham, 2018 Jun 22, #3060)
-
 Problem with two buffers with the same name a/b, if it didn't exist before and
 is created outside of Vim. (dskloetg, 2018 Jul 16, #3219)
 
-Patch to make CTRL-W <CR> work properly in a quickfix window. (Jason Franklin,
-2018 May 30)
+Memory leak in test_assert:
+==19127==    by 0x2640D7: alloc (misc2.c:874)
+==19127==    by 0x2646D6: vim_strsave (misc2.c:1315)
+==19127==    by 0x1B68D2: f_getcwd (evalfunc.c:4950)
+And:
+==19127==    by 0x2640D7: alloc (misc2.c:874)
+==19127==    by 0x1A9477: set_var (eval.c:7601)
+==19127==    by 0x19F96F: set_var_lval (eval.c:2233)
+==19127==    by 0x19EA3A: ex_let_one (eval.c:1810)
+==19127==    by 0x19D737: ex_let_vars (eval.c:1294)
+==19127==    by 0x19D6B4: ex_let (eval.c:1259)
+Memory leaks in test_channel? (or is it because of fork())
+Using uninitialized value in test_crypt.
+Memory leaks in test_escaped_glob
+==20651==    by 0x2640D7: alloc (misc2.c:874)
+==20651==    by 0x2646D6: vim_strsave (misc2.c:1315)
+==20651==    by 0x3741EA: get_function_args (userfunc.c:131)
+==20651==    by 0x378779: ex_function (userfunc.c:2036)
+Memory leak in test_terminal:
+==23530==    by 0x2640D7: alloc (misc2.c:874)
+==23530==    by 0x2646D6: vim_strsave (misc2.c:1315)
+==23530==    by 0x25841D: FullName_save (misc1.c:5443)
+==23530==    by 0x17CB4F: fix_fname (buffer.c:4794)
+==23530==    by 0x17CB9A: fname_expand (buffer.c:4838)
+==23530==    by 0x1759AB: buflist_new (buffer.c:1889)
+==23530==    by 0x35C923: term_start (terminal.c:421)
+==23530==    by 0x2AFF30: mch_call_shell_terminal (os_unix.c:4377)
+==23530==    by 0x2B16BE: mch_call_shell (os_unix.c:5383)
 
 gethostbyname() is old, use getaddrinfo() if available. (#3227)
 
@@ -152,12 +178,20 @@
 - signed integer overflow in getdecchrs() (#2254)
 - undefined left shift in get_string_tv() (#2250)
 
+Win32 console: <F11> and <F12> typed in Insert mode don't result in normal
+characters. (#3246)
+
 Patch for more quickfix refactoring. (Yegappan Lakshmanan, #2950)
 
 Tests failing for "make testgui" with GTK:
 - Test_setbufvar_options()
 - Test_exit_callback_interval()
 
+When using CTRL-W CR in the quickfix window, the jumplist in the opened window
+is cleared, to avoid going back to the list of errors buffer (would have two
+windows with it).  Can we just remove the jump list entries for the quickfix
+buffer?
+
 Patch to stack and pop the window title and icon. (IWAMOTO Kouichi, 2018 Jun
 22, #3059)
 8   For xterm need to open a connection to the X server to get the window
@@ -446,10 +480,6 @@
 Patch to fix increment/decrement not working properly when 'virtualedit' is
 set. (Hirohito Higashi, 2016 Aug 1, #923)
 
-Memory leaks in test_channel? (or is it because of fork())
-Using uninitialized value in test_crypt.
-Memory leaks in test_escaped_glob
-
 Patch to make gM move to middle of line. (Yasuhiro Matsumoto, Sep 8, #2070)
 
 Cannot copy modeless selection when cursor is inside it. (lkintact, #2300)
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 541f613..46bf567 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1462,7 +1462,7 @@
 
 " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
 " Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts
-au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD* call dist#ft#SetFileTypeSH("bash")
+au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD* call dist#ft#SetFileTypeSH("bash")
 au BufNewFile,BufRead .kshrc*,*.ksh call dist#ft#SetFileTypeSH("ksh")
 au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1))
 
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim
index ea3f9ac..dc03211 100644
--- a/runtime/ftplugin/man.vim
+++ b/runtime/ftplugin/man.vim
@@ -1,7 +1,7 @@
 " Vim filetype plugin file
 " Language:	man
 " Maintainer:	SungHyun Nam <goweol@gmail.com>
-" Last Change: 	2018 May 2
+" Last Change: 	2018 Jul 25
 
 " To make the ":Man" command available before editing a manual page, source
 " this script from your startup vimrc file.
@@ -14,32 +14,47 @@
     finish
   endif
   let b:did_ftplugin = 1
+endif
 
+let s:cpo_save = &cpo
+set cpo-=C
+
+if &filetype == "man"
   " allow dot and dash in manual page name.
   setlocal iskeyword+=\.,-
+  let b:undo_ftplugin = "setlocal iskeyword<"
 
   " Add mappings, unless the user didn't want this.
   if !exists("no_plugin_maps") && !exists("no_man_maps")
     if !hasmapto('<Plug>ManBS')
       nmap <buffer> <LocalLeader>h <Plug>ManBS
+      let b:undo_ftplugin = b:undo_ftplugin
+	    \ . '|silent! nunmap <buffer> <LocalLeader>h'
     endif
     nnoremap <buffer> <Plug>ManBS :%s/.\b//g<CR>:setl nomod<CR>''
 
     nnoremap <buffer> <c-]> :call <SID>PreGetPage(v:count)<CR>
     nnoremap <buffer> <c-t> :call <SID>PopPage()<CR>
     nnoremap <buffer> <silent> q :q<CR>
+
+    " Add undo commands for the maps
+    let b:undo_ftplugin = b:undo_ftplugin
+	  \ . '|silent! nunmap <buffer> <Plug>ManBS'
+	  \ . '|silent! nunmap <buffer> <c-]>'
+	  \ . '|silent! nunmap <buffer> <c-t>'
+	  \ . '|silent! nunmap <buffer> q'
   endif
 
   if exists('g:ft_man_folding_enable') && (g:ft_man_folding_enable == 1)
     setlocal foldmethod=indent foldnestmax=1 foldenable
+    let b:undo_ftplugin = b:undo_ftplugin
+	  \ . '|silent! setl fdm< fdn< fen<'
   endif
 
-  let b:undo_ftplugin = "setlocal iskeyword<"
-
 endif
 
 if exists(":Man") != 2
-  com -nargs=+ -complete=shellcmd Man call s:GetPage(<f-args>)
+  com -nargs=+ -complete=shellcmd Man call s:GetPage(<q-mods>, <f-args>)
   nmap <Leader>K :call <SID>PreGetPage(0)<CR>
   nmap <Plug>ManPreGetPage :call <SID>PreGetPage(0)<CR>
 endif
@@ -100,7 +115,7 @@
   return 1
 endfunc
 
-func <SID>GetPage(...)
+func <SID>GetPage(cmdmods, ...)
   if a:0 >= 2
     let sect = a:1
     let page = a:2
@@ -154,7 +169,11 @@
           new
         endif
       else
-        new
+	if a:cmdmods != ''
+	  exe a:cmdmods . ' new'
+	else
+	  new
+	endif
       endif
       setl nonu fdc=0
     endif
@@ -218,4 +237,7 @@
 
 endif
 
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
 " vim: set sw=2 ts=8 noet:
diff --git a/runtime/ftplugin/rst.vim b/runtime/ftplugin/rst.vim
index e61213e..9d737cd 100644
--- a/runtime/ftplugin/rst.vim
+++ b/runtime/ftplugin/rst.vim
@@ -1,10 +1,12 @@
-" Vim filetype plugin file
-" Language:             reStructuredText documentation format
-" Previous Maintainer:  Nikolai Weibull <now@bitwi.se>
-" Latest Revision:      2008-07-09
+" reStructuredText filetype plugin file
+" Language: reStructuredText documentation format
+" Maintainer: Marshall Ward <marshall.ward@gmail.com>
+" Original Maintainer: Nikolai Weibull <now@bitwi.se>
+" Website: https://github.com/marshallward/vim-restructuredtext
+" Latest Revision: 2018-01-07
 
 if exists("b:did_ftplugin")
-  finish
+    finish
 endif
 let b:did_ftplugin = 1
 
@@ -16,5 +18,25 @@
 setlocal comments=fb:.. commentstring=..\ %s expandtab
 setlocal formatoptions+=tcroql
 
+" reStructuredText standard recommends that tabs be expanded to 8 spaces
+" The choice of 3-space indentation is to provide slightly better support for
+" directives (..) and ordered lists (1.), although it can cause problems for
+" many other cases.
+"
+" More sophisticated indentation rules should be revisted in the future.
+
+if !exists("g:rst_style") || g:rst_style != 0
+    setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8
+endif
+
+if has('patch-7.3.867')  " Introduced the TextChanged event.
+  setlocal foldmethod=expr
+  setlocal foldexpr=RstFold#GetRstFold()
+  setlocal foldtext=RstFold#GetRstFoldText()
+  augroup RstFold
+    autocmd TextChanged,InsertLeave <buffer> unlet! b:RstFoldCache
+  augroup END
+endif
+
 let &cpo = s:cpo_save
 unlet s:cpo_save
diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim
index fb398ca..32bc9f3 100644
--- a/runtime/indent/sh.vim
+++ b/runtime/indent/sh.vim
@@ -7,6 +7,7 @@
 " License:             Vim (see :h license)
 " Repository:          https://github.com/chrisbra/vim-sh-indent
 " Changelog:
+"          20180724  - make check for zsh syntax more rigid (needs word-boundaries)
 "          20180326  - better support for line continuation
 "          20180325  - better detection of function definitions
 "          20180127  - better support for zsh complex commands
@@ -70,7 +71,7 @@
 
   " Check contents of previous lines
   if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>' ||
-        \  (&ft is# 'zsh' && line =~ '\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>')
+        \  (&ft is# 'zsh' && line =~ '\<\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>')
     if line !~ '\<\%(fi\|esac\|done\|end\)\>\s*\%(#.*\)\=$'
       let ind += s:indent_value('default')
     endif
diff --git a/runtime/indent/xml.vim b/runtime/indent/xml.vim
index 87ffb32..dcafb46 100644
--- a/runtime/indent/xml.vim
+++ b/runtime/indent/xml.vim
@@ -1,6 +1,8 @@
 " Language:	xml
-" Maintainer:	Johannes Zellner <johannes@zellner.org>
-" Last Change:	2017 Jun 13
+" Repository:   https://github.com/chrisbra/vim-xml-ftplugin
+" Maintainer:	Christian Brabandt <cb@256bit.org>
+" Previous Maintainer:	Johannes Zellner <johannes@zellner.org>
+" Last Change:	20180724 - Correctly indent xml comments https://github.com/vim/vim/issues/3200
 " Notes:	1) does not indent pure non-xml code (e.g. embedded scripts)
 "		2) will be confused by unbalanced tags in comments
 "		or CDATA sections.
@@ -55,9 +57,6 @@
 	if '' != syn1 && syn1 !~ 'xml' && '' != syn2 && syn2 !~ 'xml'
 	    " don't indent pure non-xml code
 	    return 0
-	elseif syn1 =~ '^xmlComment' && syn2 =~ '^xmlComment'
-	    " indent comments specially
-	    return -1
 	endif
     endif
     return 1
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index ec55cf6..9f4c26a 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -877,7 +877,7 @@
     return
   endif
 
-  let nr = substitute(a:msg, '.*number="\([0-9]\)*\".*', '\1', '') + 0
+  let nr = substitute(a:msg, '.*number="\([0-9]*\)".*', '\1', '') + 0
   if nr == 0
     return
   endif
diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim
index 8932059..c9bb5dc 100644
--- a/runtime/syntax/java.vim
+++ b/runtime/syntax/java.vim
@@ -1,8 +1,8 @@
 " Vim syntax file
 " Language:	Java
 " Maintainer:	Claudio Fleiner <claudio@fleiner.com>
-" URL:		http://www.fleiner.com/vim/syntax/java.vim
-" Last Change:	2015 March 01
+" URL:          https://github.com/fleiner/vim/blob/master/runtime/syntax/java.vim
+" Last Change:	2018 July 26
 
 " Please check :help java.vim for comments on some of the options available.
 
@@ -29,8 +29,6 @@
 syn match   javaError2 "#\|=<"
 hi def link javaError2 javaError
 
-
-
 " keyword definitions
 syn keyword javaExternal	native package
 syn match javaExternal		"\<import\>\(\s\+static\>\)\?"
@@ -40,7 +38,7 @@
 syn keyword javaBoolean		true false
 syn keyword javaConstant	null
 syn keyword javaTypedef		this super
-syn keyword javaOperator	new instanceof
+syn keyword javaOperator	var new instanceof
 syn keyword javaType		boolean char byte short int long float double
 syn keyword javaType		void
 syn keyword javaStatement	return
@@ -54,17 +52,25 @@
 syn keyword javaClassDecl	enum
 syn match   javaClassDecl	"^class\>"
 syn match   javaClassDecl	"[^.]\s*\<class\>"ms=s+1
-syn match   javaAnnotation	"@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>\(([^)]*)\)\=" contains=javaString
+syn match   javaAnnotation	"@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>" contains=javaString
 syn match   javaClassDecl	"@interface\>"
 syn keyword javaBranch		break continue nextgroup=javaUserLabelRef skipwhite
 syn match   javaUserLabelRef	"\k\+" contained
 syn match   javaVarArg		"\.\.\."
 syn keyword javaScopeDecl	public protected private abstract
 
+" Java Modules(Since Java 9, for "module-info.java" file)
+if fnamemodify(bufname("%"), ":t") == "module-info.java"
+    syn keyword javaModuleStorageClass	module transitive
+    syn keyword javaModuleStmt		open requires exports opens uses provides
+    syn keyword javaModuleExternal	to with
+    syn cluster javaTop add=javaModuleStorageClass,javaModuleStmt,javaModuleExternal
+endif
+
 if exists("java_highlight_java_lang_ids")
   let java_highlight_all=1
 endif
-if exists("java_highlight_all")  || exists("java_highlight_java")  || exists("java_highlight_java_lang") 
+if exists("java_highlight_all")  || exists("java_highlight_java")  || exists("java_highlight_java_lang")
   " java.lang.*
   syn match javaLangClass "\<System\>"
   syn keyword javaR_JavaLang NegativeArraySizeException ArrayStoreException IllegalStateException RuntimeException IndexOutOfBoundsException UnsupportedOperationException ArrayIndexOutOfBoundsException ArithmeticException ClassCastException EnumConstantNotPresentException StringIndexOutOfBoundsException IllegalArgumentException IllegalMonitorStateException IllegalThreadStateException NumberFormatException NullPointerException TypeNotPresentException SecurityException
@@ -296,6 +302,7 @@
 hi def link javaMethodDecl		javaStorageClass
 hi def link javaClassDecl		javaStorageClass
 hi def link javaScopeDecl		javaStorageClass
+
 hi def link javaBoolean		Boolean
 hi def link javaSpecial		Special
 hi def link javaSpecialError		Error
@@ -329,6 +336,12 @@
 hi def link htmlCommentPart		Special
 hi def link javaSpaceError		Error
 
+if fnamemodify(bufname("%"), ":t") == "module-info.java"
+    hi def link javaModuleStorageClass	StorageClass
+    hi def link javaModuleStmt		Statement
+    hi def link javaModuleExternal	Include
+endif
+
 let b:current_syntax = "java"
 
 if main_syntax == 'java'
diff --git a/runtime/syntax/javascript.vim b/runtime/syntax/javascript.vim
index a95ecac..78714d0 100644
--- a/runtime/syntax/javascript.vim
+++ b/runtime/syntax/javascript.vim
@@ -7,7 +7,7 @@
 "		(ss) repaired several quoting and grouping glitches
 "		(ss) fixed regex parsing issue with multiple qualifiers [gi]
 "		(ss) additional factoring of keywords, globals, and members
-" Last Change:	2012 Oct 05
+" Last Change:	2018 Jul 28
 " 		2013 Jun 12: adjusted javaScriptRegexpString (Kevin Locke)
 " 		2018 Apr 14: adjusted javaScriptRegexpString (LongJohnCoder)
 
@@ -35,10 +35,13 @@
 syn match   javaScriptSpecial	       "\\\d\d\d\|\\."
 syn region  javaScriptStringD	       start=+"+  skip=+\\\\\|\\"+  end=+"\|$+	contains=javaScriptSpecial,@htmlPreproc
 syn region  javaScriptStringS	       start=+'+  skip=+\\\\\|\\'+  end=+'\|$+	contains=javaScriptSpecial,@htmlPreproc
+syn region  javaScriptStringT	       start=+`+  skip=+\\\\\|\\`+  end=+`+	contains=javaScriptSpecial,javaScriptEmbed,@htmlPreproc
+
+syn region  javaScriptEmbed	       start=+${+  end=+}+	contains=@javaScriptEmbededExpr
 
 syn match   javaScriptSpecialCharacter "'\\.'"
 syn match   javaScriptNumber	       "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
-syn region  javaScriptRegexpString     start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gimuys]\{0,2\}\s*$+ end=+/[gimuys]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
+syn region  javaScriptRegexpString     start=+[,(=+]\s*/[^/*]+ms=e-1,me=e-1 skip=+\\\\\|\\/+ end=+/[gimuys]\{0,2\}\s*$+ end=+/[gimuys]\{0,2\}\s*[+;.,)\]}]+me=e-1 end=+/[gimuys]\{0,2\}\s\+\/+me=e-1 contains=@htmlPreproc,javaScriptComment oneline
 
 syn keyword javaScriptConditional	if else switch
 syn keyword javaScriptRepeat		while for do in
@@ -57,6 +60,8 @@
 syn keyword javaScriptDeprecated	escape unescape
 syn keyword javaScriptReserved		abstract boolean byte char class const debugger double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile 
 
+syn cluster  javaScriptEmbededExpr	contains=javaScriptBoolean,javaScriptNull,javaScriptIdentifier,javaScriptStringD,javaScriptStringS,javaScriptStringT
+
 if exists("javaScript_fold")
     syn match	javaScriptFunction	"\<function\>"
     syn region	javaScriptFunctionFold	start="\<function\>.*[^};]$" end="^\z1}.*$" transparent fold keepend
@@ -87,6 +92,7 @@
 hi def link javaScriptSpecial		Special
 hi def link javaScriptStringS		String
 hi def link javaScriptStringD		String
+hi def link javaScriptStringT		String
 hi def link javaScriptCharacter		Character
 hi def link javaScriptSpecialCharacter	javaScriptSpecial
 hi def link javaScriptNumber		javaScriptValue
@@ -114,6 +120,8 @@
 hi def link javaScriptReserved		Keyword
 hi def link javaScriptDebug		Debug
 hi def link javaScriptConstant		Label
+hi def link javaScriptEmbed		Special
+
 
 
 let b:current_syntax = "javascript"
diff --git a/runtime/syntax/readline.vim b/runtime/syntax/readline.vim
index 78472cd..3831ae1 100644
--- a/runtime/syntax/readline.vim
+++ b/runtime/syntax/readline.vim
@@ -2,9 +2,9 @@
 " Language:             readline(3) configuration file
 " Maintainer:           Daniel Moch <daniel@danielmoch.com>
 " Previous Maintainer:  Nikolai Weibull <now@bitwi.se>
-" Latest Revision:      2017-12-25
-"   readline_has_bash - if defined add support for bash specific
-"                       settings/functions
+" Latest Revision:      2018-07-26
+"                       Add new functions for Readline 7 / Bash 4.4
+"                       (credit: Github user bewuethr)
 
 if exists('b:current_syntax')
   finish
@@ -111,7 +111,7 @@
                               \ nextgroup=readlineVariable
                               \ skipwhite
 
-syn keyword readlineVariable    contained 
+syn keyword readlineVariable    contained
                               \ nextgroup=readlineBellStyle
                               \ skipwhite
                               \ bell-style
@@ -120,12 +120,15 @@
                               \ nextgroup=readlineBoolean
                               \ skipwhite
                               \ bind-tty-special-chars
+                              \ blink-matching-paren
+                              \ colored-completion-prefix
                               \ colored-stats
                               \ completion-ignore-case
                               \ completion-map-case
                               \ convert-meta
                               \ disable-completion
                               \ echo-control-characters
+                              \ enable-bracketed-paste
                               \ enable-keypad
                               \ enable-meta-key
                               \ expand-tilde
@@ -269,6 +272,7 @@
                               \ start-kbd-macro
                               \ end-kbd-macro
                               \ call-last-kbd-macro
+                              \ print-last-kbd-macro
                               \
                               \ re-read-init-file
                               \ abort
@@ -339,6 +343,8 @@
 
 if exists("readline_has_bash")
   syn keyword readlineFunction  contained
+                              \ shell-forward-word
+                              \ shell-backward-word
                               \ shell-expand-line
                               \ history-expand-line
                               \ magic-space
@@ -347,6 +353,8 @@
                               \ insert-last-argument
                               \ operate-and-get-next
                               \ forward-backward-delete-char
+                              \ shell-kill-word
+                              \ shell-backward-kill-word
                               \ delete-char-or-list
                               \ complete-filename
                               \ possible-filename-completions
@@ -359,6 +367,7 @@
                               \ complete-command
                               \ possible-command-completions
                               \ dynamic-complete-history
+                              \ dabbrev-expand
                               \ complete-into-braces
                               \ glob-expand-word
                               \ glob-list-expansions
diff --git a/runtime/syntax/rst.vim b/runtime/syntax/rst.vim
index 232d2a7..d620d91 100644
--- a/runtime/syntax/rst.vim
+++ b/runtime/syntax/rst.vim
@@ -3,7 +3,7 @@
 " Maintainer: Marshall Ward <marshall.ward@gmail.com>
 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
 " Website: https://github.com/marshallward/vim-restructuredtext
-" Latest Revision: 2016-08-18
+" Latest Revision: 2018-07-23
 
 if exists("b:current_syntax")
   finish
@@ -50,7 +50,10 @@
 syn match   rstExplicitMarkup       '^\s*\.\.\_s'
       \ nextgroup=@rstDirectives,rstComment,rstSubstitutionDefinition
 
-let s:ReferenceName = '[[:alnum:]]\+\%([_.-][[:alnum:]]\+\)*'
+" "Simple reference names are single words consisting of alphanumerics plus
+" isolated (no two adjacent) internal hyphens, underscores, periods, colons
+" and plus signs."
+let s:ReferenceName = '[[:alnum:]]\%([-_.:+]\?[[:alnum:]]\+\)*'
 
 syn keyword     rstTodo             contained FIXME TODO XXX NOTE
 
@@ -83,7 +86,7 @@
       \ ' end=+^\s\@!+ contains=@rstCruft,rstLiteralBlock'
 
 execute 'syn match rstSubstitutionDefinition contained' .
-      \ ' /|' . s:ReferenceName . '|\_s\+/ nextgroup=@rstDirectives'
+      \ ' /|.*|\_s\+/ nextgroup=@rstDirectives'
 
 function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right)
   execute 'syn region rst' . a:name .
@@ -107,10 +110,10 @@
   call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '’', '’')
   " TODO: Additional Unicode Pd, Po, Pi, Pf, Ps characters
 
-  call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\%(^\|\s\|[/:]\)', '')
+  call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\%(^\|\s\|\%ua0\|[/:]\)', '')
 
   execute 'syn match rst' . a:name .
-        \ ' +\%(^\|\s\|[''"([{</:]\)\zs' . a:start .
+        \ ' +\%(^\|\s\|\%ua0\|[''"([{</:]\)\zs' . a:start .
         \ '[^[:space:]' . a:start[strlen(a:start) - 1] . ']'
         \ a:end . '\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+'
 
@@ -124,14 +127,31 @@
 call s:DefineInlineMarkup('SubstitutionReference', '|', '|', '|_\{0,2}')
 call s:DefineInlineMarkup('InlineInternalTargets', '_`', '`', '`')
 
-syn match   rstSections "^\%(\([=`:.'"~^_*+#-]\)\1\+\n\)\=.\+\n\([=`:.'"~^_*+#-]\)\2\+$"
+" Sections are identified through their titles, which are marked up with
+" adornment: "underlines" below the title text, or underlines and matching
+" "overlines" above the title. An underline/overline is a single repeated
+" punctuation character that begins in column 1 and forms a line extending at
+" least as far as the right edge of the title text.
+"
+" It is difficult to count characters in a regex, but we at least special-case
+" the case where the title has at least three characters to require the
+" adornment to have at least three characters as well, in order to handle
+" properly the case of a literal block:
+"
+"    this is the end of a paragraph
+"    ::
+"       this is a literal block
+syn match   rstSections "\v^%(([=`:.'"~^_*+#-])\1+\n)?.{1,2}\n([=`:.'"~^_*+#-])\2+$"
+    \ contains=@Spell
+syn match   rstSections "\v^%(([=`:.'"~^_*+#-])\1{2,}\n)?.{3,}\n([=`:.'"~^_*+#-])\2{2,}$"
+    \ contains=@Spell
 
 " TODO: Can’t remember why these two can’t be defined like the ones above.
 execute 'syn match rstFootnoteReference contains=@NoSpell' .
-      \ ' +\[\%(\d\+\|#\%(' . s:ReferenceName . '\)\=\|\*\)\]_+'
+      \ ' +\%(\s\|^\)\[\%(\d\+\|#\%(' . s:ReferenceName . '\)\=\|\*\)\]_+'
 
 execute 'syn match rstCitationReference contains=@NoSpell' .
-      \ ' +\[' . s:ReferenceName . '\]_\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+'
+      \ ' +\%(\s\|^\)\[' . s:ReferenceName . '\]_\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+'
 
 execute 'syn match rstHyperlinkReference' .
       \ ' /\<' . s:ReferenceName . '__\=\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)/'
@@ -140,28 +160,69 @@
       \ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]"
 
 syn region rstCodeBlock contained matchgroup=rstDirective
-      \ start=+\%(sourcecode\|code\%(-block\)\=\)::\s\+\w*\_s*\n\ze\z(\s\+\)+
+      \ start=+\%(sourcecode\|code\%(-block\)\=\)::\s\+.*\_s*\n\ze\z(\s\+\)+
       \ skip=+^$+
       \ end=+^\z1\@!+
       \ contains=@NoSpell
 syn cluster rstDirectives add=rstCodeBlock
 
 if !exists('g:rst_syntax_code_list')
-    let g:rst_syntax_code_list = ['vim', 'java', 'cpp', 'lisp', 'php',
-                                \ 'python', 'perl', 'sh']
+    " A mapping from a Vim filetype to a list of alias patterns (pattern
+    " branches to be specific, see ':help /pattern'). E.g. given:
+    "
+    "   let g:rst_syntax_code_list = {
+    "       \ 'cpp': ['cpp', 'c++'],
+    "       \ }
+    "
+    " then the respective contents of the following two rST directives:
+    "
+    "   .. code:: cpp
+    "
+    "       auto i = 42;
+    "
+    "   .. code:: C++
+    "
+    "       auto i = 42;
+    "
+    " will both be highlighted as C++ code. As shown by the latter block
+    " pattern matching will be case-insensitive.
+    let g:rst_syntax_code_list = {
+        \ 'vim': ['vim'],
+        \ 'java': ['java'],
+        \ 'cpp': ['cpp', 'c++'],
+        \ 'lisp': ['lisp'],
+        \ 'php': ['php'],
+        \ 'python': ['python'],
+        \ 'perl': ['perl'],
+        \ 'sh': ['sh'],
+        \ }
+elseif type(g:rst_syntax_code_list) == type([])
+    " backward compatibility with former list format
+    let s:old_spec = g:rst_syntax_code_list
+    let g:rst_syntax_code_list = {}
+    for s:elem in s:old_spec
+        let g:rst_syntax_code_list[s:elem] = [s:elem]
+    endfor
 endif
 
-for code in g:rst_syntax_code_list
+for s:filetype in keys(g:rst_syntax_code_list)
     unlet! b:current_syntax
     " guard against setting 'isk' option which might cause problems (issue #108)
     let prior_isk = &l:iskeyword
-    exe 'syn include @rst'.code.' syntax/'.code.'.vim'
-    exe 'syn region rstDirective'.code.' matchgroup=rstDirective fold'
-                \.' start=#\%(sourcecode\|code\%(-block\)\=\)::\s\+'.code.'\_s*\n\ze\z(\s\+\)#'
+    let s:alias_pattern = ''
+                \.'\%('
+                \.join(g:rst_syntax_code_list[s:filetype], '\|')
+                \.'\)'
+
+    exe 'syn include @rst'.s:filetype.' syntax/'.s:filetype.'.vim'
+    exe 'syn region rstDirective'.s:filetype
+                \.' matchgroup=rstDirective fold'
+                \.' start="\c\%(sourcecode\|code\%(-block\)\=\)::\s\+'.s:alias_pattern.'\_s*\n\ze\z(\s\+\)"'
                 \.' skip=#^$#'
                 \.' end=#^\z1\@!#'
-                \.' contains=@NoSpell,@rst'.code
-    exe 'syn cluster rstDirectives add=rstDirective'.code
+                \.' contains=@NoSpell,@rst'.s:filetype
+    exe 'syn cluster rstDirectives add=rstDirective'.s:filetype
+
     " reset 'isk' setting, if it has been changed
     if &l:iskeyword !=# prior_isk
         let &l:iskeyword = prior_isk
@@ -169,6 +230,9 @@
     unlet! prior_isk
 endfor
 
+" Enable top level spell checking
+syntax spell toplevel
+
 " TODO: Use better syncing.
 syn sync minlines=50 linebreaks=2
 
@@ -189,8 +253,6 @@
 hi def link rstExDirective                  String
 hi def link rstSubstitutionDefinition       rstDirective
 hi def link rstDelimiter                    Delimiter
-hi def rstEmphasis ctermfg=13 term=italic cterm=italic gui=italic
-hi def rstStrongEmphasis ctermfg=1 term=bold cterm=bold gui=bold
 hi def link rstInterpretedTextOrHyperlinkReference  Identifier
 hi def link rstInlineLiteral                String
 hi def link rstSubstitutionReference        PreProc
@@ -200,6 +262,14 @@
 hi def link rstHyperLinkReference           Identifier
 hi def link rstStandaloneHyperlink          Identifier
 hi def link rstCodeBlock                    String
+if exists('g:rst_use_emphasis_colors')
+    " TODO: Less arbitrary color selection
+    hi def rstEmphasis          ctermfg=13 term=italic cterm=italic gui=italic
+    hi def rstStrongEmphasis    ctermfg=1 term=bold cterm=bold gui=bold
+else
+    hi def rstEmphasis          term=italic cterm=italic gui=italic
+    hi def rstStrongEmphasis    term=bold cterm=bold gui=bold
+endif
 
 let b:current_syntax = "rst"