- Notifications
You must be signed in to change notification settings - Fork2
clojure-vim/async-clj-highlight
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
_ .-. _ .-. _ .-. .-. _ .-. .-. :_; : : :_; : : :_; : : : : :_; : : .' `..-..-.-,-.,-.,-. . .--.: : .--..-.-..-.--. .--. . : `-..-..--.: `-.: : .-..--.: `-`. .': `; : : ,. ,. :`,`' ..: :_' .; : : :; : ..' '_.:`,`: .. : ' .; : .. : :_: ' .; : .. : :`.__.:_:_;:_;:_; `.__.`.__`.__.: `.__.:_; `.__.' :_;:_:_`._. :_;:_`.__:_`._. :_;:_:_; .-. : .-. : .-. : `._.' `._.' `._.'Extend builtin syntax highlighting to local, referred, and aliased vars inClojure buffers.
Exclusions from clojure.core (via(:refer-clojure)) are also reflected.
This is essentially a re-implementation of the dynamic highlighting featurefrom Meikel Brandmeyer's VimClojure project.
While Vim ships withvim-clojure-static, this plugin uses a feature from averyrecent version.
If you'd likevim-clojure-highlight ported to another REPL plugin, pleasecreate an issue! This can be done quite easily.
Install as a normal Vim plugin. If you are unfamiliar with this process,please refer toPathogen.
vim-clojure-highlight installs an autocommand that detects and highlightslocal vars, ns-refers, and aliased references every time a*.clj fileis (re)loaded. The syntax highlighting reflects the state of the REPL, sounevaluated references remain unmatched.
This will fail silently if no fireplace nREPL sessions exist.
Reload your buffer with:e after an eval to update syntax matches.Alternately, use the:ClojureHighlightReferences command in a customautocommand or mapping to do the same.
If you would like to eager-load a fireplace session so thatvim-clojure-highlight works on the first load of a clojure file, install anautocommand hook that calls:Require:
" Evaluate Clojure buffers on loadautocmdBufRead*.cljtry |silent! Require |catch/^Fireplace/ |endtry
Since vim-clojure-highlight dynamically alters the syntax state of a buffer,it's possible that other syntax extensions will be affected by this plugin.
A simple workaround is to activate Clojure syntax extensions in an autocmd:
autocmdSyntaxclojure EnableSyntaxExtension
For example, this is how you might enablerainbow_parentheses.vimfor Clojure buffers:
autocmdVimEnter* RainbowParenthesesToggleautocmdSyntaxclojure RainbowParenthesesLoadRoundautocmdSyntaxclojure RainbowParenthesesLoadSquareautocmdSyntaxclojure RainbowParenthesesLoadBraces
Seedoc/vim-clojure-highlight.txt for more commands and options.
About
Extend builtin syntax highlighting to referred and aliased vars in Clojure buffers
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Languages
- Clojure63.2%
- Lua28.5%
- Vim Script8.3%
