Live data from Hacker News

Customize Nano Text Editor (2022)

shafi.ddns.net

61–69 of 69 posts

Re: Customize Nano Text Editor (2022)

#61
post #7

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 usin…

Absolutely, the shortcut help is so useful! I believe that Nano and Pico copied it from Wordstar.

That seems very likely. One of the first things I'd noticed back in the early 90s when I got my shell account and used Pico for the first time was that the UI was similar (not exact copy, mind you) of how Wordstar was, with some basic guidance at the bottom to get you started.

Also kind of reminds me of the old Telix terminal software for MS-DOS, with the bottom status bar. Not exactly the same, but again quite similar in the approach to have you just quick glance at the bottom of your screen for a HUD.

Re: Customize Nano Text Editor (2022)

#63
post #33

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.

Check out Chezmoi ( https://chezmoi.io ). They even offer a nice comparison table for alternatives.

Thank you, first hearing of that tool. it might be exactly what I want.

Re: Customize Nano Text Editor (2022)

#64
post #56

Earlier quoted context omitted.

It's not just customisable, it's also insanely scriptable. Any action that you can do in nano itself corresponds to a command, and you can create "string macros" that you can bind to key combinations. Additionally it can execute external commands on any nano buffer and return the result. Combining the two is very powerful. E.g. I have a configuration which allows me to use nano while editing pdf side-by-side, and be…

Interesting. Since this kind of scriptable customization sounds like bread & butter emacs -- what tips the scales towards nano, for you?

Simple. I don't know emacs that well :) I didn't even know emacs had a terminal mode until I looked this up; my main experience with emacs was when I was writing prolog and the IDE was emacs based. I didn't find it as nice to use back then so I never gave it a serious shot.

By comparison nano is everywhere and was super-simple to configure and spruce-up with custom functions, so it just stuck with me.

As for other competitors, when comparing to vim, I find it much simpler to use, and to the surprise of most vim users I speak to, equally powerful (at least for my needs).

Re: Customize Nano Text Editor (2022)

#66

Earlier quoted context omitted.

Which bindings changed?

bind ^F forward main bind ^B back main bind M-f nextword main bind M-b prevword main

What did the maintainer change them to instead?

(Because tone doesn't always come across, I'm asking out of curiosity, not to like challenge you about it.)

Re: Customize Nano Text Editor (2022)

#67

Earlier quoted context omitted.

For CUA aficionados, I recommend dte[0]. It has replaced my nano usage quite a lot. [0]: https://craigbarnes.gitlab.io/dte/index.html

I personally like msedit. https://github.com/microsoft/edit

Promising but very barebones. Hard to do without syntax highlighting these days, for example. But I think it would be useful on a tiny machine with openwrt, as micro is huge there. ;-)

Re: Customize Nano Text Editor (2022)

#68

Earlier quoted context omitted.

bind ^F forward main bind ^B back main bind M-f nextword main bind M-b prevword main

What did the maintainer change them to instead? (Because tone doesn't always come across, I'm asking out of curiosity, not to like challenge you about it.)

Seems GP got somewhere confused as well. From `man nano`:

       Since  version  8.0,  to  be  newcomer  friendly, ^F starts a forward
       search, ^B starts a backward search, M-F searches the next occurrence
       forward, and M-B searches the next occurrence backward.  If you  want
       those keystrokes to do what they did before version 8.0, add the fol‐
       lowing lines at the end of your nanorc file:

           bind ^F forward main
           bind ^B back main
           bind M-F formatter main
           bind M-B linter main
M-F/B have not defaulted to nextword/prevword, or at least haven't within the last 10y since have those binds in the earliest version of nanorc in my .config git repo.

Re: Customize Nano Text Editor (2022)

#69

Earlier quoted context omitted.

What did the maintainer change them to instead? (Because tone doesn't always come across, I'm asking out of curiosity, not to like challenge you about it.)

Seems GP got somewhere confused as well. From `man nano`: Since version 8.0, to be newcomer friendly, ^F starts a forward search, ^B starts a backward search, M-F searches the next occurrence forward, and M-B searches the next occurrence backward. If you want those keystrokes to do what they did before version 8.0, add the fol‐ lowing lines at the end of your nanorc file: bind ^F forward main bind ^B back main bind M…

Your 10y estimate must be wrong since my nanorc only acquired these things after the nano maintainer was bullied out.
Post reply on HN