Skip to content

Windows: Fails to install plugin #1061

@shawnhatori

Description

@shawnhatori

Describe the bug

This is the error I get after adding nvim-orgmode to my Neovim config:

Failed to run `config` for orgmode

...ppData/Local/nvim-data/lazy/orgmode/lua/orgmode/init.lua:133: [orgmode] Failed to compile parser

# stacktrace:
  - orgmode/lua/orgmode/init.lua:133 _in_ **setup**
  - ~\AppData\Local\nvim\init.lua:149 _in_ **config**

In my Lazy configuration, I have:

"nvim-orgmode/orgmode",
event = "VeryLazy",
ft = { "org" },
config = function()
	require("orgmode").setup({
		-- org_agenda_files = "~/orgfiles/**/*",
		-- org_default_notes_file = "~/orgfiles/refile.org",
	})
end,

I have also tried adding require("orgmode.utils.treesitter.install").compilers = { "cl" } before orgmode setup. Both cl and clang are available within my PATH.

I am running on Windows 11 using the Git Bash shell with shellslash enabled.

NOTE: With the same configuration, I have treesitter installed with many language grammars.

checkhealth

==============================================================================
orgmode:                                                            3 ⚠️  1 ❌

Orgmode ~
- ❌ ERROR Treesitter grammar is not installed. Run `:Org install_treesitter_grammar` to install it.
- ⚠️ WARNING Setup not called
- ⚠️ WARNING No agenda files configured. Set `org_agenda_files` in your config.
- ⚠️ WARNING No default notes file configured. Set `org_default_notes_file` in your config.
- ✅ OK `shellslash` is set

Steps to reproduce

Attempt to install nvim-orgmode, fails on install.

Expected behavior

Installation successful.

Emacs functionality

No response

Minimal init.lua

-- Options
local windows = vim.fn.has("win32") == 1 or vim.fn.has("win64") == 1
---- Clipboard
vim.opt.clipboard = "unnamedplus"
---- File Handling
vim.opt.autowrite = true
vim.opt.backup = true
vim.opt.backupdir:remove(".")
vim.opt.errorformat = "%f(%l\\,%c): %t%*[^:]: %m"
vim.opt.fileformats = { "unix", "dos" }
vim.opt.switchbuf = "useopen"
vim.opt.undofile = true
vim.api.nvim_create_autocmd("FileType", {
	pattern = { "c", "cpp", "glsl", "hlsl" },
	command = "setlocal commentstring=//\\ %s",
})
vim.api.nvim_create_autocmd("FileType", {
	pattern = "*",
	command = "set formatoptions-=o",
})
vim.filetype.add({
	extension = {
		h = "c",
		hlsl = "hlsl",
		masm = "asm",
	},
})
---- Indentation
vim.opt.expandtab = true
vim.opt.shiftwidth = 4
vim.opt.softtabstop = 4
vim.opt.tabstop = 4
---- Leader Key
vim.g.mapleader = " "
vim.g.maplocalleader = " "
---- Search
vim.opt.hlsearch = false
vim.opt.ignorecase = true
vim.opt.smartcase = true
---- Shell
if windows then
	vim.opt.shell = '"C:/Program Files/Git/usr/bin/bash.exe"'
	vim.opt.shellcmdflag = "-c"
	vim.opt.shellxquote = ""
	vim.opt.shellslash = true
end
---- Visual
vim.api.nvim_create_autocmd("TextYankPost", {
	callback = function()
		vim.highlight.on_yank()
	end,
})

-- Plugins
require("lazy").setup({
	spec = {
		{
			"nvim-orgmode/orgmode",
			event = "VeryLazy",
			ft = { "org" },
			config = function()
				require("orgmode").setup({
					-- org_agenda_files = "~/orgfiles/**/*",
					-- org_default_notes_file = "~/orgfiles/refile.org",
				})
			end,
		},
		{
			"nvim-treesitter/nvim-treesitter",
			build = ":TSUpdate",
			config = function()
				require("nvim-treesitter.configs").setup({
					ensure_installed = {
						"bash",
						"c",
						"cpp",
						"css",
						"glsl",
						"go",
						"hlsl",
						"html",
						"javascript",
						"json",
						"lua",
						"markdown",
						"yaml",
					},
					highlight = {
						enable = true,
						additional_vim_regex_highlighting = false,
					},
					indent = { enable = true },
				})
			end,
		},
	},
})

Screenshots and recordings

No response

nvim-orgmode version

latest

OS / Distro

Windows 11

Neovim version/commit

0.11.5

Additional context

I have the same init.lua on a Linux machine and the plugin installs just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions