Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
frostplexx authored Jun 7, 2024
1 parent 23d4ab2 commit a176c95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down

0 comments on commit a176c95

Please sign in to comment.