nvim-neorg / neorg

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

Custom Icon style color are not maintained after entering normal mode #1472

Open CRAG666 opened 4 months ago

CRAG666 commented 4 months ago

Prerequisites

Neovim Version

v0.10.0

Neorg setup

return { { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) if type(opts.ensure_installed) == "table" then vim.list_extend(opts.ensure_installed, { "norg", "norg_meta" }) end end, }, { "nvim-neorg/neorg", version = "*", -- Pin Neorg to the latest stable release dependencies = { "luarocks.nvim", "nvim-neorg/neorg-telescope" }, cmd = "Neorg", ft = "norg", keys = { { neorg_leader .. "o", function() if neorg_enabled then vim.cmd ":Neorg return" neorg_enabled = false return end vim.cmd "Neorg workspace notes" neorg_enabled = true end, desc = "Toggle org notes", }, { neorg_leader .. "tt", function() -- if vim.w.toc_open then -- vim.api.nvim_win_close(vim.w.win_toc, false) -- vim.w.toc_open = false -- return -- end vim.cmd "Neorg toc" vim.cmd "vert resize 60" -- vim.w.win_toc = vim.api.nvim_win_get_number(0) -- vim.w.toc_open = true end, desc = "Toggle highlighting org", }, }, config = function() require("neorg").setup { load = { ["core.defaults"] = {}, -- Loads default behaviour ["core.completion"] = { config = { engine = "nvim-cmp", name = "[Norg]" } }, ["core.integrations.nvim-cmp"] = {}, ["core.concealer"] = { config = { -- icon_preset = "basic", icon_preset = "diamond", icons = { code_block = { conceal = true, }, -- heading = { -- icons = { "🌸", "🌼", "🏡️", "❇️", "πŸ’ ", "β—‰" }, -- }, }, }, }, ["core.dirman"] = { -- Manages Neorg workspaces config = { workspaces = { notes = "~/Documentos/Org/Notes", }, }, }, ["core.keybinds"] = { config = { neorg_leader = neorg_leader, hook = function(keybinds) keybinds.map_event_to_mode("norg", {

              n = { -- Bind keys in normal mode
                {
                  neorg_leader .. "fl",
                  "core.integrations.telescope.find_linkable",
                  opts = { desc = "Find linkable" },
                },
                {
                  neorg_leader .. "fh",
                  "core.integrations.telescope.search_headings",
                  opts = { desc = "Search headings" },
                },
                {
                  neorg_leader .. "fi",
                  "core.integrations.telescope.insert_link",
                  opts = { desc = "Insert link" },
                },
                {
                  neorg_leader .. "ff",
                  "core.integrations.telescope.insert_file_link",
                  opts = { desc = "Insert link" },
                },
                { "]l", "core.integrations.treesitter.next.link", opts = { desc = "Next link" } },
                { "[l", "core.integrations.treesitter.previous.link", opts = { desc = "Previous link" } },
              },

              i = { -- Bind in insert mode
                { "<C-l>", "core.integrations.telescope.insert_link", opts = { desc = "Insert link" } },
              },
            }, {
              silent = true,
              noremap = true,
            })
          end,
        },
      },
      ["core.summary"] = {},
      ["core.export"] = {},
      ["core.integrations.telescope"] = {},
      ["core.ui.calendar"] = {},
    },
  }
end,

},

Actual behavior

Icons are not consistent between different modes

Expected behavior

Icons are expected to always be the same

Steps to reproduce

Open Org and hover heading

Potentially conflicting plugins

No response

Other information

No response

Help

Yes

Implementation help

No response

CRAG666 commented 4 months ago

Diamong config: 2024-06-19T22:37:54,212676152-06:00

Error:

2024-06-19T22:38:02,668763599-06:00

benlubas commented 4 months ago

When I go into normal mode in a heading line, the concealer disables and I see * heading name

What happens for me is the expected behavior afaik.

CRAG666 commented 4 months ago

@benlubas That's what I would expect but the opposite happens, I didn't have those problems in version 7. I disabled treesitter, but the problem prevails, so I came to the conclusion that the error is part of this plugin

benlubas commented 4 months ago

Yeah I can't reproduce it. I'd recommend making a minimal config, and if you still see it happening then I can try the minimal config, otherwise it's likely something specific to your config.

CRAG666 commented 4 months ago

@benlubas The initial error is already solved, now the error is that when I am in normal mode the color of the icon changes, when I defined it with another color

CRAG666 commented 4 months ago

Normal and insert mode: 2024-06-24T20:09:56,088020109-06:00 Command mode: 2024-06-24T20:10:02,481069807-06:00

CRAG666 commented 4 months ago

catppuccin config:


            ["@neorg.lists.unordered.prefix.norg"] = { fg = C.mauve },

            ["@neorg.headings.1.title.norg"] = { fg = C.pink },
            ["@neorg.headings.1.prefix"] = { fg = C.pink },
            ["@neorg.headings.1.prefix.norg"] = { fg = C.pink },
            ["@neorg.links.location.heading.1.norg"] = { fg = C.pink },

            ["@neorg.headings.2.title.norg"] = { fg = C.yellow },
            ["@neorg.headings.2.prefix"] = { fg = C.yellow },
            ["@neorg.headings.2.prefix.norg"] = { fg = C.yellow },
            ["@neorg.links.location.heading.2.norg"] = { fg = C.yellow },

            ["@neorg.headings.3.title.norg"] = { fg = C.sky },
            ["@neorg.headings.3.prefix"] = { fg = C.sky },
            ["@neorg.headings.3.prefix.norg"] = { fg = C.sky },
            ["@neorg.links.location.heading.3.norg"] = { fg = C.sky },

            ["@neorg.headings.4.title.norg"] = { fg = C.green },
            ["@neorg.headings.4.prefix"] = { fg = C.green },
            ["@neorg.headings.4.prefix.norg"] = { fg = C.green },
            ["@neorg.links.location.heading.4.norg"] = { fg = C.green },

            ["@neorg.headings.5.title.norg"] = { fg = C.lavender },
            ["@neorg.headings.5.prefix"] = { fg = C.lavender },
            ["@neorg.headings.5.prefix.norg"] = { fg = C.lavender },
            ["@neorg.links.location.heading.5.norg"] = { fg = C.lavender },

Neorg config:

  {
    "nvim-neorg/neorg",
    dependencies = { "luarocks.nvim", "nvim-neorg/neorg-telescope" },
    cmd = "Neorg",
    ft = "norg",
    keys = {
      {
        neorg_leader .. "o",
        function()
          if neorg_enabled then
            vim.cmd.Neorg "return"
            neorg_enabled = false
            return
          end
          vim.cmd.Neorg.workspace "notes"
          neorg_enabled = true
        end,
        desc = "Toggle org notes",
      },
      {
        neorg_leader .. "c",
        function()
          vim.cmd.Neorg "toggle-concealer"
        end,
        desc = "Toggle highlighting org",
      },
      {
        neorg_leader .. "tt",
        function()
          -- if vim.w.toc_open then
          --   vim.api.nvim_win_close(vim.w.win_toc, false)
          --   vim.w.toc_open = false
          --   return
          -- end
          vim.cmd.Neorg "toc"
          vim.cmd "vert resize 60"
          -- vim.w.win_toc = vim.api.nvim_win_get_number(0)
          -- vim.w.toc_open = true
        end,
        desc = "Toggle highlighting org",
      },
    },
    config = function()
      require("neorg").setup {
        load = {
          ["core.defaults"] = {}, -- Loads default behaviour
          ["core.completion"] = { config = { engine = "nvim-cmp", name = "[Norg]" } },
          ["core.integrations.nvim-cmp"] = {},
          ["core.concealer"] = {
            config = {
              icon_preset = "basic",
              -- icon_preset = "diamond",
              icons = {
                code_block = {
                  conceal = true,
                },
                delimiter = {
                  horizontal_line = {
                    icon = "β– ",
                  },
                },
                -- todo = {
                --   cancelled = { icon = "🚫" },
                --   done = { icon = "βœ…" },
                --   undone = { icon = "πŸ•’" },
                --   on_hold = { icon = "⏸️" },
                --   pending = { icon = "⏳" },
                --   recurring = { icon = "πŸ”„" },
                --   uncertain = { icon = "❓" },
                --   urgent = { icon = "🚨" },
                -- },
                definition = {
                  single = { icon = "󰃃" },
                  multi_prefix = { icon = "σ°‰Ύ " },
                  multi_suffix = { icon = "󰝗 " },
                },
                list = {
                  icons = { "" },
                },
                quote = {
                  icons = { "󰇙" },
                },
                heading = {
                  icons = { "🌸 ", "🌼 ", "πŸ’  ", "πŸ€ ", "󰴈", "❁ " },
                },
              },
            },
          },
          ["core.dirman"] = { -- Manages Neorg workspaces
            config = {
              workspaces = {
                notes = "~/Documentos/Org/Notes",
              },
            },
          },
          ["core.keybinds"] = {
            config = {
              neorg_leader = neorg_leader,
              hook = function(keybinds)
                keybinds.map_event_to_mode("norg", {

                  n = { -- Bind keys in normal mode
                    {
                      neorg_leader .. "fl",
                      "core.integrations.telescope.find_linkable",
                      opts = { desc = "Find linkable" },
                    },
                    {
                      neorg_leader .. "fh",
                      "core.integrations.telescope.search_headings",
                      opts = { desc = "Search headings" },
                    },
                    {
                      neorg_leader .. "fi",
                      "core.integrations.telescope.insert_link",
                      opts = { desc = "Insert link" },
                    },
                    {
                      neorg_leader .. "ff",
                      "core.integrations.telescope.insert_file_link",
                      opts = { desc = "Insert link" },
                    },
                    { "]l", "core.integrations.treesitter.next.link", opts = { desc = "Next link" } },
                    { "[l", "core.integrations.treesitter.previous.link", opts = { desc = "Previous link" } },
                  },

                  i = { -- Bind in insert mode
                    { "<C-l>", "core.integrations.telescope.insert_link", opts = { desc = "Insert link" } },
                  },
                }, {
                  silent = true,
                  noremap = true,
                })
              end,
            },
          },
          ["core.summary"] = {},
          ["core.export"] = {},
          ["core.integrations.telescope"] = {},
          ["core.ui.calendar"] = {},
        },
      }
    end,
  },