From: janis_papanagnou+ng@hotmail.com   
      
   On 04.06.2024 18:17, Axel Reichert wrote:   
   > Geoff Clare writes:   
   >   
   >> Here's the "block delete" macro which deletes a rectangular block   
   >> from marked position `a as top left to `b as bottom right   
   >   
   > Cool!   
   >   
   > But I understand that this was not available out of the box in vi? I am   
   > very sure that vim can do all this (very handy!) rectangular magic, as   
   > can Emacs. I cannot say since when for the latter.   
      
   Yes, Vim supports visual modes where you can with Ctrl-V start spanning   
   a rectangular area, then typing the operator (for delete, copy, etc.).   
      
   (I think Geoff was just trying to show the possibilities of 'ex' and Vi   
   in general and how the modes cooperate.)   
      
   It's nonetheless an interesting sample how he uses the markers `a etc.   
      
   >   
   > Many advanced features start out as a keyboard macro, which then can be   
   > cast into the extension language of choice. For Emacs, there is even a   
   > package which translates a keyboard macro into the equivalent Lisp   
   > code. After all (as in vi), the keystrokes are just bound to some   
   > low-level function call.   
      
   I have a different feeling how to accurately describe how Vi operates.   
   Consider a command like "A 5 d 2 f* (I inserted spurious spaces just   
   for an easier detection of the parts). As "low-level function" we can   
   consider just the operator 'd' (delete). This is more like a language   
   [buffer] [count] {operator} [movement] with 'movement' being another   
   language entity like, say, [count] {move}. It's not that any keystroke   
   will trigger a low-level function (move or edit) as you see in other   
   editor designs. The example I showed activates buffer A for appending   
   the text that gets to be deleted, from the current cursor position up   
   to the target of the movement, which here is the second '*' found on   
   the rest of the line. This orthogonality with building-blocks is an   
   essential constituent of the power of Vi editing.   
      
   Janis   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|