Hacker News new | ask | show | jobs
by RMPR 2150 days ago
> Nano has always been my go to editor. It comes natively with most install

While vi comes with all installs

> is very easy to use. It has all the shortcut listed on page so it is quite user friendly out of the box

Tell that to the users that don't know what ^ stands for

> After learning vim for a bit, I find nano quite superior for my use case mainly editing files inside terminal on remote servers.

I just don't understand how this is possible, except if you're doing very basic edits (even in that case...)

9 comments

>Tell that to the users that don't know what ^ stands for

If you run `nano` it shows a message that you can get help using 'Ctrl-G'. In the second paragraph it tells you what '^' stands for. It will be a problem if you somehow ended in nano unintentionally. Even then someone can figure that it means either 'Alt' or 'Ctrl', that is the modifier keys.

>I just don't understand how this is possible, except if you're doing very basic edits (even in that case...)

Some people prefer or/and find easier to work with a modeless editor.

>I just don't understand how this is possible

I use nano as my daily driver, and here is how:

- I have a nanorc I copy around but am quite comfortable without. Here it is. You can use it under WTFPL-1. Feel free to fork it, but I'm not accepting pull requests.

  set multibuffer
  set nohelp
  # Defaults for older versions
  set nowrap
  set smooth
  set morespace
  unset boldtext
- I use ^K and ^U to cut and paste lines of text.

- If I need to edit multiple files, I use ^R

- If I need to find and/or replace, I use ^W (find), optionally with ^R (replace) and/or M-R (Regexp).

- Sometimes I need to go to a specific line/col, so I use ^_

Basically there's nothing else I want my text editor to do. I want minimal magic.

I know it's not the point you were answering too, but this is exactly why I don't think I will be comfortable in nano, ever. I already know vim, and I don't really bother to remember another set of shortcut just for nano.

When vi/vim aren't available, I usually just end up using sed.

The only thing you need to remember with Nano is that ^ means Ctrl. The rest you can find by reading the menus or the built-in help.

Which is why I prefer Nano over vim, I don't edit _that_ much from the console so I only have one easy thing to remember.

That's reasonable, but all the things a I listed are on the standard help bar, so the learning curve is minimal.

If there's no nano available like on busybox, I'll default to vi, but I don't prefer it.

At least in my case, I use nano typically for very simple edits, such as config files, fstab, etc. While I can use vim, I never “really” adopted it and get especially confused by the old “vi”.

As such, I almost always just grabs nano for these things, and use an IDE when working on code.

^ is quite obvious if you’ve tried to use any keyboard shortcuts in the terminal while a program is running.
Not really. Only after your comment i realized that it stands for any key at all. I never actually thought what it means before.
Yeah, for me when I was learning it was not-obvious, but wikipedia has an article on "Carat notation" I found by searching something like "what does carat mean in a terminal" on google.

Unfortunately, for me when I googled that exact phrase just now it gives a "Featured Snippet" saying it means "the beginning of a line", which is about regexen and and also only sort of right in that context. The wikipedia page is the first real result though.

Edit: I was spelling caret wrong. oops.

You mean "caret". "Carat" is something else: https://en.wikipedia.org/wiki/Carat_(mass)
I never had to Bing how to quit nano.
Ubuntu ships with nano by default? And every district Ubuntu I’ve used is defaulted to nano?
Ubuntu is nowhere near the only major distro. Maybe on the desktop, but most likely not on the server.

Edit: Also there are a lot of stories of "this old system that is central to our operation that nobody except that one guy 10 years ago knew how to set up" in companies.

I understand that Ubuntu may not be the /most/ popular distro. (tho everyone I know who runs Linux in AWS/GCE/Azure seems to run Ubuntu except me, I'm on Amazon Linux 2)

But the person I replied to said 'all' which is incorrect. If he said 'most' or something I wouldn't have replied :)

He said that vi is present in all distros, which is correct as far as I know. Not that it's the default.
I’ve been having trouble finding vi/vim lately on some installs, namely Ubuntu, although maybe they just leave it out of the default docker image? I use it sometimes for debugging conf files in between docker builds. But if you have to install something anyway, maybe it doesn’t make any difference if it’s vim or nano (emacs, though, I mean come on).

I think also I was on a real Linux box a few weeks ago (can’t remember what distro, sorry) that only came with ed by default. That was interesting, at least until I gave up and installed vi.

> except if you're doing very basic edits (even in that case...)

Most edits I do if I'm not on my daily driver is basic edits. Making adjustments to config files, etc. Doesn't require all the magic of Vim. Still prefer Vim though. Not having my Vim keybindings in an editor is like using a keyboard with a different layout.

Tell that to the users that don't know what ^ stands for

The users who have already figured out how to open a terminal, find their file, know what nano is and how to launch it?