AutoYADM commit: 2024-12-08 15:35:04
This commit is contained in:
parent
32b15dcb28
commit
93fb771477
1 changed files with 10 additions and 6 deletions
|
@ -1,26 +1,30 @@
|
||||||
return {
|
return {
|
||||||
"wfxr/minimap.vim",
|
"wfxr/minimap.vim",
|
||||||
build = "cargo install --locked code-minimap",
|
build = "cargo install --locked code-minimap",
|
||||||
|
dependencies = {
|
||||||
|
"folke/snacks.nvim", -- for the toggling
|
||||||
|
},
|
||||||
config = function()
|
config = function()
|
||||||
vim.api.nvim_create_autocmd("BufEnter", {
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.b.minimap_enabled = 0
|
if vim.g.minimap_enabled == nil then
|
||||||
|
vim.g.minimap_enabled = 0
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
local minimap_toggle = Snacks.toggle.new({
|
local minimap_toggle = Snacks.toggle.new({
|
||||||
name = "Minimap",
|
name = "Minimap",
|
||||||
-- map = vim.keymap.set,
|
|
||||||
which_key = true,
|
which_key = true,
|
||||||
get = function()
|
get = function()
|
||||||
return vim.b.minimap_enabled == 1
|
return vim.g.minimap_enabled == 1
|
||||||
end,
|
end,
|
||||||
notify = true,
|
notify = false,
|
||||||
set = function(state)
|
set = function(state)
|
||||||
if state then
|
if state then
|
||||||
vim.b.minimap_enabled = 1
|
vim.g.minimap_enabled = 1
|
||||||
vim.cmd("Minimap")
|
vim.cmd("Minimap")
|
||||||
else
|
else
|
||||||
vim.b.minimap_enabled = 0
|
vim.g.minimap_enabled = 0
|
||||||
vim.cmd("MinimapClose")
|
vim.cmd("MinimapClose")
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue