@@ -39,13 +39,47 @@ please refer to [Pathogen](https://github.com/tpope/vim-pathogen).
39
39
# Usage
40
40
41
41
` vim-clojure-highlight ` installs an autocommand that detects and highlights
42
- local vars, ns-refers, and aliased references every time a ` *.clj ` file is
43
- (re)loaded.
42
+ local vars, ns-refers, and aliased references every time a ` *.clj ` file
43
+ is (re)loaded. The syntax highlighting reflects the state of the REPL, so
44
+ unevaluated references remain unmatched.
44
45
45
- This will fail silently if fireplace is unable to connect to an nREPL server .
46
+ This will fail silently if no fireplace nREPL sessions exist .
46
47
47
- Reload your buffer with ` :e ` to update syntax matches. Alternately, use the
48
- ` :ClojureHighlightReferences ` command in a custom autocommand or mapping to do
49
- the same.
48
+ Reload your buffer with ` :e ` after an eval to update syntax matches.
49
+ Alternately, use the ` :ClojureHighlightReferences ` command in a custom
50
+ autocommand or mapping to do the same.
50
51
51
- See the ` doc/vim-clojure-highlight.txt ` for more commands and options.
52
+ # Eager loading
53
+
54
+ If you would like to eager-load a fireplace session so that
55
+ vim-clojure-highlight works on the first load of a clojure file, install an
56
+ autocommand hook that calls ` :Require ` :
57
+
58
+ ``` vim
59
+ " Evaluate Clojure buffers on load
60
+ autocmd BufRead *.clj try | silent! Require | catch /^Fireplace/ | endtry
61
+ ```
62
+
63
+ # Rainbow parentheses and other syntax extensions
64
+
65
+ Since vim-clojure-highlight dynamically alters the syntax state of a buffer,
66
+ it's possible that other syntax extensions will be affected by this plugin.
67
+
68
+ A simple workaround is to activate Clojure syntax extensions in an autocmd:
69
+
70
+ ``` vim
71
+ autocmd Syntax clojure EnableSyntaxExtension
72
+ ```
73
+
74
+ For example, this is how you might enable
75
+ [ ` rainbow_parentheses.vim ` ] ( https://github.com/kien/rainbow_parentheses.vim )
76
+ for Clojure buffers:
77
+
78
+ ``` vim
79
+ autocmd VimEnter * RainbowParenthesesToggle
80
+ autocmd Syntax clojure RainbowParenthesesLoadRound
81
+ autocmd Syntax clojure RainbowParenthesesLoadSquare
82
+ autocmd Syntax clojure RainbowParenthesesLoadBraces
83
+ ```
84
+
85
+ See ` doc/vim-clojure-highlight.txt ` for more commands and options.
0 commit comments