Sunday, July 29, 2012

Re: vim: syntax issue: colorscheme change reset my syntax highlight

On 7/17/2012 5:38 PM, Chris Jones wrote:
> On Mon, Jul 16, 2012 at 11:25:43AM EDT, ping wrote:
>
>> experts: I found every time I change my colorscheme, my syntax
>> highlight seems got reset.
>>
>> * the reason I need to change my colorscheme: I use vim from inside
>> gnu screen, work from office & home, in office I run
>> terminator/ubuntu, with default as colorscheme. at home when I run
>> cygwin/win7, and when I resume screen, I found the default doesn't
>> looks good and I change colorscheme to koehler, which looks the best.
>>
>> * the reason this become annoying I write asciidoc in a day to day
>> base, with current asciidoc syntax file:
>
>> https://github.com/dagwieers/asciidoc-vim
>
>> for some reason (guess maybe its because the way it got implemented
>> used too much wild search/match ) it become very slow with a large
>> file (2M txt for example) this make it painful everytime I lost my
>> highlights and need to set ft=asciidoc again (need to wait more than
>> 1 minute during 100% cpu )
>>
>> not sure I better split into 2 questions/emails... please advise.
>
> Not sure I understand your scenario, but the syntax file you are using
> is not the official asciidoc syntax file.

yes what I used is an alternative instead of the standard asciidoc
syntax file. the reason is this file provided more intensive highlight
for asciidoc, making it more convenience to find out errors when writing
asciidoc...

The file you link to not only
> contains the usual 'syn match'.. etc. statements that define the syntax
> to Vim.. but it also contains its own embedded color scheme. And the
> highlight groups defined in this syntax file are not linked to any of
> the common highlight groups found in most color schemes I have looked
> at. As far as I can tell, this breaks Vim's syntax highlighting.
>

I'm still learning vim syntax, but you are right, I don't understand how
the performance though.

> As a result, whatever general-purpose color scheme you specify (such as
> koehler) is not going to change anything regarding files of filetype
> asciidoc.
>
> Maybe you could comment out the 'hi' statements at the end of this
> syntax file.. or if you like the color scheme move them to a separate
> color scheme file..?
>

this I tried, but not only it doesn't expedite, but it also lose all the
syntax highlight.

> Or switch back to the 'official' asciidoc syntax file and see if that
> helps..?
>
yes as I mentioned, that works, but the default(official) syntax is very
limited and is missing a lot of very useful asciidoc syntaxes.

> Maybe contact the maintainer of that syntax file and ask him to provide
> two separate files: the syntax file and the color scheme file..?
>
I did, before seeking help in vim group, no response ... yet.

> CJ
>

thanks Chris, looks I need to loose my spam rules...
see my comment in lines
I'm reading/learning vim syntax myself and see if I can solve it myself :)


regards
ping

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