vim: make session optional
This commit is contained in:
5
bin/gv
5
bin/gv
@@ -1,11 +1,15 @@
|
||||
#!/bin/sh
|
||||
if [ "$PARENT_REPO" == "" ] ; then
|
||||
PARENT_REPO=$(find-parent-repo)
|
||||
if [ "$PARENT_REPO" == "" ] ; then
|
||||
echo "You aren't in a git repository. Can't find an automatic name."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
REPO_NAME=$(basename $PARENT_REPO)
|
||||
if [ -r ${PARENT_REPO}/Session.vim ] ; then
|
||||
if [ "$GV_NO_SESSION" != 1 ] ; then
|
||||
echo "Found ${PARENT_REPO}/Session.vim"
|
||||
if [ "$1" != "nosession" ] ; then
|
||||
echo "Restoring session"
|
||||
@@ -15,5 +19,6 @@ if [ -r ${PARENT_REPO}/Session.vim ] ; then
|
||||
shift
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
(cd $PARENT_REPO && gvim --servername $REPO_NAME $SESSION --remote "$*") ; cd $CURRENT_DIR
|
||||
|
||||
Reference in New Issue
Block a user