I understand that to move to the beginning of the line blank space I have to use 0
, but to move to the last blank space in the line '$' or 'end' sign move to the last character. How to move to the last blank space in a line?
3 Answers
I'm not sure I've understood your question correctly. I think you might want to move to the last non-whitespace character in the line.
In this case, the built-in :h g_
does just that (it's the end-of-line counterpart of _
).
I don't think there's a built in for that, but you can do a search to jump to it/ [^ ]*$
This searches for a space, followed by zero or more non-spaces ([^ ]*
), until the end of the line.
If line ends with "space" then $
Otherwise $Bh or $FSpace
-
-
1@Audrew I think you should reword your question then, or provide an example. As it stands, I feel like this is an answer to it.– BiggybiCommented Mar 7, 2022 at 20:33