nvim-lua / kickstart.nvim

A launch point for your personal nvim configuration
MIT License
16.69k stars 16.61k forks source link

Please set `conceallevel` to 0 when the `FileType` is `help`. #975

Open vimkim opened 3 weeks ago

vimkim commented 3 weeks ago

Describe the Bug

The current configuration internally sets conceallevel to 2, which makes it difficult to view help files. When conceallevel is set to a value other than 0, many characters are hidden, making it hard to understand the context of the help documentation. There should be an autocommand in init.lua that sets conceallevel to 0 when the FileType is help.

conceallevel 2

image

conceallevel 0

image

As you can see, conceallevel 2 hides important keywords (such as |map-overview|) from the paragraph, making it almost impossible to understand the context.

For the new comers who just started to learn vim or neovim, this conceallevel feature is a huge barrier and some might think the help manual is broken.

To Reproduce

Steps to reproduce the behavior:

  1. Open Neovim.
  2. Execute :help map.
  3. Observe that many paragraphs are not viewable due to hidden characters.

Expected Behavior

Help files should be fully viewable without hidden characters, making the documentation easy to read and understand.

Desktop

Neovim Version

NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1693350652
Run "nvim -V1 -v" for more info

Proposed Solution

Add an autocommand in init.lua to set conceallevel to 0 when the FileType is help:

-- Set conceallevel to 0 for help files
vim.api.nvim_create_autocmd('FileType', {
  pattern = 'help',
  callback = function()
    vim.wo.conceallevel = 0
  end,
})

This will ensure that help files are always readable by displaying all characters.

dam9000 commented 3 weeks ago

I tested this and the text appears just fine with the default kickstart, perhaps your issue lies in your own customization, perhaps it's caused by the colorscheme that you changed, which one do you use? Here is how the default kickstart looks for me: concealllevel=2: image

and concealllevel=0: image

vimkim commented 3 weeks ago

@dam9000 Interesting. Mine is the default kickstart.nvim as well. Just in case, I removed the entire ~/.config/nvim and reinstalled the default kickstart nvim, and it reproduced the same bug.

I'm kindly asking you the followings:


I confirmed that, under the same configuration, using neovim v0.9.0 did not produce the bug.

0.9.0

image image

0.10.0

image image


How to reproduce:

  1. Install the latest neovim.
  2. type :help map

neovim versions

neovim v0.10.0 installed with

neovim v0.9.0 installed with

How to fix bug

nvim --noplugin # v0.10.0

didn't come with the bug. But that also results in conceallevel = 0.


Additional testing results: setting conceallevel = 2 after nvim --noplugin does not produce the bug and the help files are readable.

There is probably some bug with the plugins kickstart.nvim is using and the recent version of neovim.

I wonder what feature of the new neovim (or the compatibility issue of the plugins, maybe UI) causes the conceallevel=2 to behave differently on the most recent version of the neovim.

vimkim commented 3 weeks ago

By the way, my colorscheme is tokyonight as well, since I tested with the default kickstart.nvim configuration.

It means @dam9000 your colorscheme and mine are the same one, but it looks different. Probably some weird terminal color rendering issue...? Anyway, just FYI.

dam9000 commented 3 weeks ago

@vimkim my neovim is 0.10, but I also have not noticed such an issue previously with 0.9.5. From your screenshots it appears to be an issue with your terminal colors. Perhaps try a different terminal or something as for the directories that nvim uses these are:

~/.config/nvim
~/.cache/nvim
~/.local/share/nvim
~/.local/state/nvim
vimkim commented 1 week ago

I figured that the colorscheme change was due to my TERM=tmux-256color env var set by .tmux plugin (oh-my-tmux).

Now my color scheme looks exactly the same as yours in the image if I quit TMUX.

and I deleted all the below listed directories as you mentioned.

~/.config/nvim
~/.cache/nvim
~/.local/share/nvim
~/.local/state/nvim

But still, the same problem happens. I guess it is not only me whose experiencing the issue, as inferred from #988.

I reproduced the same bug when:

I did not reproduce the bug when:

Thus, This bug is presumed to be related to the OS (as it works fine in Windows 11) and the neovim version.

It seems it is not the fault of kickstart.nvim.

For those who want a temporary patch until the issue gets resolved, you can put this at the bottom of your init.lua.

-- Set conceallevel to 0 for help files
vim.api.nvim_create_autocmd('FileType', {
  pattern = 'help',
  callback = function()
    vim.wo.conceallevel = 0
  end,
})

I hope this to be fixed one day.