¥
function CleverTab()
if pumvisible() != 0
return "\<C-N>"
endif
let line = getline('.')
let col = col('.')
let substr = strpart(line, -1, col + 1)
if strpart(line, 0, col - 1) =~ '^\s*$'
return "\<Tab>"
elseif match(substr, '\/') != -1
return "\<C-X>\<C-F>"
else
return "\<C-N>"
endif
endfunction
ino <expr> <silent> <Tab> CleverTab()




