26 lines
905 B
Makefile
26 lines
905 B
Makefile
|
SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||
|
TARGET_DIR := "~/.vim"
|
||
|
INSTALLED := $(shell command -v vim 1>&2 >/dev/null ; echo $$? )
|
||
|
|
||
|
install: | init update
|
||
|
|
||
|
init:
|
||
|
ifneq ($(INSTALLED), 0)
|
||
|
$(error Vim not installed)
|
||
|
endif
|
||
|
$(info => Setting up vim)
|
||
|
@ [ -e ~/.vim ] && echo " ~/.vim already exist. Skipping." || "ln -svf $(SRC_DIR) $(TARGET_DIR)"
|
||
|
@ [ -e ~/.vim ] && echo " ~/.vimrc already exist. Skipping." || "ln -svf $(TARGET_DIR)/vimrc ~/.vimrc"
|
||
|
|
||
|
update:
|
||
|
$(info => Updating vim)
|
||
|
@ curl -fsLo $(SRC_DIR)/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||
|
@ [ $(INSTALLED) -ne 0 ] || vim +PlugInstall +PlugUpdate +qall
|
||
|
|
||
|
remove:
|
||
|
@ [ -L ~/.vimrc ] && rm -f ~/.vimrc || echo "~/.vimrc is not a symbolic link. Skipping"
|
||
|
@ [ -L ~/.vim ] && rm -f ~/.vim || echo "~/.vim is not a symbolic link. Skipping"
|
||
|
|
||
|
|
||
|
.PHONY: install update init
|