chore(vim): move lint code into the lua lint file

This was not working on for some reason in vim script
This commit is contained in:
Ade Attwood 2022-09-08 20:43:59 +01:00
parent ee7def9362
commit 4274d31d39
2 changed files with 14 additions and 6 deletions

View file

@ -64,12 +64,6 @@ inoremap <M-;> <esc>A;
noremap <leader>; gcc
"vnoremap <leader>; gc
" Lint code with nvim-lint on save. This will lint all filetypes with cspell
" and then any other filetypes will be linted per the config.
au BufWritePost,BufReadPost <buffer> lua require('lint').try_lint('cspell')
au BufWritePost,BufReadPost <buffer> lua require('lint').try_lint()
inoremap jj <esc>:w<cr>
nnoremap <leader><tab> <c-^>

View file

@ -46,3 +46,17 @@ lint.linters_by_ft = {
lua = {'luacheck'},
}
-- Lint code with nvim-lint on save. This will lint all filetypes with cspell
-- and then any other filetypes will be linted per the config.
local lint_auto_command_group = vim.api.nvim_create_augroup("aa_lint", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost" }, {
group = lint_auto_command_group,
desc = "Lint the buffer",
pattern = "*",
callback = function()
lint.try_lint('cspell')
lint.try_lint()
end,
})