-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·162 lines (139 loc) · 4.19 KB
/
init.sh
File metadata and controls
executable file
·162 lines (139 loc) · 4.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#!/bin/bash
CWD=`pwd`
platform='unknown'
unamestr=`uname`
if [[ $unamestr == *Linux* ]]
then
platform='linux'
fi
if [[ $unamestr == *CYGWIN* ]]
then
platform='cygwin'
fi
# Add bash aliases
echo "Adding BASH Aliases"
cp -v .bashrc ~/
cp -v .bash_aliases ~/
cp -v .bash_env ~/
cp -v .screenrc ~/
if [ $platform == 'cygwin' ]; then
cp -v .vimperatorrc.local /cygdrive/c/Users/`whoami`/_vimperatorrc
else
cp -v .vimperatorrc.local ~/
fi
# Install Common Packages
echo "Installing Common Packages"
if [ $platform == 'linux' ]
then
sudo apt-get install astyle build-essential screen vim minicom wireshark git exuberant-ctags colormake
fi
if [ $platform == 'cygwin' ]
then
if [ ! -f /bin/apt-cyg ]; then
svn --force export http://apt-cyg.googlecode.com/svn/trunk/ /bin
chmod +x /bin/apt-cyg
fi
apt-cyg install automake autoconf gcc-g++ ctags curl vim git git-svn python python-setuptools screen astyle unzip patch
easy_install pip
pip install requests
# Install Colormake
curl https://raw.githubusercontent.com/pagekite/Colormake/master/colormake > /usr/bin/colormake
curl https://raw.githubusercontent.com/pagekite/Colormake/master/colormake.pl > /usr/bin/colormake.pl
chmod +x colormake
chmod +x colormake.pl
fi
if [ $platform == 'osx' ]
then
# Check if homebrew is installed, if not install it
if [ ! -f /usr/local/bin/brew ]; then
echo "Install Homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
echo "Updating Homebrew"
brew update
fi
brew install astyle
brew install ctags
brew install wget
brew install curl
brew install git
brew install git-svn
brew install vim
brew install screen
brew install minicom
brew install colormake
brew install astyle
fi
# Install Awesome VIMRC Script
if [ -d ~/.vim_runtime ]; then
# update the script
echo "Updating Ultimate .vimrc"
cd ~/.vim_runtime
git stash
git pull --rebase
git stash pop
python update_plugins.py
# echo "Applying patches"
# curl https://github.com/amix/vimrc/pull/60.patch | patch -p1
else
echo "Getting Ultimate .vimrc"
git clone git://github.com/amix/vimrc.git ~/.vim_runtime
sh ~/.vim_runtime/install_awesome_vimrc.sh
echo "Applying patches"
# cd ~/.vim_runtime
# curl https://github.com/amix/vimrc/pull/60.patch | patch -p1
fi
# Install more VIM Plugins
echo "Installing more plugins"
if [ ! -d ~/.vim_runtime/sources_non_forked/supertab ]; then
cd ~/.vim_runtime/sources_non_forked
git clone https://github.com/ervandew/supertab.git
else
cd ~/.vim_runtime/sources_non_forked/supertab
git pull
fi
if [ ! -d ~/.vim_runtime/sources_non_forked/rust.vim ]; then
cd ~/.vim_runtime/sources_non_forked
git clone https://github.com/rust-lang/rust.vim.git
else
cd ~/.vim_runtime/sources_non_forked/rust.vim
git pull
fi
if [ ! -d ~/.vim_runtime/sources_non_forked/vim-easygrep ]; then
cd ~/.vim_runtime/sources_non_forked
git clone https://github.com/dkprice/vim-easygrep.git
else
cd ~/.vim_runtime/sources_non_forked/vim-easygrep
git pull
fi
if [ ! -d ~/.vim_runtime/sources_non_forked/QFEnter ]; then
cd ~/.vim_runtime/sources_non_forked
git clone https://github.com/yssl/QFEnter
else
cd ~/.vim_runtime/sources_non_forked/QFEnter
git pull
fi
if [ ! -d ~/.vim_runtime/sources_non_forked/cvim ]; then
cd /tmp
wget http://www.vim.org/scripts/download_script.php?src_id=21803 -O cvim.zip
rm -rf cvim
unzip -d cvim cvim.zip
mv cvim ~/.vim_runtime/sources_non_forked
fi
if [ ! -d ~/.vim_runtime/sources_non_forked/hexman ]; then
mkdir -p ~/.vim_runtime/sources_non_forked/hexman/plugin
cd ~/.vim_runtime/sources_non_forked/hexman/plugin
wget http://www.vim.org/scripts/download_script.php?src_id=21365 -O hexman.vim
fi
# Setup vimdiff
echo "Setting vimdiff as git merge tool"
git config merge.tool vimdiff
git config merge.conflictstyle diff3
git config mergetool.prompt false
# Add custom VIM shortcuts
echo "Adding .vimrc shortcuts"
cd $CWD
cp -v my_configs.vim ~/.vim_runtime
# Reload environment
echo "Reloading the environment"
. ~/.bashrc