6 ms·
GNU Nano 8 comes with modern key bindings
- marssaxman 2y agoOh, wow! This was one of the reasons I wrote my own editor, years ago - I liked nano and used it frequently, but preferred conventional GUI-style control-key bindings.
- Denvercoder9 2y agoI'm genuinely intrigued, what made you decide to write your own editor instead of patching the keybindings in nano?
- forgotpwd16 2y agoDon't even need patching. Could've CUA keybindings by entering them in the rc file. bind ^X cut main bind ^C copytext main bind ^V uncut main bind ^Z undo main bind ^Y redo main ... (Those are from an old rc that had around. The copytext/uncut have been renamed in newer versions.)
- le-mark 2y agoIt blows my mind that this wasn’t more widely publicized over the years. At least this is the first time I’ve seen it, and I learned vim a long time ago. Partly because if it was a choice between weird keys, may as well learn vim.
- 3836293648 2y agoThey're even in the default global config, just commented out at the bottom
- bravetraveler 2y agoIt blows my mind how many people need directed at the included documentation or config files. Sheep to slaughter. Before anyone judges me for judging, instructions-included is pretty consistent across disciplines. I'm not a mechanic but I can figure out routine maintenance/customization. I'm surprised you, and surely others, arrived at switching editors instead of changing the editor itself. Not in the source or with compilation. The configuration. I know you say partly, I just doubt there is any perfect editor. All roads lead to configuration.
- marssaxman 2y agoThat was only one of the reasons. The keybindings were the seed of the idea, but as soon I started thinking about what I would like to change, I realized that I also wanted multiple edit buffers and a directory browser. Essentially it's my all-in-one coding environment.
- p4bl0 2y agoFWIW, nano can have multiple edit buffer, just add "set multibuffer" in your .nanorc to activate this feature :).
- marssaxman 2y agoSeriously!? I had no idea. What an underappreciated bit of software nano is.
- p4bl0 2y agoI really love nano. It's so cool to have an easy to use fast and reliable code editor with just a bit more than basic functions. I often see it dismissed as too basic while in reality with a minimal amount of configuration nano supports syntax coloration, line numbering, automatic indentation, the mouse to position the cursor, scroll, and to activate command (by clicking on them in the bottom help), theme customisation, multiple files opening, keyboard macros, and a few more other things that doesn't come to my mind right now. It can actually go a long way before you actually need something more powerful :).
- shric 2y agoIs there any reason to use nano over vim other than learning curve? If nano ever gets run for some reason (e.g. I forgot to set EDITOR) I immediately quit and launch vim. I readily admit nano is easier for beginners to get something done, but I don't see any value in it if you already know vim enough for basic edits.
- p4bl0 2y ago> Is there any reason to use nano over vim other than learning curve? A simple matter of preference, I guess :).
- tpoacher 2y agoThe simple answer is "no", in the same way there's no need to write a python script if you really like java. For a non-trolling answer though, for me iy's the ease with which nano's macros can be used and the easy syntax highlighting. Not long ago, I wanted to create syntax highlighting to support my own format in nano and vim. The nano one took me 5 minutes. The vim one took me 2 days.
- falsaberN1 2y agoWelp, this is big enough to make Nano my default editor. While it'll take a while to become "ubiquitous" (as in version 8.0+) it's trivial enough to build for any systems I manage. The new mousewheel behavior is particularly nice. It's totally up to my taste with --modernbindings and --mouse.
- vundercind 2y agoNow if they add an edit.com-style menu at the top I’ll really never need another CLI text editor.
- xp84 2y agois there a "unix/Linux" cli text editor that replicates or approximates EDIT? I have used micro a lot, but it's a spiritual cousin of nano/pico of course. Curious what others who like editors that are nothing like Vim use. (besides emacs, which as someone who doesn't know lisp, is probably wasted on me)
- lproven 2y agoTilde. It's splendid. https://github.com/gphalkes/tilde https://github.com/gphalkes/tilde
- falsaberN1 2y agomcedit is the closest one in general look and feel. It's installed together with Midnight Commander. Of course it can be used as an independent editor. EDIT:Sibling post proved me wrong, Tilde also exists. How interesting.
- falsaberN1 2y agoI wouldn't complain for sure. I always loved edit.com and have such fond memories of it. I used mcedit as terminal text editor for a while, but it was never installed anywhere but at home, so ended up defaulting to vi and nano for consistency. If nano became a bit more like edit.com that'd mean it'd be almost everywhere by default once versions catch up...one can dream.
- kgbcia 2y agoGreat move. I'm not a fan of emacs nor vim complexity.
- jonathankoren 2y agoI had t realized nano had progressed beyond being a pico clone. Happy to see that.
- xp84 2y agoThis seems like as good a place as any to post the PSA that even on the current version of nano, ^s does a silent save to the current file (as opposed to the "Write Out" ^w which is like a Save As...) Why on earth this one doesn't merit inclusion in the command bar is beyond me.
- gnuvince 2y agoProbably because some terminals interpret Ctrl+S as a "pause the terminal" command and if you don't know about it, it looks like your editor has frozen.
- yingbo 2y agoGreat change! I really hate to remember different key bindings crossing editors.
- pzmarzly 2y agoThis is great! I used to install micro[0] as "nano with better shortcuts", but it was always a bit of an overkill, so I'm really happy with this change. One quirk that remains: even with --modernbindings, Ctrl+X and Ctrl+C will add to nano's clipboard, instead of replacing whatever is there. [0] https://micro-editor.github.io https://micro-editor.github.io
- tpoacher 2y agoThis is not a bug, this is a feature. One of nano's best in fact. What you say is not true except in the case of consecutive cuts. So this is a way of cutting multiple consecutive lines without requiring a visual selection. If you don't want that just move the cursor once before the second cut.
- bitwize 2y agoNow if only they could enable cua-mode by default in Emacs.
- mediumsmart 2y agoI think you can tell init not to allow any mode to launch cua-mode by default.
- rurban 2y agoOh my, I have nano as my default GIT_EDITOR. Will stay with the old defaults definitely.
- ars 2y agoNano comes from pico which in turn comes from the email client pine (which is currently forked as alpine). alpine isn't used much anymore (although I still use it) but it's progeny is still widely used, which is nice.
- deleted 2y ago[deleted]
- threePointFive 2y agoWasn't nano released after the CUA spec? Hardly seems correct calling these "modern" keybinds
- Diris 2y agoFinally, this was probably my biggest gripe with it.
- EricRiese 2y agoI don't see an option to set that in nanorc https://www.nano-editor.org/dist/latest/nanorc.5.html https://www.nano-editor.org/dist/latest/nanorc.5.html And mouse mode requires holding shift to select text. Guess I'm sticking with micro.
- tpoacher 2y agoI don't know why people gripe so much about the default keybindings. I used them for like 3 days before realisimg they are easy and make sense. I'm now in the reverse situation; these "modern" keybindings feel really clunky to me.