vim syntax highlighting does not work

Hari
2011-11-16
2013-06-12
  • Hari

    Hari - 2011-11-16

    I have set up two shells in Console on windows XP, the DOS shell that is defined by default and a cygwin shell. When I edit a C++ file (with .cpp extension) in either shell the entire file is shown in the default color. There is no syntax highlighting. In the cygwin shell I have tried different values for the TERM environment variables (cygwin, ansi, vt100, xterm), but it did not make any difference.

    If I edit the same file in a 'Command Prompt' window or in a window created with the shortcut created using cygwin installation syntax highlighting works.

    Is this the expected behavior or am I missing some configuration?

    Thanks,
    Hari

     
  • Hari

    Hari - 2011-11-16

    In Settings->Appearance I had set a custom color. Once I disabled it syntax highlighting worked. May be this should be treated as a bug.

     
  • Kirill

    Kirill - 2011-11-16

    I would agree with you that Custom color setting is not obvious, but if you consider it as a "monochrome colors map for foreground color" then you'd agree that it's not a bug.

     
  • Hari

    Hari - 2011-11-16

    Sorry I don't agree. The default foreground color is white. Setting the custom color should only change that and should apply only when you are not editing something. It should not affect the behavior when using an editor like vim. I guess vim sends special escape sequences to set the text foreground colors and that should be honored regardless of whether custom color is set or not.

    I do like Console a lot. I wish I had found out about it earlier.

     
  • Kirill

    Kirill - 2011-11-16

    If you want to only replace white, then you should uncheck custom color and replace white in the colors map. And it would give you the behaviour you want .

    And no, Console does not see any escape sequences.

     
  • Hari

    Hari - 2011-11-17

    Thanks for the suggestion, but it did not work. I changed white to the color I wanted, but Console continued to use white as the foreground color. Restarting Console did not help - after restarting I did verify that Console remembered the color map change I had made. I made the change in 'Settings -> Console -> Console colors map'.

    Regardless of how vim shows different text in different colors, it's Console that's ignoring it and showing everything in the same color when custom color is enabled - isn't that true? If so, it would be nice to have an option to have Console show vim's syntax highlighting even when custom color is on.

     
  • Kirill

    Kirill - 2011-11-18

    RE: it's Console that's ignoring it and showing everything in the same color when custom color is enabled
    Yes, that's true. That's why I suggested to uncheck (disable) custom color in addition to changing the white. Warning: there is white and there is bright white, cmd usually uses regular white.

    RE: it would be nice to have an option to have Console show vim's syntax highlighting even when custom color is on
    Custom color was designed to replace any foreground colors an app might use. If you want to show vim syntax highlighting, you have to disable custom color.

     
  • Hari

    Hari - 2011-11-18

    I made the color map change in 'Settings -> Console -> Console colors map'. There is only one white, which is the very last color. 16 colors are shown in a 4x4 grid.

    Since you say there are 2 whites, am I changing the color map correctly?

     
  • Kirill

    Kirill - 2011-11-19

    The second "white" is probably called "grey". It's the last color in the second column. That's the one usually used by cmd.

     
  • Hari

    Hari - 2011-11-22

    Thanks, that was it. Works now.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks