what is the command to move the cursor to the start of the current line?
The command you’re looking for is: 0 In vi/vim , pressing 0 (zero) in
normal mode moves the cursor to the start of the current line.
Quick Scoop
In vi-style editors, a single keystroke is all it takes to jump to the start of the line.
Here are the closely related commands so you don’t mix them up:
0→ Move to the absolute start of the current line (first column).
^→ Move to the first non-blank character on the current line (skips leading spaces/tabs).
$→ Move to the end of the current line.
A tiny mental story to remember it:
- Think of
0as “column zero” – the very beginning. - Think of
^as “start of real text” on that line, ignoring indentation.
Mini FAQ
- Does this work in vim and classic vi?
Yes,0,^, and$are standard cursor movement commands in both vi and vim.
- Why do some tutorials say
^?
They’re answering a slightly different question: “go to first non-space character,” which is^, not0.
HTML table: vi/vim line-start commands
html
<table>
<thead>
<tr>
<th>Command</th>
<th>Moves cursor to</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>Absolute start of current line (column 0)</td>
</tr>
<tr>
<td>^</td>
<td>First non-blank character on current line</td>
</tr>
<tr>
<td>$</td>
<td>End of current line</td>
</tr>
</tbody>
</table>
TL;DR:
To move the cursor to the start of the current line in vi/vim, press 0
(zero).
Information gathered from public forums or data available on the internet and portrayed here.