-
Notifications
You must be signed in to change notification settings - Fork 4
/
install.sh
executable file
·27 lines (24 loc) · 1.09 KB
/
install.sh
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
#!/usr/bin/env bash
CONFIG_DIR="$HOME/.config/nvim"
CONFIG_FILE="$HOME/.config/nvim/init.vim"
AUTOLOAD_DIR="$HOME/.config/nvim/autoload"
AUTOLOAD_FILE="$HOME/.config/nvim/autoload/spaceneovim.vim"
CACHE_DIR="$HOME/.cache/nvim"
# Backup exisiting configuration.
if [ -d "$CONFIG_DIR" ]; then
backup_time=$(date +'%Y-%m-%d.%H-%M-%S')
mv "$CONFIG_DIR" "$CONFIG_DIR.$backup_time.backup"
fi
# Create the neccessary directories, download the configuration files and launch
# Neovim.
mkdir -p "$CONFIG_DIR" \
&& mkdir -p "$CACHE_DIR" \
&& echo ">>> Downloading configuration file" \
&& curl -sSfL https://raw.githubusercontent.com/tehnix/spaceneovim/master/vimrc.sample.vim -o "$CONFIG_FILE" \
&& echo ">>> Creating autoload directory for spaceneovim" \
&& mkdir -p "$AUTOLOAD_DIR" \
&& echo ">>> Downloading spaceneovim core" \
&& curl -sSfL https://raw.githubusercontent.com/tehnix/spaceneovim/master/autoload/spaceneovim.vim -o "$AUTOLOAD_FILE" \
&& echo ">>> Launching nvim" \
&& nvim --cmd "let g:dotspaceneovim_do_not_run_bootstrap=1" +SpaceNeovimRunInstallProcess && nvim \
&& echo ">>> DONE!"