added nvim-lint with clang-tidy
This commit is contained in:
parent
eaada06d1a
commit
d248b8866f
@ -61,6 +61,7 @@
|
|||||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "baa5b0dc6663284cce32e0d00ac1f2511b13496f" },
|
"nvim-dap-virtual-text": { "branch": "master", "commit": "baa5b0dc6663284cce32e0d00ac1f2511b13496f" },
|
||||||
"nvim-devdocs": { "branch": "master", "commit": "521d24661ffe6d1ba025debea2675c765a9c1ee1" },
|
"nvim-devdocs": { "branch": "master", "commit": "521d24661ffe6d1ba025debea2675c765a9c1ee1" },
|
||||||
"nvim-highlight-colors": { "branch": "main", "commit": "56e40d86a3202aedb0dbcded7aa6248c299eb0f0" },
|
"nvim-highlight-colors": { "branch": "main", "commit": "56e40d86a3202aedb0dbcded7aa6248c299eb0f0" },
|
||||||
|
"nvim-lint": { "branch": "master", "commit": "4055dc856d5ac8f6b85748006fd8fa6457e086e8" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "6e5c78ebc9936ca74add66bda22c566f951b6ee5" },
|
"nvim-lspconfig": { "branch": "master", "commit": "6e5c78ebc9936ca74add66bda22c566f951b6ee5" },
|
||||||
"nvim-navbuddy": { "branch": "master", "commit": "f34237e8a41ebc6e2716af2ebf49854d8c5289c8" },
|
"nvim-navbuddy": { "branch": "master", "commit": "f34237e8a41ebc6e2716af2ebf49854d8c5289c8" },
|
||||||
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
|
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
|
||||||
|
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
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user