Linux environment programming - editor basic operations

  
 

vim uses

New File

#vim hello.c

Insert Mode

Press I, the bottom appears - - Insert - -

Newline: Press Enter

Delete characters: Press x

in normal mode to delete the entire line: press dd

to restore: press u

Cancel command: Ctrl+R Make up for U consequences

Copy: y y2w Copy 2 words y Copy with trailing spaces yy Copy lines

Paste:p

Exit save: Press ESC, enter: wq

Exit without saving: Press ESC, enter: q! Note that there is an exclamation point ending

Find::/Find content

Specify line::5 Press Enter Line 5

Indent: Enter in the current line: Enter: set cindent shiftwidth=4 and press Enter, so the next line is indented by input or edit mode. Press the space bar to

Tab key space number::set tabstop=2

display line number::number

store its configuration file in vimrc

Note that the file edited under windows to linux conversion command: dos2unix file name

Copyright © Windows knowledge All Rights Reserved