简体   繁体   English

如何在vim中格式化这个东西?

[英]How to format this thing in vim?

I got something like this in vim: 我在vim中得到了类似的东西:

awqwq:bsak
cslqw:aslkjqwd
ska:jsqpwiq
salsqwqw:wpqwi

How to change it quickly to this: 如何快速更改它:

awqwq              :   bsak
cslqw              :   aslkjqwd
ska                :   jsqpwiq
salsqwqw           :   wpqwi

Save the following macro: 保存以下宏:

f:40i ^[l4a ^[20|dt:j0
to register a . 注册a Then place the cursor at the beginning of the text and repeat the macro with 4@a . 然后将光标放在文本的开头,并用4@a重复宏。 In this macro ^[ is the escape character which can be obtained from insert mode by typing <ctrl-v><esc> . 在这个宏中, ^[是转义字符,可以通过键入<ctrl-v><esc>从插入模式获得。

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

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