To enable relative line number, add the following line to your init.lua.

vim.wo.relativenumber = trueCode language: Lua (lua)

Save this file by doing a :w or Shift + z repeat z.

The next time you open Neovim, you should see the relative line number enabled.

Darryl Dias

I’m Darryl. I’m a 3D Artist, Programmer and Linux enthusiast. On this site I share my insights, tips and tricks, tutorials, methods and best practices.

Join the Conversation

1 Comment

  1. I’m using Lunarvim but it’s Neovim under the hood, and couldn’t figure out how to access this particular attribute. Thanks!

Leave a comment

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