nvim-orgmode / orgmode

Orgmode clone written in Lua for Neovim 0.9+.
https://nvim-orgmode.github.io/
MIT License
3k stars 131 forks source link

Installation fails with the basic lazy.nvim install script #612

Open ChausseBenjamin opened 1 year ago

ChausseBenjamin commented 1 year ago

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

kristijanhusak commented 1 year ago

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,
}
})
ChausseBenjamin commented 1 year ago

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.

juridiener commented 1 year ago

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.

kristijanhusak commented 1 year ago

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

juridiener commented 1 year ago

nvim -u minimal_init.lua

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

kristijanhusak commented 1 year ago

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

juridiener commented 1 year ago

@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

Termanater13 commented 9 months ago

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.

kristijanhusak commented 7 months ago

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

ChausseBenjamin commented 2 months ago

Lazy Installation seems to be working flawlessly for me since June. Should this be kept open for others or is it OK to close? There have been no new developments for over 6 months anyways...