Files
nix-config/modules/packages/nano.org
T
phundrak 216065c4f2 refactor: change to litterate config
Configuration is now held by the `.org` files. All `.nix` files are
tangled from the org-mode files.
2026-10-08 15:18:56 +02:00

1.9 KiB
Raw Blame History

Nano

Nano

I mostly live in Emacs, but I still want a sane fallback editor for quick edits over SSH. Here’s the nixos.nano module.

{
  flake.modules.nixos.nano = {
    programs.nano = {
      <<enable-nano>>
      <<syntax-highlight>>
      <<nanorc>>
    };
  };
}

Enabling Nano

enable = true;

Configuration

First of all, let’s enable syntax highlighting. Nothing fancy here, the basics are enough.

syntaxHighlight = true;

A handful of nanorc settings make it behave a bit more like a modern editor.

Setting Why
tabsize 2 Two spaces per tab, matching how I indent code
autoindent Keep a new line at the same indentation as the one above it
atblanks Let soft-wrapped lines indent to match the line above, blanks too
linenumbers Show line numbers in the margin
smarthome Make Home jump to the first non-blank character, not column 0
softwrap Wrap long lines visually instead of running them off-screen
set tabsize 2
set autoindent
set atblanks
set linenumbers
set smarthome
set softwrap
nanorc = ''
  <<make-nanorc()>>
'';