[Vim-latex-devel] [PATCH] imaps.vim: make IMAP undoable
Brought to you by:
srinathava,
tmaas
From: Bodo G. <ma...@bo...> - 2012-07-15 08:05:17
|
Hi, It may happen that something (possibly quite long) inserted by IMAP was not desired. Either because one mistyped or because the LHS pattern was supposed to stay as is. In the second case one could avoid this by typing the characters in a way that does not trigger IMAP. But this is quite inconvenient. So one could think, just doing <Esc>ua would do the trick. But no, this often undoes a lot of previously written text and is thus not usable. The only other solution is to manually delete all the insertions from IMAP and try again. Because of this annoying behaviour, some people even disable IMAP completely, although I feel it is a vital part of vim-latex and is really helpful especially for those longer replacement texts. So in order to circumvent the described problem, I modified the imaps.vim script and inserted an undo point "^Gu" before doing any IMAP replacements. I'm not sure whether this is the best way to do it or if the insert of a:char could make new problems with abbreviations. But please take a look at the appended patch. Also just fyi, I'm using the following, to make undoing easily possible in input mode: imap <Undo> <Esc>ua best regards, Bodo PS: is there a reason, that the following patch is not applied? https://sourceforge.net/tracker/?func=detail&aid=3057689&group_id=52322&atid=466458 |