Secret of Vim #1

In visual mode. If you use V (visual mode) to select multiline, then press : prompt will appear

>>>:'<,'>

So if you need to comment or insert something at first place please do

>>>:'<,'>s/^/#/

for example above , I need to comment selected multiline.

If you want some change with // , then we have to change delimeter, so

>>>:'<,'>s!^!//!

Hahaha, Cool , ha?

Comments

Popular posts from this blog

Difference between apt-get update and apt-get dis-upgrade