-
Notifications
You must be signed in to change notification settings - Fork 0
/
link.sh
executable file
·85 lines (66 loc) · 2.23 KB
/
link.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
#!/bin/sh
SCRIPT_DIR=$(cd $(dirname $0); pwd)
#nvim
if [ ! -f ~/.config/nvim/init.lua ]; then
echo "Neovim may not be installed/set up correctly"
cp -r $SCRIPT_DIR/config/nvim ~/.config/
fi
#vim
if [ ! -f ~/.vimrc ]; then
echo "Vim may not be installed/set up correctly."
echo "Creating a ~/.vimrc file"
touch ~/.vimrc
fi
if [ ! -f ~/.vim/plugins.vim ]; then
echo "Vim may not be installed/set up correctly. Trying to create a plugins.vim file"
mkdir -p ~/.vim/
echo "Creating a ~/.vim/plugins.vim file"
touch ~/.vim/plugins.vim
fi
ln -sf $SCRIPT_DIR/.vimrc ~/.vimrc
ln -sf $SCRIPT_DIR/plugins.vim ~/.vim/plugins.vim
#tmux
if [ ! -f ~/.tmux.conf ]; then
echo "tmux may not be installed/set up correctly. Trying to create a ~/.tmux.conf"
touch ~/.tmux.conf
fi
if [ ! -d ~/.tmux/plugins/tpm ]; then
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
echo "tpm installed"
fi
ln -sf $SCRIPT_DIR/config/.tmux.conf ~/.tmux.conf
#zsh
if [ ! -f ~/.zshrc ]; then
echo "zsh may not be installed/set up correctly"
echo "Creating ~/.zshrc now"
touch ~/.zshrc
echo "Created ~/.zshrc"
fi
if [ ! -d ~/.oh-my-zsh ]; then
echo "oh-my-zsh may not be installed/set up correctly. Installation will be attempted on sourcing ~/.zshrc"
fi
ln -sf $SCRIPT_DIR/.zshrc ~/.zshrc
ln -sf $SCRIPT_DIR/.zshrc-Darwin ~/.zshrc-Darwin
ln -sf $SCRIPT_DIR/.zshrc-Linux ~/.zshrc-Linux
#lepton
ln -sf $SCRIPT_DIR/config/.leptonrc ~/.leptonrc
#powerlevel10k
ln -sf $SCRIPT_DIR/config/.p10k.zsh ~/.p10k.zsh
#iTerm
if [ ! -d '/Applications/iTerm.app' ] && [ ! -d "$HOME/Applications/iTerm.app" ]; then
echo 'iTerm is not installed'
else
# Specify the preferences directory
defaults write com.googlecode.iterm2 PrefsCustomFolder -string "~/GitHub/dotfiles/config/"
# Tell iTerm2 to use the custom preferences in the directory
defaults write com.googlecode.iterm2 LoadPrefsFromCustomFolder -bool true
echo "iTerm Settings loaded from dotfiles repo"
fi
#Alacritty
if [ ! -d "$HOME/.config/alacritty" ]; then
mkdir -p ~/.config/alacritty
cp -r $SCRIPT_DIR/config/alacritty ~/.config
fi
ln -sf $SCRIPT_DIR/config/alacritty/alacritty.toml ~/.config/alacritty/alacritty.toml
#Zed
ln -sf $SCRIPT_DIR/config/zed.json ~/.config/zed/settings.json