Skip to content

Commit

Permalink
In README, mention the replacements for each old indent config option
Browse files Browse the repository at this point in the history
  • Loading branch information
axvr committed Oct 5, 2024
1 parent 9800368 commit 69a0b6f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ offers ways to adjust the indentation.
> The indentation code has recently been rebuilt which included the
> removal/replacement of the following configuration options:
>
> - `clojure_maxlines`
> - `clojure_align_subforms`
> - `clojure_align_multiline_strings`
> - `clojure_fuzzy_indent`
> - `clojure_fuzzy_indent_blacklist`
> - `clojure_special_indent_words`
> - `clojure_cljfmt_compat`
> - `'lispwords'`
> | Config option | Replacement (if any) |
> |-----------------------------------|------------------------------------|
> | `clojure_maxlines` | |
> | `clojure_cljfmt_compat` | `clojure_indent_style` |
> | `clojure_align_subforms` | `clojure_indent_style` |
> | `clojure_align_multiline_strings` | `clojure_indent_multiline_strings` |
> | `clojure_fuzzy_indent` | |
> | `clojure_fuzzy_indent_blacklist` | |
> | `clojure_special_indent_words` | `clojure_indent_rules` |
> | `'lispwords'` | `clojure_indent_rules` |

### Indentation style
Expand Down
12 changes: 4 additions & 8 deletions indent/clojure.vim
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,13 @@ call s:SConf('clojure_fuzzy_indent_patterns', [
" - 1+: 2 space indentation, no alignment.
" Defaults copied from: https://github.com/clojure-emacs/clojure-mode/blob/0e62583b5198f71856e4d7b80e1099789d47f2ed/clojure-mode.el#L1800-L1875
call s:SConf('clojure_indent_rules', {
\ 'ns': 1,
\ 'fn': 1, 'def': 1, 'defn': 1, 'bound-fn': 1,
\ 'let': 1, 'binding': 1, 'defmethod': 1,
\ 'fn': 1, 'def': 1, 'defn': 1, 'bound-fn': 1, 'let': 1, 'binding': 1, 'defmethod': 1,
\ 'if': 1, 'if-not': 1, 'if-some': 1, 'if-let': 1,
\ 'when': 1, 'when-not': 1, 'when-some': 1, 'when-let': 1, 'when-first': 1,
\ 'case': 1, 'cond': 0, 'cond->': 1, 'cond->>': 1, 'condp': 2,
\ 'while': 1, 'loop': 1, 'for': 1, 'doseq': 1, 'dotimes': 1,
\ 'do': 0, 'doto': 1, 'comment': 0, 'as->': 2,
\ 'delay': 0, 'future': 0, 'locking': 1,
\ 'try': 0, 'catch': 2, 'finally': 0,
\ 'ns': 1, 'do': 0, 'doto': 1, 'comment': 0, 'as->': 2,
\ 'delay': 0, 'future': 0, 'locking': 1, 'try': 0, 'catch': 2, 'finally': 0,
\ 'reify': 1, 'proxy': 2, 'defrecord': 2, 'defprotocol': 1, 'definterface': 1,
\ 'extend': 1, 'extend-protocol': 1, 'extend-type': 1,
"\ (letfn) (1 ((:defn)) nil)
Expand Down Expand Up @@ -265,8 +262,7 @@ function! s:ListIndent(delim_pos)

" TODO: handle complex indentation (e.g. letfn) and introduce
" indentation config similar to Emacs' clojure-mode and cljfmt.
" This new config option `clojure_indent_rules` should replace most
" other indentation options. Skip if "traditional" style was chosen.
" Skip if "traditional" style was chosen.

" TODO: simplify this.
let syms = split(ln_content, '[[:space:],;()\[\]{}@\\"^~`]', 1)
Expand Down

0 comments on commit 69a0b6f

Please sign in to comment.