home · contact · privacy
Add optional golang setup, and vimrc entensibility.
authorChristian Heller <c.heller@plomlompom.de>
Fri, 5 Feb 2016 23:44:14 +0000 (00:44 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 5 Feb 2016 23:44:14 +0000 (00:44 +0100)
dotfiles/minimal/vimrc
dotfiles/minimal/vimrc_add [new file with mode: 0644]
setup_go.sh [new file with mode: 0755]

index 0103b0a19b3d584197c824f83b2c9e8a4eefd404..485351cc5ab76d3f22dca797dee9760f6bdd19f5 100644 (file)
@@ -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 (file)
index 0000000..e69de29
diff --git a/setup_go.sh b/setup_go.sh
new file mode 100755 (executable)
index 0000000..fabdce8
--- /dev/null
@@ -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