1. Meikel Brandmeyer
  2. vimclojure


Meikel Brandmeyer  committed df452fd

Add FuzyyIndent option

  • Participants
  • Parent commits 3d130ca
  • Branches default

Comments (0)

Files changed (3)

File vim/autoload/vimclojure.vim

View file
  • Ignore whitespace
 " Configuration
+if !exists("g:vimclojure#FuzzyIndent")
+	let vimclojure#FuzzyIndent = 0
 if !exists("g:vimclojure#HighlightBuiltins")
 	if exists("g:clj_highlight_builtins")
 		call vimclojure#WarnDeprecated("g:clj_highlight_builtins",

File vim/doc/clojure.txt

View file
  • Ignore whitespace
 control using standard highlighting groups. The actual highlighting used
 depends on the dark/bright setting (see |'bg'|).
+Indenting                           *ft-clj-indent*
+VimClojure provides the (hopefully) correct indentation rules for
+the standard forms and macros. However user code might define also
+forms for which the indentation should follow the indentation according
+to the 'lispwords' option. The names of these forms often follow a
+pattern like "defsomething" or "with-something".
+By setting the fuzzy indent option, you can tell VimClojure, that you
+want names beginning in "def" or "with" to be indented as if they
+were included in the 'lispwords' option.
+        let vimclojure#FuzzyIndent = 1
+This option is disabled by default.
 Preview Window

File vim/indent/clojure.vim

View file
  • Ignore whitespace
 		return paren[1] + &shiftwidth - 1
+	if g:vimclojure#FuzzyIndent && w =~ '^\(def\|with\)'
+		return paren[1] + &shiftwidth - 1
+	endif
 	normal! w
 	if paren[0] < line(".")
 		return paren[1] + &shiftwidth - 1