简体   繁体   中英

Adding column of numbers in linux vi editor

I have used following commands to add columns in vi editor

visual block (ESC+Ctrl+V) arrows use to select the column x to delete value again ctrl+v Shift+I (go to the top and insert) Type the value Esc+enter

I want to repeatedly add 1 and 2 as in the snapshot attached. Can you please assist me with this. thanks

在此处输入图像描述

  • Position the cursor at the location where you want to start typing 1.
  • Start a macro qa .
  • Type what you want to type. i1<esc> jh i2<esc> jh . So that you end up 2 lines below, so that it is something repeatable.
  • Stop the macro q
  • Execute the macro dazilion times 200@a
  • Watch

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM