I use the following mapping for
inoremap <expr> <Tab> getline('.')[col('.') - 2] =~ '\w' ? "<C-N>" : "<Tab>"
It works well except that if I want to insert a tab and the previous word is not matched,
i_Ctrl-N returns the
Pattern not found error and I have to insert a space manually and then I can insert a tab.
This is quite annoying.
I know I can use
pumvisible to detect if completion pop-up is visible, but how can I evaluate the return value of