WindowsmacOSLinux

Where Is the nano Config File?

nanorc paths for system, user and per-project nano settings.

Last updated

nano reads system nanorc first then user nanorc, with include chains pulling syntax files from shared directories. One user file overrides every box default at once.

Keep ~/.nanorc in dotfiles and symlink includes relatively. System upgrades overwrite /etc/nanorc without asking.

Where nano stores this, by platform

Windows
%USERPROFILE%\.nanorc

User overrides when nano runs under Git Bash or WSL profiles on Windows. System file varies by distribution method. Includes resolve relative to the file location.

macOS
~/.nanorc

Home overrides for system nano. Homebrew installs add example configs under the cellar; copy, never edit, them.

Linux
~/.nanorc

User config with set and include directives. System defaults live in /etc/nanorc with syntax files under /usr/share/nano. Validate with nano -D for debugging.

Frequently asked questions

System or user nanorc?

User files above win over /etc/nanorc. Put personal keybinds and syntax only in the user file.

Why is nano syntax highlighting missing?

Includes in the user file above point at moved syntax dirs. Fix paths to /usr/share/nano after distro upgrades.

Notice an outdated path? Let us know.