From dab7611441373a6f950eecc5e563b049c4dbad47 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Mon, 28 Aug 2023 15:56:07 -0500 Subject: [PATCH] feat(nvim): add nvim lint --- dots/.config/nvim/after/ftplugin/Dockerfile.lua | 3 --- dots/.config/nvim/after/ftplugin/dockerfile.lua | 9 +++++++++ .../nvim/lua/plugins/configs/nvim-lint.lua | 16 ++++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) delete mode 100644 dots/.config/nvim/after/ftplugin/Dockerfile.lua create mode 100644 dots/.config/nvim/after/ftplugin/dockerfile.lua create mode 100644 dots/.config/nvim/lua/plugins/configs/nvim-lint.lua diff --git a/dots/.config/nvim/after/ftplugin/Dockerfile.lua b/dots/.config/nvim/after/ftplugin/Dockerfile.lua deleted file mode 100644 index 6e23bc18..00000000 --- a/dots/.config/nvim/after/ftplugin/Dockerfile.lua +++ /dev/null @@ -1,3 +0,0 @@ -local file_loc = vim.fn.expand("%:p:h") - -vim.opt_local.makeprg = "docker build " .. file_loc diff --git a/dots/.config/nvim/after/ftplugin/dockerfile.lua b/dots/.config/nvim/after/ftplugin/dockerfile.lua new file mode 100644 index 00000000..953b44db --- /dev/null +++ b/dots/.config/nvim/after/ftplugin/dockerfile.lua @@ -0,0 +1,9 @@ +local file_loc = vim.fn.expand("%:p:h") + +vim.opt_local.makeprg = "docker build " .. file_loc + +vim.api.nvim_create_autocmd({ "TextChanged", "TextChangedI"}, { + callback = function() + require("lint").try_lint() + end +}) \ No newline at end of file diff --git a/dots/.config/nvim/lua/plugins/configs/nvim-lint.lua b/dots/.config/nvim/lua/plugins/configs/nvim-lint.lua new file mode 100644 index 00000000..e77e070f --- /dev/null +++ b/dots/.config/nvim/lua/plugins/configs/nvim-lint.lua @@ -0,0 +1,16 @@ +return { + { + "mfussenegger/nvim-lint", + event = { "BufReadPre", "BufNewFile" }, + config = function() + require("lint").linters_by_ft = { + markdown = {"proselint"} + } + vim.api.nvim_create_autocmd({ "BufWritePost", "BufEnter" }, { + callback = function() + require("lint").try_lint() + end + }) + end + } +} \ No newline at end of file