Im trying to use omni completions and if it returns nothing i want to use normal keyword completion?
i thougt %omnifunc != '' should do it...
but what am i missing?
Here is my function.
function! CleverTab()
if pumvisible()
return "\<C-N>"
endif
if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
return "\<Tab>"
elseif &omnifunc != ''
return "\<C-X>\<C-O>"
else
return "\<C-N>"
endif
endfunction
inoremap <Tab> <C-R>=CleverTab()<CR>