Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lazy.vim instructions to the README #200

Open
yonas opened this issue Oct 12, 2024 · 1 comment
Open

Add lazy.vim instructions to the README #200

yonas opened this issue Oct 12, 2024 · 1 comment

Comments

@yonas
Copy link

yonas commented Oct 12, 2024

Add lazy.vim instructions to the README:

return {
    "wfxr/minimap.vim",
    build = "cargo install --locked code-minimap",
    lazy = false,
    cmd = { "Minimap", "MinimapClose", "MinimapToggle", "MinimapRefresh", "MinimapUpdateHighlight" },
    init = function()
        vim.cmd("let g:minimap_width = 10")
        vim.cmd("let g:minimap_auto_start = 1")
        vim.cmd("let g:minimap_auto_start_win_enter = 1")
    end,
}

-- @CnsMaple #179 (comment)

FreeBSD users can install minimap via ports: pkg install code-minimap and comment out build = "cargo install --locked code-minimap",

@ficcdaf
Copy link

ficcdaf commented Dec 8, 2024

I have something similar but I also used snacks to configure a toggle:

return {
  "wfxr/minimap.vim",
  build = "cargo install --locked code-minimap",
  dependencies = {
    "folke/snacks.nvim", -- for the toggling
  },
  config = function()
    vim.api.nvim_create_autocmd("BufEnter", {
      callback = function()
        if vim.g.minimap_enabled == nil then
          vim.g.minimap_enabled = 0
        end
      end,
    })
    local minimap_toggle = Snacks.toggle.new({
      name = "Minimap",
      which_key = true,
      get = function()
        return vim.g.minimap_enabled == 1
      end,
      notify = false,
      set = function(state)
        if state then
          vim.g.minimap_enabled = 1
          vim.cmd("Minimap")
        else
          vim.g.minimap_enabled = 0
          vim.cmd("MinimapClose")
        end
      end,
    })
    Snacks.toggle.map(minimap_toggle, "<leader>um", { desc = "Toggle Minimap" })
  end,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants