Loading…
Warp is now open-source Learn more
Loading…
While the most intuitive way to navigate around the terminal may be scrolling and using the arrow keys, Vim offers multiple shortcuts to move around the screen. Paging up and down with keyboard shortcuts is one of the most efficient and flexible ways to hop around. To start, make sure that you are not in Insert mode and that you are in Normal mode by pressing ESC.
A page is considered to be the screen size of your terminal. The following commands will move the page up and down based on the current screen size.
To move up and down a single row instead of a whole page:
Similar to how you navigated to specific rows, we can leverage this command to move up and down multiple rows.
As an engineer, I use the above commands when I’m reading through code and don’t care about cursor placement. The above commands can move the screen so that I can read my entire file, but they also alter my cursor location. When I’m writing code and want to understand related functions, I tend to use other commands to keep my cursor in place. As long as my cursor does not go off-screen, I can remember my current spot while reading through the file.
This post lists out just a couple of ways to navigate your terminal using Vim like viewing pages and rows. A related way to navigate is to use vim to go to the beginning and end of the file. Learning how to navigate is just the beginning: with vim, you’re able to copy and paste, undo and redo, and delete line(s) all with just a few keystrokes.
Select and delete to the end of a file in Vim
Select all and copy, paste, or delete the contents
Copy (Yank), Paste (Put) and Cut (Delete) in Vim
Copy (Yank), Paste (Put) and Cut (Delete) in Vim
Search forward, backward, case insensitive, and more
Toggle absolute and relative line numbers
Keyboard shortcuts and summary of how Vim tracks changes
Go to the end or beginning of a line in Vim
Variety of approaches to go to lines
Learn how to jump the top of the file in Vim, then navigate, search, highlight, and delete.
The best answer depends on which mode you use