kickstart.nvim icon indicating copy to clipboard operation
kickstart.nvim copied to clipboard

Error with Markdown files after enabling lint plugin

Open togume opened this issue 1 year ago • 6 comments

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

  • OS: MacOS Sonoma 14.5 (23F79), M3 Max
  • Terminal: iTerm 2

Neovim Version

V0.10.0 (through Homebrew)

togume avatar Jun 10 '24 13:06 togume

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.

VlaDexa avatar Jun 11 '24 03:06 VlaDexa

@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).

togume avatar Jun 11 '24 12:06 togume

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.

vimkim avatar Jun 22 '24 17:06 vimkim

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?

VlaDexa avatar Jun 22 '24 19:06 VlaDexa

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

vimkim avatar Jun 23 '24 07:06 vimkim

In my environment I had to install markdownlint-cli

npm install -g markdownlint-cli

ryenski avatar Jun 25 '24 16:06 ryenski

I ran into this when opening a README.md file. To fix, had to install markdownlint-cli. On macOS:

brew install markdownlint-cli

rajive avatar Jul 10 '24 18:07 rajive

I've run into the same problem after installing npm packages it still preserves an error before opening a .md file:

Error detected while processing BufEnter Autocommands for "*": Error running vale: ENOENT: no such file or directory Press ENTER or type command to continue

MaksWisniewski avatar Jul 10 '24 23:07 MaksWisniewski

I used :Mason to manually install the package to get rid of this error. However, I first had to use apt install npm to get npm up and running. I'm not a frontend programmer so I wasn't intending to install node/npm, but seems to be required to use some of the tools. It's 490 MB of dependencies (yikes!) to install this linter.

JakePi3 avatar Feb 09 '25 19:02 JakePi3