Results 1 to 8 of 8

Thread: VIM perl syntax highlighting

  1. #1

    VIM perl syntax highlighting

    okie so i might just give in and abandon elvis in favor of vim. the only thing is syntax highlighting:
    vim:


    elvis:


    how can i make vim look more like elvis? i know the:
    hi Comment ctermfg=gray but i still couldn't get it to my liking. can some one point me to a good tutorial for syntax highlighting?

    Thanks in advance.

  2. #2

    Re:VIM perl syntax highlighting

    Augh!

    Don't edit perl's syntax highlighting, edit your colorscheme. The idea of syntax highlighting is that the syntax highlighting file simply identifies functions as functions, comments as comments, etc, and then your colorscheme file matches up colors to those things. A syntax file should not have any references to definite colors.

    Beyond that, I can't really say anything. I don't know what color file you're using, so I don't know what you'd have to edit to change the colors to how you want them.

  3. #3

    Re:VIM perl syntax highlighting

    Oh, and you can probably put "set ts=3" into your .vimrc somewhere, that'll probably fix your indenting.

    (edit: I can count real good )

  4. #4

    Re:VIM perl syntax highlighting

    [quote author=Feztaa link=board=2;threadid=4416;start=0#43923 date=1028079673]
    Don't edit perl's syntax highlighting, edit your colorscheme.
    [/quote]

    the vim61/colors/foo?

    i looked at one of those and just change the hi in my vimrc.

    is there a good guide on making a colorscheme?

    thanks

    oh and can i get 'foo' to be red and "foo" to be green? it's like that in elvis more as a bug, but i like it cause ' != "

  5. #5

    Re:VIM perl syntax highlighting

    [quote author=gorn link=board=2;threadid=4416;start=0#43935 date=1028084140]the vim61/colors/foo?[/quote]

    Yeah, that's the one. I wrote my own colorscheme, because I wasn't totally happy with the existing ones. It's not really hard, just take an existing one and change the colors to be something you like

    i looked at one of those and just change the hi in my vimrc.

    is there a good guide on making a colorscheme?
    I haven't seen any. You could try Google, or vim.org (or vim.sourceforge.org, which might be easier to find stuff on).

    oh and can i get 'foo' to be red and "foo" to be green? it's like that in elvis more as a bug, but i like it cause ' != "
    It's certainly possible, but for this you'd have to edit the syntax file.

    Right now, the syntax file is defining what should be strings, and the color file is defining what color strings should be. What you'll have to do is poke around in the syntax file and try to make it define the two different types of strings as different names (perlString1 and perlString2 or something). Note that this will probably break the way the syntax file handles strings, so you'll have to link the new names back to the old names to fix things. It'll be ugly, but it should work. Then, in your colorfile, you can link up perlString1 and perlString2 to the colors you want.

    I'd have a look at the vim documentation, the docs on syntax highlighting are very straightforward. ':help syntax' will tell you everything.

    Hope this helps.

  6. #6

    Re:VIM perl syntax highlighting

    yes it has helped :-D

    i checked the perl.vim and found perlStringUnexpanded is the 'string' and perlString is "string" so i just set perlStringUnexpanded's color to red.
    and i played with some other stuff in both the syntax file and color scheme.

    the big thing now is if i set normal to ctermfg=yellow it makes it yellow/bold , which i want, however it makes everything else bold too, which i don't. is there a way around this?

    thanks again.

  7. #7

    Re:VIM perl syntax highlighting

    Well, for all the other ones, you could try setting cterm=none if it isn't set. I'm not sure if that would do it, but it should debold what got bolded by 'normal' text.

  8. #8

    Re:VIM perl syntax highlighting

    [quote author=Feztaa link=board=2;threadid=4416;start=0#44489 date=1028449572]
    Well, for all the other ones, you could try setting cterm=none if it isn't set. I'm not sure if that would do it, but it should debold what got bolded by 'normal' text.
    [/quote]
    yea i tried that and it doesn't work, it still bold's them.

Similar Threads

  1. Text file syntax highlighting/Export to HTML
    By vwgtiturbo in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 06-23-2006, 05:36 AM
  2. Bittorrent syntax.
    By zenmatt in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 03-02-2006, 08:02 PM
  3. Syntax highliting in VIM
    By woosting in forum Linux - General Topics
    Replies: 3
    Last Post: 09-02-2005, 01:04 PM
  4. Syntax highlighting in elvis
    By countach44 in forum Linux - Software, Applications & Programming
    Replies: 5
    Last Post: 04-07-2004, 09:25 PM
  5. Syntax highlighting in Slackware
    By -JhAzEr- in forum Linux - General Topics
    Replies: 1
    Last Post: 10-28-2003, 12:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •