Useful browser tips:
- Use Cmd+1,2,3,4..9 to switch between Chrome tabs.
- Cmd+9 will always go to the last tab, no matter how many you have.
- Cmd+Shift+[ and ] will jump left or right.
- Cmd+W will close a tab. Cmd+Shift+W will close all tabs (but not Chrome).
- Cmd+L to focus URL bar.
- Cmd+Option+I to open Dev Tools. Cmd+Shift+D to toggle it between two states (side-aligned is so good for resizing to test responsive breakpoints in front-end development).
- Cmd+Shift+T to reopen the last closed tab.
If you're running a macOS terminal command and want to make it a lower priority so it doesn't slow your computer down as much, prepend it with "nice -n 5 <command>".
Example:
nice -n 5 yarn test
The number can be -20
to 19
(default 0
). 19
is "nicest" (the lowest priority).
Hold Option
and click your WiFi icon to get your IP address along with the extended info.
Periodically check your globally installed npm
/yarn
packages and uninstall stuff.
npm list --global --depth 0
npm uninstall -g x
yarn global list
yarn global remove x
brew list
brew uninstall x
If you don't know what something is:
[npm|yarn|brew] info x
Pressing space
, alt
, or shift
will let you refine your screenshot selection as you do it when clicking Cmd+Shift+4.
You can configure what Spotlight searches to speed up the search and remove irrelevant results. Just go to System Settings → Siri & Spotlight → Search results.
[I'm turning off most of these](./macOS Settings.md).
Automator is super powerful. Here's a straightforward action you can configure.
Automate Mac setup: nicksp/dotfiles.
Review what folders your apps have access to in System Settings → Privacy & Security → Privacy → Files and Folders. Of particular importance are your Downloads and Desktop Folders, as you probably download bank statements and whatnot there. Include Terminal in this vetting.
Add symbols to your keyboard shortcuts.
Close Running Apps.
If you’re cycling through apps using Cmd-Tab, you can quit an app by hitting Q
when the app is highlighted in the switcher window, or hit H
to hide/show the app.
I often use the icon next to a title to drag & drop a file or folder somewhere else. But it requires that I hover over the title to see it.
Enable System Settings → Accessibility → Display → Show window title icons to keep the icons always visible.
Easy Volume and Brightness Control.
Hold Shift+Fn+Option + Vol/Brightness together to change the volume or brightness in small increments.
Command and click on a dock icon to open a Finder window with the app inside the folder it is in.
Hot Corners.
If you don't already use Hot Corners, they're worth checking out. You can set tasks that will happen when your mouse hovers in a specific corner, like launching Mission Control, showing the desktop, and more. Set them up in System Settings → Desktop & Dock → Hot Corners…. Here's how I set them up.
Advanced Hot Corners.
If you want to use Hot Corners but have found yourself accidentally activating features, hold down the Option key when setting up a Hot Corner. From there, the Hot Corner won't activate unless you're holding down the Option key.
Hide a Window.
To quickly hide a window on the desktop, just press Command + H. The app will disappear into the background, but you can get it back by clicking on the icon in the Dock or using Command + Tab.
Switch Between Multiple Desktops.
If you use multiple desktops, you can swap between them quickly by pressing the Control button and then either the left or the right arrow.
Rename Folders and Files.
If you Force Touch on a folder or file name, you can quickly rename it. Force Touch on a folder or file icon and you can see a preview of the file.
Activate Do Not Disturb Quickly.
If you hold the Option key and click on the Notification Center icon in the top right corner of your Mac's menu bar, you can activate Do Not Disturb mode.
Back-up existing Mac OS and applications settings.
In Finder, hold Option and click Go, and then select Library. In the Finder window that appears, open the Preferences folder, and make a copy of it. (You can do this by Option-dragging it to another folder).
Clean up node_modules
.
-
First, change directory to where you want to look for
node_modules
. -
Look for all the directories with
node_modules
and print the locations:find . -name "node_modules" -type d -prune -print | xargs du -chs
-
Above is showing you all of the
node_modules
inside the directory you moved into. You can delete these manually if you wanted but if you want to delete all of the ones displayed run the following command.
Caution
This process is irreversible!
find . -name "node_modules" -type d -prune -print -exec rm -rf '{}' \;
Apps management via Brewfile
.
- Dump current Brewfile:
brew bundle dump --file Brewfile.dump
- Make system match Brewfile:
brew bundle --force cleanup