Vim Folding

:help folding
zfap 將游標所在處的那個段落摺疊成一行。

zf7G 自游標所在處至全文第 7 行摺疊起來。

:3,9fold 將第 3 行至第 7 行摺疊起來。

5zF 將游標所在處起算 5 行的內容摺疊起來。

zf 在manual和marker模式時,手動作個fold出來。

zF 前面加上N,可以把以下N行折起來。

:{range}fo[ld] 跟zf一樣,Ex命令而已。

zd 刪除游標上的fold。

zo 打開游標上的fold。

zO 遞迴地打開游標上底下所有的fold。

zc 把游標上的fold折起來。

zC 遞迴地折起游標上底下所有的fold。

zM 把整個檔案所有的fold都折起來。

zR 把整個檔案所有的fold都打開。

zk 把游標移到上一個fold上。
:{range}foldo[pen][!] 同zo,Ex命令。

:{range}foldc[lose][!] 同zc,Ez命令。

zj 把游標移到下一個fold上。

zk 把游標移到上一個fold上。

在marker的模式下,在前面{1 }, 詳情請:h marker

When fold by indent!

set foldmethod=indent

vim
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License