Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

vim has syntax highlighting.


Not on a command line SSH connection, does it?


Sure.

Whether or not this extends to color depends on the terminal / termcap support at the remote end, but at the very least bolding and reverse-video should be supported.

In most instances, you'll have full color syntax highlighting, though I've found I've got to down-rate my terminal. e.g.: rxvt-unicode isn't known on all systems, but rxvt, ansi, linux, or xterm generally are, and dropping past "rxvt" on that list is very, very rare.


You do realize that you can compile a termcap an set it up in ~/.terminfo, right? E.g.:

  % tree ~/.terminfo 
  /home/pyre/.terminfo
  `-- r
      |-- rxvt-unicode
      `-- rxvt-unicode-256color


Hmm, I never noticed that during my casual visits to vi-land. I'll definitely look into that, it's probably time to read up on how to massage vi's settings...


If you want syntax highlighting you should be using Vim, not Vi. On many (but not all!) modern systems 'vi' will invoke Vim in compat mode forcing you to manually reenable Vim's additional features. Some modern systems come with a Vi provided by elvis or even busybox, always check what you're actually using.


Alright, I promise I will check it out. I admit I do feel a bit behind the curve for being a programmer for so long while never really having looked into vi in depth.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: