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

how to control the syntax hightlighting style?

Expand Messages
  • Liu Wen
    for example , an C program file ending in .bak, so vi would not highlight it. can I force it to ? Regards Liu
    Message 1 of 3 , Jun 3, 2001
    • 0 Attachment
      for example , an C program file ending in .bak, so vi would not
      highlight it. can I force it to ?

      Regards
      Liu
    • Michael Geddes
      set filetype=c or set syntax=c
      Message 2 of 3 , Jun 3, 2001
      • 0 Attachment
        set filetype=c

        or

        set syntax=c

        > -----Original Message-----
        > From: Liu Wen [SMTP:ragent@...]
        > Sent: Monday, 4 June 2001 16:02
        > To: vim@...
        > Subject: how to control the syntax hightlighting style?
        >
        > for example , an C program file ending in .bak, so vi would not
        > highlight it. can I force it to ?
        >
        > Regards
        > Liu
      • Benji Fisher
        ... What version of Vim are you using, and what is the exact filename? When I do ... with Vim 5.7, vim(*) knows to strip off the .bak and set the filetype
        Message 3 of 3 , Jun 4, 2001
        • 0 Attachment
          Liu Wen wrote:
          >
          > for example , an C program file ending in .bak, so vi would not
          > highlight it. can I force it to ?

          What version of Vim are you using, and what is the exact filename?
          When I do

          :e foo.c.bak

          with Vim 5.7, vim(*) knows to strip off the ".bak" and set the filetype
          (and syntax) as it would for foo.c . In other words, I get C syntax
          highlighting. This does not work with foo_c.bak, for example, or foo.bak
          .

          --Benji Fisher

          (*) It is not the vim program itself, but the script
          $VIMRUNTIME/filetype.vim that does this processing. Have a look!
        Your message has been successfully submitted and would be delivered to recipients shortly.