-
-
Save bradleyd/5100400 to your computer and use it in GitHub Desktop.
launch scripts in new gnome-terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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