26 ms·
History of Emacs and vi Keys (2010)
- atemerev 9y agotl;dr Emacs and vi keybindings are a product of inferior keyboards used at the time of their inception and not (I repeat, NOT) a superior way of text editing which philistines can't comprehend. Programmers are the worst cargo cultists.
- zck 9y agoDo you have better designs? If you're using Emacs-style editing, you want Ctrl shortcuts. If you're using vi-style modal editing, you want single keys to move around. What would you recommend? Note that moving your hand to the arrow keys is, while more intuitive, slower and requiring more thought than the other options presented (once these options are learned).
- kurtisc 9y agoRemapping vi's escape function to caps lock or jj/jk seems like a common example, or doing it the other way around and getting a HHKB. It doesn't have to be a wholly different style, just one that fits modern keyboards.
- falcolas 9y agoHaving used a HHKB, the arrow keys and page/home keys are aggravating to have to chord when you are in a program where you can't remap to the expected key combinations (and the chords all have to be done with just the right hand, unless you want to give up your CMD/Windows key). The swap of del and '\' is annoying too, and creates problematic muscle memory that will fail you when you're forced to use a normal keyboard.
- teddyh 9y agoThe Happy Hacking Keyboard Lite2 features real separate cursor keys: http://www.pfu.fujitsu.com/hhkeyboard/leaflet/hairetu.html#lite2 http://www.pfu.fujitsu.com/hhkeyboard/leaflet/hairetu.html#l...
- atemerev 9y agoMac default keymap looks intuitive enough for me. Opt+arrows for skipping words, Cmd+arrows for sentences. Beats absolutely arbitrary Ctrl-A/Ctrl-E and ^/$ definitively. (I am a proficient touch typist, but I can't adapt to hjkl in lieu of arrow keys — not to mention the context shifting overhead for two vim modes).
- vlunkr 9y agoIs holding down one or more modifiers and pressing a key not a similar context switch? Typing 'v' enters a 'v' character, cmd/ctrl-v pastes from the clipboard. There's no logical connection between the two except that you've probably had that one memorized for decades. The difference in vim is that you don't use modifiers when you're in normal mode (usually). Side note: TWO vim modes? I guess you're never had the pleasure of stumbling into ex mode
- atemerev 9y agoTwo primary modes, you pedantic you. Control keys are relegated to the edges of the keyboard and easily remembered and distinguished by touch, as there are only few of them. Cmd+X, Cmd+C and Cmd+V is much more convenient, memorizable and logical (X and V visually look like editing marks on paper, for cutting and inserting respectfully; C is for Copy), than... how do you copy-paste again in vim? v/y? I see no logic there. Yes, I remember that v is for "visual selection", and y is for "yank", whatever it is... but it is way less logical.
- vlunkr 9y ago*you pedant you
- hxegon 9y agoJust because you don't understand/like something doesn't make it illogical.
- ursus_bonum 9y agoThis just in: "P" ruled totally illogical for "paste" "V" remains totally logical though of course
- tty7 9y agoOne day i'll be able to downvote
- thowaway60 9y agoOr not. I had over 300 points when I was banned for religious content in odd comments
- atemerev 9y ago...rationalizing cargo cultists.
- hxegon 9y ago...name calling conclusion jumping anti-circlejerk-circlejerkers.
- AlexandrB 9y agoThat's a bit of an oversimplification. Especially given how none of those keyboards look THAT different than what we use today. In particular, Vim's use of the home row for movement is objectively better than moving your hand off the home row and using the arrow keys (which you can do if you wish as well). I'm sure if someone was creating Vim today, they might choose WASD instead since many are familiar with the use of those keys for movement in gaming.
- atemerev 9y agoKey distinction: they didn't have arrow keys block. You can pry my arrow keys from my cold dead hands!
- WorldMaker 9y agoBut you have to relocate your hand from the home row to use arrow keys. Arrow keys are great and all, but the vi/vim benefit to home row arrows is a lot less travel for your (usually) right hand, which can be a great ergonomic win.
- LanceH 9y agoI would prefer they pick jkl; instead of hjkl. I'm not a fan of shifting my right hand left and even less enthused about forcing my index finger into double duty on jh.
- chongli 9y agoAs a long time vi and vim user, I disagree. Learning the keys tends to happen in stages (with arrow keys being stage 1) and reliance on hjkl is not the final stage. When you truly master vi/vim you barely use hjkl at all. Instead, you use fFtT/?nN;, text objects, addresses, and marks. These tools allow you to move to places in text and make changes at a glance without dealing with all the characters or lines in between.
- prewett 9y agoFor a long time I used h, -, return, and space. I had a hard time remember what j and k did, and those were a lot easier to remember.
- epistasis 9y agoHaving caps lock where it is on current keyboards is in no way a superior design. It's a useless key in a prime location! Give me those "inferior" keyboards any day.
- jmfurlott 9y agoMap it to ctrl and emacs is unstoppable :)
- atemerev 9y agoYeah, C-n is just _perfect_ to reach. Just thinking of it makes my arm twitch and glow with pain. I am starting to suspect that Emacs original keybinding designer (Richard?) is actually an octopus.
- brudgers 9y agoHe had a keyboard with important keys on both sides of the spacebar because the assumption was that a user would interact with the computer in sophisticated ways such as or similar to programming. Most current keyboards are designed for cost saving or consumption or just by copying mediocre designs that are common.
- atemerev 9y agoI write software for 20 years, I use Linux and OS X as my primary development desktop OS, I have used Slackware Linux 1.0 back in 1995, I am a touch typist — but I just can't stay using Vim or Emacs, unless forced to (such as when I have to quickly edit something on a remote machine). Yes, I might be a special snowflake — most developers don't have problems with vim or Emacs, expect for occasional flame wars between the two. But I do, even as I tried to make the switch like 20 or more times.
- klibertp 9y agoWhy would you even try to make a switch to Emacs? It's kind of ok as a text editor, but, by default, it's nothing special. The default keybindings are stupid all the time they aren't malicious, that's true, and it has other problems, like archaic UIs (eg. completion, M-x, Speedbar). The situation changes drastically once you account for two things: 1. The plugins. I said it many times already here on HN, but my Emacs is running 900k loc of Elisp, where more than 500k loc are plugins (or extensions, applications, and libraries). When modern packaging systems appeared, for both Emacs and Vim, their ecosystems were already formidable - it only got better since then. 2. Customization. It's not, in my opinion, worth learning Emacs if you're not going to customize it. The defaults are awful, that's one of the few things I agree with Xah on. But the ease of configuration and extension makes up for it if you're willing to put some hours into it. Not into "learning Emacs", but into "learning how to customize Emacs". The latter - if you're a programmer - is also more fun than memorizing arbitrary keybindings which don't necessarily make any sense for your keyboard, hand size and other factors. It's, of course, a trade-off, as you have to put some effort into it and you're starting from a rather low point. You could try one of Emacs "starter kits", but, honestly, they involve just as much memorization as the vanilla version and (as mentioned) I don't find it fun at all. Still, the smoothness of your workflow that you can achieve with Emacs once you do customize it is astonishing. It's still not pretty like VSCode (just one example I recently played with), but it doesn't have almost any limitations to what it can do with a single press of a key. It can make minutes or sometimes hours of your work time collapse into seconds (well, as long as you tell it how). If you didn't already - if anything I wrote here is news to you - you could give Emacs another try. Of course, if you're not opposed to spending some time tinkering with it until it feels just right.
- arca_vorago 9y agoI think the main difference between the vi(m)/emacs users and others is that they actually use the keyboard as their general home more. Not just programmers, but sysadmins, office workers, etc, spend far too much time in habit-formed inefficiencies of input.
- sctb 9y agoWe don't need name-calling flamebait TL;DRs on Hacker News, please. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- atemerev 9y agoI genuinely consider falling into established patterns and modes of interaction (i.e. a cargo cult approach) to be a serious problem for software engineers, including myself. And I think that vi and emacs keybindings are a great point illustrating this problem. But you are the boss, boss. Won't happen again.
- sctb 9y agoThen please make your point without violating the guidelines. It's not trivial, especially when we feel strongly, but it's not hard.
- pvg 9y agoPrevious thread https://news.ycombinator.com/item?id=6056420 https://news.ycombinator.com/item?id=6056420
- submeta 9y agoInteresting to see the Symbolics keyboard. As an Emacs user I had reprogrammed my ThinkPad keyboard (Windows) so that Alt -> Control Windows-key and Menu Key -> Alt Control keys -> Windows key So without having ever seen a Symbolics keyboard and without knowing the history behind emacs keyboard layout I remapped my keyboard so that I had very quick access to Control and Alt (= Meta) keys. On my Macbook it's not that easy. I could remap the Command key to become a Control key, but many Mac shortcuts heavily rely on the Command key. So that's no option.
- klibertp 9y agoI used "Keyboard Maestro" for this. I tried out some other tools, but they mostly didn't work or were too bothersome to configure. It's definitely worth the cost, as it made a Mac usable to me, although my keymap is quite different from yours, which is kind of a point with this kind of software :) I was using Linux and StumpWM (a Common Lisp/Emacs-based WM, and Enlightenment before that) for a couple of years, so I thought that full support for personal keymaps is a given in any serious computing environment. I was pretty shocked to learn that on Mac OS you can do very little keybinding, if exchanging a few keys positions can be even called that. Fortunately, it looks like I'm going back to Linux soon.
- submeta 9y agoThere is Karabiner for Mac. It let's you remap every key of your Mac. For instance I remapped the enter key to behave like a Control key if I use it in combination with another key. Otherwise (if I just hit enter it behaves like the enter key)
- lispm 9y agoNeither Emacs nor the control/meta keys were invented on Lisp Machines. Emacs was written in TECO on DEC's PDP machines. The control/meta keys actually date back to Professor Wirth at Stanford. The Stanford keyboard had control/meta then. MIT then had it in the form of the Knight keyboard. http://www.lysator.liu.se/hackdict/split/bucky_bits.html http://www.lysator.liu.se/hackdict/split/bucky_bits.html
- kps 9y agoControl as a modifier key (not a bucky bit) certainly predates that, if the dates in the link are correct.
- DonHopkins 9y agoDouble Bucky (C) 1978 by Guy L. Steele, Jr. (Sung to the tune of "Rubber Duckie") Double bucky, you're the one! You make my keyboard lots of fun Double bucky, an additional bit or two: (Vo-vo-de-o!) Control and Meta side by side, Augmented ASCII, nine bits wide! Double bucky, a half a thousand glyphs, plus a few! Oh, I sure wish that I Had a couple of bits more! Perhaps a Set of pedals to Make the number of Bits four: Double double bucky! Double bucky, left and right OR'd together, outta sight! Double bucky, I'd like a whole word of Double bucky, I'm happy I heard of Double bucky, I'd like a whole word of you! (For those of you who are interested, the term "bucky bits" comes from Niklaus Wirth, known as "bucky" to friends, who suggested that an extra bit be added to terminal codes on 36 bit machines for use by screen editors.) http://www.art.net/~hopkins/Don/text/double-bucky.html http://www.art.net/~hopkins/Don/text/double-bucky.html
- soperj 9y agoAny idea why the period became repeat in VIM? I've checked through old manuals, and can't quite figure out where it came from.
- gp2000 9y agoIn command contexts "." refers to the current line (e.g., :.,$s/a/b/ will perform the a -> b substitution from the current line to the last line of the file). That comes from ex which likely copied that from ed. I've seen "." used similarly in other contexts. 8-bit Microsoft BASIC used "." for the current line -- "LIST ." would list the last line that had been listed or edited. A number of assemblers use "." for the current assembly address. The point being that there is a bit of a tradition of using "." for "the current thing" so there's a sort of sense in using it for the most recent command. If you're really curious get in touch with Bill Joy.
- flukus 9y agoAlso ./ for the current folder is still used on all OS's. I think your examples predate computers having folders though.
- kps 9y agoUNIX's ‘.’ predates Microsoft BASIC. (Possibly inherited from Multics, but I don't know.)
- flukus 9y agoI was thinking more of ed, for some reason I thought folders were a later invention, 70's or early 80's, but they were first used in 1958: https://en.wikipedia.org/wiki/Directory_(computing) https://en.wikipedia.org/wiki/Directory_(computing)
- tetraodonpuffer 9y agowhat is the difference between "backspace" and "rubout"? the emacs keyboard had both it seems, but wouldn't they be doing the same operation?
- teddyh 9y agoSince that keyboard does not seem to have a “Delete” key, I assume that “Rubout” performs that function.
- simtel20 9y agoThis is probably a holdover from typewriters. Backspace moves the cursor. Rubout erases.
- ScottBurson 9y agoOn an ASR33 Teletype, backspace simply moved the carriage one character position to the left. Rubout was a different concept entirely. The ASR33 had a paper tape punch and reader. The Rubout character was 0x7F, i.e., it had all bits set. So, to "rub out" an erroneous character from the paper tape, you could back the tape up in the punch to the desired character (by pressing a button on the punch; there was no character that invoked this function) and hit Rubout; this would punch the tape at all seven holes, changing whatever character had been there to a Rubout. (The software ignored Rubout characters on input.) When the world moved on from Teletypes, it was natural for people to want a single keystroke that meant "delete the previous input character". But there was evidently some divergence of opinion in the industry as to whether that should be Backspace or Rubout -- notwithstanding that the ASR33's concept of Rubout didn't really map at all onto the new hardware.
- kps 9y ago> notwithstanding that the ASR33's concept of Rubout didn't > really map at all onto the new hardware. If you are working with paper tape, Rubout (DEL in ASCII parlance), like every other code, advances the tape when punched. So, if the tape is a stream of characters, DEL erases the one under the cursor and leaves the cursor on the character formerly to the right. That is, Rubout/DEL is defined as a ‘forward delete’ operation, and that's something that remains useful. That leaves Backspace as the natural choice for entering ‘backward delete’ on a keyboard, at least after 1979 when you have the ANSI X3.64 escape sequences for explicitly nondestructive cursor keys. I think there's a reasonable argument for Backspace being nondestructive for overstrike effects (accents, underlining, APL, etc.), especially when received by a terminal, but I know none for changing the meaning of DEL.
- thomastjeffery 9y agoVi is a poor implementation of a great idea. I would really like a modal editor in which I could configure the behavior for each key, maybe even define more modes and composable functions.
- yorwba 9y ago:help map.txt
- thomastjeffery 9y agoYes, I am well aware that I could remap everything. It's still not as malleable as I would like.
- stewbrew 9y agoWhat exactly is missing? The tinymode, the tinykeymap (and others) plugins emulate some sort of temporary modes.
- thomastjeffery 9y agoRather than map over already-defined keys, it would be nice to have a clean slate to work from.
- njharman 9y agoSo, "I want cake! Ok, here is cake. No! I want it to be feed to me also." Sometimes, you should accept the 80% (or 97% in this case) solution and not pine for 100%. Or, scratch your own itch instead of whining no one else is offering to.
- thomastjeffery 9y ago> Or, scratch your own itch instead of whining no one else [who] is offering to. I'm working on it, but these things take time. I don't see how it hurts to express my thoughts here. I wasn't asking anyone to do anything, just expressing something that I want, in case it already exists, or there are others who share my desire for it.
- njharman 9y agoI never understood appeal of wasd. Maybe my fingers are shorter. It's way easier for me to have all three on same line so I change S to fwd and X to back.
- rosetter 9y agoEmacs user? Get a Japanese keyboard. That's my number one piece of advice after two decades of Emacsing and one on a Japanese keyboard. Japanese keyboards have a much shorter space bar with extra keys on either side. Remap these to control, hit them with your thumbs, and experience bliss. I used to get 'Emacs pinky' quite frequently, but never since the switch. If you think about it, it makes all kinds of sense: - your thumbs are strong and dextrous but totally underused in a traditional layout - most space bars are ridiculously large.. wasted real estate - your non-spacebar thumb can comfortably rest on a ctrl key so there's often no lateral movement at all Fascinating to see others thinking along the same lines as me with keyboard remapping, and also to discover that all this time we've been trying to get closer to the keyboards of antiquity!