[HN Gopher] micro - A Modern Alternative to nano
___________________________________________________________________
micro - A Modern Alternative to nano
Author : mdwalters
Score : 322 points
Date : 2023-08-18 04:06 UTC (18 hours ago)
(HTM) web link (micro-editor.github.io)
(TXT) w3m dump (micro-editor.github.io)
| Semaphor wrote:
| Out of 14 other submissions, 2020 [0] had 103 comments and 2021
| [1] 162 comments.
|
| [0]: https://news.ycombinator.com/item?id=23334190
|
| [1]: https://news.ycombinator.com/item?id=29128702
| johnklos wrote:
| micro wants to be a small, lightweight, modern alternative to
| other things, but it's written in Go, which means it isn't going
| to be available for older systems and/or for classic
| architectures.
|
| A good alternative should be usable in a decent number of places
| where the original is usable :P
| malloc-0x90 wrote:
| Tilde is faster for bigger files, and it runs and compile
| everywhere; TextAdept even has code folding.
|
| - https://github.com/gphalkes/tilde
|
| - https://orbitalquark.github.io/textadept/
| MantisShrimp90 wrote:
| I guess this is for people that don't use Neovim but never want
| to leave the terminal? Just kinda seems like the worst of both
| worlds to me. Less powerful than neovim while still using the
| same configuration language, yet less ubiquitous than even vscode
| at this point which does have many easy download options.
| cmrdporcupine wrote:
| What a strange comment, as if everyone wants or needs to use
| vi...
|
| Believe it or not, _most_ people don 't like or use modal
| editing and vi-style keybindings. Yes, Vim is extremely
| popular, but it's still a minority of people who are typing
| text into computers. The vast majority of people out there are
| working in editors with "traditional" direct, modeless, editing
| and some variation of "standard" (aka Windows/Mac) or Emacs-ish
| keybindings. (Hell, even bash/zsh/readline -- effectively a
| single line text editor -- ships with a sub-variation of emacs
| keybindings by default.)
|
| Personally, I use emacs -- when it's available. But something
| like this looks good for lower footprint systems.
|
| Anyways, what a strange comment. Nano/Pico, etc. have been
| around since the super early days, I remember using Pico on a
| 486 back in 1993. Used to be the default editor on most systems
| that had the 'pine' email client installed, too, which was very
| common all over the place.
| xp84 wrote:
| Seriously, the fetish people have for vim and for pushing a
| modal editor on people who didn't learn on such programs is
| downright weird. Vim is definitely an insane default editor
| for anyone who's not already a skilled fan of it. Micro even
| has mouse support, making the incredibly common task of "put
| something at a certain place in this config file" trivial,
| versus vim where you only need to memorize 12 random key
| bindings to become more efficient at keyboard cursor control
| than what a 7-year-old can do with a mouse.
|
| I classify vim usage more as a religion than anything else.
| That doesn't mean I don't respect how effective that 0.5% of
| developers can be with it, but nearly no one I've met is as
| efficient in it as they'd be in VSCode, and about 95% are so
| unskilled in Vim that they get tripped up by just the basic
| mode switch and remembering :wq. They should not even be
| bothering with it. But sadly it seems 80% of people think
| it's mandatory to use it to edit random files on servers, and
| as the editor for things like git.
| cmrdporcupine wrote:
| Absolutely it feels disrespectful maybe in the context of
| Bram Moolenaar's recent passing, but... To me the vim thing
| is kind of cultish?
|
| I have encountered many gatekeeping-elitists out there who
| act like this is some kind of entrance exam for competence
| in our profession or something. It's disturbing.
|
| Early on I went with the emacs religion instead of the vi
| religion. That merely came down to the fact that my
| favourite MUD/MOO client was in emacs (it was amazing,
| BTW). And because emacs was on the HP-UX systems I was
| playing on. And because the modal editing in vi seemed
| crude and slow to me.... but in the intervening years I'd
| never thought of telling anybody around me that _they_
| should be using emacs or judged them for not using it?
|
| But I've now encountered several people in the last 20
| years who said things like _" I wouldn't hire somebody who
| relies on an IDE to write code"_ always along with an
| aggressive promotion of vim.
|
| Anyways, I think vim is neat. I respect it. But I won't use
| it... Don't Mode Me In.
| punnerud wrote:
| On Mac, add it to terminal with brew:
|
| brew install micro
|
| The command on the webpage will only add it to the location you
| run it.
| linuxdude314 wrote:
| Thats because wherever you downloaded it isn't in PATH.
|
| If you don't want to use brew and want it available everywhere
| just set PATH=$PATH:<location of script>
| Roark66 wrote:
| I'm not sure why do we need one. Nano works fine everywhere.
| mixmastamyk wrote:
| It has unique keybindings. I used to change them, but don't
| need to with micro.
| petabytes wrote:
| Been using it as my main editor for the past 3 years now, coming
| from Sublime Text. It's been a great editor so far, but it's
| missing a lot of modern features, and the plugin support seems to
| be next to none.
| xp84 wrote:
| I must be weird because I see a major divide in editors. CLI
| editors are for light text editing and don't need plugins.
| Updating a line in a config file, etc. I've never even wished
| for a plug-in for them. IDEs need plugins. They're for coding.
|
| (I know some people use vim or emacs for coding, with 1000
| amazing plugins, but I think deep down they're masochists in
| the first place, especially vim.)
| legends2k wrote:
| I think people who reach for an IDE are deep down spoiled
| brats who need everything on a platter.
| tipiirai wrote:
| Why did you leave Sublime?
| dr_kiszonka wrote:
| I use Sublime daily exclusively for quick notes and as a
| scratch pad/clipboard. What I have started noticing recently
| and what worries me is that with only the most basic Markdown
| plugins it now uses 1 GB of RAM and is somewhat less snappy
| than it used to. I really hope it goes away soon but with
| other editors getting more resource-heavy, I am worried.
| manuelmagic wrote:
| I have tens of files open in ST right now and it's using 16
| MB of RAM. I'd suggest some tests without the plugins you
| are describing.
| itsoktocry wrote:
| > _I 'd suggest some tests without the plugins you are
| describing._
|
| How is this useful if you want to use those plugins?
| LoganDark wrote:
| Sublime has syntax highlighting, but no analysis or
| refactoring features
| Ennea wrote:
| It has support for LSP, with plugins that integrate the
| various language servers out there.
| LoganDark wrote:
| Since when? I can't get Sublime to do anything useful.
| Have a link?
| Nuzzerino wrote:
| https://lsp.sublimetext.io/language_servers/
| akho wrote:
| It's an alternative to nano, not to vsc.
| prmoustache wrote:
| Micro? really? a 11MB binary?
| kioshix wrote:
| Seems like a really modern alternative to my 389K nano.
| oytis wrote:
| Micro should have been 389M then.
| KolenCh wrote:
| 11 Micro TB
| [deleted]
| daneel_w wrote:
| Well, it's written in Go, so...
| benhoyt wrote:
| Yeah, "micro" for an editor would be 11 _kilo_ bytes. I bet it
| 's possible to do a half-decent editor in C in 11KB. Antirez's
| "kilo" (~1000 lines of C) is 36KB when compiled with standard
| gcc (https://github.com/antirez/kilo).
|
| That said, for many server-type use cases these days, 11MB
| isn't a huge deal. Still, I wonder if micro could be compiled
| on / ported to TinyGo and end up a few hundred KB? It looks
| like TinyGo can produce some pretty small binaries:
| https://tinygo.org/docs/guides/optimizing-binaries/
| prmoustache wrote:
| >That said, for many server-type use cases these days, 11MB
| isn't a huge deal.
|
| Yes but that doesn't make it a good candidate for a default
| editor that would be ubiquitous, from small embedded
| development stuff to servers to desktop.
|
| I don't mind several MB when the tool offer more than the
| competition. But what are pico/nano lacking really when it
| comes to editing a few lines in a config file once in a
| while? It is not like micro is trying to replace visual
| studio code or emacs either. Or is it?
| otterpro wrote:
| Vim on my macbook is 5MB. Perhaps Micro can be optimized for
| smaller-sized binary?
| prmoustache wrote:
| On some linux distros (debian based) there is a im-tiny
| package smaller than the full blown vim.
|
| Also historically vim was not the default vi clone installed,
| which was an optionnally installed package. The default was
| very often a smaller clone: elvis. Busybox as its own vi
| clone and most BSD OS are still providing nvi by default
| stracer wrote:
| Longer name, harder to type, probably won't catch on.
| seabrookmx wrote:
| echo 'alias m="micro"' >> ~/.bashrc
| pepa65 wrote:
| I think nano is modern itself, still actively being developed,
| and for the past few years more or less feature complete. But if
| nano wasn't there, I would probably be using micro.
| xp84 wrote:
| Too many awkward keyboard commands though. To save and quit:
| ^o, Return, ^x
|
| Vs Micro ^s ^q
|
| Honestly that, and ^k (kill to end of line) are the only
| commands I use in any CLI editor.
|
| Ironically my muscle memory actually learned the obnoxious
| 3-step nano way so I usually forget to use micro.
|
| But every time I work with a developer under 40 and see them
| fiddling with vim trying to wrestle with vim to do simple text
| entry with a git commit message, I help them set $VISUAL and
| -$EDITOR to micro, although I have to remember the config to
| turn on the help/status bar that shows the commands, since they
| inexplicably turned it off by default a few years ago.
| freeopinion wrote:
| Whenever I see a developer under 40 struggling to figure out
| what all the carets on the bottom of the screen mean...
| Jiocus wrote:
| Are you sure about those nano commands? Since a few years
| I've always found nano system defaults to be:
|
| ^s: Save
|
| ^o: Save as (type out filename, save and return to editing)
|
| In other words, to save and quit:
|
| ^s,^x
| xuejie wrote:
| I've been using micro as my main code editor(well I do use vscode
| for writing coq but that's the only exception) after 10+ years'
| time with emacs. I simply treat micro as the modern compromised
| version of acme. It almost has all the features to support the
| core idea of acme, I have written a plugin to exploit this
| direction: https://github.com/xxuejie/micro-acme So far it has
| been working perfectly for me.
| alberth wrote:
| Knowing nothing about micro, is there a reason why development
| has slowed down over the last 1-2 years?
|
| https://github.com/zyedidia/micro/tags
| aslilac wrote:
| because it's a text editor that's already fully capable of
| editing text. not every thing needs to constantly evolve and
| add features at a break-neck pace.
| alberth wrote:
| Emacs, which is ~40 years-old, still regularly has multiple
| updates per year.
|
| https://www.gnu.org/software/emacs/history.html
| fermentation wrote:
| You can order pizza and get a quote for a mortgage within
| emacs
| zyedidia wrote:
| A big reason is because I started a working towards a PhD
| recently, and so I've been more focused on that. I think
| micro has also reached a relatively stable spot, where it
| would only be significantly improved with some large new
| features. It is serving its purpose well as a simple/familiar
| terminal-based editor. I have plans to give it more love and
| release a version 3, but no timeframe.
| [deleted]
| cmrdporcupine wrote:
| I keep trying stripped down terminal editors as alternatives to
| emacs -- because these days I use like 1% of emacs anyways --
| but I always severely miss the common emacs major modes for
| C/C++ etc and especially its approach to indentation there (tab
| to force correct indent). I really wish other editors would
| follow this convention.
| antics9 wrote:
| Same here. Went from Emacs to Acme, while using mg in the
| terminal. Now I've customised Micro to get that Acme feel.
| aidog wrote:
| I love micro, I just wish it had a file selector like nerdtree
| and a shell.
| Borborygymus wrote:
| Software project name DNA.
|
| MicroEmacs -> Pico -> Nano -> Micro
| einr wrote:
| PICO is the PIne COmposer -- the editor that came with PINE,
| the e-mail client.
| Borborygymus wrote:
| Pico was based on MicroEmacs 3.6. Nano is an open source
| clone of Pico - there's definite DNA in that series. I'm
| assuming not in this new Micro, but it's faintly amusing that
| the name seems to be a play on something that was a play on a
| name which was a play on a historical namesake of the new
| thing.
|
| Circles.
| cmrdporcupine wrote:
| Mildly amusing joke, but, as sibling pointed out, different
| lineage.
| Narushia wrote:
| Been using this for years, really great for making quick edits in
| the terminal. Mouse support and standard editing shortcuts _as
| the default_ (unlike many other terminal text editors) are the
| best features in my opinion.
| Geezus_42 wrote:
| What standard?
| PhasmaFelis wrote:
| I'm assuming they mean the standard shared by every GUI app
| in every OS for the last 25 years.
| mixmastamyk wrote:
| About 40 really. Mac OS and IBM CUA... early to mid 80s.
| Motif, late 80s.
| PhasmaFelis wrote:
| True, it's older than that, but I didn't recall exactly
| when it became universal across all significant
| contemporary OSes. I don't know what Amiga Workbench
| used, for example. Figured Win95-era was a conservative
| guess.
| mixmastamyk wrote:
| When the IBM PC took over basically, but interestingly
| they used the Mac as a starting point, since Microsoft
| had been using the keys. MS learned GUI programming on
| the Mac before they developed Windows. Hence the lawsuit
| Apple lost.
|
| Motif/CDE said "good enough" as well. IBM even backported
| some to its mainframes and minis.
| btbuildem wrote:
| Guessing the mainstream ctrl-c/ctrl-v as opposed to "two quad
| key combos while squatting with one foot off the ground"
| [deleted]
| Narushia wrote:
| I'm not referring to some definite standard, but to the
| conventions that have existed in most desktop apps, at least
| on Windows and Linux, ever since I first used a computer.
| Wikipedia has a good list of them.[1]
|
| The list also shows Emacs and Vim for comparison, so it's
| easy to see the deviation from the Windows/Linux conventions.
|
| When it comes to text editing specifically, at least these
| ones are deeply inscribed in my muscle memory, and I use them
| every day in a variety of applications:
|
| - Ctrl+C: copy selection to clipboard
|
| - Ctrl+V: paste from clipboard
|
| - Ctrl+X: cut selection to clipboard
|
| - Ctrl+Z: undo previous operation
|
| - Ctrl+Y: redo previous operation
|
| - Ctrl+A: select all
|
| - Ctrl+F: find
|
| - Del: delete char to the right of cursor
|
| - Ctrl+Del: delete word to the right of cursor
|
| - Ctrl+Backspace: delete word to the left of cursor
|
| - Home: go to start of line
|
| - End: go to end of line
|
| - Ctrl+Home: go to start of document
|
| - Ctrl+End: go to end of document
|
| - Ctrl+Left: go to previous word
|
| - Ctrl+Right: go to next word
|
| (And the Shift variations for selecting text regions, like
| Ctrl+Shift+Right for selecting the word right of the cursor.)
|
| I'm definitely not the fastest typer, but I feel these make
| my text editing a snappy process.
|
| Additionally, while not related to the editing itself, I
| appreciate these ones:
|
| - Ctrl+S: save document
|
| - Ctrl+Q: quit document
|
| [1]:
| https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts
| PhasmaFelis wrote:
| For the record, MacOS substitutes the Command key for Ctrl,
| but otherwise most of these are the same there, too.
| muxator wrote:
| The top intuitive to use TUI editors in my heart will always be:
| - MS Dos Edit - Turbo Pascal 6
|
| Edit felt like a windows application: select with shift+arrows,
| move fast with ctrl+home/end.
|
| Turbo Pascal's keybindings were a bit influenced by WordStar's, I
| think, so a bit old style already at the time. But, my friend,
| the TUI Toolkit, TurboVision! What did they do there! Multiple
| windows that could be dragged and resized, blazingly fast. All of
| this on a 486 with megabytes of ram.
|
| I never found any TUI editors like those two.
| richardjam73 wrote:
| When looking at Freedos a while back I found an editor called
| setedit. It does work on other platforms than DOS but I haven't
| tried it. It is influenced by the Borland C++ IDE editor.
|
| https://setedit.sourceforge.net/
| pepa65 wrote:
| Those are default bindings in nano I think. (I've been using my
| custom bindings for years...)
| pyrelight wrote:
| Turbo Pascal's UI was magical and perfect.
| mbork_pl wrote:
| Right! I also used a Norton Commander clone written with Turbo
| Vision. You could mark several files (with Insert), then press
| F4 and voila - you got multiple windows open! AFAIR, you could
| even do a "global search and replace" (across these windows).
| Powerful stuff.
|
| Although _coding_ in TV was much, much less pleasant than using
| it...
|
| Now I use Emacs, which is obviously superior to any other
| editor except Vim, which is incomparable [0] to Emacs.
|
| [0] https://en.wikipedia.org/wiki/Partially_ordered_set
| TylerE wrote:
| The one I really liked back in the day was Jed. Basically
| nano/windows style keybindings, but it had stuff like syntax
| highlighting...in the mid 90s.
| kseistrup wrote:
| I've been using jed since the 90'es. I've tried many other
| editors, but I always return to jed.
|
| Should I switch to something else, it would probably be
| kakoune.
| lloeki wrote:
| 486? Ha! I remember getting my hands on a TP copy in late 80s
| early 90s, first version I had fit on a 720k floppy but the
| second one did not (1.44), and I remember trimming it down to
| fit 720k because I had only a 640kiB 80c88 with two 3.5" 720k
| drives and no hard disk. It was plenty fast already!
|
| Then I got a 1MiB 286 Goupil G5 (with something like 20MiB HDD,
| I remember thinking that thing is so huge how am I ever going
| to fill that, which I never did) and a colour CRT, TP felt so
| blink and you miss it fast on that machine already, it must
| have been lightspeed on a 486!
|
| I for the life of me can't remember if aforementioned versions
| were (resp.) 4.0 and 5.0 or 5.0 and 6.0 though. My hunch is on
| the latter but I'm _really_ not sure. Last one I used was TP
| 7.something much later (early '00s)
| pjmlp wrote:
| TP 5.5 was the one that wasn't already fitting into a floppy.
|
| Using MS-DOS 3.3 with TP 4, was still doable on a 1.44MB,
| which I used to carry around during high school for our
| computer lab.
| [deleted]
| roytam87 wrote:
| You may give YEdit a try. http://www.malsmith.net/edit/
| pjmlp wrote:
| TurboVision in TP 6 was my path into OOP, started early on by
| TP 5.5 adoption of Apple's Object Pascal features.
|
| The framework design is marvelous, not only what it could do on
| UI level, it already had reflection, serialization, collections
| with common stuff like map/filter/sort via callbacks.
|
| Great learning experience, and good ramp into "there is more
| than one way to do OOP".
|
| Another good TUI experience on MS-DOS, also with great OOP
| ramp-up learnings, Clipper (version 5 introduced OOP support).
| tuatoru wrote:
| Try tilde editor. It's close-ish.
|
| 1. https://github.com/gphalkes/tilde
| ale42 wrote:
| Very nice discovery, thanks! Just found it was already on HN,
| e.g. https://news.ycombinator.com/item?id=34545086
|
| By the way, I noticed a long startup delay... (on tilde, and
| on micro as well). After some stracing, I found out that the
| culprit was a TCP connection attempt to an X server that I
| didn't have. (X forwarding was configured in my SSH client,
| but there was no X server running on my PC...) In case it can
| help someone ;)
| acumenical wrote:
| I've never used micro, but if you look at the default
| keybindings[0], you'll see they're very Windows-y and might be
| to your liking.
|
| As for myself, I don't see cut-to-character or select-to-
| character like in vim, and yanking and pasting seems more
| intuitive in vim. And with visual block I don't miss Sublime
| style cursors at all.
|
| 0:
| https://github.com/zyedidia/micro/blob/master/runtime/help/k...
| boxed wrote:
| The selection model is unfortunately a bit broken. For
| example shift+control+arrows and shift+down doesn't work. I
| believe the problem is that selection with shift isn't
| written to compose with other navigation.
| neteresy wrote:
| This is killing me man.
| [deleted]
| bharathyes wrote:
| you need to check your terminal emulator.
|
| just checked the ctrl+thift+arrow keybind, works on
| alacritty but doesnt on kitty.
| bharathyes wrote:
| you need to check your terminal emulator.
|
| just checked the ctrl+thift+arrow keybind, works on
| alacritty but doesnt on kitty.
|
| and shift+up/down works on both
| peterfirefly wrote:
| Those key combos didn't originally send any special codes
| to the app. Newer terminal emulators do.
|
| (I once wrote a hack for Linux that opened a connection to
| the X server and used the xkb -- X Keyboard Extension --
| protocol to get info about the shift/control/etc state in
| order to synthesize shift+arrow and shift+control+arrow
| keycodes. It worked almost perfectly with a local X
| server.)
| zczc wrote:
| I think _mcedit_ is close (included with Midnight Commander):
| similar keybindings, pull-down menu on top, resizable windows
| pavlov wrote:
| The reason why MS-DOS text editors were so fast and felt
| powerful is that they used direct access to video memory to
| render the text-mode UI.
|
| Unix is still stuck on the notion of the console being an
| output stream that emulates a Teletype printer at some level.
| Full-screen text UIs work around this by adding extra layers
| for screen manipulation in a stream-oriented device.
|
| On MS-DOS, the system APIs were so primitive and limited that
| everybody (beyond basic CLI tools anyway) just wrote directly
| against the IBM PC hardware, which conveniently mapped the
| text-mode screen at a memory location. You could print or move
| or clear on-screen elements using standard memory operations,
| and there was no other software layer sitting in between
| translating the frame buffer, so updates were instant. (No
| other hardware layers either. The CRT blasted out your
| characters at most some 15 ms after your update. Today, who
| knows what's buffered in the GPU and display itself.)
|
| It's the difference between a multi-user system where you (as
| the user) get a narrow stream of I/O with the shared computer
| vs. a single-user machine where you truly control the device.
| Sadly the latter model of personal computing is increasingly
| obsolete.
| magicalhippo wrote:
| Hence some lovely text mode demos and such. Random
| example[1].
|
| [1]: https://www.youtube.com/watch?v=QSe5FGlyBFU
| cmrdporcupine wrote:
| While the 'tty' concept seems archaic, it has served Unix-ish
| systems very well in the long run, giving us a nice console
| experience with a diversity of terminal applications and an
| excellent remote experience.
|
| Meanwhile Windows never really implemented a proper universal
| console abstraction -- until recently -- and forced all
| console output through the same terrible hardcoded terminal
| with crap support for basic things like copy and paste, and
| struggled for over two decades to have a productive console
| environment, forcing administrators and power users to do
| _everything_ of substance through the GUI or tear their hair
| out. This is finally fixed, but only recently.
| matteoraso wrote:
| As an unironic GNU nano power user, I feel like this project is
| for people who want to like GNU nano but don't know how powerful
| the editor really is. Seriously, I highly recommend everybody to
| sit down with GNU nano and read the manual. There's a lot that
| you can do, almost as much as Vim in fact.
| m0rissette wrote:
| Vim is all you need.
| [deleted]
| hungryforcodes wrote:
| I understand there are alot of command line junkies here which
| might be against it -- but what's wrong with Tilde? (1)
|
| 1. https://github.com/gphalkes/tilde
| BitFlogger wrote:
| Looks like it doesn't support MacOSX...
| [deleted]
| molticrystal wrote:
| Another small TUI ide/editor to try is Orbiton [0] also written
| in go and has clang-lint, compiling, and has gdb debugging
| support, though I believe it lacks plugins. These features work
| also for Rust, C/C++, and I would imagine Zig, and Go development
| as well. I tested it on an old 2012 kindle fire and it works
| great.
|
| [0] https://github.com/xyproto/orbiton
| chromoblob wrote:
| > it's just a static binary with no dependencies
|
| Okay, how does it decide which color escape sequence to output?
| Does it have an inbuilt terminal database?
| gabrielgio wrote:
| Why is there still software asking user to run sudo on something
| downloaded from the internet? Why even bother doing that script
| if there is a easier, safer, with smaller footprint and built-in
| in all distro option available?
|
| Just as comparison, micro alpine's package has 4MB (installed)
| while its staticly compiled binary version it downloads from
| github has 11MB. The repo's package would make it more micro.
| johnklos wrote:
| Hear, hear!
|
| It is completely irresponsible to encourage piping random
| Internet sources to sudo or to (ba)sh, and I'm quite tired of
| hearing the ridiculous justification that "everyone does it".
| beeburrt wrote:
| So these are all a bad way of installing?
|
| https://bun.sh/
|
| https://www.rust-lang.org/tools/install
|
| https://deno.land/manual@v1.36.1/getting_started/installatio.
| ..
|
| I'm not disagreeing with you, as a beginner, I'm just trying
| to learn.
| jamespo wrote:
| do you read the script sections of all the packages you
| install?
| johnklos wrote:
| Yes, or I get my packages through a trusted package system,
| such as pkgsrc.
| oneshtein wrote:
| In Linux, to install virus or malware, you need to
| download, compile, and install virus manually, OR user can
| install it using `curl ... | bash`, which is much simpler
| method. Even newbies can install new malware using `curl
| ... | bash`.
| gabrielgio wrote:
| No, it is unfeasible (at least for me) to validate every
| single package. So at some point I have to trust someone/
| some party and I chose to trust more the maintainers of my
| distro than a person asking me to run sudo from curl.
| codedokode wrote:
| You do not need to trust anyone if the program is run
| inside a sandbox. This sandbox is supported in hardware
| since 80386, but Linux doesn't make proper use of it.
| Joker_vD wrote:
| And some people trust the software authors more than some
| random repo maintainers who don't have enough time to
| even make sure the packages they update are actually
| still compatible with each other.
| notnmeyer wrote:
| sudo, yes. piping to a shell is fine imo provided the install
| script is easy enough to read if you are so inclined. i have
| seen lots of generated install scripts that are mind
| boggling.
|
| the reality is that you run code you haven't personally read
| and vetted everyday. so the idea that you need some stranger
| to bless a package for you to be trustworthy doesn't make a
| whole lot of sense.
| Karellen wrote:
| > Why is there still software asking user to run sudo on
| something downloaded from the internet?
|
| Does it do this?
|
| From https://github.com/zyedidia/micro#quick-install-script
| Quick-install script curl https://getmic.ro | bash
| The script will place the micro binary in the current
| directory. From there, you can move it to a directory
| on your path of your choosing (e.g. `sudo mv micro
| /usr/bin`).
|
| It points out you need `sudo` to move the binary to `/usr/bin`
| - _if_ that 's even what you want to do - but... yeah? So?
| gabrielgio wrote:
| It says when you run the installer: Note
| that you must install micro to a directory accessible to all
| users when doing this, typically /usr/bin. cd to that
| directory before running this script. E.g.:
| $ cd /usr/bin $ curl https://getmic.ro/r | sudo sh
| or $ su - root -c "cd /usr/bin; wget -O-
| https://getmic.ro | GETMICRO_REGISTER=y sh"
| Karellen wrote:
| You conveniently missed off the lines of text above that
| which explain what "doing this" is:
| getmicro can use update-alternatives to register micro as a
| system text editor. For example, this will allow
| `crontab -e` open the cron file with micro. To
| enable this feature, define the GETMICRO_REGISTER variable
| or use the URL `https://getmic.ro/r`.
| Note that you must install micro to a directory accessible
| to all users when doing this...
|
| Yes, if you want to install `micro` as a system text
| editor, something you _can_ do (but don 't have to), you
| need privs.
|
| Again, so?
| gabrielgio wrote:
| I know why it is asking for sudo and that was not my
| point.
|
| Again, my point is: you should never ask the user to run
| sudo from curl (or actually, don't curl to bash at all).
| There are plenty ways to sploit that. Again, I know it
| needs root to move the bin to a root owned folder or
| update the default editor, but, again, you should never
| ask (or suggest) the user to pipe shit from the internet,
| it is security risk.
|
| Also there is not even reason for it, micro is available
| in every distro.
| codedokode wrote:
| This is just a demonstration of how unfriendly is Linux to
| supporting third-party software. You are supposed either to
| use software from distribution's repository or compile it
| yourself. And if you are a software developer, then you are
| on your own to decide how to support hundreds of different
| distributions (the most popular way is to statically compile
| everything into a single binary).
|
| Such scripts remind me of DOS-era "installers", and they are
| awful:
|
| - it is unknown whether your distribution is supported or not
|
| - this script is probably not tested on many distributions
| and can break something
|
| - it is unsafe, because you are running a code that some
| random person posted on the Internet without any sandboxing
| gabrielgio wrote:
| No, it is not a demonstration of anything. I'm not saying
| there is no fragmentation on linux, there is.
|
| There are many solution that try to fix that: appimage,
| flatpak, snap and what not. All of them of some degree of
| success, and pitfalls. I, for example, am happy user of
| flapak, running steam games on a alpine distro without much
| problems.
|
| But for this specific thing I just don't get why there is a
| curl/bash command. It is a wide available piece of software
| that you can easily install using distro's repo. Don't want
| to user terminal? Just download any "mainstream" distro and
| will have a store like software available, type micro,
| click install and done.
|
| Is there fragmentation in linux? Yes. Is is hard to
| guarantee it will work on every distro? Yes, a lot worse on
| software you can't compile. But micro IS NOT the
| demonstration of it.
|
| There is no reason whatsoever micro should have "curl |
| bash" on the front page.
| diego_sandoval wrote:
| Personally, I don't want a middleman to be inserted between the
| application developer and me.
|
| I want to get my applications directly from the application
| developer, because that way I can make sure that I'm using the
| officially supported version of the app and that no one has
| meddled with the code.
|
| If I don't trust the application developer, I simply don't
| install the application.
| gabrielgio wrote:
| > because that way I can make sure that I'm using the
| officially supported version
|
| No, they (the developers) can't guarantee that, nor is their
| job.
|
| You would trust them to develop a reliable software and you
| would trust the maintainer to guarantee the it will be
| properly compiled for specific OS version, has the proper
| permission set and has all dependencies it requires to run.
|
| To ask the software developer to pack and make sure it works
| for all distribution would be huge amount of work that is
| beyond their knowledge (which it is not a issue). Also it
| seems one is not aware how to properly do it when they comes
| up with a not so bright ideas like the "curl | bash".
|
| It is not you don't trust the developer, it is that there are
| people who know how to better distribute it.
|
| obs.: this is in the context of micro and general FOSS that
| is easily available and distributable.
| omgmajk wrote:
| I've been using Micro for quite some time, with some
| configuration and addons it becomes very comfy and it's enough
| for me most of the time. I miss some features though but they are
| probably more of addons than core features.
| angg wrote:
| .
| littlestymaar wrote:
| How can it be modern if it's not even written in Rust /s
| oneshtein wrote:
| > Rust
|
| https://github.com/ahmednooor/lino
|
| https://github.com/curlpipe/ox
|
| https://github.com/zee-editor/zee
|
| https://github.com/ilai-deutel/kibi
|
| https://github.com/gchp/iota
| moffkalast wrote:
| This is not a nano alternative, it follows the vim paradigm of
| having a command mode that nano does not have (for good reasons).
| It's more of a merge between vim and nano if anything, breaking
| the core intention behind nano.
|
| If you ask me, nano has a niche of a super simple terminal editor
| that anyone can look at for the very first time and instantly
| figure out, with very few pitfalls or ways to mess up. The more
| features you add, the more modes and options, the easier it is
| for newcomers to press a key combo that puts them in a state only
| intended for power users that they won't be able to get out of
| without googling.
| cmrdporcupine wrote:
| I guess my main complaint about nano has always been that it
| seems more suited for document editing rather than code --
| defaults to word-wrap on, doesn't really have syntax
| highlighting by default, not a lot of support for code-oriented
| workflow.
|
| Fine for writing up an email or commit message, I guess, but
| then I have to have another editor to write code in anyways?
|
| After 30 years of using emacs (well, these days a lot of CLion,
| too, let's call me a backsliding emacs user) I'm ready for an
| alternative. But nobody has come along with something that
| really fits the same swiss army knife niche.
| moffkalast wrote:
| Well in my experience I very rarely if ever need to actually
| code in a terminal. Sftp or rsync are usually on hand so
| there's little reason to not just go for sublime or vscode if
| I need to make a substantial change. What nano comes in handy
| for is changing config files and adjusting system settings,
| when I'm jumping around and making very small edits.
| linuxdude314 wrote:
| Agree 100%. This is the way (or use SCP).
| linuxdude314 wrote:
| Writing code in nano is so asinine and such a huge red flag.
| quickthrower2 wrote:
| https://itsthedatastupid.files.wordpress.com/2010/05/nomodes...
| kevinlinxc wrote:
| One nit: can't enlarge the carousel of images on mobile
| mpsprd wrote:
| I wonder, who is this for?
|
| I feel this kind of editor is for the sophisticated minimalist,
| used alongside a 60% fancy keyboard with ceramic key caps.
|
| I see comments about this being good for "beginners", and I
| wonder what definition they are using. Make them use a basic
| graphical editor like gedit.
| linuxdude314 wrote:
| Nano is not a powerful text editor and is generally only used
| by non sophisticated users.
| neutrono wrote:
| What is nano lacking in power?
| pie_flavor wrote:
| I use VS Code, but I don't use it for $EDITOR, because CLI
| programs popping up GUI windows always feels icky to me (and
| it's gotten orphaned once or twice). micro is a really great
| editor for people who don't use terminal editors for much.
| peferron wrote:
| I'm not on VS Code but I use micro as $EDITOR for the exact
| same reasons and it's great. I don't have to remember special
| shortcuts just to amend a git message or do an interactive
| rebase.
| mpsprd wrote:
| Ok I see. Its $EDITOR for people that dislike modal editors.
| Narushia wrote:
| It is for me, who
|
| - sometimes needs to make a few quick edits right from the
| terminal (but prefers a proper GUI text editor like VS Code for
| longer sessions)
|
| - is accustomed to the keyboard shortcut conventions of desktop
| applications on Linux/Windows[1]
|
| - occasionally, wants to use the mouse and expects it to work
| in the terminal like it would in a proper GUI text editor.
|
| Micro fulfills all these needs with its default configuration.
| It is one of the first things I install on a Linux box, be it a
| desktop or a server.
|
| [1]: https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts
| NayamAmarshe wrote:
| I love micro! Super simple to use and very intuitive.
| teddyh wrote:
| In those rare cases where Emacs is too large, I use Zile.
| satvikpendem wrote:
| Shall we just use ed instead?
| quickthrower2 wrote:
| No because I want to leave on time
| berkeleynerd wrote:
| I love micro and use it every day. Now that I've tried Helix,
| however, I want micro plus baked-in treesitter, LSP, and
| contextual help. Helix really nails it with that feature set but
| I'm just too happy with my "single-mode + commands" ctrl-c/ctrl-v
| muscle memory to switch.
| notnmeyer wrote:
| i've been daily driving helix for 6 months or so. the fact
| that's it's batteries included is so nice. great editor.
| globular-toast wrote:
| Just curious, why are people interested in small editors like
| this? The only reason I ever use vi/vim is because it's
| everywhere. If I'm going to install an editor, I'll install
| Emacs. If it's a remote system I'll simply open the file over SSH
| with tramp (essentially transparently supports remote editing)
| and retain the full power and speed of my local Emacs. For TUI
| editing (like for sudoedit, git commit, C-x C-e etc.) I run Emacs
| as a daemon so new frames, including TUI frames load instantly,
| look very close to my Emacs GUI (with nerd fonts, colours and
| everything) and are literally Emacs. You really don't need to
| have multiple editors for different use cases.
| eternityforest wrote:
| Nano is on all the OSes I ever encounter. I don't edit things
| remotely often and it's usually trivial config files.
|
| I tried micro, and liked it but it didn't quite open instantly
| on a pi and I don't use CLI editors for anything big enough to
| really need the features.
| oytis wrote:
| vim vs emacs is an age-old flamewar. I for one was never able
| to make use of emacs, it feels like a whole new hobby or job to
| configure it. Vim on the contrary is pretty convenient to use
| on default settings.
| OfSanguineFire wrote:
| I have been a Linux nerd for over two decades, but I never
| managed to grok vi, it just seems unintuitive. I found Emacs
| more attractive, and when I ssh into a low-powered device like
| a router running OpenWRT, Emacs isn't available so I use the
| editor that is available and seems intuitive: Nano. (Yes, I
| know I could also use Emacs with TRAMP, but everyone
| establishes their own personal workflow.)
|
| This comment isn't meant to knock vi. Obviously it has its
| fans. But the inability of some hackers to feel comfortable
| with it is a well-known phenomenon.
| linuxdude314 wrote:
| Have you ever sat down for an hour and tried to learn?
|
| If you're familiar with Unix tools a lot of the syntax should
| be familiar (like string substitutions).
|
| Having been a math tutor in the past, I pretty firmly believe
| anyone is capable of learning the basics of how to use vim.
|
| It's either a lack of effort or a learning disability, not
| much in between.
|
| It's really not hard to memorize a few keyboard shortcuts for
| most people who are proficient with computers.
| seabrookmx wrote:
| Just because you can doesn't mean you want to. There's
| alternatives.. if OP doesn't like vi's bindings why would
| you insinuate they're lazy or have a learning disability?
|
| For my 2c, I did invest the time and know my way around vim
| fairly well. I still prefer micro.
| Terretta wrote:
| > _interested in small editors like this_
|
| Not really interested in small editors like _this_.
|
| Very interested in small editors like* nano, for this root
| comment reason:
|
| https://news.ycombinator.com/item?id=37173126
|
| See also the opening paragraph here:
|
| https://linuxize.com/post/how-to-use-nano-text-editor/
|
| It's courteous to ensure nano in cattle builds for today's
| sysadmins that didn't grow up with vi or vim or pick the emacs
| side of that debate.
| globular-toast wrote:
| Nano is pretty decent for that reason and I definitely
| wouldn't grumble at having to use it for tiny tasks like a
| few lines of config file. Including nano (or any editor)
| inside cattle doesn't seem like it should be necessary,
| though. If you can open a shell then you should be able to
| use tramp or something similar.
| thargor90 wrote:
| We use micro because we could develop a custom plugin without
| too much effort and it is very easy to deploy (copy) to systems
| that have no good terminal editor available.
|
| Prefer vim usually, but it's too much effort to deploy a sane
| configuration to our target systems.
| mixmastamyk wrote:
| Not everyone is interested in a humongous editor with a steep
| learning curve. Some people just want to quickly _edit_ a file.
|
| You can use this with the knowledge you have already of windows
| notepad or mac simpletext and it will work on a busted or
| server machine with only a unix console.
| globular-toast wrote:
| It's funny because `emacs -Q -nw` loads instantly on my very
| modest system and supports pretty much everything `nano` does
| immediately. You can move around with arrows, you can just
| start typing etc.
|
| The one thing it's missing is telling you how to save and
| close the file etc... Makes me wonder if a nano-style help
| bar with super-simple key bindings would be a useful default
| bundle for Emacs.
|
| `emacs -Q` seems to load even faster, somehow, and that's the
| full graphical version if you have a window system.
| KnobbleMcKnees wrote:
| It also works where you don't have ssh to tunnel files, which
| is true for many servers in many professional environments.
| tasogare wrote:
| > Not everyone is interested in a humongous editor with a
| steep learning
|
| Then why using a TUI editor at all? Each time nano was opened
| because of some default settings, I saw this whole bottom bar
| with shortcuts. It sure doesn't seems to be easy to learn
| either.
| nicoburns wrote:
| I use micro as git commit/rebase editor. It's handy to be
| able to do multiline commit messages and interactive
| rebases without leaving the terminal.
| linuxdude314 wrote:
| I don't understand why so many people in these comments are
| claiming text editors are "hard" to learn.
|
| Software engineers that went to college have taken
| Calculus, Physics, and other advanced courses that can be
| very hard for many to learn.
|
| The reality is that memorizing a few keyboard shortcuts is
| not in fact hard. It's something that can take time, and
| you might not like the shortcuts, but it's not hard.
|
| If you want to use powerful tools, you're going to have to
| learn how to use them. There's no way around this.
| mixmastamyk wrote:
| You're in the wrong thread. Normal folks outnumber
| developers 100 to 1.
|
| Not to mention, some of that dev group prefer that their
| small editor have the same keybindings as their full dev
| environment and entire OS for that matter. No mode
| switching needed.
| Terretta wrote:
| > _I saw this whole bottom bar with shortcuts. It sure
| doesn 't seems to be easy_
|
| Sounds easier than _not_ seeing a bottom bar with
| shortcuts.
| mixmastamyk wrote:
| Why not? Usually it's because you don't have a GUI
| available. But also great for a quick edit with sudo.
| Ctrl+S, Ctrl+Q FTW.
| Aloha wrote:
| While this is very nice, the lack of Control-A/Control-E support
| to jump around a line is annoying.
| neutrono wrote:
| One can always use Home and End in that case.
| mypetocean wrote:
| On the other hand, Micro supports the Ctrl-based text nav/manip
| hotkeys (such as Ctrl-arrow, Ctrl-Backspace, CTRL-Home/End,
| also optionally combined with Shift for selection).
|
| More of a DOS-origin set of hotkeys than GNU. So more familiar
| to some and less familiar to others.
|
| It supports mouse interaction out-of-the-box, which is a big
| plus for some folks who haven't spent much time in keyboard
| navigation. The escape hatch is a nice option for some tasks,
| even for keyboard navigation pros.
| mixmastamyk wrote:
| micro is a great compliment to other CUA editors. One set of
| keybindings to rule them all!
| wener wrote:
| I add nano to every alpine base container, micro seems good, but
| apk add nano # Installed size 308 kB apk add micro #
| Installed size 12.17 MB
| kasperset wrote:
| Reminds me of mg editor
| https://en.m.wikipedia.org/wiki/Mg_(text_editor) It is a very
| small subset of EMacs and barely any features compare to micro.
| swozey wrote:
| I had no idea people used nano as their main code editor. I use
| it on any nix server I'm working on and have probably used it
| tens of thousands of times.
|
| I'd been a linux/bsd engineer forever and I worked at some places
| where they refused to install nano on servers. There are some
| greybeard linux admins who absolutely refuse to let someone use
| anything other than vi. I never got that. It's a 20MB package and
| not exactly much of an attack vector.
| poutinepapi wrote:
| Greybeards are going to greybeard mate. Plus, it's always funny
| to me because a lot of the old crowd you ask them what kind of
| system they ran and they(with swagger) admit that they were in
| charge of the WHOOOOLE IT department for their local
| government, and it was a big town too, so at least 500 users.
|
| And I 105% assure that that system was the most secure in the
| entire county... And also unusable. And when that lad retires
| or someone in their office kills them out of sheer desperation,
| hopefully they'll be replaced by one of these new fangled
| engineers who might not know about vi, but they at least care a
| little bit about their users(Not a lot though, we're still
| engineers)
| catiopatio wrote:
| You could have learned enough vim to be usable in the time it
| took to write that comment.
| codedokode wrote:
| How to quit Vim and install Sublime Text?
| speedgoose wrote:
| You can try Ctrl+C. Vim will of course not exit but
| display instructions about how to exit.
| rascul wrote:
| > How to quit Vim
|
| Restart the computer
| cristifalcas wrote:
| Silly you... It's Ctrl+Z
| GoblinSlayer wrote:
| Can I? I opened https://www.vim.org/docs.php but something
| bad happened to it and it displays in microscopic font for
| me.
|
| After an hour wading through the docs I found a mention of
| evim:
|
| ---
|
| This manual is about using Vim in the normal way. There is
| an alternative called "evim" (easy Vim). This is still Vim,
| but used in a way that resembles a click-and-type editor
| like Notepad. It always stays in Insert mode, thus it feels
| very different. It is not explained in the user manual,
| since it should be mostly self explanatory. See |evim-keys|
| for details.
|
| ---
|
| That's what you mean?
| swozey wrote:
| I don't know how much you actually care, and I'm the nano
| OP of this comment chain/thread but there are some vims
| (and emacs) with plugins and what not built in. Only one
| I can think of off the top of my head is
| https://spacevim.org/ but theres a bunch.
|
| If you are interested they might give you a good start.
| linuxdude314 wrote:
| Agreed. Nano use is somewhat of a red flag to me.
|
| It's SO inefficient in comparison to Vim, VSCode, or tons
| of other alternatives.
|
| If it's the only thing on the box, fine, but in reality
| usually Vim is the only editor installed.
| swozey wrote:
| I initially thought you were speaking of CPU/ram
| efficiency until you threw in vscode, so I think you mean
| developer efficiency. Vi/vim is what _you 're_ accustomed
| to. I've worked with nano since it came out, I think
| 2004-5ish. I have no idea what I used prior to that,
| probably vi.
|
| But I am MUCH faster and more efficient with nano than I
| am vi/vim/emacs. My text editor of choice is like my IDE
| of choice, it shouldn't be a problem at all for anyone to
| just accept that I'm getting my work done in a different
| application.
| cesarb wrote:
| > There are some greybeard linux admins who absolutely refuse
| to let someone use anything other than vi. I never got that.
|
| When I first encountered nano, I found out that it could
| silently corrupt configuration files (by word wrapping long
| lines) unless you were very careful to _always_ start it as
| "nano -w". Since then, I've always removed nano (or at least
| set something else as the default editor) on every Unix system
| I administer.
| zamadatix wrote:
| "-w" changes visual wrapping, it doesn't save that way. No
| different than the behavior of "cat" in an interactive
| terminal really, beyond the temptation for editor religion.
|
| There is the .nanorc option to do e.g. "setfill 80" and "set
| breaklines" but that's no different than setting a "tw=80"
| type config in your vimrc and saying vim breaks config files.
| [deleted]
| cesarb wrote:
| > "-w" changes visual wrapping, it doesn't save that way.
| No different than the behavior of "cat" in an interactive
| terminal really, beyond the temptation for editor religion.
|
| What you mentioned is "soft wrapping", which is visual only
| but doesn't affect the saved file. But the default for nano
| when I first encountered it was "hard wrapping", which does
| affect the saved file. Some distributions later changed the
| default in the nano configuration file, but depending on
| the configuration file instead of a built-in default is
| risky. See https://bugs.debian.org/cgi-
| bin/bugreport.cgi?bug=135978 (and the five other bug
| reports merged into it) for an example of the problems
| caused by running nano in the default configuration without
| disabling its line wrapping.
| zamadatix wrote:
| I stand corrected on the wrap behavior of the original
| nano 1.x. Softwrap and the default wrap mode change
| weren't added until later.
| swozey wrote:
| That's interesting. I haven't ever had that problem. I
| have had a ton of problems with zsh adding characters to
| things like SSL certs (I forgot, maybe an ending %?)
| where I had to switch back to bash to base64
| encode/decode it properly.
|
| I write the standards for our engineers to
| follow/emulate/consider. I don't have very much for nano
| but this is what I put into every containers userdata
| scripts. I can't get this curl command to show up
| correctly. # Add syntax highlighting and
| line numbers to nanorc, need to fork syntax repo so we're
| not installing random git repos curl
|
| https://raw.githubusercontent.com/scopatz/nanorc/master/i
| nst... | sh { echo set constantshow
| echo set linenumbers } > ~/.nanorc
| rascul wrote:
| If I recall correctly that default changed awhile back. One
| could also set it how they want in nanorc.
|
| However, I do understand the criticism, and how that could
| leave a bad first impression.
| notnmeyer wrote:
| pretty much madness. it's almost like a badge of honor for some
| folks.
| vdfs wrote:
| 20MB? just check nano executable and it's 277KB, the whole .deb
| packages is 860 kB
|
| https://packages.ubuntu.com/jammy/nano
| xyproto wrote:
| gccgo + upx can reduce the size of Go executables
| considerably, usually below 1M.
| [deleted]
| makapuf wrote:
| note that it does not reduce the memory size once loaded
| (and even prevents sharing pages when several instances are
| run since memory is written when decompressed, not read as
| a program binary is)
| londons_explore wrote:
| > even prevents sharing pages when several instances are
| run since memory is written when decompressed, not read
| as a program binary
|
| A shame the linux kernel doesn't have some way for
| packers to say "I am a packer, I run with access to
| nothing except the binary, therefore run me with no
| permissions and then share the pages I make with any user
| that executes me. If you like, you can even delete my
| output and reunpack me on-demand"
| xyproto wrote:
| That would be something!
| swozey wrote:
| I thought 20MB was a lot.
|
| I did "nano debian size" on google and one of them mentions -
| The Nano package contains a small, simple text editor which
| aims to replace Pico, ... Download size: 1.5 MB. Estimated
| disk space required: 20 MB.
|
| https://www.linuxfromscratch.org/blfs/view/svn/postlfs/nano..
| ..
| vdfs wrote:
| That's not true for Debian either:
|
| https://packages.debian.org/bullseye/nano
|
| But building from source is a different story, if you
| stripe and clean build dir it will be similar to prebuilt
| .deb
| JohnFen wrote:
| Personally, I strongly dislike nano and will take vi any day of
| the week over it.
|
| However, the choice of text editor is a very personal one. It
| makes no sense at all for anyone to insist that anyone else
| should or shouldn't use any particular text editor. Just let
| people use what they like.
| kunwon1 wrote:
| I was a nano user, and this happened to me. I got greybearded
| into vim, and now I only touch nano when I need to de-crappify
| a vimrc file
|
| I was mad about it at the time, but now I'm happy I made the
| change. Vim or vi is everywhere, including on the switches and
| routers I work on. Nano is not everywhere, nor can it easily be
| put everywhere.
|
| If I weren't regularly SSHing into decrepit or resource-
| constrained hardware, I would likely see less of a benefit
| swozey wrote:
| I don't know why, probably terrible memory, but I have
| practically a mental block when it comes to keyboard
| shortcuts. I've tried spacevim and a few other bundled vims
| before but I have such a hard time doing anything other than
| moving the cursor and :wq! type of stuff.
|
| Like.. this is wild https://vim.rtorr.com/
|
| And now I'm hooked on a horrible amount of vscode plugins.
| naikrovek wrote:
| you can do it. you have to _want to_ , first, though.
|
| then you sit down for an hour and you create and edit a
| file, and you do not allow yourself to hold any key down to
| move the cursor around. you have the link you posted
| printed out, and you use only what is on the sheet to edit.
|
| when you want to add something to the end of the line, you
| do NOT push the END key then enter edit mode, you look at
| the sheet and you find what you want and you push SHIFT+A
| to enter edit mode and go to the end of the line at the
| same time.
|
| you keep track of which mode you're in and what mode you
| need to do something, and you force yourself through the
| keystrokes needed to operate completely and efficiently
| using only the keyboard.
|
| in an hour, if you force yourself to use only the shortcuts
| on the cheat sheet, you will be more fluent in vi/vim than
| ~90% of the people who use it, myself included, and I've
| been using vi/vim for 25 years.
| linuxdude314 wrote:
| You might like x!
| tuxychandru wrote:
| > now I only touch nano when I need to de-crappify a vimrc
| file
|
| You can start vim with --clean to fix your vimrc.
| linuxdude314 wrote:
| You make some excellent points. Unfortunately most hardware
| at some point ends up in this state.
| un1xl0ser wrote:
| The main reason to know vi inside and out as a Unix
| administrator has to do with it being the lowest common
| denominator on Unix and Linux systems.
|
| As a *nix tech I could get a call to work on a QNX system, HP-
| UX system, SGI Altix supercomputer or a Sun Ultra 2. Linux
| systems were easy, as they had the package management support
| for FL/OSS, and would commonly come with Emacs in the base-pack
| (before nano was mainstream). Sometimes you would have a
| terminal issue and have a single line to work with, in which
| case you would need to operate vi without seeing what you are
| doing (or use sed/awk). So maybe it is those instincts to KISS
| and force everyone to learn vi, like they had to (I had to).
|
| Certainly it provides no significant surface area of attack to
| have an editor, but I wouldn't put it past a threat actor to
| leverage plugin functionality as a persistence mechanism. I
| presume that these applications operate differently as root,
| but maybe not as service (daemon) accounts. It's not very well
| hidden, but there are all grades of threat actors.
| junaru wrote:
| Haven't tried removing nano ever but hate it with a passion for
| one simple reason.
|
| If none of the EDITOR/VISUAL/etc. variables are set when you
| invoke 'visudo' a f*king nano appears.
|
| Like god dammit it i assume vi in that name comes from vi as
| even the manpage has 'vi' among 'see also'. This is akin to
| launching firefox and some random application popping up - its
| the ultimate troll and i salute your graybeards for solving the
| problem at the core!
| zwog wrote:
| That is OS dependent, though. On Arch Linux with EDITOR empty
| `visudo` opens vi.
| [deleted]
| dormento wrote:
| 20MB is bigger than some whole GNU/Linux systems I installed in
| the past. Might explain why the greybeard council disapproves
| of it.
| swozey wrote:
| You made me curious. I started w/ openBSD 1.2 in '95. I can't
| find it anywhere though to see what size it was.
| rascul wrote:
| There were some Linux distros in decades past designed to
| run off of a couple floppies. I struggle to recall any
| names at the moment.
| kunwon1 wrote:
| In 2005 I worked for a small radio shop. Firewall was
| running Coyote Linux, which booted off a single 3.5"
| floppy with write protect switched on.
| cesarb wrote:
| The classic one was "tomsrtbt" (http://www.toms.net/rb/).
| swozey wrote:
| His homepage just brought me SO much nostalgia. Just
| needs spinning skulls and construction gifs.
| http://www.toms.net/
|
| And dang he owns toms.net, nice.
|
| His resume on here hasn't been updated since 2002. Looks
| like he started his career in 1987. This is an
| interesting looking resume. Tons of skills at the top,
| goals, Other. I suppose it's cover-lettery.
|
| edit: Oh, nevermind, he has a career page updated in 2019
| - http://www.toms.net/career/ - so I guess he's been with
| Fannie Mae from 2002 - now. Good, I was a bit worried
| he'd left us.
| feldrim wrote:
| The issue of micro for me was the formatted paste. When I paste a
| piece of code, micro tries to indent it line by line. Yet, it
| does not have the whole picture. So it indents the pasted text
| gradually to infinity. And line by line inferring the format
| slows the process down to zero. You paste and go grab a coffee
| instead of watching a Matrix-like paste scene.
|
| I hope they solved it but I left at that point. If it is solved,
| I can give it a try again.
| mminer237 wrote:
| I've had that happen once when I was using it on Windows with
| Wezterm.
|
| It depends on how you paste. I'm not 100% clear how it works,
| but I believe micro reimplements pasting directly with xclip
| (idk what it does on Windows) so if you paste with Ctrl+V, it
| just instantly inserts what's on the clipboard as a block and
| copies the source indentation. If you do Ctrl+Shift+V,
| sometimes it essentially just gets the clipboard piped from the
| terminal each character one at a time, not knowing what comes
| next, so then it indents extra when it sees the return
| character and then it naively gets a couple tabs added on top.
| Yasuraka wrote:
| You could disable it (Ctrl+E, 'set autoindent off')
|
| https://github.com/zyedidia/micro/blob/master/runtime/help/o...
|
| But even when enabled (like I have) it should indently
| correctly when pasting entire blocks.
|
| If you'd like to share your setup/env/config I'd take a look at
| working out a patch
| feldrim wrote:
| It's been a while, I will try and create an issue. Bir I was
| using the default setup IIRC.
| Yasuraka wrote:
| It is enabled by default so that wouldn't be unlikely, but
| I was thinking more of the circumstances such as SSH
| tunnels, xclip or wl-clipboard and similar (or perhaps the
| most important one, version of micro itself)
| feldrim wrote:
| I only used it locally, so there wasn't any other
| application in between. I used it on Windows but I don't
| have the version -though I always keep it up to date, so
| latest or minus one- or configuration now, yet I'll
| update you with details when I get back from vacation.
| Thanks!
| pletnes wrote:
| Is it super fast on large files? (Large is 1 GB+) I've used vim
| or notepad++ for those in the past but would be happy to find
| something faster.
| bdhcuidbebe wrote:
| I use textwrangler for those massive files. Check it out!
| pletnes wrote:
| Looks like mac only? I'm often stuck on windows. But thanks!
| pbnjeh wrote:
| Ages ago, there was TextPad -- a commercial product. Back
| when I was munging textified order histories for a
| multinational (lots of orders, ergo huge text files), it
| was great up through version... 4.7.3, I seem to recall.
| Then, they started redesigning some things in ways I found
| enworsening (if I may be permitted to riff off of the
| current linguistic trend). But, IIRC, it remained fast with
| big files.
|
| This all was 20+ years ago. I wonder whether they're still
| around...
|
| https://www.textpad.com/home
| glebd wrote:
| JOE is pretty nice https://joe-editor.sourceforge.io/ -- a hybrid
| of WordStar and Emacs, and if you run it with `jstar` you get a
| pretty authentic WordStar experience which also feels like the
| earliest Borland Turbo IDEs.
| NikkiA wrote:
| native-mode joe is closer to zde/vde than wordstar, although
| jstar obviously slides that closer to wordstar.
| benhoyt wrote:
| I used to love JOE! Maybe that's why, because it had echoes of
| WordStar. I just wrote an article about how I still use the
| "WordStar Diamond" keys in Linux today:
| https://benhoyt.com/writings/wordstar-diamond/
| diydsp wrote:
| Yup! I often invoke it with "jmacs" to get the emacs keyboard
| shortcut set.
| Tomte wrote:
| Are the differences between the modes and their keybindings not
| documented in the manual?
|
| Probably I'm just stupid and overlooked them, but I really
| don't see anything.
| cmrdporcupine wrote:
| Great memories there, back in the 90s I used to use joe for
| everything that wasn't editing code. Mainly because it just
| isn't good at that, it's more of a "word processing" model,
| with word wrapping and lack of syntax highlighting, etc.
|
| But for writing text documents? Lovely little editor.
| jhallenworld wrote:
| You should try a more recent version of it: sudo apt-get
| install joe
|
| JOE has syntax highlighting, UTF-8, regex, shell windows, hex
| editing, incremental search, column/rectangular block,
| macros..
| deepspace wrote:
| Yes! The first word processor I used was Wordstar (under CP/M).
| My first programming environment was Borland Turbo Pascal.
| Later, I used "QEdit", which was configurable to use the
| wordstar keys.
|
| When I finally migrated from DOS to Unix, in the early 90s, I
| was delighted to discover JOE. It is the first program I
| install on any new Linux or *BSD box or VM.
|
| JOE has syntax highlighting and several other nice features
| these days. I have therefore never felt the need to get
| proficient with vi or emacs.
| sramsay wrote:
| I suggest nano to my students in classes where everyone is a
| beginner and we're learning programming on the command line.
|
| The greatest advantage of nano for these users is that all the
| commands are listed along the bottom of the screen. I was shocked
| to see that this is not true of micro.
| Aloha wrote:
| Alt-G brings that up apparently.
|
| Control-G brings up help
|
| There is also some sort of comment mode
| b33j0r wrote:
| I love micro for having mouse mode by default.
|
| I use it to debug containers and short-lived VMs, because
| it's easier to copy/paste stuff than configuring neovim
| (which I would normally use).
|
| However! "Help" doesn't start with G. That's a bit weird. And
| someone mentioned ctrl-c. That's a bit weird too ;)
| lofatdairy wrote:
| I imagine that the intention of micro is more like a modern,
| extensible editor, rather than a beginner friendly or
| ubiquitous editor. I think in the latter aspects, nano is still
| probably what you'd want to recommend your students (until
| they're ready for vim /s). micro is probably more for people
| who learned using nano but need more functionality/want a nicer
| ui.
| indymike wrote:
| Our team uses micro as the standard quick and dirty text
| editor, and we really like it. Micro uses familiar key
| bindings, which really helps. The name kid of tells the story
| on functionality Nano < Micro < vim or Emacs. I do thing
| Micro is a fantastic option for students mainly because they
| already have the key bindings drilled into their heads.
| vdfs wrote:
| by this trend, pico should show the whole man page in the
| bottom of the screen
| rob74 wrote:
| The difference between micro and nano is that nano's keyboard
| shortcuts are pretty opinionated, while micro's are the ones
| used by most (GUI) applications nowadays: Ctrl+S for saving,
| Ctrl+F for find, Ctrl+Z for undo, Ctrl+Q to exit etc. etc.
| There is also a helpful hint at the bottom of the screen that
| you can press Alt+G to see the shortcuts, or Ctrl+G for some
| help.
| mdaniel wrote:
| > Ctrl-S for saving ... Ctrl+Q to exit
|
| Using a flow control sequences for editor commands; what can
| go wrong?
| mardifoufs wrote:
| Wait I don't understand the issue. What are you referring
| to?
| kip_ wrote:
| Some of us graybeards use to use teletypes to talk to our
| computers. In one of the earlier races between differing
| I/O, the printer couldn't print as fast as the teletype
| was receiving data, so the teletype would send XOFF
| (Ctrl-S) to tell the remote end "Stop sending data and
| let me catch up" and would then send XON (Ctrl-Q) to say
| "I'm caught up, go back to sending data.
|
| Many of us carried that to our VT100 terminals and used
| it when lines of code or output would flood the screen
| faster than we could read.
|
| Eventually paginators like 'more' and 'less' were
| invented and flow control via the keyboard codes for
| XON/XOFF fell out of favor, but some of us have very
| strong muscle memory. :)
| rollcat wrote:
| It conveniently translates to "save and exit"!
|
| Hopefully a cautionary tale against careless in-band
| signalling.
| tivert wrote:
| > The difference between micro and nano is that nano's
| keyboard shortcuts are pretty opinionated, while micro's are
| the ones used by most (GUI) applications nowadays:
|
| Opinionated, or just old and consistent? Nano is a clone of
| an editor related in _1989_. Things weren 't as settled back
| then. IIRC, I remember Ctrl-X was used to exit some DOS apps.
| IIRC, the current "GUI conventions" originated as Mac-isms in
| 1983/84.
|
| > Ctrl+S for saving, Ctrl+F for find, Ctrl+Z for undo, Ctrl+Q
| to exit etc. etc. There is also a helpful hint at the bottom
| of the screen that you can press Alt+G to see the shortcuts,
| or Ctrl+G for some help.
|
| So, about that Ctrl-C...
| codedokode wrote:
| > Opinionated, or just old and consistent?
|
| That old hotkeys didn't survive the evolution so it doesn't
| make sense to support them anymore.
| tivert wrote:
| > That old hotkeys didn't survive the evolution so it
| doesn't make sense to support them anymore.
|
| No. It makes sense to support them if the userbase is
| familiar with them. Nothing is more annoying than having
| changes like that forced on you.
|
| Then there's the fact that the "GUI standards" conflict
| with other command-line standards in a pretty serious
| way. Every command shell on Windows I've ever used uses a
| different convention than the "GUI standard" for copy-
| paste for exactly that reason (e.g. Windows Command
| Prompt's "mark" stuff, PuTTY's select/middle-click
| behavior).
| codedokode wrote:
| > userbase is familiar
|
| I think that every user who can use terminal, knows
| combinations like Ctrl + S (Save) or Ctrl + C (Copy). So
| they are familiar to them as well and should cause no
| problems.
|
| For me, for example, those combinations from vi, nano or
| emacs are simply weird and non-standard. And I assume
| that they are "non-standard" for everyone who was born
| after 1980 and have never seen a PDP or something from
| that era.
|
| Therefore it doen't make sense to support those key
| combinations only because 40 years ago they were used in
| PDP and other archaic systems.
| GoblinSlayer wrote:
| Won't such hardcore oldtimers use vi anyway? I thought
| the point of nano was to be like notepad.
| cesarb wrote:
| > I thought the point of nano was to be like notepad.
|
| No, the point of nano was to be like pico.
| MagicMoonlight wrote:
| Lmao what userbase, you're talking about software from 40
| years ago
| stonetrw wrote:
| Yes, it's time inferior gui apps start freezing when you
| press C-z.
| defanor wrote:
| It calls its terminal multiplexer functionality "terminal
| emulator", it seems. Unless it has a GUI, but then "terminal-
| based" is wrong.
|
| I am not a fan of nano, as it is not even qualified to attend the
| editor war, but this one adds JSON configuration, "curl | bash"
| installation, has a JS-dependent website, and generally looks
| even more awkward than nano. Apparently both nano and this editor
| have their target audience, as do all those other "modern"
| editors, but observing this triggers the feelings likely similar
| to those that lead to flamewars: it is painful to observe
| seemingly inefficient and otherwise awkward tools used by others,
| and tempting to suggest to look into better options.
| mgaunard wrote:
| try looking at a "modern" text editor; the one which appears to
| have the highest popularity is visual studio code.
|
| It's an awful slow mess that cannot stop itself from triggering
| unsolicited popups, eating all your RAM and inserting
| characters you didn't type.
|
| The reality is that this is the reality of programmers today,
| they want something that does a shitty work for them rather
| than be in control.
| linuxdude314 wrote:
| I have absolutely none of the problems you are describing
| with VSCode.
|
| You have an immense amount of control over VSCode and its
| plugin ecosystem is fantastic.
|
| This sounds like more of a problem with your workstation or
| environment.
| mgaunard wrote:
| Just opening a file with default settings.
|
| "hey, looks like you're opening a C++ file, would you like
| to download our C++ plugin?"
|
| and other infinite amounts of similar popups.
|
| Then I type (, it chooses to insert a ). I didn't ask for
| this.
| jtriangle wrote:
| You know what nano's good for? Editing a few lines of a config
| file every now and then.
|
| For that purpose, it's great, works a peach, and is as at least
| as good as every other option if not better.
|
| And that's what 99% of people use it for, because that's what
| 99% of people need in a terminal based text editor. Those
| people don't tend to participate in these sorts of discussions
| because, well, they're probably still trying to figire out how
| to exit vim after someone told them vim was better than nano.
| cesarb wrote:
| > You know what nano's good for? Editing a few lines of a
| config file every now and then.
|
| As long as you always start it as "nano -w" to prevent its
| enabled-by-default (at least on some versions) word wrapping
| from corrupting your config file.
| mixmastamyk wrote:
| sudo apt install micro
|
| Not awkward, it uses keybindings you already know if you've
| used a PC or Mac in the last 40 years. :-/
| prmoustache wrote:
| I think the vim keybinding are the one I have used in the
| last 35 years.
| mixmastamyk wrote:
| I first learned on a Commodore... run stop restore! But
| then DOS edit.
| berkeleynerd wrote:
| Definitely this. I'm super happy for anyone finding some new
| level of productivity with vim, emacs, kakoune, etc. but I
| don't want to join an editor cult, not even a CUA one. I just
| want to edit text from the command line using a familiar set
| of keystrokes and move on with my life and micro fits the
| bill.
| codedokode wrote:
| What disappoints me most is that terminal editors often use weird
| hotkeys that are unique only to them instead of using widspread
| hotkeys. What I want, is, for example, to use Ctrl + S for saving
| and not some other combination.
| cryptecks wrote:
| You may be in luck, because the default keybinding for Save in
| micro is indeed Ctrl-S. I installed it and aliased it over Nano
| for a bit on one of the servers I SSH into constantly, just to
| test it out.
| dietr1ch wrote:
| Good luck using C-z for undoing
| codedokode wrote:
| Why not? Those control combinations can be disabled if I
| remember correctly. Also, as they conflict with modern
| hotkeys, they should be changed everywhere.
| just_mc wrote:
| Micro supports both Ctrl-C for 'copy' and Ctrl-Z for
| 'undo'.
|
| For someone who started using computers in the mid/late
| nineties or later, it is super intuitive and I much prefer
| it over anything else.
| TheHippo wrote:
| That is what makes micro so easy to use. It uses widespread
| hotkeys.
| andridk wrote:
| I thought Nano was the modern alternative to Pico ^_^
| mjhagen wrote:
| I'm holding out for Macro.
| sph wrote:
| Yes, a Macro Editor... perhaps with some Editor MACroS.
| xvedejas wrote:
| according to SI, the opposite of micro (10^-6) is mega (10^6)
| mgaunard wrote:
| if you look at the progression pico, nano, micro, then you
| can see its 3 times bigger everytime, not the inverse.
|
| So the next one should be milli.
| evujumenuk wrote:
| Followed by... what?
|
| Unity? We could also have an unpronounceable empty
| string, and refer to it as TEFKAM, The Editor Formerly
| Known As `milli`.
| Ekaros wrote:
| At that point for a few generations we do only 10x centi,
| deci, deca and hecto.
| evujumenuk wrote:
| The taglines basically write themselves. 'A 10x editor
| for 10x engineers.'
| velosol wrote:
| https://10xeditor.com/ might prefer you use a different
| number ;)
| thaumasiotes wrote:
| > We could also have an unpronounceable empty string
|
| For what I assume are historical reasons, the empty
| string is usually called "lambda".
| eternityforest wrote:
| Is macro the one after milli?
| mgaunard wrote:
| macro is not a SI prefix.
| mykhamill wrote:
| There are two scale systems at play.
|
| pico, nano, micro, milli, unit, kilo, Mega, Giga... Which
| relates to the SI units.
|
| And Micro,Meso and Macro scaling system that centers
| around human sized reality.
| julesnp wrote:
| Don't forget centi-, deci-, deka-, and hecto-.
| eternityforest wrote:
| SI doesn't have a prefix for 1x does it? Doe you'd need a
| non-SI like macro or meso, or just to jump from milli to
| kilo. Or call it Editor One or just Editor.
| l-albertovich wrote:
| It'd be funny to silently alias quetta=emacs in systems. I
| wonder what would people think when they find it.
| pie_flavor wrote:
| Micro to me strikes a perfect balance of easy enough to get
| working out of the box and not so simple it's stifling. I wish it
| came with LSP support built-in though.
| hobo_mark wrote:
| Is there any console editor that supports VS Code key bindings?
| moffkalast wrote:
| Well VS code is electron, so you could just launch chromium in
| kiosk mode with xinit and have VS code render in the actual
| terminal I guess?
| delfinom wrote:
| So it reinvented vim/emacs and friends and called it an
| alternative to nano without understanding what nano is.
|
| That's like saying Visual Studio is an alternative to Notepad
| with a straight face. I mean sure, both could type text but it's
| fundamentally a different product.
| NayamAmarshe wrote:
| Its main idea is the simplicity. It supports regular GUI editor
| like syntax and code highlighting.
|
| It's not like nano or vim or emacs. It's for people who prefer
| OOTB simplicity.
___________________________________________________________________
(page generated 2023-08-18 23:02 UTC)