Micro – a modern and intuitive terminal-based text editor
micro-editor.github.io
micro-editor.github.io
Micro really got the UX right for people like me and it made me more happy than I expected. It's now the EDITOR on just about every non-GUI system I have access to and I love it.
Thanks, Micro authors!
Vim keybindings are great. :) But I'd rather people learn vim keybindings out of curiosity rather than necessity.
For me, learning vim is like learning an foreign language, a few hundred words (or few hotkey/:commands for vim) can get you started, but it's not easy to reach the level of native speakers, and some old rules in your language (for example, HJKL keys in vim vs the "natural" arrow keys) will interfere your progress.
Maybe I'm going to piss many people off here, but vim is not an user-friendly text editor. An user friendly editor should pop some kind of prompt when I pressed the first g/G key and show me what I could press the next, not telling me to read :help (which probably has the volume of a dictionary at this point).
Based on my 2 minutes with Micro and the information I read from it's `help defaultkeys`, the size of it's hotkeys are more healthy and manageable. So that's a plus from me.
But being able to edit using Vim at all is very very useful to edit files on servers, which happens very often in various situations.
... Does not compute.
For anyone that wants this: these kinds of plugins are usually called "which key" after the Emacs mode. Most of the Emacs distros ship with which-key by default and it works very well with evil.
I get the sense that they're less popular on the Vim end, though I'm not sure why.
See vim-which-key [1] and which-key.nvim [2] for something similar to this.
You can use something like LunarVim which has everything already setup.
You might be interested in the Kakoune editor. Despite being superficiality similar it's not Vim compatible, which may make it a nonstarter, and it has its own flaws that keep me from using it, but it makes a point of showing on-screen help for almost every command as you're typing.
While PowerShell is, well, powerful and nowadays there's at least OpenSSH for for secure and convenient remote access, unfortunately it's rarely installed and PowerShell over SSH is still very janky and even when it's there, many things assume a GUI, which is anything but convenient to me. My workflows tend to use SSH all over the place to make remote access transparent.
Even pre micro I preferred Linux for servers, for this reason primarily. I understand Linux way less well than Windows but I navigated down that insane ISS config panel once, a decade ago, and decided that once was enough :-)
Given Windows' low popularity as a server OS these days it seems to me that plenty devs-who-use-Windows have a similar opinion.
I’m curious, why is Windows your favorite desktop OS?
Escape, slash, and write whatever you want to find, and press enter:
[Escape]/foo[Enter]
After a few weeks, you'll start trying to do it on every editor...I've used vim for 25+ years, but always alongside other editors (only used it as my main driver for 4-5 years sometime in the 90s), so I've always stuck with Esc (which, is the default anyway).
That said, I wanna jump back on with Nvim 5.0 when I get the chance to have a free day to setup and configure it to my liking.
Basics for me is i,a,:q,:wq just be able to edit something and get out of the editor again. Adding d,y,p,/,^,$ makes it a bit more productive.
I think I shared this intuition. Thankfully using vim keys on many things for a long time has ground it out of me, so it never trips me up anymore
IBM CUA, from mainframe terminals to OS2. Later Geany and Sublime Text, recently VSCode.
Unix was earlier so didn’t get with the program. I limped along with nano and a subset of vim for years. Noticed “ne” about ten years ago, was ok.
Micro is a godsend and in the Ubuntu repos now. Debian too? Not sure.
The (probably not workable) alternative is to deprecate the whole thing and make a higher level protocol.
But I agree on micro. As a Linux user who refused since 20 years up until now to learn vi or emacs nano and than micro was a real pain relive.
Oh and for the curious:
> The name "vi" is derived from the shortest unambiguous abbreviation for the ex command visual, which switches the ex line editor to visual mode. The name is pronounced /ˌviːˈaɪ/ (the English letters v and i).
Why would you have to do it every time? Sure, if you do it very rarely then you may forget, but I dunno... In any case, the way you search in vim is the way you search in `less`, `mupdf`, etc.
But from the website: "curl https://getmic.ro | bash"
NO!
We need to stop getting people comfortable with the idea of just curling random stuff into their shell.
Even worse is software that suggests you sudo curl it into bash. What could possibly go wrong?
Download and build it yourself. Or download and install a packaged .deb or .rpm or whatever is the equivalent for your platform.
Do not just blindly curl into your shell things coming from people you don't know and trust to the level that they are personal friends and you would loan them your house keys or your car.
not just any random person can submit a .deb and have it go live on the gpg-key authenticated debian mirrors.
https://wiki.debian.org/Packaging
https://www.debian.org/doc/manuals/debmake-doc/index.en.html
curl into bash can be as quick as "ooh look shiny new thing on website, let's copy/paste this string of text into my shell"
Actually, it should probably get even more hostile a reaction, since installing it that way usually means you won't get any updates for it. If you absolutely must install software from a (trusted) source other than your distribution, adding a source and then using `apt` is the way to go.
And each 'curl https://' packager has its own idea where his software should be installed. And many of them are not even providing automated way to delete their application.
I think complaining about streamlined remote script execution is just being pedantic.
If you're so worried, wget to see and run.
JOE has everything I need — it's fast, it has syntax highlighting, multiple buffers, etc. Also, it uses the WordStar key bindings, which are the same bindings used by Turbo Pascal and the other Borland IDEs that I grew up with.
But Micro looks great, too.
Is that an intentional reference to JoJo's Bizarre Adventure or just a wonderful coincidence?
What got me started was actually how much faster it is on a Raspberry Pi compared to nano.
Micro is like nano re-built for the 2020's. It feels really natural to use with sane key bindings and text selection. I like that it's written in Go and has a nice plugin framework. I might have used it more if a file manager / code tree off to the side was a built-in feature. I found a plugin that could do it, but I had some hassles with it iirc - https://github.com/NicolaiSoeborg/filemanager-plugin
[0] https://web.archive.org/web/20010107084700/http://publib.bou...
That said, kakoune looks like an interesting demonstration that maybe vim's <action><text selection> commands could be clearer as <text selection><action>.
Imo the whole "hard to use" thing mostly comes from people who feel they are already expert (at something in Windows) and get frustrated when they discover that there are other paradigms in which they are still beginners. So they label their own knowledge as doxa, and anything that doesn't conform to it is labeled "unintuitive," "obscure," "dated," "hard to use" etc. The same mechanism is behind quite a few of the voices claiming GNU/Linux communities are unfriendly or abrasive (i.e. someone gets frustrated upon the discovery that not everyone recognizes them as the expert they think they are).
Because of this, I don't mind installing it on servers. It is great for making quick edits to json configs, batch files, powershell, python scripts, etc. Syntax highlighting and line numbering are key. The alternative is editing the file locally and then getting it onto the server which can be challenging for locked down systems, especially Windows Server Core which does not have a GUI environment.
Even on my local machine, if I need to make a really quick edit, it is much faster to use this than waiting for VS Code or PyCharm to load. You also stay focused. By this I mean, your eyes don't leave the powershell window that you are currently working in. This allows me to more quickly complete the task at hand.
Typically my main use for text editors is for log analysis (mainly Sublime Text). This usually means I write a lot of regex for searching.
With that in mind, I do see one shortcoming in the choice of Lua as a scripting language. It's not really known for it's text processing abilities. One major shortcoming is that it doesn't have a true regex engine. This is something I use extensively.
For most of my use cases, this would require I hack together a native search in the application, and then pipe the buffer to Lua for post-processing. I'm not sure if search/replace pipelines are going to be easy to code in this manner or efficient enough to be worth it.
I use Sublime Text because it uses Python and makes this relatively easy. Or if I'm searching over thousands of logs to use ripgrep and just pipe in whatever that way since it can search 10GB in a few seconds with moderate sized regex.
Otherwise, I like the approach and the helpful commands for the user! It is definitely nice to be able to stay in a terminal instead of using a GUI to edit.
well, then start. What are you waiting for?
E.g. here: https://danielmiessler.com/study/vim. Don't miss Vim as Language.
While tools like lnav look great, many of its features can be replicated by combining smaller, purpose built tools, i.e. the core Unix philosophy.
Single log view: cat | less
Filters: rg | less
Decompression: zless, zgrep, rg -z
Timeline view: admittedly tricky, but doable with some incantation of cut, sort or reach for the big guns: awk, perl.
Live operation: not quite, but tail -f and less +F go a long way.
I've never once in almost 20 years of looking at log files thought I needed a SQL interface to them. I'm sure it's a powerful feature, but the above approach has served me well.
(Sorry this is a little off topic, but there’s a lot of room for improvement for working with log files over a text editor without scaling up to a log service)
That being said, this is cool. I've set it as my default editor for the GH CLI to use it for pull requests and the like, let's see how it goes!
And yes I think vim has bad ergonomics. It's so much effort to get it configured to work for me. I get way more out of Alfred and my moonlander keyboard with macros that work across the whole OS.
It's worth taking time to learn something to get a better experience. Keyboard layering takes some time to get used to (especially if you can already use a standard keyboard), but is worth being able to reduce hand movements. Modal editing takes some time to get used to, but provides a richer navigation/editing experience.
Similarly, you can customise your moonlander to the point where it's yours and no one would know how to use your keyboard.
[0]: http://www.malsmith.net/yori/
[1]: https://virtuallyfun.com/wordpress/2021/03/03/yedit-the-miss...
Quotes/backslashes will be treated literally. Use an array. [SC2089]
At the bottom, I find it quite useful although I'm not sure how one would turn it off as I didn't turn it on.I've already switched to this. Installing and configuring it was a lot easier than learning vi would have been.
So first off I use Dvorak so I have to switch tons of the bindings so I can use reference layouts. My moonlander keyboard already gives me directional movement on home keys. I don't have a ton of things to automate that I cant do in Alfred and my keyboard has over 1000 possible slots for keys and macros, more than I could ever use. Unlike Alfred workflows, the macros are trapped in vim. I have to add a ton of plugins to get anything approaching the experience of Pycharm and now it's just as slow, the auto completion is worse, and it looks like ass. But hey at least I can use it over an ssh connection (gotta transport all of my config first!), as if sshfs is not a thing, not that my work load is all cloud containers so I rarely ssh at all anyways.
Micro fills a niche for me where I don't want to leave the terminal and just need to edit a few lines.
(Sorry, just joking, could not resist :P)
I use Vim (and Emacs) as a Dvorak user. I don't change the layouts; I just stick with mnemonics. e.g. in vim, g is "go..", c is "change..", d is "delete..". With Dvorak, the `jk` are adjacent, so that works out. `h` is still to the left of `l`... but, vim's keybindings are excellent at navigating in a line, so many `h`/`l` should be avoided anyway.
I think "hard to get vim to be as good a development environment as an IDE" is more/less a fair point.
Anyway, it's great that micro can fill a niche for you. I wish everyone could appreciate modal editing and symmetrical keyboards.
There is no reason in 2021 for to have such terrible discoverability. If it's such a great tool, why did no one see fit making it progressively learnable from within the tool itself?
I see people talking about using vim like some other talk about going to the gym. Great abs, fast editing, but... do you even code, bro?
Unless I'm working on trivial stuff, my crafting speed is rarely limited by my editing capabilities. When it is, it's usually because the code is repetitive and it's time to change it.
High-level language tooling like refactoring and static analysis are way, way more important for medium+ size projects productivity.These are much better served by an actual IDE than some one-off integration with an obtuse editor deriving macho pride from it's 1970's TTY-limited semantics.
vim comes with a tutorial that teaches all the basics from inside vim... It's installed pretty much everywhere, you just have to run vimtutor.
> I see people talking about using vim like some other talk about going to the gym. Great abs, fast editing, but... do you even code, bro?
Why the condescending tone?
Yes I do code, everyday and full time, and vim absolutely increased my focus and productivity.
There is way too much to talk about in a single post, but stuff like macros, showing multiple files at once, (tabs is not the natural way of doing things in vim), viewing multiple parts of the same file at once the native integration with the terminal (just ctrl-x to go back to the terminal and fg back to vim, or execute any command with :! ) are great for productivity when you have to deal with multiple tools.
> High-level language tooling like refactoring and static analysis are way, way more important for medium+ size projects productivity.
I agree, and that's why I use vim. I can do all of that more efficiently in vim because the refactoring tools are way more powerful, and everything is macro-able.
> These are much better served by an actual IDE than some one-off integration with an obtuse editor deriving macho pride from it's 1970's TTY-limited semantics.
Condescending and even insulting tone again... great.
FYI, vim has all the features of any modern IDE. The opposite is not true however.
> The things people build to avoid learning vi...
As if learning vi was the obvious thing everybody just needs to do. Which is a common attitude within certain circles. "It was hard for me, but I made it through and so should you, with just as much pain, haha".
I was brought into the world of computers with the promise that they would help build a better world, one where the edges of technology get softer as years pass.
vi insisting on menu-less text mode and rote memorization of arcane key combinations negates any progress that was made in the last forty years in software usability. I refuse vi because I believe there _has_ to be a better way of doing things.
Look I like mechanical keyboards and editor setups as well, but let's not pretend it's this great panacea. It just feels nicer.
The amount of commands that are 2-3 characters long really slows down learning and when it comes to it you will often be typing another 80 ish characters after the command name for options and piping anyway.
Have you even used macros in vim (or whatever)? It's practically a modern editor's raison d'être.
(part of the beauty is that vi-style motion keys or similar philosophy have promulgated into everything from browser plugins to a plethora of terminal tools like htop, ncdu, tig etc.)
Just moving your hands to the arrow keys might be less efficient, but in my experience it has got nothing to do with RSI—you’re just moving your whole hand with your shoulders. That seems about as repetitive stress-inducing as going to fetch a cup of coffee.
Of course when one plays the piano one has to move the hands by the shoulders a lot... the piano is not a stenography keyboard.
LSP is good though
LSP is not even used for highlighing in vscode, where it originated.
Of course, micro is written in golang, and it seems like the author is doing just fine without relying on LSP.
Alternatives include downloading the .deb file from the Github repo and using the getmic.ro bash script. [1]
[0] https://bugs.launchpad.net/ubuntu/+source/micro/+bug/1870939
Lots of previous discussion:
1 year ago https://news.ycombinator.com/item?id=23334190
4 years ago https://news.ycombinator.com/item?id=15360509
6 years ago https://news.ycombinator.com/item?id=11516902
1. "simple text editor to use on servers/whenever I need to edit something quickly". That place is taken by nano that is easy enough so that people don't have to learn it, or vim for those who mastered it. In this niche it's important for the editor to be ubiquitous enough and present even on the old machines.
2. Regular day-to-day code editor. Micro has _some_ autocompletion, syntax highlighting etc. But for a modern editor to function, it really needs an LSP client implementation. But this seems to not be happening so far: https://github.com/zyedidia/micro/issues/1138
Micro has some features in each bucket (simplicity, ease of usage vs. IDE-like features) but does not seem to really excel at either.
Why are people still treating this like a deal breaker? It's a static go binary, if I can ssh to it, I can scp micro to it, or more typically just curl the latest release from GitHub into ~/.local/bin (no sudo!). Just like you'd do with your vimrc.
Apparently this is controversial.
One might call me lazy but I don't want to end up learning multiple editors for different scenarios if the benefits are marginal, especially if I can get away with just one!
It's not bad but it doesn't support Unicode. It's also nearing 35 years old now and while that has its advantages maybe something more modern would be better. The main reason I still use it is that it has emacs keybindings which sadly are seared deep into my brain.
I hate this. I know everyone's doing it, but it's just awful. Read the script, then run it.
Go and Rust are two languages whose compilers produce statically-linked executables and they are growing in popularity, so you should expect to see more and more of these kinds of programs. And as these programs become more spread, I expect that other languages (either existing or new) will make it easier for developers to distribute their projects as single files.
APT, DNF, and many other package managers have an "autoremove" command that will uninstall unused dependencies. So if you did "apt-get -y install $PACKAGE && apt-get -y remove $PACKAGE && apt-get autoremove", you won't have any of $PACKAGE's dependencies hanging around after.
You have access to read a file, you can get the current buffer, so inserting the text must be almost trivial.
It seems like an odd showstoppper to have, but if you're tempted to switch writing the plugin might help you get a feel for how good the editor is in other ways.
I gave micro a try because I thought it looks like a nice and somewhat intuitive text editor, but I regularly need the “insert file” function.