I'm writing a function that uses Vim's Python API. The function runs while I'm in
insert mode and I want this function to set my mode to
I tried a few things, like for example, this
import vim vim.eval(r'execute normal! \<esc>')
But unfortunately this doesn't work. I just get the error
VIM:E121: Undefined variable: execute. Any help would be greatly appreciated.
Also, generally speaking, I'd really like to know more about the
vim module. It doesn't have a
__file__ attribute, assuming that's because it's compiled. Is there source code anywhere I can view? Or generally where the file lives so that I can try importing it and running
help(vim) without having to re-run my functions in a Vim environment. If you have any information on that, in particular, it'd help a lot. Thanks!