Permalink
Browse files

Add FuzyyIndent option

  • Loading branch information...
1 parent d8d48ad commit f9b3bad5afdf640197facf67fc8343867ebad1b2 @kotarak committed Mar 15, 2011
Showing with 25 additions and 0 deletions.
  1. +4 −0 vim/autoload/vimclojure.vim
  2. +17 −0 vim/doc/clojure.txt
  3. +4 −0 vim/indent/clojure.vim
@@ -13,6 +13,10 @@ function! vimclojure#WarnDeprecated(old, new)
endfunction
" Configuration
+if !exists("g:vimclojure#FuzzyIndent")
+ let vimclojure#FuzzyIndent = 0
+endif
+
if !exists("g:vimclojure#HighlightBuiltins")
if exists("g:clj_highlight_builtins")
call vimclojure#WarnDeprecated("g:clj_highlight_builtins",
View
@@ -98,6 +98,23 @@ highlighting using ctermfg and guifg, thereby bypassing the usual colorscheme
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
--------------
View
@@ -163,6 +163,10 @@ function! GetClojureIndent()
return paren[1] + &shiftwidth - 1
endif
+ if g:vimclojure#FuzzyIndent && w =~ '^\(def\|with\)'
+ return paren[1] + &shiftwidth - 1
+ endif
+
normal! w
if paren[0] < line(".")
return paren[1] + &shiftwidth - 1

0 comments on commit f9b3bad

Please sign in to comment.