Last Updated: February 25, 2016
·
2.209K
· jigsaw

How to open a file in Sublime Text 2 from the command line

I was using CotEditor the past, but it is using the Sublime all the way from met Sublime. Vim is when it is strong.

Edit .bashrc because I'm using bash.

alias sb='open -a Sublime\ Text\ 2'

Add this. And

source .bashrc

Then

cd some/project
sb .

Then the desired project opens in Sublime. Convenient!

Even the use to edit the a little file

sb some/script.js

Then the desired little file opens in Sublime. Convenient!!!

That is all.

昔は CotEditor を使っていたのですが、Sublime に出会ってからはずっと Sublime を使っています。強いられるときはVim。

bashを使っているので .bashrc を編集します。

alias sb='open -a Sublime\ Text\ 2'

を付け加えます。あとは、

source .bashrc

すると

cd some/project
sb .

するとスッと目的のプロジェクトが Sublime で開きます。便利!

ファイルをちょっと編集する用途でも

sb some/script.js

するとスッと目的のファイルが Sublime で開くので便利!

以上です。