nvim-lua / kickstart.nvim

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

Error with Markdown files after enabling lint plugin #980

Open togume opened 3 weeks ago

togume commented 3 weeks ago

Describe the bug

Opening Markdown files throws errors after enabling the link plugin from init.lua.

Opening an .md file directly:

image

Opening .md file from Neo-tree the first time:

image

Opening any other file after neo-tree throws initial error:

image

To Reproduce

  1. Fresh install of nvim
  2. Direct clone of Kickstart per the documentation
  3. Enable lint plugin from init.lua (optional - enable neo-tree to see other errors)
  4. Open any Markdown files either directly, or through neo-tree

Desktop

Neovim Version

V0.10.0 (through Homebrew)

VlaDexa commented 3 weeks ago

To lint your file nvim-lint tries to call an external command (markdownlint). It seems that it can't find markdownlint tool, and that means you need to install it through Mason (it's in the linters tab) or install it on your machine.

togume commented 3 weeks ago

@VlaDexa yes! Fixed by adding it to the vim.list_extend(ensure_installed block.. Thanks. Does it make sense to include this within the init.lua file, alongside the stylua requirement? Or perhaps a comment somewhere? I found it confusing to have this error out of the box (as a complete newbie to nvim).

vimkim commented 1 week ago

Will this be fixed? Everytime I install kickstart.nvim in a new OS or Container I get this error and I thought I needed to manually install markdownlint via npm install -g markdownlint.

VlaDexa commented 1 week ago

Will this be fixed?

As I see it, installing markdownlint only for everyone who enable lint plugin would require a significant init.lua rewrite to allow passing ensure_installed in opts to mason or directly calling mason-core functions to install markdown lint, which at the very least will not be very pretty to look at. Installing markdownlint for everyone using kickstart, even the ones who don't use the lint plugin, is an easier solution but I don't think it's a good one.

Everytime I install kickstart.nvim in a new OS or Container I get this error

I assume you're installing your fork, which has lint plugin enabled by default. Then, you also can do what @togume did and add it to your ensure_installed in init.lua to solve this error. This would be the easiest and the fastest solution available right now to you.

I agree that this is a problem which affects the user experience, but I don't really have a good way of solving it. Maybe you can take a crack at it?

vimkim commented 1 week ago

@VlaDexa Oh I see your point. Thanks for the kind explanation. Yeah I'll follow what togume did for the moment.

ryenski commented 1 week ago

In my environment I had to install markdownlint-cli

npm install -g markdownlint-cli