Delete all lines in a file except those that start with “#”. :g/^[^#].*$/d Text search/replace. Transform line ‘wget http://gnucom.cc/some_backup.tar.gz’ into ‘/scripts/restorepkg some_backup.tar.gz’. This one is helpful for cPanel administrators. :%s/wget http:.*\//\/scripts\/restorepkg /g Add something to the end of every line of a file. :%s/$/something/g Add something to the beginning of every line of a file. [...]
My most used VIM regular expressions.