Open Sublime Text from terminal
Handy shell script to open Sublime Text (or something else)
from terminal. Works in two modes:
- if no arguments passed - open new application window within current directory
- if argument passed:
* its new/existent file - open it in the current window
* its directory - open new window
Also you can use it even application not running without any outputs polluting terminal
#!/bin/bash
run_sublime () {
if pidof sublime > /dev/null; then
eval sublime $1
else
nohup sublime $1 > /dev/null 2>&1 &
fi
}
if [ -z "$@" ]; then
run_sublime '-n .'
else
run_sublime $@
fi
Written by Andrey Garbuz
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Sublime text
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#