7 ms·
What’s up with nano?
- brudgers 10y agoRelated discussion: https://news.ycombinator.com/item?id=11953044 https://news.ycombinator.com/item?id=11953044
- rhabarba 10y agoI never understood why nano is so popular. It even breaks line breaks by default.
- JoshTriplett 10y agoIt's a simple modeless editor, with all the keys you need to know to save and exit printed on the bottom two lines. Someone used to notepad on Windows would have little to no trouble using it. That's why Debian installs it as the default text editor.
- noobermin 10y agoAnother good reason: $ ldd /bin/nano linux-vdso.so.1 (0x00007ffc72add000) libmagic.so.1 => /usr/lib64/libmagic.so.1 (0x00007f3eca793000) libncursesw.so.5 => /lib64/libncursesw.so.5 (0x00007f3eca52b000) libc.so.6 => /lib64/libc.so.6 (0x00007f3eca193000) libz.so.1 => /lib64/libz.so.1 (0x00007f3ec9f73000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f3ec9d6b000) /lib64/ld-linux-x86-64.so.2 (0x00007f3eca9bb000) $ ldd /usr/bin/vim linux-vdso.so.1 (0x00007ffd69bfd000) libSM.so.6 => /usr/lib64/libSM.so.6 (0x00007efe2d7d3000) libICE.so.6 => /usr/lib64/libICE.so.6 (0x00007efe2d5b3000) libXt.so.6 => /usr/lib64/libXt.so.6 (0x00007efe2d33b000) libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007efe2cfdb000) libm.so.6 => /lib64/libm.so.6 (0x00007efe2cceb000) libncurses.so.5 => /lib64/libncurses.so.5 (0x00007efe2ca8b000) libacl.so.1 => /lib64/libacl.so.1 (0x00007efe2c87b000) libgpm.so.1 => /lib64/libgpm.so.1 (0x00007efe2c673000) libdl.so.2 => /lib64/libdl.so.2 (0x00007efe2c46b000) libc.so.6 => /lib64/libc.so.6 (0x00007efe2c0d3000) libuuid.so.1 => /lib64/libuuid.so.1 (0x00007efe2becb000) libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007efe2bca3000) libattr.so.1 => /lib64/libattr.so.1 (0x00007efe2ba9b000) /lib64/ld-linux-x86-64.so.2 (0x00007efe2d9e3000) libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007efe2b893000) libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007efe2b68b000) There probably are stripped down versions of vim out there, but this makes nano more reliable in the case of say a corrupted disk where libs are corrupted...less points of failure at least.
- nickysielicki 10y agoI think it's a bit more fair to compare it to vi or nvi $ ldd $(which nvi) /usr/local/bin/nvi: Start End Type Open Ref GrpRef Name 0000047a80c00000 0000047a8106c000 exe 1 0 0 /usr/local/bin/nvi 0000047d4d9f6000 0000047d4de50000 rlib 0 1 0 /usr/lib/libncursesw.so.14.0 0000047c97a14000 0000047c97e20000 rlib 0 1 0 /usr/lib/libutil.so.12.1 0000047ca1ba9000 0000047ca2073000 rlib 0 1 0 /usr/lib/libc.so.88.0 0000047d3bf00000 0000047d3bf00000 rtld 0 1 0 /usr/libexec/ld.so $ ldd $(which vi) /usr/bin/vi: Start End Type Open Ref GrpRef Name 0000106784500000 0000106784956000 exe 1 0 0 /usr/bin/vi 00001069ee8ed000 00001069eed47000 rlib 0 1 0 /usr/lib/libcurses.so.14.0 00001069f097f000 00001069f0d8b000 rlib 0 1 0 /usr/lib/libutil.so.12.1 00001069a8f41000 00001069a940b000 rlib 0 1 0 /usr/lib/libc.so.88.0 0000106a02600000 0000106a02600000 rtld 0 1 0 /usr/libexec/ld.so
- synchronise 10y agoOne thing I found interesting: $ ldd /usr/bin/ne linux-vdso.so.1 => (0x00007ffc22abf000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1c2d4ee000) libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f1c2d2c5000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1c2ceff000) /lib64/ld-linux-x86-64.so.2 (0x00007f1c2d7ff000) For a pretty full featured text editor ne has surprisingly few dependencies.
- bcook 10y agoIs your "vim" actually "gvim"? On ArchLinux I get the following: ldd /usr/bin/vim linux-vdso.so.1 (0x00007ffdcebf9000) libm.so.6 => /usr/lib/libm.so.6 (0x00007f1a49617000) libncursesw.so.6 => /usr/lib/libncursesw.so.6 (0x00007f1a493aa000) libacl.so.1 => /usr/lib/libacl.so.1 (0x00007f1a491a1000) libgpm.so.2 => /usr/lib/libgpm.so.2 (0x00007f1a48f9a000) libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f1a48d96000) libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f1a48b79000) libc.so.6 => /usr/lib/libc.so.6 (0x00007f1a487d8000) /lib64/ld-linux-x86-64.so.2 (0x00007f1a4991b000) libattr.so.1 => /usr/lib/libattr.so.1 (0x00007f1a485d3000)
- untog 10y agoBecause it's simpler to grasp than vi, at least for newbies. You hit backspace, it deletes a character. You hit enter, it makes a newline. And so on.
- thallian 10y agoExactly what appealed to me in the beginning. Coming from Windows I was lost enough without trying to guess how to get out of vi. Once I got more comfortable with how things work I was confident enough to use it and I would not want to miss it any more.
- girvo 10y ago> I was lost enough without trying to guess how to get out of vi. Oh man, I remember googling that years ago now. That was fun. Now I use Vim and Visual Studio Code for all my editing, but because my Vim is so customized, if I remote into a server I'm more likely to reach for nano instead.
- rhabarba 10y agovi doesn't kill my newlines when on PuTTY.
- digi_owl 10y agoOn that note, i wonder if people should take a long at another of Hishamhm's (Htop, Gobolinux) projects, Dit. Its a terminal editor that uses hotkeys that you more commonly find in GUIs. https://github.com/hishamhm/dit https://github.com/hishamhm/dit
- sbuttgereit 10y agoI think there is a whole tier of both entry level hobbyists and what I'll call lower sophistication professionals, sysadmin types that manage small or mid-sized company IT systems where there are a small handful of low volume Linux servers (or similar) to deal with: basic configs, basic backups, etc. For them, I think nano is as close an analog to what they get in a windowed operating system, while still dealing with the command line. These aren't the types to go run off and learn vi or Emacs because, at the level they're playing at, there's not much advantage. They are in the command line text editor only occasionally for a simple edit here and there. nano is relatively intuitive, vi and Emacs aren't. Moreover, I think it may be under appreciated, especially here on HN, just how many technology professionals are in this category. They know what they know and get by with it. EDIT: I should make clear, that "lower sophistication professionals" don't have anything to be ashamed of nor are they somehow lesser in what's important; I just don't know how to say it in a way that doesn't have a tinge of sounding derogatory. It's not intended.
- joshschreuder 10y agoI fall into this category, I run a HTPC off Lubuntu for performance reasons and because I like to tinker in different technologies, but do dev on Windows in my day to day, and never bothered to learn Vim / Emacs. I stick to Sublime on Windows, and when I need to tinker on my HTPC, I jump into nano, mainly because the command is memorable and the editor is very easy to use.
- rhabarba 10y agoWouldn't it make more sense for them to use joe then? joe comes with preconfigured hotkeys which are more "known" than C-o etc.
- sbuttgereit 10y agoNever heard of it. That same audience is also likely not choosing their editor much of the time. I've found that nano is the default editor often and if it's good enough, why would you mess with it? I know when I search for something that is not a core interest of mine, I go with the first thing that Google shows me that meets my requirements.... I don't overthink that which is mostly unimportant to me.
- deleted 10y ago[deleted]
- InclinedPlane 10y agoI've been using linux/unix for 2 decades and I used pico/nano for ages. It's an intuitive and easy to use editor with on-screen help. For the vast majority of everyday uses it works just fine. And for the rare times when it's not suitable, there are plenty of tricks to working around nano's limitations. The main reason I started learning vim is just because I wanted to, not because I thought I was being held back by nano.
- zhte415 10y agoFrom a user perspective, it has huge critical mass in that short 'how-tos' tutorials invariably include screenshots of nano, as it is probably installed and can be easily used for simple tasks.
- somethingsimple 10y agoAfter years of attempting and failing hard to grasp Vim or Emacs, I've recently switched to nano and I'm very happy with it. Vim and Emacs seem impenetrable to someone coming to them after they've been around for so long. Documentation and code is scattered all around, their concepts are not intuitive and there's so much stuff (modules, modes, whatever) available for both that I just feel paralyzed trying to decide what I need and what I don't. And then there's learning all the crazy key combinations and commands. In contrast, the manpage for nanorc can be read in a few minutes. Keys work as expected and there's a helpful menu at the bottom. Shortcuts are all Ctrl+<something>. It's small, it's fast, and it does what I expect it to do: allow me to painlessly edit text files.
- rhabarba 10y agoProbably I'm just the wrong type of person for nano then. I'm rather happy with Emacs (even with its mediocre performance).
- Retra 10y agoI use Vim all the time, and I don't know how to do squat in it. Press `a` start typing, `:wq!` when done. ... Ok, that's a lie. I also know /, n, N, :noh for searching , dd to delete lines, and [{, ]} for jumping to delimiters.
- somethingsimple 10y agoThat's as much as I know of vim, and I can do those same things in nano :)
- cdmckay 10y agoI think 'a' is actually append. I think 'i' (for insert) is the correct way to start typing.
- marklgr 10y ago> Documentation and code is scattered all around Vim and Emacs both have excellent built-in manuals.
- x0 10y agoI love nano, I've got absolutely no interest in vim or emacs. First things I do with it is set up colour highlighting, make it never break lines, and make it go into the background with ^Z. If I'm ever held back by nano, I've got sublime text and rsub set up on my servers, so I can type "sublime /etc/whatever" on the remote computer, and it will pop up on my home computer.
- rhabarba 10y ago^ Thanks for that trick, I didn't follow ST development too much recently.
- samatman 10y agoI checked email with pine for ten years before succumbing to gmail. Once something's in your muscle memory, there's no reason to shift out. I use Sublime or Spacemacs for Real Editing, Writeroom for distraction free writing. Ten second config file tweak? Doing something to J. Random Remote Server? nano's got my back.
- steve_taylor 10y agoIt's popular because it's a text editor that you don't have to learn how to use. You just use it. I don't understand why, after all these years, people still think they can fool others into believing that they don't understand why others would choose nano over vim.
- digi_owl 10y agoTo borrow from an Arch discussion, it may well be that vi is something of a humblebrag.
- Ayaz 10y agoI never liked nano. The only time I used it for a stretch was when for a year I used a non-GUI, X-less only environment for everything only old ThinkPad running Slackware. I was in University then. That was when I used Pine for email and Slrn for Usenet (and elinks for browser). While I remember using nano to edit emails in Pine (and later moving over to Emacs), I can't remember which editor I used inside Slrn. I am a thorough Vim believer. I have been for a long time. If I ever accidentally find myself on a nix system with nano or pico as the default editor, I exit and install Vim. However, in my almost 15 years using nix of all flavours, I have spent considerable time using Emacs as well, both on the GUI and the command line. Eventually, I gave up Emacs in favour of Vim. I've stuck to it since.
- digi_owl 10y agoIt may well be that you were not using nano but pico. It is part of pine, and i do believe that part of the reason nano got created was that a common question on distro lists etc was "where is pico?!". And checking wikipedia i see that pine's license was at one point changed from a BSD-like to one that restricted third parties from distributing altered versions of pine. Something that naturally riled up the FSF.
- deleted 10y ago[deleted]
- Scarblac 10y agoIt comes installed on servers and isn't a modal editor. Actually mostly the same reason Notepad is still used a lot on Windows.
- tdy721 10y agoJust guessing: you didn't grow up in a GUI world. When I'm ~45 I hope I'll know lots more about vim, until then, we're still cashing checks.
- tdy721 10y agoAhh, also, I like to share the command line with other folks. Nano is the easier one to share. It comes with a manual! (trapped in vi PTSD anyone?, I certainly know one vim command. ":q")
- digi_owl 10y agoWell if i get the history right it started out as a clone of pico, and pico was the editor part of the pine email client. Meaning that the line break behavior kinda makes sense if your primary goal is writing emails, or similar long texts. But for any kind of programming of config file editing it is indeed a problem. Thankfully there is multiple ways to turn the behavior off.
- noobermin 10y agoI personally have a question relevant to this that seems to not have been answered in the previous discussion ref'd by brudgers: what does GNU stand to lose in losing Nano? What does Nano stand to lose by losing the GNU moniker?
- catskull 10y agoThat's a good question to ask. My opinion: nothing, basically, on either side. You could argue that being an official GNU project gives nano a level of legitimacy and carries with it an implied quality level. I wonder if nano would ship by default on basically every *nix distribution without the help of GNU. Last I checked, it was nano, not emacs that comes preinstalled on an Ubuntu image. I think nano helps fulfill the GNU project's original goal of a flexible OS. I think of emacs and nano as having a similar relationship as wordpad and notepad. That's a bad comparison, but you could say both tools are valid and functional for the purposes they were designed for. As it stands I think nano is better off hosting development on github or the like. People go to great lengths to install and customize their text editors, so hard core users will seek out the best nano. What sucks is I would be surprised if the next version of OSX includes a non GNU nano, thus fragmenting even further. This is my 2 cents, and I'm mostly talking through my hat.
- adiabatty 10y ago…does nano have hardcore users aside from its own developers?
- skrebbel 10y agoI accidentally downvoted you, sorry.
- 59nadir 10y agoI think most nano users will end up using the one shipped with their distro, which means that the choice of fork will mean a lot for usage statistics. No one is going to go out of their way to install the best nano fork. With vim/emacs you'll have super opinionated users and they will make sure that they use whichever is the best/most stable version, but in this case I really think politics plays a much bigger part.
- catskull 10y agoThis is something I was pondering the other day: given nano's proliferation, I wonder how many devs use it in a regular basis? My suspicion is that nano is more popular than vim or emacs, just used less. Many devs who do not primarily use a command line editor use nano when they have to. It's like a screwdriver: it's nobody's favorite tool, but it's probably the most popular.
- kirrent 10y agoI wouldn't be too surprised if you were right. In an advanced comp sci class I took recently I was surprised to find that when we had to ssh into the university's supercomputer and edit some code something liked 75% of students used nano and only a quarter used vim. These are people early in their career using a low latency connection but it still surprised me.
- RamenJunkie_ 10y agoMy experience is that it's easier to remember the commands for Nano. vi confuses the hell out of me. I'm not actually a Comp Sci major or anything, maybe that matters?
- daveguy 10y agoIt does matter. When you're editing code in all kinds of terminals over 4 years the basics become ingrained. Really knowing how to quit at first and being able to get to the different modes makes a big difference. Also using it on your home computer helps. Once you get used to it other editors seem cumbersome.
- dllthomas 10y agoThe thing about vim is that the interface is a language. It certainly takes some learning. Check out vim-adventures.com
- alxmdev 10y agoI fall in this category, I use neither Vim nor Emacs because I never had a need to learn them and I'm happy with lightweight GUI editors like Geany and Notepad++. Nano on the other hand was the default command line editor in the university computer lab, so I had to learn the basics to get around and still use it today.
- somethingsimple 10y ago> A private thread ensued between myself, GNU, and Benno, and what came out of that conversation was that Benno was not going to be allowed to become a maintainer of the project in GNU’s eyes. This is the part I'm most curious about. Why didn't GNU let him become a maintainer?
- artlogic 10y agoGNU requires contributors (and maintainers) to assign copyright for non-trivial contributions. Benno doesn't want to do this, thus in GNU's eyes, he can't be the maintainer. You can argue (and it has been, to death) whether copyright assignment is right or wrong. When it comes to GNU projects, it's the rule of law. Based on mailing list posts and contribution history, it seems like the project had probably been in questionable GNU territory for awhile, given Benno's strong role and his unwillingness to assign copyright. I'm curious to see how the GNU project will respond.
- somethingsimple 10y agoDo you know what GNU's rationale is for requiring copyright assignment?
- artlogic 10y agoI'm no expert, but I believe the rationale is to simplify relicensing (GPLv2 -> GPLv3, for instance). I also think the papers disallow dual licensing the project with a proprietary license. There's more discussion here: https://news.ycombinator.com/item?id=11953703 https://news.ycombinator.com/item?id=11953703
- femto 10y agohttps://www.gnu.org/licenses/why-assign.en.html https://www.gnu.org/licenses/why-assign.en.html Because it makes it easier for them, as owner, to deal with copyright violations.
- GhotiFish 10y ago
- kinkdr 10y agoWhat a dreadful choice of color combination! I cannot even read the comments here after reading that post.
- krylon 10y agoAgreed. Quick workaround: Firefox has a reader mode (the little book-icon at the right side of the address field) that renders the main content of a page black-on-white in a very eye-friendly (read: huge) font size. I used to wonder what that was for, but these days I come across unreadable or unreadably ugly pages more often, and I have come to like it.
- pvaldes 10y agoMy first editor was ed, then I switched to joe and pico, tried briefly vi and elvis but they didn't stick, and instead to learn how to do the same in five small editors I learned emacs. I think that this was a dificult, but very smart move in retrospective. Learned enought nano to be able to float, after or maybe at same time than emacs, so their main appeal to me always was that it was like a micro-emacs available for emergencies, but much easier to remember than ed. I like and keep using the editor, but to learn "big tricks" in nano was unnecessary from that point, because the time invested in emacs eventually started paying benefits.