290 comments

[ 3.3 ms ] story [ 250 ms ] thread
Where’s the escape key on my iPhone?
I think I finally understand Kafkaesque.
There is no escape.
(comment deleted)
Try:

Ctrl and [

That should send the same as Esc (ASCII 27).

I seem to remember this working on a new iPad Pro keyboard.

This is incredible. I think I needed this about 40 years when typing on a small Teletype (non-ASR33) without an escape key.
The reason is interesting as well. Paraphrasing from this blog post[0]

When you format the ASCII table in four columns, you can see `ESC` and `[` on the same row. Holding `CTRL` essentially ~lops off the first three bits~ subtracts 64, resulting in `ESC`

   ...
   ...
   0011000 CAN    0111000 8    1011000 X    1111000 x
   0011001 EM     0111001 9    1011001 Y    1111001 y
   0011010 SUB    0111010 :    1011010 Z    1111010 z
   0011011 ESC    0111011 ;    1011011 [    1111011 {
   0011100 FS     0111100 <    1011100 \    1111100 |
   0011101 GS     0111101 =    1011101 ]    1111101 }
   0011110 RS     0111110 >    1011110 ^    1111110 ~
   0011111 US     0111111 ?    1011111 _    1111111 DEL

[0] http://www.catb.org/esr/faqs/things-every-hacker-once-knew/
> Holding `CTRL` essentially lops off the first three bits

No, it inverts the 7th bit (or subtracts 64).

The Linux `ascii(7)` man page has a similar table, but with 2 columns. The first 32 control characters listed there have their "caret notation" character in the opposite column.

Is this why the symbol for Ctrl is also commonly the symbol for xor?!
I'm not sure. I think the caret is just a prefix to make it distinguishable from the normal letters.

It is the reason why Ctrl+i in a terminal is the same as Tab though. Likewise for Ctrl+m == Enter.

Standard adaptation for touchbar Macs, too. I find it less of a disruption from the home row.
Caps lock is right on the home row.
BUT HOW WOULD I WRITE MY FORTRAN?
Oh, right. I have control remapped on caps lock, so it's caps lock + [.
This is where https://github.com/alols/xcape is amazing.

I'm not sure, but I think Karabiner can be configured to act the same way.

Karabiner is amazing. I have caps lock mapped to ctrl-cmd-alt when pressed with some other key, and esc when pressed and released alone.
Not as easy to remap keys though, on the iPad (keyboard cover) unless I’m not aware.
It's very easy to remap on the touchbar macs though.
Something else to try is Ctrl-3. This commonly gives the ESC code.
I missed the lowercase i on first read. I'll comment anyway in case this helps others. Hacker's Keyboard from f-droid has an escape key. If using the compact layout you can get to it by holding the tab key. I think on the full layout it has a more traditional placement. I'm not sure what alternative keyboards iOS has.
Where's the escape key on my Macbook Pro?
Same place as before, it's just no longer as squishy
(comment deleted)
Running on Firefox and `Shift` generates a `^P` character.
Firefox on Debian 9 x86 here, not happening to me.
Same, Firefox on Arch
I thought I was getting stuck in insert mode, and I got fairly frustrated before realizing my Vim keybindings browser extension was grabbing ESC and keeping it from this weird browser-Vim.

We brought this abomination on ourselves.

We have strayed too far from RMS's light
RMS is the Terence McKenna of open source: a fundational figure whose ideas where way ahead of the curve, but also a too extreme to attract the mainstream.
Almost no one goes full RMS. But I suggest that the world would be much better if everyone went even 50% RMS.

Relevant: https://old.reddit.com/r/StallmanWasRight/

(Disclosure: RMS was a childhood hero, since I read the Steven Levy "Hackers" book, right up there with Mr. Rogers, Richard Feynman, Neil Armstrong, and Marvin Minsky. One day, RMS reached out, to ask me to sign over copyright, to the FSF, of a tiny bit of Emacs code ("Yes, sir!"). Today, I occasionally have the privilege of exchanging emails with him.)

It's true, even though most people don't go "full RMS", he's clearly a force for good in the Universe, and he's fighting the good fight for the benefit of all of us.
RMS has done a lot, but perhaps his main role now is to encourage others to do things. In the good fight, people shouldn't thank him for his service, but rather, join up.
Indeed. The fight is not over, it barely started. The dangers RMS told us about have materialized in full force now.
Ironically, these dangers are not thwarted by FSF licenses. Even more, the persistence with which FSF fights anything that would dare touch the pillars that they marked as "freedom" is holding back any meaningful discussion about alternatives.

For example:

https://www.fsf.org/blogs/licensing/recent-licensing-updates

> We added the Commons Clause to our list of nonfree licenses... It's particularly nasty given that the name, and the fact that it is attached to pre-existing free licenses, may make it seem as if the work is still free software.

So while RMS was undeniably a force of good, we should take his advice with grain of salt, and start discussing which freedoms we can protect, and what the price for that is.

They consider Commons Clause to be harmful for good reasons. To quote from https://www.gnu.org/licenses/license-list.html#comclause:

> The “Commons Clause” is a nonfree license because it forbids selling copies of the program, and even running the program as part of implementing any commercial service. Adding insult to injury, it also twists the words “commons” and “sell.”

RMS and FSF's stance on software freedom is ultimately straightforward: they want to protect end user's freedoms, and protecting this involves removing the ability for anyone in between to take away end user's freedoms.

Thank you for the downvotes - but winning the (down)voting game doesn't make you right.

> They consider Commons Clause to be harmful for good reasons.

Your quote only tells that they consider the license non-free. Which is true, if you subscribe to their definition of "freedom" [0] (which I don't - YMMV). Harmful though? I don't think so.

Have you looked around lately? Has opensource software won? Where it did, it did because it helped big tech companies to "commoditize their complements". Where it didn't, it is because by itself it doesn't provide hobby developers with any incentive to keep working once the maintaining stops being fun.

> RMS and FSF's stance on software freedom is ultimately straightforward: they want to protect end user's freedoms, and protecting this involves removing the ability for anyone in between to take away end user's freedoms.

Exactly. What they are missing however is that without developers' engagement you get the situation that we have now. And that some of the freedoms are more important than others - like freedom to repair, to run for every purpose, and... to actually have a polished piece of software. Do you still think opensource "won"?

In the end it's a free world, or it should be. Also free to decide which license to use. And free from hordes of preachers falling on every mention of Commons Clause.</rant>

[0] https://en.wikipedia.org/wiki/The_Free_Software_Definition#T...

Don't confuse Open Source with Free Software. Open Source is a necessary but not sufficient part of Free Software.

RMS/FSF goal is to protect the rights of end users. Not developers. That's the difference between copyleft and permissive licenses. Commons Clause is neither, and it seems focused on the wrong thing. The problem isn't charging for software; the problem is charging and preventing others from redistribution and access to source code.

As for losing interest in maintaining software, I don't see how Commons Clause helps.

> The problem isn't charging for software; the problem is charging and preventing others from redistribution and access to source code.

This is simply not what Commons Clause does, you really should read it. Access to the source code is not prevented. And redistribution is not prevented either, on the condition that end users do not sell it. That is all.

> As for losing interest in maintaining software, I don't see how Commons Clause helps.

It helps by allowing someone to actually build a business around their work without fear of "unfair" competition ("unfair" is in quotes because it is legal and in line with FOSS, it just doesn't seem fair to me [0]).

[0] https://onezero.medium.com/open-source-betrayed-industry-lea...

> But I suggest that the world would be much better if everyone went even 50% RMS.

I disagree. Stallman infuriates and disappoints just as much as he inspires. He often comes off as rambling and intransigent. Years ago I found an open letter to him that I found reasonable[1]. Near the end, the writer considers how Stallman’s way of presenting an argument is harmful to his goal:

> Dr. Stallman, I have a tremendous amount of respect for your contributions to GNU, emacs and gdb amongst others. You are a man of considerable intellect and programming ability. That said, I nor the people that I spoke with about your talk found you to be a particularly charismatic or persuasive speaker. The only people that seemed convinced by your speech were the ones who had already been leaning towards your point of view to start with. Several friends of mine who had not heard of the FSF before left half way through because they were so put off by some of conspiratorial rhetoric above.

Stallman’s reply was a single line:

> I am skeptical of advice from people who disagree with what I stand for.

Stallman isn’t a paragon or righteousness. He’s a rambling human with as many biases and unreasonable obsessions as the next person. He makes me question if he really wants to change the behaviour of the masses, or if he just wants to mock and deride what he doesn’t like. If he’s going for the former, he’s doing an awful job; you don’t convince people to change their views with aggressiveness and ridicule. If he’s going for the latter that’s his prerogative, but it’s not my belief that people like that are beneficial to the world.

[1]: http://alexeymk.com/dear-dr-stallman-an-open-letter/

[2]: http://alexeymk.com/dear-dr-stallman-the-aftermath/

I'm sympathetic to what I think you're talking about, and I've had a few discussions about that. I think your assessment is too harsh in some ways, and I'd like to mention a few thoughts why...

In some regards, some things that seem arbitrary actually have a large amount of informed reasoning behind them. He doesn't show off, and maybe makes his arguments too simple, in simple language, but I've seen him trot out more of the logic and academic terms&references on occasion (for people who know those terms&references).

And I think this ties in with him being obstinate/uncompromising: it's wrt logic he's worked out (and some values weights specific to him). IMHO, we need some uncompromising people, to provide different perspectives, and as a check against all the rest of us (including myself) who compromise more easily.

Some other things that seem arbitrary actually might be, even if they seem counterproductive (not, e.g., a principles reason). For a simple example, I've suggested a few times that saying "free software" to people unfamiliar with the term seems to derail many discussions, or is just confusing (especially when we keep doing it after the somewhat less-confusing "libre software" term). I think probably RMS has decided saying "free software" creates an opportunity to educate someone new on what "software freedom" is (even at the cost of any other discussion that was going on). Maybe "free software" is also a wordplay that appeals to him (like "GNU" being a recursive initialism), and which he thinks others might like. But I haven't seen that seem to work well in practice, overall. (Or maybe it works better one-on-one for him than it does in larger practice by others?)

Which brings me to another theory: RMS might think a bit differently than our typical programmer, and this might also affect his advocacy. We tend to think others are like us (sometimes more than they are), and we might also use ourselves to help model others. I suspect RMS realizes that others are a bit different, but I don't know whether he doesn't understand people well enough to influence them as well as he could, or he's prioritizing differently. For example, promoting the "software freedom" idea itself takes priority over everything else, including the goals of the person he's talking with and any promotion that might immediately build on those goals. (I can't get into details, but I've also seen setbacks due to RMS/FSF being seemingly misled by people who said the right catchphrases to him/them. Usually people mainly enthusiastic, not intentional manipulators. I don't know how well he was able to read them, and maybe he could read them, but was willing to take a chance because his mission needs a lot more workers.)

I think we're blessed to have at least one "full RMS". How does shooting for 50% RMS for everyone else sound?

I don’t want to dwell on this matter, quite frankly because I don’t find that Stallman is worth it. But I don’t feel like you understood my post, which is possibly a failure on my part for not having been clear enough.

You touched on “things that seem arbitrary” twice, but that wasn’t part of my point at all. Neither were most of your arguments. I don’t think Stallman’s behaviour is arbitrary, I think it’s harmful to his alleged goals.

> I think we're blessed to have at least one "full RMS". How does shooting for 50% RMS for everyone else sound?

Above all, that’s what heightened my certainty you did not absorb the meaning I intended for my point. The answer to that question is the premisse of my post. “How does shooting for 50% RMS for everyone else sound?”. It sounds awful. The Stallman we already have could even drop a few points.

I know you said you don't want to dwell on this matter, but if you are later inspired, please consider contacting RMS, to point out a specific example of something counterproductive to his goals, and how it might be improved.
> if you are later inspired, please consider contacting RMS, to point out a specific example of something counterproductive to his goals, and how it might be improved.

Again, part of my point was that Stallman is uninterested in such feedback, as demonstrated by the quoted exchange. The linked open letter did just what you suggest and was fruitless. His intransigence in such matters is why I don’t think he’s worth emulating. It’s my belief the world needs people open to challenging their own core ideas, to entertain the possibility they might be wrong and evolving their understanding of themselves, others, and the world itself. Stallman comes across as the opposite of that.

Thank you for explaining.

For what it's worth, I have seen him be flexible in thinking, in response to argument, including on famously firm positions. It has happened.

Of course, I'm also aware that many people have been frustrated by perceived inflexibility, and some of those times are very unfortunate.

If it inspires patience, consider that RMS has been flooded for decades with arguments that are often not well-informed, or are not in good faith. And he's only human, with finite time -- some needles in the haystack will get brushed off before he's able to invest enough time to see them. I suspect most of his responses are almost on autopilot, because he'll talk with anyone, but most of the conversations have happened many thousands of times before. (And I'm sorry I just now realize I should've warned of that, before I suggested you invest in reaching out to him yourself.)

I don't go full RMS, myself, and I was thinking that the exact makeup of the proposed 50% RMS level could be cherry-picked by the individual/observer, and include overlap with good qualities they already see from some other sources. I now realize that anything that looked like a quantification or calculus of RMS's qualities or value was counterproductive to discussion. I'd like to modify it to say that I think RMS exhibits some qualities that I'd like to see more in people. (And, on later occasions, I might have time to enumerate some suggestions.)

Anyway, thank you for your patience here, and for prompting me to rethink some things.

Even though I’ve spent more time on the subject than I wished, thank you for the continued discussion.

I appreciate that Stallman is human and has had to deal with ill-intentioned people over the years, which could be the reason he’s less willing to be flexible on certain matters these days. But I see that as less of a reason to ignore said inflexibility and more of a reason to question if he’s the best person to continue to carry his message.

He may be tired of fielding the same questions over and over, but every day there is someone else hearing his message for the first time as he continues to present it. As long as he keeps on introducing his views to new people, he should be responding to their concerns as coming from individuals thinking about them for the first time (because that’s what they are), not as questions he’s tired of addressing.

If our combined hypothesis are that Stallman has a good message but he’s harming it with his delivery, he should consider passing the baton to someone with more patience, if lack of it is indeed the reason for his attitude (a word I use with neutral meaning).

> Anyway, thank you for your patience here

You as well. I feel this was a healthy and respectful way to disagree and discuss a point at length. Thank you.

I might be in agreement with you. I do think we need RMS doing whatever it is RMS sees fit to do. But we also need many other sincere and altruistic people, with other perspectives and approaches, also working on ideas in this broad space.
Just curious. In what way was Terence McKenna ahead of the curve? All I've heard from him seems really crazy. Suggesting the most plausable explenation for the origin creatures you speak with on DMT is that they're other dimensional aliens (or something close to that).

I'm really confused to why so many people whom I respect find him insightful.

(comment deleted)
I like that fella for his ability to craft narrative. his vocabulary and thought labyrinths are top notch. not necessarily believing all the stuff he did.
(comment deleted)
Who is RMS?
Someone from the era of short usernames on unix boxes, along with "esr" and "rob". To more directly answer, it's Richard Stallman. Known for the free software movement and emacs among other things.
ESR is a poseur who doesn't belong next to those other names.
I totally disagree. I don't agree with anything he believes in outside of software as far as I can tell, but the Cathedral and Bazaar was pivotal. Not only that, but if you've never looked at the source code for Nethack, you should. I admit, I haven't looked at it since he was leading the project, but it remains in my mind as one of the best pieces of C code I've ever played with. Also, his description of working with Fetchmail revolutionised (at least for me) the idea of just taking some code that someone else has abandoned and slowly improving it.

He never understood software freedom, but as far as I can tell he is responsible for communicating the way that free (as in freedom) software can be competitive in the real world. Before that, all anyone would talk about was how we had to have free software for moral reasons (which I personally believe). He was the one that saw how successful projects were being run, put 2 and 2 together and told everybody else how to do it. I have much respect for ESR and I wish that the good things he has done had a wider audience.

Inflammatory take: people resent esr's right-wing politics.
So they do. It shouldn't matter in this context.

Unlike in fiction, real-life humans aren't universally perfect to everyone's standards. In some areas they believe or practice something great, in others they say or do repugnant stuff. Fortunately, you can evaluate one's contribution in different areas in isolation, and I wish more people would learn how to do that.

... it's not like his right-wing politics are repugnant. Come on.
They are for those who hate esr for it and want his existence in history of computing to be forgotten.
What has he done, besides The Cathedral and the Bazaar...?

Most of his open source contributions seem to be littering up source files with long-winded comments and grandiose attributions to himself. I've read a fair bit of his code and it's certainly not impressive. Quite the opposite actually.

I'm further right on the political spectrum than ESR is. It's his delusions of grandeur and constant, smug championing of his own relevance that I can't stand...
(comment deleted)
Richard Matthew Stallman
(comment deleted)
He's the guy who invented emacs. The emacs OS is rumoured to have a built-in text editor somewhere, but it's not as good as vi.
Eleven Megs And Constantly Swapping!
Escape Meta Alt Control Shift
In this context, he wrote emacs. But he also created the GPL, and the GNU project and wrote gcc and ...
No, I think the proper persons to look to are the C/Unix folks from bell labs where simplicity and pragmatism ruled.

RMS means well but GNU is a bloated mess.

If you don't want the bloat, the OpenBSD folks rewrite many bloated tools (including GNU or GPL tools) with their own implementation. Their recent project is OpenRsync.
I'm an OpenBSD user myself :-) I love simple so I gravitate towards it. I'm also a plan 9 fan and tinker in 9front.

  Ctr+[
Vim-ing on devices with not physical Esc key makes you get used to this (default configured, no extra keymapping required) Esc alternative :P
In many terminals (especially old ones), Ctrl-3 also commonly gives ESC.
Frankly I prefer Ctrl-[ over Esc because it requires less hand movement.
Rebound my caps lock to escape and never looked back!
You should (look back). Mapping it to Ctrl is a much more sensible choice. Can’t imagine using backspace instead of Ctrl-h, or Ctrl-A/E to go to the beginning/end of line, or Ctrl-W to delete back one word etc. Of course, Ctrl-[ is also right under your finger tips with Caps Lock mapped to Ctrl.
you can do tap for esc, hold for ctrl
This is what I've done for years now, best thing since sliced bread.
Tap what?
They mean remapping capslock to:

* Ctrl if held and used with other keys.

* Esc if pressed and released on its own.

There's no reason to press and release Ctrl on its own (minus games), and you never need to chord Esc with anything else, so they can both live on the same key.

Thank you for explaining. Didn't know you could do that. Will look it up.
> You should (look back).

Tell me about it!

> Mapping it to Ctrl is a much more sensible choice.

Never considered this, but just moved my pinkie to Ctrl and then to Esc and then to Ctrl... hmm... I use Emacs bindings in Insert Mode, wouldn't this interfere with them?

On the contrary, mapping caps lock to ctrl makes emacs keybindings super accessible! That’s exactly my point. I even disabled the backspace to force myself to use Ctrl-H instead. It’s all in the home row!

Added bonus: on MacOS, emacs keybindings work in pretty much every place where you can input text, so you get’em everywhere. It’s part of the Cocoa Text System:

http://www.hcs.harvard.edu/~jrus/site/system-bindings.html

> Ctrl-W to delete back one word

That's one of the most commonly used shortcuts I use. Not just in vim, but also in the shell. When I screw up on my typing, the mistake is often 3 or more letters back. Instead of hitting backspace a lot or moving the cursor and retyping mid-word, I prefer to say "screw it", hit Ctrl-w, and retype the word. It's faster. My brain is just not optimized to type pieces of words. I can't use muscle memory then.

Besides that, I don't know about you or dmitryminkovsky, but I remapped it to Caps system-wide, so by remapping to Ctrl, I'd be losing a lot more than those shortcuts you mentioned. On the other hand, CapsLock has always been a useless key to me. When I want to type in all-caps, it's less confusing/error-prone to just hold Shift with my pinky while typing. Also, Caps is in a much easier place to hit than Ctrl, so it's more fitting for a key that I hit a lot.

Speaking of Emacs key bindings: Alt+D, for when you've made a typo in the future.
The equivalent of Ctrl-w in emacs is Ctrl-Backspace. It's more common to want to delete the word you just typed instead of the word to the right of the cursor.
...and on my laptop, those are both physical keys with tactile sensations!
I have it on `jj`. No hand movement at all, less pinky-bending.
Unfortunately doesn't work for us that access [ via the AltGr layer. Unless someone knows of a workaround?
Whoa, I was not aware of this. Now I can completely avoid using the touchbar!
Man, what a sad statement...
I get where they are coming from. I find the touch bar pretty neat and useful... But it's dynamic and I don't want that to interfere with pure muscle memory tasks like typing.
You can also remap a key like Caps Lock to Escape, straight from System Preferences on macOS (unless you're already remapping it to Ctrl or something)
I do this and while I'm on my magic keyboard I sometimes forget and keep using the physical Esc key. I need to see if I can use something like BTT/Keyboard Maestro to respect the physical (or Touchbar) Esc key but send a notification of something like "You should use the Caps Lock Key instead" to help train myself better. I will say it's really nice that macOS makes it stupid easy to map Caps Lock to Esc and it work flawlessly for me.
I did this recently. An upgrade to a Mac with a touchbar prompted it, but I should have done it over a decade ago.
Caps lock remapped to esc is definitely a great solution - I have been using it for years
In Emacs, we remap Caps Lock to Ctrl.

Does anyone actually like Caps Lock?

I PROGRAM IN A LEGACY ENVIRONMENT THAT USES CAPS ONLY. I LOVE CAPS LOCK AND FIND IT ANNOYING TO HAVE TO SWITCH BACK AND FORTH WITH SHIFT.

so emails and general writing tend to be all lower case and rely on the editor to upcase for me. mostly works.

I really dislike shortcuts with `[` and similar keys. Design software also tends do use them. On a Portuguese keyboard layout[1], I need to press ⌥8 to get `[`. So shortcuts like ⌃[ become ⌃⌥8, which in vim produces `8`.

[1]: https://en.wikipedia.org/wiki/File:KB_Portuguese.svg

That's why I use the EurKEY [1] layout on all my machines!

This way I can use all the default US-based shortcuts for emacs/vim/... while still being able to easily type the special chars for my native language, e.g. pressing AltGr+o results in 'ö'.

This method is slightly inconvenient for typing long texts but for me it's still the perfect solution to such problems.

[1]: https://eurkey.steffen.bruentjen.eu/start.html

Why the Windows key though? Not everyone runs Windows. Call it Super. That covers every OS, including Windows and Mac. Also, caps lock is arguably useless. First thing I rebind... on Windows with a *.reg key, on macOS with Karabiner Elements.
I was not aware of this, but found a similar solution that is available almost on any computer: On Linux (my main work environment) I use the English International with AltGr Dead Keys. This gives me a lot of European (and other) accents by combining AltGr+<Accent simulation key> <Letter on which to put the accent>.

Examples:

ä - AltGr+" a (the double quote looks visiually like 2 dots)

ç - AltGr+, c

õ - AltGr+~, o

and so on. I found this solution very practical, even if quite late in my life (went from German QWERTZ, to French AZERTY, to end up with QWERTY), because QWERTY is available everywhere, even if I have to work remote through Windows computers, and it is much much friendlier than AZERTY/QWERTZ. Additionally it gives me to write with the same layout German, French, Portuguese, etc. And it is very easy to remember how to get the accents, because the used signs are visually close.

That's really cool. But if only care about English + French + Spanish and similar languages just using US-Standard layout on a Mac gives you similar benefits, and instead of the norther-European languages you get more common math symbols and greek letters :P

But anyway, EurKEY would be a sane standard in Europe, instead of the hellish borderline-inusable national standard keyboards...

Technically ESC is the shortcut key for ctrl-[.
Any keyboard used by a programmer should have direct one-key access to `[` and to all the 0-9 numbers...

For every shortcut you can imagine you can find at least one keyboard layout out there where it's inconvenient.

Just get over the crappy nationalized keyboard layouts and use US English keyboards like all programmers do!

I can type French + English + Romanian just fine and comfy (would also work for Spanish + Italian fine, northern languages might be a bit of an issue...), with all the accents and special chars of each language, on a US-English layout keyboard that also has `[` and ``` (backtricks) and all the 0-9 numbers available one keystroke away. Mac keyboards work fine by default, the Windows ones might ned fiddling around with picking US vs US-Intenational and windows quote character settings until you get it right.

Western European keyboard layouts (except British) are just plain broken imo, you can't need more than one key to type a damn `[` (array access), or force ppl to use Shift to type numbers, wtf.

Otoh, typing Lisp code on a French keyboards is kinda' cool in a way :P

I like that in spite of this requiring two fingers, each finger on it's own has to move less distance than one would in order to reach Esc.
Remapping Caps Lock to Control makes the motion even easier.
I have a couple "HHKB" layout boards which do that. It is quite helpful!

What I have found even more useful is triggering a "layer" when Caps Lock is held down, which turns H, J, K, & I into an arrow cluster; U & O into Page Up / Down; and P & ; into Home / End. To toggle regular Caps Lock, I just activate the layer and then hit A. It's a big time saver! :)

Do you have a minimal keyboard?

Vim would be a particularly good editor since most operations are simple and elegant with only an occasional exit of insert mode.

but emacs... probably not as fun.

:imap jk <esc>

Will change your life man.

Hah that’s good one! I need to take a vacation and re-examine my vim life. So many good things to explore and muscle memory to tweak.
I wonder if there are any studies that look at how hard it is to permanently readjust muscle memory as you age.

Would I ever (at 31) ever achieve the same fluency with emacs if I switched cold-turkey today as I've developed with vim in my teens and twenties? What about in my fifties?

I'm 33, switched to emacs the end of the last year, still find the way that vim edit files better, but the ecosystem around emacs has a ton of niceties, so for me the solution was to install evil-mode and configure it to work as close as possible to my vim configuration, but in the end I decided to left some things the emacs way.

Now I sometimes find myself using some of the emacs shortcuts when editing files with vim...

Nah when you hit 50 you're basically just a burned out husk and can't learn anything new, not even your muscles.

Love, Silicon Valley

This is what Spacemacs and I think Evil Mode do as well
Consciously I know that jk is a better shortcut, but I've been using jj for so long that it's ingrained in the muscle memory, when I started using emacs the first thing that I did with evil was replicate all the shortcuts that I am used to in vim, the first one was jj.
I have to shy away from using these remappings because I often work in Vim-emulation mode. It's easier to map CapsLock to ESC system-wide. It works across the several Vim-emulating editors I use.
I use quite a few as well and they all support it. Actually I don’t use vim much, mostly emacs and vscode but I know it works in IntelliJ, Eclipse and Visual Studio as well. What is annoying though is they all have totally different names and methods of configuration.
`:inoremap jk <esc>` first thing I usually do
ahah nice trick, I added it to my .vimrc ... and why not? also this

inoremap uu <esc>

  :colorscheme
  unknown                       "that's weird
  :set file^I^I                 "I guess tab autocomplete doesn't work
  :set filetype=cpp
  i#include <iostream><Esc>     "I guess syntax highlighting doesn't work either
  :set tabstop=4 softtabstop=4
  i^I^I                         "at least that worked!
Any plug-in support? Could I upload my vimrc to a server, then download it, apply it, and run :PlugInstall to get my vim setup in any web browser?
Would be even more awesome with plain nvi support :)
where would it store your plugins?

this is vim running in your browser, not some weird hybrid server-side vim thing that stores all your config files and plugins server-side in a per-user account but then transpiles them to wasm (regardless of plugin language) and sends them to the browser.

Unfortunately it's not working on my android phone with hacker keyboard (full keyboard with esc). There are also horizontal lines across the screen that should not be there.
I am impressed that

    :imap jk <Esc>
    :imap kj <Esc>
works great. However it seems like outer and inner text objects aren't working at all. E.g. daw, ci)
Anytime I end up in someone else's Vim editor the first thing I do is

    :imap kj <Esc>
Worked fine here, felt super snappy too.
is this a common key binding? I've seen it before and it makes a lot of sense but I'm wondering if I will run into issues. I don't want to disrupt my flow and muscle memory and later regret it.
Unless you type a lot of graph algorithms notes (and have to write "Dijkstra"), you rarely encounter the key sequence jk. It makes it easier to work with vim and never move to hit the Esc key.
That or you're writing in Dutch. Neither of ij, jk or even kj work in Dutch, because they are very common.
That's a very fair point! I hadn't considered this at all, I mostly write in English, and subconsciously assumed this would be true of most Vim users.
I guess it depends whether you want to write about playing blackjack with Dijkstra in Reykjavik!

I might need to try it out for a bit. It has the nice feature that if you press it in normal mode there's usually no effect.

I use it and love it, even after binding Caps Lock to Esc.

The only issue I have is when I type something that ends with j or k and immediately want to exit insert mode. e.g. if I type "ack" and then mash jk to leave insert mode. Sometimes the j will hit first and only "ac" is left in the buffer.

That happens rarely though, and sometimes now I'll know it's going to happen and consciously type "ackkj" or just pause a beat to ensure the right thing happens.

sorry for being dense, but I can't seem to save files or do anything seemingly practical. Is there any practical use cases for this library, or is this purely along the lines of "Hey checkout this cool hack!"
For the moment I'm going with hack.

I hope the author will work out some of these kinks so that it becomes usable !

When I was working on the Sage Notebook, circa 2007, I made the best textarea-IDE I could... folks requested vim and emacs bindings but browsers just weren't ready. Heck, I wrote my own javascript console because iirc only Firefox had one at the time, I digress... I look forward to a vim plugin for the IPython notebook!
I haven't tried it yet, but that should still make it as useful as pasting text into vim to make changes quickly. Things like highlighting a sentence and making it all lowercase or uppercase is very simple. (v/V/C-v for one of the visual mode selection types, then pressing u after the select makes it all lowercase, and ~ can swap case if you had capslock on and typed "sOMETHING LIKE THIS"). There's also :sort for quick alphabetizing and the classic :s/word1/word2 text replacement.
The register "* is visible but doesn't seem to reflect the clipboard or similar. I agree that it would be great if it were supported.
This is so cool! Well done!
This is absolutely incredible. I never thought this would be possible-- wasm opens a new phase of software development and deployment.
Or just use regular Vim and not think that everything needs to run inside of a web browser, especially if you value user privacy and computer resources.
Would be nice to be able to use vim (or any other editor of your choice) in web text boxes.
(comment deleted)
There are browser extensions that offer this. E.g. the excellent Tridactyl for Firefox lets you pop up a gVim window for any text box if you press Ctrl+i.
This has been possible for years with Vimperator and then Pentadactyl. Unfortunately it's awkward and can't take advantage of text fields with real time JavaScript processing (e.g.: Gmail, Markdown preview).
This is the logic that makes everyone move their workflow into emacs. A lot of what we do is text editing, so having a good text editor everywhere makes sense. Some programs like mutt can also drop in to your editor of choice when composing an email. Imagine if we all had vim for typing up these HN comments. I'd like something like this to be more feasible. Maybe there could be a standard for forums that gives you vim editing in the same way many give you markdown. It could also be cool to support org-mode syntax.
Imagine if programs knew how to interact with one another and could plumb data between them instead of everything living in one monolithic application.
Don't immediately hand wave away the value of these sorts of things. I don't think anyone would use this as their primary editor, but I'd love something like this in our merge request / code review process, as that's currently entirely browser based already.
Makes more sense for that process to move to the editor than for the editor to move to the browser. That way you keep all your plugins and whatever other context the same regardless of what you're doing.
There is some benefits you may not see atm...

I'd love to have my VIM with my config just available as a web service to use it on every device! That's what I already love about NextCloud and the likes - just one install and every device can access it. If you know how you can also make it secure enough for every day stuff - I think to be really secure going offline is not enough anymore.

Exactly. The first question that came to my mind is: "are the keystrokes logged?"
Wasm is company and technology independent and went through the proper process for becoming a standard rather than being forced in by some corp hoping to take over the internet.

It also doesn't have any of the security issues because its limited to things JavaScript can do.

Both alternatives that I mentioned, Flash and PNaCL did have open source implementations available, it is just a matter of following the links I posted.

WASM doesn't offer any security over internal data corruption as buffer access within linear memory aren't validated for data bounds or nullability.

So it is possible, for a WASM module generated from C or C++ code, to provide input data to its functions in such a way that it would compromise its behavior from the outside, even though it doesn't escape the sandbox.

Politics.

> Both alternatives that I mentioned, Flash and PNaCL did have open source implementations available, it is just a matter of following the links I posted.

At least for Flash I remember that the OSS implementations couldn't run many real-world flash programs. Did this change later?

It was good enough to run Unreal.
That's slightly interesting. But it doesn't change the fact that some programs fail to run on the open implementations. And why is that? Presumably it's a secret. This unknown difference in behavior is significant, even if the actual difference is small. It means one can intentionally write a program the only runs on proprietary implementations.
Wasm linear memory is a building block, if you want higher security boundaries, stitch together multiple Wasm envs and communicate via webworkers.

Wasm is nearly identical, but different in the ways that matter. You are being blinded by being ahead of the curve, but the curve has moved now.

I am eagerly waiting for the first set of CVEs related to WASM, and the "you are holding it wrong" comments from WASM advocates.
It would be interesting to force Wasm through an asm.js polyfill for non tier-1 trusted sites. Then one would have higher assurance that malicious Wasm couldn't do anything that js couldn't do.

Wasm will be absolutely pervasive at all levels of the stack.

> .... will be absolutely pervasive at all levels of the stack.

Yeah, I heard that before.

> Both alternatives that I mentioned, Flash and PNaCL did have open source implementations available, it is just a matter of following the links I posted.

You know that open source is not the same thing as open standards, right?

CrossBridge is a cross compiler. Where is the open source flash runtime?
GNU Gnash and Lightspark.
Probably next step would be to run nginx/node in browser!

This will enable doing full web development in browser only

I have seen a project which runs a js webserver in a service worker; it's not a terribly far-fetched idea.
Actually I wonder how hard it would be to run node in a browser, given that it's already JavaScript. You obviously have to have to implement some amount of API surface at a minimum and it's possible that browsers are geared to be servers and clients, but it certainly sounds plausible at a first pass.
The latency in Safari on a MacBook is better than VSCode. Which makes total sense, but is impressive and demonstrates how much better electron could be.
very cool, some of the set commands don't seem to work for me... set softtabstop for example didn't appear to work. also i might have a local setting but tab complete with set wasn't working... again probably local settings. and :w wtf didn't work :D seems to crash it. This is super cool

[update] ah i see from the readme write support is in the todo list.

Does anyone know if lynx plans on supporting wasm? I'd like to try this editor in a terminal.
How about this in emacs www mode?
At this point, the easier route to getting a text-based browser to support something like this would be creating a new one based on WebKit/Blink.

It would probably need to get the engine to draw to a fake screen buffer and run an OCR algorithm over that. And even if the OCR and layout worked well, there would be a lot other work necessary to get reasonable text based interactivity, though that's probably partially solved by projects like Vimium. Some interactions like dragging would likely never be supported.

Not easy at all, but somehow more reasonable than updating lynx to support all of today's new technologies. I wonder if anyone's already tried something like it.

I just found Browsh[1] which seems to be basically this but with Gecko. It seems they don't need to do OCR which makes sense thinking about it more. Cool stuff. Haven't gotten to try it yet.

[1] https://www.brow.sh/

I did! See brow.sh

It uses Firefox as a backend so can in fact run Wasm. However it doesn't use OCR, it uses the DOM to get precise coordinates for text nodes, this recreating a pure text representation of the page, using nothing but spaces and carriage returns for "formatting".

The vim browser demo uses pixels drawn to canvas though.
> OCR

Hey, dial back the blasphemy there. HTML is not PDF, it's usually made from text in the first place.

I'd guess you could force all text to use a monospace font, with fixed measures and line-height, and limit the width of the page. Then mostly dump the resulting text arrangement into the terminal.

Now, layouts from the various elements and CSS are probably a lot trickier, but snapping all margins and padding to multiples of a symbol's size should go a long way.

It seems that this could even be embedded at different levels in the browser: the layout engine or just the user's JS. (If JS can obtain the exact layout of text lines and elements―likely not, though, especially in forms. Maybe via devtools.)

> HTML is not PDF, it's usually made from text in the first place.

I don't know, man. Most websites would be smaller if they were replaced by a HD video of someone reading the contents.

> Hey, dial back the blasphemy there. HTML is not PDF, it's usually made from text in the first place.

Hey, dial back the blasphemy there. PDF is not an image, it’s usually[0] made from text in the first place.

As someone who has a bunch of experience both creating and parsing PDFs, it’s definitely very doable to extract the text content and render it in a similar way on a terminal. Yes, parsing the PDF format is much more painful than average HTML, but these days there’s libraries commonly available to assist.

[0] unless the PDF is a famous redacted DOJ document, then it’s a poorly scanned collection of image crammed into a PDF container.

It would need to have its HTTP code gutted and replaced with something that uses JS's XMLHttpRequest or the request API, but I think that's all you'd need to change.
Or write a C function called http_request, refactor all of Lynx to use just this one function, and then do something like

    #if PLATFORM === 'WASM'
    then
      fetch()
    else
      the actual sockets and stuff
    end
You might be on to something here. I could see this editor working really well in a terminal environment.
(comment deleted)
What's a terminal? Every kid knows that anything that doesn't run in a browser can't be software.
Definitely doesn’t scale.
Oops, I forgot the /s at the end of my comment.
I can't save.

:w test

"test" E667: Fsync failed Warning: original file may be lost or damaged.

i had to turn off adblock plus and ublock origin to get this to work for some reason
Why does it completely freeze on :w foo ? It asks for ENTER or any key but that doesn't work at all at that point.
Will wasm ever use html/css properly? Or will it just be more like flash?
Well, HTML/CSS are sort of separate and wasm doesn’t replace them, but if you mean DOM access, it’s planned but not available yet. You basically have to write JS glue code that interacts with your web assembly code
It can already interact with the dom and people are working on making this more seamless and faster.

The real question would be: why would you do that when you can instead use any proper native UI toolkit?

Answer: it's now a choice. If you need command line stuff like vi running smoothly in a browser, the DOM is an obstacle, not a solution. If on the other hand you want a wasm application driving the DOM and generally looking and feeling like a web app, you can do that as well. There are several frameworks emerging for rust, kotlin, C#, and other languages that do exactly that and that use bindings for the DOM and other APIs you have in javascript in a browser. Basically, you are writing normal dom/html/css based applications; except it all compiles down to wasm and does not involve any javascript.

Good work. Almost there.

Things that doesn't work starts from where you might need to change word "ciw", visually select word "viw".

pretty fun as an experiment. It would be so cool if someday github/gitlab had this as an option for editing files
I think this is why a lot of people still handle issues via email. It integrates well with the classic text editors.
:! cat /etc/passwd

[blocked]

sorry can't help myself trying this. but good job!

It runs client side, though
It's nice when tools prevent you from pwning yourself :)