]> Cypherpunks repositories - gostls13.git/commitdiff
misc/vim: reorganize plugin so it uses ftplugin and syntax
authorJames Whitehead <jnwhiteh@gmail.com>
Sun, 20 Jun 2010 09:46:12 +0000 (11:46 +0200)
committerAndrew Gerrand <adg@golang.org>
Sun, 20 Jun 2010 09:46:12 +0000 (11:46 +0200)
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
https://golang.org/cl/1723044

misc/vim/ftdetect/gofiletype.vim [new file with mode: 0644]
misc/vim/readme.txt [new file with mode: 0644]
misc/vim/syntax/go.vim [moved from misc/vim/go.vim with 100% similarity]

diff --git a/misc/vim/ftdetect/gofiletype.vim b/misc/vim/ftdetect/gofiletype.vim
new file mode 100644 (file)
index 0000000..b67dab0
--- /dev/null
@@ -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 (file)
index 0000000..eaa839e
--- /dev/null
@@ -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
similarity index 100%
rename from misc/vim/go.vim
rename to misc/vim/syntax/go.vim