How to remove line numbers in vim?
Asked Answered
S

1

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?

Seventieth answered 12/4, 2016 at 17:4 Comment(4)
Are you looking for help rnu? instead od trying :%!cat -nDessiatine
I am looking for a solution which can make the line number dissapear. I am a begginer with vim (1 and half years).Seventieth
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?Nostalgia
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?Seventieth
E
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// 
Eaglestone answered 12/4, 2016 at 17:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.