chrisbra / Colorizer

color hex codes and color names
547 stars 30 forks source link

question: Colorizer#AutoCmds #5

Closed teschmitz closed 12 years ago

teschmitz commented 12 years ago

Please, excuse my ignorance: why does DoColor need to be called on BufEnter?

When I initially configered the plugin, I plumped for auto-colouring, of course had a wee look at your Colorizer.vim. Needless to say, with all the colour definitions loading was sloooowww ;-) And that's when I realized that merely bringing a tab to the foreground causes the Highlighting to be applied again.

I'm just asking because auto-highlighting might be useful for certain filetypes.

Regards, Tarlika Elisabeth

chrisbra commented 12 years ago

Hm, maybe a BufWinEnter autocommand is better? The idea is, to just call the plugin to highlight colors when first entering a buffer.

teschmitz commented 12 years ago

On Mon, 19 Mar 2012 13:46:50 -0700 chrisbra reply@reply.github.com wrote:

maybe a BufWinEnter autocommand is better?

I replaced BufEnter with BufWinEnter in your .vim/autoload/Colorizer.vim.

That's a damned sight faster and a more workable solution in case one opens a colour monster like .vim/autoload/Colorizer.vim!

Is it possible to enable auto-colourizing for certain filetypes only? If so, how?

Best Regards, Tarlika Elisabeth Schmitz, Scotland

chrisbra commented 12 years ago

That is an interesting idea. What filetypes come to mind?

teschmitz commented 12 years ago

On Mon, 19 Mar 2012 15:10:33 -0700 chrisbra reply@reply.github.com wrote:

.css, .html, .svg

At the moment, I have restricted highlighting to CSS.

.vim/ftpplufin/css.vim: :ColorHighlight

Obviously, that's not auto-colouring.

But I would certainly see a needfor filetype-specific settings as I don't necessarily want the words "red", "blue" etc. highlighted in every text or take a performance penalty.

Regards, Tarlika Elisabeth Schmitz, Scotland

chrisbra commented 12 years ago

Hi Tarlika,

On Mo, 19 Mär 2012, teschmitz wrote:

On Mon, 19 Mar 2012 15:10:33 -0700 chrisbra reply@reply.github.com wrote:

.css, .html, .svg

At the moment, I have restricted highlighting to CSS.

.vim/ftpplufin/css.vim: :ColorHighlight

Obviously, that's not auto-colouring.

But I would certainly see a needfor filetype-specific settings as I don't necessarily want the words "red", "blue" etc. highlighted in every text or take a performance penalty.

Regards, Tarlika Elisabeth Schmitz, Scotland

Well, it is not perfect yet, but current head provides a documentation info on how to enable it for certain filetypes. It should be turned into a real Filetype specific autocommand and that is still on my todo list, but it should work basically. Also, current head, includes the colorizer_names variable, to prevent highlighting of color names.

regards, Christian

teschmitz commented 12 years ago

I am getting an error message when opening a css file now: "Error detected while processing function Colorizer#DoColor E380 Undo number 0 not found"

The colorizer_names variable did not seem to be doing anything, maybe because of this error?

chrisbra commented 12 years ago

On Tue, March 20, 2012 22:01, teschmitz wrote:

I am getting an error message when opening a css file now: "Error detected while processing function Colorizer#DoColor E380 Undo number 0 not found"

Upps, fixed that one.

The colorizer_names variable did not seem to be doing anything, maybe because of this error?

Its g:colorizer_colornames variables. I fixed the documentation.

regards, Christian

teschmitz commented 12 years ago

Many thanks for the fixes, Christian.

I just opened a CSS file and it gives me pleasure everytime I see the wee colour blocks!