Add GoLang Syntax Highlighting for VIM
You're looking to set up GoLang syntax highlighting for VIM. While the instructions you're following are generally correct, they no longer apply to the latest Go distributions.
Update:
Go 1.4 and later no longer include Go support files for editors. This information has been moved to a curated wiki page.
Solution:
Instead of the instructions you found at http://go-lang.cat-v.org/text-editors/vim/, follow these steps:
" Clear filetype flags before changing runtimepath to force Vim to reload them. filetype off filetype plugin indent off set runtimepath+=$GOROOT/misc/vim filetype plugin indent on syntax on
Note that you may need to adjust the path to $GOROOT/misc/vim depending on your installation. Once you've completed these steps, GoLang syntax highlighting should be enabled in VIM.
The above is the detailed content of How do I Enable GoLang Syntax Highlighting in VIM with Go 1.4 and Later?. For more information, please follow other related articles on the PHP Chinese website!