vi-mode: add gg/G motions and fix ^ motion behavior #953
+157
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the
gg
andG
motions and adjusts the^
motion invi-mode
. Thegg
motion moves the cursor to the first character of the buffer andG
moves it to the last. Unlike Vim, these motions do not keep the current column and their interaction with commands likec
,d
, andy
differs because reedline does not support linewise operations. Tests are included fordgg
,dG
,cgg
, andcG
.The
^
motion now moves the cursor to the first non-blank character of the line instead of the line start. Test cases ford^
andc^
are updated accordingly.Also, the name
NonBlankStart
could be better. Please tell me if you come up with something better.This is the first pr I made in rust, if I did any mistake please point it out. Thanks