Skip to content

Commit 2a3fc32

Browse files
committed
update Makefile
1 parent bfafdaf commit 2a3fc32

File tree

4 files changed

+65
-45
lines changed

4 files changed

+65
-45
lines changed

Makefile

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
#------------------------------------------------
22
# Makefile for dotfile
3+
#
4+
# WARN: the dotfiles must in user home, depth 1
35
#------------------------------------------------
4-
#=> install or recover all dotfile to system
6+
#=> install dotfiles to system
57
define publish
6-
rsync -av \
7-
--exclude 'vim-install.sh'\
8-
--exclude 'preview.png'\
9-
--exclude '.gitignore'\
10-
--exclude '.git'\
11-
--exclude 'fugitive:'\
12-
--exclude 'README.md'\
13-
--exclude 'LICENSE'\
14-
--exclude 'Makefile'\
15-
./ ../
8+
rsync -av --exclude-from exclude.txt ./ ../
169
endef
1710

18-
#=> install vim dependens
19-
define installvim
11+
#=> push system updated files to dotfiles folder
12+
define push
13+
rsync -av --existing --exclude-from exclude.txt ../ ./
14+
endef
15+
16+
#=> install vim depends
17+
define ivim-depends
2018
# install depends
2119
sudo apt install curl git-core cmake python-dev
2220

@@ -35,15 +33,34 @@ define installvim
3533
vim +PlugInstall +qall
3634
endef
3735

36+
#=> install vim
37+
define ivim
38+
cp -f .vimrc ~/
39+
cp -f .vim-basic.vim ~/
40+
cp -f .vim-plugin.vim ~/
41+
vim +PlugInstall +qall
42+
endef
43+
3844
.PHONY: publish
3945
publish:
40-
echo "sync dotfiles folder to home folder"
46+
@echo "\033[38;5;2m""* sync dotfiles folder to home folder *""\033[0m"
4147
@$(publish)
4248

43-
all: ivim publish
49+
.PHONY: push
50+
push:
51+
@echo "\033[38;5;2m""* sync home folder to dotfiles folder *""\033[0m"
52+
@$(push)
53+
54+
.PHONY: ivim-depends
55+
ivim-depends:
56+
@echo "\033[38;5;2m""* install vim depends *""\033[0m"
57+
$(ivim-depends)
4458

4559
.PHONY: ivim
4660
ivim:
47-
echo "install vim dependens"
48-
$(installvim)
61+
@echo "\033[38;5;2m""* install vim *""\033[0m"
62+
$(ivim)
63+
64+
install: ivim-depends ivim install
65+
all: install
4966

README.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,42 @@
11
This is my vim, zsh, tmux, etc. files.
22
===
33
All dotfiles can be installed or recovered via Makefile commands simplely. See helps below.
4+
> WARN: the dotfiles must in user home, depth 1
5+
6+
## install
7+
```
8+
cd ~
9+
git clone https://github.com/liangguohuan/dotfiles
10+
cd dotfiles
11+
make all
12+
```
413

514
## Makefile commands
615
* `publish` (default command)
7-
install or recover all dotfile to system
16+
publish dotfiles to system
17+
* `push`
18+
push system updated files to dotfiles folder
19+
* `ivim-depends`
20+
install vim depends
821
* `ivim`
9-
install vim dependens
22+
install vim
23+
* `install`
24+
exec all Makefile commands
1025
* `all`
11-
ivim publish
26+
same as command `install`
1227

13-
## vim-install
28+
## vim install (only)
1429
vim-conf base on [amix/vimrc](https://github.com/amix/vimrc). But use [ junegunn/vim-plug ](https://github.com/junegunn/vim-plug) to manage vim plugins,
1530
and so many things to be changed, just get some helps from `amix/vimrc` and read the sources from files `.vim-basic.vim` & `.vim-plugins`
1631

1732
* ### install
1833

19-
- Step 1: clone the files, and use shell script `install.sh` to autoinsall.
20-
> Notice: it will overwrite the files '.vimrc', '.vim-basic', '.vim-plugins' if they exists in home fold `~`
34+
- Step 1: clone the files and install.
35+
> Notice: it will overwrite the files '.vimrc', '.vim-basic', '.vim-plugins' if they exists in home folder `~`
2136
2237
git clone https://github.com/liangguohuan/dotfiles
2338
cd dotfiles
24-
sh ./vim-install.sh
39+
make ivim
2540

2641
- Step 3: Test it, it might need something other program like (ack, ag, install-markdown-d).
2742

exclude.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
vim-install.sh
2+
preview.png
3+
.gitignore
4+
.git
5+
fugitive:
6+
README.md
7+
LICENSE
8+
Makefile
9+
exclude.txt

vim-install.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)