546 points · by fuzzix · 14y ago · 219 comments
The 1992 paper "The Prevention of Mode Errors Through Sensory Feedback" [1] uses this exact mechanism.
[1] http://research.microsoft.com/en-us/um/people/asellen/public...
I've argued for years that vim is one of the few good examples of modal design since it allows for quick entry of the command grammar without modifiers and the command grammar is an excellent fit for the domain. Whenever I bring this up with an interaction designer, I'm told there is no such thing as a good mode. The citation chain has always wound up at this paper and while I generally agree with the paper's conclusion, I'm frustrated that the editor is used in the most inspid way possible to generate mode errors (at the rate of 3-6 in 10 minutes of editing...). The problem given in the paper is solved by `:%s/\<[A-Z]\+\>\zs/errorerror/g` and I could probably do it a half dozen other ways.
Every time I read the paper I tell myself I should make/acquire a pedal and try it out but I've always been too lazy.
Doug Engelbart (http://en.wikipedia.org/wiki/Douglas_Engelbart) around 50 years ago:
http://www.dougengelbart.org/history/pix.html
"other experimental variations were later built and tested, including foot-pedal operated, knee-operated, even head-operated ("nose pointing") devices."
That said, for me as a pianist the idea of mode pedal looks pretty awesome. It just needs to be developed a bit further.
Similar ideas came up quite a few times in the recent MaKey MaKey design competition:
http://www.makeymakey.com/forums/index.php?topic=211.msg310#...
http://www.makeymakey.com/forums/index.php?topic=53.msg65#ms...
http://www.makeymakey.com/forums/index.php?topic=285.msg412#...
http://www.makeymakey.com/forums/index.php?topic=180.msg250#...
http://www.makeymakey.com/forums/index.php?topic=292.msg441#...
http://www.makeymakey.com/forums/index.php?topic=173.msg239#...
http://www.makeymakey.com/forums/index.php?topic=338.msg568#...
http://www.makeymakey.com/forums/index.php?topic=346.msg576#...
My setup has one pedal bound to Escape for Vim, and the other two switchable using F keys and some xbindkeys magic. By default, they're "switch WM workspace" (sort of like Alt-Tab) and "switch window focus within a workspace" in Awesome WM, but I can change them to e.g. j and k for reading my email, or have them run various scripts, or whatever.
It's a lot of fun to use, but I haven't been on it much lately having switched to a standing desk and I haven't yet figured out a way to make the two play together nicely. And, as always, I've been meaning to throw the scripts & dotfiles on GitHub, but I'm a slacker.
http://en.wikipedia.org/wiki/Mode_(computer_interface)#Quasi...
He never mentioned pedals though, it's a really clever approach.
If pedal-up worked, it would be neat to be inserting only while the pedal is depressed.
But however I think this is purely subjective. From an experiment perspective, this is really cool! And this generally qualifies into what could one call a 'real hack'. This has a air of freshness to it.
Now the real power of vim is in getting into a mode called 'extreme keyboarding'. I didn't realize this until I read Tom Christiansen's seminal essay "Zenclavier: Extreme Keyboarding"- http://oreilly.com/news/zenclavier_1299.html
This is to ultimately turn the keyboard into a Musical instrument, and then to become 'one with the keyboard'. Totally loosing any realization that you are actually typing. Read the essay carefully and try to understand how he tries to talk about 'moving in and out of zones'.
I started learning vim a few days back, after I suffered from Emacs Pinky. When I started question I asked was, 'Why should I memorize so many commands'. The thing is I quickly realized that being proficient with vim, requires you to understand some things. You really have to understand the vim paradigm, without that straightly diving into vim wont be much productive.
You have to learn h,j,k,l are not just navigational keys but also can be combined with multipliers like 20h(Moves 20 positions to the left). You basically speak a 'Editor programming language'. You program editor with a stream of characters. Like for example you my say 'copy this line, move up 20 positions and paste it'. This will be yy(copy current line) 20k(Move up 20 positions) p(paste it there).
So you have to basically learn these things in detail. You can use position stuff for things as well. Like for example 'd' specifies 'cut from here' and 'y' specifies 'yank/copy from here', but to where? the next character specifies that for example '$' specifies the end of a line. You can also do something like 'y2/foo' this means 'yank from here till foo'. You will have to learn regular expressions, touch typing, and many other text processing stuff. Basically you learn a terse programming language which is written as a stream of characters with data on the editor as a input.
Recently a colleague of mine introduced me to a editor command called ': perldo' you can do perl oneliner on the editor line by line.
The only thing is I couldn't find a book so far in my early days of vim, which completely teaches the 'zen of vim' completely in the paradigm, in which one needs to understand it. So vim is really about these things, I don't how far the pedal/clutch experiments gel with this concept. You may need a totally different editor paradigm to work with this setup.
In the meanwhile, if someone knows of a book that talks of vim in the way its supposed to be explained please recommend. All I could find on the net was cheat sheets, books that teach a commands in bulk.
You know, I've understood this for a while, but to this day I still don't use it.
I can't count characters that fast! If you're going to lean forward and count out chars, you might as well count them out with presses of 'h'.
With that, my natural finger movement on the arrowkeys and on the vim home row match each other.
The reason vim's navigation keys (hjkl) today are arranged the way they are, left-means-down and right-means-up instead of up-means-up and down-means-down, is among the dumbest reasons there can be. Decades ago, the keyboard Bill Joy happened to be using when he wrote vi just happened to have arrows printed on the keycaps of the hjkl keys. He was trying to think of ways to make memorizing lots of commands easier, so he decided to take advantage of what was printed on those keycaps. There were no arrowkeys on that keyboard. That, in itself, was not a dumb choice, because it would have been a useful mnemonic on his own keyboard and he'd probably never seen an inverted-T set of arrowkeys, which didn't become popular until years later.
The dumb part is the insistence on maintaining this onion in the varnish as sacrosanct decades after that silly keyboard disappeared and in an era where every new vim user is accustomed to using the inverted-T arrowkeys found on virtually every keyboard. Anyone who, for some reason, hasn't ever used his arrowkeys picks it up immediately: up-down-left-right mean up-down-left-right. Got it.
That's why so many people who want to use vim have to be "broken" of the habit of using the arrowkeys and forced to learn an additional, weird arrowkey arrangement, because ("trust us") using the home keys is better.
Well, using the home keys is better, but not because of the awkward arrangement. That part is worse. It's better because that's where your fingers rest normally on the keyboard, from where you can operate the full set of vi commands and enjoy its full power.
You can have both. It wouldn't take much convincing to wean people off the arrowkeys if both sets of "arrow keys" on their keyboard had the same natural arrangement they've been used to for years.
I was worried when I abandoned the onion that it would handicap me on plain-vanilla installations of vi/vim until I realized that, these days, yes, there are two sets of arrowkeys on every keyboard, and I can use the real arrowkeys if I have to work on a version of vi/vim without my .vimrc, because they're arranged just like my ijkl. I can live with using the real arrowkeys for a while, and if I'm staying longer, I'll "curl -O mydomain.com/myvimrc" and restart vim with my full customizations and go back to the home row. (I also have my zsh in vi mode, and my .zshrc remaps keys the same way and can also be fetched using curl.)
I fully understand that changing this fundamental arrangement is NOT attractive to experienced vim users, because muscle memory has long since automatized the arrangement. The old fogey's vociferously defend the old onions for various, mostly self-serving, reasons.
(They tell me, for example, that this will make it impossible to use a vim on a different machine on the same page where they brag about their extensive and brilliant .vimrc customizations that they "couldn't live without." Hmm.)
But I'm starting to teach my kids to use terminals, command lines, and editors, and I didn't want to pass this onion on to their generation. I remapped the keys and retaught myself to make it easier for them. Now we can share the same .vimrc and .zshrc. They'll have one, consistent set of muscle habits for arrowkey motion from the start, whether playing games, editing text, or on the zsh command line.
* First and foremost: If you rely on hjkl, you are doing it wrong anyway. You should be using f, w, ), :n (for integer n), ^d, ^f, etc. My biggest hjkl use case is using j to idly scroll through a file (or less/more/man page), in which case it's conveniently under my index finger and I love it. I also use l for off-by-one errors.
* Secondly...especially now that it's ingrained, all of the other keys "make sense" (sort of), and there's no excellent alternative. With your setup, "Why is h insert? Wouldn't i make more sense? Gosh, vim is hard to use." Etc. etc.
Thanks to the relative line numbers patch being merged in finally (:set rnu and now you show line numbers relative to your cursor) you get easy moving up and down.
I prefer the easymotion plugin (https://github.com/Lokaltog/vim-easymotion/) that annotates your file with little markers (like the vimperator/pentadactyl/vimium browser plugins use to click links with the keyboard) that allow you to jump around extraordinarily quickly.
It was, and still is, a learning curve since it adds to so many basic vim commands that are muscle memory for me by now but it's worth it.
If you type fast, you don't want to have to spend time correcting for line estimations that are slightly off as a result of thinks like 20h. For navigation, just use forward slash to search and you'll land right where you want. It's also almost always faster to use f/F/t/T in conjunction with semicolon or comma for jumping to specific letters than using h or l. The # and * keys are also useful for jumping to words in a specific line. Failing all of /?fFtT#*, it's still going to be faster to use ^0$wWbBeE than hl unless you're one or two characters away from where you want to be. But you shouldn't even need to navigate much within lines, since text objects let you edit entire units of text, regardless of where the cursor is within those units. People who come from an emacs background (and use the default editing environment instead of evil) can't even imagine how powerful Vim is as a raw editor until they try it. I can only edit in emacs for long periods of time if I'm using evil to emulate vim's text objects.
See http://www.viemu.com/a-why-vi-vim.html if you're new to Vim
:set relativenumber
You won't have to count anymore.Moving word wise,(w,e) is used a lot.
Next occurrence of word under cursor is useful. *,#
Learning effective macros is extremely useful.
di" is one of my favorite commands. Delete everything inside the quotes not including the quotes.
Put inoremap jj <Esc> into your .vimrc so that you can press jj quickly in insert mode instead of Esc.
Remap your arrow keys to nop and get proficient with it; this feels like I am editing super fast. A lot of editor time can be spent with your hands on home row without ever leaving.
You usually want to replace what's inside the quotes, so hence use ci"
cit is pretty nice for replacing a tag's inner html. And of course this works with parentheses - ci( - and brackets - ci[ - and curly braces and single quotes and angle brackets.. I love vim :)
I use ci{ all the time for functions and CSS. It's like magic. Whenever I'm using something like nano, I'll instinctively type what looks like a long string of gibberish: "jjjddo [oh crap] <bs><bs>..."
Once you really start getting used to the language, it makes it frustrating to use anything else.
I normally use C-c. Is there a way to make the time between j...j to be really short? Like the delay for it to count as a double press? I'd like to reduce any chance of accidental typing (although I can't see any reason I'd type "jj" a lot).
How could I forget the substitution command? <range> s/old/new/g (g == all occurrences on the line.) range can be a lot of different options. The most useful <range> options in my experience would be:
%(all lines in the file),
select something in visual mode and press :,
-x, +y for + and - x and y lines from where you are.
exact range is not that useful in my daily use.
The other thing to note about the s command is that you can use other delimiters instead of / I like to use #
% s#/some/path/to/a/file#/another/path/#g works just fine and is much more readable than % s/\/some\/path\/to\/a\/file/\/another\/path\//g
I think the car clutch is more related to the force required to press it - it's kind of a long, slow push with lots of pressure AND control at the same time. This seems like a button, on/off-type deal - more like tapping your foot than squeezing a clutch.
I also recommend the O'Reilly "Learning the vi and vim editors" book, http://shop.oreilly.com/product/9780596529833.do and my own course on vi basics, http://www.verticalsysadmin.com/vi.htm
It looks a bit untidy, but it's a very quick read because it's a low-density chat log.
Wonderful articulation of what we're losing with the fashion moving towards low learning curve, expert-proof designs.
Now I can send that link to people instead of trying to articulate the same idea in my own words.
remove lock = Caps_Lock
remove Control = Control_L
keysym Caps_Lock = Control_L
add lock = Caps_Lock
add Control = Control_L slkjs/sdfjks/\1jksok/j23kjdj\skjd
is the same as
lkkd\kk////?!@
except latter is shorter and easier to understand
The note was actually correct and the actual expressions made sense, but to an average person both looked like a line noise. Needless to say it was his last class.This can be used to easily control the keyboard: http://www.pjrc.com/teensy/td_keyboard.html
However, maybe these car style pedals would be more ergonomically suited than the little metal studs of guitar pedals, which are designed to be aggressively stamped on.
Thoughts?
imap kj <esc>
I have never had to type a word with the letter combination 'kj' in it. Works great.Picture : https://plus.google.com/118040095502884745897/posts/FwN5FEfN...
Source : https://github.com/suapapa/arduino_sketch_balcon123
I'm pretty happy by having my caps lock key mapped to escape, though.
Works here (misusing the F8 key) [2].
---
Sadly, I don't think it will be trivial to implement.
I only use i part of the time, however; I, a, A, o, and O are each used substantially.
The one I do have a massive problem with is capslock. So many times I'll go back to normal mode and there's a few moments of disorientation before I realise all my commands are being capitalised. Ugh.
OTOH I have heard Emacs users need Ctrl/Alt constantly while editing.
Ctrl+u,d for page up and down.
Ctrl+e,y for shifting the screen up and down.
Ctrl+],t for moving in and out of tags (with ctags).
Ctrl+v for visual block mode.
Ctrl+[ instead of escape.
Ctrl+p,n for autocomplete.
Ctrl+r for redo.
Ctrl+o,i navigate location jump history.
...and probably more that I don't know about.
Additionally:
I have Ctrl+h,l mapped for tab switching.
Terminal multiplexers like tmux and screen use Ctrl for switching terminal sessions.
Actually, on the laptop I'm on, I have Caps Lock mapped to backspace - vanilla unedited colemak layout. On my desktop, I have Caps Lock remapped to LCtrl and LCrtrl mapped to backspace.
You said you were on a mac so:
System Preferences -> Keyboard -> Modifier Keys
Another idea: repurposing a midi faderbank that supports automation (servos) to display data from snmp/statsd/graphite.
I was inspired because my midi keyboard has a pedal switch input...
Suppose he comes up with a better way to build the device. It would be good practice to have all versions available, something that isn't as easy to do with a website. Additionally, his target audience is people who use vim, which probably has a reasonably large overlap with git/GitHub users.
A clutch can be used for mod switching; such as running mode, stealth mode or reloading guns.
[^] Nintendo is a holdout here, though the WiiU apparently has the buttons.
This is the latter.
vi and vim are holdbacks from the days of 300 to 9600 BAUD modems. A time when more sophisticated interfaces were prohibitive. Back in those days it wasn't too uncommon for people to actually write their own text editors. I wrote a few, mainly in Forth, as I would bring-up self-designed systems.
While I use VIM today when I have to I continue to think that in today's context these things are, well, ridiculous. There is no reason that the terminal can't switch modes on you and allow text editing with the same (or very similar) UI that traditional simple GUI editors provide.
The damn text box I am using in this browser to enter this comment is far more user-friendly than VIM. There is no reason for a modern terminal to continue to support something like VIM.
Put another way, I had editors running on 6502-based 2MHz clock (yes, 2 MEGA Hertz, not Giga) Forth machines that were far more user friendly than VIM or VI. We ought to have better tools today. In my opinion, there is no compelling reason to continue to promote something like VIM. Put a bullet in it already.
As for the hack. Lots of fun. But, geez, how fucked-up is an text editor that you have to come-up with a foot-switch to make it more usable?
Either you're a terrible Vim user or you have a pretty awesome browser text box. I had to install a third party browser extension just to make the damn thing resizeable - woe is me if I want to do search/replace, indent anything, or do anything but the most trivial undo/redo operation. And who hasn't permanently lost stuff they've written into a form by hitting the wrong key?
Yes, I am a terrible VIM user. I have far more important things to do than to get good at using modem-age text editors. My efficiency comes from planning, not counting keystrokes.
As if the two are mutually exclusive...
To the average user, sure; the text box is more friendly.
But that's not the point with vim. At all. Vim's design goals are speed and efficiency. To date, non-modal editors haven't come anywhere near vim in that regard.
As to "user friendly" - depends on who the user is. Yes, this text box is infinitely more user friendly than vim when your mom is using it.
That a foot-pedal might make vim more usable has nothing to do with vim being outdated or unusable. Is your operating system broken / outdated because one might find a food pedal driving "alt-tab" more usable or fun?
http://www.helis.com/h/h53ecab.jpg
We're talking about a general-purpose text editing tool used by experts for hours, days, and years on end. I understand that you like to click through your menus, but you'll have to excuse those of us who know what we're doing in vim and don't have the time or patience for that.
And, yes, funny enough, it just so happens that I would find the cockpit of a military helicopter very user friendly.
Vim when you're using it with 3-5 buffers, some specialized, on screen with lots of plugins feels just like an ide or something like Sublime Text 2
Vim keybindings in Sublime Text 2 or Visual studio/outlook/word via ViEmu is pretty good in my experience.
Now vim has everything I need for coding html/css. To me vim just makes everything better from my experience, it made me more efficient, more faster at coding. Visual Studio with vim key bindings made me love the VS IDE as well haha.
https://bitbucket.org/cheater/us_split.
It's just like us qwerty, just more ergonomic.
Could a neck collar or head band be developed to perform similar tasks? Eg you move your head left or right to navigate web sites.
Definitely a neat hacky idea (so by its nature, me gusta), but VIM is a silly, silly editor for real world purposes.
Why do you think that? Vim is perfectly fine for real world purposes - I use it for real world purposes all the time, as do a lot of other people.
Not only do the basic vi commands make my life easier (My mantra is if I have to press the same key more than three times, then I'm doing it wrong - you quickly learn to navigate by words, brackets, lines, search and judge how many of these away you want to move - eg instead of wwwww to move forward five words you can do 5w, to turn "abcde_" into "_abcdeabcdeabcde" you can do 5x3p - silly examples I know, but this makes it very fast an efficient to navigate and edit text), but with vims additional features and with a small handful of plugins there is nothing that a GUI IDE can do that vim can't.