-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.sh
executable file
·43 lines (35 loc) · 1 KB
/
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
#!/usr/bin/env bash
set -e
source_dir="$(pwd)"
function symlink() {
source=$1
target=$2
if [[ -d $2 ]]; then
echo $target is a directory
echo backup $target
mv $target "$target-backup"
fi
echo "symlink $source to $target"
ln -sf $source $target
}
install_spaceship_theme() {
echo Install Spaceship theme!
export ZSH="$HOME/.oh-my-zsh"
if [[ -z "$ZSH_CUSTOM" ]]; then
export ZSH_CUSTOM="$ZSH/custom"
fi
git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1
ln -sf "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
}
# chsh $(which zsh)
for file in $(ls "$(pwd)/dot"); do
symlink "$source_dir/dot/$file" $HOME/.$file
done
# symlink config folder
config_dir=$HOME/.config
symlink "$source_dir/alacritty" $config_dir/alacritty
symlink "$source_dir/nvim" $config_dir/nvim
source $HOME/.zshrc
install_spaceship_theme
echo "install vim plugins"
nvim --headless +PlugInstall +qall