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.
`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
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:
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!
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.
To open a new finder window in the current directory in a terminal:
> 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.