Last active
March 3, 2020 12:36
-
-
Save ugovaretto/045e7d09c9a08216ae0ff6ae65aadf28 to your computer and use it in GitHub Desktop.
Add line numbers to code in vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Select lines visually: Shift + v | |
2) type following command: '<,'>s/^/\=line(".")-line("'<")+1.". "/ | |
\= evaluate expression | |
line(".") line number of each selected line | |
line("'<") line number of the first line in the selection | |
. concatenation operator | |
". " concatenated string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment