Hi Teemu :)

On Tue, Feb 24, 2009 at 19:42, Teemu Likonen <[email protected]> dixit:
> On 2009-02-24 19:06 (+0100), Raúl Núñez de Arenas Coronado wrote:
>
>> I want to automatically modify the format of the attribution line and
>> some details of the signature when replying to emails. This can be
>> done using a couple of simple "s" commands. My problem is on the
>> "automatically" part...
>>
>> For doing the "automatic edition" I've set an autocommand:
>>
>> autocmd BufRead *.eml /pattern/s/something/otherthing/
>>
>> I've put this in "~/.vim/after/ftplugin/mail.vim
>
> If you add an autocmd in ftplugin and buffer's context it would probably
> be better idea to add buffer-local autocmd:

Well, that was my first try but it didn't work either (the autocommand
was not run). I thought that the <buffer> part was not defined at the
time the autocommand was defined and that it was the reason why it was
not working.

Probably the problem was, in that case, that the event I was using
(BufRead) was the wrong one.

>> Given that I only want to do the substitution once at the beginning:
>> should I get rid of autocommands and do the job directly in
>> "~/.vim/after/ftplugin/mail.vim" (which is what I'm doing right
>> now)?
>
> ..in your case I think autocmds are not useful. Just have the ftplugin
> check that this is the right kind of file and modify the buffer.

Right now I'm doing it exactly in that way and it works, so I suppose
I'm going to do that instead of using autocmd.

Thanks!

Raúl "DervishD" Núñez de Arenas Coronado

Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to