0

I modified ~/.vimrc and added the following line:

syntax on

to turn syntax on. The syntax is highlighted for python, java, but for golang it doesn't highlight at all.

I would like to do the same when editing vim files, logged in as root too. I tried to modify vimrc as root but none of the modes work with syntax.

Jonathan.Brink
  • 23,757
  • 20
  • 73
  • 115
Jaimy
  • 227
  • 1
  • 8
  • 1
    Is it a difference in PATH? (and why would you ever need to edit Go code as root?) – JimB Dec 22 '15 at 20:22
  • 1
    I think it is already answered here: http://stackoverflow.com/questions/15579822/add-golang-syntax-highlighting-for-vim – Alexander Trust Dec 22 '15 at 20:28
  • 1
    It seems like you need to install a go language support plugin. To configure this for root, simply add this to the root user's config file (it's probably in `/root/.vimrc`, unless if your root user has a different home directory). – Nick McCurdy Dec 31 '15 at 19:23
  • Possible duplicate of [Add GoLang syntax highlighting for VIM](https://stackoverflow.com/questions/15579822/add-golang-syntax-highlighting-for-vim) – Armali Jan 17 '18 at 10:35

0 Answers0