Vim-cheatsheet: Difference between revisions

From wikipost
Jump to navigation Jump to search
No edit summary
No edit summary
Line 16: Line 16:


:marks show list of marks
:marks show list of marks
</pre>



===Find and Replace===

<pre>
:%s/word1/word2/ once
:%s/word1/word2/g entire document
:%s/word1/word2/gc entire document, with confirmation
</pre>
</pre>

Revision as of 01:59, 5 May 2024

Cursor movement

gg      home
G       end


Markers

ma      set current position for mark A
'a      jump to position of mark A
['      previous mark
]'      next mark

:marks  show list of marks


Find and Replace

:%s/word1/word2/     once
:%s/word1/word2/g    entire document
:%s/word1/word2/gc    entire document, with confirmation