3 回答

TA貢獻1796條經驗 獲得超4個贊
要為當前用戶永久定義此.vimrc文件,請創建(或編輯)文件:
$ vim ~/.vimrc
然后,將以下配置粘貼到文件中。vim重新啟動后,選項卡設置將適用。
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貢獻1757條經驗 獲得超7個贊
我將其復制并粘貼到我的.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個設置意味著當我按Tab時我得到4個空格。第三個設置意味著當我這樣做時V>(即視覺和縮進),我還將獲得4個空格。
它不像公認的答案那么全面,但是可以幫助那些只想復制和粘貼內容的人。
- 3 回答
- 0 關注
- 657 瀏覽
添加回答
舉報