How do I store a golang template macro in vim

168 views Asked by At

I want to store the following code permanently in the .vimrc file. Can anyone provide me the code to do so?

package main

import "fmt"

func main() {
        fmt.Println("Hello World")
}
1

There are 1 answers

0
Sam Smith On

The plugin vim-go does this automatically and provides other useful features for go development like running gofmt on save and adding commands for go imports