Fold function in vim

前端 未结 5 1685
無奈伤痛
無奈伤痛 2021-01-29 18:21

Is there any way or tools to fold function in vim, like Visual Studio or Eclipse?

5条回答
  •  情话喂你
    2021-01-29 18:50

        Vim folding commands
    ---------------------------------
    zf#j creates a fold from the cursor down # lines.
    zf/ string creates a fold from the cursor to string .
    zj moves the cursor to the next fold.
    zk moves the cursor to the previous fold.
    za toggle a fold at the cursor.
    zo opens a fold at the cursor.
    zO opens all folds at the cursor.
    zc closes a fold under cursor. 
    zm increases the foldlevel by one.
    zM closes all open folds.
    zr decreases the foldlevel by one.
    zR decreases the foldlevel to zero -- all folds will be open.
    zd deletes the fold at the cursor.
    zE deletes all folds.
    [z move to start of open fold.
    ]z move to end of open fold.
    

    Source: vim docs.

提交回复
热议问题