Skip to content

Commit 38d71bc

Browse files
committed
Add g:clojure_special_indent_words
Feature requested by oskarkv <https://github.com/oskarkv>
1 parent 7872993 commit 38d71bc

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

indent/clojure.vim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ if exists("*searchpairpos")
3939
let g:clojure_fuzzy_indent_patterns = "with.*,def.*,let.*"
4040
endif
4141

42+
if !exists('g:clojure_special_indent_words')
43+
let g:clojure_special_indent_words = 'deftype,defrecord,reify,proxy,extend-type,extend-protocol,letfn'
44+
endif
45+
4246
if !exists("g:clojure_align_multiline_strings")
4347
let g:clojure_align_multiline_strings = 0
4448
endif
@@ -155,8 +159,7 @@ if exists("*searchpairpos")
155159
call cursor(nextParen)
156160

157161
call search('\S', 'W')
158-
let keyword = s:CurrentWord()
159-
if index(['deftype', 'defrecord', 'reify', 'proxy', 'extend-type', 'extend-protocol', 'letfn'], keyword) >= 0
162+
if g:clojure_special_indent_words =~ '\<' . s:CurrentWord() . '\>'
160163
return 1
161164
endif
162165

@@ -258,7 +261,7 @@ if exists("*searchpairpos")
258261
return paren[1]
259262
endif
260263

261-
" Noe we want to test words with any leading non-word chars stripped;
264+
" Test words with any leading non-word chars stripped;
262265
" e.g. #'defn should indent like defn.
263266
let ww = substitute(w, '\v\W*(\w.*)', '\1', '')
264267

0 commit comments

Comments
 (0)