summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Whitehead <jnwhiteh@gmail.com>2010-06-20 11:46:12 +0200
committerJames Whitehead <jnwhiteh@gmail.com>2010-06-20 11:46:12 +0200
commit438d74f75334de21d91bbab100178bc9e08a1f46 (patch)
treecde17f7e40b1548fe284193a35c437a4b4401896
parentf26c28a219d496036138048fac8ba7aa9f5745cc (diff)
downloadgolang-438d74f75334de21d91bbab100178bc9e08a1f46.tar.gz
misc/vim: reorganize plugin so it uses ftplugin and syntax
This sets up vim to work out of the box with go programs as long as syntax highlighting is enabled. Both files must be copied to the vim runtime directory in order for the file-type detection and syntax loading to work. R=golang-dev, adg CC=golang-dev http://codereview.appspot.com/1723044 Committer: Andrew Gerrand <adg@golang.org>
-rw-r--r--misc/vim/ftdetect/gofiletype.vim1
-rw-r--r--misc/vim/readme.txt12
-rw-r--r--misc/vim/syntax/go.vim (renamed from misc/vim/go.vim)0
3 files changed, 13 insertions, 0 deletions
diff --git a/misc/vim/ftdetect/gofiletype.vim b/misc/vim/ftdetect/gofiletype.vim
new file mode 100644
index 000000000..b67dab0ab
--- /dev/null
+++ b/misc/vim/ftdetect/gofiletype.vim
@@ -0,0 +1 @@
+au BufRead,BufNewFile *.go setfiletype go
diff --git a/misc/vim/readme.txt b/misc/vim/readme.txt
new file mode 100644
index 000000000..eaa839eb7
--- /dev/null
+++ b/misc/vim/readme.txt
@@ -0,0 +1,12 @@
+Vim syntax highlighting for Go (http://golang.org)
+==================================================
+
+To install automatic syntax highlighting for GO programs:
+
+ 1. Copy ftplugin/gofiletype.vim to the ftplugin directory underneath your vim
+ runtime directory (normally $HOME/.vim/ftplugin)
+ 2. Copy syntax/go.vim to the syntax directory underneath your vim runtime
+ directory (normally $HOME/.vim/syntax)
+ 3. Add the following line to your .vimrc file (or equivalent):
+
+ syntax on
diff --git a/misc/vim/go.vim b/misc/vim/syntax/go.vim
index 244503ca3..244503ca3 100644
--- a/misc/vim/go.vim
+++ b/misc/vim/syntax/go.vim