-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·35 lines (29 loc) · 976 Bytes
/
install
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
#!/bin/sh
if [ -e $HOME/.config/nvim ]; then
echo "$HOME/.config/nvim already exists"
exit 1
fi
if [ -e $HOME/.local/share/nvim ]; then
echo "$HOME/.local/share/nvim already exists"
exit 1
fi
if [ $(type systemd-path >/dev/null) ]; then
NVIM_CONFIG_DIR=$(systemd-path user-configuration --suffix "/nvim")
NVIM_DATA_DIR=$(systemd-path user-shared --suffix "/nvim")
else
NVIM_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/nvim"
NVIM_DATA_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/nvim"
fi
ln -s $PWD/nvim "$NVIM_CONFIG_DIR"
mkdir -p "$NVIM_CONFIG_DIR/backup"
mkdir -p "$NVIM_CONFIG_DIR/tmp"
mkdir -p "$NVIM_CONFIG_DIR/view"
mkdir -p "$NVIM_CONFIG_DIR/local-config"
mkdir -p "$NVIM_CONFIG_DIR/tags"
mkdir -p "$NVIM_CONFIG_DIR/yankring"
mkdir -p "$NVIM_CONFIG_DIR/notes"
mkdir -p "$NVIM_CONFIG_DIR/local-snippets"
mkdir -p "$NVIM_CONFIG_DIR/spell"
mkdir -p "$NVIM_DATA_DIR/shada"
mkdir -p "$NVIM_DATA_DIR/undo"
mkdir -p "$NVIM_DATA_DIR/view"