logoalt Hacker News

Customize Nano Text Editor (2022)

164 pointsby shafiemoji10/25/202564 commentsview on HN

Comments

its_notjack11/04/2025

I must have used nano for years at this point, and I'm shocked to find out how customisable nano actually is! I tend to use micro[0] on most of my systems now just because it comes with really lovely defaults and keybindings that are a bit more familiar, but this might make me take a second look at nano in future.

[0] https://micro-editor.github.io/

show 3 replies
chawyehsu11/04/2025

It seems few people are aware of how customizable nano actually is. Usually, they use nano with the default preset for quick bootstrapping tasks and then switch to vim without hesitation. While vim/neovim are certainly very powerful, nano remains my go-to editor for many quick terminal operations. I've customized it quite a bit[1], especially the key bindings, though the defaults are already excellent.

[1]: https://github.com/chawyehsu/dotfiles/blob/main/.config/nano...

show 1 reply
p4bl011/04/2025

I tried a long time ago [1,2] to initiate this discussion on Nano here. I'm glad it's happening :).

[1] https://news.ycombinator.com/item?id=41289141

[2] https://news.ycombinator.com/item?id=41289773

sanex11/04/2025

Nano is my go-to whenever doing something quick in the terminal. It's quick, I don't need to learn how to use it, and now it's going to be slightly more convenient. I had no idea it had these options. Thank you!

show 1 reply
gorgoiler11/04/2025

Nano is quite a venerable piece of software with the initial implementation shipping as pico, the text editor for the pine mail client, back in 1992. Tens of thousands of students at a few universities will have been introduced to it as their very first email client.

The pine authors fell foul of the Debian free software guidelines and, as well as nano, a clone for the mail client itself lives on to this day as alpine. I use it every so often for a spot of nostalgia.

show 1 reply
iLoveOncall11/04/2025

If you're on Mac and can't get .nanorc to work, check out https://stackoverflow.com/a/73373788/3876196

It's also possible that you simply do NOT have nano installed at all, and just have the simlink from nano to pico by default. That was my case. In this situation, install nano and it should work.

positron2611/04/2025

Right after the nano maintainer got bullied out by the FSF, I noticed two bindings got their defaults changed. They never change. I almost feel like it was graffiti, a flex against the old maintainer, a retribution for not doing whatever the FSF wanted.

Since forever, GNU readline programs and nano had identical bindings. I'm fast moving around the CLI because I'm fast at nano. Emacs has the same defaults. What sane organization only abandons their own defaults and prioritizes that work after pushing the existing maintainer out (or irritating them enough to accomplish this)?

show 1 reply
jasperry11/04/2025

The line numbers and position bar are some real quality-of-life enhancements!

I don't regularly use nano anymore, but I have often thought that more programs should imitate the way it shows the command shortcuts on-screen as a kind of instant tutorial. I remember my physics major friends in college thinking it was pure snobbery for vi not to do that by default. Back then we were dialing in to an HP-UX server and using pico, which nano is an open-source clone of. For those who aren't aware, pico was originally the editor component of the Pine email client.

show 2 replies
thejbo11/04/2025

I actually prefer 'constantshow' instead of 'linenumbers'. That way if you want to select/copy some text from the terminal it doesn't include those line numbers.

notepad0x9011/04/2025

My struggle is that I work on lots of systems, sometimes ephemeral/temporary systems. There is no easy way to "sync" customizations, so I adapt to defaults.

Even basic things like how shell history is managed is very annoying to configure every single time. if only it was as simple as cloning your private github repo to ~/.config.

show 4 replies
SilentM6811/04/2025

Thank you, looking for way to set tab to 2 spaces for eons without success! Very helpful :)

dv35z11/04/2025

What would it take to have "vim-wiki" for nano (see also: FOAM, Obsidian)? I have always admired nano for how simple and easy to use it is, and would love to use it for wiki/obsidian-style note taking & linking...

show 1 reply
jdorfman11/04/2025

I’ve been using nano as my default bash profile editor for over 15 years. It’s also great for quick updates for other config files.

Definitely going to enable mouse support. Didn’t know that was possible.

Narishma11/04/2025

Is it possible to apply some of the settings like autoindent or line numbers only when editing source code? In other words, does it have different modes like emacs?

show 3 replies
tracker111/04/2025

Also worth a look, if you want more TUI..

https://github.com/microsoft/edit

spidermonkey2311/04/2025

I just did this for some of my setups recently, using the minibar and constantshow settings.easy to cut and paste without line numbers enabled too

kapitanjakc11/05/2025

10 years, I've been using nano as my editor.

10 years I've spent mastering the shortcuts.

I have been using nano in hard mode.

These configs will make my life so much easier.

nyc11111/05/2025

I use nano a lot but this page is not opening for me. Is someone else having the same problem?

show 1 reply
DoctorOetker11/05/2025

any sane advice on

1) integrating cscope with nano?

2) integrating exuberant ctags with nano?

3) integrating universal ctags with nano?

3) any sane advice on pattern matching (say find, or find and replace) where newlines, tabs etc can be part of query, part of the substitution?

reaperducer11/04/2025

Note that for the last few versions of macOS, "nano" is symlinked to pico.

haik9011/05/2025

nano is my go-to text editor, because it’s the default text editor for all our systems, but somehow I never customize it, until this post.

threatofrain11/04/2025

What about LSP?

wetpaws11/04/2025

[dead]

onita11/05/2025

[flagged]

akatsutki11/04/2025

better than vim

show 3 replies
Ekaros11/04/2025

Did you know Nano supports mouse? Alt+M... Not that I use that much, but it is fun fact.

show 1 reply