How to get code completion on Mac
You can do this with Note My, with no project to set up first. Here is how to use the suggestion list, what it will offer you, and what to do when nothing appears.
You are editing a file — a script, a config, a single source file that is not part of any project — and you want the editor to finish identifiers for you. A list of plausible completions, on demand, that inserts the right text when you accept it and leaves the rest of your document exactly as you left it.
That is what code suggestions in Note My are. You get the names already in your file, the standard functions, types and keywords of the language you are writing, and the paths of files around you — all on your Mac, with nothing to set up first.
Every suggestion comes from your own file, the language you are writing and the folders around you, and it all happens on your Mac. There is no account to create, nothing is uploaded, and your files never leave the machine.
Get the suggestion list to appear
-
Make sure the file has a language
Keywords, standard-library names and your own declarations follow the language of the document. Open a file from disk and that is already settled — our advanced language identifier picks the language for you, on your Mac, so you can start typing straight away. In a new untitled tab, look at the status bar's Identify pill: it shows the language in force, and one click sets a different one. It is worth a glance whenever the suggestions look wrong for the code in front of you.
One kind of suggestion never needs a language at all: the words already present in your document. Even a plain-text file will finish long identifiers you have typed before.
-
Type two or three characters
The list appears on its own as you type an identifier, and keeps up rather than flickering along behind you. Every extra character narrows it, so keep going and the row you want will rise.
You do not have to remember how a name starts. The letters you type only have to appear in order, not together and not at the beginning, so
prifindsprintfand also finds names where those three letters are spread out. -
Or force it with ⌃Space
Edit ▸ Auto-Complete opens the list at the caret on demand. This works even when suggest-while-typing has been switched off, and it works in very large documents where the list waits to be asked. If you prefer a quiet editor, turn the automatic popup off in Settings ▸ Code Suggestions and use this one key instead.
-
Accept with ⇥ or ↩
Both keys accept the highlighted row, and both are individually switchable — you can have Tab accept and Return insert a newline, or the reverse, or neither. Whichever you leave on, the list never steals your keyboard: any key it does not use for itself goes straight into your document, so you can type on through an open list.
What is actually in the list
Rows are grouped into labelled sections, so you can tell at a glance what you are about to insert — a standard library call, one of your own declarations, a keyword, a file path. Section headings appear only when the list holds more than one kind.
| Section | What you get | Worth knowing |
|---|---|---|
| Auto-import | A symbol, plus the import line needed to use it | Ready for Swift, Python, JavaScript and TypeScript. Type at least two characters. |
| Paths | Files and folders around you, one segment at a time | Type a /, or start in a place a path belongs. |
| Builtins | Standard functions and types, with signatures and documentation | Accepting one can lay out the argument list for you, ready to type over. |
| Document symbols | Declarations from the file you have open | Your own functions, types and variables, with no project set-up. |
| Keywords | The language's own keywords | Available for the code languages the app knows. |
| Words | Words already written in your document, nearest ones first | Offered even when the file has no code language. |
Smart tokens have an entrance of their own. Type {{ and the list offers tokens instead of identifiers. If none of them matches what you have typed, ordinary suggestions come back, so {{config still offers you identifiers.
Where a suggestion carries documentation, a description panel sits beside the list; rest on a row for a moment and its documentation comes up. It is the quickest way to check an argument order or a return type without leaving the line you are writing. The list never changes width under your hands, so the row you were aiming at stays where it was. If you prefer the narrow list on its own, documentation is a switch in Settings ▸ Code Suggestions.
Moving through the list
While the list is visible, these keys belong to it; everything else goes to your document.
| Key | Does |
|---|---|
| ↓ / ↑ | Next / previous row |
| ⌘↓ / ⌘↑ | Jump to the bottom / top of the list |
| Page Down / Page Up | Move five rows down / up |
| Home / End | First / last row |
| ⇥ or ↩ | Accept the highlighted row, if that key is enabled |
| ⌃M | Memorise the highlighted path without inserting it |
| ⎋ | Dismiss |
Getting to the row you want
The row you want is usually at or near the top, and typing another character or two brings it there faster than the arrow keys will. Type the name the way you would write it, capitals included, and the row you meant comes up to meet you. Save the arrow keys for the last step or two; for anything further down, another character is quicker.
Note My also remembers what you accept and offers it sooner next time you write in that language, so the calls you actually use start arriving first. It stays on your Mac, and you can wipe it from Settings ▸ Code Suggestions ▸ Learning ▸ Clear….
The highlight starts on the first row of the first section, so give it a glance before you press ↩. The row you meant may be a section further down, and one arrow key — or one more character — brings it under the highlight.
What happens when you accept
Accepting a row does more than paste a name, and one keystroke gets you all of it. If you change your mind, one ⌘Z takes the whole insertion back out again, including any import line that came with it.
- Arguments laid out for you. A standard function arrives with its argument list in place and the first argument selected, ready to be typed over. Press ⇥ for the next one.
- Brackets added for anything that is called, with the caret parked inside them. Accept a name where a bracket already follows and you get the name alone — never a doubled bracket to clean up.
- The choice is remembered on your Mac, for the language you are writing in, so the same name is quicker to reach next time.
- Any import line goes in at the top of the file, and your cursor stays exactly where you left it in the code.
Paths, and remembering the ones you reuse
Type a / where a path belongs and matching files and folders are offered, so you can walk in one segment at a time. It is the quickest way to get an import, a stylesheet link or a shell path exactly right.
A path you use repeatedly can be pinned: press ⌃M with it highlighted, or click the light-bulb beside it. A filled bulb means memorised, and a memorised path is then offered in every other document, not just this one. It is worth doing for the few files you touch in every project.
Both lists live on your Mac and both can be emptied whenever you want: Settings ▸ Code Suggestions ▸ Saved paths ▸ Forget… clears the memorised paths, and Settings ▸ Code Suggestions ▸ Learning ▸ Clear… clears what the app has learned from what you accept.
Signatures while you write a call
Completion tells you what to type; call tips tell you what goes inside the brackets. ⌃⇧Space — Edit ▸ Show Call Tip — shows the signature of the call you are inside, with the argument you are currently on highlighted, so you can see which one you are filling in without counting commas.
You get call tips for the standard functions of the languages the app knows, and for functions you have declared in the file you are editing, so a helper you wrote forty lines up can raise a call tip of its own. The highlight follows the argument you are on, so a call with several arguments stays readable while you fill it in, and your text is untouched until you type it yourself.
Suggestions in a very large file
Our large-file engine keeps huge logs, exports and generated source quick to open, scroll and type in, and suggestions stay one key away in all of them. Press ⌃Space and the list opens at the caret with the same sections, the same keys and the same behaviour when you accept a row.
Plenty of people come to prefer that rhythm everywhere — a quiet editor while the words are flowing, a full list the moment you ask for one. To work that way in every file, switch suggest-while-typing off in Settings ▸ Code Suggestions and let ⌃Space be the thing that opens the list.
Ways to make it fit how you work
Completion is at its best when it is set to the shape of your own habits, and every part of it is a switch you own:
- Choose which sources you want. Paths, builtins, document symbols, keywords and words each have their own switch in Settings ▸ Code Suggestions, and auto-import is enabled per language. Keep the ones that earn their place in the list and drop the rest.
- Choose when the list appears. Let it arrive as you type, or switch suggest-while-typing off and open it with ⌃Space at exactly the moment you want it.
- Choose which key accepts. Tab and Return are separate switches, so Return can stay a newline while Tab does the accepting — or the other way round, whichever your fingers already expect.
- Choose how much the list tells you. The documentation panel is a switch of its own: signatures and descriptions to hand while you write, or the narrow list on its own.
- Choose what it remembers. Memorised paths and what the app has learned from what you accept both live on your Mac, and both empty on request from Settings ▸ Code Suggestions.
Nothing here touches your text until you accept a row, and one ⌘Z undoes an insertion whole if you change your mind. You can leave every setting where it is for months and come back to them the day something starts to feel noisy.
Troubleshooting
Nothing appears while I type
Press ⌃Space. If the list opens on demand but never on its own, suggest-while-typing is switched off in Settings ▸ Code Suggestions, or the document is a very large one where the list waits to be asked. If nothing opens either way, check the language: the status bar's Identify pill shows what is in force, and one click sets it. Pick the language you are actually writing and colouring, completion, call tips and document symbols all arrive with it. In a document with no code language, the words already written in it are still offered, so a long name you have typed once will keep finishing itself.
The list closes while I am still typing
A list with nothing left to offer closes rather than sitting in front of you empty, which keeps the editor out of the way while you write. If you were expecting a row, delete a character or two and press ⌃Space again — a shorter fragment matches more, and the letters you type only have to appear in order.
↩ inserts a newline instead of accepting
Return-to-accept and Tab-to-accept are separate switches in Settings ▸ Code Suggestions. Turn Return on if you want it doing the accepting, or leave it doing what it has always done and let ⇥ take the row — a good many people prefer the two keys kept apart.
I want the import line as well as the name
Auto-import is ready for Swift, Python, JavaScript and TypeScript, and it starts offering once you have typed two characters. Look under the Auto-import heading in the list: accept a row from there and the import line goes in at the top of the file while your cursor stays exactly where it was in the code. Change your mind and one ⌘Z takes the name and the import out together. Auto-import is enabled per language, so you can have it in the languages you write most and leave the rest alone.
I would like the documentation panel beside the list
Switch documentation on in Settings ▸ Code Suggestions and the panel appears whenever a row has something to show. Standard functions and types carry their signatures and descriptions, so rest on one of those rows for a moment and the detail comes up next to the line you are writing — argument order and return type checked without leaving the caret.
I accepted the wrong row
One ⌘Z takes the whole insertion back out — the name, the brackets that came with it and any import line added at the top of the file — and leaves you where you were, ready to type another character or two and pick again. Nothing else in the document moves.
The same path costs me too many keystrokes
Highlight it in the list and press ⌃M, or click the light-bulb beside it. A filled bulb means memorised, and from then on that path is offered in every document you open rather than only this one. Settings ▸ Code Suggestions ▸ Saved paths ▸ Forget… empties the list again whenever you want a clean start.
Frequently asked questions
What is the keyboard shortcut for autocomplete on a Mac?
⌃Space — Edit ▸ Auto-Complete. It opens the suggestion list at the caret even when the automatic popup is switched off, and it still works in very large documents where the list waits to be asked.
Can I turn the popup off but keep it on demand?
Yes. Switch off suggest-while-typing in Settings ▸ Code Suggestions and the list will only ever appear when you press ⌃Space. Individual sources can be switched off too: paths, builtins, document symbols, keywords and words each have their own switch, and auto-import is enabled per language — so you can keep, say, paths and words while dropping keywords.
Why does typing "pri" match something that does not start with those letters?
The letters you type have to appear in order, but they do not have to be next to each other or at the beginning, so you can find a name you half remember. Names that do start with what you typed are offered well above coincidental middle-of-the-word matches, so printf still comes first.
Does Note My learn from what I accept?
Yes, and it all stays on your Mac. What you accept is remembered for the language you were writing in, and comes back nearer the top the next time, so the calls you reach for most start arriving first. Nothing is uploaded and there is no account. Clear it whenever you like from Settings ▸ Code Suggestions ▸ Learning ▸ Clear….
Will completion work in a plain text file?
Yes. Words already written in the document are always offered, whatever the file is, so a long name you have typed once will finish itself from then on. Give the document a code language from the status bar's Identify pill and keywords, standard-library names, declarations and auto-import join in as well.
Do suggestions slow down typing in a big file?
Typing and scrolling stay quick. Our large-file engine is built for documents far larger than most editors will open, and in the very biggest files the list waits for ⌃Space rather than appearing as you type — the same sections, the same keys, one keystroke away.