-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnvim.sh
More file actions
executable file
·59 lines (47 loc) · 1.49 KB
/
Copy pathnvim.sh
File metadata and controls
executable file
·59 lines (47 loc) · 1.49 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
#!/usr/bin/env bash
# Exit if any command fails
set -e
. base
echosuccess "Setting up nvim..."
# Check if fzf is installed (needed for fzf.vim)
if ! command -v fzf > /dev/null; then
echowarn "fzf is not installed. Consider installing it for better search functionality:"
case "$OSID" in
ubuntu)
echowarn " sudo apt install fzf"
;;
arch)
echowarn " sudo pacman -S fzf"
;;
darwin)
echowarn " brew install fzf"
;;
esac
fi
# Check if ripgrep is installed (needed for :Rg command)
if ! command -v rg > /dev/null; then
echowarn "ripgrep is not installed. Consider installing it for better grep functionality:"
case "$OSID" in
ubuntu)
echowarn " sudo apt install ripgrep"
;;
arch)
echowarn " sudo pacman -S ripgrep"
;;
darwin)
echowarn " brew install ripgrep"
;;
esac
fi
# Install vim-plug
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
mkdir -p "$HOME/.config/nvim"
backup "$HOME/.config/nvim/init.vim"
cp nvim/init.vim "$HOME/.config/nvim/init.vim"
# Create undo directory for persistent undo
mkdir -p "$HOME/.config/nvim/undodir"
# Install all plugins
nvim +'PlugInstall --sync' +'Helptags' +qa
# Note: colorscheme is already set in init.vim, no need to append it
echook
echo