Skip to content

Instantly share code, notes, and snippets.

@nf
Last active June 14, 2023 22:08
Show Gist options
  • Star 42 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save nf/d89c8ba5db9bbf23da18 to your computer and use it in GitHub Desktop.
Save nf/d89c8ba5db9bbf23da18 to your computer and use it in GitHub Desktop.
Script for setting up Debian Jessie VM with my development environment
#!/bin/bash -e
echo '
PATH=$HOME/go/bin:$PATH
export GOPATH=$HOME
export CDPATH=.:$HOME/src/golang.org/x:$HOME/go/src:$HOME/src/github.com:$HOME/src/github.com/nf:$HOME/src/github.com/adg
export EDITOR=vim
' >> ~/.profile
sudo apt-get update
sudo apt-get install -y --no-install-recommends mosh build-essential mercurial vim screen git
curl https://storage.googleapis.com/golang/go1.4.1.linux-amd64.tar.gz | tar xz
mv go go1.4
git clone https://go.googlesource.com/go
(cd go/src && ./make.bash)
GOPATH=$HOME ~/go/bin/go get golang.org/x/tools/cmd/goimports golang.org/x/review/git-codereview
mkdir -p ~/.vim/autoload ~/.vim/bundle && curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go
echo '
execute pathogen#infect()
let g:go_fmt_command = "goimports"
set autoindent
filetype plugin indent on
set dir=/tmp
set backupdir=/tmp
' > ~/.vimrc
echo '
[alias]
change = codereview change
gofmt = codereview gofmt
mail = codereview mail
pending = codereview pending
rebase-work = codereview rebase-work
submit = codereview submit
sync = codereview sync
[user]
email = adg@golang.org
name = Andrew Gerrand
' > ~/.gitconfig
@andrewwatson
Copy link

just don't forget to change the last two lines when you adapt it to your own uses, people! :)

@dsymonds
Copy link

If you wrote

source ~/.profile

immediately after writing to it then you wouldn't need to set GOPATH when go-getting those two packages.

@nf
Copy link
Author

nf commented Feb 10, 2015

@dsymonds yeah but I don't want to re-exec my .profile; who knows what it does.

@fatih
Copy link

fatih commented Mar 5, 2015

Hi Andrew,

Happy to see you are using vim-go.

let g:go_disable_autoinstall = 1

This line is not required anymore. There is no autoinstall anymore, it was removed 6 months ago (fatih/vim-go#166). So you can safely remove that line :)

@nf
Copy link
Author

nf commented May 26, 2015

@fatih Thanks!

@ryanolsonx
Copy link

Do you still use this? Just curious

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