Re: [dev] [RFC] Design of a vim like text editor

From: Martti Kühne <mysatyre_AT_gmail.com>
Date: Fri, 19 Sep 2014 14:59:00 +0200

> Let me give an example:
> - we want to comment a block of code
> - we edit C-like code, i.e.:
> - let's say a block of code is defined by text between the next "{"
> and its matching "}"
> - comment means add "//" at the beginning of the line
>
> To realize this on "level 2" commands, we may use these commands:
> - select text between "{" and next "}"
> - add "//" at the beginning of all lines of text selection
> (and I feel this is how most vi users work, but I might be wrong)
>
> To realize this on "level 3" commands, we may use these commands:
> - select "block of code"
> - comment current selection
>
> ==> Level 3 commands do not depend on the actual syntax ("{", "//"
> characters), but on code abstractions.
> ==> We can use *the very same commands* for LaTeX sources for instance,
> where "{" would be "\begin", "}" would be "\end" and "//" would be "%".
>

Hmm. adding /* and */ around the selection are two times two key presses.
But I do see your approach being useful in languages where this isn't available.

Then again, what we actually do with our editors would look like:
Comment out this function (/* */), go on with a copy of the above, so we can
out-of-order undo...

Or we might select an amount of lines and make another function from them.
This might be going places.

cheers!
mar77i
Received on Fri Sep 19 2014 - 14:59:00 CEST

This archive was generated by hypermail 2.3.0 : Fri Sep 19 2014 - 15:00:09 CEST