Vim 的 tab 設定
- Productivity
- 10 May, 2020
expandtab:在 insert mode 時,輸入 tab 時,改為輸入 spacesofttabstop:在 insert mode 時,按下 tab 鍵會跑出幾個 spacetabstop:tab 的寬度為幾個 spaceshiftwidth:縮排的寬度為幾個 space
實驗 softtabstop 跟 tabstop
先關閉 expandtab (:set noexpandtab )以及改變顯示tab 跟 space的方式(:set list listchars=tab:▸-,trail:· )就可以實驗 softtabstop 跟tabstop 的組合。
noexpandtab+ tabstop=8+ softtabstop=4
- 按一次 tab
.... - 按兩次 tab
▸------- - 按三次 tab
▸-------.... - 按 backspace
▸-------