diff --git a/runtime/indent/eruby.vim b/runtime/indent/eruby.vim
new file mode 100644
index 0000000..664f9c2
--- /dev/null
+++ b/runtime/indent/eruby.vim
@@ -0,0 +1,20 @@
+" Vim indent file
+" Language:     Ruby
+" Maintainer:	Doug Kearns <djkea2 at gus.gscit.monash.edu.au>
+" Info:         $Id$
+" URL:          http://vim-ruby.rubyforge.org/
+" Anon CVS:     See above site
+" Licence:      GPL (http://www.gnu.org)
+" Disclaimer:
+"    This program is distributed in the hope that it will be useful,
+"    but WITHOUT ANY WARRANTY; without even the implied warranty of
+"    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+"    GNU General Public License for more details.
+" ----------------------------------------------------------------------------
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+  finish
+endif
+
+runtime! indent/html.vim
diff --git a/runtime/indent/php.vim b/runtime/indent/php.vim
index 3e7a990..22210ce 100644
--- a/runtime/indent/php.vim
+++ b/runtime/indent/php.vim
@@ -2,30 +2,27 @@
 " Language:	PHP
 " Author:	John Wellesz <John.wellesz (AT) teaser (DOT) fr>
 " URL:		http://www.2072productions.com/vim/indent/php.vim
-" Last Change: 2005 Aug 15
-" Version: 1.17
+" Last Change: 2005 September 22th
+" Version: 1.181
 "
-" For a complete change log and lots of comments in the code, download the script on
+" The change log and all the comments have been removed from this file.
+"
+" For a complete change log and fully commented code, download the script on
 " 2072productions.com at the URI provided above.
-" 
 "
-" 
+"
 "  If you find a bug, please e-mail me at John.wellesz (AT) teaser (DOT) fr
-"  with an example of code that break the algorithm.
-"
-"
-"	Thanks a lot for using this script.
+"  with an example of code that breaks the algorithm.
 "
 "
 " NOTE: This script must be used with PHP syntax ON and with the php syntax
-"		script by Lutz Eymers (http://www.isp.de/data/php.vim ) that's the script bundled with Gvim.
+"	script by Lutz Eymers (http://www.isp.de/data/php.vim ) that's the script bundled with Gvim.
 "
 "
 "	In the case you have syntax errors in your script such as end of HereDoc
 "	tags not at col 1 you'll have to indent your file 2 times (This script 
 "	will automatically put HereDoc end tags at col 1).
 " 
-"
 " NOTE: If you are editing file in Unix file format and that (by accident)
 " there are '\r' before new lines, this script won't be able to proceed
 " correctly and will make many mistakes because it won't be able to match
@@ -38,56 +35,51 @@
 " silently remove them when VIM load this script (at each bufread).
 
 " Options: PHP_default_indenting = # of sw (default is 0), # of sw will be
-"		   added to the indent of each line of PHP code.
+"	   added to the indent of each line of PHP code.
 "
 " Options: PHP_removeCRwhenUnix = 1 to make the script automatically remove CR
-"		   at end of lines (by default this option is unset), NOTE that you
-"		   MUST remove CR when the fileformat is UNIX else the indentation
-"		   won't be correct...
+"	   at end of lines (by default this option is unset), NOTE that you
+"	   MUST remove CR when the fileformat is UNIX else the indentation
+"	   won't be correct...
 "
 " Options: PHP_BracesAtCodeLevel = 1 to indent the '{' and '}' at the same
-"		   level than the code they contain.
-"		   Exemple:
-"			Instead of:
-"				if ($foo)
+"	   level than the code they contain.
+"	   Exemple:
+"		Instead of:
+"			if ($foo)
+"			{
+"				foo();
+"			}
+"
+"		You will write:
+"			if ($foo)
 "				{
-"					foo();
+"				foo();
 "				}
 "
-"			You will write:
-"				if ($foo)
-"					{
-"					foo();
-"					}
-"
-"			NOTE: The script will be a bit slower if you use this option because
-"			some optimizations won't be available.
+"		NOTE: The script will be a bit slower if you use this option because
+"		some optimizations won't be available.
 
 
 if exists("b:did_indent")
-	finish
+    finish
 endif
 let b:did_indent = 1
 
-"	This script set the option php_sync_method of PHP syntax script to 0
-"	(fromstart indenting method) in order to have an accurate syntax.
-"	If you are using very big PHP files (which is a bad idea) you will
-"	experience slowings down while editing, if your code contains only PHP
-"	code you can comment the line below.
 
 let php_sync_method = 0
 
 
 if exists("PHP_default_indenting")
-	let b:PHP_default_indenting = PHP_default_indenting * &sw
+    let b:PHP_default_indenting = PHP_default_indenting * &sw
 else
-	let b:PHP_default_indenting = 0
+    let b:PHP_default_indenting = 0
 endif
 
 if exists("PHP_BracesAtCodeLevel")
-	let b:PHP_BracesAtCodeLevel = PHP_BracesAtCodeLevel
+    let b:PHP_BracesAtCodeLevel = PHP_BracesAtCodeLevel
 else
-	let b:PHP_BracesAtCodeLevel = 0
+    let b:PHP_BracesAtCodeLevel = 0
 endif
 
 
@@ -108,24 +100,21 @@
 setlocal nosmartindent
 setlocal noautoindent 
 setlocal nocindent
-setlocal nolisp " autoindent must be on, so this line is also useless...
+setlocal nolisp
 
 setlocal indentexpr=GetPhpIndent()
 setlocal indentkeys=0{,0},0),:,!^F,o,O,e,*<Return>,=?>,=<?,=*/
 
 
-if version <= 603 && &encoding == 'utf-8'
-	let s:searchpairflags = 'bW'
-else
-	let s:searchpairflags = 'bWr'
-endif
+
+let s:searchpairflags = 'bWr'
 
 if &fileformat == "unix" && exists("PHP_removeCRwhenUnix") && PHP_removeCRwhenUnix
-	silent! %s/\r$//g
+    silent! %s/\r$//g
 endif
 
 if exists("*GetPhpIndent")
-	finish " XXX
+    finish " XXX
 endif
 
 let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
@@ -134,537 +123,544 @@
 
 
 function! GetLastRealCodeLNum(startline) " {{{
-	"Inspired from the function SkipJavaBlanksAndComments by Toby Allsopp for indent/java.vim 
-	let lnum = a:startline
-	let old_lnum = lnum
+    let lnum = a:startline
+    let old_lnum = lnum
 
-	while lnum > 1
-		let lnum = prevnonblank(lnum)
+    while lnum > 1
+	let lnum = prevnonblank(lnum)
+	let lastline = getline(lnum)
+
+	if b:InPHPcode_and_script && lastline =~ '?>\s*$'
+	    let lnum = lnum - 1
+	elseif lastline =~ '^\s*?>.*<?\%(php\)\=\s*$'
+	    let lnum = lnum - 1
+	elseif lastline =~ '^\s*\%(//\|#\|/\*.*\*/\s*$\)'
+	    let lnum = lnum - 1
+	elseif lastline =~ '\*/\s*$'
+	    call cursor(lnum, 1)
+	    if lastline !~ '^\*/'
+		call search('\*/', 'W')
+	    endif
+	    let lnum = searchpair('/\*', '', '\*/', s:searchpairflags)
+
+	    let lastline = getline(lnum)
+	    if lastline =~ '^\s*/\*'
+		let lnum = lnum - 1
+	    else
+		break
+	    endif
+
+
+	elseif lastline =~? '\%(//\s*\|?>.*\)\@<!<?\%(php\)\=\s*$\|^\s*<script\>'
+
+	    while lastline !~ '\(<?.*\)\@<!?>' && lnum > 1
+		let lnum = lnum - 1
 		let lastline = getline(lnum)
-
-		if b:InPHPcode_and_script && lastline =~ '?>\s*$'
-			let lnum = lnum - 1
-		elseif lastline =~ '^\s*?>.*<?\%(php\)\=\s*$'
-			let lnum = lnum - 1
-		elseif lastline =~ '^\s*\%(//\|#\|/\*.*\*/\s*$\)' " if line is under comment
-			let lnum = lnum - 1
-		elseif lastline =~ '\*/\s*$' " skip multiline comments
-			call cursor(lnum, 1)
-			call search('\*/\zs', 'W') " positition the cursor after the first */
-			let lnum = searchpair('/\*', '', '\*/\zs', s:searchpairflags) " find the most outside /*
-
-			let lastline = getline(lnum)
-			if lastline =~ '^\s*/\*' " if line contains nothing but comment
-				let lnum = lnum - 1 " do the job again on the line before (a comment can hide another...)
-			else
-				break
-			endif
-
-			
-		elseif lastline =~? '\%(//\s*\|?>.*\)\@<!<?\%(php\)\=\s*$\|^\s*<script\>' " skip non php code
-
-			while lastline !~ '\(<?.*\)\@<!?>' && lnum > 1
-				let lnum = lnum - 1
-				let lastline = getline(lnum)
-			endwhile
-			if lastline =~ '^\s*?>' " if line contains nothing but end tag 
-				let lnum = lnum - 1
-			else
-				break " else there is something important before the ?>
-			endif
+	    endwhile
+	    if lastline =~ '^\s*?>'
+		let lnum = lnum - 1
+	    else
+		break
+	    endif
 
 
-		elseif lastline =~? '^\a\w*;$' && lastline !~? s:notPhpHereDoc " match the end of a heredoc
-			let tofind=substitute( lastline, '\([^;]\+\);', '<<<\1$', '')
-			while getline(lnum) !~? tofind && lnum > 1
-				let lnum = lnum - 1
-			endwhile
-		else
-			break " if none of these were true then we are done
-		endif
-	endwhile
-
-	if lnum==1 && getline(lnum)!~ '<?'
-		let lnum=0
+	elseif lastline =~? '^\a\w*;$' && lastline !~? s:notPhpHereDoc
+	    let tofind=substitute( lastline, '\([^;]\+\);', '<<<\1$', '')
+	    while getline(lnum) !~? tofind && lnum > 1
+		let lnum = lnum - 1
+	    endwhile
+	else
+	    break 
 	endif
-	
-	if b:InPHPcode_and_script && !b:InPHPcode
-		let b:InPHPcode_and_script = 0
-	endif
-	return lnum
-endfunction
-" }}}
+    endwhile
+
+    if lnum==1 && getline(lnum)!~ '<?'
+	let lnum=0
+    endif
+
+    if b:InPHPcode_and_script && !b:InPHPcode
+	let b:InPHPcode_and_script = 0
+    endif
+    return lnum
+endfunction " }}}
 
 function! Skippmatch()  " {{{
-	let synname = synIDattr(synID(line("."), col("."), 0), "name")
-	if synname == "Delimiter" || synname == "phpParent" || synname == "javaScriptBraces" || synname == "phpComment" && b:UserIsTypingComment
-		return 0
-	else
-		return 1
-	endif
-endfun
-" }}}
+    let synname = synIDattr(synID(line("."), col("."), 0), "name")
+    if synname == "Delimiter" || synname == "phpParent" || synname == "javaScriptBraces" || synname == "phpComment" && b:UserIsTypingComment
+	return 0
+    else
+	return 1
+    endif
+endfun " }}}
 
 function! FindOpenBracket(lnum) " {{{
-	call cursor(a:lnum, 1) " set the cursor to the start of the lnum line
-	return searchpair('{', '', '}', 'bW', 'Skippmatch()')
-endfun
-" }}}
+    call cursor(a:lnum, 1)
+    return searchpair('{', '', '}', 'bW', 'Skippmatch()')
+endfun " }}}
 
 function! FindTheIfOfAnElse (lnum, StopAfterFirstPrevElse) " {{{
-" A very clever recoursive function created by me (John Wellesz) that find the "if" corresponding to an
-" "else". This function can easily be adapted for other languages :)
-	
-	if getline(a:lnum) =~# '^\s*}\s*else\%(if\)\=\>'
-		let beforeelse = a:lnum " we do this so we can find the opened bracket to speed up the process
-	else
-		let beforeelse = GetLastRealCodeLNum(a:lnum - 1)
+
+    if getline(a:lnum) =~# '^\s*}\s*else\%(if\)\=\>'
+	let beforeelse = a:lnum
+    else
+	let beforeelse = GetLastRealCodeLNum(a:lnum - 1)
+    endif
+
+    if !s:level
+	let s:iftoskip = 0
+    endif
+
+    if getline(beforeelse) =~# '^\s*\%(}\s*\)\=else\%(\s*if\)\@!\>'
+	let s:iftoskip = s:iftoskip + 1
+    endif
+
+    if getline(beforeelse) =~ '^\s*}'
+	let beforeelse = FindOpenBracket(beforeelse)
+
+	if getline(beforeelse) =~ '^\s*{'
+	    let beforeelse = GetLastRealCodeLNum(beforeelse - 1)
 	endif
-
-	if !s:level
-		let s:iftoskip = 0
-	endif
-
-	if getline(beforeelse) =~# '^\s*\%(}\s*\)\=else\%(\s*if\)\@!\>'
-		let s:iftoskip = s:iftoskip + 1
-	endif
-	
-	if getline(beforeelse) =~ '^\s*}'
-		let beforeelse = FindOpenBracket(beforeelse)
-
-		if getline(beforeelse) =~ '^\s*{'
-			let beforeelse = GetLastRealCodeLNum(beforeelse - 1)
-		endif
-	endif
+    endif
 
 
-	if !s:iftoskip && a:StopAfterFirstPrevElse && getline(beforeelse) =~# '^\s*\%([}]\s*\)\=else\%(if\)\=\>'
-		return beforeelse
-	endif
-
-	if getline(beforeelse) !~# '^\s*if\>' && beforeelse>1 || s:iftoskip && beforeelse>1
-		
-		if  s:iftoskip && getline(beforeelse) =~# '^\s*if\>'
-			let s:iftoskip = s:iftoskip - 1
-		endif
-
-		let s:level =  s:level + 1
-		let beforeelse = FindTheIfOfAnElse(beforeelse, a:StopAfterFirstPrevElse)
-	endif
-
+    if !s:iftoskip && a:StopAfterFirstPrevElse && getline(beforeelse) =~# '^\s*\%([}]\s*\)\=else\%(if\)\=\>'
 	return beforeelse
+    endif
 
-endfunction
-" }}}
+    if getline(beforeelse) !~# '^\s*if\>' && beforeelse>1 || s:iftoskip && beforeelse>1
+
+	if  s:iftoskip && getline(beforeelse) =~# '^\s*if\>'
+	    let s:iftoskip = s:iftoskip - 1
+	endif
+
+	let s:level =  s:level + 1
+	let beforeelse = FindTheIfOfAnElse(beforeelse, a:StopAfterFirstPrevElse)
+    endif
+
+    return beforeelse
+
+endfunction " }}}
 
 function! IslinePHP (lnum, tofind) " {{{
-	let cline = getline(a:lnum)
+    let cline = getline(a:lnum)
 
-	if a:tofind==""
-		let tofind = "^\\s*[\"']*\s*\\zs\\S" " This correct the issue where lines beginning by a 
-		" single or double quote were not indented in some cases.
-	else
-		let tofind = a:tofind
-	endif
+    if a:tofind==""
+	let tofind = "^\\s*[\"']*\s*\\zs\\S"
+    else
+	let tofind = a:tofind
+    endif
 
-	let tofind = tofind . '\c' " ignorecase
+    let tofind = tofind . '\c'
 
-	let coltotest = match (cline, tofind) + 1 "find the first non blank char in the current line
-	
-	let synname = synIDattr(synID(a:lnum, coltotest, 0), "name") " ask to syntax what is its name
+    let coltotest = match (cline, tofind) + 1
 
-	if synname =~ '^php' || synname=="Delimiter" || synname =~? '^javaScript'
-		return synname
-	else
-		return ""
-	endif
-endfunction
-" }}}
+    let synname = synIDattr(synID(a:lnum, coltotest, 0), "name")
+
+    if synname =~ '^php' || synname=="Delimiter" || synname =~? '^javaScript'
+	return synname
+    else
+	return ""
+    endif
+endfunction " }}}
 
 let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\);'
-let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|while\>\|switch\>\|for\%(each\)\=\>\|declare\>\|[|&]\)'
+let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|else\>\|while\>\|switch\>\|for\%(each\)\=\>\|declare\>\|class\>\|[|&]\)'
 
 let s:autorestoptions = 0
 if ! s:autorestoptions
-	au BufWinEnter,Syntax	*.php,*.php3,*.php4,*.php5	call ResetOptions()
-	let s:autorestoptions = 1
+    au BufWinEnter,Syntax *.php,*.php3,*.php4,*.php5 call ResetOptions()
+    let s:autorestoptions = 1
 endif
 
 function! ResetOptions()
-	if ! b:optionsset
-		setlocal formatoptions=qroc
-		let b:optionsset = 1
-	endif
+    if ! b:optionsset
+	setlocal formatoptions=qroc
+	let b:optionsset = 1
+    endif
 endfunc
 
 function! GetPhpIndent()
-	"##############################################
-	"########### MAIN INDENT FUNCTION #############
-	"##############################################
 
-	let UserIsEditing=0
-	if 	b:PHP_oldchangetick != b:changedtick
-		let b:PHP_oldchangetick = b:changedtick
-		let UserIsEditing=1
+    let UserIsEditing=0
+    if	b:PHP_oldchangetick != b:changedtick
+	let b:PHP_oldchangetick = b:changedtick
+	let UserIsEditing=1
+    endif
+
+    if b:PHP_default_indenting
+	let b:PHP_default_indenting = g:PHP_default_indenting * &sw
+    endif
+
+    let cline = getline(v:lnum)
+
+    if !b:PHP_indentinghuge && b:PHP_lastindented > b:PHP_indentbeforelast 
+	if b:PHP_indentbeforelast
+	    let b:PHP_indentinghuge = 1
+	    echom 'Large indenting detected, speed optimizations engaged'
 	endif
+	let b:PHP_indentbeforelast = b:PHP_lastindented
+    endif
 
-	if b:PHP_default_indenting
-		let b:PHP_default_indenting = g:PHP_default_indenting * &sw
+    if b:InPHPcode_checked && prevnonblank(v:lnum - 1) != b:PHP_lastindented
+	if b:PHP_indentinghuge
+	    echom 'Large indenting deactivated'
+	    let b:PHP_indentinghuge = 0
+	    let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
 	endif
+	let b:PHP_lastindented = v:lnum
+	let b:PHP_LastIndentedWasComment=0
+	let b:PHP_InsideMultilineComment=0
+	let b:PHP_indentbeforelast = 0
 
-	let cline = getline(v:lnum) " current line
+	let b:InPHPcode = 0
+	let b:InPHPcode_checked = 0
+	let b:InPHPcode_and_script = 0
+	let b:InPHPcode_tofind = ""
 
-	if !b:PHP_indentinghuge && b:PHP_lastindented > b:PHP_indentbeforelast 
-		if b:PHP_indentbeforelast
-			let b:PHP_indentinghuge = 1
-			echom 'Large indenting detected, speed optimizations engaged'
-		endif
-		let b:PHP_indentbeforelast = b:PHP_lastindented
-	endif
+    elseif v:lnum > b:PHP_lastindented
+	let real_PHP_lastindented = b:PHP_lastindented
+	let b:PHP_lastindented = v:lnum
+    endif
 
-	if b:InPHPcode_checked && prevnonblank(v:lnum - 1) != b:PHP_lastindented
-		if b:PHP_indentinghuge
-			echom 'Large indenting deactivated'
-			let b:PHP_indentinghuge = 0
-			let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
-		endif
-		let b:PHP_lastindented = v:lnum
-		let b:PHP_LastIndentedWasComment=0
-		let b:PHP_InsideMultilineComment=0
-		let b:PHP_indentbeforelast = 0
-		
-		let b:InPHPcode = 0
-		let b:InPHPcode_checked = 0
-		let b:InPHPcode_and_script = 0
+
+    if !b:InPHPcode_checked " {{{ One time check
+	let b:InPHPcode_checked = 1
+
+	let synname = IslinePHP (prevnonblank(v:lnum), "")
+
+	if synname!=""
+	    if synname != "phpHereDoc"
+		let b:InPHPcode = 1
 		let b:InPHPcode_tofind = ""
 
-	elseif v:lnum > b:PHP_lastindented " we are indenting line in > order (we can rely on the line before)
-		let real_PHP_lastindented = b:PHP_lastindented
-		let b:PHP_lastindented = v:lnum
-	endif
-
-
-	if !b:InPHPcode_checked " {{{ One time check
-		let b:InPHPcode_checked = 1
-
-		let synname = IslinePHP (prevnonblank(v:lnum), "") " the line could be blank (if the user presses 'return')
-
-		if synname!=""
-			if synname != "phpHereDoc"
-				let b:InPHPcode = 1
-				let b:InPHPcode_tofind = ""
-
-				if synname == "phpComment"
-					let b:UserIsTypingComment = 1
-				else
-					let b:UserIsTypingComment = 0
-				endif
-
-				if synname =~? '^javaScript'
-					let b:InPHPcode_and_script = 1
-				endif
-
-			else
-				let b:InPHPcode = 0
-				let b:UserIsTypingComment = 0
-
-				let lnum = v:lnum - 1
-				while getline(lnum) !~? '<<<\a\w*$' && lnum > 1
-					let lnum = lnum - 1
-				endwhile
-
-				let b:InPHPcode_tofind = substitute( getline(lnum), '^.*<<<\(\a\w*\)\c', '^\\s*\1;$', '')
-			endif
-		else " IslinePHP returned "" => we are not in PHP or Javascript
-			let b:InPHPcode = 0
-			let b:UserIsTypingComment = 0
-			" Then we have to find a php start tag...
-			let b:InPHPcode_tofind = '<?\%(.*?>\)\@!\|<script.*>'
-		endif
-	endif "!b:InPHPcode_checked }}}
-
-
-	let lnum = prevnonblank(v:lnum - 1)
-	let last_line = getline(lnum)
-
-	if b:InPHPcode_tofind!=""
-		if cline =~? b:InPHPcode_tofind
-			let	b:InPHPcode = 1
-			let b:InPHPcode_tofind = ""
-			let b:UserIsTypingComment = 0
-			if cline =~ '\*/' " End comment tags must be indented like start comment tags
-				call cursor(v:lnum, 1)
-				call search('\*/\zs', 'W')
-				let lnum = searchpair('/\*', '', '\*/\zs', s:searchpairflags) " find the most outside /*
-
-				let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
-				let b:PHP_LastIndentedWasComment = 0 " prevent a problem if multiline /**/ comment are surounded by
-													 " other types of comments
-				
-				if cline =~ '^\s*\*/'
-					return indent(lnum) + 1
-				else
-					return indent(lnum)
-				endif
-
-			elseif cline =~? '<script\>' " a more accurate test is useless since there isn't any other possibility
-				let b:InPHPcode_and_script = 1
-			endif
-		endif
-	endif
-
-
-	if b:InPHPcode
-
-		if !b:InPHPcode_and_script && last_line =~ '\%(<?.*\)\@<!?>\%(.*<?\)\@!' && IslinePHP(lnum, '?>')=="Delimiter"
-			if cline !~? s:PHP_startindenttag
-				let b:InPHPcode = 0
-				let b:InPHPcode_tofind = s:PHP_startindenttag
-			elseif cline =~? '<script\>'
-				let b:InPHPcode_and_script = 1
-			endif
-
-		elseif last_line =~? '<<<\a\w*$' 
-			let b:InPHPcode = 0
-			let b:InPHPcode_tofind = substitute( last_line, '^.*<<<\(\a\w*\)\c', '^\\s*\1;$', '')
-
-		elseif !UserIsEditing && cline =~ '^\s*/\*\%(.*\*/\)\@!' && getline(v:lnum + 1) !~ '^\s*\*' " XXX indent comments
-			let b:InPHPcode = 0
-			let b:InPHPcode_tofind = '\*/'
-
-		elseif cline =~? '^\s*</script>'
-			let b:InPHPcode = 0
-			let b:InPHPcode_tofind = s:PHP_startindenttag
-		endif
-	endif " }}}
-
-	if !b:InPHPcode && !b:InPHPcode_and_script
-		return -1
-	endif
-
-
-	" Indent successive // or # comment the same way the first is {{{
-	if cline =~ '^\s*\%(//\|#\|/\*.*\*/\s*$\)'
-		if b:PHP_LastIndentedWasComment == 1
-			return indent(real_PHP_lastindented) " line replaced in 1.02
-		endif
-		let b:PHP_LastIndentedWasComment = 1
-	else
-		let b:PHP_LastIndentedWasComment = 0
-	endif
-	" }}}
-	
-	" Indent multiline /* comments correctly {{{
-	
-
-	if b:PHP_InsideMultilineComment || b:UserIsTypingComment
-		if cline =~ '^\s*\*\%(\/\)\@!'   " if cline == '*'
-			if last_line =~ '^\s*/\*' " if last_line == '/*'
-				return indent(lnum) + 1
-			else
-				return indent(lnum)
-			endif
+		if synname == "phpComment"
+		    let b:UserIsTypingComment = 1
 		else
-			let b:PHP_InsideMultilineComment = 0
+		    let b:UserIsTypingComment = 0
 		endif
-	endif
-	
-	if !b:PHP_InsideMultilineComment && cline =~ '^\s*/\*' " if cline == '/*'
-		let b:PHP_InsideMultilineComment = 1
-		return -1
-	endif
-	" }}}
 
-	if cline =~# '^\s*<?' && cline !~ '?>' " Added the ^\s* part in version 1.03
-		return 0
-	endif
-
-	if  cline =~ '^\s*?>' && cline !~# '<?'  
-		return 0
-	endif
-
-	if cline =~? '^\s*\a\w*;$' && cline !~? s:notPhpHereDoc
-		return 0
-	endif
-	" }}}
-
-	let s:level = 0
-
-	let lnum = GetLastRealCodeLNum(v:lnum - 1)
-	let last_line = getline(lnum)    " last line
-	let ind = indent(lnum) " by default
-	let endline= s:endline
-
-	if ind==0 && b:PHP_default_indenting
-		let ind = b:PHP_default_indenting
-	endif
-
-	if lnum == 0
-		return b:PHP_default_indenting
-	endif
-
-
-	if cline =~ '^\s*}\%(}}\)\@!'
-		let ind = indent(FindOpenBracket(v:lnum))
-		let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
-		return ind
-	endif
-
-	if cline =~ '^\s*\*/' " End comment tags must be indented like start comment tags
-		call cursor(v:lnum, 1)
-		call search('\*/\zs', 'W')
-		let lnum = searchpair('/\*', '', '\*/\zs', s:searchpairflags) " find the most outside /*
-
-		let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
-
-		if cline =~ '^\s*\*/'
-			return indent(lnum) + 1
-		else
-			return indent(lnum)
+		if synname =~? '^javaScript'
+		    let b:InPHPcode_and_script = 1
 		endif
-	endif
 
-	let defaultORcase = '^\s*\%(default\|case\).*:'
+	    else
+		let b:InPHPcode = 0
+		let b:UserIsTypingComment = 0
 
-	if last_line =~ '[;}]'.endline && last_line !~# defaultORcase 
-		if ind==b:PHP_default_indenting " if no indentation for the previous line
-			return b:PHP_default_indenting
-		elseif b:PHP_indentinghuge && ind==b:PHP_CurrentIndentLevel && cline !~# '^\s*\%(else\|\%(case\|default\).*:\|[})];\=\)' && last_line !~# '^\s*\%(\%(}\s*\)\=else\)' && getline(GetLastRealCodeLNum(lnum - 1))=~';'.endline
-			return b:PHP_CurrentIndentLevel
-		endif
-	endif
-
-	let LastLineClosed = 0 " used to prevent redundant tests in the last part of the script
-
-	let terminated = '\%(;\%(\s*?>\)\=\|<<<\a\w*\|}\)'.endline
-
-	let unstated   = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.endline
-
-	if ind != b:PHP_default_indenting && cline =~# '^\s*else\%(if\)\=\>'
-		let b:PHP_CurrentIndentLevel = b:PHP_default_indenting " prevent optimized to work at next call
-		return indent(FindTheIfOfAnElse(v:lnum, 1))
-	elseif last_line =~# unstated && cline !~ '^\s*{\|^\s*);\='.endline
-		let ind = ind + &sw
-		return ind
-
-
-	elseif ind != b:PHP_default_indenting && last_line =~ terminated
-		let previous_line = last_line
-		let last_line_num = lnum
-		let LastLineClosed = 1
-
-
-		while 1
-			if previous_line =~ '^\s*}'
-				let last_line_num = FindOpenBracket(last_line_num)
-
-				if getline(last_line_num) =~ '^\s*{'
-					let last_line_num = GetLastRealCodeLNum(last_line_num - 1)
-				endif
-
-				let previous_line = getline(last_line_num)
-
-				continue
-			else
-				if getline(last_line_num) =~# '^\s*else\%(if\)\=\>'
-					let last_line_num = FindTheIfOfAnElse(last_line_num, 0)
-					continue " re-run the loop (we could find a '}' again)
-				endif
-
-
-				let last_match = last_line_num " remember the 'topest' line we found so far
-
-				let one_ahead_indent = indent(last_line_num)
-				let last_line_num = GetLastRealCodeLNum(last_line_num - 1)
-				let two_ahead_indent = indent(last_line_num)
-				let after_previous_line = previous_line
-				let previous_line = getline(last_line_num)
-
-
-				if previous_line =~# defaultORcase.'\|{'.endline
-					break
-				endif
-
-				if after_previous_line=~# '^\s*'.s:blockstart.'.*)'.endline && previous_line =~# '[;}]'.endline
-					break
-				endif
-
-				if one_ahead_indent == two_ahead_indent || last_line_num < 1 
-					if previous_line =~# '[;}]'.endline || last_line_num < 1
-						break
-					endif
-				endif
-			endif
+		let lnum = v:lnum - 1
+		while getline(lnum) !~? '<<<\a\w*$' && lnum > 1
+		    let lnum = lnum - 1
 		endwhile
 
-		if indent(last_match) != ind " if nothing was done lets the old script continue
-			let ind = indent(last_match) " let's use the indent of the last line matched by the alhorithm above
-			let b:PHP_CurrentIndentLevel = b:PHP_default_indenting " line added in version 1.02 to prevent optimized mode
-			" from acting in some special cases
-
-			if cline =~# defaultORcase
-				let ind = ind - &sw
-			endif
-			return ind
-		endif
+		let b:InPHPcode_tofind = substitute( getline(lnum), '^.*<<<\(\a\w*\)\c', '^\\s*\1;$', '')
+	    endif
+	else
+	    let b:InPHPcode = 0
+	    let b:UserIsTypingComment = 0
+	    let b:InPHPcode_tofind = '<?\%(.*?>\)\@!\|<script.*>'
 	endif
-
-	let plinnum = GetLastRealCodeLNum(lnum - 1)
-	let pline = getline(plinnum) " previous to last line
-
-	let last_line = substitute(last_line,"\\(//\\|#\\)\\(\\(\\([^\"']*\\([\"']\\)[^\"']*\\5\\)\\+[^\"']*$\\)\\|\\([^\"']*$\\)\\)",'','')
+    endif "!b:InPHPcode_checked }}}
 
 
-	if ind == b:PHP_default_indenting
-		if last_line =~ terminated
-			let LastLineClosed = 1
+    " Test if we are indenting PHP code {{{
+    let lnum = prevnonblank(v:lnum - 1)
+    let last_line = getline(lnum)
+
+    if b:InPHPcode_tofind!=""
+	if cline =~? b:InPHPcode_tofind
+	    let	b:InPHPcode = 1
+	    let b:InPHPcode_tofind = ""
+	    let b:UserIsTypingComment = 0
+	    if cline =~ '\*/'
+		call cursor(v:lnum, 1)
+		if cline !~ '^\*/'
+		    call search('\*/', 'W')
 		endif
-	endif
-	
-	if !LastLineClosed " the last line isn't a .*; or a }$ line
-		if last_line =~# '[{(]'.endline || last_line =~? '\h\w*\s*(.*,$' && pline !~ '[,(]'.endline
+		let lnum = searchpair('/\*', '', '\*/', s:searchpairflags)
 
-			if !b:PHP_BracesAtCodeLevel || last_line !~# '^\s*{' " XXX mod {
-				let ind = ind + &sw
-			endif
+		let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
 
-			if b:PHP_BracesAtCodeLevel || cline !~# defaultORcase " XXX mod (2) {
-				" case and default are not indented inside blocks
-				let b:PHP_CurrentIndentLevel = ind
-				return ind
-			endif
+		let b:PHP_LastIndentedWasComment = 0
 
-		elseif last_line =~ '\S\+\s*),'.endline
-			call cursor(lnum, 1)
-			call search('),'.endline, 'W')
-			let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()')
-			if openedparent != lnum
-				let ind = indent(openedparent)
-			endif
-			
-		elseif cline !~ '^\s*{' && pline =~ '\%(;\%(\s*?>\)\=\|<<<\a\w*\|{\|^\s*'.s:blockstart.'\s*(.*)\)'.endline.'\|^\s*}\|'.defaultORcase
-			
-			let ind = ind + &sw
-
-		endif
-		if  b:PHP_BracesAtCodeLevel && cline =~# '^\s*{' " XXX mod {
-			let ind = ind + &sw
+		if cline =~ '^\s*\*/'
+		    return indent(lnum) + 1
+		else
+		    return indent(lnum)
 		endif
 
-	elseif last_line =~# defaultORcase
-		let ind = ind + &sw
+	    elseif cline =~? '<script\>'
+		let b:InPHPcode_and_script = 1
+	    endif
 	endif
+    endif
 
-	if cline =~  '^\s*);\='
-		let ind = ind - &sw
-	elseif cline =~# defaultORcase
-		let ind = ind - &sw
-	
+    if b:InPHPcode
+
+	if !b:InPHPcode_and_script && last_line =~ '\%(<?.*\)\@<!?>\%(.*<?\)\@!' && IslinePHP(lnum, '?>')=="Delimiter"
+	    if cline !~? s:PHP_startindenttag
+		let b:InPHPcode = 0
+		let b:InPHPcode_tofind = s:PHP_startindenttag
+	    elseif cline =~? '<script\>'
+		let b:InPHPcode_and_script = 1
+	    endif
+
+	elseif last_line =~? '<<<\a\w*$' 
+	    let b:InPHPcode = 0
+	    let b:InPHPcode_tofind = substitute( last_line, '^.*<<<\(\a\w*\)\c', '^\\s*\1;$', '')
+
+	elseif !UserIsEditing && cline =~ '^\s*/\*\%(.*\*/\)\@!' && getline(v:lnum + 1) !~ '^\s*\*'
+	    let b:InPHPcode = 0
+	    let b:InPHPcode_tofind = '\*/'
+
+	elseif cline =~? '^\s*</script>'
+	    let b:InPHPcode = 0
+	    let b:InPHPcode_tofind = s:PHP_startindenttag
 	endif
+    endif " }}}
 
-	let b:PHP_CurrentIndentLevel = ind
+    if !b:InPHPcode && !b:InPHPcode_and_script
+	return -1
+    endif
+
+
+    " Indent successive // or # comment the same way the first is {{{
+    if cline =~ '^\s*\%(//\|#\|/\*.*\*/\s*$\)'
+	if b:PHP_LastIndentedWasComment == 1
+	    return indent(real_PHP_lastindented)
+	endif
+	let b:PHP_LastIndentedWasComment = 1
+    else
+	let b:PHP_LastIndentedWasComment = 0
+    endif " }}}
+
+    " Indent multiline /* comments correctly {{{
+
+    if b:PHP_InsideMultilineComment || b:UserIsTypingComment
+	if cline =~ '^\s*\*\%(\/\)\@!'
+	    if last_line =~ '^\s*/\*'
+		return indent(lnum) + 1
+	    else
+		return indent(lnum)
+	    endif
+	else
+	    let b:PHP_InsideMultilineComment = 0
+	endif
+    endif
+
+    if !b:PHP_InsideMultilineComment && cline =~ '^\s*/\*'
+	let b:PHP_InsideMultilineComment = 1
+	return -1
+    endif " }}}
+
+
+    " Things always indented at col 1 (PHP delimiter: <?, ?>, Heredoc end) {{{
+    if cline =~# '^\s*<?' && cline !~ '?>'
+	return 0
+    endif
+
+    if  cline =~ '^\s*?>' && cline !~# '<?'  
+	return 0
+    endif
+
+    if cline =~? '^\s*\a\w*;$' && cline !~? s:notPhpHereDoc
+	return 0
+    endif " }}}
+
+    let s:level = 0
+
+    let lnum = GetLastRealCodeLNum(v:lnum - 1)
+    let last_line = getline(lnum)
+    let ind = indent(lnum)
+    let endline= s:endline
+
+    if ind==0 && b:PHP_default_indenting
+	let ind = b:PHP_default_indenting
+    endif
+
+    if lnum == 0
+	return b:PHP_default_indenting
+    endif
+
+
+    if cline =~ '^\s*}\%(}}\)\@!'
+	let ind = indent(FindOpenBracket(v:lnum))
+	let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
 	return ind
+    endif
+
+    if cline =~ '^\s*\*/'
+	call cursor(v:lnum, 1)
+	if cline !~ '^\*/'
+	    call search('\*/', 'W')
+	endif
+	let lnum = searchpair('/\*', '', '\*/', s:searchpairflags)
+
+	let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
+
+	if cline =~ '^\s*\*/'
+	    return indent(lnum) + 1
+	else
+	    return indent(lnum)
+	endif
+    endif
+
+    let defaultORcase = '^\s*\%(default\|case\).*:'
+
+    if last_line =~ '[;}]'.endline && last_line !~# defaultORcase 
+	if ind==b:PHP_default_indenting
+	    return b:PHP_default_indenting
+	elseif b:PHP_indentinghuge && ind==b:PHP_CurrentIndentLevel && cline !~# '^\s*\%(else\|\%(case\|default\).*:\|[})];\=\)' && last_line !~# '^\s*\%(\%(}\s*\)\=else\)' && getline(GetLastRealCodeLNum(lnum - 1))=~';'.endline
+	    return b:PHP_CurrentIndentLevel
+	endif
+    endif
+
+    let LastLineClosed = 0
+
+    let terminated = '\%(;\%(\s*?>\)\=\|<<<\a\w*\|}\)'.endline
+
+    let unstated   = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.endline
+
+    if ind != b:PHP_default_indenting && cline =~# '^\s*else\%(if\)\=\>'
+	let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
+	return indent(FindTheIfOfAnElse(v:lnum, 1))
+    elseif cline =~ '^\s*{'
+	let previous_line = last_line
+	let last_line_num = lnum
+
+	while last_line_num > 1
+
+	    if previous_line =~ '^\s*\%(' . s:blockstart . '\|\%([a-zA-Z]\s*\)*function\)' && previous_line !~ '^\s*[|&]'
+
+		let ind = indent(last_line_num)
+
+		if  b:PHP_BracesAtCodeLevel
+		    let ind = ind + &sw
+		endif
+
+		return ind 
+	    endif
+
+	    let last_line_num = last_line_num - 1
+	    let previous_line = getline(last_line_num)
+	endwhile
+
+    elseif last_line =~# unstated && cline !~ '^\s*{\|^\s*);\='.endline
+	let ind = ind + &sw
+	return ind
+
+    elseif ind != b:PHP_default_indenting && last_line =~ terminated
+	let previous_line = last_line
+	let last_line_num = lnum
+	let LastLineClosed = 1
+
+	while 1
+	    if previous_line =~ '^\s*}'
+		let last_line_num = FindOpenBracket(last_line_num)
+
+		if getline(last_line_num) =~ '^\s*{'
+		    let last_line_num = GetLastRealCodeLNum(last_line_num - 1)
+		endif
+
+		let previous_line = getline(last_line_num)
+
+		continue
+	    else
+
+		if getline(last_line_num) =~# '^\s*else\%(if\)\=\>'
+		    let last_line_num = FindTheIfOfAnElse(last_line_num, 0)
+		    continue
+		endif
+
+
+		let last_match = last_line_num
+
+		let one_ahead_indent = indent(last_line_num)
+		let last_line_num = GetLastRealCodeLNum(last_line_num - 1)
+		let two_ahead_indent = indent(last_line_num)
+		let after_previous_line = previous_line
+		let previous_line = getline(last_line_num)
+
+
+		if previous_line =~# defaultORcase.'\|{'.endline
+		    break
+		endif
+
+		if after_previous_line=~# '^\s*'.s:blockstart.'.*)'.endline && previous_line =~# '[;}]'.endline
+		    break
+		endif
+
+		if one_ahead_indent == two_ahead_indent || last_line_num < 1 
+		    if previous_line =~# '[;}]'.endline || last_line_num < 1
+			break
+		    endif
+		endif
+	    endif
+	endwhile
+
+	if indent(last_match) != ind
+	    let ind = indent(last_match)
+	    let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
+
+	    if cline =~# defaultORcase
+		let ind = ind - &sw
+	    endif
+	    return ind
+	endif
+    endif
+
+    let plinnum = GetLastRealCodeLNum(lnum - 1)
+    let pline = getline(plinnum)
+
+    let last_line = substitute(last_line,"\\(//\\|#\\)\\(\\(\\([^\"']*\\([\"']\\)[^\"']*\\5\\)\\+[^\"']*$\\)\\|\\([^\"']*$\\)\\)",'','')
+
+
+    if ind == b:PHP_default_indenting
+	if last_line =~ terminated
+	    let LastLineClosed = 1
+	endif
+    endif
+
+    if !LastLineClosed
+
+	if last_line =~# '[{(]'.endline || last_line =~? '\h\w*\s*(.*,$' && pline !~ '[,(]'.endline
+
+	    if !b:PHP_BracesAtCodeLevel || last_line !~# '^\s*{'
+		let ind = ind + &sw
+	    endif
+
+	    if b:PHP_BracesAtCodeLevel || cline !~# defaultORcase
+		let b:PHP_CurrentIndentLevel = ind
+		return ind
+	    endif
+
+	elseif last_line =~ '\S\+\s*),'.endline
+	    call cursor(lnum, 1)
+	    call search('),'.endline, 'W')
+	    let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()')
+	    if openedparent != lnum
+		let ind = indent(openedparent)
+	    endif
+
+
+	elseif cline !~ '^\s*{' && pline =~ '\%(;\%(\s*?>\)\=\|<<<\a\w*\|{\|^\s*'.s:blockstart.'\s*(.*)\)'.endline.'\|^\s*}\|'.defaultORcase
+
+	    let ind = ind + &sw
+
+	endif
+
+    elseif last_line =~# defaultORcase
+	let ind = ind + &sw
+    endif
+
+    if cline =~  '^\s*);\='
+	let ind = ind - &sw
+    elseif cline =~# defaultORcase
+	let ind = ind - &sw
+
+    endif
+
+    let b:PHP_CurrentIndentLevel = ind
+    return ind
 endfunction
 
-" vim: set ts=4 sw=4:
-" vim: set ff=unix:
+" vim: set ts=8 sw=4 sts=4:
diff --git a/runtime/indent/ruby.vim b/runtime/indent/ruby.vim
index ff22bbb..e5946eb 100644
--- a/runtime/indent/ruby.vim
+++ b/runtime/indent/ruby.vim
@@ -82,7 +82,7 @@
 let s:end_middle_regex = '\<\%(ensure\|else\|\%(\%(^\|;\)\s*\)\@<=\<rescue\>\|when\|elsif\)\>'
 
 " Regex that defines the end-match for the 'end' keyword.
-let s:end_end_regex = '\%(^\|[^.]\)\@<=\<end\>'
+let s:end_end_regex = '\%(^\|[^.:]\)\@<=\<end\>'
 
 " Expression used for searchpair() call for finding match for 'end' keyword.
 let s:end_skip_expr = s:skip_expr .
@@ -244,17 +244,12 @@
   " If we have a deindenting keyword, find its match and indent to its level.
   " TODO: this is messy
   if s:Match(v:lnum, s:ruby_deindent_keywords)
-"    let lnum = s:PrevNonBlankNonString(v:lnum - 1)
-"
-"    if lnum == 0
-"      return 0
-"    endif
-"
-"    return indent(v:lnum) - &sw
     call cursor(v:lnum, 1)
     if searchpair(s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'bW',
             \ s:end_skip_expr) > 0
-      if strpart(getline('.'), 0, col('.') - 1) =~ '=\s*'
+      let line = getline('.')
+      if strpart(line, 0, col('.') - 1) =~ '=\s*$' &&
+       \ strpart(line, col('.') - 1, 2) !~ 'do'
         let ind = virtcol('.') - 1
       else
         let ind = indent('.')
@@ -380,5 +375,3 @@
 
 let &cpo = s:cpo_save
 unlet s:cpo_save
-
-" vim: nowrap sw=2 sts=2 ts=8 ff=unix:
diff --git a/runtime/indent/sml.vim b/runtime/indent/sml.vim
new file mode 100644
index 0000000..30d3108
--- /dev/null
+++ b/runtime/indent/sml.vim
@@ -0,0 +1,215 @@
+" Vim indent file
+" Language:     SML
+" Maintainer:	Saikat Guha <sg266@cornell.edu>
+" 				Hubert Chao <hc85@cornell.edu>
+" Original OCaml Version:
+" 				Jean-Francois Yuen  <jfyuen@ifrance.com>
+"               Mike Leary          <leary@nwlink.com>
+"               Markus Mottl        <markus@oefai.at>
+" OCaml URL:    http://www.oefai.at/~markus/vim/indent/ocaml.vim
+" Last Change:  2003 Jan 04	- Adapted to SML
+" 				2002 Nov 06 - Some fixes (JY)
+"               2002 Oct 28 - Fixed bug with indentation of ']' (MM)
+"               2002 Oct 22 - Major rewrite (JY)
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+  finish
+endif
+let b:did_indent = 1
+
+setlocal expandtab
+setlocal indentexpr=GetSMLIndent()
+setlocal indentkeys+=0=and,0=else,0=end,0=handle,0=if,0=in,0=let,0=then,0=val,0=fun,0=\|,0=*),0)
+setlocal nolisp
+setlocal nosmartindent
+setlocal textwidth=80
+setlocal shiftwidth=2
+
+" Comment formatting
+if (has("comments"))
+  set comments=sr:(*,mb:*,ex:*)
+  set fo=cqort
+endif
+
+" Only define the function once.
+"if exists("*GetSMLIndent")
+"finish
+"endif
+
+" Define some patterns:
+let s:beflet = '^\s*\(initializer\|method\|try\)\|\(\<\(begin\|do\|else\|in\|then\|try\)\|->\|;\)\s*$'
+let s:letpat = '^\s*\(let\|type\|module\|class\|open\|exception\|val\|include\|external\)\>'
+let s:letlim = '\(\<\(sig\|struct\)\|;;\)\s*$'
+let s:lim = '^\s*\(exception\|external\|include\|let\|module\|open\|type\|val\)\>'
+let s:module = '\<\%(let\|sig\|struct\)\>'
+let s:obj = '^\s*\(constraint\|inherit\|initializer\|method\|val\)\>\|\<\(object\|object\s*(.*)\)\s*$'
+let s:type = '^\s*\%(let\|type\)\>.*='
+let s:val = '^\s*\(val\|external\)\>.*:'
+
+" Skipping pattern, for comments
+function! s:SkipPattern(lnum, pat)
+  let def = prevnonblank(a:lnum - 1)
+  while def > 0 && getline(def) =~ a:pat
+    let def = prevnonblank(def - 1)
+  endwhile
+  return def
+endfunction
+
+" Indent for ';;' to match multiple 'let'
+function! s:GetInd(lnum, pat, lim)
+  let llet = search(a:pat, 'bW')
+  let old = indent(a:lnum)
+  while llet > 0
+    let old = indent(llet)
+    let nb = s:SkipPattern(llet, '^\s*(\*.*\*)\s*$')
+    if getline(nb) =~ a:lim
+      return old
+    endif
+    let llet = search(a:pat, 'bW')
+  endwhile
+  return old
+endfunction
+
+" Indent pairs
+function! s:FindPair(pstart, pmid, pend)
+  call search(a:pend, 'bW')
+"  return indent(searchpair(a:pstart, a:pmid, a:pend, 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"'))
+  let lno = searchpair(a:pstart, a:pmid, a:pend, 'bW', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
+  if lno == -1
+	return indent(lno)
+  else
+	return col(".") - 1
+  endif
+endfunction
+
+function! s:FindLet(pstart, pmid, pend)
+  call search(a:pend, 'bW')
+"  return indent(searchpair(a:pstart, a:pmid, a:pend, 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"'))
+  let lno = searchpair(a:pstart, a:pmid, a:pend, 'bW', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
+  let moduleLine = getline(lno)
+  if lno == -1 || moduleLine =~ '^\s*\(fun\|structure\|signature\)\>'
+	return indent(lno)
+  else
+	return col(".") - 1
+  endif
+endfunction
+
+" Indent 'let'
+"function! s:FindLet(pstart, pmid, pend)
+"  call search(a:pend, 'bW')
+"  return indent(searchpair(a:pstart, a:pmid, a:pend, 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment" || getline(".") =~ "^\\s*let\\>.*=.*\\<in\\s*$" || getline(prevnonblank(".") - 1) =~ "^\\s*let\\>.*=\\s*$\\|" . s:beflet'))
+"endfunction
+
+function! GetSMLIndent()
+  " Find a non-blank line above the current line.
+  let lnum = prevnonblank(v:lnum - 1)
+
+  " At the start of the file use zero indent.
+  if lnum == 0
+    return 0
+  endif
+
+  let ind = indent(lnum)
+  let lline = getline(lnum)
+
+	" Return double 'shiftwidth' after lines matching:
+	if lline =~ '^\s*|.*=>\s*$'
+		return ind + &sw + &sw
+	elseif lline =~ '^\s*val\>.*=\s*$'
+		return ind + &sw
+	endif
+
+  let line = getline(v:lnum)
+
+	" Indent lines starting with 'end' to matching module
+	if line =~ '^\s*end\>'
+		return s:FindLet(s:module, '', '\<end\>')
+
+	" Match 'else' with 'if'
+	elseif line =~ '^\s*else\>'
+	  	if lline !~ '^\s*\(if\|else\|then\)\>'
+				return s:FindPair('\<if\>', '', '\<then\>')
+	  	else return ind
+		endif
+
+	" Match 'then' with 'if'
+	elseif line =~ '^\s*then\>'
+  	if lline !~ '^\s*\(if\|else\|then\)\>'
+		  return s:FindPair('\<if\>', '', '\<then\>')
+	else return ind
+	endif
+
+	" Indent if current line begins with ']'
+	elseif line =~ '^\s*\]'
+		return s:FindPair('\[','','\]')
+
+  " Indent current line starting with 'in' to last matching 'let'
+	elseif line =~ '^\s*in\>'
+		let ind = s:FindLet('\<let\>','','\<in\>')
+
+	" Indent from last matching module if line matches:
+	elseif line =~ '^\s*\(fun\|val\|open\|structure\|and\|datatype\|type\|exception\)\>'
+		cursor(lnum,1)
+  		let lastModule = indent(searchpair(s:module, '', '\<end\>', 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"'))
+		if lastModule == -1
+			return 0
+		else
+			return lastModule + &sw
+		endif
+
+	" Indent lines starting with '|' from matching 'case', 'handle'
+	elseif line =~ '^\s*|'
+		" cursor(lnum,1)
+		let lastSwitch = search('\<\(case\|handle\|fun\|datatype\)\>','bW')
+		let switchLine = getline(lastSwitch)
+		let switchLineIndent = indent(lastSwitch)
+		if lline =~ '^\s*|'
+		  return ind
+		endif
+		if switchLine =~ '\<case\>'
+			return col(".") + 2
+		elseif switchLine =~ '\<handle\>'
+			return switchLineIndent + &sw
+		elseif switchLine =~ '\<datatype\>'
+			call search('=')
+			return col(".") - 1
+		else
+			return switchLineIndent + 2
+		endif
+
+
+  " Indent if last line ends with 'sig', 'struct', 'let', 'then', 'else',
+  " 'in'
+  elseif lline =~ '\<\(sig\|struct\|let\|in\|then\|else\)\s*$'
+		let ind = ind + &sw
+
+  " Indent if last line ends with 'of', align from 'case'
+  elseif lline =~ '\<\(of\)\s*$'
+		call search('\<case\>',"bW")
+		let ind = col(".")+4
+
+	" Indent if current line starts with 'of'
+  elseif line =~ '^\s*of\>'
+		call search('\<case\>',"bW")
+		let ind = col(".")+1
+
+
+	" Indent if last line starts with 'fun', 'case', 'fn'
+	elseif lline =~ '^\s*\(fun\|fn\|case\)\>'
+		let ind = ind + &sw
+
+	endif
+
+	" Don't indent 'let' if last line started with 'fun', 'fn'
+	if line =~ '^\s*let\>'
+		if lline =~ '^\s*\(fun\|fn\)'
+			let ind = ind - &sw
+		endif
+  endif
+
+  return ind
+
+endfunction
+
+" vim:sw=2
