forked from rstacruz/vimfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (28 loc) · 906 Bytes
/
Makefile
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
lockfile := ./bin/restore
vim := nvim
pwd := $(shell pwd -LP)
default: install
help:
@grep -h -E '^\"\"' plugin/*/*.vim plugin/*.vim | sort | sed 's/--/\t/g'
# Install into home directory
link: link-vim link-neovim
@if [ ! -d ~/.vim/vendor ]; then \
echo "\n\033[32;1m→ NOTE:\033[0m run ':PlugInstall' in Vim to install plugins."; \
echo " (alternatively, use 'make install')"; \
fi
link-vim:
ln -nfs "${pwd}" ~/.vim
ln -nfs "${pwd}/init.vim" ~/.vimrc
link-neovim:
mkdir -p ~/.config
ln -nfs "${pwd}" ~/.config/nvim
# Installs plugins, produces lockfile
install:
$(vim) +PlugInstall +PlugClean +"PlugSnapshot ${lockfile}" +qa
# Updates plugins, vim-plug, and show changes
upgrade:
$(vim) +PlugUpdate +PlugUpgrade +PlugClean +"PlugSnapshot ${lockfile}" +PlugDiff
# Install from lockfile
restore:
vim -S ${lockfile}
.PHONY: install link upgrade restore default link-vim link-neovim