Mac text editor keyboard shortcuts
Every combination Note My really answers to, grouped the way its menus are grouped, with the context keys that go alongside them. The list, not a tour.
Most shortcut pages are generous with combinations and vague about which ones work. This one is the opposite. Everything below is a combination Note My really answers to on macOS, grouped the way the menus are grouped, so you can learn a menu at a time and trust every key you press.
The symbols are the standard Mac ones: ⌘ Command, ⌥ Option, ⇧ Shift, ⌃ Control, ⎋ Escape, ↩ Return.
File
The File menu carries the everyday set, plus a handful for tabs and for getting from a document back to the Finder.
| Keys | Command |
|---|---|
| ⌘N | New |
| ⌘O | Open… |
| ⇧⌘O | Open Anything as Text… |
| ⌘W | Close |
| ⇧⌘W | Close All Tabs |
| ⌘S | Save |
| ⇧⌘S | Save As… |
| ⌥⇧⌘S | Save a Copy As… |
| ⌃⌘D | Duplicate Tab |
| ⌘R | Reload from Disk |
| ⇧⌘R | Reveal in Finder |
| ⌥⇧⌘C | Copy Path |
| ⌘P | Print… |
| ⇧⌘P | Page Setup… |
Two of these behave in ways worth spelling out. ⇧⌘O opens a file as text whatever its type or extension says — a rotated log, a file with no extension, a dump. And ⇧⌘W is the bulk close that asks for confirmation once for the whole set, so a tidy-up between jobs takes one keystroke and one answer; four further bulk closes sit a right-click away on the tab bar, for when you want to clear some of the set rather than all of it.
The rest of the File menu — Rename File…, Duplicate File…, Open Containing Folder, Open With Default App, Open With…, Copy File Name, Copy Containing Folder Path and Move to Trash… — is a menu away, and each one acts on the file itself rather than on the text in front of you. Save a new tab once and the whole set comes alive for it, which makes the File menu a small file manager for the document you are already looking at.
Edit and completion
| Keys | Command |
|---|---|
| ⌘Z / ⇧⌘Z | Undo / Redo |
| ⌘X / ⌘C / ⌘V | Cut / Copy / Paste |
| ⌥⇧⌘V | Paste and Match Style |
| ⌘A | Select All |
| ⌃Space | Auto-Complete |
| ⌃⇧Space | Show Call Tip |
Paste is always plain text here, whichever of the two paste commands you use: styled text from a browser arrives as characters, never as formatting you then have to strip out.
⌃Space is the one to remember in a very large document. Our large-file engine keeps typing responsive there, and the shortcut puts suggestions under your hand the moment you want them.
The popup never takes keyboard focus, so you can keep typing straight through it. ⇥ and ↩ both accept a suggestion, and each of those two can be switched off independently, so the key that accepts a suggestion is the one you choose. ⌃⇧Space is the companion: it shows the call tip for the thing you are inside, which is the faster key when you know the name and want only the arguments.
Two ways to search, and when to use each
You have two ways to search a document, and knowing which is which makes both faster. One is a quick strip for a phrase you can see; the other is a full pop-over for the work you want to get exactly right.
⌘F opens the system find bar — the standard macOS text-finding strip, with ⌥⌘F for its replace variant and ⌘G / ⇧⌘G for next and previous. ⌘E takes the current selection as the search term and ⌘J scrolls back to it.
Our find and replace — the one with a This File / All Tabs scope, Case Sensitive, Whole Word and Regular Expression options, a live match count and Bookmark All — is a pop-over, and it opens from the magnifying-glass button in the toolbar. Reach for that button when the search matters: the live count tells you how many matches you have before you replace any of them, the scope segments decide whether you are working in this file or across every tab you have open, and the pattern options let you match a case, a whole word or an expression exactly. Like everything else here, it runs on your Mac — nothing is uploaded, there is no account, and the files never leave the machine.
Once the pop-over is open it has its own keys: ↩ steps to the next match, ⇧↩ steps back, ⎋ closes it.
Search
The Search menu carries most of the keys for moving around a document, and around a folder full of them.
| Keys | Command |
|---|---|
| ⇧⌘F | Find in Folder… |
| ⌘L | Go to Line… |
| ⌘F2 | Toggle Bookmark |
| F2 / ⇧F2 | Next / Previous Bookmark |
| ⌥⌘B | Bookmark All Search Matches |
| ⌥⌘E / ⌥⇧⌘E | Jump to Next / Previous Error |
⇧⌘F opens a separate window that searches every text file under a folder and lists what it finds grouped by file; double-click a result to open that file at that line. The window stays open while you work, so you can walk down the list at your own pace, opening one hit after another without losing your place. It only ever reads, so nothing under that folder is touched while you look — you can point it at a live project and know the files come back exactly as they were. When you do want to change something, open the files that matter and let our find and replace work across the tabs in front of you.
⌘L arrives pre-filled with the line you are on, selected, so it doubles as an answer to "where am I?". A number past the end of the document is refused rather than quietly clamped to the last line.
The error jumps stop at the next line carrying FATAL, CRITICAL, SEVERE, ERROR, WARNING or WARN, in any capitalisation, and carry on from the top once they reach the end of the file. In a long log that is the quickest way down to the lines worth reading. Count Matches sits in the same menu and reports "N matches on M lines" in a HUD, which is the quickest way to size a problem before you start on it.
Macros
| Keys | Command |
|---|---|
| ⌥⌘R | Start Recording |
| ⌥⇧⌘R | Stop Recording |
| ⌥⌘P | Playback |
| ⎋ | Cancel Playback |
While recording, a glass pill appears with a pulsing red dot, the words "Recording Macro" and a running action count, and the toolbar glyph flips to a red stop symbol. The count is your live confirmation: it rises as our macro recorder takes each step on board, and a short note tells you at once when a step wants recording by another route, so you learn that while you are still at the keyboard rather than at playback. Stop recording and the pill goes, the toolbar glyph returns to normal, and the macro is ready to play against the next document you open.
The Macro menu carries the rest. Playback Multiple Times… repeats a run as many times as you ask, the scope chooser decides how far it reaches, and Manage Macros… is where saved macros are named and kept. One ⌘Z after a run undoes the whole thing, however many actions it made, so you can try a macro on a real document and back out.
App, window and view
| Keys | Command |
|---|---|
| ⌘, | Settings… |
| ⌘? | Note My Help |
| ⌥⌘T | Show Toolbar |
| ⌃⌘F | Enter Full Screen |
| ⌘M | Minimize |
| ⌘Q | Quit |
The Settings window has fourteen panes, and the search field in its sidebar finds a setting by name across all of them — usually faster than remembering which pane it lives in. Two controls sit closer to the work instead, where you are most likely to want them: soft wrap is on the toolbar and the View menu, one click from the text it reflows, and everything our indentation engine does is gathered in the Indentation sheet.
Keys that work in context
These are the ones that pay you back once you know them. Each belongs to a particular place in the app and does its work the moment you are there.
- In the completion popup: ⇥ or ↩ accepts, the arrow, Page, Home and End keys move, ⎋ dismisses, and ⌃M memorises a path so it is offered next time.
- In a snippet: ⇥ jumps to the next
${N:default}placeholder. - In compare mode: hold ⇧ to mirror the scroll of both panes — it is a held key, not a mode you switch on — and press ⎋ to leave compare mode entirely.
- In the tab bar: ⌥-click the
+to Open rather than New, ⌃-click a tab for its context menu, double-click a tab name to rename it inline. - In the editor: double-click a brace to fold or unfold that block; double-click an identifier to highlight every occurrence of it.
- In menus: ⌥-click a saved template to reveal its Delete item, and ⌥-click a smart token to insert the literal
{{TOKEN}}instead of its expansion. - On the last page of the welcome carousel: ⌘T takes the toolbar tour.
Commands you reach by pointing
Some of the strongest tools in the app are a click away rather than a keystroke away, and they sit in the toolbar precisely because you want to see their settings as you use them. Learn where these live and the rest of the app opens up:
- Find & Replace. The magnifying-glass button opens the pop-over, with the This File / All Tabs scope, Case Sensitive, Whole Word and Regular Expression options, a live match count and Bookmark All in one place.
- Re-indentation. The Indentation sheet opens from the toolbar Indent button, where you choose what our indentation engine should do — and see the choice before you commit to it.
- Indentation guides. A toolbar toggle, with the ten styles chosen in Settings.
- Code folding. Double-click a brace to fold or unfold that block, with matching for curly brackets, parentheses and square brackets. Folding is a view of the file, so the file itself stays exactly as it was.
- Multi View and Single View, Wrap, Show Invisibles and Smart Edit. All toolbar controls, so the whole look of a document is under your thumb without leaving the text; wrap is also on the View menu.
- The Clean menu. Clean Now, Clean AI Copy/Paste Markers, Clean Invisible / Special Characters… and two items for stepping through hidden characters all live in one pull-down. Our cleanup rules and our hidden-character scanner do the work from there, so smart quotes, non-breaking spaces and the markers left behind by AI text are found and fixed — and nothing changes in your document until you choose an item.
- Compare. Compare Files… and Quick Compare are toolbar menu items. Our comparison view then puts the two files side by side with the differences marked, and ⇧ mirrors the scroll while you read down them.
Two keys worth learning well
⌘R brings the file back from disk
⌘R is Reload from Disk: the version saved on disk replaces what is in front of you, which is exactly what you want when a log has grown, a build has rewritten a config, or a colleague has saved over a file you are watching. It reads the file and never writes to it, so reloading never changes what is on disk. The habit to build is a two-key one — ⌘S, then ⌘R — so your own edits are safely on disk before the newer version arrives. Our auto-recovery safety net is there for an unexpected quit as well, so a document you were partway through comes back on the next launch.
Escape always cancels
⎋ is the app's universal way out, with no modifiers to remember. It closes the Find & Replace pop-over, dismisses the completion popup, leaves compare mode, and stops a macro playback at once from anywhere in the app, which is why Macro ▸ Cancel Playback stays available wherever you happen to be. Escape only ever closes and cancels; it never edits your text, so pressing it is always safe.
Two neighbours are worth a sentence, because they sit close to those keys and each does exactly one thing. ⌥⌘R always starts a macro recording, and ⌘P always opens the print dialogue. Learn those alongside ⌘R and the whole R-and-P corner of the keyboard becomes predictable.
Troubleshooting
I want to step through the hidden characters in a file
Open the Clean pull-down and choose one of the two navigation items there. They walk you from one hidden character to the next, so a stray non-breaking space or an invisible marker in a pasted paragraph is something you can see and land on rather than hunt for. Our hidden-character scanner finds them; the Clean menu is where you act on them.
⌘F opened a plain search strip, not the pop-over I expected
That is correct behaviour, and both are useful. ⌘F is the system find bar, the quickest route to a phrase you already know is there. For scope segments, a live count and regular expressions, click the magnifying glass in the toolbar to open our find and replace.
F2 is not reaching the app
The bookmark keys are literal function keys. If your keyboard's top row is configured to send hardware controls — brightness, volume — hold your keyboard's function modifier as you press them and they arrive as expected. ⌘F2 to set a bookmark, F2 and ⇧F2 to move between them.
Go to Line refused my number
Out-of-range and non-numeric input is refused rather than clamped, on purpose: typing 90,000 in a 9,000-line file beeps instead of silently sending you to the end. The sheet names the range it will accept — "Enter a line number between 1 and N" — and the Lines counter in the status bar carries the same total.
I meant to reload and started recording a macro
⌘R reloads; ⌥⌘R starts recording. If you see a glass pill with a pulsing red dot, you are recording — press ⌥⇧⌘R to stop.
Escape cancelled the wrong thing
Escape is available everywhere, so with two things open at once it may close the outer one first. Press ⎋ again, or click outside the pop-over, popup or sheet you wanted to close. Nothing is lost either way — Escape closes and cancels, it never edits your text.
Tuning what sits behind the keys
The combinations are the same on every Mac you sit down at, which is the point: the muscle memory you build here keeps working, on your machine and on anyone else's. What sits behind several of them is yours to tune, in Settings at ⌘,:
- Fourteen panes, one search field. General, Editing, Code Suggestions, Text Cleanup, Guides, Ruler, Invisibles, Encoding, Line Endings, File Monitor, Backup, Bookmarks, Macros and Print & Export. Type a word into the sidebar search and the setting comes to you.
- Make the completion keys yours. Code Suggestions decides what ⌃Space offers, and ⇥ and ↩ can each be switched off independently, so accepting a suggestion happens on the key you actually mean.
- Three ways to play a macro. ⌥⌘P from the keyboard, the Macro menu when you want the scope chooser, or the toolbar Macros pull-down when you want to see the list — and ⌘Z to step back out of a whole run.
- Toolbar first, by design. Find & Replace, re-indent, guides and folding are reached by pointing, because each of them shows you what it is about to do while you set it up.
Frequently asked questions
How do I open Find and Replace?
Click the magnifying-glass button in the toolbar. The pop-over gives you the This File / All Tabs scope, Case Sensitive, Whole Word and Regular Expression options, a live match count and Bookmark All. ⌘F opens the system find bar, which is the quicker route when you only want to find a phrase.
Where do I run a saved macro from?
⌥⌘P plays the current macro. The Macro menu adds Playback Multiple Times… and the scope chooser, and the toolbar Macros pull-down shows the saved list. A single ⌘Z undoes an entire run, so trying one on a real document costs you nothing.
How do I jump to a line number?
⌘L. The field is pre-filled with your current line and selected, so you can type over it immediately. A number beyond the end of the document is refused rather than clamped.
Is there a shortcut to search a whole folder?
⇧⌘F opens Find in Folder. It searches every text file under a folder you choose, with glob masks and a skip list to keep the results tight. It only ever reads, so the folder comes back exactly as it was. Open the files that matter from the results list and our find and replace handles the changes across your tabs.
How do I move between errors in a log?
⌥⌘E and ⌥⇧⌘E jump to the next and previous error. They stop at lines carrying the severity words FATAL, CRITICAL, SEVERE, ERROR, WARNING or WARN, in any capitalisation, and carry on from the top of the file once they reach the end.
How do I fold a block of code?
Double-click a brace to fold or unfold that block, with matching for curly brackets, parentheses and square brackets. It is a pointing gesture rather than a command, so it is as quick to undo as it is to do — and folding never changes the document or marks it as edited.