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

vim.wo.number = true
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 hybrid 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

1 Comment

  1. Hi Darryl, thanks for neovim tips.
    Could you explain, how to automatically toggle between hybrid numbers and standart numbers with lua config?

    Here is legacy vimrc config:

    :set number

    :augroup numbertoggle
    : autocmd!
    : autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu && mode() != “i” | set rnu | endif
    : autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif
    :augroup END

Leave a comment

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