←back to thread

2039 points Gadiguibou | 10 comments | | HN request time: 1.08s | source | bottom
1. apocalyptic0n3 ◴[] No.36498002[source]
`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.
replies(6): >>36498084 #>>36498873 #>>36499022 #>>36499642 #>>36499746 #>>36504000 #
2. baliex ◴[] No.36498084[source]
To open a new finder window in the current directory in a terminal:

    alias finder='open .'
3. Kyuuketsuki ◴[] No.36498873[source]
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.
4. Sujeto ◴[] No.36499022[source]
I made a script to open files with rofi

https://github.com/davatorium/rofi

Looks like this:

https://i.imgur.com/Hm9TGeV.jpg

In a vscode terminal I just use the alias "o" and it opens that at the correct location, then I can navigate and pick a file to open in the editor.

5. movedx ◴[] No.36499642[source]
> 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?

replies(2): >>36499910 #>>36507329 #
6. jonpalmisc ◴[] No.36499746[source]
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
replies(1): >>36507257 #
7. andelink ◴[] No.36499910[source]
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.
8. varenc ◴[] No.36504000[source]
`open -a ...` tab completion has been horribly slow for years because Apple hasn’t updated their completion definition. I replied with a work around on this SO post: https://stackoverflow.com/a/63097652
9. apocalyptic0n3 ◴[] No.36507257[source]
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!
10. apocalyptic0n3 ◴[] No.36507329[source]
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.