vi

Vi
show column number
:set number
:set nonumber
:%s/old/new/gc  - replace all occurences in file with confirmation
/w search forward for w

:s/(/[/  # replace only the current line from ( to [

filename  -  insert content of filename below cursor
-----------
Vi + file – open at last line
Vi +N file – open at N line
0, $ - first, last position of the file
w,b forward, backward word
HML – top, middle, last line of the screen
Ctrl+U, Ctrl+D - scroll down, up one half of screen
/pattern – search forward for pattern
?pattern – search backward for pattern
N,n – repeat last search in same, opposite direction
:11 – move to line 11 in file
Insert:
Insert text after and before the cursor a, i
o,O – open new line for text below, above cursor
cc – change current line
dd – delete line
dw – delete word
p,P – put deleted text after, before cursor
u – undo last edit
J – join 2 lines
:30,60w newfile - write from lines 30 to 60 to the newfile
:30l60w >> newfile – add from lines 30 to 60 to the newfile
Vi –r file1 – recover file1
VIM commands
-b – start in binary mode
---------
Repeat last command - n
Indirect - N

Comments

Popular posts from this blog

HAproxy logging

tomcat catalina coyote jasper cluster

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all