-
Notifications
You must be signed in to change notification settings - Fork 0
/
dotfiles.sh
executable file
·96 lines (73 loc) · 2.34 KB
/
dotfiles.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
#:------------------------------------------------------------------------------
#: Usage: ./debasics.sh
#: Purpose: My basic debian packages
#:------------------------------------------------------------------------------
# Obviusly inspired by jdavis
if [[ -d ~/.git ]]; then
echo "Oh my. It looks like you already have a Git repository in your home directory. You'll need to fix this before you install the dotfiles."
exit
fi
if [[ -d ~/dotfiles.old ]]; then
echo "Well, I was going to put all your old files into dotfiles.old, but it appears you already have a directory named that. Move it and try again... Please?"
exit
fi
hash git 2> /dev/null || {
echo "Oh dear. I require Git, but it's not installed."
exit
}
cd ~/
echo
echo "Initializing a blank repo..."
git init .
echo
echo "Adding dotfiles remote origin...."
# https://help.github.com/articles/adding-a-remote/
git remote add origin https://github.com/fenandosr/dotfiles.git
git remote -v
echo
echo "Fetching code..."
git fetch
echo
echo "Moving old dotfiles so we don't have a clash..."
mkdir dotfiles.old
git ls-tree --name-only origin/master | xargs mv '{}' dotfiles.old/ > /dev/null 2>&1
echo
echo "Checking out remote branch..."
git checkout -b master remotes/origin/master
#git pull origin master
echo
echo "Setting up submodules..."
git submodule init
git submodule update
builtin cd ~/.vim
git submodule init
git submodule update
echo
echo
echo "All old dotfiles were moved to dotfiles.old."
# install Vundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/vundle
echo
echo
echo "To install Vundle Bundles, run the command below:"
echo " vim +BundleInstall +qall"
# Fonts correctly
# https://github.com/vim-airline/vim-airline/wiki/FAQ
#sudo apt-get install fonts-powerline
# At last, install YCMD
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
echo
echo
echo "Dotfiles are now installed. Proceed to conquer the universe."
# Install antigen
# http://antigen.sharats.me/
curl -L git.io/antigen > antigen.zsh
chsh -s $(which zsh)
/usr/bin/env zsh
source ~/.zshrc
# less with source-highlighting
sudo mkdir --parents /usr/share/source-highlight/
sudo curl --output /usr/share/source-highlight/src-hilite-lesspipe.sh "https://raw.githubusercontent.com/n0ts/dotfiles/master/dot.source-highlight/src-hilite-lesspipe.sh"
# cambiar!