9

I would like to mc viewer (mcview, run by F3 key) highlights my C++ code. Is it possible?

For editing (mcedit, F4 key) I am using vim with its own syntax highlighting. For viewing, I can't find such option. There is

editor_syntax_highlighting=1

Which can be changed in ~/.mc/ini or ~/.config/mc/ini but it's obviously related with built-in mcedit, not the viewer. Is there something like viewer_syntax_highlighting=1 or any other way how to highlight syntax in viewer?

Pablo Bianchi
  • 1,824
  • 1
  • 26
  • 30
Michal Špondr
  • 1,337
  • 2
  • 21
  • 44

1 Answers1

10

Viewer doesn't do syntax highlighting, only Editor does.

phd
  • 82,685
  • 13
  • 120
  • 165
  • Is there a reason behind it? – Michal Špondr May 25 '17 at 20:23
  • I can guess it's simply nobody has implemented it. – phd May 25 '17 at 21:35
  • 5
    For reference - there is a ticket proposing this enhancement in the mc bugtracker - http://midnight-commander.org/ticket/28 - However, it was created already 2005 – Christian Herenz May 31 '18 at 14:39
  • 1
    It's only a feature request, not a patch. Someone has to step in and implement the feature. – phd May 31 '18 at 18:37
  • 2
    Would be possible to apply [these patches](https://midnight-commander.org/ticket/83) to have an `mcedit` read-only mode that could replace `mcview` by [changing VIEWER](https://unix.stackexchange.com/a/80852/209677) environment variable – Pablo Bianchi May 20 '20 at 02:47