summaryrefslogtreecommitdiff
path: root/misc/vim/readme.txt
diff options
context:
space:
mode:
Diffstat (limited to 'misc/vim/readme.txt')
-rw-r--r--misc/vim/readme.txt28
1 files changed, 25 insertions, 3 deletions
diff --git a/misc/vim/readme.txt b/misc/vim/readme.txt
index cb3a52073..b8469f927 100644
--- a/misc/vim/readme.txt
+++ b/misc/vim/readme.txt
@@ -14,6 +14,12 @@ To use all the Vim plugins, add these lines to your $HOME/.vimrc.
If you want to select fewer plugins, use the instructions in the rest of
this file.
+A popular configuration is to gofmt Go source files when they are saved.
+To do that, add this line to the end of your $HOME/.vimrc.
+
+ autocmd FileType go autocmd BufWritePre <buffer> Fmt
+
+
Vim syntax highlighting
-----------------------
@@ -47,9 +53,10 @@ Vim filetype plugins
To install one of the available filetype plugins:
1. Same as 1 above.
- 2. Copy or link one or more plugins from ftplugin/go/*.vim to the
- Go-specific ftplugin directory underneath your vim runtime directory
- (normally $HOME/.vim/ftplugin/go/*.vim).
+ 2. Copy or link ftplugin/go.vim to the ftplugin directory underneath your vim
+ runtime directory (normally $HOME/.vim/ftplugin). Copy or link one or more
+ additional plugins from ftplugin/go/*.vim to the Go-specific subdirectory
+ in the same place ($HOME/.vim/ftplugin/go/*.vim).
3. Add the following line to your .vimrc file (normally $HOME/.vimrc):
filetype plugin on
@@ -68,6 +75,21 @@ To install automatic indentation:
filetype indent on
+Vim compiler plugin
+-------------------
+
+To install the compiler plugin:
+
+ 1. Same as 1 above.
+ 2. Copy or link compiler/go.vim to the compiler directory underneath your vim
+ runtime directory (normally $HOME/.vim/compiler).
+ 3. Activate the compiler plugin with ":compiler go". To always enable the
+ compiler plugin in Go source files add an autocommand to your .vimrc file
+ (normally $HOME/.vimrc):
+
+ autocmd FileType go compiler go
+
+
Godoc plugin
------------