Skip to content

Commit

Permalink
feat(illuminate): use LazyVim settigns
Browse files Browse the repository at this point in the history
  • Loading branch information
asyncedd committed Jun 26, 2023
1 parent a8fe193 commit c590fab
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions lua/plugins/specs/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,39 @@ return {
},
{
"RRethy/vim-illuminate",
config = function()
require("illuminate").configure()
opts = {
delay = 200,
large_file_cutoff = 2000,
large_file_overrides = {
providers = { "lsp" },
},
},
config = function(opts)
require("illuminate").configure(opts)

local function map(key, dir, buffer)
vim.keymap.set("n", key, function()
require("illuminate")["goto_" .. dir .. "_reference"](false)
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
end

map("]]", "next")
map("[[", "prev")

-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
vim.api.nvim_create_autocmd("FileType", {
callback = function()
local buffer = vim.api.nvim_get_current_buf()
map("]]", "next", buffer)
map("[[", "prev", buffer)
end,
})
end,
event = "VeryLazy",
keys = {
{ "]]", desc = "Next Reference" },
{ "[[", desc = "Prev Reference" },
},
},
{
"goolord/alpha-nvim",
Expand Down

0 comments on commit c590fab

Please sign in to comment.