https://github.com/markosnarinian/ln.nvim
Smart line numbers for Neovim
https://github.com/markosnarinian/ln.nvim
autocmd line-numbers lua neovim neovim-plugin nvim nvim-plugin relative-line-numbers window-focus
Last synced: 18 days ago
JSON representation
Smart line numbers for Neovim
- Host: GitHub
- URL: https://github.com/markosnarinian/ln.nvim
- Owner: markosnarinian
- License: mit
- Created: 2026-05-26T12:57:36.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-05-26T14:16:49.000Z (about 1 month ago)
- Last Synced: 2026-05-26T14:18:46.399Z (about 1 month ago)
- Topics: autocmd, line-numbers, lua, neovim, neovim-plugin, nvim, nvim-plugin, relative-line-numbers, window-focus
- Language: Lua
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim - ln.nvim - Relative numbers on the active window, absolute everywhere else. (UI / OS-specific)
- my-neovim-pluginlist - markosnarinian/ln.nvim - commit/markosnarinian/ln.nvim)  (Other Standard Feature Enhancement / Number)
README
# ln.nvim
Automatically switches between relative and absolute line numbers based on context. The active window shows relative line numbers for easy motion; inactive windows show absolute line numbers for reference.
## Installation
### With lazy.nvim
```lua
-- default configuration
{
"markosnarinian/ln.nvim",
opts = {
absolute_events = { "WinLeave", "InsertEnter", "TermEnter", "CmdlineEnter" },
relative_events = { "WinEnter", "InsertLeave", "TermLeave", "CmdlineLeave" },
exclude = {
"TelescopePrompt",
"lazy",
"mason",
"checkhealth",
"help",
"Trouble",
"fzf",
"toggleterm",
"startify",
"undotree",
"dashboard",
"snacks_dashboard",
"aerial",
},
},
}
```
You can add or remove any standard Neovim autocmd events from either list to customise when each mode activates.
You can also add or remove buffer types and file types from the exclude list as you like.
# Contributing
All contributions are welcome! I promise that I will take the time to review your PR.