Vim moving cursor to the beginning of the next line

29.2k Views Asked by At

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.

2

There are 2 best solutions below

4
On BEST ANSWER

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.

5
On

You can move to the beginning of a line by pressing + That just moves to the first non-blank character at the beginning of the line, which is fine if there is no indentation. If you want to go to the first character in the line regardless of white space, you can do j0

If you need any more help with movement keys, this is a good resource: http://vim.wikia.com/wiki/Moving_around