Saturday, September 3, 2011

Re: Color Definition at VIM Invocation???

On Sep 2, 2:58 pm, "Benjamin R. Haskell" <v...@benizi.com> wrote:
> Does 5.7 have autocommands?  If so, put 'em in a function that gets
> called when editing files:

I'm pretty sure syntax highlighting has always been triggered using
autocmds, so probably this will work.

>
> fun! LinkColorGroups()
>      highlight link cConditional VisualNOS
>      highlight link cRepeat VisualNOS
>      highlight link cStatement VisualNOS
>      highlight link cLabel VisualNOS
>      highlight link cStructure VisualNOS
>      highlight link cStorageClass VisualNOS
> endfun
>
> aug SetupColors
>      au!
>      au BufRead,BufNewFile * call LinkColorGroups()
> aug END
>

I'd try an autocmd like this first:

au Syntax c call LinkColorGroups

Since it's closer to what you're trying to accomplish.

But perhaps it won't work in a Vim as old as 5.7.

--
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

No comments: