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

overriding certain plugins doesn't work properly #49

Open
zfogg opened this issue Jan 28, 2024 · 3 comments
Open

overriding certain plugins doesn't work properly #49

zfogg opened this issue Jan 28, 2024 · 3 comments

Comments

@zfogg
Copy link

zfogg commented Jan 28, 2024

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
Copy link

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
Copy link
Author

zfogg commented Jan 28, 2024

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
Copy link
Author

zfogg commented Jan 28, 2024

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

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

No branches or pull requests

2 participants