Sublime on my CLI
So working on my projects using Unx-based tools, I run Homebrew on my Mac. I get the best looking, slim & powerful laptop on Unx that comes as close to Linux as possible for my deployments.
I usually write in vi but occasionally like to use Sublime Text. So I am not a fan of intermixing CLI with GUI controls, with the exception of what I’m doing. ;-) (Hey, I’m human.) So I spun up some Bash alias on a function to do it on my Mac at the CLI.
Add this to your $HOME/.bashrc file:
runSublime() { /Applications/Sublime\ Text.app/Contents/MacOS/Sublime\ Text $1 2&>1 > /dev/null } alias sublime=runSublime
If you don't redirect stderr and stdout to /dev/null then your terminal will be filled with NS output garbaaj.
Now at the CLI, you simply type in:
~$ sublime /my/dir/to/sublime/with
Voila! You are now editing file in /my/dir/to/sublime/with.
Simple. Useful? Let me know.
ttfn,
/rob











