Sunday, July 13, 2014

trying to autostart the rainbow_parentheses plugin in all new buffers

Hi, I'm starting to use rainbow_parentheses.vim in order to get colourful parentheses (very useful for nested code):
https://github.com/kien/rainbow_parentheses.vim
and I want it to be activated by default in all new buffers.

To activate the plugin manually, I have to do:
:RainbowParentheseActivate (or :RainbowParentheseToggle)
:RainbowParentheseLoadRound
That works great but I don't want to type this every time I open a file.

So I tried the options proposed in the doc to have it "always on":
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
It does work on the first file that I open, but not on any extra other buffers that I open afterwards (with :vs for example).

Just for the sake of experiment, I tried to replace this line:
au VimEnter * RainbowParenthesesToggle
with that one:
au VimEnter * RainbowParenthesesActivate
but now even the first file that I open doesn't have any coloured parentheses.
I can't understand why: Activate seems to work like Toggle when I use them manually.
But if I put this, then it works on that first file:
au VimEnter * RainbowParenthesesActivate
au VimEnter * RainbowParentheseLoadRound
but still not on other buffers that I open.

I've tried to add this but it doesn't work either:
au BufNewFile,BufRead * RainbowParenthesesActivate
au BufNewFile,BufRead * RainbowParenthesesLoadRound
au BufNewFile,BufRead * echo "TEST"
even though "TEST" gets printed.
I just can't understand what's going on.

Any idea how to solve this, or even just how to investigate further?


PS: I'm asking for help here because the Github repository does not allow to create issues, and the author hasn't done anything on Github for a year now.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment