How to remove line numbers in vim?

坚强是说给别人听的谎言 提交于 2020-01-07 01:50:06

问题


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?


回答1:


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// 


来源:https://stackoverflow.com/questions/36579720/how-to-remove-line-numbers-in-vim

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!