-
Notifications
You must be signed in to change notification settings - Fork 0
/
vim_config.sh
executable file
·75 lines (69 loc) · 1.97 KB
/
vim_config.sh
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
#!/bin/bash
dir=~/dotfiles
files=".vimrc"
# Install git
if ! which git > /dev/null; then
echo "Installing git..."
sudo apt-get install git
else
echo "Git already found in the system..."
fi
echo "Setting git global commit template..."
git config --global commit.template $dir/git_commit_template.txt
# Install vim
if ! which vim > /dev/null; then
echo "Installing vim..."
sudo apt-get install vim
else
echo "Vim already found in the system..."
fi
if [ -d "~/.vim" ] ; then
echo "Vim folder already present!"
else
echo "Creating vim folder"
sudo mkdir $HOME/.vim
fi
if [ -d "~/.vim/bundle" ] ; then
echo "Vim bundle folder already present!"
else
echo "Creating vim bundle folder..."
sudo mkdir $HOME/.vim/bundle
fi
# Change to dotfiles directory
cd $dir
for file in $files; do
echo "Creating symlink to $file in home directory..."
ln -s $dir/$file $HOME/$file
done
echo "Installing Vundle..."
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
echo "Installing molokai theme locally..."
git clone https://github.com/fatih/molokai.git
ln -s molokai/colors ~/.vim/colors
echo "Installing Vundle plugins..."
vim +PluginInstall +qall
echo "Compiling youCompleteMe package"
cd ~/.vim/bundle/youcompleteme
sudo ./install.py --all
echo "Finished installing dependencies!"
echo "Installing customized fonts for Vim..."
if [ -d "~/.fonts" ] ; then
echo "Fonts folder already present!"
else
echo "Creating fonts folder"
sudo mkdir $HOME/.fonts
fi
echo "Copying fonts file to fonts folder..."
sudo cp PowerlineSymbols.otf $HOME/.fonts/
sudo fc-cache -vf $HOME/.fonts/
if [ -d "~/.config/fontconfig" ] ; then
echo "Fonts config folder already present!"
else
echo "Creating fontsconfig folder"
sudo mkdir $HOME/.config/fontconfig
sudo mkdir $HOME/.config/fontconfig/conf.d
fi
sudo cp 10-powerline-symbols.conf $HOME/.config/fontconfig/conf.d/
echo "Setting Vim as default visual editor for all applications...."
export VISUAL=vim
export EDITOR="$VISUAL"