dotfiles/vim/makefile
James Patrick f48d4370f0 reset term post vim upgrade to prevent.
Prior the terminal would go all funky. This is an attempt to fix it.
2020-05-28 13:29:19 -04:00

36 lines
910 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"
stty sane # dropping in & out causes some weird tty behavior.
else
$(report) warn "cannot find vim?"
fi
remove:
$(report) header "Removing vim config"
$(rm_link) ~/.vimrc
$(rm_link) $(TARGET_DIR)