Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm still not sold on modal editing. Please sell it to me.


Stuff I can think of off the top of my head:

It's easier on the fingers. You can move around using jkl, perform clipboard operations,deletions and other text operations generally without having your fingers leave the main keyboard area to reach for the modifier keys or arrows.

It works especially well if you remap Caps to Escape.

It's logical: dd deletes a line. 10dd deletes 10 lines.

f+ moves the cursor to forward to the next '+' character on the line. 2f+ does it twice - moves the cursor to the second '+' on the line.

df+ delete from the current position to the first + character.

Commands are chainable: d2f+ deletes from the current position to the second '+' on the line.

In general when you have modal UIs (not specific to text editing) it makes it easier to accomplish work as you're working in a 'mode' that is specific to your task. When in insert-mode, your keyboard is used to insert text. In editing-mode[1] your keyboard's functionality is now used for the sole purpose of making edits and manipulating existing text. In visual-mode, the keys provide functionality to easily highlight and manipulate highlighted text.

That said - modal editing does have its drawbacks. There's a higher learning curve. And the lock-in thing I mentioned isn't necessarily a good thing. Non-modal editors can reasonably emulate each other's keybindings allowing you to easily shift between, say, Sublime and Textmate and Visual Studio. But good luck doing any of that with Vim thrown in. Also, Vim users have to still learn a reasonable amount of emacs keybindings in order to efficiently use the command line and native text fields on Linux/MacOSX.

Also as someone joked recently - Vim has 2 modes:

1) Beep at me 2) Destroy all my text

[1] not actually called that but that's how I like to think of it


> It works especially well if you remap Caps to Escape.

And Emacs users remap Caps to Ctrl. Nobody really likes Caps, it seems.


No surprise there, it's just a legacy from typewriters after all.

These days, unless you're doing data-entry or a lot of SQL, caps-lock is just wasting (a lot of) prime keyboard real estate -- on the home row, no less!


Sql is case insensitive isn't it?


yeah, but for various (historical) reasons people like to DO IT ALL IN UPPERCASE TO DISTINGUISH LANGUAGE SYNTAX FROM "actual data".

As usual, computer science is an embarrassment for the computer.


Just look at the trade-offs:

- With non-modal editing, you get precise control of what's happening for every character that you type. In some ways, that kind of granularity is powerful. But what's the cost of that fine-grained control? The cost is having to be explicit about anything "special" you do in an editor with the letter keys. (Namely, you indicate that you're doing something special with the control key.) Imagine having to type capitalized SQL statements in a true non-modal way (i.e., without CAPS LOCK).

- With modal editing, you type in terms of ideas. You insert text when that's appropriate. When it's not appropriate, your entire keyboard (and every combination of keys) is free to do what an editor is actually supposed to do: edit.


You don't get sold on knowing on an intellectual level what it is. You get sold on it by using it.


I'm just in the middle of the learning curve and was wondering if I was missing something.


Consider that you spend more time reading, navigating and manipulating code than you do actually writing it. For that reason, it makes sense to assign navigation and manipulation semantics to the keys on your keyboard. But, then you have to have two different modes of operation for the keys.


http://www.viemu.com/a-why-vi-vim.html

And remap Caps Lock as Escape.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: