-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·75 lines (61 loc) · 2.01 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·75 lines (61 loc) · 2.01 KB
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
#!/usr/bin/env bash
set -xeo pipefail
CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
ln -sf "$CUR_DIR/pkgs/bash/bashrc" ~/.bashrc
ln -sf "$CUR_DIR/pkgs/vim/vimrc" ~/.vimrc
ln -sf "$CUR_DIR/pkgs/tmux/tmux.conf" ~/.tmux.conf
ln -sf "$CUR_DIR/pkgs/bash/inputrc" ~/.inputrc
# oh-my-bash
ln -sfn "$CUR_DIR/submodules/oh-my-bash" ~/.oh-my-bash
set +x
source ~/.oh-my-bash/tools/upgrade.sh # Upgrade oh-my-bash
set -x
# VIM
if [[ ! -d ~/.vim/ftplugin ]]; then
mkdir -p ~/.vim/ftplugin
fi
for s in $(ls $CUR_DIR/pkgs/vim/.vim/ftplugin/*.*); do
ln -sfn "$s" ~/.vim/ftplugin
done
# Source bashrc to pickup changes
source ~/.bashrc
# Use exisiting .gitconfig if it exists
if [[ ! -f ~/.gitconfig ]]; then
ln -sf "$CUR_DIR/pkgs/git/gitconfig" ~/.gitconfig
fi
if [[ -e ~/.local/bin/ ]]; then
for s in $(ls $CUR_DIR/bin/*.*); do
ln -sf "$s" ~/.local/bin/
done
else
echo "WARN: '~/.local/bin' does not exist."
fi
# Ghostty
case "$(uname -s)" in
Linux*)
if [[ ! -f ~/.local/bin/ghostty/config ]]; then
ln -s $CUR_DIR/pkgs/ghostty/config ~/.local/bin/ghostty/config
fi
;;
Darwin*)
if [[ ! -f ~/Library/Application\ Support/com.mitchellh.ghostty/config ]]; then
ln -s $CUR_DIR/pkgs/ghostty/config ~/Library/Application\ Support/com.mitchellh.ghostty/config
fi
;;
*)
echo "WARN: Unknown OS. Skipping ghostty configuration setup."
;;
esac
# Install argonaut theme for ghostty
mkdir -p ~/.config/ghostty/themes && curl -sfL "https://ghostty-style.vercel.app/api/configs/5006be7b-b5c3-4caf-bd7c-1db48b1f35a8/download" > ~/.config/ghostty/themes/argonaut
# Download vim package manager
if [[ ! -f ~/.vim/autoload/plug.vim ]]; then
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi
# Uninstall all plugins not in vimrc
vim +'PlugClean' +qa
# Install all vim plugins
vim +'PlugPlugUpgrade --sync' +qa
vim +'PlugUpdate --sync' +qa
echo "Done!"