How to Add Relative Line Numbers in Vscode

Posted by Chaitanya Shahare on Sun, Aug 20, 2023

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

  1. Open the command palette by pressing Ctrl+Shift+P or Cmd+Shift+P on Mac.
  2. Type settings.json and select Preferences: Open Settings (JSON).
  3. Add the following line to the file:
"editor.lineNumbers": "relative"
  1. 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.