]> gitweb.fluxo.info Git - utils-x11.git/commitdiff
Session: decouple vim from tmux session handling
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 5 Feb 2018 12:28:44 +0000 (10:28 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 5 Feb 2018 12:28:44 +0000 (10:28 -0200)
session

diff --git a/session b/session
index ce32171fa3994d4cf5a8720924e6ff9e3cfa290d..d18da1b45dc601fc6ae13e3c5057fe9f1a917946 100755 (executable)
--- a/session
+++ b/session
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Open a VIM + tmux session
+# Open a work session, which might consist on VIM, tmux, etc sessions.
 #
 
 # Parameters
@@ -14,17 +14,11 @@ if [ -z "$SESSION" ]; then
 fi
 
 # Check VIM session
-if [ ! -e "$HOME/.local/share/vim/sessions/$SESSION.vim" ]; then
-  echo "$BASENAME: no such vim session $SESSION"
-  exit 1
+if [ -e "$HOME/.local/share/vim/sessions/$SESSION.vim" ]; then
+  terminal vim -S $HOME/.local/share/vim/sessions/$SESSION.vim &
 fi
 
 # Check tmux session
-if [ ! -e "$HOME/.tmux/$SESSION" ]; then
-  echo "$BASENAME: no such tmux session $SESSION"
-  exit 1
+if [ -e "$HOME/.tmux/$SESSION" ]; then
+  terminal shell $SESSION &
 fi
-
-# Dispatch
-terminal shell $SESSION &
-terminal vim -S $HOME/.local/share/vim/sessions/$SESSION.vim &