3

Is there a shortcut to take you to the midpoint or the middle of a line inside VI? Ctrl + A and Cntrl + E are super helpful, but I'd love something that's Cntrl + M or something to take me to the line middle.

For example, if I make a spelling error in the following fictional command, it might be nice to have my cursor go to the bold (or near it) in order to fix the error rather than having to press the left or right arrow so many times

I am a terminal command **z**with a spelling error
4
  • 1
    f, z maybe?
    – Mark Setchell
    Dec 12, 2020 at 17:29
  • 6
    If your question is about vim, then I think gM does what you want. I don't think it's available in either readline's or zsh' vi-mode though. Edit: looks like it's only available since version 8.1.2231 too (see the changelog).
    – Marth
    Dec 12, 2020 at 17:41
  • StackOverflow is dedicated to helping solve programming code problems. Your Q may be more appropriate for Super User , or Vi and Vim , but read their help section regarding on-topic questions . AND please read Help On-topic and Help How-to-ask before posting more Qs here. Good luck.
    – shellter
    Dec 12, 2020 at 17:51
  • 1
    This question is appropriate for Vi and Vim and @Marth you should post that as an answer.
    – filbranden
    Dec 12, 2020 at 18:06

1 Answer 1

1

In vim, you can navigate spelling errors with ]s and [s. That doesn’t address moving to the middle of the line, but it’s more efficient to go exactly where you need, no ?

Your Answer

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