-
Notifications
You must be signed in to change notification settings - Fork 36
/
Makefile
47 lines (37 loc) · 1.35 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
44
45
46
47
VIMI_DIR = ~/.vimi
VIMRC = .vimrc
VUNDLE_DIR = bundle/vundle
BACKUP_PREFIX = .vimi.bak
DOT_VIM = .vim
vimi: echostart bundle-install
@echo "\nVimi successfully installed.\nRun Vim and write something awesome."
echostart:
@echo "Start installing Vimi…\n"
bundle-install: symlinks vundle
-vim +BundleInstall +quitall
symlinks: backup
@ln -s $(VIMI_DIR)/$(VIMRC) ~/$(VIMRC) && \
ln -s $(VIMI_DIR)/$(DOT_VIM) ~/$(DOT_VIM) && \
echo "Create symlinks:\n~/$(VIMRC) -> $(VIMI_DIR)/$(VIMRC)\n~/$(DOT_VIM) -> $(VIMI_DIR)/$(DOT_VIM)\n"
backup: remove-prev-backup
@test ! -e ~/$(DOT_VIM) || \
(\
mv ~/$(DOT_VIM) ~/$(DOT_VIM)$(BACKUP_PREFIX); \
echo "Vimi makes backup of your current ~/$(DOT_VIM) directory to ~/$(DOT_VIM)$(BACKUP_PREFIX)\n" \
)
@test ! -e ~/.vimrc || \
( \
mv ~/$(VIMRC) ~/$(VIMRC)$(BACKUP_PREFIX); \
echo "Vimi makes backup of your current ~/$(VIMRC) to ~/$(VIMRC)$(BACKUP_PREFIX)\n" \
)
remove-prev-backup:
@test ! -e ~/$(DOT_VIM)$(BACKUP_PREFIX) || \
rm -fr ~/$(DOT_VIM)$(BACKUP_PREFIX)
@test ! -e ~/$(VIMRC)$(BACKUP_PREFIX) || \
rm -f ~/$(VIMRC)$(BACKUP_PREFIX)
vundle:
@test ! -e $(VIMI_DIR)/$(DOT_VIM)/$(VUNDLE_DIR) || \
rm -rf $(VIMI_DIR)/$(DOT_VIM)/$(VUNDLE_DIR)
@echo "Clone Vundle from github.com…"
@git clone https://github.com/VundleVim/Vundle.vim.git $(VIMI_DIR)/$(DOT_VIM)/$(VUNDLE_DIR) > /dev/null
@echo "Done.\n"