In Vim, is there a key moving cursor to the beginning of the next line?
j
moves the cursor to the corresponding position of the current position in the next line. I'm looking for a single key that could move the cursor to position 0 irrespective of the cursor position in the current line.
Press 0 to go to the beginning of a line, or ^ to go to the first non-blank character in a line.
Thankfully, there is a keyboard shortcut that moves to the next line. Move the text cursor to where you want the new line to begin, press the Enter key, hold down the Shift key, and then press Enter again.
Press Enter to move the cursor to the beginning of the next line.
I will remap some shortcut keys in my vimrc, most of them are cursor moving under the Insert mode. That means: Ctrl + a : Go to beginning of the line [Normal Mode && Insert Mode] Ctrl + e : Go to end of line [Normal Mode && Insert Mode]
The +
motion moves to the first non-blank character in the next ([count]
) line. That fulfills your requirement if there's no indent. With indent, you can use +0
or j0
.
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