Skip to content

Instantly share code, notes, and snippets.

@oscarryz
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oscarryz/81bb2b5c1db821d71d1c to your computer and use it in GitHub Desktop.
Save oscarryz/81bb2b5c1db821d71d1c to your computer and use it in GitHub Desktop.

Sooo...

I thought it would be easier to setup goimports to use it with vim, and probably it is, but I had a lot of problems on the way.

Here's a quick summary of what I did at the end.

Note: I already had go installed and my GOPATH envrionment variable set.

  1. If fish shell is the default shell change it to something else ( I reverted to bash)

     chsh -s /bin/bash
    
  2. Install Pathogen.vim

     cd ~/.vim
     mkdir autoload bundle
     #copy the pathogen.vim file in autoload
    
  3. Install vim-go

     git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go
    
  4. Add these lines to the top of the ~/.vimrc file:

     execute pathogen#infect()
     let g:go_fmt_command = "goimports"
    
  5. Open vim y run:

     :GoInstallBinaries
    

And that was it!

Have I know this before I would've save a lot of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment