added nvim-lint with clang-tidy
This commit is contained in:
19
lua/plugins/nvim-lint.lua
Normal file
19
lua/plugins/nvim-lint.lua
Normal 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
|
||||
}
|
Reference in New Issue
Block a user