vi Notes batch reconciliation comments

Method a: Visual block mode

Batch Notes:

Ctrl+v进入VISUAL BLOCK(可视块)模式,按 j (向下选取列)或者 k (向上选取列)
按Shift + I 进入编辑模式,输入你想要插入的字符(任意字符)
按两次Esc就可以实现批量插入字符,不仅仅实现批量注释而已。

Batch solution Note:

Ctrl+v进入VISUAL BLOCK(可视块)模式,按 j (向下选取列)或者 k (向上选取列)
按 x 或者 d 批量删除字符

Method two: Replace line mode

Batch Notes

命令行模式下,输入 " : 首行号,尾行号s /^/字符/g "实现批量插入字符。
如 输入:5,10s/^/#/g,在5到10行首插入#
如 输入:5,10s/$/#/g,在5到10行尾追加#

Batch Solution Notes

命令行模式下,输入 " : 首行号,尾行号s /^字符//g "实现批量删除字符。
如 输入:5,10s/^#//g,在5到10行首删除#
如 输入:5,10s/#$/?/g,在5到10行尾将#替换成?
Published 21 original articles · won praise 5 · views 10000 +

Guess you like

Origin blog.csdn.net/icodestechnology/article/details/90055268