0

I have set line numbers in vim using :%!cat -n as suggested here. The line numbers appeard but now when I open vim I am getting 'E481: No range allowed:' errors and now I want to get rid of the line numbers. But how?

Community
  • 1
  • 1
Cristian
  • 1,590
  • 5
  • 23
  • 38
  • 1
    Are you looking for `help rnu`? instead od trying `:%!cat -n` – dlmeetei Apr 12 '16 at 17:07
  • I am looking for a solution which can make the line number dissapear. I am a begginer with vim (1 and half years). – Cristian Apr 12 '16 at 17:12
  • You added line numbers to you .vimrc file and then saved it? So they are actually **in** the file on disk? And now you want to remove them from there again? – Etan Reisner Apr 12 '16 at 17:13
  • I have not modified the .vimrc file. I've just issued the `:%!cat -n` command directly from vim. So basicly if you open vim and issue the `:%!cat -n` command the line numbers will appear, but how to remove them? – Cristian Apr 12 '16 at 17:16

1 Answers1

3

First, you can try this to get the line numbers:

:%!cat -n %

If you've not saved, you can revert back to the last save:

:e!

If you have the line numbers, then you can get rid of them like this

:%s/^[[:blank:]]*[0-9]*\t// 
SaintHax
  • 1,875
  • 11
  • 16