* El 16/01/07 a las 18:22, Andy Wokula chamullaba:

> Luis A. Florit schrieb:
> > Pals,
> >
> >    How I avoid certain commands and/or substitutions NOT to be saved
> > into the history list? For example, I have a sequence of VIM commands
> > that executes on every email quote to properly format it, and I don't
> > want these to appear in the registries and history.
> >
> >    Thanks!
> >
> >        L.
>
> Think I completely misunderstood you (because of the subject), in case
> please forget my previous post.

In fact, your previous post is closer to what I want.

> Commands:
> A  :SomeCommand  will not be added to the history, if you map it to a
> normal mode key (including the <cr>), for example:
>   :map <f2> :Command1<cr>:Command2<bar>Command3<cr>
>
> Registers:
> You could write data into variables to not touch registers.
> You will need some knowledge about vim script.
>   :h eval
>
> Search history:
> The search history is always overwritten, although you can backup and
> restore the last search pattern:
>   :let sav_search = @/
>   /some search/
>   :let @/ = sav_search
>   :unlet sav_search   " no need within :function
> ...
>
> Do you use filetype plugins?
> ...
>
> Wonder if this has more to do with what you had in mind.

Sorry if I wasn't clear enough... Let me try again.

First, I have is an autocommand to execute a function for, say, every
email I open:

au FileType mail call MyMutt()

Then, my function called MyMutt() executes a bunch of commands,
among them, a perl script to clean adds, signatures, etc. These
work of course by searching for strings and making substitutions.
So, every time I edit an email, these search strings and commands
are stored... Very annoying, and keeps filling my 'good' history
with trash.

So, I want to avoid this. I don't want to store specifically these
commands/searches/substitutions of MyMutt() function into my history.
Hence, I want a "don't-store-the-following-until-I-tell-you" command.

I tried adding a 'rv!' at the end of the MyMutt() function
(tried also with 'wv!' in the beginning, and setting 'history=0'
as you suggested with same result). It works in a strange way...
It keeps cycling between 2 viminfo files, have no idea why.
I mean: I open an email for writting, and I have some search patterns
A,B,C... already stored in the history. I close vim. I open vim in a
mail again, and I have old patterns D,E,F... in history. I close the
email, and open another. Then, I have again the previous patterns
A,B,C... At least, with 'rv!' it forgets the patterns from the
MyMutt() function, as I wanted.

    Any clues?

        Thanks!

            L.

Reply via email to