This is a user contributed FAQ.
Q. Can you tell me few useful vim text editor keyboard short cuts for moving around while editing text files?
A.
Moving around with vim.
Open any file, for example
$ vim /etc/httpd/conf/httpd.conf
1. Go to the first line
gg or 1 shift g or :0 (zero) Enter
2. Go to the last line.
Shift g or :$ Enter
3. Go to line 8
8 shift g
4. To scroll down one screen
Ctrl f
5. To scroll up one screen
Ctrl b
6. First position on line
0(zero)
7. Last position on line
$
8. Go to matching parenthesis
%
9. Right, left, up, down respectively.
l, h, k, j
Or You can also use arrow keys
10. Where Am I?
Ctrl g
Note: previous command works in command mode
11. You can see a nice summery of more vim commands here.
This article / faq is contributed by Yoander Valdés Rodríguez (yoander). nixCraft welcomes readers' tips / howtos.
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop












{ 2 comments… read them below or add one }
for point 3 you can use :8 as well (like :0 for the 1st line)
for point 9 (l, h, k, j) are alternatives for the arrows, it’s easies to use arrow keys…
one more thing… you can hit 7 and then down/up/left/right to move 7 lines/chars in that direction
try this
:set number