vi/vim :move -2 :move +2 - moves line search text and replace :%s/search/replace/gc

vi :move -2 :move +2 - moves line in vi

search text and replace
:%s/search/replace/gc

Here "pattern" represents the old string and "replace" represents the new string. For example, to replace each occurrence of the word "lemon" in a line with "orange," type:
:s/lemon/orange/
The syntax for replacing every occurrence of a string in the entire text is similar. The only difference is the addition of a "%" in front of the "s":
:%s/pattern/replace/

Comments

Popular posts from this blog

HAproxy logging

teamcity Automatic Agent Start under Linux

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