vim底行指令多行注释#和解注释

2023-03-07 14:22:40 浏览数 (2)

​1.vim底行命令模式

(1).64至74行首插入"#":
代码语言:javascript复制
底行指令:64, 74 s/^/#/g

 64 #[Running] python -u "Pydeco_1.py"
 65 #enter deco3 (foo)
 66 #enter deco2 (wrap_3)
 67 #enter deco1 (wrap_2)
 68 #enter wrapers_1 (2, 3)
 69 #enter wrapers_2 (2, 3)
 70 #enter wrapers_3 (2, 3)
 71 #exit wrapper_3 result   3:11
 72 #exit wrapper_2 result   1:12
 73 #exit wrapper_1 result * 2:24
 74 #24
(2).64至74行首删除"#":

··· 底行指令:64,74 s/^#//g

64 [Running] python -u “Pydeco_1.py” 65 enter deco3 (foo) 66 enter deco2 (wrap_3) 67 enter deco1 (wrap_2) 68 enter wrapers_1 (2, 3) 69 enter wrapers_2 (2, 3) 70 enter wrapers_3 (2, 3) 71 exit wrapper_3 result 3:11 72 exit wrapper_2 result 1:12 73 exit wrapper_1 result * 2:24 74 24 ​···

2.其实质是正则匹配替换

0 人点赞