Vim logo vim online Vim Book Ad

basic Tip #278: all the right moves

 tip karma   Rating 46/29, Viewed by 1301 

created:   July 9, 2002 13:25      complexity:   basic
author:   vim_power      as of Vim:   5.7

One of the principles of effective text editing is moving around very efficiently.
Following are some pointers which may help u do that.

    h      move one character left
    j       move one row down
   k       move one row up
   l         move one char. right.
   w       move to begining of next word
   b       move to begining of previous word
   e       move to end of word
   W     move to begining of next word after a whitespace
   B      move to begining of pervious word before a whitespace
   E      move to end of word before a whitespace.

(All the above movements can be preceeded by a numeric value . i.e  '4j' will move 4 rows down )

   ^        move to first non blank char of the line.
   g_      move to last non blank char of the line.
   0        moev to begining of line
   $        move to end of line.
   gg      move to first line.
   G        move to last line.
   nG      move to "n"th line.
   H        top of screen.
  M         middle of screen
   L        bottom of screen
    Ctrl-D   move half page down
    Ctrl-U   move half page up.
    Ctrl-B   page-up
    Ctrl-F   page down.

     Ctrl-o  last cursor position.
     '[a-z,0-9,A-Z]    jump to the marker. (u can set a marker on line by :-   m[a-zA-Z,0-9] and then jump back to it by '[a-z,A-Z0-9]

      n   next matching search pattern
      N  previous matching search pattern
      *    next word under cursor
     #    previous word under cursor.
     g*   next matching search pattern under cursor.
     g#  previous matching search pattern under cursor.

 rate this tip  Life Changing Helpful Unfulfilling 

<<Function signature previewer | On Windows, make GVim the default action for double-click with "unknown file types" >>

Additional Notes

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
SourceForge Logo