Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to put the current line under edit on the top of the screen in vim

Tags:

vim

It is very inconvenient when the line I'm editing is at the bottom of the screen . Because you can't see any following lines and that prevent you from take any "eye refernce" to the content of the file following the current line .

so my question is there a vim command can refresh the display and put the current line under edit to on the top of the screen ? thanks in advance.

like image 443
Haiyuan Zhang Avatar asked Feb 17 '10 15:02

Haiyuan Zhang


People also ask

How do I move a line up or down in vim?

Mappings to move lines In normal mode or in insert mode, press Alt-j to move the current line down, or press Alt-k to move the current line up.

How do you go to the top line in vim?

Type "gg" in command mode. This brings the cursor to the first line.

How do I move the cursor to the next line in vi editor?

Press the Return key to move the cursor to the beginning of the next line down.

What does Ctrl F do in vim?

Ctrl+f will search within the file ctrl+shift+f will search in all the files in the folder tree.


1 Answers

See this reference.

z<return> 
like image 80
Jonathan Feinberg Avatar answered Sep 23 '22 18:09

Jonathan Feinberg