Jason (jcreed) wrote,

So there's this article about text editors, which describes that vi as being "composable" because "d" means "delete" and "y" means "yank" and there's various motion commands like "$" (end of line) "w" (word) etc. and so you get
"$" move to end of line
"d$" delete to end of line
"y$" yank to end of line
"w" move to end of word
"dw" delete to end of word
"yw" yank to end of word

Happily I see that in a comment thread it was mentioned several times what I thought was the obvious statement about emacs, that emacs is not so different, because you have a notion of mark, so if you want to delete from here to the result of some motion command, it's
C-space <motion command> C-w

Now you can certainly argue about total-number-of-keystrokes — I agree emacs loses for this particular example — but we can agree that it's O(1). The reason that it's got keystrokes on both sides of the motion command rather than only one side is that it merely needs a delimiter; and this lets you perform operations on complex motions, not only motions that are possible with a single command. Maybe vi has some way to say "d <begin complex motion> ... <end complex motion>"? Dunno.

What's actually really interesting to me linguistically is that if you think of it like natural language word order, it feels like vi is verb-before-direct-object, or "VO" (like english and chinese, for example) and emacs is "OV" (like japanese, latin, turkish). Both of which occur in natural languages with about equal frequency, and yet one can feel very unnatural to speakers of a language that does the other.

I seem to recall some old human-interface-guideline documents in the early days of Macs specifically recommending OV --- that you should let the user select things in the application first, and have menu commands operate on whatever's selected. I wonder (assuming I've remembered this right) what research they did to support this recommendation. Because really, even though that happens to align with my current preference for emacs, in my guts I feel pretty agnostic about either way being fundamentally better.
Tags: editors, language
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded