Question

i'm looking for a way to trigger SuperTab when writing a . (dot) in insert mode. I came up with something like this:

inoremap <buffer> . .<C-x><C-o>

But this just triggers Omnicompletion and not SuperTab. I want it to trigger SuperTab so I have my SuperTab configuration (preselect first entry, autoclose preview window). Also I still want my normal SuperTab binding (which is Tab).

This could probably be solved by simulating a keypress (while in insert mode), but I just cant get it working.

inoremap <buffer> . .<Tab>

Just inserts a literal tab. Any hints?

Thanks!

Was it helpful?

Solution

inoremap means exactly:

:ino[remap] {lhs} {rhs}

Map the key sequence {lhs} to {rhs} for the modes where the map command applies. Disallow mapping of {rhs}, to avoid nested and recursive mappings.

Have you tried:

:imap . .<tab>

?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top