mfussenegger / nvim-lint

An asynchronous linter plugin for Neovim complementary to the built-in Language Server Protocol support.
GNU General Public License v3.0
2.02k stars 208 forks source link

QUESTION: how are linters found? #617

Closed Integralist closed 4 months ago

Integralist commented 4 months ago

👋🏻

I was curious as to how the linter tools are looked up by this plugin.

For example I have the following configuration that uses the actionlint linter:

https://github.com/Integralist/nvim/blob/main/lua/plugins/lint-and-format.lua#L81-L82

lint.try_lint("actionlint")

Now I don't have that linter installed in my normal shell environment...

$ actionlint -h
zsh: command not found: actionlint

But I do have it installed via https://github.com/williamboman/mason.nvim which installs tools into ~/.local/share/nvim/mason/packages/ so does this plugin automatically search for tools in ~/.local/share/nvim ?

Thanks.

Mouarius commented 4 months ago

Hello ! It's because when you install a program with Mason, it adds it automatically to the PATH environment variable on Neovim startup !

See : :h mason-introduction

Packages are installed in Neovim's data directory (:h standard-path) by default. Executables are linked to a single bin/ directory, which mason.nvim will add to Neovim's PATH during setup, allowing seamless access from Neovim builtins (shell, terminal, etc.) as well as other 3rd party plugins.

If you want to have it accessible in your login shell, you can add the directory of mason binaries to your PATH as well !

Integralist commented 4 months ago

Ah! Thanks for clarifying 👍