Open current terminal directory in Sublime Text

David Carr

Development

Being able to open the current directory from terminal in Sublime Text is very useful, I’ve seen others do it and figured I’d find out. Turns out it’s very simple by placing the following command in your bash profile:

nano ~/.bash_profile

Command to open sublime text.

# Open sublime command
subl () {
   open -a "Sublime Text" $@
}

Then to open the current directory in Sublime Text:

subl .

//calling subl without any arguments will open sublime.

 

Copyright © 2006 - 2024 DC Blog - All rights reserved.