[HN Gopher] GNU nano is my editor of choice
       ___________________________________________________________________
        
       GNU nano is my editor of choice
        
       Author : todsacerdoti
       Score  : 134 points
       Date   : 2021-08-13 21:31 UTC (1 hours ago)
        
 (HTM) web link (ariadne.space)
 (TXT) w3m dump (ariadne.space)
        
       | davidkunz wrote:
       | >Hopefully this post demonstrates that nano is a quite capable
       | editor in its own right.
       | 
       | This post showed how to add a slightly enhanced minibar, remove
       | the help and add syntax highlighting. It would be more important
       | for me how to quickly navigate text.
        
         | tpoacher wrote:
         | you can also quickly navigate text.
        
       | chaoticmass wrote:
       | I've been using mcedit (the editor component of midnight
       | commander) for about 15 years now as my primary editor for
       | coding.
        
       | riffic wrote:
       | more power to ya! that's what's wonderful about general-purpose
       | computing - there are many choices and whatever works for you to
       | get the job done is all that matters.
        
       | tomc1985 wrote:
       | I've always liked nano, as it seemed closest in functionality to
       | the text editors I used to work with in DOS (which set the UI
       | standard that I measure interacting with console applications
       | from)
       | 
       | I wasn't aware people have added so much extra functionality to
       | it. Nowadays I turn to vim but I will give nano a closer look
        
       | jrockway wrote:
       | > The vim vs emacs flame war
       | 
       | I doubt that there is any ongoing vim vs. emacs flamewar. Most
       | people are probably arguing about VSCode vs. JetBrains these
       | days. My impression as an Emacs user is that if someone says they
       | use Vim, I think "hey, one of us". (nano I guess falls into that
       | category, but I bet nano users are missing out on some timesaving
       | innovations from the last few years, and nothing frustrates me
       | more than people that have inefficient workflows because they
       | eschew learning new things.)
       | 
       | > Emacs Lisp is not really a particularly fun language to use
       | simply for customizing the behavior of an editor -- as they say,
       | Emacs is a nice operating system, it just needs a good editor.
       | 
       | I doubt one would like an OS where the SDK only supports a
       | language they don't like. I know this was an attempt to reuse a
       | quote, but I think they actually like the editor and dislike the
       | OS, which is the opposite of what sentiment that quote conveys.
       | (Here's another tired meme: "eighty megs and constantly
       | swapping".)
       | 
       | Emacs Lisp is actually very interesting in its staying power. It
       | was designed from the ground up to write programs that the
       | programmer is in front of all day, and that's very different than
       | the enterprise / systems programming use cases that modern
       | languages optimize for (where tens of thousands of copies of your
       | program need to run unattended). The API and tooling matter more
       | than the actual programming language, and I've looked around at
       | other editor platforms and they're just not there yet. You can't
       | C-M-x to run the line of code you're currently editing. You have
       | to write HTML and CSS to supply preferences to your plugin. It's
       | so weird to me how actively extension-hostile the popular editors
       | are these days, and how hard they make manipulating the contents
       | of the editor.
        
         | garciasn wrote:
         | I wish vim had the option for CTRL-K/U behavior rather than
         | having to do the unintuitive (to me) visual block.
        
         | techrat wrote:
         | https://i.imgur.com/LV6umMH.png
        
       | lcnmrn wrote:
       | # highlighting for all languages
       | 
       | include /usr/share/nano/*.nanorc
       | 
       | set autoindent
       | 
       | set minibar
       | 
       | set morespace
       | 
       | set historylog
       | 
       | set linenumbers
       | 
       | set softwrap
       | 
       | set tabsize 4
       | 
       | set tabstospaces
       | 
       | Now you got a full featured IDE.
        
       | pauldirac137 wrote:
       | Nano is OK, I guess, but it's a bit bloated. Now ed(1) -- that's
       | an editor!
        
       | markus_zhang wrote:
       | I think I'm getting enough of these editor posts. It's just a
       | tool and I'd rather see more language war posts.
        
         | awelxtr wrote:
         | Aren't languages just tools, too?
        
           | markus_zhang wrote:
           | Yeah, that's the point. Since they are both tools, I'd rather
           | see more tool war posts regarding languages. At least people
           | will quickly deviate to language theory or quirks in
           | languages so that we can learn a lot.
        
       | mad_ned wrote:
       | i spent a good long time writing code in emacs but our current
       | project uses an IDE, and I found I could be pretty productive in
       | it and learned to leverage its advantages. But I could not live
       | without a solid text editor, and still use emacs for texty stuff,
       | like config and log files and such (even though in theory i could
       | do that in the IDE as well)
       | 
       | But as a result, a lot of the cool stuff I had set up in emacs
       | never gets used anymore. not even sure how to run many of the
       | .el's anymore i have in my .emacs tbh. I could probably get by
       | just fine with nano but run full emacs just out of habit.
        
       | matthewmorgan wrote:
       | May a 'gatekeeper' give me a nod in the right direction
        
       | jtchang wrote:
       | Nano feels a lot like windows notepad. Still my favorite editor
       | and beginner friendly (as far as unix editors go).
        
       | bigdict wrote:
       | How do you navigate text in nano?
        
         | pphysch wrote:
         | Slowly
        
           | 28175022 wrote:
           | As much as we all enjoy low effort posts, there are a number
           | of shortcuts to move around, as well as the general "find"
           | option.
           | 
           | https://www.nano-editor.org/dist/latest/cheatsheet.html
        
             | pphysch wrote:
             | If we're gonna learn a stack of key combo shortcuts, why
             | not go with a editor that was designed with that in mind
             | (i.e. key combos organized into a hierarchy rather than a
             | huge flat mess)?
        
               | gravypod wrote:
               | Note: I'm not saying nano is perfect but these are some
               | nice features.
               | 
               | The key bindings are at the bottom of the screen.
               | 
               | Example: https://imgur.com/tFVNFc4
               | 
               | ^ is CNTRL.
               | 
               | > why not go with a editor that was designed with that in
               | mind (i.e. key combos organized into a hierarchy rather
               | than a huge flat mess)?
               | 
               | Nano has a tree-like structure. There are a a few root
               | commands for common things but a menu like "replace" has
               | these options shown: https://imgur.com/5IKRyeC
               | 
               | In this screen you can see "M" which means the ALT key.
               | These names (^, M) are not ideal but they have their
               | roots in the originally common teletype names (control,
               | meta). It's not the best but it's easy once you remember
               | those two things since you need to remember nothing else.
               | 
               | An important note about these menus: they remember your
               | previous insert. If you click the up arrow key you can go
               | back in time to previous searches just like your
               | terminal. It's how I could say that 4 searches ago I
               | looked for `affinity_test`.
               | 
               | Also, nano supports all of the standard navigation you
               | will be used to. Things like:                 - Page
               | Up/down: Go up/down an entire page of text.       -
               | Arrows: Navigate text one character/line at a time.
               | - Scroll Wheel: Move cursor up/down for each input.
               | - ctl + left/right arrow: Move one "word".       - Home /
               | End keys: beginning and end of line.
               | 
               | So, the things you already know from all other programs
               | directly apply. The things that aren't the same that you
               | _will_ use are at the bottom of the screen or behind a
               | "CNTRL+G" menu that is at the bottom of the screen. All
               | for giving up ~3 vertical lines of text. I just checked
               | and at my default font size I can fit 57 lines on my
               | monitor so I'm giving up 5% of my screen so anyone,
               | regardless of skill level, can sit down at my computer
               | and know how to operate the text editor.
        
         | gruez wrote:
         | * arrow keys
         | 
         | * pg up/down
         | 
         | * find (^W)
         | 
         | * go to line (^_)
         | 
         | the first two are standard across applications, and the last
         | two are in the help menu that shows up by default.
        
           | bruce343434 wrote:
           | > (^_)
           | 
           | Confusingly, this is actually not a ctrl (^) shortcut at all.
           | It is alt-g.
        
             | RandallBrown wrote:
             | ctrl + underscore is go to line, column for me
             | 
             | Am I misunderstanding what you mean?
        
             | tpoacher wrote:
             | no, it is control underscore
             | 
             | alt g is another binding for the same.
        
             | rahimnathwani wrote:
             | Not confusing.
             | 
             | ^_ is ctrl and underscore
             | 
             | underscore is shift and minus
             | 
             | So ^_ is ctrl and shift and minus.
             | 
             | On my computer, doing ctrl+shift+- brings up 'Enter line
             | number, ...'.
        
           | techrat wrote:
           | Hell, even the mouse scroll wheel works.
        
         | Palomides wrote:
         | lesser known nano fact: with -m it supports mouse clicks for
         | cursor movement
        
       | budafish wrote:
       | I've been a really big fan of Micro[1]. A single binary with
       | excellent out of the box features. Mouse mode, syntax
       | highlighting, tabs etc
       | 
       | [1] https://github.com/zyedidia/micro
        
         | timothylaurent wrote:
         | but are there vim keybindings?
        
           | budafish wrote:
           | From the faq.
           | 
           | Does micro support Vi keybindings?
           | 
           | Currently micro does not have any sort of Vim emulation.
           | However, this is the next major feature that is planned, so
           | stay tuned.
        
         | type0 wrote:
         | It is great. It should have been the default editor in some
         | Linux distros that settled on nano!
        
         | rickstanley wrote:
         | The only thing that keeps me from using it as my daily editor
         | is the clipboard functionality in WSL (using Windows Terminal).
         | The first problem was clipboard not working at all, after some
         | updates and tweaks (aliasing xclip to a custom bash script) the
         | clipboard worked. The second problem is yet to be resolved:
         | copy/cut and paste ignores new lines, I haven't found a
         | solution ... Any advice is appreciated!
        
       | theonemind wrote:
       | Outside of corner cases, most of the things that become the focus
       | of tech religious wars make fairly marginal difference compared
       | to other factors, like proper design, testing, documentation,
       | etc. (Corner cases do exist, however; no one wants to write a
       | compiler in brainfuck). I definitely tend toward a view of do the
       | work, boring stuff included, in whatever text editor, IDE, and
       | language floats your boat.
        
       | kzrdude wrote:
       | Why is nano the favourite editor? What's the upsides and why does
       | it stay the favourite?
        
         | andrewzah wrote:
         | It's very simple. It behaves like users would expect something
         | like Word to behave.
         | 
         | Editors like Vim have a learning curve because they introduce
         | the concept of modal editing which takes some getting used to.
        
           | kzrdude wrote:
           | I can't even properly explain why I like Vim. I guess it's
           | the same way, by habit. When in a non-modal editor I'm just
           | very clumsy. Trying to type commands but inserting text
           | instead by mistake and so on.
        
       | guyromm wrote:
       | https://www.gnu.org/fun/jokes/ed-msg.en.html
        
       | ctur wrote:
       | The thesis of this post is roughly that nano, when configured, is
       | enough of an editor for the author. Which is totally fine! People
       | should be happy with their tools and not feel pressured by
       | popularity to use what others use (vim, emacs being prime
       | competitors in this case).
       | 
       | Alas, nano (and pico before it) have a certain stigma among more
       | "experienced" Unix users that more or less boils down to
       | gatekeeping and snobbery. Which is a shame.
       | 
       | That said... it is worth considering that learning tools like
       | editors is an investment in one's self and pushing through
       | preference to genuinely try to use what others find value in can,
       | if nothing else, help you better understand what you value and
       | adjust your tooling to fit (much like the author adjusted Nano to
       | be more like vim).
       | 
       | That's a pretty nuanced distinction though and I am glad that the
       | author feels comfortable owning their preference and not feeling
       | pressured by peers to conform to more "acceptable" choices while
       | still having tried and learned from them.
        
         | relax88 wrote:
         | It's not really gatekeeping or snobbery to say that knowing vim
         | is more useful simply because I can log into any Linux machine
         | on the planet and edit a text file without having to install an
         | editor.
        
           | hkt wrote:
           | Is installing an editor really such a hardship?
        
             | orthoxerox wrote:
             | Yes, because your sysadmins won't give you sudo, so you
             | must scp a copy of nano into your home dir. Surprise, it's
             | an AIX server running on Power, so your x86 nano won't run.
             | Does building one from source count as hardship?
        
             | dllthomas wrote:
             | Usually not, sometimes very much so.
        
             | yakubin wrote:
             | In "linux embedded", absolutely. You take what's there. At
             | some point I even had a debugging session through
             | TeamViewer connected to a Windows machine which had
             | Terraterm open connected to serial port of a linux box.
             | Unfortunately, there was a lot of spam on the serial port,
             | so even using vi was impossible, because the screen got
             | garbled pretty fast. So I printed the files with cat,
             | worked out a set of sed commands to get those files to the
             | desired state and typed them back in. Crazy. But real.
             | 
             | (Add to that communicating with a guy on-site over
             | notepad.exe. Mr. Robot vibes.)
        
           | emef wrote:
           | this is less true these days w/ slim docker images that don't
           | include any editors by default
        
             | dijit wrote:
             | Doesn't POSIX designate vi as a requirement?
             | 
             | https://ieeexplore.ieee.org/document/6880751
        
               | yakubin wrote:
               | POSIX doesn't say anything about containers.
        
               | dijit wrote:
               | But your containers may be a bit weird if their
               | environment isn't POSIX.
               | 
               | Like if you removed the "cd" command or the ability to
               | read environment variables. "Containers" is any
               | definition you want, but surely they're built to some
               | standard.
               | 
               | PS: I do make "from scratch" images a lot, I know you
               | don't "need" to have any utilities at all, but I'm fairly
               | certain that a lot of software expects the "OS" to be
               | POSIX.
        
               | yakubin wrote:
               | I don't know what you mean. Linux containers don't
               | contain operating systems. They contain processes. POSIX
               | describes operating systems.
               | 
               | Every Linux process can read environment variables. They
               | are contained in its address space. "cd" is a shell
               | built-in. When there is no shell, there is no "cd". Not
               | providing access to a shell sounds like great security
               | practice tbh. Your applications shouldn't be using it
               | anyway (they should create new processes directly).
        
               | messe wrote:
               | This is just being obtuse for the sake of it. Yes,
               | technically nothing in the notion of a container
               | necessitates that; containers are just a form of
               | namespacing. Have a gold star for understanding that. But
               | the fact is: the vast majority of containers in use are
               | going to be based on some minimal OS image, which is what
               | the commenter was referring to.
        
               | privacyking wrote:
               | Not sure, but I've logged into many terminals before and
               | not one of them didn't have vi installed. Have found
               | plenty without nano or vim though.
        
           | aroman wrote:
           | They probably meant snobbery that vim is superior because
           | it's more capable, not because it's more ubiquitous. Nano is
           | also very widely installed, so the latter point isn't even
           | particularly true.
        
           | brundolf wrote:
           | Every Unix machine (Mac or Linux) that I've ever tried to use
           | nano on has had it preinstalled. I'm sure not _all_ of them
           | have it preinstalled, but it 's very common.
        
             | klyrs wrote:
             | In the late aughts, I found myself at the keyboard of a
             | Solaris system that only had ed. I was there to get the
             | network configured and it didn't have an optical drive, so
             | there was no way but forward.
             | 
             | More recently, I've found myself inside a container which
             | didn't have _any_ editors. I got the job done with echo,
             | head and tail. Delightful.
        
               | trey-jones wrote:
               | Removing vi from your container image is rude, IMO.
        
             | correct_horse wrote:
             | Most non-copyleft (permissive free software and proprietary
             | software) tries to stay as far away as possible from the
             | GPLv3 license. Because of this, macOS ships gnu nano 2.0.6
             | whereas the latest is 5.8. FreeBSD doesn't even have nano
             | installed by default.
        
             | relax88 wrote:
             | If you've never logged into a Linux machine without nano
             | installed, then you probably haven't logged into that many
             | flavours of Linux machine.
             | 
             | I agree this is pretty much a non issue for the average
             | developer, but those of us who work on network
             | infrastructure, as red-team hackers, or do any work on
             | embedded systems can attest to how much of a pain it would
             | be to not know how to use vi/vim.
        
           | bluedino wrote:
           | Except when it's vi and casual vim users can't figure out why
           | nothing works
        
             | trey-jones wrote:
             | Aren't casual vim users really vi users? I use emacs
             | primarily but years ago created an _extremely_ minimal (~20
             | lines) .vimrc to be installed by default on every server I
             | work on. Some color, maybe indentation, I don 't even know
             | because I usually just use Emacs/TRAMP these days, but I'm
             | nearly 100% sure that every config there works in vi. I
             | would consider myself a casual vim/vi user in that I don't
             | know the differences.
        
               | hn8788 wrote:
               | I may be misremembering, but the biggest differences I
               | remember between vi and vim as a semi-casual user is vi
               | defaults to not supporting arrow keys, and doesn't tell
               | you the mode it's in.
        
           | babypuncher wrote:
           | I've never worked with distros targeting enterprise, but I've
           | never encountered a distro that didn't include nano.
           | 
           | Even if Vim is "better", I think it's important for all
           | distros to include a text editor that is easy to use out of
           | the box, and nano fits that bill perfectly.
        
           | shapefrog wrote:
           | Its not snobbery if it is better
        
         | swiley wrote:
         | I'm glad for nano users because the popularity of their editor
         | probably won't ever mean stuff that won't work with mine.
        
         | dijit wrote:
         | The thing about that "snobbery and gate keeping" is that it's
         | not at all that.
         | 
         | Maybe not everyone's experience mimics mine but I _felt_ like
         | people looked down at me a bit when I was 16 for using nano on
         | the command line.
         | 
         | But, and here's the kicker, if I hadnt been pushed into vim I
         | would not be nearly as productive now.
         | 
         | There have been countless times in my career as a
         | sysadmin/devops/SRE where I've been stuck with horrible latency
         | to machines half a world away (or, a few miles away but the
         | network is crappy) and being able to send just a few keystrokes
         | and get a lot of power out of it is helpful.
         | 
         | That's not counting all the "repeat" patterns or complex search
         | and replace.
         | 
         | I remember still when I got my first job as a junior sysadmin,
         | I spent a really long time logging in to each machine, updating
         | a config file, logging out then going to the next one.
         | 
         | I didn't need to be told that "ssh and nano is fine", I needed
         | to be told "there are better tools that you should invest in
         | learning, because they will repay you back thousandfold".
         | 
         | What I thought were people looking down on me were in fact
         | people looking at me with hopeless pity, because I fought the
         | idea of learning vim.
        
           | davmar wrote:
           | +1 for vim. I also spent a lot of time resisting it. Now it's
           | all I use because it's just so much better.
        
           | crazygringo wrote:
           | > _What I thought were people looking down on me were in fact
           | people looking at me with hopeless pity_
           | 
           | Or maybe they actually were looking down on you. When we feel
           | bad in response to someone else, we're not usually
           | misinterpreting the emotional cues.
           | 
           | It's not just what they say -- it's the _way_ they say it.
           | 
           | Which is why the term "constructive criticism" exists. If you
           | want to help them, then make them feel _good_ by expanding
           | their knowledge. But support them in their own choices and
           | autonomy.
        
             | edoceo wrote:
             | Have you tried...
             | 
             | Vs
             | 
             | What you should do is...
        
           | ghaff wrote:
           | It also depends what you use an editor for. Back when was
           | doing more programming, I used something more powerful for
           | the DOS environment--yes this was a while back.
           | 
           | I tend to use nano because I'm mostly making changes to
           | config files and the like so I mostly want simple.
        
           | 2muchcoffeeman wrote:
           | _Maybe not everyone's experience mimics mine but I felt like
           | people looked down at me a bit when I was 16 for using nano
           | on the command line. ... What I thought were people looking
           | down on me were in fact people looking at me with hopeless
           | pity, because I fought the idea of learning vim._
           | 
           | People need to check how they encourage other people or
           | promote things. You probably weren't wrong about feeling
           | looked down upon. Even if they really thought you would
           | benefit.
        
         | dheera wrote:
         | It's not gatekeeping, anyone can use any editor they want, but
         | you bet I _will_ judge your ability to code by your preference
         | of editor, for the simple fact that there are lots of frequent
         | tasks in coding that the basic editors like nano /gedit/Notepad
         | do not provide for. Simple tasks like jumping to line numbers,
         | refactoring and search/replace with regexes, sending the output
         | of a set of lines through a command, syntax highlighting,
         | importing from a file, looking at column numbers, split pane
         | editing, repeating commands, ease of conversion between
         | DOS/UNIX carriage returns, git status, being able to insert 4
         | spaces when you hit the tab key, being able to adjust the
         | indent level of multiple lines at once, and much more, I expect
         | experienced coders to want at least a large subset of this
         | stuff in their editor.
         | 
         | If you say your favorite editor is vim, emacs, sublime,
         | eclipse, VS code, Atom, pycharm, anything along those lines,
         | I'll likely think you're an experienced coder. And if you have
         | an especially strong opinion, I'll consider you even more
         | experienced, even if your strong opinion differs from mine;
         | simply by virtue of having of strong opinion it means you
         | likely have been using it for years and have found other tools
         | inadequate for your skills.
         | 
         | If you say your favorite editor is gedit, notepad, or nano,
         | chances are I won't think of you as beyond a beginner-level
         | coder. It means you have zero desire for certain features that
         | are almost necessary to be efficient in large software
         | projects, and signals to me that your skill set is possibly not
         | high enough to have experienced that desire for advanced editor
         | features.
        
           | accelbred wrote:
           | Jumping to line numbers can be done with mouse. Refactoring
           | and search/replace can be either sed or grep and copy/paste.
           | Filtering text through a command can be done in your shell.
           | Nano has syntax highlighting. Importing from a file is copy
           | and paste. Not sure when you really need column numbers.
           | Split pane editing is tmux or multiple windows.
           | 
           | Now I'll take my customized and plugin-full neovim setup over
           | that any day, but that does not mean a developer cannot be
           | fully competent with nano. I've worked with large projects
           | where I didn't have access to neovim or my setup and just zsh
           | and vi were enough to get the job done. Having to use nano
           | would have been more of an inconvenience but it would have
           | not been in any way undoable. Understandably, a dev would be
           | more productive with their preferred setup, but if a dev
           | couldn't work without it, that would be a red flag.
        
           | brazzy wrote:
           | >And if you have an especially strong opinion, I'll consider
           | you even more experienced, even if your strong opinion
           | differs from mine; simply by virtue of having of strong
           | opinion it means you likely have been using it for years and
           | have found other tools inadequate for your skills.
           | 
           | If you really think strength of opinion indicates experience,
           | then clearly you don't have a lot of experience with
           | people...
        
           | techrat wrote:
           | > It's not gatekeeping,
           | 
           | > you bet I will judge your ability to code by your
           | preference of editor,
           | 
           | FYI. That's called 'gatekeeping.'
        
             | trey-jones wrote:
             | It's kind of a misnomer then, isn't it? He's not preventing
             | anybody from doing anything, just forming a preconception
             | based on what I think a lot of people would agree is sound
             | logic:
             | 
             | That on average, people whose first instinct is `nano` to
             | edit a file in Linux have less experience than people whose
             | first instinct is `vi(m)` (or, selfishly `emacs`).
        
               | techrat wrote:
               | https://www.urbandictionary.com/define.php?term=Gatekeepi
               | ng
               | 
               | > When someone uses a hobby or interest as a means of
               | elevating themselves above others to give oneself a sense
               | of being superior transforming their passion or knowledge
               | about a particular subject into an ugly tool of self-
               | inflation.
               | 
               | The shoe fits.
               | 
               | First editor I used was vi/vim.
               | 
               | For years it was the only editor I could use. (My CS
               | education and school server use predates Pine/Pico/Nano
               | and later on, it was a long time before nano was an
               | option on more restrictive/specialized machines)
               | 
               | I still prefer nano.
               | 
               | In the end, I don't give a fuck what you use as long as
               | you can get the job done.
               | 
               | Passing judgement on what people prefer to use is the de-
               | facto definition of 'gatekeeping.'
        
           | GekkePrutser wrote:
           | Many of the things you mention are absolutely in nano :) Like
           | highlighting, jumping to a line, importing.. I don't have the
           | time to do a point by point comparison but trying nano for 5
           | minutes doesn't equate knowing it, just like with vim.
           | 
           | I'm not big into coding anymore and nano is handy for my
           | muscle memory, coming from DOS :) It's good enough for my
           | purposes. Sure vim is more powerful but it's not as
           | accessible to the casual user. It's a good tool for its job
           | just like vim is. They're just different jobs.
        
             | ixfo wrote:
             | Absolutely. I use loads of those features including regexp
             | in nano all the time and it works fantastically well. For
             | me it's the fact that it's small (so available on nearly
             | every platform) and the command interface is so _quick_. It
             | 's light, fast, and snappy to drive - no context "shifts"
             | to get to commands, and I can do "power user stuff" with
             | just a simple key shortcut _which is written on the screen
             | so you can see it_ most of the time. It's easy, and that's
             | worth more than a thousand vims. See also the success of
             | Visual Studio Code.
        
         | shapefrog wrote:
         | I too was bullied from nano onto vi/vim. I still dont think I
         | 'get it' but the brainwashing is complete, I cant even type the
         | word nano into a terminal.
         | 
         | I too applaud the author for their bravery in coming out as a
         | proud nano user, not that there is anything wrong with it.
        
       | hprotagonist wrote:
       | there are far worse choices. for quick stuff, i either emacs -q
       | or nano more or less interchangably, and in my larval stage i
       | lived in nano (and pine!) for many years happily enough.
       | 
       | These days, i find that my movement key memory will betray me in
       | nano at the worst time(s), so i tend to stick with emacs -q -nw
       | for light-and-fast stuff, but when that's annoying to obtain,
       | i'll happily fall back and think more carefully about my
       | keystrokes.
        
         | Jtsummers wrote:
         | emacs --daemon
         | 
         | Then connect with emacsclient. You can also name the daemon
         | which lets you have specific configurations for specific tasks.
         | At that point, launching emacs for quick stuff is _very_ fast.
        
           | hprotagonist wrote:
           | oh, i know. sometimes i want barebones as well.
        
       | rubyist5eva wrote:
       | no matter what you editor you use, set EDITOR to whatever you
       | want, then when you want to edit files as root do `sudo -e
       | /path/to/file`
       | 
       | thanks me later
        
         | darnir wrote:
         | Or even simpler use `sudoedit /path/to/file/`
        
           | rubyist5eva wrote:
           | sudo -e is less characters to type tho, though I guess you
           | can do sudoe<TAB> and complete it...choices, choices
        
         | _def wrote:
         | The more you know. Thanks!
        
         | throaway46546 wrote:
         | How is it better than `sudo vi /path/to/file`?
        
           | dllthomas wrote:
           | `sudo vi` runs vi as root, which means 1) it won't have your
           | users configurations, and 2) it's probably way the hell over-
           | privileged for what you are trying to do.
           | 
           | `sudoedit` (and equivalently `sudo -e`) makes a copy of the
           | file that you can edit and then copies it back as root iff
           | it's changed.
        
       | _def wrote:
       | nano was my cli editor of choice because I was overwhelmed by
       | vim. For years I felt subpar and thought that I should learn
       | using vim. I'm using vim for some years now but I don't really
       | make much use of it's features, maybe an occasional cut and
       | paste, which probably can easily be done with nano too.
        
         | dllthomas wrote:
         | https://vim-adventures.com/ is a fun way to flesh out your vim
         | understanding. I've only been through the free bit and balked
         | at the price tag, but very much enjoyed what I played and if I
         | weren't already well versed in vim it would probably be well
         | worth it to continue.
        
         | RandallBrown wrote:
         | My dirty software engineering secret is that I don't know how
         | to use vim. Like at all. I've been a developer for over 10
         | years at this point.
         | 
         | The only thing I remember is that some combo of hitting the
         | escape key and typing :wq gets me out of it. When I get a new
         | machine I have to immediately change the default editor for git
         | so I don't get totally stuck if I need to edit a commit
         | message.
         | 
         | I also use a GUI text editor for git...
         | 
         | I really appreciate that nano has it's shortcuts written on the
         | screen for me to use. It's my CLI text editor of choice for
         | that reason.
        
         | bspammer wrote:
         | An easy (and fun) way to get better at vim and learn some of
         | its features is to play vimgolf [1]. After you submit you can
         | see solutions which are slightly better than yours, and run
         | them through to see what each command does.
         | 
         | [1] http://www.vimgolf.com
        
       | tonyfader wrote:
       | please, just, no.
        
       | Guid_NewGuid wrote:
       | So I have a question and I'd like to understand if possible.
       | 
       | To me programming isn't text editing. Granted, we use text to
       | write most code outside of say Pike but effectively most
       | programming is working with symbols right? Like .subst is
       | meaningless as an operation on a string but .substring(0, 1) is
       | meaningful.
       | 
       | So I don't really get the advantage of such, to my mind,
       | rudimentary text editors. At a minimum surely being given
       | contextual information about the symbols you are working with
       | (type, fields, methods, etc) is helpful? Perhaps there are
       | languages or domains that are better suited? I can see that
       | there's not much difference between an ide and editor for new
       | languages but why do people prefer text editing and prioritize
       | typing speed where IDEs exist? Does an editor create a sort of
       | flow or deeper state since lack of tooling requires deeper mental
       | context?
        
         | bachmeier wrote:
         | > I can see that there's not much difference between an ide and
         | editor for new languages but why do people prefer text editing
         | and prioritize typing speed where IDEs exist?
         | 
         | That's not why I use a text editor (Geany most often). I find
         | the IDE to be complex and to bring on complexity. If I'm using
         | a text editor the project has to remain simple. The best
         | analogy I have was when I used Slackware. Ubuntu users would
         | laugh because Slackware didn't have a package manager that
         | resolved dependencies. Slackware users would laugh because
         | Ubuntu had a packaging system so complex that it needed
         | dependency resolution. Simply put, using a text editor imposes
         | discipline that makes programming more fun for me.
         | 
         | I'm sure I would use an IDE if I were a Dilbert-style
         | enterprise Java developer. The enterprise thing took all the
         | fun out of programming so I took my career in a different
         | direction.
        
           | Guid_NewGuid wrote:
           | > I'm sure I would use an IDE if I were a Dilbert-style
           | enterprise Java developer. The enterprise thing took all the
           | fun out of programming so I took my career in a different
           | direction.
           | 
           | I think this is the crux of my fear here. Like I don't really
           | enjoy the jobs I've had because they tend to be that kind of
           | environment. I'd compare it to being a logger whose sole job
           | is to saw lots of logs quickly. Using a handsaw just seems
           | barmy but you would probably use one when building a
           | jewellery box. I guess Unix type architecture and design
           | encourages jewellery boxes over lots of planks quickly.
        
         | arghwhat wrote:
         | To me, programming is a mental task that requires overview and
         | easy text manipulation.
         | 
         | Most IDEs get in the way of me effectively navigating the code
         | as it was originally organized, while still maintaing my
         | overview. "Big" IDEs that clearly sacrifice text area for
         | widgets, or shift text around to pop up distracting inline
         | "help" are the worst offenders. I'm looking at you, Visual
         | Studio.
         | 
         | Common IDE tools like ho-to-definition usually leads to poor
         | understanding of the code structure (and in turn doesn't train
         | for good structures). My best anology being navigating by gut
         | vs. being told where to go by an app - you never learn the
         | route and scenery if you're always busy following the route
         | instructions. And if you never start navigating by gut, you
         | never learn to find your way in general.
         | 
         | I always get frustrated by how slow go-to-definition users are
         | compared to those that just... Open the file in the tree that
         | would logically contain that part.
         | 
         | This is just one example of course - another is that IDE are
         | usually not very versatile when writing in many languages.
         | Also, a good text editor can have IDE-like features in a non-
         | intrusive way, but the difference between "IDE" and "enhanced
         | text editor" would to me be the intrusiveness.
        
           | Guid_NewGuid wrote:
           | Thanks for your answer, out of interest what languages are
           | you primarily working with and what sort of team and codebase
           | size? It sounds like being forced to consider navigability
           | would offset the tendency for codebase 'melt' in larger IDE
           | assisted projects.
           | 
           | Also one area I lean heavily on an IDE is I can switch
           | codebases up to 4 times in a day between JS and Java, so I'm
           | not going to remember structure most of the time and being
           | able to have all kinds of crutches helps me maintain
           | velocity. Do you find your sense of navigation when swapping
           | is enhanced because you have a deeper understanding of the
           | structure from memory?
           | 
           | I'd say VS Code kind of straddles that middle ground, like an
           | enhanced text editor++. But then full IntelliJ is where I
           | feel most at home so obviously we have different preferences
           | and that's fine. I just worry I'm missing out and heavily
           | dependent on IDEs.
        
         | Barrin92 wrote:
         | for me personally I noticed that using an IDE started to
         | replace my memory in a way and I didn't like it. I noticed that
         | when I program in languages with an IDE environment (Java in my
         | case) I only really slowly picked up what functions were
         | available in a libraries and I started to really dislike this
         | reliance on constantly looking up things.
         | 
         | When I just program without autocomplete or for that matter
         | constantly googling I actually paid way more attention to
         | 'where things are'.
         | 
         | In python I pretty much know what every string method is. In
         | some languages I used IDEs for I was still scrolling through
         | the completions because I somehow never picked anything up.
        
           | Guid_NewGuid wrote:
           | To be fair my memory has always been terrible. I loathed
           | times tables at school. I still don't really know them. I
           | just feel like if I need to know I'll use a calculator and if
           | there isn't one available I'll have other problems like clean
           | water and food! Having a general sense of 'size of' numbers
           | was enough and I'm pretty good at maths.
           | 
           | I get that it impedes memorization but how does that scale to
           | using new libraries which may lack documentation? I'm jealous
           | of your memorization of those string methods, every time I
           | switch to JavaScript I feel lost because I don't recall
           | substr Vs subString Vs substring etc!
        
         | nonameiguess wrote:
         | There are many parts to answering this.
         | 
         | First, "plain" text editors have caught up with IDEs in many
         | ways that you're talking about here. With a good LSP plugin,
         | you can hop to definition and autocomplete perfectly fine. For
         | a strong statically typed language, the editor can even tell
         | you why it won't build and how to fix it before you even try.
         | Many things you used to need an IDE for just no longer require
         | it.
         | 
         | Second, even without those tools, people hacking away at a
         | keyboard are often doing a lot more than just writing
         | executable code. You're editing config files, READMEs,
         | comments, documentation templates, test data, API request
         | examples. None of these things are amenable to any of the
         | niceties an IDE can help with.
         | 
         | Third, in a microservices world or even just working on a plain
         | library that calls into lots of other libraries, unless you
         | download the source code for every dependency, hop to
         | definition and autocomplete isn't guaranteed to work anyway.
         | It's often easier to pull up the API documentation in a browser
         | on a second monitor and refer to it while working. Screen real
         | estate is cheap these days and the more mature projects you're
         | better off using as dependencies anyway tend to be pretty well
         | documented.
         | 
         | Fourth, an increase in the use of dynamic languages has brought
         | with it an increase in dynamically-generated code. There's a
         | lot of convenience here in reducing the amount of boilerplate
         | you need to type out and being able to change behavior without
         | even having to rewrite the core code, but it also makes IDEs
         | less useful. It pushes the mental burden of understanding how
         | code gets generated and runtime objects get decorated and
         | changed by understanding the underlying data model of the
         | language and its runtime, but hey, that's what we're paid for.
         | 
         | Fifth, what does it even matter in the grand scheme to have
         | definitions and names more readily available inside the actual
         | window you're typing into? It's a convenience, sure, but if you
         | type subst when it should have been substring, you try to build
         | or run a test or just a static analyzer or whatever and you get
         | an error message and remember "oh yeah, that's Language X and
         | I'm writing Language Y," you lost what? A minute at most to go
         | do a global find and replace? Compared to the time studying a
         | problem domain, designing and vetting a solution, coming up
         | with adequate test cases and a suitable type representation
         | that models the domain, the time spent literally typing out
         | function names is minuscule. I'm not going to say saving
         | seconds there is worthless, but it's not a huge gain.
        
         | haolez wrote:
         | It's not about the editor: it's about the combination of other
         | tools. Simple text editors invite you to use specific tools for
         | specific tasks that an IDE aggregates and configures for you.
         | 
         | An IDE is usually good enough, but for some environments,
         | having total control of your tooling can give you big
         | productivity boosts. And not every software depends upon lines
         | and lines of code. Sometimes, you will write useful software
         | that's only a couple hundred lines, but required you hundreds
         | of hours thinking about the problem :)
        
         | kevin_thibedeau wrote:
         | The advantage is you don't become dependent on an IDE. Ever
         | seen someone who can't write anything without all the IDE aids
         | to fill in code for them?
        
           | Guid_NewGuid wrote:
           | Haha you're pretty much describing me. I think autocomplete
           | overlaps with spellcheck in a text editor. You won't improve
           | your spelling by relying heavily on a spell checker but it
           | won't really affect your vocabulary either and enables
           | everyone to write syntactically correct text.
           | 
           | Programming is more about telling the story or writing the
           | speech than the spelling of the text. Treating code as
           | manipulating plain text just freaks my brain out as the wrong
           | abstraction level. But as I try and remind myself 'different
           | people like different things and that's ok'.
        
           | crispyalmond wrote:
           | I fully agree to an extent. Some APIs (e.g. Android) are huge
           | and a pain to type in Java without some sort of completion.
           | Maybe I'm just lazy or used to C, but Java makes having an
           | IDE almost essential.
        
           | foolfoolz wrote:
           | when do you ever not have one? work isn't like camping or
           | something. you always have your computer
        
             | kevin_thibedeau wrote:
             | When using a language without an IDE. In a shell. At home.
        
           | jenscow wrote:
           | Ah, I don't know... I don't depend on an IDE, they just make
           | things much quicker and easier for me.
           | 
           | And let's say I do depend on one.. it's not like I'm going to
           | be dropped at a computer where I'm not allowed to use an
           | IDE... but it would just take a day to adjust.
           | 
           | For me, anyway.
        
       | thayne wrote:
       | > it provides all of the features from vim I would want anyway,
       | but in a modeless format
       | 
       | > vim-like functionality with modeless editing
       | 
       | > nano is a quite capable editor in its own right
       | 
       | but the only features that are mentioned are syntax highlighting
       | and hiding the help text.
       | 
       | Looking at the man pages for nano, it _is_ a lot more capable
       | than I had previously though (though not as capable as vim or
       | emacs), but the author doesn't really go into that.
        
       | filmgirlcw wrote:
       | Nano (or pico) is great for very small, quick edits. I often use
       | it when setting up a VPS for the first time before configuring my
       | editor's remote SSH exten B sion (or in the past, installing
       | rmate). I wouldn't personally use it for more than just a quick
       | change, but to each their own!
        
       | hughrr wrote:
       | Quite impressive.
       | 
       | I actually don't use nano though only because it's not always
       | there. I learned a long time to pick a narrow subset of
       | ubiquitous tools to know really well, compose those and leave it
       | at that. If I'm dumped in single user mode somewhere with no
       | network, or on a system I don't have the ability to install
       | packages on, a usable vi implementation is always available.
       | 
       | Going back a couple of decades a colleague was stuck on a Solaris
       | box because he needed pico installed and Miss root was off sick.
       | He learned vi that day.
       | 
       | Incidentally I used to embarrassingly suck at vi until I
       | completely hosed a couple of systems.
        
       | tpoacher wrote:
       | It's worth pointing out that many distros ship with a positively
       | prehistoric version of nano (i.e. v2.9), whereas the latest
       | version is actually lightyears better.
       | 
       | I agree with the author completely.
       | 
       | As for the "yes but vim keystrokes" apologists, honestly I have
       | yet to find something truly important I can do with significantly
       | less keystrokes in vim. (especially if you factor in
       | programmability and macros).
        
       ___________________________________________________________________
       (page generated 2021-08-13 23:00 UTC)