Explorar el Código

Make linkup verbose, simplify vim plugin install

This way, what it does it always printed.
Weiyi Lou hace 9 años
padre
commit
e9a6377fd0
Se han modificado 3 ficheros con 15 adiciones y 24 borrados
  1. 10 10
      Makefile
  2. 4 4
      bin/linkup
  3. 1 10
      install

+ 10 - 10
Makefile

@@ -46,34 +46,34 @@ rm-git:
 	git config --global --unset diff.mnemonicPrefix true
 
 zsh: submodules
-	./bin/linkup ~/dotfiles/zsh/zshenv ~/.zshenv
-	./bin/linkup ~/dotfiles/zsh/zshrc ~/.zshrc
+	@./bin/linkup ~/dotfiles/zsh/zshenv ~/.zshenv
+	@./bin/linkup ~/dotfiles/zsh/zshrc ~/.zshrc
 rm-zsh:
 	rm ~/.zshenv
 	rm ~/.zshrc
 
 tmux: submodules
-	./bin/linkup ~/dotfiles/tmux/tmux.conf ~/.tmux.conf
+	@./bin/linkup ~/dotfiles/tmux/tmux.conf ~/.tmux.conf
 rm-tmux:
 	rm ~/.tmux.conf
 
 ack:
-	./bin/linkup ~/dotfiles/ack/ackrc ~/.ackrc
+	@./bin/linkup ~/dotfiles/ack/ackrc ~/.ackrc
 rm-ack:
 	rm ~/.ackrc
 
 vimperator:
-	./bin/linkup ~/dotfiles/vimperator ~/.vimperator
-	./bin/linkup ~/dotfiles/vimperator/vimperatorrc ~/.vimperatorrc
+	@./bin/linkup ~/dotfiles/vimperator ~/.vimperator
+	@./bin/linkup ~/dotfiles/vimperator/vimperatorrc ~/.vimperatorrc
 rm-vimperator:
 	rm ~/.vimperator
 	rm ~/.vimperatorrc
 
 vim:
-	./bin/linkup ~/dotfiles/vim ~/.vim
-	./bin/linkup ~/dotfiles/vim/vimrc ~/.vimrc
-	./bin/linkup ~/dotfiles/vim $(XDG_CONFIG_HOME)/nvim
-	@vim -u ~/dotfiles/vim/plugins.vim -N +PlugClean! +PlugUpdate! +quitall!
+	@./bin/linkup ~/dotfiles/vim ~/.vim
+	@./bin/linkup ~/dotfiles/vim/vimrc ~/.vimrc
+	@./bin/linkup ~/dotfiles/vim $(XDG_CONFIG_HOME)/nvim
+	@vim +PlugClean! +PlugUpdate! +quitall!
 rm-vim:
 	rm ~/.vim
 	rm ~/.vimrc

+ 4 - 4
bin/linkup

@@ -7,8 +7,8 @@ IFS=$'\n\t'
 usage="Usage: ${0##*/} source_file target_file"
 src=${1:?$usage}
 tgt=${2:?$usage}
-backup=~/.backup
+bak=~/.backup
 
-[[ ! -d $backup ]] && mkdir $backup
-[[ -e "$tgt" ]] && mv "$tgt" "$backup/${tgt##*/}-$(date '+%Y-%m-%d-%H%M%S')" || true
-ln -sf "$src" "$tgt"
+[[ ! -d $bak ]] && mkdir $bak
+[[ -e "$tgt" ]] && mv -v "$tgt" "$bak/${tgt##*/}-$(date '+%Y%m%d-%H%M%S')" || true
+ln -sfv "$src" "$tgt"

+ 1 - 10
install

@@ -12,7 +12,6 @@ echo "Preparing."
 
 # Initialise submodules
 (cd ~/dotfiles && git submodule sync && git submodule update --init)
-echo "Submodules done."
 
 # Git config
 git config --global color.ui true
@@ -24,29 +23,21 @@ echo "Git config done."
 # Zsh
 ~/dotfiles/bin/linkup ~/dotfiles/zsh/zshenv ~/.zshenv
 ~/dotfiles/bin/linkup ~/dotfiles/zsh/zshrc ~/.zshrc
-echo "Zsh linked."
 
 # Tmux
 ~/dotfiles/bin/linkup ~/dotfiles/tmux/tmux.conf ~/.tmux.conf
-echo "Tmux linked."
 
 # Ack
 ~/dotfiles/bin/linkup ~/dotfiles/ack/ackrc ~/.ackrc
-echo "Ack linked."
 
 # Vimperator
 ~/dotfiles/bin/linkup ~/dotfiles/vimperator ~/.vimperator
 ~/dotfiles/bin/linkup ~/dotfiles/vimperator/vimperatorrc ~/.vimperatorrc
-echo "Vimperator linked."
 
 # Vim
 ~/dotfiles/bin/linkup ~/dotfiles/vim ~/.vim
 ~/dotfiles/bin/linkup ~/dotfiles/vim/vimrc ~/.vimrc
 ~/dotfiles/bin/linkup ~/dotfiles/vim $XDG_CONFIG_HOME/nvim
-echo "Vim linked."
-
-# vim-plug install process. Starts with plugin list and `nocompatible` flag.
-vim -u ~/dotfiles/vim/plugins.vim -N +PlugClean! +PlugUpdate! +quitall!
-echo "Vim plugins done."
+vim +PlugClean! +PlugUpdate! +quitall!
 
 echo "Install complete!"