Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neorg not highlighting markup #1388

Closed
2 tasks done
MihailMihov opened this issue Apr 8, 2024 · 5 comments
Closed
2 tasks done

Neorg not highlighting markup #1388

MihailMihov opened this issue Apr 8, 2024 · 5 comments
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@MihailMihov
Copy link

MihailMihov commented Apr 8, 2024

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin

Neovim Version

NVIM v0.10.0-dev-2783+g381806729-dirty Build type: Release LuaJIT 2.1.0-beta3

Neorg setup

require("neorg").setup({
	load = {
		["core.defaults"] = {},
		["core.concealer"] = {},
		["core.dirman"] = {
			config = {
				workspaces = {
					dev = "~/dev/notes",
				},
				index = "index.norg",
			}
		}
	}
})

Actual behavior

image
image
First screenshot is before :Neorg toggle-concealer, second is after. Only the headings change to icons and for some reason the spoiler text. Same behaviour as #1374.

Expected behavior

Markdown text is properly highlighted.

Steps to reproduce

I followed the instructions to install rocks.nvim. My config is here. I set my colorscheme as opt and loaded it in it's rocks-config file, because otherwise I got an error that it's not found (as per the rocks-config README). I was then experiencing the issue in #1351, so I added the snippet from there to my config and now neorg loads, but the concealer isn't working properly. Running :InspectTree does give the expected output I think:
image

Potentially conflicting plugins

No response

Other information

I'm using foot terminal, I have Source Code Pro and the symbols from Nerd Fonts installed. I also installed the tree-sitter-cli, but that didn't change anything. I tried Vhyrro's config, as it uses rocks.nvim, but I believe that it isn't updated as it failed to even load the colorscheme.

Help

No

Implementation help

No response

@MihailMihov MihailMihov added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label Apr 8, 2024
@github-project-automation github-project-automation bot moved this to added-updated-reopened in sorting neorg issue tracker Apr 8, 2024
@MihailMihov
Copy link
Author

I don't really know how to debug this, but I ran the command nvim -V3log -c 'help neorg' -c 'q' -c 'q' and here is the log file. I don't know where to look, but it says @neorg.markup.bold gets linked to @markup.strong. Running :highlight @neorg.markup.bold(or @markup.strong) does show bold text.

@flexagoon
Copy link

flexagoon commented Apr 8, 2024

It seems like you don't have TreeSitter highlighting enabled

https://github.com/MihailMihov/dotfiles/blob/main/.config/nvim/lua/plugins/nvim-treesitter.lua

Try adding

highlight = {
  enable = true
}

To nvim-treesitter.configs opts

@MihailMihov
Copy link
Author

Thank you so much that was it. Once the issues with rocks-treesitter.nvim are resolved and it can be used instead of nvim-treesitter will this option be enabled automatically? Also could I add a healthcheck to the core.concealer module to warn users if they don't have treesitter highlighting enabled?

@flexagoon
Copy link

@MihailMihov I'm not a maintainer of neorg or rocks-treesitter, so I don't know for sure, but looking at the rocks-treesitter readme, it seems like highlighting should still be enabled in the rocks.toml file:

https://github.com/nvim-neorocks/rocks-treesitter.nvim?tab=readme-ov-file#using-rockstoml

@vhyrro
Copy link
Member

vhyrro commented Apr 9, 2024

@MihailMihov yep once rocks-treesitter.nvim is fully stabilized highlighting will be enabled in all files automatically. In the meantime you can set your colourscheme from rocks-config.nvim itself:

[config]
colorscheme = "kanagawa-wave" # Example colourscheme

This is equivalent to running vim.cmd.colorscheme("kanagawa-wave") but rocks-config.nvim makes sure to run this at a time when the colourscheme is available :)

@github-project-automation github-project-automation bot moved this from added-updated-reopened to done in sorting neorg issue tracker Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.
Projects
None yet
Development

No branches or pull requests

3 participants