Introduction
If you are a vim user switching to VSCode for some reason you might want the line numbers to be relative. This is a simple guide to do that.
Steps
- Open the command palette by pressing
Ctrl+Shift+P
orCmd+Shift+P
on Mac. - Type
settings.json
and selectPreferences: Open Settings (JSON)
. - Add the following line to the file:
"editor.lineNumbers": "relative"
- Save the file and you are done.
Conclusion
This is a simple guide to add relative line numbers in vscode. If you have any questions or suggestions feel free to reach out to me.