go to line in vim code example

Example 1: vim move to specific line

# Basic syntax:
<number>+G # In Vi/Vim, type a number and hold down shift+g

# Example usage:
50G	# Moves you to line 50 in the document

Example 2: vim make the line go top

z<CR> or zt puts current line to top of screen (<CR> == Enter)

z. or zz puts current line to center of screen

z- or zb puts current line to bottom of screen




# Misc:
(z<CR>, z., and z- puts the cursor in the first non blank column. zt, zz, and zb leaves the cursor in the current column)

More info about scrolling at http://vimdoc.sourceforge.net/htmldoc/scroll.html or
in vim type :help scroll-cursor

from mtk, chaptuck

Tags:

Misc Example