Code Monkey home page Code Monkey logo

Comments (6)

kristijanhusak avatar kristijanhusak commented on June 12, 2024

There are multiple issues with your config:

  1. org_agenda_files goes inside setup. You put it after the setup call
  2. nvim-treesitter is not necessary any more.

This is the correct config for you:

local tmp_dir = vim.env.TMPDIR or vim.env.TMP or vim.env.TEMP or '/tmp'
local nvim_root = tmp_dir .. '/nvim_orgmode'
local lazy_root = nvim_root .. '/lazy'
local lazypath = lazy_root .. '/lazy.nvim'

-- Install lazy.nvim if not already installed
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)

require('lazy').setup({
  {
    'nvim-orgmode/orgmode',
    event = 'VeryLazy',
    branch = 'master',
    config = function()
      require('orgmode').setup({
        org_agenda_files = '~/Dropbox/org/*'
      })
    end
  },
}, {
  root = lazy_root,
  lockfile = nvim_root .. '/lazy.json',
  install = {
    missing = false,
  },
})

require('lazy').sync({
  wait = true,
  show = false,
})

from orgmode.

tanj avatar tanj commented on June 12, 2024

whoops, messed that up with building the minimal config, but it is correct in my main config. After fixing the minimal config the behaviour is still the same.

I had issues with even opening agenda mode without adding the treesitter config. I kept having errors come up until I manually set the TMPDIR variable when launching nvim.

Do you know if neovim is using any of the temp dir variables as part of how orgmode operates? I had issues in the past with lualatex and temp dirs not being set in expected way on windows.

from orgmode.

kristijanhusak avatar kristijanhusak commented on June 12, 2024

I kept having errors come up until I manually set the TMPDIR variable when launching nvim.

What is the result of the 1st line in the minimal config for you?

Do you know if neovim is using any of the temp dir variables as part of how orgmode operates?

tempname() function is being used to generate temporary capture files.

from orgmode.

tanj avatar tanj commented on June 12, 2024

The first line is the result of putting print(tmp_dir) after the first line of the minimal config

C:\Users\JTEBOK~1\AppData\Local\Temp
Error detected while processing C:/Users/jtebokkel/Documents/junk/minimal_init-2.lua:
E5113: Error while calling lua chunk: ...Local/Temp/nvim_orgmode/lazy/lazy.nvim/lua/lazy/help.lua:42:
Vim:E151: No match: C:\Users\JTEBOK~1\AppData\Local\Temp\nvim_orgmode\lazy\lazy.nvim\doc\**
stack traceback:
[C]: in function 'helptags'
...Local/Temp/nvim_orgmode/lazy/lazy.nvim/lua/lazy/help.lua:42: in function 'update'
...emp/nvim_orgmode/lazy/lazy.nvim/lua/lazy/manage/init.lua:94: in function 'cb'
...p/nvim_orgmode/lazy/lazy.nvim/lua/lazy/manage/runner.lua:158: in function 'install'
...emp/nvim_orgmode/lazy/lazy.nvim/lua/lazy/manage/init.lua:190: in function 'sync'
C:/Users/jtebokkel/Documents/junk/minimal_init-2.lua:42: in main chunk
Press ENTER or type command to continue

After pressing enter

[orgmode] Installing tree-sitter grammar...
[orgmode] Done!
E5108: Error executing lua ...eovim/share/nvim/runtime/lua/vim/treesitter/language.lua:104: no parser for 'org' language, see :help treesitter-parsers
stack traceback:
[C]: in function 'error'
...eovim/share/nvim/runtime/lua/vim/treesitter/language.lua:104: in function 'add'
...s/Neovim/share/nvim/runtime/lua/vim/treesitter/query.lua:250: in function 'fn'
...iles/Neovim/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in function 'fn'
...iles/Neovim/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in function 'get'
...y/orgmode/lua/orgmode/colors/highlighter/markup/init.lua:13: in function 'new'
...ode/lazy/orgmode/lua/orgmode/colors/highlighter/init.lua:28: in function '_setup'
...ode/lazy/orgmode/lua/orgmode/colors/highlighter/init.lua:21: in function 'new'
...ocal/Temp/nvim_orgmode/lazy/orgmode/lua/orgmode/init.lua:47: in function 'init'
...ocal/Temp/nvim_orgmode/lazy/orgmode/lua/orgmode/init.lua:200: in function 'instance'
...ocal/Temp/nvim_orgmode/lazy/orgmode/lua/orgmode/init.lua:150: in function 'action'
[string ":lua"]:1: in main chunk 

This happens on each launch unless I execute like TMPDIR=$junk/orgmode-tmp-2 nvim -u $junk/minimal_init-2.lua where $junk is a folder in my home directory. If I set my own TMPDIR like that then I can bring up agenda view, but again no items are in the list.

from orgmode.

kristijanhusak avatar kristijanhusak commented on June 12, 2024

I pushed a fix for loading agenda files. Just start up with minimal init and do :Lazy sync to bring up latest master. Restart nvim and check if agenda files appear.

from orgmode.

tanj avatar tanj commented on June 12, 2024

that fixed it! Thank you so much!

from orgmode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.