Vim undo (delete) characters written by imap!

in vim, is there a way to remove a block of text written by (no) remap or iab? for example let's say I have

inoremap xx \ hat {x}

in my .vimrc file, I want to be able to delete \ hat {x} with one keystroke (but not ^ w or dB .. I could have two consecutive iabs consisting of just text, so I need to be able to cut abababcdcdcd in the middle if cdcdcd is iab, say "cc")

any ideas?

+5
source share
2 answers

Finally, a clean solution

inoremap xx ^Gu\hat{x}^Gu

(It's C-gover there)

. , ( ^Gu, , -x , )

, , , , :

:he undo|/break/;+3p

:

, , CTRL-G u. , , . , . | I_CTRL-G_u |

+2

, <Esc>a .

:

inoremap xx <Esc>a\hat{x}

, . , .

, , . , "" .

+1

All Articles