orgmode icon indicating copy to clipboard operation
orgmode copied to clipboard

Installation fails with the basic lazy.nvim install script

Open ChausseBenjamin opened this issue 10 months ago • 9 comments

Describe the bug

I get an error when launching nvim with the lazy.nvim snippet from the readme.md. Here is what I get:

Failed to run `config` for orgmode                                                                                                                   .../current/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid structure at position 2992 for language lua
# stacktrace:
  - ~/scoop/apps/neovim/current/share/nvim/runtime/lua/vim/treesitter/query.lua:259 _in_ **get**
  - ~/scoop/apps/neovim/current/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:110 _in_ **new**
  - ~/scoop/apps/neovim/current/share/nvim/runtime/lua/vim/treesitter.lua:61 _in_ **_create_parser**
  - ~/scoop/apps/neovim/current/share/nvim/runtime/lua/vim/treesitter.lua:131 _in_ **get_parser**
  - ~/scoop/apps/neovim/current/share/nvim/runtime/lua/vim/treesitter.lua:459 _in_ **start**
  - plugins.lua:54 _in_ **config**

Steps to reproduce

Install orgmode with lazy.nvim.

Expected behavior

Flawless installation

Emacs functionality

No response

Minimal init.lua

-- Bootstrap installation of lazy.nvim on a new system:
local lazypath = vim.fn.stdpath("data") .. "/lazy/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",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

-- Installed plugins:
require("lazy").setup({

  -- Org Mode {{{
  {
    'nvim-orgmode/orgmode',
    dependencies = {
      { 'nvim-treesitter/nvim-treesitter', lazy = true },
    },
    event = 'VeryLazy',
    config = function()
      -- Load treesitter grammar for org
      require('orgmode').setup_ts_grammar()
      -- Setup treesitter
      require('nvim-treesitter.configs').setup({
        highlight = {
          enable = true,
          additional_vim_regex_highlighting = { 'org' },
        },
        ensure_installed = { 'org' },
      })
      -- Setup orgmode
      require('orgmode').setup({
        org_agenda_files = '~/orgfiles/**/*',
        org_default_notes_file = '~/orgfiles/refile.org',
      })
    end,
  }, -- }}}

})

Screenshots and recordings

No response

OS / Distro

Windows 11

Neovim version/commit

0.9.1

Additional context

No response

ChausseBenjamin avatar Sep 20 '23 06:09 ChausseBenjamin

Do you have any issues with other package managers?

Can you post the full configuration with lazy? Maybe I need to add more context to the installation part. It assumes that you do something like this:

require('lazy').setup({
{
  'nvim-orgmode/orgmode',
  dependencies = {
    { 'nvim-treesitter/nvim-treesitter', lazy = true },
  },
  event = 'VeryLazy',
  config = function()
    -- Load treesitter grammar for org
    require('orgmode').setup_ts_grammar()

    -- Setup treesitter
    require('nvim-treesitter.configs').setup({
      highlight = {
        enable = true,
        additional_vim_regex_highlighting = { 'org' },
      },
      ensure_installed = { 'org' },
    })

    -- Setup orgmode
    require('orgmode').setup({
      org_agenda_files = '~/orgfiles/**/*',
      org_default_notes_file = '~/orgfiles/refile.org',
    })
  end,
}
})

kristijanhusak avatar Sep 20 '23 07:09 kristijanhusak

I just noticed this setting:

highlight = {
  enable = false, -- <<< This is now set to false
  additional_vim_regex_highlighting = { 'org' },
},

When configured that way, all errors go away and orgmode starts working. I'm gonna take a closer look at my treesitter configuration to see if it's the culprit.

ChausseBenjamin avatar Sep 20 '23 07:09 ChausseBenjamin

I just noticed this setting:

highlight = {
  enable = false, -- <<< This is now set to false
  additional_vim_regex_highlighting = { 'org' },
},

When configured that way, all errors go away and orgmode starts working. I'm gonna take a closer look at my treesitter configuration to see if it's the culprit.

Hi did you figured it out? I have same problems that if I try to install nvim-orgmode in LazyVim. And try to open the agenda view nothin happens.

juridiener avatar Sep 20 '23 07:09 juridiener

Minimal init is now updated to use lazy.nvim since packer is no longer maintained. You can see it here https://github.com/nvim-orgmode/orgmode/blob/master/scripts/minimal_init.lua.

To use it, just download it and do nvim -u minimal_init.lua

kristijanhusak avatar Sep 20 '23 15:09 kristijanhusak

nvim -u minimal_init.lua

I donwloaded and run the command. But nothing happens, no plugins were installed??

juridiener avatar Sep 21 '23 07:09 juridiener

@juridiener which system are you running? It should install everything in the background. Once it's done, try doing \oa to open the agenda.

kristijanhusak avatar Sep 21 '23 07:09 kristijanhusak

@juridiener which system are you running? It should install everything in the background. Once it's done, try doing \oa to open the agenda.

macOs Ventura 13.5.2

juridiener avatar Sep 21 '23 12:09 juridiener

I have a similar issue, maybe the same, my error is the same, but the line Start says line 460 not line 459. I'm using Neovim version v0.9.5 on Windows 11. trying their change of true to false also makes the error go away. I am also using lazy.vim to install.

Termanater13 avatar Jan 05 '24 01:01 Termanater13

@Termanater13 can you try on latest master? Windows should be supported with minimal init now.

kristijanhusak avatar Feb 14 '24 20:02 kristijanhusak