[LINUX] Display line numbers in vim editor (with default settings)

Display line numbers

With the vim editor open

:set number or
:set nu

The line numbers will be displayed while the file is open.

Hide line numbers

With the vim editor open

:set nonumber or
:set nonu

The line number that was displayed is hidden.

Display line numbers by default

When it is troublesome to type : set number one by one, Edit the configuration file in the vim editor.

$ vi ~/.vimrc 

After opening the configuration file with the vim editor, add the following line Save the file.

set number

This completes the settings. The next time you open the vim editor, the line numbers will be displayed automatically. If the ~ / .vimrc file does not exist, you can create a new one and make the above settings.

[Supplement] I was able to set it not only on Linux but also on Mac.

Recommended Posts

Display line numbers in vim editor (with default settings)
Testing with random numbers in Python
Display Disney's waiting time with LINE bot
Display Python 3 in the browser with MAMP
VIM settings
Display the script shortcut menu in the network editor
Determine the numbers in the image taken with the webcam
Get files, functions, line numbers running in python
Settings for getting started with MongoDB in python