Tuesday, November 1, 2022

Lowest number of keystrokes to modify part of a line

Hi,

I'm Italian hence knowingly lazy.

I have a file that I use as a log for my morse learning.

The structure is:


qrq Wed 26/10 11:18
Groups Thu 27/10 20:00
WT Thu 27/10 21:37
qrq2 Thu 27/10 10:24
morse Fri 28/10 20:17
qrq Fri 28/10 22:15
Groups Sat 29/10 19:46
WT Sat 29/10 21:21
qrq2 Sun 30/10 18:48
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.

The timestamp is mapped to 'mydate' :

$ grep mydate .vim/vimrc
iabbrev mydate <C-R>=strftime("%a %d/%m/%Y")

I want to find the lowest number of keystrokes I need to modify that
timestamp.

What I'm doing at the moment is:

[w] [w] [R] cwd [:wq]

That is: one word forward, one word forward, Replace to the end; save
and quit, but I wonder if there is a lazier and more elegant way.

M. v. g.


--
Ottavio Caruso

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/fcf39be5-f471-beed-9297-e1e653c22342%40yahoo.com.

No comments:

Post a Comment