1

I'm a hobbyist go programmer, and I'm using vim-go to make vim efficient go editor.

One thing I like about vim-go is, whenever in a directory, when you open a new .go file. It adds this:

package main

import "fmt"

func main() {
    fmt.Println("vim-go")
}

Note that it has the main function. And now if you create other .go files now on, you'll get this:

package main

I really like this feature. And would like to implement this for other filetypes. E.g. for Python files, I would like to do this:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

And for bash files, I would like to do this:

#!/usr/bin/env bash

And so on.

What is the minimal setup that I need to do for each filetype (Say I already have a template file for each)?

Browse other questions tagged or ask your own question.