2

I would like to know what is the method to do syntax highlighting in terminal. I am trying to avoid my mouse to become more of a keyboard junkie so I am working more on Terminal and trying to learn vim. When I decide to look back at some previous commands on terminal, its tough to read. So I was hoping that a syntax highlighting will differentiate the line I enter to that from the machine. I did see a previous post at Can I make my Mac OS X Terminal color items according to syntax, like the Ubuntu terminal?. But as it was asked in 2011, I am hoping the process has got easier.

3
  • It sounds like you want the prompt, your command, and the resulting output to all be different colors? Or are you talking about syntax highlighting the contents of files in vim? Or are you talking about your shell's history file being syntax highlighted? – Camden Narzt Mar 15 '15 at 21:05
  • @CamdenNarzt I need prompt, command, and the resulting output to all be different colors. Exactly. I did not know the right words to ask in the first place. – qbektrix Mar 16 '15 at 4:39
  • Prompt can be customized, and it has little to do with the terminal (except terminal type and color scheme). It's the job of your shell. In Bash and Zsh, you customize the prompt by modifying the environment variable PS1. Different colors for command and resulting output is impossible (unless your output contains color escape codes by itself). At least not in a terminal emulator that I know of. And typical keyboard junkies (like me) find a (well) customized, (well) colorized prompt more than capable of distinguishing everything, so you'd better get used to it. – 4ae1e1 Mar 21 '15 at 15:14

You must log in to answer this question.

Browse other questions tagged .