3

There are commands to distinguish between the beginning of a line (0) and the beginning of the first word of the line (^), basically ignoring leading whitespace. But I can only find one way to move to the end of a line ($), including whitespace, much like 0, but no way to move to the end of the last word.

Is there an end-of-line equivalent to ^, which ignores trailing whitespace?

4

g_ will to go to the last non-blank character of the line

For more help see :h g_

| improve this answer | |
3
  • $ or <End> - goes to end of line
  • g_ - goes to last non blank of line
  • g$ or g<End> (both take a count) - goes to end of last screen n-1'th line
  • <Ctrl><End> (takes a count) - goes to end of absolute n'th line
| improve this answer | |
2

Yes, see :h g_

g_          To the last non-blank character of the line and
            [count - 1] lines downward |inclusive|.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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