Difference between revisions of "Vi"

From MyWiki
Jump to: navigation, search
Line 6: Line 6:
 
[Control][u] - Move back (up) 1/2 screen<br>
 
[Control][u] - Move back (up) 1/2 screen<br>
 
Delete blank lines : :v/./d<br>
 
Delete blank lines : :v/./d<br>
 +
<source lang="text">
 +
:v/./d
 +
or
 +
:g/^$/d
 +
or
 +
:%!cat -s
 +
</source>

Revision as of 09:41, 31 October 2014

Delete all white space till end of line  :%s/ *$//g

[Control][b] - Move back one full screen
[Control][f] - Move forward one full screen
[Control][d] - Move forward 1/2 screen
[Control][u] - Move back (up) 1/2 screen
Delete blank lines : :v/./d

:v/./d
or
:g/^$/d
or
:%!cat -s