From a176c952547e1d27765d47c96e0439ae25c52fe3 Mon Sep 17 00:00:00 2001 From: Daniel Inama <62436912+frostplexx@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:04:49 +0200 Subject: [PATCH] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6781e5f..6aa2852 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,9 @@ vim.list_extend(names, lint.linters_by_ft["*"] or {}) lint.try_lint(names) ``` -## Dynamically Load Linters +## Dynamically Load Linters and Formatters + +### Linters You can have `nvim-lint` dynamically load linters so you dont have to restart nvim after installing or uninstalling a tool. To achive this you need to update the [autcommand from the nvim-lint README](https://github.com/mfussenegger/nvim-lint?tab=readme-ov-file#usage) like this: ```lua @@ -99,7 +101,7 @@ vim.api.nvim_create_autocmd({ "BufWritePost" },{ }) ``` -## Dynamically Load Formatters +### Formatters We ask for the currently installed formatters in a similar way to how we ask for linters. To achieve this we need to turn `format_on_save` into a function that re-sets the `formatters_by_ft` for `conform.nvim` like shown in the example below.