Failed to run `config` for vim-fugitive due to missing module 'vim-fugitive'
Closed this issue · 1 comments
PixsaOJ commented
Hi there,
I'm experiencing an issue with vim-fugitive. When I try to run the any command, I get the following error message:
Failed to run `config` for vim-fugitive
~~~~~~~~~~~/.config/nvim/lua/plugins/git.lua:30: module 'vim-fugitive' not found:
no field package.preload['vim-fugitive']
cache_loader: module vim-fugitive not found
cache_loader_lib: module vim-fugitive not found
no file './vim-fugitive.lua'
no file '/usr/share/luajit-2.1/vim-fugitive.lua'
no file '/usr/local/share/lua/5.1/vim-fugitive.lua'
no file '/usr/local/share/lua/5.1/vim-fugitive/init.lua'
no file '/usr/share/lua/5.1/vim-fugitive.lua'
no file '/usr/share/lua/5.1/vim-fugitive/init.lua'
no file '~~~~~~~~~~~/.local/share/nvim/lazy-rocks/telescope.nvim/share/lua/5.1/vim-fugitive.lua'
no file '~~~~~~~~~~~/.local/share/nvim/lazy-rocks/telescope.nvim/share/lua/5.1/vim-fugitive/init.lua'
no file './vim-fugitive.so'
no file '/usr/local/lib/lua/5.1/vim-fugitive.so'
no file '/usr/lib/lua/5.1/vim-fugitive.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '~~~~~~~~~~~/.local/share/nvim/lazy-rocks/telescope.nvim/lib/lua/5.1/vim-fugitive.so'
# stacktrace:
- ~/.config/nvim/lua/plugins/git.lua:30 _in_ **config**
The error message suggests that the vim-fugitive module is missing, but I've installed it via Lazy (as per the documentation) and I'm not sure what's causing this issue.
I also use gitsigns
dependency.
Config:
{
"tpope/vim-fugitive",
dependencies = {
"lewis6991/gitsigns.nvim",
},
config = function()
require("gitsigns").setup()
require("vim-fugitive").setup({
gitsigns = true
})
end,
keys = {
{
"<leader>gb",
function()
require("gitsigns").toggle_current_line_blame()
end,
desc = "Git blame line",
},
{
"<leader>gp",
function()
require("gitsigns").preview_hunk()
end,
desc = "Git preview changes",
},
{
"<leader>gh",
function()
vim.cmd("Git log")
end,
desc = "Git History",
},
{
"<leader>gf",
function()
require('telescope.builtin').git_bcommits()
end,
desc = "Git File History",
},
{
"<leader>g1",
"<cmd>diffget //2<cr>",
desc = "Git Diffget 2",
},
{
"<leader>g2",
"<cmd>diffget //3<cr>",
desc = "Git Diffget 3",
}
},
}
tpope commented
You don't need/want require("vim-fugitive")
. That's for loading a Lua module and Fugitive does not include any Lua.