Text Wrangler and terminal command?

357 Views Asked by At

I was wondering how can I open a index.html file from terminal. For example, I know with sublime works like this:

sublime index.html

but for textWrangler? And in general, how can I find these commands like "sublime" for whatever program I chose. Thanks I am using OSX.

1

There are 1 best solutions below

0
Akinjide On

For TextWrangler access in terminal I use the open command:

# opens index.html in TextWrangler
open index.html -a 'TextWrangler'

# opens CWD in TextWrangler
open . -a 'TextWrangler'

# alternative, add alias for TextWrangler in .bashrc or .zshrc
alias code="open ${1: .} -a 'TextWrangler'"

# then open index.html or CWD (current working directory)
code index.html
code

Hope this helps.