Vi Tips
-
Remove all blank lines from a file
:g/^$/d
-
Reload the current file and start again from scratch
:e!%
This uses external mode. The ":e!" tells vi to edit a file without saving
the current file. The "%" specifies the current file.
-
On a Linux, Unix, or Mac OS X system, you can reformat a paragraph so that
lines fit in the terminal window withoug wrapping to the next line providing
for a neat display in a terminal wndow with the following
command:
!}fmt
This will insert line breaks in the text to fit the lines in the terminal
window.
-
Use
}
to move to the start of the next paragraph.
References:
-
Vi ---> Removing blank
lines
Unix is a Four Letter Word
-
Sample: Vi Tips and techniques
Richard Botting's Home Page
Created: August 15, 2005 16:42