nvim-neorg / neorg

Modernity meets insane extensibility. The future of organizing your life in Neovim.
GNU General Public License v3.0
6.1k stars 205 forks source link

Launching Journal hangs Neovim #1393

Open maikelthedev opened 2 months ago

maikelthedev commented 2 months ago

Prerequisites

Neovim Version

0.9.5

Neorg setup

{ "nvim-neorg/neorg", build = ":Neorg sync-parsers", lazy = false, -- specify lazy = false because some lazy.nvim distributions set lazy = true by default -- tag = "", version = "", dependencies = { "nvim-lua/plenary.nvim", "vhyrro/luarocks.nvim"}, config = function() require("neorg").setup { load = { ["core.defaults"] = {}, -- Loads default behaviour ["core.concealer"] = { config = { icons = { code_block = { content_only = true, conceal = true, }, }, }, }, -- Adds pretty icons to your documents ["core.export"] = {}, ["core.dirman"] = { -- Manages Neorg workspaces config = { default_workspace = "notes", workspaces = { notes = "~/notes", }, }, }, }, } end, },

Actual behavior

Running

:Neorg journal today

makes Neovim unresponsive. It opens the day but crashes. I'm using kitty.

Expected behavior

open the day and let me use Neovim

Steps to reproduce

above

Potentially conflicting plugins

No response

Other information

No response

Help

None

Implementation help

No response

pysan3 commented 2 months ago

Neorg won't work if you have build = ":Neorg sync-parsers". Are you sure you have neorg setup correctly? And what version of neorg are you currently using?

quinnvoker commented 2 months ago

I'm experiencing the same issue with creating a new journal entry for today. Using the latest stable version of neorg (v8.4.1), which works for editing other .norg files, but specifically running :Neorg journal today opens the correct file in nvim but immediately hangs.

I'm using Lazy to set up neorg, and this is my config:

{
  "nvim-neorg/neorg",
  opts = {
    load = {
      ["core.defaults"] = {}, -- Loads default behaviour
      ["core.concealer"] = {}, -- Adds pretty icons to your documents
      ["core.dirman"] = { -- Manages Neorg workspaces
        config = {
          workspaces = {
            notes = "~/notes",
          },
        },
      },
      ["core.journal"] = {
        config = {
          journal_folder = "journal",
          strategy = "flat",
          workspace = "notes",
        },
      },
      ["core.keybinds"] = {
        config = {
          hook = function(keybinds)
            keybinds.map("norg", "n", "<tab>", "za")
          end,
          neorg_leader = "<Leader>",
        },
      },
      ["core.completion"] = {
        config = {
          engine = "nvim-cmp",
        },
      },
      ["core.export"] = {},
      ["core.export.markdown"] = {},            
    },
  },
  dependencies = { "luarocks.nvim" },
  lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default
  version = "*", -- Pin Neorg to the latest stable release
  config = true,
},

I did some testing by selectively commenting out parts of my config, and it specifically seems to be an issue with core.concealer, as commenting out everything in load except the defaults and concealer configs still causes the hang when opening today's journal. Similarly, commenting out only the core.concealer line allows the journal to open and be edited as expected.

PatMulligan commented 1 month ago

Is this only happening for you guys with the journal? My system often seems to all of a sudden start to hang (first it behaves normally) regardless of if it's :Neorg journal today or :Neorg index. The process starts to max out the CPU and the fans go wild

I have yet to find the steps to reproduce it reliably... but using nvim v0.9.4

return {
  {
    "nvim-neorg/neorg",
    dependencies = { "luarocks.nvim" },
    version = "*",
    config = function()
      require("neorg").setup {
        load = {
          ["core.defaults"] = {},
          ["core.concealer"] = {},
          ["core.dirman"] = {
            config = {
              workspaces = {
                notes = "~/notes",
              },
              default_workspace = "notes",
            },
          },
        },
      }

      vim.wo.foldlevel = 99
      vim.wo.conceallevel = 2
    end,
  }
}
benlubas commented 1 month ago

@PatMulligan I'd try 9.5, I remember having a bunch of issues like you describe with 9.4 as well, and they were fixed with 9.5