vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: macro question


From: david sowerby
Subject: Re: macro question
Date: Fri, 26 Apr 2024 19:01:09 +0000 (UTC)

Thanks for the suggestions. I did finally get a macro written that does what I want, but mapped it to F12. I can run the macro if I think I need to back-up the file or not. I checked and $cfilname is not affected, probably because I used $cbufname instead?

==========================================
Inertia is the most powerful force in the Universe.


On Friday, April 5, 2024 at 02:46:27 PM PDT, Thomas Dickey <dickey@his.com> wrote:


On Thu, Apr 04, 2024 at 08:01:01PM +0000, david sowerby wrote:

> Hi, in Vim/Neovim I can save a copy of the file when I exit. The copy is renamed file-$(date +%s).bak. This gives me a file with an increasing number plus .bak. It looks like "date+%s" and  "&stime" do the same thing. Is this possible in vile? I know I can save a file as file.bak but I like to save a series of changed files, not just one.
> So a macro that saves a copy and I then call that macro with write-hook.  Thanks.


write-hook is called before a file is written (so I don't think it would work
just like the suggested order).

But you could have a macro which decides what the filename should be,
and writes to that.  The macro should save and restore $cfilname,
otherwise $cfilname will get updated to point to the most recently
written file.

--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net


reply via email to

[Prev in Thread] Current Thread [Next in Thread]