Skip to content

togawalk/relative-toggle.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

relative-toggle.nvim

Neovim plugin to automatically toggling between relative and absolute line numbers in Neovim.

Installation

{
  "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:

{
    relativenumber = true,
    pattern= "*",
    events = {
        on = { "BufEnter", "FocusGained", "InsertLeave", "WinEnter", "CmdlineLeave" },
        off = { "BufLeave", "FocusLost", "InsertEnter", "WinLeave", "CmdlineEnter" },
    },
}

Usage

Toggle relative numbers with :ToggleRelativeNumber.

or

-- -- line numbers
vim.keymap.set("n", "<leader>rn", "<cmd> ToggleRelativeNumber <CR>", { desc = "Toggle relative number" })

About

Automatically toggling between relative and absolute line numbers in Neovim.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages