Last active
June 27, 2024 02:35
-
-
Save iwanbk/bdb5c557ff77fd5c2bf7 to your computer and use it in GitHub Desktop.
Go + Vim Init : main file is goinit.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export GOROOT=$HOME/go | |
export GOPATH=$HOME/pathgo | |
export PATH=$PATH:$GOROOT/bin | |
export PATH=$PATH:$GOPATH/bin | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install packages | |
sudo apt-get update -y | |
sudo apt-get install -y curl vim build-essential mercurial git cmake pkg-config vim-nox graphviz tmux | |
#install go | |
cd | |
wget -c https://go.dev/dl/go1.22.4.linux-amd64.tar.gz | |
tar zxf go1.22.4.linux-amd64.tar.gz | |
#configure path | |
wget -c https://gist.githubusercontent.com/iwanbk/bdb5c557ff77fd5c2bf7/raw/ac521b4baa7884194b5b0eb8a75b85f0366761e3/bashrc_add -O /tmp/bashrc_add | |
cat /tmp/bashrc_add >> ~/.bashrc | |
source ~/.bashrc | |
# install pathogen and vim-go | |
cd | |
mkdir -p ~/.vim/autoload ~/.vim/bundle | |
curl -LSso ~/.vim/autoload/pathogen.vim https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim | |
echo "execute pathogen#infect()" >> ~/.vimrc | |
cd ~/.vim/bundle | |
git clone https://github.com/fatih/vim-go.git | |
# neocomplete | |
cd ~/.vim/bundle | |
git clone https://github.com/Shougo/neocomplete.vim.git | |
echo "let g:neocomplete#enable_at_startup = 1" >> ~/.vimrc | |
export GOPATH=$HOME/pathgo | |
export PATH=$PATH:$HOME/go/bin/:$GOPATH/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#add swap | |
sudo fallocate -l 1G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo sh -c 'echo "/swapfile none swap sw 0 0" >> /etc/fstab' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment