From: Christian Heller Date: Fri, 5 Feb 2016 23:44:14 +0000 (+0100) Subject: Add optional golang setup, and vimrc entensibility. X-Git-Url: https://plomlompom.com/repos/balance?a=commitdiff_plain;h=18bb8421ac5593f7b40e15937cb3a66345bf2fca;p=config Add optional golang setup, and vimrc entensibility. --- diff --git a/dotfiles/minimal/vimrc b/dotfiles/minimal/vimrc index 0103b0a..485351c 100644 --- a/dotfiles/minimal/vimrc +++ b/dotfiles/minimal/vimrc @@ -25,3 +25,6 @@ autocmd BufEnter * :syntax sync fromstart " Mark the 80-th column. set colorcolumn=80 + +" Source additions +source ~/.vimrc_add diff --git a/dotfiles/minimal/vimrc_add b/dotfiles/minimal/vimrc_add new file mode 100644 index 0000000..e69de29 diff --git a/setup_go.sh b/setup_go.sh new file mode 100755 index 0000000..fabdce8 --- /dev/null +++ b/setup_go.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +set -e +set -x + +ensure_line() { + add_string="$1" + file="$2" + echo "TESTESTEST" + echo $add_string + echo $file + test=`grep "$add_string" "$file" | wc -l` + if [ $test -lt 1 ]; then + echo "$add_string" >> "$file" + fi +} + +filename=temp_golang_binary + +if [ "$1" = "" ]; then + echo 'Need URL of current go package' + exit 1 +fi +sudo rm -rf /usr/local/go +sudo apt-get -y install wget +wget -O $filename $1 +sudo tar -C /usr/local -xzf $filename +rm $filename +ensure_line 'export PATH=$PATH:/usr/local/go/bin' ~/.shinit_add +ensure_line 'export GOPATH=~/gopath' ~/.shinit_add +sudo apt-get -y install vim-pathogen +rm -rf ~/.vim/bundle/vim-go +git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go +ensure_line 'source ~/.vimrc_vimgo' ~/.vimrc_add +cat << EOF > ~/.vimrc_vimgo +" vim-go: Make vim-go run. +call pathogen#infect() +let g:go_disable_autoinstall = 0 +" vim-go: Highlight +let g:go_highlight_functions = 1 +let g:go_highlight_methods = 1 +let g:go_highlight_structs = 1 +let g:go_highlight_operators = 1 +let g:go_highlight_build_constraints = 1 +EOF