May 17, 2008

Setting number to vi editor

Setting number to vi editor

There is something that I consider important. Whenever I edit something I want to make it easy to debug. So, I edit the vimrc to set numbers to each line.

Note: this file is sitting under root's directory and it applies to root's profile..

# vi /root/.vimrc

In the third or fourth line add set number

  • Press ESC
  • Type the colon “:”
  • Type wq

---------------------------------------------------------------
From now on when you edit something as root, it will be numbered.
---------------------------------------------------------------
Note. When you edit something and you made changes but don't want to save it, you can ignore it by quitting without saving.

When you use

  • Press ESC
  • Type the colon “:”
  • Type q

In case it gives you an error.

  • Type q! instead

No comments:

Post a Comment

Popular Posts