-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup
executable file
·56 lines (46 loc) · 1.03 KB
/
setup
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
#!/usr/bin/bash
script_dir="$(dirname "$(realpath "$0")")"
# Install Neovim and dependencies
packages=(
neovim
nodejs
python3
python3-pip
stow
pipx
clang-format
clangd
ripgrep
)
if ! dpkg -s "${packages[@]}" &> /dev/null; then
sudo apt-get update && sudo apt-get install -y "${packages[@]}"
else
echo "All packages are already installed."
fi
sudo pipx install \
cmake-language-server
# Recursively creates symbolic links to nvim files in ~/ for .config set up
pushd $script_dir
echo "stowing dotfiles..."
stow -t $HOME nvim/
stow -t $HOME tmux/
popd
# Fix permissions
sudo chown -R $(id -u):$(id -g) $HOME/.local/share/
##### BASHRC #####
declare -a ALIASES=(
"alias nv='nvim'"
"alias v='nvim'"
)
bashrc_changed=0
for alias in "${ALIASES[@]}"; do
if [ $(cat ~/.bashrc | grep "$alias" | wc -l) -eq 0 ]; then
echo "Adding $alias to ~/.bashrc ..."
echo $alias >> ~/.bashrc
bashrc_changed=1
fi
done
if [ $bashrc_changed -eq 1 ]; then
echo "~/.bashrc was changed. Remember to run:"
echo "source ~/.bashrc"
fi