Skip to content

Commit 8adba5c

Browse files
authored
feat: delete old nvim config before cloning, fix on order
gitpod tmux script is the last step
1 parent d57fea0 commit 8adba5c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

setup.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,24 @@ else
2222
echo "tmux already installed!"
2323
fi
2424

25+
# remove any old nvim config
26+
rm -rf ~/.config/nvim
2527
# Clone Neovim configuration
2628
git clone --depth 1 https://github.com/daliendev/astro-nvim/ "$HOME/.config/nvim"
29+
# Install necessary LSP and plugins
30+
nvim --headless '+Lazy! sync' +qall
2731

2832
# Auto start tmux on SSH or xtermjs
2933
cat >>"$HOME/.bashrc" <<'EOF'
3034
if test ! -v TMUX && (test -v SSH_CONNECTION || test "$PPID" == "$(pgrep -f '/ide/xterm/bin/node /ide/xterm/index.cjs' | head -n1)"); then
3135
if ! tmux has-session 2>/dev/null; then
3236
# Create a new detached tmux session named "gitpod"
3337
tmux new-session -d -s gitpod -n "editor"
34-
# Send the Neovim command to the session, it will install necessary LSP and plugins
35-
tmux send-keys -t gitpod "nvim --headless '+Lazy! sync' +qall" C-m
3638
fi
3739
exec tmux attach
3840
fi
3941
EOF
4042

41-
# Download Gitpod Tmux Configuration
42-
curl -L "https://raw.githubusercontent.com/axonasif/gitpod.tmux/main/gitpod.tmux" --output ~/gitpod.tmux
43-
chmod +x ~/gitpod.tmux
44-
! grep -q 'gitpod.tmux' ~/.tmux.conf 2>/dev/null && echo "run-shell -b 'exec ~/gitpod.tmux'" >>~/.tmux.conf
45-
4643
# Install Nerd Font (JetBrainsMono Nerd Font) only if not already installed
4744
if ! fc-list | grep -qi "JetBrains Mono"; then
4845
curl -L https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/JetBrainsMono.zip -o ~/JetBrainsMono.zip
@@ -52,3 +49,8 @@ fi
5249

5350
# Set Nerd Font in .tmux.conf
5451
! grep -q 'Nerd Font' ~/.tmux.conf 2>/dev/null && echo "set-option -g default-terminal 'xterm-256color'" >>~/.tmux.conf
52+
53+
# Download Gitpod Tmux Configuration
54+
curl -L "https://raw.githubusercontent.com/axonasif/gitpod.tmux/main/gitpod.tmux" --output ~/gitpod.tmux
55+
chmod +x ~/gitpod.tmux
56+
! grep -q 'gitpod.tmux' ~/.tmux.conf 2>/dev/null && echo "run-shell -b 'exec ~/gitpod.tmux'" >>~/.tmux.conf

0 commit comments

Comments
 (0)