nvim.d/nvim/lua/plugins/config/lint.lua
Dan Anglin f2aa4651fa
fix: update LSP configuration
Changes:

- fix: replace on_attach and custom_attach with autocommand for LspAttach
  as recommended by the official documentation.
- fix: enable inlay hints for gopls.
- fix: add a keymap to toggle inlay hints for supported versions of
  neovim.
- fix: customise the NormalFloat background colour.
- fix: add LSP configuration for the Lua Language Server.

- refactor: move the lint autocommand to lint.lua
2023-09-23 13:10:38 +01:00

23 lines
352 B
Lua

local ok, lint = pcall(require, "lint")
if not ok then
return
end
lint.linters_by_ft = {
go = {'golangcilint'},
sh = {'shellcheck'},
python = {'pylint'},
}
vim.api.nvim_create_autocmd('BufWritePost', {
callback = function()
local ok, lint = pcall(require, "lint")
if not ok then
return
end
lint.try_lint()
end
})