Configuring Go Syntax Highlighting in Vim
Attempting to add Go syntax highlighting to Vim, you followed the instructions to copy go.vim to the syntax directory and create a ftdetect file. However, the highlighting is not activating.
Solution
As per the Go 1.4 Release Notes, Go support for editors like Vim has been removed from the standard repository. Instead, you can find installation instructions for Vim plugins on the Go Wiki:
To use all the Vim plugins, add these lines to your $HOME/.vimrc. " Some Linux distributions set filetype in /etc/vimrc. " 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
Update your .vimrc file with these lines, and Vim will automatically load the necessary syntax settings for Go files.
The above is the detailed content of Why isn't Go syntax highlighting working in Vim after installing go.vim?. For more information, please follow other related articles on the PHP Chinese website!