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

Failed to run config for vim-fugitive due to missing module 'vim-fugitive' #2332

Closed
PixsaOJ opened this issue Aug 26, 2024 · 1 comment
Closed

Comments

@PixsaOJ
Copy link

PixsaOJ commented Aug 26, 2024

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

tpope commented Aug 26, 2024

You don't need/want require("vim-fugitive"). That's for loading a Lua module and Fugitive does not include any Lua.

@tpope tpope closed this as completed Aug 26, 2024
Repository owner deleted a comment from PixsaOJ Aug 27, 2024
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

4 participants
@tpope @PixsaOJ and others