Add b:clojure_syntax_without_core_keywords · guns/vim-clojure-static@82e2156 (original) (raw)
3 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -116,8 +116,12 @@ to have a certain set of symbols highlighted in a certain way, while the | ||
116 | 116 | buffer-local version is intended for plugin authors who wish to highlight |
117 | 117 | symbols dynamically. |
118 | 118 | |
119 | +If the buffer flag `b:clojure_syntax_without_core_keywords` is set, vars from | |
120 | +`clojure.core` are not highlighted by default. This is useful for highlighting | |
121 | +namespaces that have set `(:refer-clojure :only [])`. | |
122 | + | |
119 | 123 | [`vim-clojure-highlight`](https://github.com/guns/vim-clojure-highlight) uses |
120 | -this feature to highlight extra vars when connected to a REPL. | |
124 | +these variables to highlight extra vars when connected to a REPL. | |
121 | 125 | |
122 | 126 | Indent Options |
123 | 127 | ============== |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -138,6 +138,9 @@ identifiers: | ||
138 | 138 | < |
139 | 139 | Refer to the Clojure syntax script for valid syntax group names. |
140 | 140 | |
141 | +If the |buffer-variable | |
142 | +language constants and special forms are matched. | |
143 | + | |
141 | 144 | Setting *g:clojure_fold* enables folding Clojure code via the syntax engine. |
142 | 145 | Any list, vector, or map that extends over more than one line can be folded |
143 | 146 | using the standard Vim |fold-commands |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -41,7 +41,14 @@ function! s:syntax_keyword(dict) | ||
41 | 41 | endfor |
42 | 42 | endfunction |
43 | 43 | |
44 | -call s:syntax_keyword(s:clojure_syntax_keywords) | |
44 | +if exists('b:clojure_syntax_without_core_keywords') && b:clojure_syntax_without_core_keywords | |
45 | + " Only match language specials and primitives | |
46 | +for s:key in ['clojureBoolean', 'clojureConstant', 'clojureException', 'clojureSpecial'] | |
47 | +execute 'syntax keyword' s:key join(s:clojure_syntax_keywords[s:key], ' ') | |
48 | +endfor | |
49 | +else | |
50 | +call s:syntax_keyword(s:clojure_syntax_keywords) | |
51 | +endif | |
45 | 52 | |
46 | 53 | if exists('g:clojure_syntax_keywords') |
47 | 54 | call s:syntax_keyword(g:clojure_syntax_keywords) |
@@ -51,6 +58,7 @@ if exists('b:clojure_syntax_keywords') | ||
51 | 58 | call s:syntax_keyword(b:clojure_syntax_keywords) |
52 | 59 | endif |
53 | 60 | |
61 | +unlet! s:key | |
54 | 62 | delfunction s:syntax_keyword |
55 | 63 | |
56 | 64 | " Keywords are symbols: |