Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 3
    I'm surprised people doesn't even bother to Google before posting wrong answers... Commented Jun 29, 2014 at 11:48
  • 1
    @user1147688: If you carefully read Felix's answer, the GNU source-highlight is an external program, and the integration with less is very loose. It's not less that does the highlighting; but Vim indeed has this capability built-in. Commented Jun 29, 2014 at 11:59
  • 4
    For the question "How do I apply syntax highlighting colors according to vim colors for less command?", the answer "By using source-highlight" seems like a more correct answer that "By using vim". Commented Mar 10, 2015 at 9:21
  • 3
    +1 but I'm sure what these comments are trying to say -- can't tell if they're even positive or negative ("...google before posting wrong answers"?, "installing xyz is more correct than just using vim"?). This answer is clearly the "most correct answer". Basically the OP didn't know this feature of vim existed, and this answer lets the OP know that it exists. Occam's razor ftw. The answer could only be improved by showing an example, e.g., $ diff file1.c file2.c | /usr/share/vim/vim74/macros/less.sh Commented Dec 5, 2016 at 2:51