Northern Commander

Your files

The files that hold what you set up. Each is changed on a screen of its own, and each is an ordinary file you can edit by hand, copy to another Mac or hand to someone.

File Holds Changed with Read Schema
settings.json Every setting Settings… As the application starts settings
key-bindings.json Only the keys you changed Key bindings… As the application starts key-bindings
favourites.json Your favorite places, in number order Edit favorites…, ⌘D Each time they are shown favorites
user-menu.json Your own commands, in menu order Edit the user menu… Each time the menu opens user-menu
searches/ Saved searches, a .ncsearch file each Save on the search form Each time they are listed —

All are in ~/.northern-commander/. Every change made on a screen is written at once; for the settings, that is what Write settings decides.

settings.json

Every setting, one a line, whether or not you changed it. It has a page of its own: The settings file — what is in it, editing it, when it is written, and what a value it cannot use does. What each setting does is under Settings.

  • Read as the application starts, so a change made by hand counts from the next start.
  • A save writes only the settings that run changed, so one you edited by hand while it ran keeps what you wrote.
  • A value it cannot use costs that one setting, which stays at its default.
  • A file that is not JSON at all leaves every setting at its default and is never written over: the next start moves it beside itself as settings.unreadable-<date>-<time>.json and tells you where.

key-bindings.json

The keys you changed on the Key bindings screen — only those, so a new version’s keys still arrive for everything else. How a key is written, and every command’s id: Key bindings.

{
  "rename": "F12",
  "go-to-folder": ["Cmd+G", "Cmd+Shift+G"],
  "delete-permanently": []
}
  • Read as the application starts, so a change made by hand counts from the next start.
  • The screen writes the file as each change is made, and writes only the command you changed: the rest stays as you left it, even edited while the application is open.
  • A key it cannot read is left out, and the log says so. A command left with none it can read keeps its usual keys. What could not be read stays in the file as you wrote it.
  • A file that is not JSON leaves every key as it ships and is never written over: the next start moves it beside itself as key-bindings.unreadable-<date>-<time>.json and tells you where.
  • A command this version does not know — one a newer version added — is kept and written back.

favourites.json

Your favorite places, in the order the list shows them: the first nine are reached by their number.

{
  "version": 1,
  "favourites": [
    { "name": "Projects", "location": "/Users/you/Projects" },
    { "name": "Disks", "location": "/", "provider": "volumes" }
  ]
}
name
What the list calls it. Required.
location
Where it leads. Required. Nothing checks it is there until you go.
provider
What kind of list it is — volumes for the list of disks. Left out for a folder.

Read again each time the list is shown or a number is pressed, so a hand edit counts at once. The form and ⌘D write the whole list as each change is made. Going there, adding and editing: Going places.

user-menu.json

Your commands, in the order the menu shows them. Every field, with an example: The user menu.

Read again each time the menu or its form opens, so a hand edit counts at once. The form writes the whole list as each change is made.

Favorites and the user menu, edited by hand

The two files are read and written on the same terms:

  • An entry the application cannot read is left out — a favorite with no name or location, a command with no label or command — and the log says so.
  • A file holding one is never written over. A change on the form, or ⌘D, is refused with the reason, and your file stays as you wrote it until you mend it.
  • A file that is not JSON at all reads as an empty list, and is not written over either: a change on the form is refused, naming the line where the JSON goes wrong. The next start moves it beside itself as favourites.unreadable-<date>-<time>.json (user-menu.… for the menu) and tells you where, so the list can be written again.
  • A whenSelected the application does not know — misspelled, say — asks for confirmation, so a mistake never runs a command unasked.
  • Anything beside the list is kept, $schema included, and written back as it was.

Saved searches

Each saved search is a file in ~/.northern-commander/searches/, <name>.ncsearch: the file’s name is the search’s name, so renaming the file renames the search. It holds what you asked, never what it found. Copy one anywhere: Enter on a .ncsearch file runs it, wherever it is. Saving, running and opening them: Finding files.

  • A file that is not JSON is listed grayed, as cannot be read.
  • A criterion it cannot read costs that criterion alone.
  • Save on the form writes the whole file, beside itself and then moved into place. A key in the file that this version does not write — one added by a newer version, or by you — is kept.
What a .ncsearch file holds

JSON, with each box of the search form written as you would type it there.

Key On the form
where Where — . for wherever the pane is when it runs
name, nameIs Name matches, and wildcard or regex
lookFor Look for: files, directories or both
containing, containingIs Containing, and text, regex or bytes
matchCase, wholeWords Match case, Whole words
notContaining true for Inside: does not contain
encoding Encoding: detected, utf-8, utf-16le, utf-16be or latin-1
size, modified, created, accessed The boxes of those names, such as >1M or <7d
skipDirs, skipDirsIs Skip dirs, and wildcard or regex
skipHidden Skip hidden files and directories
subdirectories, depth Search in subdirectories, and Depth — 0 is as far as there is
followLinks Follow links
inArchives Also look for the text in file names inside archives
readOnly Read-only: yes, no or either

An age such as <7d is counted from when the search runs, not when it was saved.

Checking a file in an editor

Each JSON file’s schema — linked in the table at the top — says what every key means and the values it takes. For your editor to check the file and complete it as you type, add a $schema line naming it:

{
  "$schema": "https://northerncommander.com/schemas/key-bindings.schema.json",
  "rename": "F12"
}

The application keeps the line. Or tie the schema to the file in your editor’s own settings — in Visual Studio Code, under json.schemas.

Moving them to another Mac

Copy the files into ~/.northern-commander/ there with the application closed, or take a backup — one zip holding all of them, the histories and where you left off — and restore it there.