diff --git a/runtime/indent/cmake.vim b/runtime/indent/cmake.vim
index 93a131b..85a9ec4 100644
--- a/runtime/indent/cmake.vim
+++ b/runtime/indent/cmake.vim
@@ -1,14 +1,12 @@
 " Vim indent file
-" Program:      CMake - Cross-Platform Makefile Generator
-" Module:       $RCSfile: cmake-indent.vim,v $
 " Language:     CMake (ft=cmake)
 " Author:       Andy Cedilnik <andy.cedilnik@kitware.com>
-" Maintainer:   Karthik Krishnan <karthik.krishnan@kitware.com>
-" Last Change:  $Date: 2008-01-16 16:53:53 $
-" Version:      $Revision: 1.9 $
+" Maintainer:   Dimitri Merejkowsky <d.merej@gmail.com>
+" Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
+" Last Change:  2017 Aug 30
 "
 " Licence:      The CMake license applies to this file. See
-"               http://www.cmake.org/HTML/Copyright.html
+"               https://cmake.org/licensing
 "               This implies that distribution with Vim is allowed
 
 if exists("b:did_indent")
@@ -16,6 +14,7 @@
 endif
 let b:did_indent = 1
 
+setlocal et
 setlocal indentexpr=CMakeGetIndent(v:lnum)
 setlocal indentkeys+==ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE(
 
@@ -68,19 +67,19 @@
     let ind = ind
   else
     if previous_line =~? cmake_indent_begin_regex
-      let ind = ind + shiftwidth()
+      let ind = ind + &sw
     endif
     if previous_line =~? cmake_indent_open_regex
-      let ind = ind + shiftwidth()
+      let ind = ind + &sw
     endif
   endif
 
   " Subtract
   if this_line =~? cmake_indent_end_regex
-    let ind = ind - shiftwidth()
+    let ind = ind - &sw
   endif
   if previous_line =~? cmake_indent_close_regex
-    let ind = ind - shiftwidth()
+    let ind = ind - &sw
   endif
 
   return ind
diff --git a/runtime/indent/javascript.vim b/runtime/indent/javascript.vim
index 3b3f3a1..2861716 100644
--- a/runtime/indent/javascript.vim
+++ b/runtime/indent/javascript.vim
@@ -2,7 +2,7 @@
 " Language: Javascript
 " Maintainer: Chris Paul ( https://github.com/bounceme )
 " URL: https://github.com/pangloss/vim-javascript
-" Last Change: March 21, 2017
+" Last Change: September 18, 2017
 
 " Only load this indent file when no other was loaded.
 if exists('b:did_indent')
@@ -10,6 +10,10 @@
 endif
 let b:did_indent = 1
 
+" indent correctly if inside <script>
+" vim/vim@690afe1 for the switch from cindent
+let b:html_indent_script1 = 'inc'
+
 " Now, set up our indentation expression and keys that trigger it.
 setlocal indentexpr=GetJavascriptIndent()
 setlocal autoindent nolisp nosmartindent
@@ -21,6 +25,13 @@
 
 let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<'
 
+" Regex of syntax group names that are or delimit string or are comments.
+let b:syng_strcom = get(b:,'syng_strcom','string\|comment\|regex\|special\|doc\|template\%(braces\)\@!')
+let b:syng_str = get(b:,'syng_str','string\|template\|special')
+" template strings may want to be excluded when editing graphql:
+" au! Filetype javascript let b:syng_str = '^\%(.*template\)\@!.*string\|special'
+" au! Filetype javascript let b:syng_strcom = '^\%(.*template\)\@!.*string\|comment\|regex\|special\|doc'
+
 " Only define the function once.
 if exists('*GetJavascriptIndent')
   finish
@@ -36,7 +47,7 @@
   endfunction
 else
   function s:sw()
-    return &l:shiftwidth == 0 ? &l:tabstop : &l:shiftwidth
+    return &l:shiftwidth ? &l:shiftwidth : &l:tabstop
   endfunction
 endif
 
@@ -44,272 +55,301 @@
 " matches before pos.
 let s:z = has('patch-7.4.984') ? 'z' : ''
 
+" Expression used to check whether we should skip a match with searchpair().
+let s:skip_expr = "s:SynAt(line('.'),col('.')) =~? b:syng_strcom"
+let s:in_comm = s:skip_expr[:-14] . "'comment\\|doc'"
+
+let s:rel = has('reltime')
 " searchpair() wrapper
-if has('reltime')
-  function s:GetPair(start,end,flags,skip,time,...)
-    return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 2000,0] + a:000),a:time)
+if s:rel
+  function s:GetPair(start,end,flags,skip)
+    return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,s:l1,a:skip ==# 's:SkipFunc()' ? 2000 : 200)
   endfunction
 else
-  function s:GetPair(start,end,flags,skip,...)
-    return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 1000,get(a:000,1)]))
+  function s:GetPair(start,end,flags,skip)
+    return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,s:l1)
   endfunction
 endif
 
-" Regex of syntax group names that are or delimit string or are comments.
-let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template\%(braces\)\@!'
-let s:syng_str = 'string\|template\|special'
-let s:syng_com = 'comment\|doc'
-" Expression used to check whether we should skip a match with searchpair().
-let s:skip_expr = "synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'"
-
-function s:parse_cino(f) abort
-  return float2nr(eval(substitute(substitute(join(split(
-        \ matchstr(&cino,'.*'.a:f.'\zs[^,]*'), 's',1), '*'.s:W)
-        \ , '^-\=\zs\*','',''), '^-\=\zs\.','0.','')))
-endfunction
-
-function s:skip_func()
-  if getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$'
-    return eval(s:skip_expr)
-  elseif s:checkIn || search('\m`\|\${\|\*\/','nW'.s:z,s:looksyn)
-    let s:checkIn = eval(s:skip_expr)
+function s:SynAt(l,c)
+  let byte = line2byte(a:l) + a:c - 1
+  let pos = index(s:synid_cache[0], byte)
+  if pos == -1
+    let s:synid_cache[:] += [[byte], [synIDattr(synID(a:l, a:c, 0), 'name')]]
   endif
-  let s:looksyn = line('.')
-  return s:checkIn
+  return s:synid_cache[1][pos]
 endfunction
 
-function s:alternatePair(stop)
-  let pos = getpos('.')[1:2]
-  let pat = '[][(){};]'
-  while search('\m'.pat,'bW',a:stop)
-    if s:skip_func() | continue | endif
-    let idx = stridx('])};',s:looking_at())
-    if idx is 3 | let pat = '[{}()]' | continue | endif
-    if idx + 1
-      if s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,a:stop) <= 0
+function s:ParseCino(f)
+  let [divider, n, cstr] = [0] + matchlist(&cino,
+        \ '\%(.*,\)\=\%(\%d'.char2nr(a:f).'\(-\)\=\([.s0-9]*\)\)\=')[1:2]
+  for c in split(cstr,'\zs')
+    if c == '.' && !divider
+      let divider = 1
+    elseif c ==# 's'
+      if n !~ '\d'
+        return n . s:sw() + 0
+      endif
+      let n = str2nr(n) * s:sw()
+      break
+    else
+      let [n, divider] .= [c, 0]
+    endif
+  endfor
+  return str2nr(n) / max([str2nr(divider),1])
+endfunction
+
+" Optimized {skip} expr, only callable from the search loop which
+" GetJavascriptIndent does to find the containing [[{(] (side-effects)
+function s:SkipFunc()
+  if s:top_col == 1
+    throw 'out of bounds'
+  endif
+  let s:top_col = 0
+  if s:check_in
+    if eval(s:skip_expr)
+      return 1
+    endif
+    let s:check_in = 0
+  elseif getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$'
+    if eval(s:skip_expr)
+      let s:looksyn = a:firstline
+      return 1
+    endif
+  elseif search('\m`\|\${\|\*\/','nW'.s:z,s:looksyn) && eval(s:skip_expr)
+    let s:check_in = 1
+    return 1
+  endif
+  let [s:looksyn, s:top_col] = getpos('.')[1:2]
+endfunction
+
+function s:AlternatePair()
+  let [pat, l:for] = ['[][(){};]', 2]
+  while s:SearchLoop(pat,'bW','s:SkipFunc()')
+    if s:LookingAt() == ';'
+      if !l:for
+        if s:GetPair('{','}','bW','s:SkipFunc()')
+          return
+        endif
         break
+      else
+        let [pat, l:for] = ['[{}();]', l:for - 1]
       endif
     else
-      return
+      let idx = stridx('])}',s:LookingAt())
+      if idx == -1
+        return
+      elseif !s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:SkipFunc()')
+        break
+      endif
     endif
   endwhile
-  call call('cursor',pos)
+  throw 'out of bounds'
 endfunction
 
-function s:save_pos(f,...)
-  let l:pos = getpos('.')[1:2]
-  let ret = call(a:f,a:000)
-  call call('cursor',l:pos)
-  return ret
+function s:Nat(int)
+  return a:int * (a:int > 0)
 endfunction
 
-function s:syn_at(l,c)
-  return synIDattr(synID(a:l,a:c,0),'name')
-endfunction
-
-function s:looking_at()
+function s:LookingAt()
   return getline('.')[col('.')-1]
 endfunction
 
-function s:token()
-  return s:looking_at() =~ '\k' ? expand('<cword>') : s:looking_at()
+function s:Token()
+  return s:LookingAt() =~ '\k' ? expand('<cword>') : s:LookingAt()
 endfunction
 
-function s:previous_token()
-  let l:pos = getpos('.')[1:2]
-  if search('\m\k\{1,}\zs\k\|\S','bW')
-    if (getline('.')[col('.')-2:col('.')-1] == '*/' || line('.') != l:pos[0] &&
-          \ getline('.') =~ '\%<'.col('.').'c\/\/') && s:syn_at(line('.'),col('.')) =~? s:syng_com
-      while search('\m\S\ze\_s*\/[/*]','bW')
-        if s:syn_at(line('.'),col('.')) !~? s:syng_com
-          return s:token()
-        endif
-      endwhile
+function s:PreviousToken()
+  let l:col = col('.')
+  if search('\m\k\{1,}\|\S','ebW')
+    if search('\m\*\%#\/\|\/\/\%<'.a:firstline.'l','nbW',line('.')) && eval(s:in_comm)
+      if s:SearchLoop('\S\ze\_s*\/[/*]','bW',s:in_comm)
+        return s:Token()
+      endif
+      call cursor(a:firstline, l:col)
     else
-      return s:token()
+      return s:Token()
     endif
   endif
-  call call('cursor',l:pos)
   return ''
 endfunction
 
-function s:expr_col()
-  if getline('.')[col('.')-2] == ':'
-    return 1
-  endif
+function s:Pure(f,...)
+  return eval("[call(a:f,a:000),cursor(a:firstline,".col('.').")][0]")
+endfunction
+
+function s:SearchLoop(pat,flags,expr)
+  return s:GetPair(a:pat,'\_$.',a:flags,a:expr)
+endfunction
+
+function s:ExprCol()
   let bal = 0
-  while search('\m[{}?:;]','bW')
-    if eval(s:skip_expr) | continue | endif
-    " switch (looking_at())
-    exe {   '}': "if s:GetPair('{','}','bW',s:skip_expr,200) <= 0 | return | endif",
-          \ ';': "return",
-          \ '{': "return getpos('.')[1:2] != b:js_cache[1:] && !s:IsBlock()",
-          \ ':': "let bal -= getline('.')[max([col('.')-2,0]):col('.')] !~ '::'",
-          \ '?': "let bal += 1 | if bal > 0 | return 1 | endif" }[s:looking_at()]
+  while s:SearchLoop('[{}?]\|\_[^:]\zs::\@!','bW',s:skip_expr)
+    if s:LookingAt() == ':'
+      let bal -= 1
+    elseif s:LookingAt() == '?'
+      let bal += 1
+      if bal == 1
+        break
+      endif
+    elseif s:LookingAt() == '{'
+      let bal = !s:IsBlock()
+      break
+    elseif !s:GetPair('{','}','bW',s:skip_expr)
+      break
+    endif
   endwhile
+  return s:Nat(bal)
 endfunction
 
 " configurable regexes that define continuation lines, not including (, {, or [.
 let s:opfirst = '^' . get(g:,'javascript_opfirst',
-      \ '\C\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)')
+      \ '\C\%([<>=,.?^%|/&]\|\([-:+]\)\1\@!\|\*\+\|!=\|in\%(stanceof\)\=\>\)')
 let s:continuation = get(g:,'javascript_continuation',
-      \ '\C\%([-+<>=,.~!?/*^%|&:]\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$'
+      \ '\C\%([<=,.~!?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$'
 
-function s:continues(ln,con)
-  if !cursor(a:ln, match(' '.a:con,s:continuation))
-    let teol = s:looking_at()
-    if teol == '/'
-      return s:syn_at(line('.'),col('.')) !~? 'regex'
-    elseif teol =~ '[-+>]'
-      return getline('.')[col('.')-2] != tr(teol,'>','=')
-    elseif teol =~ '\l'
-      return s:previous_token() != '.'
-    elseif teol == ':'
-      return s:expr_col()
-    endif
-    return 1
+function s:Continues(ln,con)
+  let tok = matchstr(a:con[-15:],s:continuation)
+  if tok =~ '[a-z:]'
+    call cursor(a:ln, len(a:con))
+    return tok == ':' ? s:ExprCol() : s:PreviousToken() != '.'
+  elseif tok !~ '[/>]'
+    return tok isnot ''
   endif
-endfunction
-
-" get the line of code stripped of comments and move cursor to the last
-" non-comment char.
-function s:Trim(ln)
-  let pline = substitute(getline(a:ln),'\s*$','','')
-  let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
-  while l:max != -1 && s:syn_at(a:ln, strlen(pline)) =~? s:syng_com
-    let pline = pline[: l:max]
-    let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
-    let pline = substitute(pline[:-2],'\s*$','','')
-  endwhile
-  return pline is '' || cursor(a:ln,strlen(pline)) ? pline : pline
-endfunction
-
-" Find line above 'lnum' that isn't empty or in a comment
-function s:PrevCodeLine(lnum)
-  let [l:pos, l:n] = [getpos('.')[1:2], prevnonblank(a:lnum)]
-  while l:n
-    if getline(l:n) =~ '^\s*\/[/*]'
-      let l:n = prevnonblank(l:n-1)
-    elseif stridx(getline(l:n), '*/') + 1 && s:syn_at(l:n,1) =~? s:syng_com
-      call cursor(l:n,1)
-      keepjumps norm! [*
-      let l:n = search('\m\S','nbW')
-    else
-      break
-    endif
-  endwhile
-  call call('cursor',l:pos)
-  return l:n
+  return s:SynAt(a:ln, len(a:con)) !~? (tok == '>' ? 'jsflow\|^html' : 'regex')
 endfunction
 
 " Check if line 'lnum' has a balanced amount of parentheses.
 function s:Balanced(lnum)
-  let l:open = 0
-  let l:line = getline(a:lnum)
-  let pos = match(l:line, '[][(){}]', 0)
+  let [l:open, l:line] = [0, getline(a:lnum)]
+  let pos = match(l:line, '[][(){}]')
   while pos != -1
-    if s:syn_at(a:lnum,pos + 1) !~? s:syng_strcom
+    if s:SynAt(a:lnum,pos + 1) !~? b:syng_strcom
       let l:open += match(' ' . l:line[pos],'[[({]')
       if l:open < 0
         return
       endif
     endif
-    let pos = match(l:line, (l:open ?
-          \ '['.escape(tr(l:line[pos],'({[]})',')}][{(').l:line[pos],']').']' :
-          \ '[][(){}]'), pos + 1)
+    let pos = match(l:line, !l:open ? '[][(){}]' : '()' =~ l:line[pos] ?
+          \ '[()]' : '{}' =~ l:line[pos] ? '[{}]' : '[][]', pos + 1)
   endwhile
   return !l:open
 endfunction
 
-function s:OneScope(lnum)
-  let pline = s:Trim(a:lnum)
-  let kw = 'else do'
-  if pline[-1:] == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
-    if s:previous_token() =~# '^\%(await\|each\)$'
-      call s:previous_token()
-      let kw = 'for'
-    else
-      let kw = 'for if let while with'
-    endif
+function s:OneScope()
+  if s:LookingAt() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr)
+    let tok = s:PreviousToken()
+    return (count(split('for if let while with'),tok) ||
+          \ tok =~# '^await$\|^each$' && s:PreviousToken() ==# 'for') &&
+          \ s:Pure('s:PreviousToken') != '.' && !(tok == 'while' && s:DoWhile())
+  elseif s:Token() =~# '^else$\|^do$'
+    return s:Pure('s:PreviousToken') != '.'
   endif
-  return pline[-2:] == '=>' || index(split(kw),s:token()) + 1 &&
-        \ s:save_pos('s:previous_token') != '.'
+  return strpart(getline('.'),col('.')-2,2) == '=>'
 endfunction
 
-" returns braceless levels started by 'i' and above lines * shiftwidth().
-" 'num' is the lineNr which encloses the entire context, 'cont' if whether
-" line 'i' + 1 is a continued expression, which could have started in a
-" braceless context
-function s:iscontOne(i,num,cont)
-  let [l:i, l:num, bL] = [a:i, a:num + !a:num, 0]
-  let pind = a:num ? indent(l:num) + s:W : 0
-  let ind = indent(l:i) + (a:cont ? 0 : s:W)
-  while l:i >= l:num && (ind > pind || l:i == l:num)
-    if indent(l:i) < ind && s:OneScope(l:i)
-      let bL += s:W
-      let l:i = line('.')
-    elseif !a:cont || bL || ind < indent(a:i)
+function s:DoWhile()
+  let cpos = searchpos('\m\<','cbW')
+  if s:SearchLoop('\C[{}]\|\<\%(do\|while\)\>','bW',s:skip_expr)
+    if s:{s:LookingAt() == '}' && s:GetPair('{','}','bW',s:skip_expr) ?
+          \ 'Previous' : ''}Token() ==# 'do' && s:IsBlock()
+      return 1
+    endif
+    call call('cursor',cpos)
+  endif
+endfunction
+
+" returns total offset from braceless contexts. 'num' is the lineNr which
+" encloses the entire context, 'cont' if whether a:firstline is a continued
+" expression, which could have started in a braceless context
+function s:IsContOne(num,cont)
+  let [l:num, b_l] = [a:num + !a:num, 0]
+  let pind = a:num ? indent(a:num) + s:sw() : 0
+  let ind = indent('.') + !a:cont
+  while line('.') > l:num && ind > pind || line('.') == l:num
+    if indent('.') < ind && s:OneScope()
+      let b_l += 1
+    elseif !a:cont || b_l || ind < indent(a:firstline)
+      break
+    else
+      call cursor(0,1)
+    endif
+    let ind = min([ind, indent('.')])
+    if s:PreviousToken() is ''
       break
     endif
-    let ind = min([ind, indent(l:i)])
-    let l:i = s:PrevCodeLine(l:i - 1)
   endwhile
-  return bL
+  return b_l
+endfunction
+
+function s:Class()
+  return (s:Token() ==# 'class' || s:PreviousToken() =~# '^class$\|^extends$') &&
+        \ s:PreviousToken() != '.'
+endfunction
+
+function s:IsSwitch()
+  return s:PreviousToken() !~ '[.*]' &&
+        \ (!s:GetPair('{','}','cbW',s:skip_expr) || s:IsBlock() && !s:Class())
 endfunction
 
 " https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
 function s:IsBlock()
-  if s:looking_at() == '{'
-    let l:n = line('.')
-    let char = s:previous_token()
-    if match(s:stack,'\cxml\|jsx') + 1 && s:syn_at(line('.'),col('.')-1) =~? 'xml\|jsx'
-      return char != '{'
-    elseif char =~ '\k'
-      if char ==# 'type'
-        return s:previous_token() !~# '^\%(im\|ex\)port$'
-      endif
-      return index(split('return const let import export extends yield default delete var await void typeof throw case new of in instanceof')
-            \ ,char) < (line('.') != l:n) || s:save_pos('s:previous_token') == '.'
-    elseif char == '>'
-      return getline('.')[col('.')-2] == '=' || s:syn_at(line('.'),col('.')) =~? '^jsflow'
-    elseif char == ':'
-      return !s:save_pos('s:expr_col')
-    elseif char == '/'
-      return s:syn_at(line('.'),col('.')) =~? 'regex'
+  let tok = s:PreviousToken()
+  if join(s:stack) =~? 'xml\|jsx' && s:SynAt(line('.'),col('.')-1) =~? 'xml\|jsx'
+    return tok != '{'
+  elseif tok =~ '\k'
+    if tok ==# 'type'
+      return s:Pure('eval',"s:PreviousToken() !~# '^\\%(im\\|ex\\)port$' || s:PreviousToken() == '.'")
+    elseif tok ==# 'of'
+      return s:Pure('eval',"!s:GetPair('[[({]','[])}]','bW',s:skip_expr) || s:LookingAt() != '(' ||"
+            \ ."s:{s:PreviousToken() ==# 'await' ? 'Previous' : ''}Token() !=# 'for' || s:PreviousToken() == '.'")
     endif
-    return char !~ '[=~!<*,?^%|&([]' &&
-          \ (char !~ '[-+]' || l:n != line('.') && getline('.')[col('.')-2] == char)
+    return index(split('return const let import export extends yield default delete var await void typeof throw case new in instanceof')
+          \ ,tok) < (line('.') != a:firstline) || s:Pure('s:PreviousToken') == '.'
+  elseif tok == '>'
+    return getline('.')[col('.')-2] == '=' || s:SynAt(line('.'),col('.')) =~? 'jsflow\|^html'
+  elseif tok == '*'
+    return s:Pure('s:PreviousToken') == ':'
+  elseif tok == ':'
+    return s:Pure('eval',"s:PreviousToken() =~ '^\\K\\k*$' && !s:ExprCol()")
+  elseif tok == '/'
+    return s:SynAt(line('.'),col('.')) =~? 'regex'
+  elseif tok !~ '[=~!<,.?^%|&([]'
+    return tok !~ '[-+]' || line('.') != a:firstline && getline('.')[col('.')-2] == tok
   endif
 endfunction
 
 function GetJavascriptIndent()
   let b:js_cache = get(b:,'js_cache',[0,0,0])
-  " Get the current line.
-  call cursor(v:lnum,1)
-  let l:line = getline('.')
+  let s:synid_cache = [[],[]]
+  let l:line = getline(v:lnum)
   " use synstack as it validates syn state and works in an empty line
-  let s:stack = map(synstack(v:lnum,1),"synIDattr(v:val,'name')")
-  let syns = get(s:stack,-1,'')
+  let s:stack = [''] + map(synstack(v:lnum,1),"synIDattr(v:val,'name')")
 
   " start with strings,comments,etc.
-  if syns =~? s:syng_com
+  if s:stack[-1] =~? 'comment\|doc'
     if l:line =~ '^\s*\*'
       return cindent(v:lnum)
     elseif l:line !~ '^\s*\/[/*]'
       return -1
     endif
-  elseif syns =~? s:syng_str
+  elseif s:stack[-1] =~? b:syng_str
     if b:js_cache[0] == v:lnum - 1 && s:Balanced(v:lnum-1)
       let b:js_cache[0] = v:lnum
     endif
     return -1
   endif
-  let l:lnum = s:PrevCodeLine(v:lnum - 1)
-  if !l:lnum
+
+  let s:l1 = max([0,prevnonblank(v:lnum) - (s:rel ? 2000 : 1000),
+        \ get(get(b:,'hi_indent',{}),'blocklnr')])
+  call cursor(v:lnum,1)
+  if s:PreviousToken() is ''
     return
   endif
+  let [l:lnum, pline] = [line('.'), getline('.')[:col('.')-1]]
 
   let l:line = substitute(l:line,'^\s*','','')
+  let l:line_raw = l:line
   if l:line[:1] == '/*'
     let l:line = substitute(l:line,'^\%(\/\*.\{-}\*\/\s*\)*','','')
   endif
@@ -318,60 +358,91 @@
   endif
 
   " the containing paren, bracket, or curly. Many hacks for performance
+  call cursor(v:lnum,1)
   let idx = index([']',')','}'],l:line[0])
-  if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
-        \ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))
+  if b:js_cache[0] > l:lnum && b:js_cache[0] < v:lnum ||
+        \ b:js_cache[0] == l:lnum && s:Balanced(l:lnum)
     call call('cursor',b:js_cache[1:])
   else
-    let [s:looksyn, s:checkIn, top] = [v:lnum - 1, 0, (!indent(l:lnum) &&
-          \ s:syn_at(l:lnum,1) !~? s:syng_str) * l:lnum]
-    if idx + 1
-      call s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:skip_func()',2000,top)
-    elseif getline(v:lnum) !~ '^\S' && syns =~? 'block'
-      call s:GetPair('{','}','bW','s:skip_func()',2000,top)
-    else
-      call s:alternatePair(top)
-    endif
+    let [s:looksyn, s:top_col, s:check_in, s:l1] = [v:lnum - 1,0,0,
+          \ max([s:l1, &smc ? search('\m^.\{'.&smc.',}','nbW',s:l1 + 1) + 1 : 0])]
+    try
+      if idx != -1
+        call s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:SkipFunc()')
+      elseif getline(v:lnum) !~ '^\S' && s:stack[-1] =~? 'block\|^jsobject$'
+        call s:GetPair('{','}','bW','s:SkipFunc()')
+      else
+        call s:AlternatePair()
+      endif
+    catch /^\Cout of bounds$/
+      call cursor(v:lnum,1)
+    endtry
+    let b:js_cache[1:] = line('.') == v:lnum ? [0,0] : getpos('.')[1:2]
   endif
 
-  let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [0,0] : getpos('.')[1:2])
-  let num = b:js_cache[1]
+  let [b:js_cache[0], num] = [v:lnum, b:js_cache[1]]
 
-  let [s:W, isOp, bL, switch_offset] = [s:sw(),0,0,0]
-  if !num || s:IsBlock()
+  let [num_ind, is_op, b_l, l:switch_offset] = [s:Nat(indent(num)),0,0,0]
+  if !num || s:LookingAt() == '{' && s:IsBlock()
     let ilnum = line('.')
-    let pline = s:save_pos('s:Trim',l:lnum)
-    if num && s:looking_at() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
-      let num = ilnum == num ? line('.') : num
-      if idx < 0 && s:previous_token() ==# 'switch' && s:previous_token() != '.'
-        if &cino !~ ':'
-          let switch_offset = s:W
-        else
-          let switch_offset = max([-indent(num),s:parse_cino(':')])
-        endif
+    if num && s:LookingAt() == ')' && s:GetPair('(',')','bW',s:skip_expr)
+      if ilnum == num
+        let [num, num_ind] = [line('.'), indent('.')]
+      endif
+      if idx == -1 && s:PreviousToken() ==# 'switch' && s:IsSwitch()
+        let l:switch_offset = &cino !~ ':' ? s:sw() : s:ParseCino(':')
         if pline[-1:] != '.' && l:line =~# '^\%(default\|case\)\>'
-          return indent(num) + switch_offset
+          return s:Nat(num_ind + l:switch_offset)
+        elseif &cino =~ '='
+          let l:case_offset = s:ParseCino('=')
         endif
       endif
     endif
-    if idx < 0 && pline[-1:] !~ '[{;]'
-      let isOp = (l:line =~# s:opfirst || s:continues(l:lnum,pline)) * s:W
-      let bL = s:iscontOne(l:lnum,b:js_cache[1],isOp)
-      let bL -= (bL && l:line[0] == '{') * s:W
+    if idx == -1 && pline[-1:] !~ '[{;]'
+      let sol = matchstr(l:line,s:opfirst)
+      if sol is '' || sol == '/' && s:SynAt(v:lnum,
+            \ 1 + len(getline(v:lnum)) - len(l:line)) =~? 'regex'
+        if s:Continues(l:lnum,pline)
+          let is_op = s:sw()
+        endif
+      elseif num && sol =~# '^\%(in\%(stanceof\)\=\|\*\)$'
+        call call('cursor',b:js_cache[1:])
+        if s:PreviousToken() =~ '\k' && s:Class()
+          return num_ind + s:sw()
+        endif
+        let is_op = s:sw()
+      else
+        let is_op = s:sw()
+      endif
+      call cursor(l:lnum, len(pline))
+      let b_l = s:Nat(s:IsContOne(b:js_cache[1],is_op) - (!is_op && l:line =~ '^{')) * s:sw()
     endif
-  elseif idx < 0 && getline(b:js_cache[1])[b:js_cache[2]-1] == '(' && &cino =~ '('
-    let pval = s:parse_cino('(')
-    return !pval ? (s:parse_cino('w') ? 0 : -(!!search('\m\S','W'.s:z,num))) + virtcol('.') :
-          \ max([indent('.') + pval + (s:GetPair('(',')','nbrmW',s:skip_expr,100,num) * s:W),0])
+  elseif idx.s:LookingAt().&cino =~ '^-1(.*(' && (search('\m\S','nbW',num) || s:ParseCino('U'))
+    let pval = s:ParseCino('(')
+    if !pval
+      let [Wval, vcol] = [s:ParseCino('W'), virtcol('.')]
+      if search('\m\S','W',num)
+        return s:ParseCino('w') ? vcol : virtcol('.')-1
+      endif
+      return Wval ? s:Nat(num_ind + Wval) : vcol
+    endif
+    return s:Nat(num_ind + pval + searchpair('\m(','','\m)','nbrmW',s:skip_expr,num) * s:sw())
   endif
 
   " main return
-  if l:line =~ '^\%([])}]\||}\)'
-    return max([indent(num),0])
+  if l:line =~ '^[])}]\|^|}'
+    if l:line_raw[0] == ')' && getline(num)[b:js_cache[2]-1] == '('
+      if s:ParseCino('M')
+        return indent(l:lnum)
+      elseif &cino =~# 'm' && !s:ParseCino('m')
+        return virtcol('.') - 1
+      endif
+    endif
+    return num_ind
   elseif num
-    return indent(num) + s:W + switch_offset + bL + isOp
+    return s:Nat(num_ind + get(l:,'case_offset',s:sw()) + l:switch_offset + b_l + is_op)
   endif
-  return bL + isOp
+  return b_l + is_op
 endfunction
 
 let &cpo = s:cpo_save
diff --git a/runtime/indent/perl.vim b/runtime/indent/perl.vim
index cf256ea..094d1d3 100644
--- a/runtime/indent/perl.vim
+++ b/runtime/indent/perl.vim
@@ -3,7 +3,7 @@
 " Maintainer:    vim-perl <vim-perl@googlegroups.com>
 " Homepage:      http://github.com/vim-perl/vim-perl
 " Bugs/requests: http://github.com/vim-perl/vim-perl/issues
-" Last Change:   2017 Jun 13
+" Last Change:   2017-01-04
 
 " Suggestions and improvements by :
 "   Aaron J. Sherman (use syntax for hints)
@@ -48,11 +48,6 @@
         return 0
     endif
 
-    " Don't reindent comments on first column
-    if cline =~ '^#.'
-        return 0
-    endif
-
     " Get current syntax item at the line's first char
     let csynid = ''
     if b:indent_use_syntax
@@ -134,6 +129,7 @@
                         \ || synid == "perlMatchStartEnd"
                         \ || synid == "perlHereDoc"
                         \ || synid == "perlBraces"
+                        \ || synid == "perlStatementIndirObj"
                         \ || synid =~ "^perlFiledescStatement"
                         \ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
                 let brace = strpart(line, bracepos, 1)
@@ -151,6 +147,7 @@
             if synid == ""
                         \ || synid == "perlMatchStartEnd"
                         \ || synid == "perlBraces"
+                        \ || synid == "perlStatementIndirObj"
                         \ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
                 let ind = ind - shiftwidth()
             endif
