When typing LaTeX one often needs to type a \
to invoke a command such as \omega
. One of the nicer features of LaTeX is the ability to define your own commands, which can then be detected by Vim if 'define'
is properly set. This will allow completion of these commands with <c-x><c-d>
. I would like to avoid typing the \
too often as it is located rather awkwardly on my keyboard. Therefore I would like to be able to type ome<c-x><c-d>
and have vim complete that to \omega
. In other words, I want to be able to complete a word of which I never typed the first character. Is this even possible using the vim completion function or do I need something more capable?
Just to be clear, I will of course be remapping <c-x><c-d>
in this case, as this is still an awkward combination.
inoremap <c-x><c-d> <esc>bi\<esc>ea<c-x><c-d>
This is not tested but the idea is to remap<c-x><c-d>
in insert mode so that it will escape insert mode, add the missing `\` before the word, go back to the end of the word and start autocompletion. I didn't tested it so it might not work.<c-n>
does not work for me.