Move in vi normal mode without using arrow keys.
Move the cursor one line upward.
Which key should be used?
vi's basic movement keys are h left, j down, k up, and l right in normal mode.
Detailed explanation
hIncorrect. h moves one character left.
Incorrect. h moves one character left.
jIncorrect. j moves one line down.
Incorrect. j moves one line down.
kCorrect. k moves one line up.
Correct. k moves one line up.
lIncorrect. l moves one character right.
Incorrect. l moves one character right.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s\n' 'Vimで2行目にカーソルを置き、ノーマルモードでkを押す'Expected result
カーソルが同じ桁を保ちながら1行上へ移動するKey points
- h moves left
- j moves down
- k moves up
- l moves right
Notes
- Environment: vi/Vimのノーマルモード
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.