gpt4 book ai didi

vim - 使用vi缩进或注释多个文本行

转载 作者:行者123 更新时间:2023-12-03 14:27:31 26 4
gpt4 key购买 nike

vim或vim可以用来同时注释或缩进许多行吗?例如:

for item in Lista:
ind = int(floor(1.0*(item-lmin)/width))
if ind==nintervals:
ind=ind-1
print item,ind


评论到:

#for item in Lista:
#ind = int(floor(1.0*(item-lmin)/width))
#if ind==nintervals:
#ind=ind-1
#print item,ind


或缩进为:

  for item in Lista:
ind = int(floor(1.0*(item-lmin)/width))
if ind==nintervals:
ind=ind-1
print item,ind


P.D. VI和VIM之间有区别吗?

最佳答案

这是另一种方式。


ctrl+v阻止行
//插入注释符号(I
用ESC逃生


关键输入是

ctrl+vjjjjI//→ESC

关于vim - 使用vi缩进或注释多个文本行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2462794/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com