重排段落並保留游標位置
gwap
範例
一般模式 0 / 2等待指定範圍 1 / 2一般模式 2 / 2one two three four five six seven eight nine ten游標位於第 1 行,第 1 欄one two three four five six seven eight nine ten游標位於第 1 行,第 1 欄one two three four five
six seven eight nine ten游標位於第 1 行,第 1 欄重新安排段落的換行,完成後返回原來的游標位置。
接著按 ap,指定要重新編排的範圍。
重新安排段落的換行,完成後返回原來的游標位置
操作前後
one two three four five six seven eight nine ten游標位於第 1 行,第 1 欄one two three four five
six seven eight nine ten游標位於第 1 行,第 1 欄從一般模式開始。游標在第 1 行第 1 欄,行和欄都從 1 起算。設定 textwidth=24 與 formatoptions=tcq。gw 使用內部格式化並如文件所述還原游標位置。按 gwap。
詳細說明與 Vim 文件
範例已在 Vim 重播驗證
重新安排段落的換行,完成後返回原來的游標位置。
本例設定 textwidth=24 和 formatoptions=tcq。gw 會用 Vim 內建的格式規則處理 ap 選取的段落。