Added vim-recover
This commit is contained in:
parent
7a9474a413
commit
211ea5f862
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue