clevertab
public text v1 · immutablefunction! CleverTab()
" strpart(string, start, length)
"if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
if strpart( getline('.'), col('.')-2, 1 ) =~ '^\s*$'
return "\<Tab>"
else
return "\<C-P>"
endfunction
inoremap <Tab> <C-R>=CleverTab()<CR>