0

Say the cursor is []:

A very intelligent turtle
Found programming [U]NIX a hurdle

I want to end up here:

A very intelligent turtl[e]
Found programming UNIX a hurdle

If I were here:

A very intelligent turtle
[F]ound programming UNIX a hurdle

I could use ge.

What I can think of is kg_ or k$. Is there another sequence to consider?

6
  • 3
    I like k$, but why do you need to be there? For example, if starting a new line, O. Or if appending, kA is better. Etc.
    – D. Ben Knoble
    Jan 4, 2022 at 19:10
  • 3
    It could also be 0<bs> or 0<left> depending on :h 'whichwrap' setting. But, I'm agree, in most cases one really wants kA or O.
    – Matt
    Jan 4, 2022 at 19:54
  • 1
    @D.BenKnoble Yea it's a good point. I'd have to wait until the next time it comes up. It was likely kA or kS that I needed.
    – mcp
    Jan 4, 2022 at 20:10
  • @D.BenKnoble Ah! I came across it again! It's when I want to do a replace on the last character in the previous line. So I'm looking for something better than kA<BS>.
    – mcp
    Jan 4, 2022 at 23:49
  • 1
    So, k$s or k$r?
    – D. Ben Knoble
    Jan 5, 2022 at 0:24

1 Answer 1

2

Summarizing the comments: k$ is probably the best for Normal mode. Depending on what you want to do, there are other options: kA, kS, O, k$s, k$r, etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.