emacs string-insert-rectangle vector of numbers?

后端 未结 4 1280
萌比男神i
萌比男神i 2020-12-28 11:12

How can I use emacs string-insert-rectangle operation to add a vector of numbers to a series of lines? For example, I\'ve got this shortened version of a bunch of text entri

4条回答
  •  無奈伤痛
    2020-12-28 11:19

    Here is a log of how you can solve it with a keyboard macro. AFAIK you can't solve this with just string-insert-rectangle.

    Where a register input is required, I used a

    C-1 C-x r n
               number-to-register
    C-x (      kmacro-start-macro
    C-M-f      forward-sexp [3 times]
    C-M-b      backward-sexp
    C-u C-x r i
               insert-register
    C-x r +    increment-register
    C-x )      kmacro-end-macro
    C-SPC      set-mark-command
    M->        end-of-buffer
    C-x C-k r  apply-macro-to-region-lines
    

提交回复
热议问题