On Tue, Sep 19, 2006 at 08:36:13AM -0400, Benji Fisher wrote: > On Mon, Sep 18, 2006 at 04:47:14PM -0300, Matias Grana wrote: > [snip] > > > > -------------------- excerpt of .vimrc ----------------- > > augroup acentos > > autocmd! > > autocmd BufReadPost *.tex call Acentua() > > autocmd BufWritePre *.tex exe "normal mm" | call Desacentua() > > autocmd BufWritePost *.tex call Acentua() | exe "normal `m" > > augroup END > [snip] > > -------------------- end of excerpt -------------------- > > > [snip] > > So far, so good. Now I have two problems: > > > > 1) the substitutions in the functions Acentua and Desacentua are saved > > as changings. So undo commands mess with them. I'd like those changings > > not to be seen by undo/redo commands. Is it possible? > > I have not tried using this new vim-7 feature, but you might try > experimenting with :undojoin . > > :help :undojoin
Seems to work, except for the fact that I can't do an :undojoin after an undo. So I resort in the script to a) do a dummy change b) :undojoin c) change the things I want to change d) save the file e) undo Is it possible to do it without the dummy change? > > 2) Although I put a mark on the line I am at, and then go back to it in > > BufWritePost, sometimes the window scrolls a few lines, which is not > > very nice. Is it possible to save the first line appearing in the > > window, and, at the end of the saving process, end up seeing exactly the > > same lines I was seeing before? > > :help winsaveview() Perfect! > [snip] > HTH --Benji Fisher Thanks a lot! MatÃas