Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim moving cursor to the beginning of the next line

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.

like image 511
Lavya Avatar asked Dec 20 '14 14:12

Lavya


People also ask

How do you move to the beginning of a line in vim?

Press 0 to go to the beginning of a line, or ^ to go to the first non-blank character in a line.

How do I move the cursor to the next 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.

Which key is used to move the cursor to the beginning of the next line?

Press Enter to move the cursor to the beginning of the next line.

What is the shortcut to get to the beginning of a line in vim?

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]


1 Answers

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.

like image 134
Ingo Karkat Avatar answered Oct 13 '22 00:10

Ingo Karkat