set nocp
filetype plugin on
" configure tags - add additional tags here or comment out not-used ones
" load user definition tags
" set tags+=~/.vim/tags/stl
set tags+=~/.vim/tags/c
" linux header file tag
" set tags+=~/.vim/tags/linuxkernel
" set tags+=~/.vim/tags/sdl
" set tags+=~/.vim/tags/qt4
" build tags of your own project with CTRL+F12
map :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .
noremap :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .
inoremap :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .
" OmniCppComplete
" let OmniCpp_NamespaceSearch = 1
" let OmniCpp_GlobalScopeSearch = 1
" let OmniCpp_ShowAccess = 1
" let OmniCpp_MayCompleteDot = 1
" let OmniCpp_MayCompleteArrow = 1
" let OmniCpp_MayCompleteScope = 1
" let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
" automatically open and close the popup menu / preview window
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
set completeopt=menuone,menu,longest,preview
let g:SuperTabRetainCompletionType = 2
let g:SuperTabDefaultCompletionType = ""
let g:AutoComplPop_MappingDriven = 0
let g:acp_enableAtStartup = 1
let g:acp_ignorecaseOption = 1
let g:acp_completeOption = '.,w,b,k'
" """""""""""""""""""""""""""""configuration for neocomplcache""""""""""""""""""""""""""""
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplcache.
let g:neocomplcache_enable_at_startup = 1
" Use smartcase.
let g:neocomplcache_enable_smart_case = 1
" Use camel case completion.
let g:neocomplcache_enable_camel_case_completion = 1
" Use underbar completion.
let g:neocomplcache_enable_underbar_completion = 1
" Set minimum syntax keyword length.
let g:neocomplcache_min_syntax_length = 1
" set the max list in the popup menu. increase the speed
let g:neocomplcache_max_list=20
" Define keyword.
if !exists('g:neocomplcache_keyword_patterns')
let g:neocomplcache_keyword_patterns = {}
endif
let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
let g:neocomplcache_auto_completion_start_length=1
" ignore letter case
let g:neocomplcache_enable_ignore_case=1
" """""""""""""""""""""""""""""configuration for neocomplcache""""""""""""""""""""""""""""
" """"""""""""""""""""""""""auto complete () "" """"""""""""""""""""""""""""""""""""""""
:inoremap ( ()i
:inoremap ) =ClosePair(')')
:inoremap { {}i
:inoremap } =ClosePair('}')
:inoremap [ []i
:inoremap ] =ClosePair(']')
:inoremap < <>i
:inoremap > =ClosePair('>')
function ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\"
else
return a:char
endif
endf
" """"""""""""""""""""""""""auto complete () "" """"""""""""""""""""""""""""""""""""""""
" """"""""""""""""""""""""""""line number"""""""""""""""""""""""""""""""""""""""""""""'
set nu
" """"""""""""""""""""""""""""line number"""""""""""""""""""""""""""""""""""""""""""""
" """""""""""""""""""""""""""""auto indent """"""""""""""""""""""""""""""""""""""""
set autoindent
set cindent
" """""""""""""""""""""""""""""auto indent """"""""""""""""""""""""""""""""""""""""
" """""""""""""""""""""""""""""syntax on"""""""""""""""""""""""""""""""""""""""""""""
syntax on
" """""""""""""""""""""""""""""""syntax on """"""""""""""""""""""""""""""""""""""""""""
需要注意的是,默认的情况下vim是不会加载 set tags+=~/.vim/tags/c文件的,需要使用命令:NeoComplCacheCachingTags
暂时仅仅能够完成的一个文件的代码提示,下面几篇中还将介绍如何使用vim来管理项目文件,如何使用vim来debug c程序。