To enable relative line number, add the following line to your init.lua
.
vim.wo.relativenumber = true
Code 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’m using Lunarvim but it’s Neovim under the hood, and couldn’t figure out how to access this particular attribute. Thanks!
Good content.
Is there a way to enable hybrid line numbering in init.lua?
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
Thanks Darryl! For hybrid line numbering in init.lua, set both:
vim.wo.number = true
vim.wo.relativenumber = true
That’s interesting, thank you for sharing that.