-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
路37 lines (29 loc) 路 887 Bytes
/
Copy pathinstall.sh
File metadata and controls
executable file
路37 lines (29 loc) 路 887 Bytes
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
#!/bin/bash
set -e
DOTFILES_DIR="$(cd "$(dirname "$0")" && pwd)"
echo "Installing dotfiles from $DOTFILES_DIR"
link_file() {
local src="$1"
local dest="$2"
echo "Linking $dest -> $src"
ln -sf "$src" "$dest"
}
# Symlink Bash
link_file "$DOTFILES_DIR/bashrc" "$HOME/.bashrc"
link_file "$DOTFILES_DIR/bash" "$HOME/.bash"
# Symlink Zsh
link_file "$DOTFILES_DIR/zshrc" "$HOME/.zshrc"
link_file "$DOTFILES_DIR/zsh" "$HOME/.zsh"
# Symlink Git Config
link_file "$DOTFILES_DIR/gitconfig" "$HOME/.gitconfig"
# Symlink Vim & Neovim Configs
mkdir -p "$HOME/.config"
link_file "$DOTFILES_DIR/nvimrc" "$HOME/.config/nvimrc"
link_file "$DOTFILES_DIR/nvim" "$HOME/.config/nvim"
link_file "$DOTFILES_DIR/vimrc" "$HOME/.vimrc"
link_file "$DOTFILES_DIR/vim" "$HOME/.vim"
# Install vim plugins
if [ -t 1 ]; then
echo "Installing Vim plugins..."
vim -Es -u ~/.vimrc +PlugInstall +qall
fi