Skip to content

Instantly share code, notes, and snippets.

@CrBoy
Created August 9, 2010 14:27
Show Gist options
  • Save CrBoy/515479 to your computer and use it in GitHub Desktop.
Save CrBoy/515479 to your computer and use it in GitHub Desktop.
" filetypes
filetype plugin on
filetype indent on
" ~/.vimrc ends here
set laststatus=2
set statusline=%4*%<\ %1*[%F]
set statusline+=%4*\ %5*[%{&fileencoding}, " encoding
set statusline+=%{&fileformat}%{\"\".((exists(\"+bomb\")\ &&\ &bomb)?\",BOM\":\"\").\"\"}]%m
set statusline+=%4*%=\ %6*%y%4*\ %3*%l%4*,\ %3*%c%4*\ \<\ %2*%P%4*\ \>
highlight User1 ctermfg=red
highlight User2 term=underline cterm=underline ctermfg=green
highlight User3 term=underline cterm=underline ctermfg=yellow
highlight User4 term=underline cterm=underline ctermfg=white
highlight User5 ctermfg=cyan
highlight User6 ctermfg=white
syntax on
set number
set autoindent
set tabstop=4
set shiftwidth=4
set incsearch
set showcmd
set cursorline
set foldmethod=syntax
set foldlevel=10
"set ignorecase
set filetype= "設定檔案型態 如:set filetype=c
set showmode "顯示當前模式
set title "自動設定標題
set t_Co=256
colorscheme desert
set fileencodings=utf-8,big5
"Taglist
nmap <leader>t :TlistToggle<cr>
let Tlist_GainFocus_On_ToggleOpen = 1
let Tlist_Close_On_Select = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_Use_Right_Window = 1
let Tlist_WinWidth = 50
let Tlist_Display_Prototype = 1
"Single file compilation
nmap <F5> :w<CR> :!g++ -Wall -o %:r %<CR> :!./%:r<CR>
"Word complete
"autocmd BufEnter * call DoWordComplete()
"OmniCppComplete
"set nocp
filetype plugin on
map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
set tags+=~/.vim/tags
set tags+=~/.vim/c++.tags
set tags+=~/.vim/stl-3.3.tags
set tags+=~/.vim/leda.tags
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
let OmniCpp_MayCompleteDot = 1 " autocomplete with .
let OmniCpp_MayCompleteArrow = 1 " autocomplete with ->
let OmniCpp_MayCompleteScope = 1 " autocomplete with ::
let OmniCpp_SelectFirstItem = 2 " select first item (but don't insert)
let OmniCpp_NamespaceSearch = 2 " search namespaces in this and included files
let OmniCpp_ShowPrototypeInAbbr = 1 " show function prototype (i.e. parameters) in popup window
let OmniCpp_DisplayMode = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment