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

> 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()

(This is also a new feature in vim 7.)  For something that works with
older versions of vim, you can see how this is done in the Mark()
function defined in foo.vim, my file of example vim functions:

http://www.vim.org/script.php?script_id=72

HTH                                     --Benji Fisher

Reply via email to