-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recolouring parentheses #4
Comments
This appears to be an issue more with vim-clojure-static which is actually doing the highlighting work. Not sure what, if anything, should be changed with that plugin. However vim-niji doesn't modify the highlighting of anything except parentheses and braces, so you should be able to call niji#highlight() after :ClojureHighlightReferences each time and get both forms of highlighting. |
I have the same problem as FrigoEU, only I am using rainbow_parentheses.vim. When I call :ClojureHighlightReferences, the things that vim-clojure-highlight are supposed to work on seem to go through correctly, but parentheses all receive the same colour. And, unfortunately, I cannot fix it with a subsequent call to :RainbowParenthesesToggleAll (or similar commands). They remain un-rainbowy :) I've taken a screenshot, which you can see here, to illustrate the difference. On the right side, I've called :ClojureHighlightReferences . Should I report this at the vim-clojure-static repo? |
Hello all, Thanks for the heads up on this issue, @Reefersleep, I admit I forgot this One solution is to setup the rainbow parens plugin in the Syntax hook: autocmd VimEnter * RainbowParenthesesToggle
autocmd Syntax clojure RainbowParenthesesLoadRound
autocmd Syntax clojure RainbowParenthesesLoadSquare
autocmd Syntax clojure RainbowParenthesesLoadBraces This is actually the setup recommended by I've updated the README with this advice, along with another tip for " Evaluate Clojure buffers on load
autocmd BufRead *.clj try | silent! Require | catch /^Fireplace/ | endtry Hope that clears everything up! |
Hello guns Cheers for the reply! Adding those 4 + 1 lines to my ~/.vimrc seems to get me most of the way there; when I load up a .clj with a repl running in the project root, I get the syntax highlighting, but not the parens - but now, I am able to load it with :RainbowParenthesesToggle, once I'm inside vim. Is there maybe a way that I can sneak that call into the Require autocmd? I figure that the other lines are called before that one and that is why my parens are dull upon entry. (I've tried reordering them, no difference - I guess it depends on when the specific hooks are executed) |
Also, two side effects - opening the .clj file gets somewhat slow, but I guess there's no way around that, as this is the process of highlighting occupying the thread. And, if I open a .cljs file (which I haven't managed to hook up to repls yet), or a .clj file without a lein repl, my parens are dull. Do you know a simple way out of this, perhaps by slightly modifying the vimscript above? I should really learn how to read/write it myself :/ |
Wait, wait, wait, my mistake - of course I had already defined some activation of rainbow parens in my ~/.vimrc, so by adding those extra lines, I was deactivating my previous activation! So, in conclusion, I now have the following in my /.vimrc :
And, with a lein repl running in the same project root, I get both syntax highlighting and rainbow parens upon entry, and rainbow parens work for both cljs and clj files without a repl. Huzzah! |
@Reefersleep wrote:
More specifically, it's the If that's the pause you are experiencing, I'd recommend either deleting autocmd BufRead *.clj try | silent! Require | catch /^Fireplace/ | endtry or deleting classpath.vim to prevent the one-time REPL spin up on load. Happy to hear that fixes your problems. I know you have probably moved on with your life, but if you are still autocmd Syntax clojure call niji#highlight() |
Well, my terminal is not that fast to begin with. I think I've probably fudged things up by adding stupid stuff to my .vimrc and/or by configuring other terminal-related stuff stupidly. Also, disk harddrive. Upgrading to SSD soon. In any case, I don't have classpath.vim installed, the syntax highlighting only works with a project root repl. Without it, vim loads in about less than half a second, with it, it's ~1,5 seconds. I think the culprit is just the Require/highlight, because when I do cpr with vim-fireplace, it's not exactly fast either. I'm hoping the SSD will make the need to optimize my terminal configurations redundant ^^ Very happy with the result here, thanks a lot, guns! 👍 |
For those who stumble across this and want to use luochen1990/rainbow, I was able to make it work with vim-clojure-highlight without having to add any So now that section of my
|
Hey,
Really like the addon, just one thing ticks me off. When I run :ClojureHighlightReferences, all my parentheses, which all have different colors thanks to vim-niji, become the same color. Any idea how to prevent this?
The text was updated successfully, but these errors were encountered: