Anyone know if it's possible in vi to replace only uncommented/non-blank lines with comments?
If I want to replace a commented line with something I know I can use :%s/^#/##foo##/g -- but I am looking for the opposite of this.
Example file:
# Some user's cron
# Test comments
00 00 * * * ~/somescript.sh
Expected result:
# Some user's cron
# Test comments
##DISABLE##00 00 * * * ~/somescript.sh