Skip to content

Instantly share code, notes, and snippets.

@bradleyd
Created March 6, 2013 16:07
Show Gist options
  • Save bradleyd/5100400 to your computer and use it in GitHub Desktop.
Save bradleyd/5100400 to your computer and use it in GitHub Desktop.
launch scripts in new gnome-terminal
#!/bin/bash
# open files in vim in a spawned gnome-terminal
# This is a alternative to using gvim
# filename
file=$1
# check whether arg is populated
if [ -n "$file" ]
then
bname=$(basename $1)
else
bname="new file"
fi
# execute vim in a new gnome-terminal
gnome-terminal --tab --title="$bname" -e "bash -c \"vim $file; exec bash\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment