Category Archives: Android

Does it really take four keystrokes to delete a line in Vim?

After 30+ years of using various editors, I keep hearing so much about Vi and Vim. So I’m learning them, but I’m still on the fence and not seeing the real benefits of a “modal” editor. Maybe the reason Vi has modes, faster modeless editors were not common yet when it was created. According to the author:

One of the good things about EMACS, though, is its programmability and the modelessness. Those are two ideas which never occurred to me.

For example, just to delete a line it takes four keystrokes to switch modes. If you ask me, that’s not efficient.

ESC + d + d + i = four keystrokes.

“Escape” switches your mode to delete, and “i” switches your mode back to editing.

This other solution is not really faster, but saves you from manually switching back to the (INSERT) editing mode.

ESC + SHIFT + C + Backspace = four keystrokes.

Am I missing something here?

Apparently, lots of people are OK with that archaic way of working. But I question the wisdom here, having used many editors that do this with fewer keystrokes. I suspect other Vim commands will be more of the same: extra keystrokes.

Before I work alien Vim concepts like “yank” into my muscle memory, I’m doing a reality check. So I ask the Vim gurus: Why do I want twice as many keystrokes to do something as common as deleting a line?

At the moment, I do most heavy editing in Geany, and I mount remote files to my laptops/desktops with sshfs. Currently, I do most terminal-based editing using Nano and Joe, and now Vim, mostly for quick editing of config files. I’m looking at my options.

I have no compelling reason to spend all my time in a terminal, but if I find a text-mode editor that I like, I can imagine moving more away from Geany for day-to-day work. Do I want to master Joe, Nano, Vim, or something else for terminal-based work?

Just to quit Vim:

ESC + SHIFT + : + q + SHIFT + ! + ENTER = seven keystrokes.

I’m starting to see a pattern here.

Update 1: I tried all these suggestions posted on StackExchange. So far, I think the text mode of Cream is what I’m looking for. It’s a “modeless” version of Vim that behaves like a standard code editor, like Gedit, Geany, Editplus, etc. I’m still testing it out and looking for a repository.

Update 2: Using Cream on a remote server is going to be difficult. Because it’s based on Gvim and not in CentOS repositories, I’m not even sure how I would compile it, or if that would even work. So it’s not a sensible option for real work.

Update 3: After a long search, I found an editor called Micro back on Page 3 of a Google search. It’s just about perfect. Shift-arrow selection works perfectly. Control-C (cut), Control-V (paste), Control-Z (undo), Control-S (save) all work as expected. It also indents and unindents selections perfectly. And full mouse support!

Micro is a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the full capabilities of modern terminals. It comes as one single, batteries-included, static binary with no dependencies, and you can download and use it right now.

As the name indicates, micro aims to be somewhat of a successor to the nano editor by being easy to install and use in a pinch, but micro also aims to be enjoyable to use full time, whether you work in the terminal because you prefer it (like me), or because you need to (over ssh).



Maybe the only caveat, you need a terminal emulator that properly supports the Shift key. Terminator works fine. Some Android-based terminals do not support shift-selection, but JuiceSSH with the Hacker’s Keyboard works, though I haven’t extensively tested it yet.

More detailed Micro installation instructions here.

Releases here https://github.com/zyedidia/micro/releases

I found the best #terminal #editor yet, it's called Micro. Get the link on my It's a self-described #modern editor that has the #functionality you would expect for #cut, #paste, shift-selects, etc. It's easy to install. http://PJBrunet.com

A photo posted by PJ Brunet (@pjbrunet) on



I like Micro so much, it’s added to my /usr/local/bin

These photos are blurry due to my cheap smartphone camera and low-res, antiglare screen. That just makes them more authentic ;-)

The #superb Micro #text #editor #syntaxhighlighting in action with #phpcli. You get a handy #commandprompt with Control-E. Then "run php example.php" to try some . Super way to without or the #internet. PHP-CLI is really useful for background #cronjobs aka #microservices. PHP is still the most #popular language according to #googletrends, although #python might be #catchingup, I'm not worried. http://PJBrunet.com #backenddeveloper

A photo posted by PJ Brunet (@pjbrunet) on