added nvim-lint with clang-tidy

This commit is contained in:
2024-04-10 20:16:46 +02:00
parent eaada06d1a
commit d248b8866f
2 changed files with 20 additions and 0 deletions

19
lua/plugins/nvim-lint.lua Normal file
View File

@ -0,0 +1,19 @@
return {
'mfussenegger/nvim-lint',
config = function()
require('lint').linters_by_ft = {
cpp = { 'clangtidy', }
}
vim.api.nvim_create_autocmd({ 'BufWritePost' }, {
callback = function()
-- try_lint without arguments runs the linters defined in `linters_by_ft`
-- for the current filetype
require('lint').try_lint()
-- You can call `try_lint` with a linter name or a list of names to always
-- run specific linters, independent of the `linters_by_ft` configuration
-- require('lint').try_lint('cspell')
end,
})
end
}