From d0d87aa5d7d3745793e89258b2bcc0a302b40f67 Mon Sep 17 00:00:00 2001 From: David Alexander Majnemer Date: Wed, 2 Sep 2009 21:22:12 -0500 Subject: [PATCH] omnicompletion backcompat for vim 6 --- vimrc | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/vimrc b/vimrc index 0cf76d6..53fb0b0 100644 --- a/vimrc +++ b/vimrc @@ -329,18 +329,20 @@ if has('eval') endif " ---- OmniCpp ---- -if has('autocmd') - autocmd InsertLeave * if pumvisible() == 0|pclose|endif +if v:version >= 700 + if has('autocmd') + autocmd InsertLeave * if pumvisible() == 0|pclose|endif + endif + + set completeopt=menu,menuone,longest + + 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 + map :!$HOME/bin/ctags -R --c++-kinds=+p --fields=+iaS --extra=+q . + " add current directory's generated tags file to available tags + set tags+=./tags endif - -set completeopt=menu,menuone,longest - -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 -map :!$HOME/bin/ctags -R --c++-kinds=+p --fields=+iaS --extra=+q . -" add current directory's generated tags file to available tags -set tags+=./tags