diff --git a/zsh/functions.zsh b/zsh/functions.zsh index e88c794..dde85f2 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -89,6 +89,23 @@ makelatex() { cp /home/thomas/.script/classgen/Makefile.latex ./Makefile } +# Check recovery directory from vim +vim-recover() { + if [ -f $1 ]; then + echo >&2 Cannot recover an existing file... + return 1 + fi + + BACKUP_PATH=~/.vim/backups/`echo $PWD/$1 | tr '/' '%'` + + if [ ! -f "$BACKUP_PATH" ]; then + echo >&2 Backup not found... + return 2 + fi + + cp $BACKUP_PATH $1 +} + source $HOME/.config/dotfiles/zsh/update.zsh source $HOME/.config/dotfiles/zsh/gclone.zsh