參考這篇
```
filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
```
:set ts=4 sts=4 et
:retab
https://stackoverflow.com/questions/16888658/change-2-space-indent-to-4-space-in-vim:%s/<Ctrl-V><Ctrl-M>//g<Ctrl-V>表示組合鍵Ctrl+V , <Ctrl-M>表示組合鍵Ctrl+M
"=== basic ===" filetype plugin on "plugin enable filetype indent on "auto indent "=== encoding ===" set encoding=utf-8 "enc set fileencodings=utf-8,gbk,big5,cp950,gb18030,gb2312 "fenc set termencoding=utf-8 "tenc "=== editing ===" syntax on set nocompatible set backspace=indent,eol,start set shiftwidth=2 set tabstop=2 set softtabstop=2 set expandtab set ic "ignorecase set ru "position set nu "line number set hls "hlsearch set confirm set wrapscan set history=1000 set laststatus=2 set statusline=%4*%<\%m%<[%f\%r%h%w]\ [%{&ff},%{&fileencoding},%Y]%=\[Position=%l,%v,%p%%] "=== buffer ===" set clipboard+=unnamed "=== color scheme ===" set t_Co=256 colorscheme blackbeauty "for java colorscheme leo "for c/c++ "=== vim ===" autocmd FileType java runtime! autoload/javacomplete.vim autocmd Filetype java setlocal omnifunc=javacomplete#Complete autocmd Filetype java set completefunc=javacomplete#CompleteParamsInf inoremapinoremap "=== tab ===" nmap tc :tabnew nmap te :tabedit nmap tm :tabmove nmap tk :tabclose "=== folding ===" set foldenable set foldlevel=10000
$ mkdir ~/.vim/colors2.看到喜歡的,下載{COLOR_SCHEME}.vim到colors目錄下
$ mv /path/to/{COLOR_SCHEME}.vim ~/.vim/colors3.修改Vim顏色設定,我目前是用blackbeauty和leo
$ vim ~/.vimrc
set t_Co=256 "support 256 colors colorscheme blackbeauty "blackbeauty is the name of color scheme colorscheme leo "leo is the name of color scheme4.在Vim中使用
:colorscheme COLOR_SCHEME
<Ctrl-C> To commentHow to install?
<Ctrl-X> To un-comment
For VIM 6 and higher, stick this file in your ~/.vim/plugin directory or in some other 'plugin' directory that is in your runtime path