Shougo / neosnippet.vim

neo-snippet plugin
Other
1.12k stars 108 forks source link

Avoid triggering `InsertLeave` #503

Closed savchenko closed 3 years ago

savchenko commented 3 years ago

I have the following mapping to avoid "jumping" cursor when exiting Insert mode:

autocmd InsertLeave * :normal! `^

Works great, however this leads to incorrect manual expansion in Neosnippet.

Example snippet:

snippet vv
abbr    Jinja: variable
options indent
        {{ ${1: variable } }}

if vv is the last word in line, everything works fine. However if there is anything after it, the expansion will result in v{{ variable }}

Would it be possible to use C-c inside of the plugin to avoid triggering InsertLeave? Are there any other workarounds you might think of?

P.S. Neosnippet is pretty damn handy. Kudos!

Shougo commented 3 years ago

Sorry. I cannot fix the problem. <ESC>: is used to implement the snippet plugin. So InsertLeave is triggered.

Shougo commented 3 years ago

I have replaced <Esc> to <C-c>. It seems work.

savchenko commented 3 years ago

I have replaced <Esc> to <C-c>. It seems work.

It does work! Thank you.