2011年11月3日 星期四

vimrc的好用設定

set number  "顯示行數"
set autoindent  "自動縮排"
set shiftwidth=4  "使用'>'或'<'調整縮排時,一次調4格"
set tabstop=4  "讓每個tab空4格,而非預設的8格"

autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab
"假如檔案為.py檔,則讓tab=空白。因為python視tab和space為不同的東西,這個設定可以避免不必要的困擾"

syntax on  "依檔案副檔名顯示色碼"
filetype on
filetype plugin on  "開啟plug in"

nnoremap <c-n> :NERDTree <cr>  "以ctrl+n開啟NERDTree這個plugin"

nmap <silent> <c-l> :tabnext<cr>  "以ctrl+l 切到下一個vim tab"
nmap <silent> <c-k> :tabprev<cr>  "以ctrl+k 切到上一個vim tab"

以上中文解說皆是註解,可以直接複製貼上到.vimrc中

沒有留言:

張貼留言