Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 1 | " Vim indent file |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 2 | " Language: Clojure |
| 3 | " Author: Meikel Brandmeyer <mb@kotka.de> |
| 4 | " URL: http://kotka.de/projects/clojure/vimclojure.html |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 5 | " |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 6 | " Maintainer: Sung Pae <self@sungpae.com> |
| 7 | " URL: https://github.com/guns/vim-clojure-static |
| 8 | " License: Same as Vim |
| 9 | " Last Change: 08 September 2013 |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 10 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 11 | " TODO: Indenting after multibyte characters is broken: |
| 12 | " (let [Δ (if foo |
| 13 | " bar ; Indent error |
| 14 | " baz)]) |
| 15 | |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 16 | if exists("b:did_indent") |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 17 | finish |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 18 | endif |
| 19 | let b:did_indent = 1 |
| 20 | |
| 21 | let s:save_cpo = &cpo |
| 22 | set cpo&vim |
| 23 | |
| 24 | let b:undo_indent = 'setlocal autoindent< smartindent< lispwords< expandtab< softtabstop< shiftwidth< indentexpr< indentkeys<' |
| 25 | |
| 26 | setlocal noautoindent nosmartindent |
| 27 | setlocal softtabstop=2 shiftwidth=2 expandtab |
| 28 | setlocal indentkeys=!,o,O |
| 29 | |
| 30 | if exists("*searchpairpos") |
| 31 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 32 | if !exists('g:clojure_maxlines') |
| 33 | let g:clojure_maxlines = 100 |
| 34 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 35 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 36 | if !exists('g:clojure_fuzzy_indent') |
| 37 | let g:clojure_fuzzy_indent = 1 |
| 38 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 39 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 40 | if !exists('g:clojure_fuzzy_indent_patterns') |
| 41 | let g:clojure_fuzzy_indent_patterns = ['^with', '^def', '^let'] |
| 42 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 43 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 44 | if !exists('g:clojure_fuzzy_indent_blacklist') |
| 45 | let g:clojure_fuzzy_indent_blacklist = ['-fn$', '\v^with-%(meta|out-str|loading-context)$'] |
| 46 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 47 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 48 | if !exists('g:clojure_special_indent_words') |
| 49 | let g:clojure_special_indent_words = 'deftype,defrecord,reify,proxy,extend-type,extend-protocol,letfn' |
| 50 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 51 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 52 | if !exists('g:clojure_align_multiline_strings') |
| 53 | let g:clojure_align_multiline_strings = 0 |
| 54 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 55 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 56 | function! s:SynIdName() |
| 57 | return synIDattr(synID(line("."), col("."), 0), "name") |
| 58 | endfunction |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 59 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 60 | function! s:CurrentChar() |
| 61 | return getline('.')[col('.')-1] |
| 62 | endfunction |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 63 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 64 | function! s:CurrentWord() |
| 65 | return getline('.')[col('.')-1 : searchpos('\v>', 'n', line('.'))[1]-2] |
| 66 | endfunction |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 67 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 68 | function! s:IsParen() |
| 69 | return s:CurrentChar() =~ '\v[\(\)\[\]\{\}]' && |
| 70 | \ s:SynIdName() !~? '\vstring|regex|comment|character' |
| 71 | endfunction |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 72 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 73 | " Returns 1 if string matches a pattern in 'patterns', which may be a |
| 74 | " list of patterns, or a comma-delimited string of implicitly anchored |
| 75 | " patterns. |
| 76 | function! s:MatchesOne(patterns, string) |
| 77 | let list = type(a:patterns) == type([]) |
| 78 | \ ? a:patterns |
| 79 | \ : map(split(a:patterns, ','), '"^" . v:val . "$"') |
| 80 | for pat in list |
| 81 | if a:string =~ pat | return 1 | endif |
| 82 | endfor |
| 83 | endfunction |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 84 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 85 | function! s:MatchPairs(open, close, stopat) |
| 86 | " Stop only on vector and map [ resp. {. Ignore the ones in strings and |
| 87 | " comments. |
| 88 | if a:stopat == 0 |
| 89 | let stopat = max([line(".") - g:clojure_maxlines, 0]) |
| 90 | else |
| 91 | let stopat = a:stopat |
| 92 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 93 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 94 | let pos = searchpairpos(a:open, '', a:close, 'bWn', "!s:IsParen()", stopat) |
| 95 | return [pos[0], virtcol(pos)] |
| 96 | endfunction |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 97 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 98 | function! s:ClojureCheckForStringWorker() |
| 99 | " Check whether there is the last character of the previous line is |
| 100 | " highlighted as a string. If so, we check whether it's a ". In this |
| 101 | " case we have to check also the previous character. The " might be the |
| 102 | " closing one. In case the we are still in the string, we search for the |
| 103 | " opening ". If this is not found we take the indent of the line. |
| 104 | let nb = prevnonblank(v:lnum - 1) |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 105 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 106 | if nb == 0 |
| 107 | return -1 |
| 108 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 109 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 110 | call cursor(nb, 0) |
| 111 | call cursor(0, col("$") - 1) |
| 112 | if s:SynIdName() !~? "string" |
| 113 | return -1 |
| 114 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 115 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 116 | " This will not work for a " in the first column... |
| 117 | if s:CurrentChar() == '"' |
| 118 | call cursor(0, col("$") - 2) |
| 119 | if s:SynIdName() !~? "string" |
| 120 | return -1 |
| 121 | endif |
| 122 | if s:CurrentChar() != '\\' |
| 123 | return -1 |
| 124 | endif |
| 125 | call cursor(0, col("$") - 1) |
| 126 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 127 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 128 | let p = searchpos('\(^\|[^\\]\)\zs"', 'bW') |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 129 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 130 | if p != [0, 0] |
| 131 | return p[1] - 1 |
| 132 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 133 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 134 | return indent(".") |
| 135 | endfunction |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 136 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 137 | function! s:CheckForString() |
| 138 | let pos = getpos('.') |
| 139 | try |
| 140 | let val = s:ClojureCheckForStringWorker() |
| 141 | finally |
| 142 | call setpos('.', pos) |
| 143 | endtry |
| 144 | return val |
| 145 | endfunction |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 146 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 147 | function! s:ClojureIsMethodSpecialCaseWorker(position) |
| 148 | " Find the next enclosing form. |
| 149 | call search('\S', 'Wb') |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 150 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 151 | " Special case: we are at a '(('. |
| 152 | if s:CurrentChar() == '(' |
| 153 | return 0 |
| 154 | endif |
| 155 | call cursor(a:position) |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 156 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 157 | let nextParen = s:MatchPairs('(', ')', 0) |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 158 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 159 | " Special case: we are now at toplevel. |
| 160 | if nextParen == [0, 0] |
| 161 | return 0 |
| 162 | endif |
| 163 | call cursor(nextParen) |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 164 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 165 | call search('\S', 'W') |
| 166 | if g:clojure_special_indent_words =~ '\<' . s:CurrentWord() . '\>' |
| 167 | return 1 |
| 168 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 169 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 170 | return 0 |
| 171 | endfunction |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 172 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 173 | function! s:IsMethodSpecialCase(position) |
| 174 | let pos = getpos('.') |
| 175 | try |
| 176 | let val = s:ClojureIsMethodSpecialCaseWorker(a:position) |
| 177 | finally |
| 178 | call setpos('.', pos) |
| 179 | endtry |
| 180 | return val |
| 181 | endfunction |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 182 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 183 | function! GetClojureIndent() |
| 184 | " Get rid of special case. |
| 185 | if line(".") == 1 |
| 186 | return 0 |
| 187 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 188 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 189 | " We have to apply some heuristics here to figure out, whether to use |
| 190 | " normal lisp indenting or not. |
| 191 | let i = s:CheckForString() |
| 192 | if i > -1 |
| 193 | return i + !!g:clojure_align_multiline_strings |
| 194 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 195 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 196 | call cursor(0, 1) |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 197 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 198 | " Find the next enclosing [ or {. We can limit the second search |
| 199 | " to the line, where the [ was found. If no [ was there this is |
| 200 | " zero and we search for an enclosing {. |
| 201 | let paren = s:MatchPairs('(', ')', 0) |
| 202 | let bracket = s:MatchPairs('\[', '\]', paren[0]) |
| 203 | let curly = s:MatchPairs('{', '}', bracket[0]) |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 204 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 205 | " In case the curly brace is on a line later then the [ or - in |
| 206 | " case they are on the same line - in a higher column, we take the |
| 207 | " curly indent. |
| 208 | if curly[0] > bracket[0] || curly[1] > bracket[1] |
| 209 | if curly[0] > paren[0] || curly[1] > paren[1] |
| 210 | return curly[1] |
| 211 | endif |
| 212 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 213 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 214 | " If the curly was not chosen, we take the bracket indent - if |
| 215 | " there was one. |
| 216 | if bracket[0] > paren[0] || bracket[1] > paren[1] |
| 217 | return bracket[1] |
| 218 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 219 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 220 | " There are neither { nor [ nor (, ie. we are at the toplevel. |
| 221 | if paren == [0, 0] |
| 222 | return 0 |
| 223 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 224 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 225 | " Now we have to reimplement lispindent. This is surprisingly easy, as |
| 226 | " soon as one has access to syntax items. |
| 227 | " |
| 228 | " - Check whether we are in a special position after a word in |
| 229 | " g:clojure_special_indent_words. These are special cases. |
| 230 | " - Get the next keyword after the (. |
| 231 | " - If its first character is also a (, we have another sexp and align |
| 232 | " one column to the right of the unmatched (. |
| 233 | " - In case it is in lispwords, we indent the next line to the column of |
| 234 | " the ( + sw. |
| 235 | " - If not, we check whether it is last word in the line. In that case |
| 236 | " we again use ( + sw for indent. |
| 237 | " - In any other case we use the column of the end of the word + 2. |
| 238 | call cursor(paren) |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 239 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 240 | if s:IsMethodSpecialCase(paren) |
| 241 | return paren[1] + &shiftwidth - 1 |
| 242 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 243 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 244 | " In case we are at the last character, we use the paren position. |
| 245 | if col("$") - 1 == paren[1] |
| 246 | return paren[1] |
| 247 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 248 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 249 | " In case after the paren is a whitespace, we search for the next word. |
| 250 | call cursor(0, col('.') + 1) |
| 251 | if s:CurrentChar() == ' ' |
| 252 | call search('\v\S', 'W') |
| 253 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 254 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 255 | " If we moved to another line, there is no word after the (. We |
| 256 | " use the ( position for indent. |
| 257 | if line(".") > paren[0] |
| 258 | return paren[1] |
| 259 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 260 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 261 | " We still have to check, whether the keyword starts with a (, [ or {. |
| 262 | " In that case we use the ( position for indent. |
| 263 | let w = s:CurrentWord() |
| 264 | if stridx('([{', w[0]) > -1 |
| 265 | return paren[1] |
| 266 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 267 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 268 | " Test words without namespace qualifiers and leading reader macro |
| 269 | " metacharacters. |
| 270 | " |
| 271 | " e.g. clojure.core/defn and #'defn should both indent like defn. |
| 272 | let ww = substitute(w, "\\v%(.*/|[#'`~@^,]*)(.*)", '\1', '') |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 273 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 274 | if &lispwords =~ '\V\<' . ww . '\>' |
| 275 | return paren[1] + &shiftwidth - 1 |
| 276 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 277 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 278 | if g:clojure_fuzzy_indent |
| 279 | \ && !s:MatchesOne(g:clojure_fuzzy_indent_blacklist, ww) |
| 280 | \ && s:MatchesOne(g:clojure_fuzzy_indent_patterns, ww) |
| 281 | return paren[1] + &shiftwidth - 1 |
| 282 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 283 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 284 | call search('\v\_s', 'cW') |
| 285 | call search('\v\S', 'W') |
| 286 | if paren[0] < line(".") |
| 287 | return paren[1] + &shiftwidth - 1 |
| 288 | endif |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 289 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 290 | call search('\v\S', 'bW') |
| 291 | return virtcol(".") + 1 |
| 292 | endfunction |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 293 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 294 | setlocal indentexpr=GetClojureIndent() |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 295 | |
| 296 | else |
| 297 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 298 | " In case we have searchpairpos not available we fall back to |
| 299 | " normal lisp indenting. |
| 300 | setlocal indentexpr= |
| 301 | setlocal lisp |
| 302 | let b:undo_indent .= '| setlocal lisp<' |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 303 | |
| 304 | endif |
| 305 | |
| 306 | " Specially indented symbols from clojure.core and clojure.test. |
| 307 | " |
| 308 | " Clojure symbols are indented in the defn style when they: |
| 309 | " |
| 310 | " * Define vars and anonymous functions |
| 311 | " * Create new lexical scopes or scopes with altered environments |
| 312 | " * Create conditional branches from a predicate function or value |
| 313 | " |
| 314 | " The arglists for these functions are generally in the form of [x & body]; |
| 315 | " Functions that accept a flat list of forms do not treat the first argument |
| 316 | " specially and hence are not indented specially. |
| 317 | |
| 318 | " Definitions |
| 319 | setlocal lispwords= |
| 320 | setlocal lispwords+=bound-fn |
| 321 | setlocal lispwords+=def |
| 322 | setlocal lispwords+=definline |
| 323 | setlocal lispwords+=definterface |
| 324 | setlocal lispwords+=defmacro |
| 325 | setlocal lispwords+=defmethod |
| 326 | setlocal lispwords+=defmulti |
| 327 | setlocal lispwords+=defn |
| 328 | setlocal lispwords+=defn- |
| 329 | setlocal lispwords+=defonce |
| 330 | setlocal lispwords+=defprotocol |
| 331 | setlocal lispwords+=defrecord |
| 332 | setlocal lispwords+=defstruct |
| 333 | setlocal lispwords+=deftest " clojure.test |
| 334 | setlocal lispwords+=deftest- " clojure.test |
| 335 | setlocal lispwords+=deftype |
| 336 | setlocal lispwords+=extend |
| 337 | setlocal lispwords+=extend-protocol |
| 338 | setlocal lispwords+=extend-type |
| 339 | setlocal lispwords+=fn |
| 340 | setlocal lispwords+=ns |
| 341 | setlocal lispwords+=proxy |
| 342 | setlocal lispwords+=reify |
| 343 | setlocal lispwords+=set-test " clojure.test |
| 344 | |
| 345 | " Binding forms |
| 346 | setlocal lispwords+=as-> |
| 347 | setlocal lispwords+=binding |
| 348 | setlocal lispwords+=doall |
| 349 | setlocal lispwords+=dorun |
| 350 | setlocal lispwords+=doseq |
| 351 | setlocal lispwords+=dotimes |
| 352 | setlocal lispwords+=doto |
| 353 | setlocal lispwords+=for |
| 354 | setlocal lispwords+=if-let |
| 355 | setlocal lispwords+=let |
| 356 | setlocal lispwords+=letfn |
| 357 | setlocal lispwords+=locking |
| 358 | setlocal lispwords+=loop |
| 359 | setlocal lispwords+=testing " clojure.test |
| 360 | setlocal lispwords+=when-first |
| 361 | setlocal lispwords+=when-let |
| 362 | setlocal lispwords+=with-bindings |
| 363 | setlocal lispwords+=with-in-str |
| 364 | setlocal lispwords+=with-local-vars |
| 365 | setlocal lispwords+=with-open |
| 366 | setlocal lispwords+=with-precision |
| 367 | setlocal lispwords+=with-redefs |
| 368 | setlocal lispwords+=with-redefs-fn |
| 369 | setlocal lispwords+=with-test " clojure.test |
| 370 | |
| 371 | " Conditional branching |
| 372 | setlocal lispwords+=case |
| 373 | setlocal lispwords+=cond-> |
| 374 | setlocal lispwords+=cond->> |
| 375 | setlocal lispwords+=condp |
| 376 | setlocal lispwords+=if |
| 377 | setlocal lispwords+=if-not |
| 378 | setlocal lispwords+=when |
| 379 | setlocal lispwords+=when-not |
| 380 | setlocal lispwords+=while |
| 381 | |
| 382 | " Exception handling |
| 383 | setlocal lispwords+=catch |
Bram Moolenaar | fa13eef | 2013-02-06 17:34:04 +0100 | [diff] [blame] | 384 | |
| 385 | let &cpo = s:save_cpo |
| 386 | unlet! s:save_cpo |
| 387 | |
Bram Moolenaar | baca7f7 | 2013-09-22 14:42:24 +0200 | [diff] [blame] | 388 | " vim:sts=8:sw=8:ts=8:noet |