question: Colorizer#AutoCmds #5

Closed
teschmitz opened this Issue Mar 18, 2012 · 8 comments

Comments

Projects
None yet
2 participants
@teschmitz

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

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Mar 19, 2012

Owner

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

Owner

chrisbra commented Mar 19, 2012

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

@teschmitz

This comment has been minimized.

Show comment
Hide comment
@teschmitz

teschmitz Mar 19, 2012

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

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

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Mar 19, 2012

Owner

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

Owner

chrisbra commented Mar 19, 2012

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

@teschmitz

This comment has been minimized.

Show comment
Hide comment
@teschmitz

teschmitz Mar 19, 2012

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

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

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Mar 20, 2012

Owner

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

Owner

chrisbra commented Mar 20, 2012

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

This comment has been minimized.

Show comment
Hide comment
@teschmitz

teschmitz Mar 20, 2012

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?

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

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Mar 21, 2012

Owner

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

Owner

chrisbra commented Mar 21, 2012

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

This comment has been minimized.

Show comment
Hide comment
@teschmitz

teschmitz Mar 23, 2012

Many thanks for the fixes, Christian.

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

Many thanks for the fixes, Christian.

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

@chrisbra chrisbra closed this Mar 23, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment