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.

I compiled a list of software and services that I use to improve my workflow, here is the link to the list.

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

6 Comments

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

    1. Hi Scott,

      There might be a way, but as of right now I am not sure how to do it. If I figure a way to do it I will post, and respond to your comment.

      Have a good day

      1. Thanks Darryl! For hybrid line numbering in init.lua, set both:

        vim.wo.number = true
        vim.wo.relativenumber = true

Leave a comment

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