changeset 11262:214f228718cf

Update runtime files. commit https://github.com/vim/vim/commit/e0720cbf63eb3045be8d965e3182c0c392c7b5e9 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 29 13:48:40 2017 +0200 Update runtime files.
author Christian Brabandt <cb@256bit.org>
date Wed, 29 Mar 2017 14:00:06 +0200
parents afa323d6b143
children ae5f9f26f81c
files runtime/doc/eval.txt runtime/doc/filetype.txt runtime/doc/ft_rust.txt runtime/doc/message.txt runtime/doc/options.txt runtime/doc/os_mac.txt runtime/doc/os_win32.txt runtime/doc/tags runtime/doc/todo.txt runtime/doc/usr_41.txt runtime/filetype.vim runtime/indent/php.vim runtime/pack/dist/opt/matchit/plugin/matchit.vim runtime/syntax/sas.vim
diffstat 14 files changed, 375 insertions(+), 310 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*	For Vim version 8.0.  Last change: 2017 Mar 21
+*eval.txt*	For Vim version 8.0.  Last change: 2017 Mar 27
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -7874,6 +7874,7 @@ test_override({name}, {val})				*test_ov
 
 		name	     effect when {val} is non-zero ~
 		redraw       disable the redrawing() function
+		silent_mode  enable silent mode (like using |-s| after |-e|)
 		char_avail   disable the char_avail() function
 		ALL	     clear all overrides ({val} is not used)
 
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -1,4 +1,4 @@
-*filetype.txt*  For Vim version 8.0.  Last change: 2017 Mar 21
+*filetype.txt*  For Vim version 8.0.  Last change: 2017 Mar 28
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -353,12 +353,12 @@ 2. Define your own mapping.  Example: >
    You need to define your own mapping before the plugin is loaded (before
    editing a file of that type).  The plugin will then skip installing the
    default mapping.
-
+						*no_mail_maps*
 3. Disable defining mappings for a specific filetype by setting a variable,
    which contains the name of the filetype.  For the "mail" filetype this
    would be: >
 	:let no_mail_maps = 1
-
+<						*no_plugin_maps*
 4. Disable defining mappings for all filetypes by setting a variable: >
 	:let no_plugin_maps = 1
 <
--- a/runtime/doc/ft_rust.txt
+++ b/runtime/doc/ft_rust.txt
@@ -1,7 +1,7 @@
 *ft_rust.txt*      Filetype plugin for Rust
 
 ==============================================================================
-CONTENTS                                                      *rust* *ft-rust*
+CONTENTS                                                      *rust*
 
 1. Introduction                                                   |rust-intro|
 2. Settings                                                    |rust-settings|
--- a/runtime/doc/message.txt
+++ b/runtime/doc/message.txt
@@ -1,4 +1,4 @@
-*message.txt*   For Vim version 8.0.  Last change: 2017 Jan 02
+*message.txt*   For Vim version 8.0.  Last change: 2017 Mar 25
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -768,6 +768,13 @@ Example: >
 You tried to execute a command that is neither an Ex command nor
 a user-defined command.
 
+							*E943*  >
+  Command table needs to be updated, run 'make cmdidxs'
+
+This can only happen when changing the source code, when adding a command in
+src/ex_cmds.h.  The lookup table then needs to be updated, by running: >
+	make cmdidxs
+
 ==============================================================================
 3. Messages						*messages*
 
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt*	For Vim version 8.0.  Last change: 2017 Mar 09
+*options.txt*	For Vim version 8.0.  Last change: 2017 Mar 22
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -6489,8 +6489,7 @@ A jump table for the options with a shor
 	Flag passed to the shell to execute "!" and ":!" commands; e.g.,
 	"bash.exe -c ls" or "command.com /c dir".  For the MS-DOS-like
 	systems, the default is set according to the value of 'shell', to
-	reduce the need to set this option by the user.  It's not used for
-	OS/2 (EMX figures this out itself).
+	reduce the need to set this option by the user.
 	On Unix it can have more than one flag.  Each white space separated
 	part is passed as an argument to the shell command.
 	See |option-backslash| about including spaces and backslashes.
--- a/runtime/doc/os_mac.txt
+++ b/runtime/doc/os_mac.txt
@@ -12,11 +12,12 @@ NOTE: This file is a bit outdated.  You 
 	http://macvim.org/
 
 1. Filename Convention		|mac-filename|
-2. .vimrc an .vim files		|mac-vimfile|
-3. FAQ				|mac-faq|
-4. Known Lack			|mac-lack|
-5. Mac Bug Report		|mac-bug|
-6. Compiling Vim		|mac-compile|
+2. .vimrc and .vim files	|mac-vimfile|
+3. Standard mappings		|mac-standard-mappings|
+4. FAQ				|mac-faq|
+5. Known Lack			|mac-lack|
+6. Mac Bug Report		|mac-bug|
+7. Compiling Vim		|mac-compile|
 
 There was a Mac port for version 3.0 of Vim.  Here are the first few lines
 from the old file:
@@ -72,7 +73,18 @@ the |'nocompatible'| option is set, othe
 files.
 
 ==============================================================================
-3. Mac FAQ						*mac-faq*
+3. Standard mappings				*mac-standard-mappings*
+
+The following mappings are available for cut/copy/paste from/to clipboard.
+
+key		Normal	Visual	  Insert	Description ~
+Command-v	"*P	"-d"*P    <C-R>*	paste text       *<D-v>*
+Command-c		"*y			copy Visual text *<D-c>*
+Command-x		"*d			cut Visual text  *<D-x>*
+Backspace		"*d			cut Visual text
+
+==============================================================================
+4. Mac FAQ						*mac-faq*
 
 On the internet:  http://macvim.org/OSX/index.php#FAQ
 
@@ -95,13 +107,13 @@ A: The following trick works with most s
 	let $PATH = matchstr(s:path, 'VIMPATH\zs.\{-}\ze\n')
 
 ==============================================================================
-4. Mac Lack						*mac-lack*
+5. Mac Lack						*mac-lack*
 
 In a terminal CTRL-^ needs to be entered as Shift-Control-6.  CTRL-@ as
 Shift-Control-2.
 
 ==============================================================================
-5. Mac Bug Report					*mac-bug*
+6. Mac Bug Report					*mac-bug*
 
 When reporting any Mac specific bug or feature change, please use the vim-mac
 maillist |vim-mac|.  However, you need to be subscribed.  An alternative is to
@@ -110,7 +122,7 @@ send a message to the current MacVim mai
 	mac@vim.org
 
 ==============================================================================
-6. Compiling Vim					*mac-compile*
+7. Compiling Vim					*mac-compile*
 
 See the file "src/INSTALLmac.txt" that comes with the source files.
 
--- a/runtime/doc/os_win32.txt
+++ b/runtime/doc/os_win32.txt
@@ -1,4 +1,4 @@
-*os_win32.txt*  For Vim version 8.0.  Last change: 2016 Oct 12
+*os_win32.txt*  For Vim version 8.0.  Last change: 2017 Mar 21
 
 
 		  VIM REFERENCE MANUAL    by George Reilly
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -3277,6 +3277,9 @@ 90.5	usr_90.txt	/*90.5*
 <Char>	map.txt	/*<Char>*
 <CursorHold>	autocmd.txt	/*<CursorHold>*
 <D-	intro.txt	/*<D-*
+<D-c>	os_mac.txt	/*<D-c>*
+<D-v>	os_mac.txt	/*<D-v>*
+<D-x>	os_mac.txt	/*<D-x>*
 <Del>	change.txt	/*<Del>*
 <Down>	motion.txt	/*<Down>*
 <Drop>	change.txt	/*<Drop>*
@@ -4514,6 +4517,7 @@ E94	windows.txt	/*E94*
 E940	eval.txt	/*E940*
 E941	eval.txt	/*E941*
 E942	eval.txt	/*E942*
+E943	message.txt	/*E943*
 E95	message.txt	/*E95*
 E96	diff.txt	/*E96*
 E97	diff.txt	/*E97*
@@ -6139,7 +6143,6 @@ ft-rst-syntax	syntax.txt	/*ft-rst-syntax
 ft-ruby-omni	insert.txt	/*ft-ruby-omni*
 ft-ruby-syntax	syntax.txt	/*ft-ruby-syntax*
 ft-rust	filetype.txt	/*ft-rust*
-ft-rust	ft_rust.txt	/*ft-rust*
 ft-scheme-syntax	syntax.txt	/*ft-scheme-syntax*
 ft-sdl-syntax	syntax.txt	/*ft-sdl-syntax*
 ft-sed-syntax	syntax.txt	/*ft-sed-syntax*
@@ -7179,6 +7182,7 @@ mac-compile	os_mac.txt	/*mac-compile*
 mac-faq	os_mac.txt	/*mac-faq*
 mac-filename	os_mac.txt	/*mac-filename*
 mac-lack	os_mac.txt	/*mac-lack*
+mac-standard-mappings	os_mac.txt	/*mac-standard-mappings*
 mac-vimfile	os_mac.txt	/*mac-vimfile*
 macintosh	os_mac.txt	/*macintosh*
 macro	map.txt	/*macro*
@@ -7689,6 +7693,8 @@ nice	todo.txt	/*nice*
 no-eval-feature	eval.txt	/*no-eval-feature*
 no-type-checking	eval.txt	/*no-type-checking*
 no_buffers_menu	gui.txt	/*no_buffers_menu*
+no_mail_maps	filetype.txt	/*no_mail_maps*
+no_plugin_maps	filetype.txt	/*no_plugin_maps*
 non-greedy	pattern.txt	/*non-greedy*
 non-zero-arg	eval.txt	/*non-zero-arg*
 none-variable	eval.txt	/*none-variable*
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 8.0.  Last change: 2017 Mar 21
+*todo.txt*      For Vim version 8.0.  Last change: 2017 Mar 29
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -110,8 +110,8 @@ manager.  Problem with Motif?
 
 Memory leak in test97?  The string is actually freed.  Weird.
 
-Patch to make "start" work better: Use ShellExecute in !start (Katsuya Hino,
-#1570)
+Patch for deleting the quickfix lists and a test for it. (Yegappan, 2017 Mar
+21)
 
 Add a toolbar in the terminal.  Can be global, above all windows, or specific
 for one window.
@@ -122,6 +122,8 @@ Use tb_set(winid, [{'text': 'stop', 'cb'
 json_encode(): should convert to utf-8. (Nikolai Pavlov, 2016 Jan 23)
 What if there is an invalid character?
 
+Patch for broken foldtext. (Christian 2017 Mar 22, #1567, 2nd one)
+
 Json string with trailing \u should be an error. (Lcd)
 
 On MS-Windows with 'clipboard' set to "unnamed" this doesn't work to double
@@ -148,6 +150,9 @@ Another example in #1309
 Patch to change all use of &sw to shiftwidth(). (Tyru, 2017 Feb 19)
 Wait until maintainers integrate it.
 
+Patch to change mb_char2len() to utf_char2len(c) when known to use UTF.
+(Dominique, 2017 Mar 21, #1582)
+
 Completion for user-defined commands does not work if a few characters were
 already typed. (Dominique, 2017 Jan 26)
 
@@ -157,6 +162,9 @@ when writing viminfo (and the delete was
 Suggestion to improve pt-br spell checking. (Marcelo D Montu, 2016 Dec 15,
 #1330)
 
+Patch to Modernize GtkForm Implmentation. (Kazuki Kuriyama, 2017 Mar 26)
+Any objections?
+
 Error in test_startup_utf8 on Solaris. (Danek Duvall, 2016 Aug 17)
 
 Completion for :!cmd shows each match twice. #1435
@@ -341,14 +349,6 @@ Jul 25, #948)
 Patch to fix wrong encoding of error message on Cygwin/MSYS terminal.
 (Ken Takata, 2016 Oct 4)
 
-Patch to introduce 'cmdencoding'. (Ken Takata, Aug 18?)
-Better help Aug 19.
-Problem: applies to too many commands, such as :cbuffer.
-Updated patch with three options, 2016 Sep 8.
-    Win32: When running ":make" and 'encoding' differs from the system locale,
-    the output should be converted.  Esp. when 'encoding' is "utf-8". (Yongwei
-    Wu) Should we use 'termencoding' for this?
-
 Patch to add 'systemencoding', convert between 'encoding' and this for file
 names, shell commands and the like.  (Kikuchan, 2010 Oct 14)
 Assume the system converts between the actual encoding of the filesystem to
@@ -421,7 +421,7 @@ When doing "vi buf.md" a BufNew autocomm
 Because of using the initial buffer? (Dun Peal, 2016 May 12)
 
 Patch to add the :bvimgrep command.  (Christian Brabandt, 2014 Nov 12)
-Updated 2016 Jun 10, #858
+Updated 2016 Jun 10, #858  Update 2017 Mar 28: use <buffer>
 
 Add redrawtabline command. (Naruhiko Nishino, 2016 Jun 11)
 
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -1,4 +1,4 @@
-*usr_41.txt*	For Vim version 8.0.  Last change: 2017 Mar 18
+*usr_41.txt*	For Vim version 8.0.  Last change: 2017 Mar 28
 
 		     VIM USER MANUAL - by Bram Moolenaar
 
@@ -2277,8 +2277,8 @@ plugin for the mail filetype: >
 	endif
 
 Two global variables are used:
-no_plugin_maps		disables mappings for all filetype plugins
-no_mail_maps		disables mappings for a specific filetype
+|no_plugin_maps|	disables mappings for all filetype plugins
+|no_mail_maps|		disables mappings for the "mail" filetype
 
 
 USER COMMANDS
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2017 Mar 13
+" Last Change:	2017 Mar 27
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -288,7 +288,8 @@ au BufNewFile,BufRead *.bib			setf bib
 au BufNewFile,BufRead *.bst			setf bst
 
 " BIND configuration
-au BufNewFile,BufRead named.conf,rndc.conf	setf named
+" sudoedit uses namedXXXX.conf
+au BufNewFile,BufRead named*.conf,rndc*.conf	setf named
 
 " BIND zone
 au BufNewFile,BufRead named.root		setf bindzone
--- a/runtime/indent/php.vim
+++ b/runtime/indent/php.vim
@@ -3,8 +3,8 @@
 " Author:	John Wellesz <John.wellesz (AT) teaser (DOT) fr>
 " URL:		http://www.2072productions.com/vim/indent/php.vim
 " Home:		https://github.com/2072/PHP-Indenting-for-VIm
-" Last Change:	2015 September 8th
-" Version:	1.60
+" Last Change:	2017 March 12th
+" Version:	1.62
 "
 "
 "	Type :help php-indent for available options
@@ -141,11 +141,13 @@ let s:PHP_validVariable = '[a-zA-Z_\x7f-
 let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)'
 let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|\%(}\s*\)\?else\>\|do\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|trait\>\|use\>\|interface\>\|abstract\>\|final\>\|try\>\|\%(}\s*\)\=catch\>\|\%(}\s*\)\=finally\>\)'
 let s:functionDecl = '\<function\>\%(\s\+'.s:PHP_validVariable.'\)\=\s*(.*'
-let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
+let s:endline = '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
+let s:unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.s:endline
 
 
-let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<\s*[''"]\=\a\w*[''"]\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)\|^[^''"`]*[''"`]$'
+let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<\s*[''"]\=\a\w*[''"]\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)'
 let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
+let s:structureHead = '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline . '\|\<new\s\+class\>'
 
 
 
@@ -214,10 +216,28 @@ function! GetLastRealCodeLNum(startline)
 		let lnum = lnum - 1
 	    endwhile
 	elseif lastline =~ '^[^''"`]*[''"`][;,]'.s:endline
-	    let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$', '')
-	    while getline(lnum) !~? tofind && lnum > 1
-		let lnum = lnum - 1
+
+	    let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$\\|^[^\1]\\+[=([]\\s*[\1]', '')
+	    let trylnum = lnum
+	    while getline(trylnum) !~? tofind && trylnum > 1
+		let trylnum = trylnum - 1
 	    endwhile
+
+	    if trylnum == 1
+		break
+	    else
+		if lastline =~ ';'.s:endline
+		    while getline(trylnum) !~? s:terminated && getline(trylnum) !~? '{'.s:endline && trylnum > 1
+			let trylnum = prevnonblank(trylnum - 1)
+		    endwhile
+
+
+		    if trylnum == 1
+			break
+		    end
+		end
+		let lnum = trylnum
+	    end
 	else
 	    break
 	endif
@@ -262,7 +282,7 @@ function! FindOpenBracket(lnum, blockSta
 	while line > 1
 	    let linec = getline(line)
 
-	    if linec =~ s:terminated || linec =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
+	    if linec =~ s:terminated || linec =~ s:structureHead
 		break
 	    endif
 
@@ -273,6 +293,20 @@ function! FindOpenBracket(lnum, blockSta
     return line
 endfun " }}}
 
+let s:blockChars = {'{':1, '[': 1, '(': 1, ')':-1, ']':-1, '}':-1}
+function! BalanceDirection (str)
+
+    let balance = 0
+
+    for c in split(a:str, '\zs')
+	if has_key(s:blockChars, c)
+	    let balance += s:blockChars[c]
+	endif
+    endfor
+
+    return balance
+endfun
+
 function! FindTheIfOfAnElse (lnum, StopAfterFirstPrevElse) " {{{
 
     if getline(a:lnum) =~# '^\s*}\s*else\%(if\)\=\>'
@@ -457,7 +491,7 @@ function! GetPhpIndent()
 
 	if synname!=""
 	    if synname == "SpecStringEntrails"
-		let b:InPHPcode = -1
+		let b:InPHPcode = -1 " thumb down
 		let b:InPHPcode_tofind = ""
 	    elseif synname != "phpHereDoc" && synname != "phpHereDocDelimiter"
 		let b:InPHPcode = 1
@@ -540,7 +574,7 @@ function! GetPhpIndent()
 		let b:InPHPcode_and_script = 1
 	    endif
 
-	elseif last_line =~ '^[^''"`]\+[''"`]$'
+	elseif last_line =~ '^[^''"`]\+[''"`]$' " a string identifier with nothing after it and no other string identifier before
 	    let b:InPHPcode = -1
 	    let b:InPHPcode_tofind = substitute( last_line, '^.*\([''"`]\).*$', '^[^\1]*\1[;,]$', '')
 	elseif last_line =~? '<<<\s*[''"]\=\a\w*[''"]\=$'
@@ -660,7 +694,8 @@ function! GetPhpIndent()
 
     let terminated = s:terminated
 
-    let unstated   = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.endline
+    let unstated  = s:unstated
+
 
     if ind != b:PHP_default_indenting && cline =~# '^\s*else\%(if\)\=\>'
 	let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
@@ -673,7 +708,7 @@ function! GetPhpIndent()
 
 	while last_line_num > 1
 
-	    if previous_line =~ terminated || previous_line =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . endline
+	    if previous_line =~ terminated || previous_line =~ s:structureHead
 
 		let ind = indent(last_line_num)
 
@@ -689,7 +724,7 @@ function! GetPhpIndent()
 	endwhile
 
     elseif last_line =~# unstated && cline !~ '^\s*);\='.endline
-	let ind = ind + s:sw()
+	let ind = ind + s:sw() " we indent one level further when the preceding line is not stated
 	return ind + addSpecial
 
     elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated
@@ -699,7 +734,7 @@ function! GetPhpIndent()
 
 	let isSingleLineBlock = 0
 	while 1
-	    if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline
+	    if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline " XXX
 
 		call cursor(last_line_num, 1)
 		if previous_line !~ '^}'
@@ -780,10 +815,10 @@ function! GetPhpIndent()
     if !LastLineClosed
 
 
-	if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline
+	if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline && BalanceDirection(last_line) > 0
 
 	    let dontIndent = 0
-	    if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*)\s*{'.endline && last_line !~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
+	    if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*[)\]]\+\s*{'.endline && last_line !~ s:structureHead
 		let dontIndent = 1
 	    endif
 
@@ -797,9 +832,9 @@ function! GetPhpIndent()
 		return ind + addSpecial
 	    endif
 
-	elseif last_line =~ '\S\+\s*),'.endline
+	elseif last_line =~ '\S\+\s*),'.endline && BalanceDirection(last_line) < 0
 	    call cursor(lnum, 1)
-	    call search('),'.endline, 'W')
+	    call search('),'.endline, 'W') " line never begins with ) so no need for 'c' flag
 	    let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()')
 	    if openedparent != lnum
 		let ind = indent(openedparent)
@@ -809,7 +844,7 @@ function! GetPhpIndent()
 	    let ind = ind + s:sw()
 
 
-    elseif AntepenultimateLine =~ '{'.endline || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase
+	elseif AntepenultimateLine =~ '{'.endline && AntepenultimateLine !~? '^\s*use\>' || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase
 	    let ind = ind + s:sw()
 	endif
 
--- a/runtime/pack/dist/opt/matchit/plugin/matchit.vim
+++ b/runtime/pack/dist/opt/matchit/plugin/matchit.vim
@@ -1,7 +1,7 @@
 "  matchit.vim: (global plugin) Extended "%" matching
-"  Last Change: 2016 Aug 21
+"  Last Change: 2017 March 26
 "  Maintainer:  Benji Fisher PhD   <benji@member.AMS.org>
-"  Version:     1.13.2, for Vim 6.3+
+"  Version:     1.13.3, for Vim 6.3+
 "		Fix from Fernando Torres included.
 "		Improvement from Ken Takata included.
 "  URL:		http://www.vim.org/script.php?script_id=39
@@ -89,12 +89,15 @@ let s:notslash = '\\\@<!\%(\\\\\)*'
 
 function! s:Match_wrapper(word, forward, mode) range
   " In s:CleanUp(), :execute "set" restore_options .
-  let restore_options = (&ic ? " " : " no") . "ignorecase"
-  if exists("b:match_ignorecase")
+  let restore_options = ""
+  if exists("b:match_ignorecase") && b:match_ignorecase != &ic
+    let restore_options .= (&ic ? " " : " no") . "ignorecase"
     let &ignorecase = b:match_ignorecase
   endif
-  let restore_options = " ve=" . &ve . restore_options
-  set ve=
+  if &ve != ''
+    let restore_options = " ve=" . &ve . restore_options
+    set ve=
+  endif
   " If this function was called from Visual mode, make sure that the cursor
   " is at the correct end of the Visual range:
   if a:mode == "v"
@@ -287,7 +290,9 @@ endfun
 " Restore options and do some special handling for Operator-pending mode.
 " The optional argument is the tail of the matching group.
 fun! s:CleanUp(options, mode, startline, startcol, ...)
-  execute "set" a:options
+  if strlen(a:options)
+    execute "set" a:options
+  endif
   " Open folds, if appropriate.
   if a:mode != "o"
     if &foldopen =~ "percent"
@@ -639,8 +644,9 @@ fun! s:MultiMatch(spflag, mode)
   if !exists("b:match_words") || b:match_words == ""
     return ""
   end
-  let restore_options = (&ic ? "" : "no") . "ignorecase"
-  if exists("b:match_ignorecase")
+  let restore_options = ""
+  if exists("b:match_ignorecase") && b:match_ignorecase != &ic
+    let restore_options .= (&ic ? " " : " no") . "ignorecase"
     let &ignorecase = b:match_ignorecase
   endif
   let startline = line(".")
--- a/runtime/syntax/sas.vim
+++ b/runtime/syntax/sas.vim
@@ -1,262 +1,259 @@
 " Vim syntax file
-" Language:	SAS
-" Maintainer:	James Kidd <james.kidd@covance.com>
-" Last Change:  2012 Apr 20
-"               Corrected bug causing some keywords to appear as strings instead
-"               18 Jul 2008 by Paulo Tanimoto <ptanimoto@gmail.com>
-"               Fixed comments with * taking multiple lines.
-"               Fixed highlighting of macro keywords.
-"               Added words to cases that didn't fit anywhere.
-"             	02 Jun 2003
-"		Added highlighting for additional keywords and such;
-"		Attempted to match SAS default syntax colors;
-"		Changed syncing so it doesn't lose colors on large blocks;
-"		Much thanks to Bob Heckel for knowledgeable tweaking.
-"  quit when a syntax file was already loaded
-if exists("b:current_syntax")
-   finish
+" Language:     SAS
+" Maintainer:   Zhen-Huan Hu <wildkeny@gmail.com>
+" Original Maintainer: James Kidd <james.kidd@covance.com>
+" Version:      3.0.0
+" Last Change:  Mar 10, 2017
+"
+" 2017 Mar 7
+"
+" Upgrade version number to 3.0. Improvements include:
+" - Improve sync speed
+" - Largely enhance precision
+" - Update keywords in the latest SAS (as of Mar 2017)
+" - Add syntaxes for date/time constants
+" - Add syntax for data lines
+" - Add (back) syntax for TODO in comments
+"
+" 2017 Feb 9
+"
+" Add syntax folding 
+"
+" 2016 Oct 10
+"
+" Add highlighting for functions
+"
+" 2016 Sep 14
+"
+" Change the implementation of syntaxing
+" macro function names so that macro parameters same
+" as SAS keywords won't be highlighted
+" (Thank Joug Raw for the suggestion)
+" Add section highlighting:
+" - Use /** and **/ to define a section
+" - It functions the same as a comment but
+"   with different highlighting
+"
+" 2016 Jun 14
+"
+" Major changes so upgrade version number to 2.0
+" Overhaul the entire script (again). Improvements include:
+" - Higher precision
+" - Faster synchronization
+" - Separate color for control statements
+" - Highlight hash and java objects
+" - Highlight macro variables in double quoted strings
+" - Update all syntaxes based on SAS 9.4
+" - Add complete SAS/GRAPH and SAS/STAT procedure syntaxes
+" - Add Proc TEMPLATE and GTL syntaxes
+" - Add complete DS2 syntaxes
+" - Add basic IML syntaxes
+" - Many other improvements and bug fixes
+" Drop support for VIM version < 600
+
+if version < 600
+  syntax clear
+elseif exists('b:current_syntax')
+  finish
 endif
 
+let s:cpo_save = &cpo
+set cpo&vim
+
 syn case ignore
 
-syn region sasString	start=+"+  skip=+\\\\\|\\"+  end=+"+
-syn region sasString	start=+'+  skip=+\\\\\|\\"+  end=+'+
-
-" Want region from 'cards;' to ';' to be captured (Bob Heckel)
-syn region sasCards	start="^\s*CARDS.*" end="^\s*;\s*$"
-syn region sasCards	start="^\s*DATALINES.*" end="^\s*;\s*$"
-
-syn match sasNumber	"-\=\<\d*\.\=[0-9_]\>"
-
-" Block comment
-syn region sasComment	start="/\*"  end="\*/" contains=sasTodo
-
-" Ignore misleading //JCL SYNTAX... (Bob Heckel)
-syn region sasComment	start="[^/][^/]/\*"  end="\*/" contains=sasTodo
+" Basic SAS syntaxes
+syn keyword sasOperator and eq ge gt in le lt ne not of or
+syn keyword sasReserved _all_ _automatic_ _char_ _character_ _data_ _infile_ _last_ _n_ _name_ _null_ _num_ _numeric_ _temporary_ _user_ _webout_
+" Strings
+syn region sasString start=+'+ skip=+''+ end=+'+ contains=@Spell
+syn region sasString start=+"+ skip=+""+ end=+"+ contains=sasMacroVariable,@Spell
+" Constants
+syn match sasNumber /\v<\d+%(\.\d+)=%(>|e[\-+]=\d+>)/ display
+syn match sasDateTime /\v(['"])\d{2}%(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d{2}%(\d{2})=:\d{2}:\d{2}%(:\d{2})=%(am|pm)\1dt>/ display
+syn match sasDateTime /\v(['"])\d{2}%(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d{2}%(\d{2})=\1d>/ display
+syn match sasDateTime /\v(['"])\d{2}:\d{2}%(:\d{2})=%(am|pm)\1t>/ display
+" Comments
+syn keyword sasTodo todo tbd fixme contained
+syn region sasComment start='/\*' end='\*/' contains=sasTodo
+syn region sasComment start='\v%(^|;)\s*\zs\%=\*' end=';'me=s-1 contains=sasTodo
+syn region sasSectLbl matchgroup=sasSectLblEnds start='/\*\*\s*' end='\s*\*\*/' concealends
+" Macros
+syn match sasMacroVariable '\v\&+\w+%(\.\w+)=' display
+syn match sasMacroReserved '\v\%%(abort|by|copy|display|do|else|end|global|goto|if|include|input|let|list|local|macro|mend|put|return|run|symdel|syscall|sysexec|syslput|sysrput|then|to|until|window|while)>' display
+syn region sasMacroFunction matchgroup=sasMacroFunctionName start='\v\%\w+\ze\(' end=')'he=s-1 contains=@sasBasicSyntax,sasMacroFunction
+syn region sasMacroFunction matchgroup=sasMacroFunctionName start='\v\%q=sysfunc\ze\(' end=')'he=s-1 contains=@sasBasicSyntax,sasMacroFunction,sasDataStepFunction
+" Syntax cluster for basic SAS syntaxes
+syn cluster sasBasicSyntax contains=sasOperator,sasReserved,sasNumber,sasDateTime,sasString,sasComment,sasMacroReserved,sasMacroFunction,sasMacroVariable,sasSectLbl
 
-" Previous code for comments was written by Bob Heckel
-" Comments with * may take multiple lines (Paulo Tanimoto)
-syn region sasComment start=";\s*\*"hs=s+1 end=";" contains=sasTodo
-
-" Comments with * starting after a semicolon (Paulo Tanimoto)
-syn region sasComment start="^\s*\*" end=";" contains=sasTodo
+" Formats
+syn match sasFormat '\v\$\w+\.' display contained
+syn match sasFormat '\v<\w+\.%(\d+>)=' display contained
+syn region sasFormatContext start='.' end=';'me=s-1 contained contains=@sasBasicSyntax,sasFormat
 
-" This line defines macro variables in code.  "hi def link" at end of file
-" defines the color scheme. Begin region with ampersand and end with
-" any non-word character offset by -1; put ampersand in the skip list
-" just in case it is used to concatenate macro variable values.
-
-" Thanks to ronald höllwarth for this fix to an intra-versioning
-" problem with this little feature
-
-syn region sasMacroVar	start="&" skip="[_&]" end="\W"he=e-1
-
+" Define global statements that can be accessed out of data step or procedures
+syn keyword sasGlobalStatementKeyword catname dm endsas filename footnote footnote1 footnote2 footnote3 footnote4 footnote5 footnote6 footnote7 footnote8 footnote9 footnote10 missing libname lock ods options page quit resetline run sasfile skip sysecho title title1 title2 title3 title4 title5 title6 title7 title8 title9 title10 contained
+syn keyword sasGlobalStatementODSKeyword chtml csvall docbook document escapechar epub epub2 epub3 exclude excel graphics html html3 html5 htmlcss imode listing markup output package path pcl pdf preferences phtml powerpoint printer proclabel proctitle ps results rtf select show tagsets trace usegopt verify wml contained
+syn match sasGlobalStatement '\v%(^|;)\s*\zs\h\w*>' display transparent contains=sasGlobalStatementKeyword
+syn match sasGlobalStatement '\v%(^|;)\s*\zsods>' display transparent contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
 
-" I dont think specific PROCs need to be listed if use this line (Bob Heckel).
-syn match sasProc		"^\s*PROC \w\+"
-syn keyword sasStep		RUN QUIT DATA
-
-
-" Base SAS Procs - version 8.1
-
-syn keyword sasConditional	DO ELSE END IF THEN UNTIL WHILE
+" Data step statements, 9.4
+syn keyword sasDataStepFunctionName abs addr addrlong airy allcomb allperm anyalnum anyalpha anycntrl anydigit anyfirst anygraph anylower anyname anyprint anypunct anyspace anyupper anyxdigit arcos arcosh arsin arsinh artanh atan atan2 attrc attrn band beta betainv blackclprc blackptprc blkshclprc blkshptprc blshift bnot bor brshift bxor byte cat catq cats catt catx cdf ceil ceilz cexist char choosec choosen cinv close cmiss cnonct coalesce coalescec collate comb compare compbl compfuzz compged complev compound compress constant convx convxp cos cosh cot count countc countw csc css cumipmt cumprinc curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datdif date datejul datepart datetime day dclose dcreate depdb depdbsl depsl depsyd deptab dequote deviance dhms dif digamma dim dinfo divide dnum dopen doptname doptnum dosubl dread dropnote dsname dsncatlgd dur durp effrate envlen erf erfc euclid exist exp fact fappend fclose fcol fcopy fdelete fetch fetchobs fexist fget fileexist filename fileref finance find findc findw finfo finv fipname fipnamel fipstate first floor floorz fmtinfo fnonct fnote fopen foptname foptnum fpoint fpos fput fread frewind frlen fsep fuzz fwrite gaminv gamma garkhclprc garkhptprc gcd geodist geomean geomeanz getoption getvarc getvarn graycode harmean harmeanz hbound hms holiday holidayck holidaycount holidayname holidaynx holidayny holidaytest hour htmldecode htmlencode ibessel ifc ifn index indexc indexw input inputc inputn int intcindex intck intcycle intfit intfmt intget intindex intnx intrr intseas intshift inttest intz iorcmsg ipmt iqr irr jbessel juldate juldate7 kurtosis lag largest lbound lcm lcomb left length lengthc lengthm lengthn lexcomb lexcombi lexperk lexperm lfact lgamma libname libref log log1px log10 log2 logbeta logcdf logistic logpdf logsdf lowcase lperm lpnorm mad margrclprc margrptprc max md5 mdy mean median min minute missing mod modexist module modulec modulen modz month mopen mort msplint mvalid contained
+syn keyword sasDataStepFunctionName n netpv nliteral nmiss nomrate normal notalnum notalpha notcntrl notdigit note notfirst notgraph notlower notname notprint notpunct notspace notupper notxdigit npv nvalid nwkdom open ordinal pathname pctl pdf peek peekc peekclong peeklong perm pmt point poisson ppmt probbeta probbnml probbnrm probchi probf probgam probhypr probit probmc probnegb probnorm probt propcase prxchange prxmatch prxparen prxparse prxposn ptrlongadd put putc putn pvp qtr quantile quote ranbin rancau rand ranexp rangam range rank rannor ranpoi rantbl rantri ranuni rename repeat resolve reverse rewind right rms round rounde roundz saving savings scan sdf sec second sha256 sha256hex sha256hmachex sign sin sinh skewness sleep smallest soapweb soapwebmeta soapwipservice soapwipsrs soapws soapwsmeta soundex spedis sqrt squantile std stderr stfips stname stnamel strip subpad substr substrn sum sumabs symexist symget symglobl symlocal sysexist sysget sysmsg sysparm sysprocessid sysprocessname sysprod sysrc system tan tanh time timepart timevalue tinv tnonct today translate transtrn tranwrd trigamma trim trimn trunc tso typeof tzoneid tzonename tzoneoff tzones2u tzoneu2s uniform upcase urldecode urlencode uss uuidgen var varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vtype vtypex vvalue vvaluex week weekday whichc whichn wto year yieldp yrdif yyq zipcity zipcitydistance zipfips zipname zipnamel zipstate contained
+syn keyword sasDataStepCallRoutineName allcomb allcombi allperm cats catt catx compcost execute graycode is8601_convert label lexcomb lexcombi lexperk lexperm logistic missing module poke pokelong prxchange prxdebug prxfree prxnext prxposn prxsubstr ranbin rancau rancomb ranexp rangam rannor ranperk ranperm ranpoi rantbl rantri ranuni scan set sleep softmax sortc sortn stdize streaminit symput symputx system tanh tso vname vnext wto contained
+syn region sasDataStepFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction
+syn region sasDataStepFunctionFormatContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction,sasFormat
+syn match sasDataStepFunction '\v<\w+\ze\(' contained contains=sasDataStepFunctionName,sasDataStepCallRoutineName nextgroup=sasDataStepFunctionContext
+syn match sasDataStepFunction '\v%(input|put)\ze\(' contained contains=sasDataStepFunctionName nextgroup=sasDataStepFunctionFormatContext
+syn keyword sasDataStepHashMethodName add check clear definedata definedone definekey delete do_over equals find find_next find_prev first has_next has_prev last next output prev ref remove removedup replace replacedup reset_dup setcur sum sumdup contained
+syn region sasDataStepHashMethodContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction
+syn match sasDataStepHashMethod '\v\.\w+\ze\(' contained contains=sasDataStepHashMethodName nextgroup=sasDataStepHashMethodContext
+syn keyword sasDataStepHashAttributeName item_size num_items contained
+syn match sasDataStepHashAttribute '\v\.\w+>\ze\_[^(]' display contained contains=sasDataStepHashAttributeName
+syn keyword sasDataStepControl continue do end go goto if leave link otherwise over return select to until when while contained
+syn keyword sasDataStepControl else then contained nextgroup=sasDataStepStatementKeyword skipwhite skipnl skipempty
+syn keyword sasDataStepHashOperator _new_ contained
+syn keyword sasDataStepStatementKeyword abort array attrib by call cards cards4 datalines datalines4 dcl declare delete describe display drop error execute file format infile informat input keep label length lines lines4 list lostcard merge modify output put putlog redirect remove rename replace retain set stop update where window contained
+syn keyword sasDataStepStatementHashKeyword hash hiter javaobj contained
+syn match sasDataStepStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasDataStepStatementKeyword,sasGlobalStatementKeyword
+syn match sasDataStepStatement '\v%(^|;)\s*\zs%(dcl|declare)>' display contained contains=sasDataStepStatementKeyword nextgroup=sasDataStepStatementHashKeyword skipwhite skipnl skipempty
+syn match sasDataStepStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
+syn match sasDataStepStatement '\v%(^|;)\s*\zs%(format|informat|input|put)>' display contained contains=sasDataStepStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
+syn match sasDataStepStatement '\v%(^|;)\s*\zs%(cards|datalines|lines)4=\s*;' display contained contains=sasDataStepStatementKeyword nextgroup=sasDataLine skipwhite skipnl skipempty
+syn region sasDataLine start='^' end='^;'me=s-1 contained
+syn region sasDataStep matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsdata>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,@sasDataStepSyntax
+syn cluster sasDataStepSyntax contains=sasDataStepFunction,sasDataStepHashOperator,sasDataStepHashAttribute,sasDataStepHashMethod,sasDataStepControl,sasDataStepStatement
 
-syn keyword sasStatement	ABORT ARRAY ATTRIB BY CALL CARDS CARDS4 CATNAME
-syn keyword sasStatement	CONTINUE DATALINES DATALINES4 DELETE DISPLAY
-syn keyword sasStatement	DM DROP ENDSAS ERROR FILE FILENAME FOOTNOTE
-syn keyword sasStatement	FORMAT GOTO INFILE INFORMAT INPUT KEEP
-syn keyword sasStatement	LABEL LEAVE LENGTH LIBNAME LINK LIST LOSTCARD
-syn keyword sasStatement	MERGE MISSING MODIFY OPTIONS OUTPUT PAGE
-syn keyword sasStatement	PUT REDIRECT REMOVE RENAME REPLACE RETAIN
-syn keyword sasStatement	RETURN SELECT SET SKIP STARTSAS STOP TITLE
-syn keyword sasStatement	UPDATE WAITSAS WHERE WINDOW X SYSTASK
+" Procedures, base SAS, 9.4
+syn keyword sasProcStatementKeyword abort age append array attrib audit block break by calid cdfplot change checkbox class classlev column compute contents copy create datarow dbencoding define delete deletefunc deletesubr delimiter device dialog dur endcomp exact exchange exclude explore fin fmtlib fontfile fontpath format formats freq function getnames guessingrows hbar hdfs histogram holidur holifin holistart holivar id idlabel informat inset invalue item key keylabel keyword label line link listfunc listsubr mapmiss mapreduce mean menu messages meta modify opentype outargs outdur outfin output outstart pageby partial picture pie pig plot ppplot printer probplot profile prompter qqplot radiobox ranks rbreak rbutton rebuild record remove rename repair report roptions save select selection separator source star start statistics struct submenu subroutine sum sumby table tables test text trantab truetype type1 types value var vbar ways weight where with write contained
+syn match sasProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcStatementKeyword,sasGlobalStatementKeyword
+syn match sasProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
+syn match sasProcStatement '\v%(^|;)\s*\zs%(format|informat)>' display contained contains=sasProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
+syn region sasProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc%(\s+\h\w*)=>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasProcStatement
+syn region sasProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(catalog|chart|datasets|document|plot)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasProcStatement
+
+" Procedures, SAS/GRAPH, 9.4
+syn keyword sasGraphProcStatementKeyword add area axis bar block bubble2 byline cc ccopy cdef cdelete chart cmap choro copy delete device dial donut exclude flow format fs goptions gout grid group hbar hbar3d hbullet hslider htrafficlight id igout label legend list modify move nobyline note pattern pie pie3d plot plot2 preview prism quit rename replay select scatter speedometer star surface symbol tc tcopy tdef tdelete template tile toggle treplay vbar vbar3d vtrafficlight vbullet vslider where contained
+syn match sasGraphProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasGraphProcStatementKeyword,sasGlobalStatementKeyword
+syn match sasGraphProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasGraphProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
+syn region sasGraphProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(g3d|g3grid|ganno|gcontour|gdevice|geocode|gfont|ginside|goptions|gproject|greduce|gremove|mapimport)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasGraphProcStatement
+syn region sasGraphProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(gareabar|gbarline|gchart|gkpi|gmap|gplot|gradar|greplay|gslide|gtile)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasGraphProcStatement
 
-" Keywords that are used in Proc SQL
-" I left them as statements because SAS's enhanced editor highlights
-" them the same as normal statements used in data steps (Jim Kidd)
+" Procedures, SAS/STAT, 14.1
+syn keyword sasAnalyticalProcStatementKeyword absorb add array assess baseline bayes beginnodata bivar bootstrap bounds by cdfplot cells class cluster code compute condition contrast control coordinates copy cosan cov covtest coxreg der design determ deviance direct directions domain effect effectplot effpart em endnodata equality estimate exact exactoptions factor factors fcs filter fitindex format freq fwdlink gender grid group grow hazardratio height hyperprior id impjoint inset insetgroup invar invlink ippplot lincon lineqs lismod lmtests location logistic loglin lpredplot lsmeans lsmestimate manova matings matrix mcmc mean means missmodel mnar model modelaverage modeleffects monotone mstruct mtest multreg name nlincon nloptions oddsratio onecorr onesamplefreq onesamplemeans onewayanova outfiles output paired pairedfreq pairedmeans parameters parent parms partial partition path pathdiagram pcov performance plot population poststrata power preddist predict predpplot priors process probmodel profile prune pvar ram random ratio reference refit refmodel renameparm repeated replicate repweights response restore restrict retain reweight ridge rmsstd roc roccontrast rules samplesize samplingunit seed size scale score selection show simtests simulate slice std stderr store strata structeq supplementary table tables test testclass testfreq testfunc testid time transform treatments trend twosamplefreq twosamplemeans towsamplesurvival twosamplewilcoxon uds units univar var variance varnames weight where with zeromodel contained
+syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasAnalyticalProcStatementKeyword,sasGlobalStatementKeyword
+syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
+syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasAnalyticalProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
+syn region sasAnalyticalProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(aceclus|adaptivereg|bchoice|boxplot|calis|cancorr|candisc|cluster|corresp|discrim|distance|factor|fastclus|fmm|freq|gam|gampl|gee|genmod|glimmix|glmmod|glmpower|glmselect|hpcandisc|hpfmm|hpgenselect|hplmixed|hplogistic|hpmixed|hpnlmod|hppls|hpprincomp|hpquantselect|hpreg|hpsplit|iclifetest|icphreg|inbreed|irt|kde|krige2d|lattice|lifereg|lifetest|loess|logistic|mcmc|mds|mi|mianalyze|mixed|modeclus|multtest|nested|nlin|nlmixed|npar1way|orthoreg|phreg|plm|pls|power|princomp|prinqual|probit|quantlife|quantreg|quantselect|robustreg|rsreg|score|seqdesign|seqtest|sim2d|simnormal|spp|stdize|stdrate|stepdisc|surveyfreq|surveyimpute|surveylogistic|surveymeans|surveyphreg|surveyreg|surveyselect|tpspline|transreg|tree|ttest|varclus|varcomp|variogram)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepControl,sasDataStepFunction,sasAnalyticalProcStatement
+syn region sasAnalyticalProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(anova|arima|catmod|factex|glm|model|optex|plan|reg)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepControl,sasDataStepFunction,sasAnalyticalProcStatement
 
-syn keyword sasStatement	ADD AND ALTER AS CASCADE CHECK CREATE
-syn keyword sasStatement	DELETE DESCRIBE DISTINCT DROP FOREIGN
-syn keyword sasStatement	FROM GROUP HAVING INDEX INSERT INTO IN
-syn keyword sasStatement	KEY LIKE MESSAGE MODIFY MSGTYPE NOT
-syn keyword sasStatement	NULL ON OR ORDER PRIMARY REFERENCES
-syn keyword sasStatement	RESET RESTRICT SELECT SET TABLE
-syn keyword sasStatement	UNIQUE UPDATE VALIDATE VIEW WHERE
-
-" Match declarations have to appear one per line (Paulo Tanimoto)
-syn match sasStatement	"FOOTNOTE\d"
-syn match sasStatement	"TITLE\d"
+" Procedures, ODS graphics, 9.4
+syn keyword sasODSGraphicsProcStatementKeyword band block bubble by colaxis compare dattrvar density dot dropline dynamic ellipse ellipseparm format fringe gradlegend hbar hbarbasic hbarparm hbox heatmap heatmapparm highlow histogram hline inset keylegend label lineparm loess matrix needle parent panelby pbspline plot polygon refline reg rowaxis scatter series spline step style styleattrs symbolchar symbolimage text vbar vbarbasic vbarparm vbox vector vline waterfall where xaxis x2axis yaxis y2axis yaxistable contained
+syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasODSGraphicsProcStatementKeyword,sasGlobalStatementKeyword
+syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
+syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasODSGraphicsProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
+syn region sasODSGraphicsProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(sgdesign|sgpanel|sgplot|sgrender|sgscatter)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasODSGraphicsProcStatement
 
-" Match declarations have to appear one per line (Paulo Tanimoto)
-syn match sasMacro "%BQUOTE"
-syn match sasMacro "%NRBQUOTE"
-syn match sasMacro "%CMPRES"
-syn match sasMacro "%QCMPRES"
-syn match sasMacro "%COMPSTOR"
-syn match sasMacro "%DATATYP"
-syn match sasMacro "%DISPLAY"
-syn match sasMacro "%DO"
-syn match sasMacro "%ELSE"
-syn match sasMacro "%END"
-syn match sasMacro "%EVAL"
-syn match sasMacro "%GLOBAL"
-syn match sasMacro "%GOTO"
-syn match sasMacro "%IF"
-syn match sasMacro "%INDEX"
-syn match sasMacro "%INPUT"
-syn match sasMacro "%KEYDEF"
-syn match sasMacro "%LABEL"
-syn match sasMacro "%LEFT"
-syn match sasMacro "%LENGTH"
-syn match sasMacro "%LET"
-syn match sasMacro "%LOCAL"
-syn match sasMacro "%LOWCASE"
-syn match sasMacro "%MACRO"
-syn match sasMacro "%MEND"
-syn match sasMacro "%NRBQUOTE"
-syn match sasMacro "%NRQUOTE"
-syn match sasMacro "%NRSTR"
-syn match sasMacro "%PUT"
-syn match sasMacro "%QCMPRES"
-syn match sasMacro "%QLEFT"
-syn match sasMacro "%QLOWCASE"
-syn match sasMacro "%QSCAN"
-syn match sasMacro "%QSUBSTR"
-syn match sasMacro "%QSYSFUNC"
-syn match sasMacro "%QTRIM"
-syn match sasMacro "%QUOTE"
-syn match sasMacro "%QUPCASE"
-syn match sasMacro "%SCAN"
-syn match sasMacro "%STR"
-syn match sasMacro "%SUBSTR"
-syn match sasMacro "%SUPERQ"
-syn match sasMacro "%SYSCALL"
-syn match sasMacro "%SYSEVALF"
-syn match sasMacro "%SYSEXEC"
-syn match sasMacro "%SYSFUNC"
-syn match sasMacro "%SYSGET"
-syn match sasMacro "%SYSLPUT"
-syn match sasMacro "%SYSPROD"
-syn match sasMacro "%SYSRC"
-syn match sasMacro "%SYSRPUT"
-syn match sasMacro "%THEN"
-syn match sasMacro "%TO"
-syn match sasMacro "%TRIM"
-syn match sasMacro "%UNQUOTE"
-syn match sasMacro "%UNTIL"
-syn match sasMacro "%UPCASE"
-syn match sasMacro "%VERIFY"
-syn match sasMacro "%WHILE"
-syn match sasMacro "%WINDOW"
+" Proc TEMPLATE, 9.4
+syn keyword sasProcTemplateClause as into
+syn keyword sasProcTemplateStatementKeyword block break cellstyle class close column compute continue define delete delstream do done dynamic edit else end eval flush footer header import iterate link list mvar ndent next nmvar notes open path put putl putlog putq putstream putvars replace set source stop style test text text2 text3 translate trigger unblock unset xdent contained
+syn keyword sasProcTemplateStatementComplexKeyword cellvalue column crosstabs event footer header statgraph style table tagset contained
+syn keyword sasProcTemplateGTLStatementKeyword axislegend axistable bandplot barchart barchartparm begingraph beginpolygon beginpolyline bihistogram3dparm blockplot boxplot boxplotparm bubbleplot continuouslegend contourplotparm dendrogram discretelegend drawarrow drawimage drawline drawoval drawrectangle drawtext dropline ellipse ellipseparm endgraph endinnermargin endlayout endpolygon endpolyline endsidebar entry entryfootnote entrytitle fringeplot heatmap heatmapparm highlowplot histogram histogramparm innermargin layout legenditem legendtextitems linechart lineparm loessplot mergedlegend modelband needleplot pbsplineplot polygonplot referenceline regressionplot scatterplot seriesplot sidebar stepplot surfaceplotparm symbolchar symbolimage textplot vectorplot waterfallchart contained
+syn keyword sasProcTemplateGTLComplexKeyword datalattice datapanel globallegend gridded lattice overlay overlayequated overlay3d region contained
+syn match sasProcTemplateStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcTemplateStatementKeyword,sasProcTemplateGTLStatementKeyword,sasGlobalStatementKeyword
+syn match sasProcTemplateStatement '\v%(^|;)\s*\zsdefine>' display contained contains=sasProcTemplateStatementKeyword nextgroup=sasProcTemplateStatementComplexKeyword skipwhite skipnl skipempty
+syn match sasProcTemplateStatement '\v%(^|;)\s*\zslayout>' display contained contains=sasProcTemplateGTLStatementKeyword nextgroup=sasProcTemplateGTLComplexKeyword skipwhite skipnl skipempty
+syn match sasProcTemplateStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
+syn region sasProcTemplate matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+template>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasProcTemplateClause,sasProcTemplateStatement
 
-" SAS Functions
+" Proc SQL, 9.4
+syn keyword sasProcSQLFunctionName avg count css cv freq max mean median min n nmiss prt range std stderr sum sumwgt t uss var contained
+syn region sasProcSQLFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasProcSQLFunction
+syn match sasProcSQLFunction '\v<\w+\ze\(' contained contains=sasProcSQLFunctionName,sasDataStepFunctionName nextgroup=sasProcSQLFunctionContext
+syn keyword sasProcSQLClause add asc between by calculated cascade case check connection constraint cross desc distinct drop else end escape except exists foreign from full group having in inner intersect into is join key left libname like modify natural newline notrim null on order outer primary references restrict right separated set then to trimmed union unique user using values when where contained
+syn keyword sasProcSQLClause as contained nextgroup=sasProcSQLStatementKeyword skipwhite skipnl skipempty
+syn keyword sasProcSQLStatementKeyword connect delete disconnect execute insert reset select update validate contained
+syn keyword sasProcSQLStatementComplexKeyword alter create describe drop contained nextgroup=sasProcSQLStatementNextKeyword skipwhite skipnl skipempty
+syn keyword sasProcSQLStatementNextKeyword index table view contained
+syn match sasProcSQLStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcSQLStatementKeyword,sasGlobalStatementKeyword
+syn match sasProcSQLStatement '\v%(^|;)\s*\zs%(alter|create|describe|drop)>' display contained contains=sasProcSQLStatementComplexKeyword nextgroup=sasProcSQLStatementNextKeyword skipwhite skipnl skipempty
+syn match sasProcSQLStatement '\v%(^|;)\s*\zsvalidate>' display contained contains=sasProcSQLStatementKeyword nextgroup=sasProcSQLStatementKeyword,sasProcSQLStatementComplexKeyword skipwhite skipnl skipempty
+syn match sasProcSQLStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty 
+syn region sasProcSQL matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+sql>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasProcSQLFunction,sasProcSQLClause,sasProcSQLStatement
+
+" SAS/DS2, 9.4
+syn keyword sasDS2FunctionName abs anyalnum anyalpha anycntrl anydigit anyfirst anygraph anylower anyname anyprint anypunct anyspace anyupper anyxdigit arcos arcosh arsin arsinh artanh atan atan2 band beta betainv blackclprc blackptprc blkshclprc blkshptprc blshift bnot bor brshift bxor byte cat cats catt catx ceil ceilz choosec choosen cmp cmpt coalesce coalescec comb compare compbl compfuzz compound compress constant convx convxp cos cosh count countc countw css cumipmt cumprinc cv datdif date datejul datepart datetime day dequote deviance dhms dif digamma dim divide dur durp effrate erf erfc exp fact find findc findw floor floorz fmtinfo fuzz gaminv gamma garkhclprc garkhptprc gcd geodist geomean geomeanz harmean harmeanz hbound hms holiday hour index indexc indexw inputc inputn int intcindex intck intcycle intdt intfit intget intindex intnest intnx intrr intseas intshift inttest intts intz ipmt iqr irr juldate juldate7 kcount kstrcat kstrip kupdate kupdates kurtosis lag largest lbound lcm left length lengthc lengthm lengthn lgamma log logbeta log10 log1px log2 lowcase mad margrclprc margrptprc max md5 mdy mean median min minute missing mod modz month mort n ndims netpv nmiss nomrate notalnum notalpha notcntrl notdigit notfirst notgraph notlower notname notprint notpunct notspace notupper notxdigit npv null nwkdom ordinal pctl perm pmt poisson power ppmt probbeta probbnml probbnrm probchi probdf probf probgam probhypr probit probmc probmed probnegb probnorm probt prxchange prxmatch prxparse prxposn put pvp qtr quote ranbin rancau rand ranexp rangam range rank rannor ranpoi rantbl rantri ranuni repeat reverse right rms round rounde roundz savings scan sec second sha256hex sha256hmachex sign sin sinh skewness sleep smallest sqlexec sqrt std stderr streaminit strip substr substrn sum sumabs tan tanh time timepart timevalue tinv to_date to_double to_time to_timestamp today translate transtrn tranwrd trigamma trim trimn trunc uniform upcase uss uuidgen var verify vformat vinarray vinformat vlabel vlength vname vtype week weekday whichc whichn year yieldp yrdif yyq contained
+syn region sasDS2FunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasDS2Function
+syn match sasDS2Function '\v<\w+\ze\(' contained contains=sasDS2FunctionName nextgroup=sasDS2FunctionContext
+syn keyword sasDS2Control continue data dcl declare do drop else end enddata endpackage endthread from go goto if leave method otherwise package point return select then thread to until when while contained
+syn keyword sasDS2StatementKeyword array by forward keep merge output put rename retain set stop vararray varlist contained
+syn keyword sasDS2StatementComplexKeyword package thread contained
+syn match sasDS2Statement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasDS2StatementKeyword,sasGlobalStatementKeyword
+syn match sasDS2Statement '\v%(^|;)\s*\zs%(dcl|declare|drop)>' display contained contains=sasDS2StatementKeyword nextgroup=sasDS2StatementComplexKeyword skipwhite skipnl skipempty
+syn match sasDS2Statement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
+syn region sasDS2 matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+ds2>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDS2Function,sasDS2Control,sasDS2Statement
+
+" SAS/IML, 14.1
+syn keyword sasIMLFunctionName abs all allcomb allperm any apply armasim bin blankstr block branks bspline btran byte char choose col colvec concat contents convexit corr corr2cov countmiss countn countunique cov cov2corr covlag cshape cusum cuprod cv cvexhull datasets design designf det diag dif dimension distance do duration echelon eigval eigvec element exp expmatrix expandgrid fft forward froot full gasetup geomean ginv hadamard half hankel harmean hdir hermite homogen i ifft insert int inv invupdt isempty isskipped j jroot kurtosis lag length loc log logabsdet mad magic mahalanobis max mean median min mod moduleic modulein name ncol ndx2sub nleng norm normal nrow num opscal orpol parentname palette polyroot prod product pv quartile rancomb randdirichlet randfun randmultinomial randmvt randnormal randwishart ranperk ranperm range rank ranktie rates ratio remove repeat root row rowcat rowcatc rowvec rsubstr sample setdif shape shapecol skewness solve sparse splinev spot sqrsym sqrt sqrvech ssq standard std storage sub2ndx substr sum sweep symsqr t toeplitz trace trisolv type uniform union unique uniqueby value var vecdiag vech xmult xsect yield contained
+syn keyword sasIMLCallRoutineName appcort armacov armalik bar box change comport delete eigen execute exportdatasettor exportmatrixtor farmacov farmafit farmalik farmasim fdif gaend gagetmem gagetval gainit gareeval garegen gasetcro gasetmut gasetobj gasetsel gblkvp gblkvpd gclose gdelete gdraw gdrawl geneig ggrid ginclude gopen gpie gpiexy gpoint gpoly gport gportpop gportstk gscale gscript gset gshow gsorth gstart gstop gstrlen gtext gvtext gwindow gxaxis gyaxis heatmapcont heatmapdisc histogram importdatasetfromr importmatrixfromr ipf itsolver kalcvf kalcvs kaldff kaldfs lav lcp lms lp lpsolve lts lupdt marg maxqform mcd milpsolve modulei mve nlpcg nlpdd nlpfdd nlpfea nlphqn nlplm nlpnms nlpnra nlpnrr nlpqn nlpqua nlptr ode odsgraph ortvec pgraf push qntl qr quad queue randgen randseed rdodt rupdt rename rupdt rzlind scatter seq seqscale seqshift seqscale seqshift series solvelin sort sortndx sound spline splinec svd tabulate tpspline tpsplnev tsbaysea tsdecomp tsmlocar tsmlomar tsmulmar tspears tspred tsroot tstvcar tsunimar valset varmacov varmalik varmasim vnormal vtsroot wavft wavget wavift wavprint wavthrsh contained
+syn region sasIMLFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasIMLFunction
+syn match sasIMLFunction '\v<\w+\ze\(' contained contains=sasIMLFunctionName,sasDataStepFunction nextgroup=sasIMLFunctionContext
+syn keyword sasIMLControl abort by do else end finish goto if link pause quit resume return run start stop then to until while contained
+syn keyword sasIMLStatementKeyword append call close closefile create delete display edit file find force free index infile input list load mattrib print purge read remove replace reset save setin setout show sort store summary use window contained
+syn match sasIMLStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasIMLStatementKeyword,sasGlobalStatementKeyword
+syn match sasIMLStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
+syn region sasIML matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+iml>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasIMLFunction,sasIMLControl,sasIMLStatement
 
-syn keyword sasFunction	ABS ADDR AIRY ARCOS ARSIN ATAN ATTRC ATTRN
-syn keyword sasFunction	BAND BETAINV BLSHIFT BNOT BOR BRSHIFT BXOR
-syn keyword sasFunction	BYTE CDF CEIL CEXIST CINV CLOSE CNONCT COLLATE
-syn keyword sasFunction	COMPBL COMPOUND COMPRESS COS COSH CSS CUROBS
-syn keyword sasFunction	CV DACCDB DACCDBSL DACCSL DACCSYD DACCTAB
-syn keyword sasFunction	DAIRY DATE DATEJUL DATEPART DATETIME DAY
-syn keyword sasFunction	DCLOSE DEPDB DEPDBSL DEPDBSL DEPSL DEPSL
-syn keyword sasFunction	DEPSYD DEPSYD DEPTAB DEPTAB DEQUOTE DHMS
-syn keyword sasFunction	DIF DIGAMMA DIM DINFO DNUM DOPEN DOPTNAME
-syn keyword sasFunction	DOPTNUM DREAD DROPNOTE DSNAME ERF ERFC EXIST
-syn keyword sasFunction	EXP FAPPEND FCLOSE FCOL FDELETE FETCH FETCHOBS
-syn keyword sasFunction	FEXIST FGET FILEEXIST FILENAME FILEREF FINFO
-syn keyword sasFunction	FINV FIPNAME FIPNAMEL FIPSTATE FLOOR FNONCT
-syn keyword sasFunction	FNOTE FOPEN FOPTNAME FOPTNUM FPOINT FPOS
-syn keyword sasFunction	FPUT FREAD FREWIND FRLEN FSEP FUZZ FWRITE
-syn keyword sasFunction	GAMINV GAMMA GETOPTION GETVARC GETVARN HBOUND
-syn keyword sasFunction	HMS HOSTHELP HOUR IBESSEL INDEX INDEXC
-syn keyword sasFunction	INDEXW INPUT INPUTC INPUTN INT INTCK INTNX
-syn keyword sasFunction	INTRR IRR JBESSEL JULDATE KURTOSIS LAG LBOUND
-syn keyword sasFunction	LEFT LENGTH LGAMMA LIBNAME LIBREF LOG LOG10
-syn keyword sasFunction	LOG2 LOGPDF LOGPMF LOGSDF LOWCASE MAX MDY
-syn keyword sasFunction	MEAN MIN MINUTE MOD MONTH MOPEN MORT N
-syn keyword sasFunction	NETPV NMISS NORMAL NOTE NPV OPEN ORDINAL
-syn keyword sasFunction	PATHNAME PDF PEEK PEEKC PMF POINT POISSON POKE
-syn keyword sasFunction	PROBBETA PROBBNML PROBCHI PROBF PROBGAM
-syn keyword sasFunction	PROBHYPR PROBIT PROBNEGB PROBNORM PROBT PUT
-syn keyword sasFunction	PUTC PUTN QTR QUOTE RANBIN RANCAU RANEXP
-syn keyword sasFunction	RANGAM RANGE RANK RANNOR RANPOI RANTBL RANTRI
-syn keyword sasFunction	RANUNI REPEAT RESOLVE REVERSE REWIND RIGHT
-syn keyword sasFunction	ROUND SAVING SCAN SDF SECOND SIGN SIN SINH
-syn keyword sasFunction	SKEWNESS SOUNDEX SPEDIS SQRT STD STDERR STFIPS
-syn keyword sasFunction	STNAME STNAMEL SUBSTR SUM SYMGET SYSGET SYSMSG
-syn keyword sasFunction	SYSPROD SYSRC SYSTEM TAN TANH TIME TIMEPART
-syn keyword sasFunction	TINV TNONCT TODAY TRANSLATE TRANWRD TRIGAMMA
-syn keyword sasFunction	TRIM TRIMN TRUNC UNIFORM UPCASE USS VAR
-syn keyword sasFunction	VARFMT VARINFMT VARLABEL VARLEN VARNAME
-syn keyword sasFunction	VARNUM VARRAY VARRAYX VARTYPE VERIFY VFORMAT
-syn keyword sasFunction	VFORMATD VFORMATDX VFORMATN VFORMATNX VFORMATW
-syn keyword sasFunction	VFORMATWX VFORMATX VINARRAY VINARRAYX VINFORMAT
-syn keyword sasFunction	VINFORMATD VINFORMATDX VINFORMATN VINFORMATNX
-syn keyword sasFunction	VINFORMATW VINFORMATWX VINFORMATX VLABEL
-syn keyword sasFunction	VLABELX VLENGTH VLENGTHX VNAME VNAMEX VTYPE
-syn keyword sasFunction	VTYPEX WEEKDAY YEAR YYQ ZIPFIPS ZIPNAME ZIPNAMEL
-syn keyword sasFunction	ZIPSTATE
-
-" Handy settings for using vim with log files
-syn keyword sasLogMsg	NOTE
-syn keyword sasWarnMsg	WARNING
-syn keyword sasErrMsg	ERROR
-
-" Always contained in a comment (Bob Heckel)
-syn keyword sasTodo	TODO TBD FIXME contained
+" Macro definition
+syn region sasMacro start='\v\%macro>' end='\v\%mend>' fold keepend contains=@sasBasicSyntax,@sasDataStepSyntax,sasDataStep,sasProc,sasODSGraphicsProc,sasGraphProc,sasAnalyticalProc,sasProcTemplate,sasProcSQL,sasDS2,sasIML
 
-" These don't fit anywhere else (Bob Heckel).
-" Added others that were missing.
-syn keyword sasUnderscore	_ALL_ _AUTOMATIC_ _CHARACTER_ _INFILE_ _N_ _NAME_ _NULL_ _NUMERIC_ _USER_ _WEBOUT_
-
-" End of SAS Functions
-
-"  Define the default highlighting.
-"  Only when an item doesn't have highlighting yet
-
-
-" Default sas enhanced editor color syntax
-hi sComment	term=bold cterm=NONE ctermfg=Green ctermbg=Black gui=NONE guifg=DarkGreen guibg=White
-hi sCard	term=bold cterm=NONE ctermfg=Black ctermbg=Yellow gui=NONE guifg=Black guibg=LightYellow
-hi sDate_Time	term=NONE cterm=bold ctermfg=Green ctermbg=Black gui=bold guifg=SeaGreen guibg=White
-hi sKeyword	term=NONE cterm=NONE ctermfg=Blue  ctermbg=Black gui=NONE guifg=Blue guibg=White
-hi sFmtInfmt	term=NONE cterm=NONE ctermfg=LightGreen ctermbg=Black gui=NONE guifg=SeaGreen guibg=White
-hi sString	term=NONE cterm=NONE ctermfg=Magenta ctermbg=Black gui=NONE guifg=Purple guibg=White
-hi sText	term=NONE cterm=NONE ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
-hi sNumber	term=NONE cterm=bold ctermfg=Green ctermbg=Black gui=bold guifg=SeaGreen guibg=White
-hi sProc	term=NONE cterm=bold ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
-hi sSection	term=NONE cterm=bold ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
-hi mDefine	term=NONE cterm=bold ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
-hi mKeyword	term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=NONE guifg=Blue guibg=White
-hi mReference	term=NONE cterm=bold ctermfg=White ctermbg=Black gui=bold guifg=Blue guibg=White
-hi mSection	term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
-hi mText	term=NONE cterm=NONE ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
-
-" Colors that closely match SAS log colors for default color scheme
-hi lError	term=NONE cterm=NONE ctermfg=Red ctermbg=Black gui=none guifg=Red guibg=White
-hi lWarning	term=NONE cterm=NONE ctermfg=Green ctermbg=Black gui=none guifg=Green guibg=White
-hi lNote	term=NONE cterm=NONE ctermfg=Cyan ctermbg=Black gui=none guifg=Blue guibg=White
-
-
-" Special hilighting for the SAS proc section
-
-hi def link sasComment	sComment
-hi def link sasConditional	sKeyword
-hi def link sasStep		sSection
-hi def link sasFunction	sKeyword
-hi def link sasMacro	mKeyword
-hi def link sasMacroVar	NonText
-hi def link sasNumber	sNumber
-hi def link sasStatement	sKeyword
-hi def link sasString	sString
-hi def link sasProc		sProc
-" (Bob Heckel)
-hi def link sasTodo		Todo
-hi def link sasErrMsg	lError
-hi def link sasWarnMsg	lWarning
-hi def link sasLogMsg	lNote
-hi def link sasCards	sCard
-" (Bob Heckel)
-hi def link sasUnderscore	PreProc
+" Define default highlighting
+hi def link sasComment Comment
+hi def link sasTodo Delimiter
+hi def link sasSectLbl Title
+hi def link sasSectLblEnds Comment
+hi def link sasNumber Number
+hi def link sasDateTime Constant
+hi def link sasString String
+hi def link sasDataStepControl Keyword
+hi def link sasProcTemplateClause Keyword
+hi def link sasProcSQLClause Keyword
+hi def link sasDS2Control Keyword
+hi def link sasIMLControl Keyword
+hi def link sasOperator Operator
+hi def link sasGlobalStatementKeyword Statement
+hi def link sasGlobalStatementODSKeyword Statement
+hi def link sasSectionKeyword Statement
+hi def link sasDataStepFunctionName Function
+hi def link sasDataStepCallRoutineName Function
+hi def link sasDataStepStatementKeyword Statement
+hi def link sasDataStepStatementHashKeyword Statement
+hi def link sasDataStepHashOperator Operator
+hi def link sasDataStepHashMethodName Function
+hi def link sasDataStepHashAttributeName Identifier
+hi def link sasProcStatementKeyword Statement
+hi def link sasODSGraphicsProcStatementKeyword Statement
+hi def link sasGraphProcStatementKeyword Statement
+hi def link sasAnalyticalProcStatementKeyword Statement
+hi def link sasProcTemplateStatementKeyword Statement
+hi def link sasProcTemplateStatementComplexKeyword Statement
+hi def link sasProcTemplateGTLStatementKeyword Statement
+hi def link sasProcTemplateGTLComplexKeyword Statement
+hi def link sasProcSQLFunctionName Function
+hi def link sasProcSQLStatementKeyword Statement
+hi def link sasProcSQLStatementComplexKeyword Statement
+hi def link sasProcSQLStatementNextKeyword Statement
+hi def link sasDS2FunctionName Function
+hi def link sasDS2StatementKeyword Statement
+hi def link sasIMLFunctionName Function
+hi def link sasIMLCallRoutineName Function
+hi def link sasIMLStatementKeyword Statement
+hi def link sasMacroReserved PreProc
+hi def link sasMacroVariable Define
+hi def link sasMacroFunctionName Define
+hi def link sasDataLine SpecialChar
+hi def link sasFormat SpecialChar
+hi def link sasReserved Special
 
 " Syncronize from beginning to keep large blocks from losing
 " syntax coloring while moving through code.
@@ -264,4 +261,5 @@ syn sync fromstart
 
 let b:current_syntax = "sas"
 
-" vim: ts=8
+let &cpo = s:cpo_save
+unlet s:cpo_save