简体   繁体   English

在 linux vi 编辑器中添加数字列

[英]Adding column of numbers in linux vi editor

I have used following commands to add columns in vi editor我使用以下命令在 vi 编辑器中添加列

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视觉块 (ESC+Ctrl+V) 箭头用于选择列 x 再次删除值 ctrl+v Shift+I(转到顶部并插入) 键入值 Esc+enter

I want to repeatedly add 1 and 2 as in the snapshot attached.我想在附加的快照中重复添加 1 和 2。 Can you please assist me with this.你能帮我解决这个问题吗? thanks谢谢

在此处输入图像描述

  • Position the cursor at the location where you want to start typing 1.将光标放在要开始输入 1 的位置。
  • Start a macro qa .启动宏qa
  • Type what you want to type.键入您要键入的内容。 i1<esc> jh i2<esc> jh . i1<esc> jh i2<esc> jh So that you end up 2 lines below, so that it is something repeatable.这样您就可以在下面结束 2 行,以便它是可重复的。
  • Stop the macro q停止宏q
  • Execute the macro dazilion times 200@a执行宏 dazilion 次200@a
  • Watch手表

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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