RRethy / vim-illuminate

illuminate.vim - (Neo)Vim plugin for automatically highlighting other uses of the word under the cursor using either LSP, Tree-sitter, or regex matching.
2.23k stars 53 forks source link

Option to disable default keymaps #217

Open TheSast opened 2 weeks ago

TheSast commented 2 weeks ago

Describe the bug <a-i> gets conditionally mapped by the plugin, without an option to prevent it.

To Reproduce Steps to reproduce the behavior (include minimal init.vim or .vimrc):

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system { "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }
    vim.fn.system { "git", "--git-dir=" .. lazypath, "--work-tree=" .. lazypath, "checkout", "077102c" }
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
require("lazy").setup {
    "RRethy/vim-illuminate",
    version = "5eeb795",
    config = function(_, opts) require("illuminate").configure(opts) end,
    init = function() vim.cmd.highlight "IlluminatedWordText ctermbg=14 guibg=Cyan gui=underline" end
}

Output from :IlluminateDebug

buf_should_illuminate 1 true
config {
  case_insensitive_regex = false,
  delay = 100,
  filetype_overrides = {},
  filetypes_allowlist = {},
  filetypes_denylist = { "dirbuf", "dirvish", "fugitive" },
  min_count_to_highlight = 1,
  modes_allowlist = {},
  modes_denylist = {},
  providers = { "lsp", "treesitter", "regex" },
  providers_regex_syntax_allowlist = {},
  providers_regex_syntax_denylist = {},
  under_cursor = true
}
started true
provider table: 0x7f77e5e17618 regex
`termguicolors` false

Expected behavior Bool option to enable the default mappings, which when set to nil (default) would use the current plugin behavior of only setting them if the keys are not already mapped.

Screenshots N/A

Additional context This is similar to #202