Omni-completion (aka "Intelisense completion”) in vim using the tab-key

Just add this fine piece of code to your ~/.vimrc:

 function! CleverTab()
           if pumvisible()
             return "\"
           endif
   if strpart( getline('.'), 0, col('.')-1 ) =~ '^s*$'
      return "\"
           elseif exists('&omnifunc') && &omnifunc != ''
              return "\"
           else
              return "\"
          endif
endfunction
inoremap  =CleverTab()

Edit:
Found a site which describes quite well how to enable the built in omnicompletion using ^X^O here.

^X^F completes filenames and directories.

Some other completion methods:

SnippetMagic:

Works for my but the arrow keys  are not correctly mapped so use better

snippetsEmu:

witch worked out of the box for me, just create  ~/.vim/after/ftplugin, open the vimball, source it with :so and use it with your tab-key.

technorati tags:, ,

~ by princ3 on October 27, 2006.

One Response to “Omni-completion (aka "Intelisense completion”) in vim using the tab-key”

  1. Redakční systém sežral všechna < a >
    V prvním případě se vrací (c-n), v druhém (tab), ve třetím (c-x)(c-o) a v posledním zase (c-n), pokud to někdo netouží mít nastavené jinak.

Leave a Reply