2013年4月28日 星期日

~/.vimrc

" vundle config
set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

Plugin 'scrooloose/nerdtree'
Plugin 'Lokaltog/vim-powerline'
"Plugin 'vim-airline/vim-airline'
"Plugin 'vim-airline/vim-airline-themes'
Plugin 'Yggdroot/indentLine'
Plugin 'kien/ctrlp.vim'
"Plugin 'Valloric/YouCompleteMe'

call vundle#end()            " required
filetype plugin indent on    " required

set hlsearch

" syntastic setting
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

" shown powerline in sigle buffer
set laststatus=2
set t_Co=256
let g:Powerline_colorscheme='solarized256'
"let g:Powerline_symbols = 'fancy'
"let g:airline_powerline_fonts = 1

" airline setting
"set laststatus=2
"set t_Co=256
"let g:airline_theme="bubblegum"
"let g:airline#extensions#tabline#enabled = 1

" tab
map <C-t>l <ESC>:tabnext<CR>
map <C-t>h <ESC>:tabprev<CR>
map <C-t>n <ESC>:tabnew<CR>:NERDTree<CR>
map <C-t>c <ESC>:tabclose<CR>
map <C-t>0 <ESC>:tabfirst<CR>
map <C-t>$ <ESC>:tablast<CR>
map <C-t>q <ESC>:qall<CR>

set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4

set autoindent
" C語言的縮排方法
"set cindent

set ruler
set showmode
set bg=dark
set nu

" terminal的title會設成filename
"set title

" 可以用 {{{ }}} 縮排 Folded
set foldmethod=marker
" 預設關閉
set foldlevel=0

" 編碼設定
set fileencoding=utf-8
set fileencodings=utf8,big5
set termencoding=utf-8
set enc=utf-8
set tenc=utf8

nmap <silent> <F5> <ESC>:NERDTree<CR>

" indent line 縮排對齊線plugin,預設關閉。
nmap <silent> <F6> <ESC>:IndentLinesToggle<CR>
let g:indentLine_enabled = 0

" 自動補齊括號
"inoremap ( ()<ESC>i
"inoremap [ []<ESC>i
"inoremap { {}<ESC>i

nnoremap <silent> <F8> :set paste<CR>
nnoremap <silent> <F9> :set nopaste<CR>

" vim color theme
colorscheme default
syntax on

" hightlight current line
set cursorline
hi CursorLine cterm=NONE ctermbg=234 ctermfg=NONE

" highlight TODO FIXME XXX with bold
hi Todo cterm=bold ctermbg=11

" highlight current line number
hi LineNr cterm=NONE ctermbg=234 ctermfg=245
"hi CursorLineNR cterm=NONE ctermbg=234 ctermfg=245

" 改變背景顏色顏色
"highlight Comment ctermbg=DarkGray
" 改變字體顏色
"highlight Comment ctermfg=DarkGray

沒有留言:

張貼留言