Loading ...
Sorry, an error occurred while loading the content.

15269Re: Block code highlighting

Expand Messages
  • Thomas Köhler
    Sep 6, 2000
    • 0 Attachment
      On Wed, Sep 06, 2000 at 10:45:09AM -0400,
      Geoffrey Gallaway <geoffeg@...> wrote:
      >
      > Thats close but I wanted to use the background so I could still do
      > complete syntax highlighting for the text.

      Should be possible. Those highlighting regions for { ... } should just
      set the background color and contain all other highlighting groups
      (but not itself)

      See http://jeanluc-picard.de/vim/highlightning2/
      Now, in order to get _full_ highlightning-pass-thru (so, those keywords
      get the same background color as the surrounding region), just duplicate
      the corresponding syntax items and contain only one set of them into
      each such region: first region contains cTypeRegion1, next contains
      cTypeRegion2 etc. - and each of those sets the same foreground, but
      different background colors...
      (it's just a bit more work to do :)

      > Maybe I should start asking questions about doing this for real now
      > that it looks like its remotely possible:
      >
      > * Can vim/gvim set the background color for syntax highlighting

      Yes. http://jeanluc-picard.de/vim/highlightning2/screenshot.png

      > * Can (vim)/gvim set the color to something specific?

      Yes. http://jeanluc-picard.de/vim/highlightning2/c2.vim contains lines
      like this:
      hi cwhileState guibg=#222222

      Set any color you like :-)

      > * What is the approximate air speed velocity of an unlaiden swallow?

      Eh? :-)

      > Obviously doing alot of this stuff on the console becomes difficult since
      > the console cant handle more than 2 or 3 shades of any color but I'll
      > live.

      That's one of the main reasons for me to use gvim at all.
      Bad terminal emulations are the other one.
      But gvim over ISDN is much slower than console vim - so I still use that
      a lot :-)

      > Geoff

      CU,
      Thomas

      > This one time, at band camp, Thomas Köhler wrote:
      >
      > > On Wed, Sep 06, 2000 at 09:20:23AM -0400,
      > > Geoffrey Gallaway <geoffeg@...> wrote:
      > > >
      > > > Hope people don't mind me posting this here. I've posted to comp.editors
      > > > with little response...
      > >
      > > Well, there's quite a few people having a look at comp.editors
      > > sometimes, including me - but as far as I'm concerned, I often leave
      > > lots of articles unread (especially when I run out of time, which
      > > happens quite often lately).
      > >
      > > > I've been looking for a way to get vim (especially gvim) to do syntax
      > > > highlighting of code blocks. What I want is a darker (or lighter depending
      > > > on the current bg settings) background shade block around certain
      > > > structures (while, if, sub, do, for, etc) and continuly get darker for
      > > > recursing structures. I created an example of what I wanted this to look
      > > > like in staroffice and took a .png screenshot, it can be viewed at
      > > > "http://www.sloth.org/~geoffeg/highlight.png" and a text version that makes
      > > > little sense is included below. The lines on the boxes are not important and
      > > > are there just to better show what I'm trying to convey..
      > >
      > > Looks nice.
      > > I once had a similar idea, and played around a bit with syntax
      > > highlightning. The result can be found here:
      > > http://jeanluc-picard.de/vim/highlightning/
      > >
      > > There's two files: c2.vim (a modified version of the original syntax
      > > file for C) and a screenshot how it looks like in current vim (6.0h), of
      > > course this uses my very own special highlightning file et cetera, but
      > > you can have a look at c2.vim and get the idea. "nested areas" of
      > > highlightning regions is the key...
      > >
      > > > This would be usefull in a few ways.. It definetly shows you where you've
      > > > screwed up and left a brace off (maybe the rest of a buffer should go red
      > > > after a lack of closing brace) and it helps to clarify deeply nested code.
      > >
      > > Well, one could add lots of funny stuff after that... :-)
      > >
      > > > Any ideas?
      > > >
      > > > Geoff
      > >
      > > Ciao,
      > > Thomas
      > >
      > >
      >
      > --
      > Geoffrey Gallaway || We've heard that a million monkeys at a million keyboards
      > geoffeg@... || could produce the Complete Works of Shakespeare; now,
      > D e v o r z h u n || thanks to the internet, we know this is not true.
      >

      Ciao,
      Thomas

      --
      Thomas Köhler Email: jean-luc@... | LCARS - Linux
      <>< WWW: http://jeanluc-picard.de | for Computers
      IRC: jeanluc | on All Real
      PGP public key available from Homepage! | Starships
    • Show all 11 messages in this topic