Developing on a mac¶
This page is under construction, please feel free to add a relevant section or subpage, For now I just need to mention homebrew because it's the preferred method for getting Meld.
Command Line Interface¶
The default app providing a CLI on macOS is Terminal. It's located in /Applications/Utilities/Terminal.app if you're looking for it in Finder, but the simplest way to get to it is to:
- press "command" + "space"
- in the resulting search box, type
Term- you should see the
Terminalapp as a top search result
- you should see the
- use the "down arrow" to highlight the
Terminalsearch result - press "return"
- you should now have a terminal window open
Shell¶
- iTerm2.app (Dr. Stewart uses this)
- honorable mentions
- Warp
- Hyper
echo $0¶
zsh is my shell.
There are many like it,
but this one is mine.
macOS started defaulting to zsh in like 10.15, seems fine.
Your shell probably has a few config files.
They are run at different times, and sometimes only some are run for certain kinds of shells.
In general, you most likely want to edit your .zshrc when you wish to modify the experience in the shell.
Most often, this is to change the things you can do on the command line, e.g. by adding new entries to your path, defining aliases or functions, adding completion for newly installed programs, or adding/updating environment variables.
Here's a few things in mine that you might like. Add some of your own if you think others could benefit (this is a wiki!)
# Preferred editor for remote and local sessions (respectively)
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='code --wait' # depends on https://code.visualstudio.com/docs/setup/mac#_launch-vs-code-from-the-command-line
fi
# run browsers from the command line
BROWSER=/Applications/Firefox.app/Contents/MacOS/firefox
google-chrome() {
open -a "Google Chrome" --args "$@"
}
Shell config managers¶
Shell Themes¶
- PowerLevel10k (Dr. Stewart uses this)
Homebrew¶
Homebrew is a package manager for macOS. Pretty much any developer software made for Linux (and much that's not) is available for install via Homebrew, and this installation is typically much simpler than alternatives, especially for developer tools.
Both installing Homebrew itself, as well as afterward using it to install other software are done via the command line.
Install Homebrew¶
On the command line, paste the command found at https://brew.sh/#install to install homebrew.
Install other packages via Homebrew¶
To install a package that's command-line-only, simply run:
brew install <package>- e.g.
brew install lolcat
- e.g.
To install a package that has a graphical user interface, simply run:
brew install --cask <package>- e.g.
brew install --cask meld
- e.g.
Stewart recommends you consider installing:
- Trash to be able to
trashfiles and directories from the command line (they'll go to the Trash of filesystem/GUI rather than just gone like withrm) - alt-tab
- curl
- dbeaver-community
- imagemagick
- git
- jq
- rectangle
- wget
Window Management¶
- Rectangle.app
- AltTab.app
- else?
Password Manager¶
- 1password (costs $)
- honorable mentions:
- BitWarden free and open source (for "basic")
Productivity/Else¶
- Alfred, especially because the (paid) powerpack has clipboard history (finally a free feature on Windows)
- s/o to Carlos on this cheaper clipboard history app called Clipsy
- FYI: Dr. Stewart who historically recommends the more expensive alfred powerpack for this feature hasn't tried Clipsy yet
- Bartender
- s/o to Carlos on this cheaper clipboard history app called Clipsy
HotKey Index¶
Text Navigation¶
In many apps, limited emacs hotkeys work.
There's another nice system: consider the following modifier key combos to be of increasing weight:
- Option + ...
- Cmd + ...
Then if you combine them with the arrow keys, then you can move:
- (no modifier only arrow key): one character horizontally or one line vertically
- Option + ...: up/down a section or paragraph or horizontally a word at a time
- Cmd + ...: beginning or end of the document or line
Then if you hold Shift while navigating any of those, you'll select text.
macOS¶
- On Windows they only have Alt + Tab (Quick window switcher, add Shift into the mix to cycle in the reverse direction)
- on a mac by default Cmd + Tab changes Apps and Cmd + ` switches between windows within an app
- If you use the Alt-Tab app recommended above, you can control some of this
- most apps on a mac have
- Cmd + ? (or to be more precise: Cmd + Shift + /) mapped to search that app's menu items. it's awesome. it basically means you just made almost all the features of most apps keyboard-accessible!
- the hotkey Cmd + , to open its settings/prefs. this was so convenient and following some patterns in other hotkeys,
- Dr. Stewart recommends you set up Cmd + Shift + , to open the macOS
System Settings. to do so:- click on the apple on the top left of your primary monitor in the Menu Bar and choose
System Settings... - scroll to choose
Keyboard - find and click the button that says
Keyboard Shortcuts... - find the section labeled
App Shortcuts, click the plus+button and enter these values:- Application:
All Applications - Menu title:
System Settings...(note: you must enter the 3 dots) - Keyboard shortcut: Cmd + Shift + ,
- Application:
- click on the apple on the top left of your primary monitor in the Menu Bar and choose
- Dr. Stewart recommends you set up Cmd + Shift + , to open the macOS
vscode¶
(see more in the docs)
- Cmd + Shift + P: DO EVERYTHING if you learn only one command it should be this bc then you start typing what you need to do and options come up
- Cmd + /: toggle comment for current line (or current selected lines)
- Cmd + P: open a file (so like press this command and then just type characters that are anywhere in the filename no matter how deep in the files currently in the explorer of vscode...)
- Cmd + D: (first highlight some text)
Add selection to next Find match- so like select some word or part of a word or long bunch of syntax, press the shortcut and the next instance of the currently selected text in the document will also be selected, repeat (if there's an odd one that gets added before the next one you wanted, subsequently pressing Cmd + K, Cmd + D will deselect the anomaly and select next [it's called `Move last selection to next Find match])
- delete current line: Cmd + Shift + K
- apple symbol found accidentally trying to do the above: Option + Shift + K
- add cursor up/down: Cmd + Option + Up/Down
Last modified: 2026-03-03 09:07 by Michael Stewart (115d76f)