I write prose in Vim in markdown, and many times I want to jump to the end of text-objects to edit them. Some text objects are easy to navigate: words and WORDS are easy (using e
and E
), but sentences and paragraphs are a little less efficient. I use }gE
and )gE
to jump to the ends of paragraphs and sentences (respectively).
Before I bind )gE
and }gE
to a single key, is there another (more efficient) way to get to the end of a sentence or paragraph in Vim?
Press ^ to move the cursor to the start of the current line. Press $ to move the cursor to the end of the current line.
I can't say for the end of paragraph, but you can use $
to go to the end of line. And while we're on the topic, here are two more commands for navigating sentences:
0
to go to the start of the line
^
to go to the first non-white character in the line
def sample():
& print('sample string')
To properly explain the difference between the two, let's say you're in an indented code block, and you want to go to the very first position in the line (marked as &
in the sample code), but if you wanted to go to the first non-white character, in this case, p
, then you would use ^
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With