Vi commands: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Display Command == === Display line Number === Press : set number set nonumber") |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==Manipulation== | |||
===Search and Replace=== | |||
====First One on the line==== | |||
<pre>:s/OLD/NEW</pre> | |||
====All occurences of the line==== | |||
<pre>:s/OLD/NEW/g</pre> | |||
====Replace All (Globally)==== | |||
<pre>:s/OLD/NEW/g</pre> | |||
== Display Command == | == Display Command == | ||
=== Display line Number === | === Display line Number === | ||
Press : | <p>Press :</p> | ||
set number | <pre> set number or set nonumber </pre> | ||
set nonumber |
Latest revision as of 20:09, 11 December 2016
Manipulation
Search and Replace
First One on the line
:s/OLD/NEW
All occurences of the line
:s/OLD/NEW/g
Replace All (Globally)
:s/OLD/NEW/g
Display Command
Display line Number
Press :
set number or set nonumber