Skip to content

shrynx/line-numbers.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

line-numbers.nvim

A Neovim plugin to display both relative and absolute line numbers side-by-side using the statuscolumn feature (requires Neovim 0.9+).

✨ Features

  • Show relative, absolute, both, or no line numbers
  • Configurable format (abs_rel or rel_abs)
  • Custom separator between numbers
  • Highlight groups for styling relative and absolute numbers
  • Current line highlighting for styling the numbers on the cursor line
  • Lightweight and Lua-only

screenshot

⚡️ Requirements

  • Neovim >= 0.9.0
  • lazy.nvim plugin manager
    • OR a plugin manager that uses Neovim's native package system

📦 Installation

With lazy.nvim:

{
  "shrynx/line-numbers.nvim",
  opts = {},
}
use({
  "shrynx/line-numbers.nvim",
  config = function()
    require("line-numbers").setup({})
  end
})

⚙️ Options

All the options are optional and below are the defaults.

{
  mode = "both",      -- "relative", "absolute", "both", "none"
  format = "abs_rel", -- or "rel_abs"
  separator = " ",
  rel_highlight = { link = "LineNr" },
  abs_highlight = { link = "LineNr" },
  current_rel_highlight = { link = "CursorLineNr" },
  current_abs_highlight = { link = "CursorLineNr" },
}

🔀 Commands

  • :LineNumberToggle
  • :LineNumberRelative
  • :LineNumberAbsolute
  • :LineNumberBoth
  • :LineNumberNone

📚 Help

After installation, run:

:helptags ~/.local/share/nvim/lazy/line-numbers.nvim/doc
:help line-numbers

About

A Neovim plugin to display both relative and absolute line numbers side-by-side

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages