[TIL] "set number" makes ":g/re/p" to print the line numbers too
I've always had set number in my vimrc, and everytime I use the :global command and print the output with :g/re/p (of course, p is optional because it's the default) the line numbers also appear.
All this time I though that showing the numbers was part of the :g/re/p default output, but today I wanted :g/re/p NOT to show line numbers and I found that the actual default is to not print them (and then pass the # flag to :print to add the line numbers to the output).
It seems that set number changes the way :print works. So, I had to do :setlocal nonumber first and then run :g/re/p.
Posted Dec 6, 2018, 1:20 AM UTC
145