https://github.com/walkingshamrock/rnum.nvim
https://github.com/walkingshamrock/rnum.nvim
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/walkingshamrock/rnum.nvim
- Owner: walkingshamrock
- License: mit
- Created: 2025-04-12T05:46:55.000Z (8 days ago)
- Default Branch: main
- Last Pushed: 2025-04-12T14:06:03.000Z (8 days ago)
- Last Synced: 2025-04-12T15:21:46.124Z (8 days ago)
- Language: Lua
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- my-neovim-pluginlist - walkingshamrock/rnum.nvim - commit/walkingshamrock/rnum.nvim)  (Other Standard Feature Enhancement / Number)
README
# rnum.nvim
Smart, right-aligned line numbers for Neovim — relative in normal mode, absolute in insert mode.
`rnum.nvim` enhances your line number column using Neovim's `statuscolumn` feature. It dynamically switches between relative and absolute numbers depending on the current mode, with clean right alignment and consistent visual layout.
Thank you for considering supporting this project! Your generosity helps keep development active and ensures the plugin continues to improve.
[](https://www.buymeacoffee.com/walkingshamrock)
---
## Features
- **Dynamic Line Numbers**: Relative numbers in normal mode, absolute numbers in insert mode.
- **Right-Aligned Formatting**: Ensures a clean and consistent visual layout.
- **Fixed-Width Number Column**: Prevents layout shifts when switching modes.
- **Highlight for Current Line**: Improves focus and readability.
- **Customizable Width**: Configure the number column width to suit your preferences.---
## Why I Built This Plugin
I created `rnum.nvim` because I wanted a better way to align the current line number when `relativenumber` is enabled in Neovim. By default, the current line's number aligns to the left, while the relative numbers for other lines align to the right. This inconsistency bothered me, so I built this plugin to ensure clean, right-aligned formatting for all line numbers, regardless of the current mode.
---
## Installation
### Using lazy.nvim
Add the following to your `lazy.nvim` configuration:
```lua
{
"walkingshamrock/rnum.nvim",
config = function()
require("rnum").setup({
number_width = 4, -- optional: set custom column width
})
end,
}
```---
## Configuration
`rnum.nvim` provides a simple setup function to customize its behavior. Below are the available options:
- `number_width` (default: `4`): Sets the width of the number column.
Example configuration:
```lua
require("rnum").setup({
number_width = 6, -- Adjust the column width to 6
})
```---
## Requirements
- Neovim 0.9 or later
---
## License
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
---
## Contributing
Contributions are welcome! If you have ideas, bug reports, or improvements, feel free to open an issue or submit a pull request. Let's make `rnum.nvim` even better together!