To open a file in read-only.
$)view practice.c
or
$)vi -R practice.c
To open a file at line number [10]
$) vi +10 practice.c
To open a file at a particular sequence
$)vi +/main practice.c
Document my experience using Oracle pro*c/c++,pl/sql and vi editor. Blog examples,tips and general information.
Showing posts with label vi. Show all posts
Showing posts with label vi. Show all posts
Wednesday, April 7, 2010
Wednesday, March 3, 2010
VI commands to move in the file
List of vi movement commands
Scroll forward one screen. ^F
Scroll backward one screen. ^B
Scroll forward half screen. ^D
Scroll backward half screen. ^U
Redraw the screen. ^L
Move to top line of screen. H
Move to middle line of screen. M
Move to bottom line of screen. L
Move to column n of current line. n|
Go to given line n. nG
Go to end of file. G
Return to previous mark or context. ``
Show current line. ^G
Scroll forward one screen. ^F
Scroll backward one screen. ^B
Scroll forward half screen. ^D
Scroll backward half screen. ^U
Redraw the screen. ^L
Move to top line of screen. H
Move to middle line of screen. M
Move to bottom line of screen. L
Move to column n of current line. n|
Go to given line n. nG
Go to end of file. G
Return to previous mark or context. ``
Show current line. ^G
Subscribe to:
Posts (Atom)