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: 29 days ago
JSON representation

Automatically toggling between relative and absolute line numbers in Neovim.

Lists

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" })
```