-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
43 lines (33 loc) · 1.13 KB
/
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
38
39
40
41
42
43
SHELL = /bin/bash
vim := $(if $(shell which nvim),nvim,$(shell which vim))
vim_version := '${shell $(vim) --version}'
XDG_CACHE_HOME ?= $(HOME)/.cache
default: install
install: create-dirs update-plugins
update: update-plugins
upgrade: update
create-dirs:
@mkdir -vp "$(XDG_CACHE_HOME)/vim/"{backup,session,swap,tags,undo}
update-plugins:
$(vim) -V1 -es -i NONE -N --noplugin -u dot_config/nvim/config/init.vim \
-c "try | call dein#clear_state() | call dein#update() | finally | messages | qall! | endtry"
uninstall:
rm -rf "$(XDG_CACHE_HOME)/vim"
test:
ifeq ('$(vim)','nvim')
$(info Testing NVIM 0.4+...)
$(if $(shell echo "$(vim_version)" | egrep "NVIM v0\.[4-9]"),\
$(info OK),\
$(error .. You need Neovim 0.4.x or newer))
else
$(info Testing VIM 8.x...)
$(if $(shell echo "$(vim_version)" | egrep "VIM .* 8\."),\
$(info OK),\
$(error .. You need Vim 8.x))
$(info Testing +python3... )
$(if $(findstring +python3,$(vim_version)),\
$(info OK),\
$(error .. MISSING! Install Vim 8.x with "+python3" enabled))
endif
@echo All tests passed, hooray!
.PHONY: install create-dirs update-repo update-plugins uninstall test