Added vim-recover

This commit is contained in:
Thomas Forgione 2018-11-29 15:34:24 +01:00
parent 7a9474a413
commit 211ea5f862
No known key found for this signature in database
GPG Key ID: 203DAEA747F48F41
1 changed files with 17 additions and 0 deletions

View File

@ -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