vim: make session optional

This commit is contained in:
2022-11-01 13:26:49 +00:00
parent dd447c5dd7
commit d8a3c36c28

25
bin/gv
View File

@@ -1,18 +1,23 @@
#!/bin/sh #!/bin/sh
PARENT_REPO=$(find-parent-repo)
if [ "$PARENT_REPO" == "" ] ; then if [ "$PARENT_REPO" == "" ] ; then
echo "You aren't in a git repository. Can't find an automatic name." PARENT_REPO=$(find-parent-repo)
exit 1 if [ "$PARENT_REPO" == "" ] ; then
echo "You aren't in a git repository. Can't find an automatic name."
exit 1
fi
fi fi
REPO_NAME=$(basename $PARENT_REPO) REPO_NAME=$(basename $PARENT_REPO)
if [ -r ${PARENT_REPO}/Session.vim ] ; then if [ -r ${PARENT_REPO}/Session.vim ] ; then
echo "Found ${PARENT_REPO}/Session.vim" if [ "$GV_NO_SESSION" != 1 ] ; then
if [ "$1" != "nosession" ] ; then echo "Found ${PARENT_REPO}/Session.vim"
echo "Restoring session" if [ "$1" != "nosession" ] ; then
SESSION="-S ${PARENT_REPO}/Session.vim" echo "Restoring session"
else SESSION="-S ${PARENT_REPO}/Session.vim"
echo "nosession given, not restoring." else
shift echo "nosession given, not restoring."
shift
fi
fi fi
fi fi