xolag on Nostr: #Vim Tips A way to learn Vim Imagine you have a long file, and want to comment out ...
#Vim Tips
A way to learn Vim
Imagine you have a long file, and want to comment out just the line that contain a particular text, for example the word "dev"
In normal mode:
------------------
qa0i#q
:g/dev/norm! @a
------------------
qa: record macro in registrr a
0: go to the beginning of the line
i#: insert #
:g....: find the lines that contain dev and run the macro a.
A way to learn Vim
Imagine you have a long file, and want to comment out just the line that contain a particular text, for example the word "dev"
In normal mode:
------------------
qa0i#q
:g/dev/norm! @a
------------------
qa: record macro in registrr a
0: go to the beginning of the line
i#: insert #
:g....: find the lines that contain dev and run the macro a.