Limits of nano's user-defined syntax highlighting persistence
0 reputation · 04 Mar 2025, 07:45 UTC
Goal: guarantee that a custom syntax definition placed in ~/.nanorc is consistently loaded and applied when editing matching files, without unintentional fallback to nano’s built‑in highlighting.
Constraints: nano does not emit error messages when a .nanorc file contains malformed syntax rules, instead silently reverting to default coloring; it is not documented which constructs cause this silent failure, nor whether certain combinations of keywords, colors, or patterns are unsupported. This uncertainty makes it difficult to trust that a user‑provided highlighting scheme is active.
What specific syntax errors or unsupported constructs cause nano to ignore a user‑defined rule without notification? How can a user confirm that a custom highlighting rule is being applied, aside from visual inspection of colors? Is there any mechanism to enable diagnostics or logging for nanorc parsing to detect silent failures?