Black Friday sale is now on! 50% off Laravel: The Modular Way. Learn more

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.

     

    Laravel Modules Book by David Carr

    Help support the blog so that I can continue creating new content!

    Subscribe to my newsletter

    Subscribe and get my books and product announcements.

    © 2009 - 2022 DC Blog. All code MIT license. All rights reserved.