Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I make vi in Cygwin highlight the syntax when I open a file by default? I know that I can type in the command "syntax on" but I would prefer to not do this all the time.

share|improve this question

Put the line syntax on in your ~/.vimrc (assuming you're talking about vim), same as on any other installation of vim.

share|improve this answer

As Gilles says that add syntax on in your ~/.vimrc. You can also add other such as set nu (the number of line), set bacpspace=2 and so on. The ~/.vimrc file is a configuration file, you can configure it the same way as on Linux.

share|improve this answer
I'm sorry, the file(.vimrc) is used to set vi editor as in Linux. – binghenzq Aug 15 '13 at 9:09
Ah ok Mat fixed it. I will delete the command. – Raphael Ahrens Aug 15 '13 at 10:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.