summaryrefslogtreecommitdiffstats
path: root/ftplugin/clojure.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ftplugin/clojure.vim')
-rw-r--r--ftplugin/clojure.vim17
1 files changed, 16 insertions, 1 deletions
diff --git a/ftplugin/clojure.vim b/ftplugin/clojure.vim
index b46b9c80..2741a3a1 100644
--- a/ftplugin/clojure.vim
+++ b/ftplugin/clojure.vim
@@ -15,7 +15,7 @@ let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
-let b:undo_ftplugin = 'setlocal iskeyword< define< formatoptions< comments< commentstring<'
+let b:undo_ftplugin = 'setlocal iskeyword< define< formatoptions< comments< commentstring< lispwords<'
setlocal iskeyword+=?,-,*,!,+,/,=,<,>,.,:,$
@@ -30,6 +30,21 @@ setlocal formatoptions-=t
setlocal comments=n:;
setlocal commentstring=;\ %s
+" 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.
+"
+" Generated from https://github.com/guns/vim-clojure-static/blob/%%RELEASE_TAG%%/clj/src/vim_clojure_static/generate.clj
+setlocal lispwords=as->,binding,bound-fn,case,catch,cond->,cond->>,condp,def,definline,definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecord,defstruct,deftest,deftest-,deftype,doall,dorun,doseq,dotimes,doto,extend,extend-protocol,extend-type,fn,for,if,if-let,if-not,let,letfn,locking,loop,ns,proxy,reify,set-test,testing,when,when-first,when-let,when-not,while,with-bindings,with-in-str,with-local-vars,with-open,with-precision,with-redefs,with-redefs-fn,with-test
+
" Provide insert mode completions for special forms and clojure.core. As
" 'omnifunc' is set by popular Clojure REPL client plugins, we also set
" 'completefunc' so that the user has some form of completion available when