0
我正在使用mvim,我想折叠类实验。我怎么做?如何折叠在类中声明的类在Ruby代码中
class Lab
def method1
end
class Experiment
def method2
end
end # end of class Experiment
end # end of class Lab
我正在使用mvim,我想折叠类实验。我怎么做?如何折叠在类中声明的类在Ruby代码中
class Lab
def method1
end
class Experiment
def method2
end
end # end of class Experiment
end # end of class Lab
如果您想折叠特定数量的行,请使用zf
,然后使用动作命令。例如,如果要折叠class Experiment
中的所有行,请将光标放在def method2
的行上,并输入zf2j
。 zf
是折叠命令,2
是要折叠到当前折线以下的行数,而j
表示向下的光标移动。其结果将是这样的:
class Lab
def method1
end
class Experiment
+--------------- 3 lines: def method2 -------------------------
end # end of class Lab
您还可以使用视线模式来选择你想折叠,然后键入za
折叠/非折叠什么。