-
When I migrated from packer to
When I use packer, the plugin is successfully loaded with custom filetype, but after migrating to Here's the reproduction stepI create the following directory:
repro.lua-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
-- add any other plugins here
{
"alker0/chezmoi.vim",
priority = 99999,
lazy = false,
init = function()
vim.g["chezmoi#source_dir_path"] = vim.env.HOME .. "/test/chezmoi"
end,
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight") While this minimal config without lazy is work: repro-no-lazy.lualocal root = vim.fn.fnamemodify("./.repro-no-lazy", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- colorscheme
local colorpath = root .. "/pack/plugins/start/tokyonight.nvim"
if not vim.loop.fs_stat(colorpath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/tokyonight.nvim.git", colorpath })
end
vim.opt.runtimepath:prepend(colorpath)
vim.cmd.colorscheme("tokyonight")
-- load filetype plugin
local path = root .. "/pack/plugins/start/chezmoi.vim"
if not vim.loop.fs_stat(path) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/alker0/chezmoi.vim.git", path })
end
vim.opt.runtimepath:append(path)
vim.g["chezmoi#source_dir_path"] = vim.env.HOME .. "/test/chezmoi" .chezmoiexternal.yaml.local/share/ansi-arts:
type: git-repo
url: https://github.com/latipun7/ansi-arts.git
refreshPeriod: 744h
.local/bin: # vimv
type: archive
url: {{ template "vimv-download-url" . }}
refreshPeriod: 168h
{{ if ne .chezmoi.os "windows" -}}
.local/bin/fnm:
type: file
url: {{ template "fnm-download-url" . }}
executable: true
refreshPeriod: 168h
filter:
command: gzip
args: ["--decompress", "--to-stdout", "--suffix", ".zip"]
nolazy.log
lazy.log
I'm sorry, @folke , is it possible to load plugin before filetype? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
nope, that's not possible. That chezmoi plugin does some really weird things in their code. There's better ways to achieve what they're trying to do. I'm sure it may have worked before with Packer, but I'm not going to add any special handling for this in lazy. |
Beta Was this translation helpful? Give feedback.
nope, that's not possible. That chezmoi plugin does some really weird things in their code. There's better ways to achieve what they're trying to do.
I'm sure it may have worked before with Packer, but I'm not going to add any special handling for this in lazy.