dotfiles/vim/makefile
James Patrick 6c3787ef1b Refactored to use .ONESHELL
This makes it a hell of a lot simpler but will lose support for BSD
make. All effected machines are running gnu-make, so the cost benefit
ratio ways heavily in favor of doing this.
2020-03-09 13:37:50 -04:00

35 lines
846 B
Makefile

SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
TARGET_DIR := ~/.vim
PLUG_URL := https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
PLUG_PATH := $(SRC_DIR)/autoload/plug.vim
include ../lib/shared.mk
install: | init update
init:
if (( $$+commands[vim] )) ; then
$(report) header "Setting up vim"
$(mk_link) $(SRC_DIR) $(TARGET_DIR)
$(mk_link) $(SRC_DIR)/vimrc ~/.vimrc
else
$(report) warn "cannot find vim?"
fi
update:
if (( $$+commands[vim] )) ; then
$(report) header "Upgrading vim"
curl -fsLo $(PLUG_PATH) $(PLUG_URL) \
; $(report) "vim plug setup"
vim +PlugInstall +PlugUpdate +qall \
; $(report) "downloading/updating plugins"
else
$(report) warn "cannot find vim?"
fi
remove:
$(report) header "Removing vim config"
$(rm_link) ~/.vimrc
$(rm_link) $(TARGET_DIR)