-
Notifications
You must be signed in to change notification settings - Fork 1
/
mydotfiles.sh
executable file
·104 lines (85 loc) · 2.32 KB
/
mydotfiles.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
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
#--------------------------------#
# backing up Existing dotfiles #
#--------------------------------#
clear
echo "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
echo "Backing your existing dotfiles (if any)"
echo "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
echo ""
echo ""
echo "Copying them to ~/.backupdotfiles"
mkdir ~/.backupdotfiles
cp ~/.bashrc ~/.backupdotfiles/bashrc
cp ~/.bash_profile ~/.backupdotfiles/bash_profile
cp ~/.zshrc ~/.backupdotfiles/zshrc
cp ~/.vimrc ~/.backupdotfiles/vimrc
cp ~/.vim ~/.backupdotfiles/vim
cp ~/.tmux.conf ~/.backupdotfiles/tmux.conf
cp ~/.gitconfig ~/.backupdotfiles/gitconfig
cp ~/.screenrc ~/.backupdotfiles/screenrc
cp ~/.hgrc ~/.backupdotfiles/hgrc
rm -f ~/.bashrc
rm -f ~/.bash_profile
rm -f ~/.hgrc
rm -rf ~/.vim
rm -f ~/.gitconfig
rm -f ~/.zshrc
rm -f ~/.vimrc
rm -f ~/.tmux.conf
rm -f ~/.screenrc
echo "Backup done"
sleep 1.5
clear
#-----------------------#
# Create the symlinks #
#-----------------------#
echo "^^^^^^^^^^^^^^^^^^^^^"
echo "Creating the Symlinks"
echo "^^^^^^^^^^^^^^^^^^^^^"
echo ""
# Vim
ln -s $HOME/dotfiles/vim $HOME/.vim
ln -s $HOME/dotfiles/vim/vimrc $HOME/.vimrc
# Bash
ln -s $HOME/dotfiles/bash/bash_profile $HOME/.bash_profile
ln -s $HOME/dotfiles/bash/bashrc $HOME/.bashrc
# Zsh
ln -s $HOME/dotfiles/zsh/zshrc $HOME/.zshrc
ln -s $HOME/dotfiles/zsh/prose.zsh-theme $HOME/dotfiles/zsh/oh-my-zsh/themes/prose.zsh-theme
# tmux
ln -s $HOME/dotfiles/tmux/tmux.conf $HOME/.tmux.conf
# GNU Screen
ln -s $HOME/dotfiles/gnu-screen/screenrc $HOME/.screenrc
# git
ln -s $HOME/dotfiles/git/gitconfig $HOME/.gitconfig
# mutt
# ln -s $HOME/dotfiles/mutt/muttrc $HOME/.muttrc
# Mercurial
ln -s $HOME/dotfiles/hg/hgrc $HOME/.hgrc
echo "Creating symlinks done"
sleep 1.5
clear
#------------------------------------#
# Update Vim plugin git submodules #
#------------------------------------#
echo "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
echo "Updating Vim Plugins via git submodules"
echo "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
echo ""
cd ~/dotfiles
git submodule init
git submodule update
echo "Vim Plugins are ready"
sleep 1.5
clear
echo ""
echo "If you get an error with git, install it and run again"
echo ""
echo "$ git submodule init"
echo "$ git submodule update"
echo ""
echo ""
echo "Your existing dotfiles were copied to ~/.backupdotfiles"
echo ""
echo "Enjoy!!"