Skip navigation.
KDE Developer's Journals

Note to self - vim :g

frederik gladhorn's picture

While eagerly awaiting KDevelop4 to become stable (it crashes on me too often right now)...
I'm back to forgetting vim commands Eye-wink

To get a list of files on the left (still need to get comfy with it, but it looks useful) use the Project plugin

Substitute (replace stuff - I've used this so often that I remember, but maybe you don't yet?)
:%s/what/with/g
(with % on the entire file, without only current line)
(g all occurrences in the line, without only the first hit)

Do something on lines that mach a search pattern (this is what I always forget because I don't use it that often):
:g/search pattern/command

Delete empty lines using the above:
:g/^$/d