250
Nano has already supplanted the great EMacs and Vim as the most popular text editor of all linux distros, for though it has many omissions in functionality it scores over the older, more complete programs in two important respects. First, it is slightly simpler; and secondly it has the text "^ Exit" inscribed in highlighted text on its footer
EDIT : This sees to be going over some people's heads. It's a hitchiker's guide to the galaxy reference.
The Hitchhiker's Guide has already supplanted the great Encyclopaedia Galactica as the standard repository of all knowledge and wisdom, for though it has many omissions . . . it scores over the older, more pedestrian work in two important respects. First, it is slightly cheaper; and secondly it has the words DON'T PANIC inscribed in large friendly letters on its cover.
That’s because Ubuntu, honestly.
I've used Vim, NeoVim, Micro, mg(1), JOE, and even MS Edit (both the original DOS version and the recent Rust clone). No matter how complex and tailored I wrote my config, though, the features I actually used were included in GNU nano and/or my command shell without any of the bugs, bloat, learning curve, or slop.
Using it as my default just makes sense.
Nano is great for editing files. It is absolutely terrible for any amount of text processing or anything other than raw code copied from a tutorial
oh no, not again.
I use helix for all my developer work and nano for "I need to edit this config file buried somewhere in /usr/...". I never remember to do Sudo -E
Best local simple terminal text editor is micro.
It is insane how far using the same shortcuts literally everything else can get you in the world of terminal text editors and yet here we are
Sometimes I catch myself opening nano inside emacs' term. I literally forget I'm using emacs and just do it on instinct. I once also opened emacs inside emacs' term and I just stared at the screen in disbelief.
Emacs: "Sure, fuck it, why not."
It's there and it's easy. Most people don't use terminal text editors unless they are SSHing in a server, and they would only do that sporadically, so it makes no sense to become proficient in a complex text editor like vim or Emacs for that little use case.
Sidenote: personally, I learned vim once, and used it extensively every day for two years. I stopped using it for one year and was back to square one. Now I use vscode for everything... Even when I'm using SSH, because vscode supports SSH
I always forget that vscode can do that
Every editor "supports" SSH, you can mount files on a remote SSH server via SSHFS.
And instead vscode supports SSH (without quotes), you can connect to an SSH host, and it will open files and folders on the host like it does locally. And if you open the integrated terminal it will run on the remote host. And it will forward the git login agent so you can commit or push with the credentials of your local machine. And it can forward ports from the remote.
It’s kind of sad that many people don’t use the shell / terminal anymore, especially as part of their regular development flow. There’s so much scripting and so many shell commands you can use that will do things you just can’t do in vscode. And having an editor like vi immediately available is part of that flow.
For me, vim and the shell are my primary IDE. I rarely fire up vscode. But I guess I’m getting old. Still faster than the younger devs who mainly use vscode and then struggle when they are forced to use the command line due to whatever circumstance where vscode is not available or appropriate. Kind of makes me sad. Feels like a valuable skill is being lost.
Oh, I use the terminal a lot, it doesn't throw me off. When I can't have vscode (e.g. small openwrt devices) I can use vim. It's just plain easier to use vscode for editing files when I can
People don’t have to look up “how to exit nano”
I'm in the "been working with Linux since the 90s" gang so I call vim vi and nano pico and when I started there was a coolness factor to be considered. I was incredibly uncool so I used whatever I wanted, including pico - I mean you used pine for email back in the day and the interface was nearly identical, so whatever.
But I did want to be at least a tiny bit cooler, so I learned vi in a fairly rudimentary fashion. I can edit, jump, delete, search, replace, copy and paste - oh, and I can exit. I've spent so much time using vi, that my brain doesn't even have to think about exiting, not even whether I want to write or not. It just happens like second nature. It's actually gotten to where nano seems unduly burdensome to me.
But really, I prefer an IDE for programming. CLI editors will always be for configuration files and shell scripts to me.
I like Nano; it lets me do what I need to do quickly, simply and efficiently.
That’s why nano gets used more than vi/vim. In the past, the majority of people using terminal text editors were geeks and developers. Now the majority of people using the terminal text editors are more often casual users who have no use for putting the time and effort to learn vi/vim, especially because they have no need for the extended functionality
I don't get you people. Proper copy/paste support is "extended functionality"? I beg to differ. This is basic functionality.
And no, single line copy/paste as offered by nano, or copy and paste through the terminal is not proper copy/paste.
Doesn't matter if it's not "proper" if it works.
Blasphemy! Ctrl+k is multi line!
Many were increasingly of the opinion that they’d all made a big mistake in making text editors in the first place. And some said that even making operating systems had been a bad move, and that no one should ever have built computers at all.
In the beginning, boolean algebra was invented.
This has made a lot of people very angry and been widely regarded as a bad move.
I still think smart watches are a pretty neat idea.
Same here, computers have gone the wrong way; from utility to project to pet.
Same reason people use notepad on windows. It's already installed on almost every distro
It is preinstalled and does what it needs to do. What else can I ask for?
I see Hitchhikers Guide to the Galaxy parody, I updoot
If ind it quite funny that the majority of the posts are about the text editor and not about the blatant hitchhiker's guide reference to the point where I had to specify it in the OP and then the thread exploded after that point.
I've wanted to move elsewhere for a long time, thing is I don't use nano for programming, I use it for config files. For programming I use an IDE, and every time I've tried leaving my IDE for emacs with a language server I find I just can't be bothered to set it up and learn it and make the move. Maybe because while I have some gripes with my current setup...they're very minor
People program in things like nano? Wow. I want to learn that. I also have only really used them for configs, terminal profiles, …
Can they offer autocomplete and syntax highlighting like vscode can, extendable for different languages and whatnot?
I've programmed in notepad. Not often or very much, because even though I operated in a Windows environment, I didn't hate myself, but simple edits or creating small files was possible if you knew what you were doing. More could be done too, if you wanted to pretend you were a caveman programmer.
Nano has syntax highlighting out of the box IIRC. I've used it for programming in a pinch but no, it's nowhere near as extensible as VSCode or Vim. It's a text editor, not an IDE
nano has supported syntax highlighting for a good long while, and for the Debian package at least, comes with a bunch of predefined languages in /usr/share/nano/*.nanorc.
I wouldn't recommend it for large projects, but I've created and edited shell and Perl scripts with it plenty of times.
I'm part of the "learned Linux when I got my first raspberry pi" gang, and all Ras pi tutorials tell you to use nano. So yes.
Nano is to EMacs/Vim as Notepad is to Notepad++ or VSCode (Nano has features Notepad doesn't, but you get the point).
I don't do a ton of code editing directly on the CLI. I do things like change parameters in config files or open a file to read it quickly. If I'm doing more heavy editing, I'll use a GUI editor (with an SFTP extension if I'm working on a headless server). So programs like Vim and EMacs have never been useful for me.
To each their own (and I have all the respect for anyone who knows how to exit Vim without looking it up) but I'm guessing the majority of people have a similar experience.
I spent enough time learning vim that I can do basic navigation and text editing. I'd like to be able to navigate efficiently like some of the savants out there, but the effort to get to that point is more than I'm willing to put into in.
Being good at nano does not transfer like notepad transfers to notepad++ or kwrite.
vim does not respect nano shortcuts and modes are simply a barrier: an extra keypress and another thing to keep track of. It slows you down significantly.
Noone good at nano would switch to vim naturally, you have to force yourself to endure until you catch back up to what you could long do in nano.
Conversely I don't know a single shortcut, behavior, or info notepad shows that np++ or kwrite don't have. Besides maybe bracket and quote completion in kwrite which you'd have to disable in settings.
And on the other hand the advantages are more directly visible, like tabs, syntax hilighting, ...
You might not immediately intuit the shortcuts for tab management, but you can still use tabs and then not return to notepad due to missing them.
Sure, Notepad transfers to other GUI programs better than Nano transfers to Vim or EMacs. But that has little to do with Notepad and more to do with GUIs typically supporting similar shortcuts. Like I said, it's an imperfect analogy.
I think you missed my original point. Most people wouldn't describe themselves as "good" or "bad" at Notepad or Nano. They're simple programs designed for simple editing. The learning curve is very low for both. Advanced editors have differing learning curves, but they're all a lot more steep.
And my original point was that, because many people do only simple editing in a CLI and more advanced editing in a GUI, it makes sense that Nano became the most popular for CLI due to its shallow learning curve.
vim does not respect nano shortcuts and modes are simply a barrier: an extra keypress and another thing to keep track of. It slows you down significantly.
You obviously haven't used much vim if you think modes slow you down. First it means you don't have to bring your right hand all the way to the arrows whenever you want to move the cursor, secondly it means you can use shortcuts without adding a modifier everytime - this translates to fewer keypresses.
If you customize nanorc then you can also point and click with the mouse and highlight text and copy/paste like it was a GUI from the terminal. Most people shiting on Nano just never learned it because they learned the editor they are familiar with. Same reason I shit on vim.
I was talking about the new user experience. No new user can navigate without the arrow keys, the most you can expect is looking up i and esc to enter and exit edit mode, and then using both modes the same way being annoyed at being in the wrong mode when something doesn't work.
Keeping track of the modes is also obviously something only problematic to those not familiar with vim.
I have been around since production servers were predominantly HP-UX, Solaris, and AIX. I settled on Vi because it was the one common editor that was preinstalled on every *NIX OS, including Linux and you could jump right into edit mode while reading a file without having to exit the preview first.
Nano is fine, but one you've gone through the pain of committing Vi to muscle memory, there's no point to switch.
Not long ago, I needed to quickly add a 4-line thing to my Ruby on Rails app on my Raspberry Pi. I was like, shit, I really can't be arsed to mount the RPi over Samba to edit this stuff on VSCode on my Windows laptop to add like 4 lines. I don't have vim, I can't be arsed to check which vimlike I have at hand, I can't be arsed to see if my Emacs setup has been customised for this RPi. So fuck it, Nano it is!
I think Vim is great if you use it everyday and know it inside out. For those of us who don't, Nano is just easier, not least because it tells you in the UI how to exit it xD
Big fan of micro. Like nano, it's non-modal, but unlike nano, it doesn't need to print its shortcuts on the bottom because everyone already knows most of the shortcuts from almost every GUI editor. And it has inbuilt syntax highlighting and LSP support (TBH it's a bit much at times, the UI is a bit too intrusive to (by default) complain every time you violate some style guideline).
Though that's moot if you don't have admin privileges on the box you're working on.
nano -x may be more to your liking then. Or nano -0 if you like being terrified.
Hints: Ctrl+X still works to quit. Alt-Z and Alt-X toggle the title and the help respectively.
You can also use the toggles in regular nano to hide one or the other if you're bothered by them.
The UI isn't the issue with nano, it's that it needs that kind of UI ... you could memorize nano's shortcuts, but it doesn't have enough features to justify the effort.
What extra features do you think it ought to have?
Well, micro has syntax highlighting and LSP support ... though nano's feature set is honestly fine for what it is, I'd much rather it used well-known shortcuts by default.
It's not that they want more features - it's that in micro for instance copy is ctrl+c which everyone already knows, where in nano it's different
Then you want nano -/ which uses the modern key bindings. They've been in nano for a while now.
For historical reasons, it doesn't use them by default.
Yup they could use nano -/0, or they could just use micro.
A note: I couldn't find -/ referenced online easily though when I checked it is indeed there. On Mac nano redirects to pico by default which doesn't have that either. I think it's understandable someone would just choose to use micro
To flog this dead horse just a bit longer, micro is nearly seven times the size of nano, and Apple are clearly doing it wrong. Pointing an old name at a new thing is fine as long as there's backward compatibility, but a new name at an old thing that doesn't support the same features is a disservice to the old thing, the new thing and the user.
The Venn diagram of nano users and Debian/Ubuntu users is a circle
sudo apt install micro
I myself make it just a slightly out of focus circle, nano or Kate and yes I’m on Arch… btw
sample size of me supports this hypothesis
I'm N+1
yep. One of the reasons I stick to debian based (vanilla Deb) is so that any dumbass tutorial works for me, because I am not smart.
I only ever use to quickly edit some config file and for that i really don't need anything more complex.
I'm a vim stan. I love my vim. I still end up installing nano on all my machines. It's honestly not even for me anymore, it's for anyone else who happens to use it. Vim is great but it's got a learning curve.
Often times I'll just use vi, since it's always there.
Also a die hard vim user. Once you get comfortable with it, it’s a very functional tool that will always be there for you, at least in vi form if nothing else.
OK so... How long did it take you to learn to use vim? I mean, where you didn't have to look anything up?
As a nano user, I've assumed it was in the 1 - 6 months range, but maybe it's not that bad?
if you use something like Neovim/Lazyvim or NVChad it's pretty easy to pick up as you can just hit space and it'll tell you pretty much everything you can do. Neovim also includes a decent tutorial. you can pick up the absolute basics pretty quickly, easily within a day or so.
I had a job for a while where my main task for about a year was reviewing / editing configs on servers, in which I learned the basic functions of vim (opening, closing, seeking, copy / paste, find / replace, etc.) and used them enough to get them embedded in my memory.
I use vim less now, as I still prefer graphical editors with a visual file tree for most development tasks, but I still have the simple stuff ready at hand when I have to jump on a server and change a config file. I've "learned" new tricks with vim since then, but I have a harder time remembering them when I don't use them every day, and I periodically come across vim functionality that I've encountered before but then forgot.
So, maybe six months isn't so far off, but it's not that I dedicated myself to studying and learning the full length and breadth of vim's capabilities for that whole period. It's more that I picked up the basics pretty quickly, maybe after a few days of getting settled, then repeated the basics in slightly varying contexts until they became rote, which took longer.
Like two or three weeks for most tasks. I still check the manual sometimes, it's built in :)
Check out vimtutor if you wanna learn it fast
https://vimschool.netlify.app/introduction/vimtutor/
I oft reference the wikibooks page as well https://en.wikibooks.org/wiki/Vim
I use nano just because it's the one that's usually installed. if it was usually Vim, I would use that instead.
Exactly. I use nano because it's always there, and if it's not somehow? It's in a preloaded repo. It's just so simple and easy.
And I've used it to write code before, only several dozen lines at a time. And that's BEFORE I knew about the option to use modern key commands. (Learned that today).
Now nano is unstoppable in my mind.
If I learned vim or whatever, then on top of learning it, I'd have to stop and install it every single time. Bleh. No thanks.
