diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-03-22 21:02:50 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-03-22 21:02:50 +0100 |
commit | a68783751647e3243ca6f22df62907efbdbccb02 (patch) | |
tree | 372908fd79defec22190b6d2a48bbc6155bb22e7 /runtime/indent | |
parent | ed287f9a4e3f4ed5528ad2af65b7b23bce14a688 (diff) |
Updated runtime files.
Diffstat (limited to 'runtime/indent')
-rw-r--r-- | runtime/indent/clojure.vim | 83 | ||||
-rw-r--r-- | runtime/indent/j.vim | 15 |
2 files changed, 10 insertions, 88 deletions
diff --git a/runtime/indent/clojure.vim b/runtime/indent/clojure.vim index df88cea942..64f1333643 100644 --- a/runtime/indent/clojure.vim +++ b/runtime/indent/clojure.vim @@ -6,7 +6,7 @@ " Maintainer: Sung Pae <self@sungpae.com> " URL: https://github.com/guns/vim-clojure-static " License: Same as Vim -" Last Change: 16 December 2013 +" Last Change: 16 February 2014 " TODO: Indenting after multibyte characters is broken: " (let [Δ (if foo @@ -21,7 +21,7 @@ let b:did_indent = 1 let s:save_cpo = &cpo set cpo&vim -let b:undo_indent = 'setlocal autoindent< smartindent< lispwords< expandtab< softtabstop< shiftwidth< indentexpr< indentkeys<' +let b:undo_indent = 'setlocal autoindent< smartindent< expandtab< softtabstop< shiftwidth< indentexpr< indentkeys<' setlocal noautoindent nosmartindent setlocal softtabstop=2 shiftwidth=2 expandtab @@ -307,85 +307,6 @@ else endif -" Specially indented symbols from clojure.core and clojure.test. -" -" Clojure symbols are indented in the defn style when they: -" -" * Define vars and anonymous functions -" * Create new lexical scopes or scopes with altered environments -" * Create conditional branches from a predicate function or value -" -" The arglists for these functions are generally in the form of [x & body]; -" Functions that accept a flat list of forms do not treat the first argument -" specially and hence are not indented specially. - -" Definitions -setlocal lispwords= -setlocal lispwords+=bound-fn -setlocal lispwords+=def -setlocal lispwords+=definline -setlocal lispwords+=definterface -setlocal lispwords+=defmacro -setlocal lispwords+=defmethod -setlocal lispwords+=defmulti -setlocal lispwords+=defn -setlocal lispwords+=defn- -setlocal lispwords+=defonce -setlocal lispwords+=defprotocol -setlocal lispwords+=defrecord -setlocal lispwords+=defstruct -setlocal lispwords+=deftest " clojure.test -setlocal lispwords+=deftest- " clojure.test -setlocal lispwords+=deftype -setlocal lispwords+=extend -setlocal lispwords+=extend-protocol -setlocal lispwords+=extend-type -setlocal lispwords+=fn -setlocal lispwords+=ns -setlocal lispwords+=proxy -setlocal lispwords+=reify -setlocal lispwords+=set-test " clojure.test - -" Binding forms -setlocal lispwords+=as-> -setlocal lispwords+=binding -setlocal lispwords+=doall -setlocal lispwords+=dorun -setlocal lispwords+=doseq -setlocal lispwords+=dotimes -setlocal lispwords+=doto -setlocal lispwords+=for -setlocal lispwords+=if-let -setlocal lispwords+=let -setlocal lispwords+=letfn -setlocal lispwords+=locking -setlocal lispwords+=loop -setlocal lispwords+=testing " clojure.test -setlocal lispwords+=when-first -setlocal lispwords+=when-let -setlocal lispwords+=with-bindings -setlocal lispwords+=with-in-str -setlocal lispwords+=with-local-vars -setlocal lispwords+=with-open -setlocal lispwords+=with-precision -setlocal lispwords+=with-redefs -setlocal lispwords+=with-redefs-fn -setlocal lispwords+=with-test " clojure.test - -" Conditional branching -setlocal lispwords+=case -setlocal lispwords+=cond-> -setlocal lispwords+=cond->> -setlocal lispwords+=condp -setlocal lispwords+=if -setlocal lispwords+=if-not -setlocal lispwords+=when -setlocal lispwords+=when-not -setlocal lispwords+=while - -" Exception handling -setlocal lispwords+=catch - let &cpo = s:save_cpo unlet! s:save_cpo diff --git a/runtime/indent/j.vim b/runtime/indent/j.vim index 056c20a4e4..ae443bae2a 100644 --- a/runtime/indent/j.vim +++ b/runtime/indent/j.vim @@ -1,9 +1,10 @@ " Vim indent file " Language: J " Maintainer: David Bürgin <676c7473@gmail.com> -" Last Change: 2013-09-21 +" URL: https://github.com/glts/vim-j +" Last Change: 2014-03-17 -if exists("b:did_indent") +if exists('b:did_indent') finish endif let b:did_indent = 1 @@ -12,9 +13,9 @@ setlocal indentexpr=GetJIndent() setlocal indentkeys-=0{,0},\:,0# setlocal indentkeys+=0),=case.,=catch.,=catchd.,=catcht.,=do.,=else.,=elseif.,=end.,=fcase. -let b:undo_indent = "setl indk< inde<" +let b:undo_indent = 'setlocal indentkeys< indentexpr<' -if exists("*GetJIndent") +if exists('*GetJIndent') finish endif @@ -27,11 +28,11 @@ function GetJIndent() let indent = indent(prevlnum) if getline(prevlnum) =~# '^\s*\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|fcase\|for\%(_\a\k*\)\=\|if\|select\|try\|whil\%(e\|st\)\)\.' if getline(prevlnum) !~# '\<end\.' - let indent += &shiftwidth + let indent += shiftwidth() endif endif - if getline(v:lnum) =~# '^\s*\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|end\|fcase\)\.' - let indent -= &shiftwidth + if getline(v:lnum) =~# '^\s*\%(\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|end\|fcase\)\.\)\|)' + let indent -= shiftwidth() endif return indent endfunction |