vimtricks.wiki Concise Vim tricks, one at a time.

How do you add line numbers to visually selected lines?

Answer

:'<,'>!nl -ba

Explanation

Select lines visually, then run :'<,'>!nl -ba to pipe through the nl command which prepends line numbers to each selected line.

Next

How do I visually select a double-quoted string including the quotes themselves?