-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·126 lines (105 loc) · 3 KB
/
install.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/usr/bin/env bash
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$script_dir/__shared.sh"
source "$script_dir/configs/shells/__colors.sh"
base=`pwd`
function __link_file {
file1=${1}
file2=${2}
echo -e ""
ls -la --color=auto "${file2}"
rm "${file2}"
__print_action "Remove file: ${file2}"
__print_action "Link file: ${file1} => ${file2}"
ln -s "${file1}" "${file2}"
}
# ------------------------------------------------------------------------------
function __install_profile {
__print_title ".profile"
__link_file $base/configs/.profile ~/.profile
}
function __install_bash {
__print_title "Bash"
__link_file $base/configs/shells/bash/.bash_profile ~/.bash_profile
__link_file $base/configs/shells/bash/.bashrc ~/.bashrc
}
function __install_zsh {
__print_title "Zsh"
__link_file $base/configs/shells/zsh/.zprofile ~/.zprofile
__link_file $base/configs/shells/zsh/.zshrc ~/.zshrc
}
function __install_fish {
__print_title "Fish"
rm -rf ~/.config/fish
__link_file $base/configs/shells/fish/ ~/.config/fish
}
function __install_vim {
__print_title "Vim"
__link_file $base/configs/.vimrc ~/.vimrc
mkdir -p ~/.vim/bundle
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
# vim +PluginInstall +qall
echo | echo | vim +PluginInstall +qall &>/dev/null
}
function __install_git {
__print_title "Git"
__link_file $base/configs/git/.gitattributes ~/.gitattributes
__link_file $base/configs/git/.gitconfig ~/.gitconfig
__link_file $base/configs/git/.gitignore ~/.gitignore
}
function __install_tig {
__print_title "Tig"
__link_file $base/configs/.tigrc ~/.tigrc
}
function __install_tmux {
__print_title "Tmux"
__link_file $base/configs/.tmux.conf ~/.tmux.conf
}
function __install_vsc {
__print_title "Visual Studio Code"
path="$HOME/Library/Application Support/Code/User/"
if [ -d "${path}" ]; then
echo -e "Directory ${path} exists\n"
__link_file $base/configs/vsc/snippets/ "${path}snippets"
__link_file $base/configs/vsc/keybindings.json "${path}keybindings.json"
__link_file $base/configs/vsc/settings.json "${path}settings.json"
else
echo -e "Directory ${path} not exists"
fi
}
function __install_fzf {
__print_title "fzf"
__link_file $base/configs/.fzf.bash ~/.fzf.bash
__link_file $base/configs/.fzf.zsh ~/.fzf.zsh
}
function __install_fastfetch {
__print_title "fastfetch"
__link_file $base/configs/.config/fastfetch/ ~/.config/fastfetch
}
function __install_mc {
__print_title "mc"
__link_file $base/configs/.config/mc/ ~/.config/mc
}
function __install_btop {
__print_title "btop"
__link_file $base/configs/.config/btop/ ~/.config/btop
}
function __install_htop {
__print_title "htop"
__link_file $base/configs/.config/htop/ ~/.config/htop
}
echo -e "Install configs"
__install_profile
__install_bash
__install_zsh
__install_fish
__install_git
__install_vim
__install_tig
__install_tmux
__install_vsc
__install_fzf
__install_fastfetch
__install_mc
__install_btop
__install_htop