On 2022-11-01 10:50, 'Ottavio Caruso' via vim_use wrote:
> morse Sun 30/10 22:07[x]
> qrq Mon 31/10 10:19
> Groups Mon 31/10 19:42
>
> See that [x]? That's where the cursor is.
>
> I want to modify the line just below that (starting with qrq),
> remove that timestamp and put a new one.
My first thought is to map a key to do a substitution using
sub-replace-special like
nnoremap Q :s@ \<lt>\zs.*@\=strftime("%a %d/%m/%Y")<cr>
or, if you always do this from the line above, you can add a "+"
nnoremap Q :+s@ \<lt>\zs.*@\=strftime("%a %d/%m/%Y")<cr>
which, while it has more keystrokes initially to create, reduces
the "update the timestamp on the next line" to a single keypress
("Q" in this instance, but whatever you want to map it to).
(also, it looks like your strftime() format string differs from the
format in the existing data, so tweak accordingly)
-tim