Permanently add line numbers to vim

If you open a file with vim then it is often very helpful to know the line number which you currently editing. To display line numbers within vim you can enable them every time you start vim with:


To enable line numbers permanently you can add the following line to /etc/vimrc (if you want to enable line numbers globally) or to ~/.vimrc (if you want to enable them only for your personal user):

echo set number >> /etc/vimrc


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.