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