"====================================================================================== " vim setting "set fileencoding=taiwan "set enc=big5 set backspace=indent,eol,start " allow backspacing over everything in insert mode set autoindent " auto indent " set cindent " for C source code auto indent set showmatch " show match parenthese when insert a bracket set matchtime=5 " when insert bracket , the time to jump to parenthese " set softtabstop=4 " soft tabs length " set tabstop=4 " set shiftwidth=4 " >> width set hlsearch " search result will represent highlight set incsearch " search result will represent immediately "set nowrapscan " when search to the end of file , stop set nocompatible " not compatible with vi , for vim extension function syntax on " enable the syntax highlight set number " print line number set ruler " print cursur position set laststatus=2 " status lines set cmdheight=2 " command lines set showcmd " show command " When editing a file, always jump to the last known cursor position. " Don't do it when the position is invalid or when inside an event handler " (happens when dropping a file on gvim). autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif "====================================================================================== " key maps map :w! " press for save map ZZ " press for save & exit map :q! " press for exit without saving map :bp " press to edit previous file in buffer map :bn " press to edit next file in buffer " press to switch syntax on/off map :if exists("syntax_on") syntax off else syntax enable endif " press to switch hlsearch on/off map :set hls!set hls? " press to switch autoindent on/off map :set autoindent!set autoindent? " press to switch number/nonumber map :set number! set number? "====================================================================================== " terminal color setting "if (&term =~ "term") || (&term =~ "rxvt") || (&term =~ "vt100") || (&term =~ "screen") " if has ("terminfo") " set t_Co=16 " set t_AF=[%?%p1%{8}%<%t3%p1%d%e%p1%{22}%+%d;1%;m " set t_AB=[%?%p1%{8}%<%t4%p1%d%e%p1%{32}%+%d;1%;m " else " set t_Co=8 " set t_Sf=[3%dm " set t_Sb=[4%dm " endif "endif "====================================================================================== " syntax color setting hi Comment term=bold ctermfg=darkcyan hi Constant term=underline ctermfg=Red hi Special term=bold ctermfg=Magenta hi Identifier term=underline ctermfg=cyan hi Statement term=bold ctermfg=Brown hi PreProc term=bold ctermfg=DarkYellow hi Type term=bold ctermfg=DarkGreen hi Ignore ctermfg=white hi Error term=reverse ctermbg=Red ctermfg=White hi Todo term=standout ctermbg=Yellow ctermfg=Red hi Search term=standout ctermbg=Yellow ctermfg=Black hi ErrorMsg term=reverse ctermbg=Red ctermfg=White hi StatusLine ctermfg=Yellow ctermbg=White hi StatusLineNC ctermfg=darkblue ctermbg=White "======================================================================================