Comment by apocalyptic0n3

3 years ago

`open` is one I use all the time. I love that simple command.

    alias tab='open . -a iterm'
    alias phpstorm='open -a "PhpStorm"'
    alias smerge='open -a "Sublime Merge"'

etc. I use those more than I do the Open/Recents dialogs in the respective apps.

One flag also not mentioned is -n, which allows you to run the same application in more than one instance. Historically the single most used utility for me, though the number of applications that have had design problems bad enough to warrant it has gone down.

Sublime Text and Sublime Merge actually ship with these CLI utilities by default, which have some additional features:

    $ fd 's(merge|ubl)$' /Applications/Sublime*                                          
    /Applications/Sublime Merge.app/Contents/SharedSupport/bin/smerge
    /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl

  • I knew of (and use) `subl` but was unaware they provided their own `smerge`. I'll delete my own alias in favor of that. Thanks!

To open a new finder window in the current directory in a terminal:

    alias finder='open .'

> alias tab='open . -a iterm'

But if you just open a new tab, you'll be in the same $CWD in the new tab? Am I missing some trick here?

  • I forget that's an option. I really dislike that and prefer for new tabs to open in my home directory. So having my `tab` alias that I use a couple times a week and opening the other 100 tabs in my home directory fits my workflow.

  • In your iterm profile settings, you can configure new tabs to go to either $HOME, $CWD, or a fixed specific directory. I've configured new windows and tabs to $HOME, but new split panes $CWD.