I am trying to use the omnicomplete. It is quite simple to use in insert mode, but I'm having a hard time using it from a function. Here is what I have so far:
" Cmd-. to autocomplete tags, especially HTML, see *i_CTRL-X_CTRL-O*
function Autocomplete()
normal! i</<C-x><C-o>
" If it was an empty omni-complete, delete those three characters
let char_three_left = getline('.')[col('.')-3]
if (char_three_left == '<')
normal!XXX
endif
endfunction
inoremap <leader>. <C-O>:call Autocomplete()<CR>\
However, it seems to enter in the text literally, and I am having a hard-time escaping it when in insert mode. What would be the proper way to do this?
I suppose maybe I just need to call :call htmlcomplete#CompleteTags(...)
but there seems to be little to no documentation on that.