How to autocomplete file paths on Mac
You can do this with Note My. It finishes a path as you type it, and lets you pin the folders you use everywhere so they are a couple of characters away.
Some paths you type once. Others you type forty times: the same src/main/resources/, the same scripts/deploy/, spread across a Dockerfile, a CI file and three imports. It is slow, and a typo in a path does not announce itself until something fails at run time.
Note My completes paths as you write them, and will memorise the ones you keep coming back to so they follow you into every other document. This guide covers what you will be offered, how to pin a path so it follows you, and how to keep the list tuned to the project in front of you.
What you will be offered
The list is built from two things you control: the paths in your own writing, and the ones you have chosen to keep. Everything else on this page follows from that.
There are two kinds of suggestion. The first comes from the document in front of you — the paths written in it, plus every folder along the way. So a single line containing config/staging/services/api.yaml quietly gives you config/, config/staging/ and config/staging/services/ as well as the file itself. Write a deep path once, and the shallower ones you need next are already there.
The second kind is your memorised list, covered below. Those follow you into every document you open.
That is what keeps it fast. The list is there the instant you ask for it, even on a slow external drive, and the more you write the more it has to hand you. It all happens on your Mac: nothing is uploaded, there is no account, and your files never leave the machine.
Paths are not the only thing the list offers. Language keywords, symbols from the document and plain words can appear in the same popup, kept apart under their own section headings, so you can see at a glance whether you are about to insert a path or an identifier.
Complete a path while you type
-
Start writing the path
Type the first
/, or start typing somewhere a path plainly belongs, and the suggestions arrive on their own.You can keep typing with the list open. Your keystrokes still go into the document, so the popup never interrupts you: ignore it and it goes away, glance at it and take what you need.
-
Narrow it down without typing the whole prefix
You do not have to type a path from its beginning. Scattered characters are enough:
cfsvapireachesconfig/staging/services/api.yaml, andprireachesprintfthe same way. Type the letters you remember, in the order they appear, and skip the ones you do not. Three or four are usually plenty, even in a document full of similar paths.A few rows are visible at a time and the rest are reached with the arrow keys. ⌘ with an arrow jumps to the top or bottom of the list, Page Up and Page Down move five rows at a time, and Home and End go to the ends.
-
Accept the one you want
⇥ and ↩ both accept the highlighted item, and each is separately switchable in Settings if you would rather only one of them did. ⎋ dismisses the list without inserting anything.
Take the wrong one and a single ⌘Z removes the whole insertion.
-
Call the list up whenever you want it
⌃Space is Auto-Complete. It opens the popup on demand — with suggest-while-typing on or off, in a short config file or a very large document — so you can type in silence and summon the list only when a long path is coming. Plenty of people work this way all day.
Memorise a path so it follows you
A path found in the current document is yours for as long as you are working in it. Pin one and it comes with you — into the next file, into next month's project, into every document you open from then on.
Two ways to pin. Click the light bulb beside a path suggestion in the popup, or press ⌃M with the path highlighted. The keystroke memorises the highlighted path without inserting it — worth knowing, because it means you can bank a path you have just noticed and carry on typing something else entirely.
A filled bulb means memorised. A hollow one means the suggestion is coming from the document you are in. One glance at the popup tells you which paths will follow you into tomorrow's file and which belong to today's, and the bulb is right there to promote any of them.
| Found in the document | Memorised | |
|---|---|---|
| Where it is offered | That document only | Every document |
| Light bulb | Hollow | Filled |
| Best for | A path you are using in this file today | A path you type in every project |
| How long it lasts | As long as the path is in the text | Until you clear the list |
| How it is cleared | Remove the path from the text | Settings ▸ Code Suggestions ▸ Saved paths ▸ Forget… |
Pin generously. The paths worth memorising are the ones you type without thinking — a deploy folder, a resources root, the log directory you always tail — and two or three characters bring any of them back.
How to read the order of the list
The order is not arbitrary, and knowing what to expect saves you reading every row.
Memorised paths sit above ones found only in the document you are working in, so a folder you have pinned is usually the first thing under your fingers. Below those come the paths from the document itself. In practice the row you want is the first or the second, and after a day of use you will stop reading past them.
Read to the end of a row rather than the start of it, since a folder and a long file inside it can begin with the same few characters. The whole path is written out on the row, so a glance settles which is which — and if you do take the wrong one, a single ⌘Z lifts the insertion straight back out.
The list also keeps up with the paths you actually pick, so the ones you use every day stay easy to reach and the rest stay out of the way. If that ever feels wrong — a finished project still crowding the top — clear what has been learned from Settings ▸ Code Suggestions ▸ Learning ▸ Clear…. That is separate from the saved path list, so clearing one leaves the other alone, and neither touches the paths written in your documents.
Path completion in your biggest files
Path completion comes with you into the largest documents you open. Our large-file engine keeps typing and scrolling smooth, and the popup arrives the moment you call for it with ⌃Space, so a generated file or a long log stays as quick under your hands as a short script.
Everything else is exactly where you left it. Your memorised paths are still at the top, the same handful of remembered letters still finds the row you want, and ⇥ still takes it. One keystroke opens the list in a vast generated file, and from there it behaves exactly as it does in a short shell script.
| If you want to | Do this |
|---|---|
| See suggestions in a very large file | Press ⌃Space |
| Keep a path for every document | Highlight it and press ⌃M |
| Use suggestions only on demand | Turn off suggest-while-typing |
| Keep paths, drop other suggestions | Settings ▸ Code Suggestions |
One habit helps more than any setting: in an unfamiliar project, paste a couple of key paths in early. Every folder along them is then a few keystrokes away.
Tune the list to the work in front of you
Path suggestions have their own switch, so the list can be exactly as busy as the job wants. Leave everything on and paths sit alongside language builtins, symbols from the document, keywords and plain word completion; set paths aside for an afternoon of prose and the rest carries on as it was. The controls live in Settings ▸ Code Suggestions, reached with ⌘,. The sidebar in that window has a search field, so typing "path" takes you straight to them.
The same pane holds the two acceptance switches for ⇥ and ↩, the call-tip switch, and the two clearing actions for saved paths and learned completions. Whatever you want completion to do differently, it is usually one switch away.
Getting a path into the document in the first place
Suggestions grow out of what you have written or pinned, so the quick ways to put a real path into a document are worth having at your fingertips.
- File ▸ Copy Path (⌥⇧⌘C) copies the full path of the file in the active tab. Copy File Name and Copy Containing Folder Path sit beside it for the other two things you usually want.
- The Finder extension. Right-click a file and the Note My submenu offers Copy Path and Copy Relative Path without opening the file at all.
- The identity item in the toolbar shows the saved file's path, and hovering it shows the path in full — a quick way to read where you are standing before you write a path relative to it.
Paste one of those in once, and every folder along it becomes a suggestion for the rest of that document. If it is a path you will want again next week, pin it with ⌃M at the same time.
Troubleshooting
Getting the list to appear when you type a slash
Three things bring it up. Code suggestions need to be on; path suggestions have their own switch in Settings ▸ Code Suggestions; and the cursor needs to be somewhere a path plainly belongs. In a very large document, ⌃Space calls the list up on the spot.
The list disappears when nothing matches what I typed
That is by design. When nothing matches, the popup steps aside and leaves you typing rather than sitting in the way with an empty row. Nothing has gone wrong: delete a character or two and the list comes straight back as soon as your letters match something.
Getting a folder you use often into the list
Introduce it once and it is yours. Paste or type the path into the document and every folder along it joins the list; highlight it and press ⌃M and it joins every other document too. From then on three or four characters bring it back.
An old path I no longer use keeps coming back
It is memorised. Start the list again from Settings ▸ Code Suggestions ▸ Saved paths ▸ Forget…, then pin the handful you still reach for as you meet them — a minute's work, and the top of the popup is sharp again for the project you are on now. If the path was never memorised, it is written somewhere in the document, and the suggestion goes when the text does.
⇥ inserts a tab character instead of accepting
Tab acceptance is a switch, and it can be off. Turn it back on in Settings ▸ Code Suggestions, or use ↩ instead. Note that ⇥ is also the key that jumps between snippet placeholders, so inside an expanded template it is doing that job rather than accepting anything.
The path completed, but the folder has since been renamed
Completion hands back exactly what you wrote or pinned, which is what keeps typos out of the paths you write: the spelling you get is the spelling you approved. When a folder moves, correct the path once in the text and the corrected one is what you are offered from then on — and if you had pinned the old one, clear the saved list and pin the new one with ⌃M while it is under the cursor.
Six ways to save more keystrokes
- Pin the three you type most. The deploy folder, the resources root, the log directory you always tail. Those three earn their place faster than anything else here, and they are ready in every document you open.
- Write the deepest path first. A single long path hands you every folder along it, so the shallower ones you reach for next are waiting before you need them.
- Type the consonants. Scattered characters are enough, so
scdpis a fair way to ask forscripts/deploy/. Aim for the letters that make the path distinctive rather than the ones at the front. - Bank a path without breaking your line. ⌃M memorises the highlighted path and inserts nothing, so you can notice a good path mid-sentence, keep it, and carry on writing whatever you were writing.
- Ask rather than wait. ⌃Space calls the list up whenever you want it — in a huge generated file, or as your everyday way of working if you would rather type in silence and summon suggestions on demand.
- Keep the top rows honest. When a project finishes, clear the learned completions from Settings ▸ Code Suggestions ▸ Learning ▸ Clear… and let the next project's paths rise. Your documents are untouched by it either way.
Together those turn a path you used to retype into two or three characters and a ⇥, in the config file, the Dockerfile and every import that mentions it.
Frequently asked questions
Does path completion work in any file type, or only in code?
Any file you open. A path in a plain-text note, a config file, a Dockerfile or a shell script is completed just as it is in source code, and memorised paths come with you into all of them.
Does it complete relative paths as well as absolute ones?
Both, and in the same breath. Whichever form your document uses, that form and the folders along it are what you are offered, and what you accept arrives exactly as you wrote it — completion never reshapes a path behind your back.
How many paths can I memorise?
Pin as freely as you like — a working lifetime of project roots, deploy folders and log directories sits comfortably in the saved list. Keep every path you genuinely reuse, and let the document in front of you supply the rest.
How quickly can I get back to a memorised path?
In two or three characters. Memorised paths sit at the top of the suggestion list in every document, and you only type the letters you remember, in the order they appear — so the path itself becomes the shortcut. There is one key to learn, ⌃M, and the ordinary list does the rest.
Are my saved paths sent anywhere?
They stay with you. It all happens on your Mac: nothing is uploaded, there is no account to create, and your files never leave the machine. Your saved paths live with the rest of Note My's settings on your own computer, ready in every document you open there.
Can I insert the current file's name into the text automatically?
Yes, through smart tokens rather than completion. {{FILENAME}}, {{FILEBASE}} and {{PROJECT}} are among the tokens our template library offers from the Templates menu, and Expand Smart Tokens in Document fills them all in at once.