3 回答

TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超4個(gè)贊
要為當(dāng)前用戶永久定義此.vimrc文件,請(qǐng)創(chuàng)建(或編輯)文件:
$ vim ~/.vimrc
然后,將以下配置粘貼到文件中。vim重新啟動(dòng)后,選項(xiàng)卡設(shè)置將適用。
set tabstop=4 " The width of a TAB is set to 4.
" Still it is a \t. It is just that
" Vim will interpret it to be having
" a width of 4.
set shiftwidth=4 " Indents will have a width of 4
set softtabstop=4 " Sets the number of columns for a TAB
set expandtab " Expand TABs to spaces

TA貢獻(xiàn)1757條經(jīng)驗(yàn) 獲得超7個(gè)贊
我將其復(fù)制并粘貼到我的.vimrc文件中:
" size of a hard tabstop
set tabstop=4
" always uses spaces instead of tab characters
set expandtab
" size of an "indent"
set shiftwidth=4
前2個(gè)設(shè)置意味著當(dāng)我按Tab時(shí)我得到4個(gè)空格。第三個(gè)設(shè)置意味著當(dāng)我這樣做時(shí)V>(即視覺和縮進(jìn)),我還將獲得4個(gè)空格。
它不像公認(rèn)的答案那么全面,但是可以幫助那些只想復(fù)制和粘貼內(nèi)容的人。
- 3 回答
- 0 關(guān)注
- 655 瀏覽
添加回答
舉報(bào)