LazyVim / starter

Starter template for LazyVim
Apache License 2.0
859 stars 674 forks source link

overriding certain plugins doesn't work properly #49

Open zfogg opened 7 months ago

zfogg commented 7 months ago

i can't get the flash.nvim plugin to override its config for some reason with the default starter clone

here's something to reproduce it.

my overrides actually DO work if i first set defaults.version = '*' in the lazy spec, and then update all my plugins. but then i get a lot of other issues like slowness in the UI when i restart nvim.. keeping defaults.version = false is the right move but how can i get flash.nvim overrides working without doing that?

disabling flash.nvim works nicely, but i want to use it

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  -- bootstrap lazy.nvim
  -- stylua: ignore
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

require("lazy").setup({
  spec = {
    -- add LazyVim and import its plugins
    { "LazyVim/LazyVim", import = "lazyvim.plugins" },
    -- import any extras modules here
    -- { import = "lazyvim.plugins.extras.lang.typescript" },
    -- { import = "lazyvim.plugins.extras.lang.json" },
    -- { import = "lazyvim.plugins.extras.ui.mini-animate" },
    -- import/override with your plugins
    { import = "plugins" },
    {
      "folke/flash.nvim",
      event = "VeryLazy",
      ---@type Flash.Config
      opts = {
        char = {
          -- keys = { [";"] = "H", [","] = "L" },
          keys = { "f", "F", "t", "T", [";"] = "L", [","] = "H" },
        },
      },
    },
  },
  defaults = {
    -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
    -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
    lazy = false,
    -- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
    -- have outdated releases, which may break your Neovim install.
    version = false, -- always use the latest git commit
    -- version = "*", -- try installing the latest stable version for plugins that support semver
  },
  install = { colorscheme = { "tokyonight", "habamax" } },
  checker = { enabled = true }, -- automatically check for plugin updates
  performance = {
    rtp = {
      -- disable some rtp plugins
      disabled_plugins = {
        "gzip",
        -- "matchit",
        -- "matchparen",
        -- "netrwPlugin",
        "tarPlugin",
        "tohtml",
        "tutor",
        "zipPlugin",
      },
    },
  },
})
briandipalma commented 7 months ago

I usually override the builtin plugins by adding a lua file in the plugins folder named after the plugin with my overrides like this: https://github.com/briandipalma/iac/blob/main/dotfiles/nvim/lua/plugins/mini-animate.lua

It's always worked for me so far.

zfogg commented 7 months ago

would you mind trying this one to see if you can get it to work? i can't get it to work unless i turn on '*' version in lazy.nvim lol

zfogg commented 7 months ago

my example will reproduce it and you'll see that , and ; don't get remapped properly :(