Tuesday, June 28, 2011

Re: How to retrigger 'autocmd' ?

2011/6/28 Tim Chase <vim@tim.thechases.com>:
> On 06/28/2011 06:11 AM, Ben Schmidt wrote:
>>>>
>>>> think what I need to do is to retriggle those 'autocmd' that would
>>>> been usually executed if I don't do 'noau ...'.  Can anyone tell me
>>>> how to, if possible?
>>
>> :doau Filetype c
>>
>> perhaps? Or
>>
>> :doau BufRead
>>
>> which will call :setfiletype and thereby retrigger the autocommands?
>
> I recommend Ben's answer over using ":e" because it shouldn't lose various
> state (such as jump-lists, undo-history, marks, manual folds, etc which can
> be lost in an ":e") and it can be used on a modified buffer without losing
> the changes.
>
> -tim
>

Hi,
in case the buffer was already opened before there is no need to
retrigger the autocommands anyway.

Cheers,
Gregor

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: