Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/togawalk/relative-toggle.nvim
Automatically toggling between relative and absolute line numbers in Neovim.
https://github.com/togawalk/relative-toggle.nvim
neovim-plugin nvim
Last synced: about 2 months ago
JSON representation
Automatically toggling between relative and absolute line numbers in Neovim.
- Host: GitHub
- URL: https://github.com/togawalk/relative-toggle.nvim
- Owner: togawalk
- Created: 2023-12-29T10:54:51.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-19T14:51:13.000Z (10 months ago)
- Last Synced: 2024-08-02T18:37:13.018Z (5 months ago)
- Topics: neovim-plugin, nvim
- Language: Lua
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- my-neovim-pluginlist - togawalk/relative-toggle.nvim - toggle.nvim) ![](https://img.shields.io/github/last-commit/togawalk/relative-toggle.nvim) ![](https://img.shields.io/github/commit-activity/y/togawalk/relative-toggle.nvim) (Other Standard Feature Enhancement / Number)
README
# relative-toggle.nvim
Neovim plugin to automatically toggling between relative and absolute line numbers in Neovim.
## Installation
### [lazy.nvim](https://github.com/folke/lazy.nvim)
```lua
{
"togawalk/relative-toggle.nvim",
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
}
}
```## Configuration
**relative-toggle.nvim** comes with the following defaults:
```lua
{
relativenumber = true,
pattern= "*",
events = {
on = { "BufEnter", "FocusGained", "InsertLeave", "WinEnter", "CmdlineLeave" },
off = { "BufLeave", "FocusLost", "InsertEnter", "WinLeave", "CmdlineEnter" },
},
}
```## Usage
Toggle relative numbers with `:ToggleRelativeNumber`.
or
```lua
-- -- line numbers
vim.keymap.set("n", "rn", " ToggleRelativeNumber ", { desc = "Toggle relative number" })
```