The use of large data -vi text editor

Use the vi text editor

1.1 Basic Usage

vi fbb.txt

1, the first will enter the "normal mode", this mode will only accept a variety of shortcut keys, you can not edit the contents of the file

2, press i, will enter edit mode from the general mode, in this mode, typing the file contents are

3. After editing, press Esc to exit edit mode and return to normal mode;

4. Press: to enter the "bottom-line command mode", enter wq command, press Enter

1.2 Keyboard Shortcuts

Some useful shortcuts (in normal mode):

a start an inserted after the cursor

A line is inserted at the end of the

I inserted in the front of the line

Gg jump directly to the first line of the file

G jump directly to the last line of the file

dd delete rows, if the row 5DD 5, the cursor is deleted disposable

yy Copy current line, multi-line copy, then 3yy, then copy the three lines in the vicinity of the current row

p Paste

v character selection mode is entered, the selection is done according to y copying, pasting press p

ctrl + v proceeds to block selection mode, the selection is done according to y copying, pasting press p

shift + v row selection mode is entered, the selection is done according to y copying, pasting press p

 

Find and Replace (bottom row enter command mode)

% S / fbb / lyf effect: Find files in all fbb, replaced lyf

/ Lyf Effect: Find lyf appear in the file, and is positioned to place the first found, according to n may be positioned to the next matching position (positioned on a press N)

Guess you like

Origin www.cnblogs.com/qq18361642/p/11856556.html