News for hackers. Stuff that matters.
Re:VS Code can do that? by philsnow on Sunday April 22, 2018 @12:08AM (#16894662)
I end up doing everything like that in emacs keyboard macros.

For your example, this is the kmacro I ended up with:

    ;; Keyboard Macro Editor.  Press C-c C-c to finish; press C-x k RET to cancel.
    ;; Original keys: 2*M-f M-DEL b C-x C-k TAB C-a 2*C-k 2*C-y C-p
    
    Command: last-kbd-macro
    Key: none
    
    Macro:
    
    2*M-f                   ;; forward-word
    M-DEL                   ;; backward-kill-word
    b                       ;; self-insert-command
    C-x C-k TAB             ;; kmacro-insert-counter
    C-a                     ;; move-beginning-of-line
    2*C-k                   ;; kill-line
    2*C-y                   ;; yank
    C-p                     ;; previous-line
(after you've created a macro, you can get the above by doing M-x kmacro-edit-macro.)

There are no comments on this comment yet.