in reply to (OT) tab completion for code?
function! TabOrCompletion() let col = col('.') - 1 if col==0 || getline('.')[col - 1] !~ '\k' return "\<TAB>" else return "\<C-N>" endif endfunction inoremap <tab> <c-r>=TabOrCompletion()<cr> [download]