from book "Learning The Vi And Vim Editors, 7th Edition"
eg:
A Q in the command of vi invokes ex. And in ex the command vi return to vi editor. ex-command.png define_lines.png
. stands for the current line;
$ stands for the last line of the file;
% stands for every line in the file.
define_lines-ex.png
line_address.png
line_address-1.png
number 0 stands for the top of the file. 0 is equivalent to 1-.
line_address-2.png
redefine the current position:
append to file
Use the Unix redirect and append operator(>>) with w
to append all or part of the contents of the buffer to an existing file.
append_to_file.png
copy_file.png
:g/old/s//new/g has the same effect as :%s/old/new/g
网友评论