Implement go syntax highlighting in vim and gedit

1. Copy ~/go/misc/vim/go.vim to ~/.vim/syntax/ (there is no such directory under Ubuntu 9.10, so create it first)

2. Create go in ~/.vim/ftdetect/ .vim file, the content is:

autocmd BufNewFile,BufReadPost *.go set filetype=go

so that vim can automatically identify the go source program and highlight it.

-----------------------------------
In addition, set go in gedit, download go syntax highlighting from the following address File

http://go-lang.cat-v.org/text-editors/gedit/

Copy the go.lang file to the /usr/share/gtksourceview-2.0/language-specs directory, note that go.lang is set to Readable by all. Or copy to $HOME/.local/share/gtksourceview-2.0/language-specs, if there is no corresponding directory, please create it first. Just restart gedit.
#Go

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326940515&siteId=291194637