Another cool plugin for Neovim, GitHub - jmbuhr/otter.nvim: Just ask an otter! 🦦 makes it possible to run linters for embedded code, like Markdown in code documentation:
In order to make it happen, you need to install otter (example for lazy.vim):
{
"jmbuhr/otter.nvim",
dependencies = {
"hrsh7th/nvim-cmp",
"neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter",
},
opts = {
buffers = {
set_filetype = true,
},
},
}
You also need to activate Otter in Elixir files:
local group = vim.api.nvim_create_augroup("Elixir", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = "*.ex,*.exs",
group = group,
callback = function()
local ok, otter = pcall(require, "otter")
if ok then
otter.activate({ "markdown" })
end
end,
})
Then I installed ltex-ls
and vale-ls
via :Mason
.
Vale also needs a config in the project or in ~/.vale.ini
:
StylesPath = styles
MinAlertLevel = suggestion
Packages = proselint, write-good, alex, Joblint
[*]
BasedOnStyles = Vale, proselint, write-good, alex, Joblint
Then vale sync
and you’re ready to go.
Now your Neovim will be able to help with grammar and style guide for English not only in Markdown files, but also in Markdown embedded into Elixir files.