From ec470f93db4c6f913860c8df7d201d9688b9e5d1 Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Mon, 25 Jul 2022 19:44:14 +0100 Subject: [PATCH] fix(vim): lint files when we open buffers Currently they are only getting saved when you save buffers. I was missing errors when jumping around because the files do not get saved. This will now show me the errors when the buffer opens not only when the buffer is saved and I get to see linting errors when jumping around a codebase. --- site-modules/core/files/vim/init.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site-modules/core/files/vim/init.vim b/site-modules/core/files/vim/init.vim index cbaf82c..1138053 100644 --- a/site-modules/core/files/vim/init.vim +++ b/site-modules/core/files/vim/init.vim @@ -64,8 +64,8 @@ noremap ; gcc " 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 lua require('lint').try_lint('cspell') -au BufWritePost lua require('lint').try_lint() +au BufWritePost,BufReadPost lua require('lint').try_lint('cspell') +au BufWritePost,BufReadPost lua require('lint').try_lint() inoremap jj :w