Skip to content

elentok/togglr.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Togglr

Togglr is a Neovim plugin that toggles boolean values (by pressing <Leader>tw in normal mode):

  • true ↔ false
  • on ↔ off
  • enabled ↔ disabled
  • left ↔ right
  • top ↔ bottom
  • margin-left ↔ margin-right
  • etc...

Installation

Using Lazy:

{
  "elentok/togglr.nvim",
  opts = {}
}

You can also customize the settings:

{
  "elentok/togglr.nvim",
  opts = {
    -- Specify key map (set to false or nil to disable)
    key = "<Leader>tw",

    -- Specify which register to use (to avoid overriding the default register)
    register = "t",

    -- Enable debugging mode
    debug = true,

    -- Add custom sets to values to toggle between
    values = {
      ["value"] = "opposite-value",
    },
  },
}

Using Packer:

use {
  'elentok/togglr.nvim',
  config = function()
    require('togglr').setup({
      -- options
    })
  end
}

If after the initial setup you want to add more values:

require('togglr').add('value', 'opposite-value')

To trigger the toggling manually:

require('togglr').toggle_word()

About

Vim plugin that toggles values in the text

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages