Vi/vim:
Edit Mode <-:--Command mode--a, I, o A, I, o-> insert mode
Set line number: Set Nu:set Nonu
Line number move: GG G ng/:n
Mobile: H, J, K, L 0 $ H, M, L
Search:
/"Characters searched" n Next n ignored case: Set IC
Copy yy/y Nyy/ny
Cut dd ndd Paste p/p
Replace:
R R + ESC
Full-text replacement of the specified string:%s/old/new/g:%s/old/new/c
N1 to N2 line range replace specified string: n1,n2s/old/new/g: n1,n2s/old/new/c
Delete: x NX dd NDD DG d:n1,n2d
Undo U
Save exit:
: wq! Only root and file owners can have no cross-w permissions, so use
Import File: R file name
Execute command:! Command name
Import + command: R!date effect is import date
Define shortcut keys:: Map Ctrl+p i#<esc> at the beginning of the line plus #
: Map ctrl+b 0x to remove characters from the beginning of the line
: Unmap
Replace:
: AB AA bb changes aa to BB
: Unab AA
Permanent modification:
Modify the default configuration file for VI: Home directory under Users/home
VI ~/.VIMRC VI ROOT/.VIMRC
Learn the Vi/vim operation of Linux system from the zero start