Open nenikitov opened 5 months ago
Check out the options in this doc: https://github.com/stevearc/conform.nvim/blob/master/doc/formatter_options.md#injected
Open your markdown file and run :InspectTree
, then press I
to toggle the language of the nodes. This will help you find out the name of the language that is being used for the injection. If it says markdown
, then something is going wrong with your injection (are the parsers installed?)
Once you get the name (e.g. plaintex
), add another entry to that lang_to_ext
map. For example:
require("conform").setup({
formatters = {
injected = {
options = {
lang_to_ext = {
plaintex = "tex"
}
}
}
}
})
If this seems like a setting that would make sense for everyone, feel free to open a PR to add it to the default list of lang_to_ext
.
Neovim version (nvim -v)
NVIM v0.10.0-dev-2359+g9f8c96240d
Operating system/version
Arch Linux 6.6.8
Add the debug logs
log_level = vim.log.levels.DEBUG
and pasted the log contents below.Log file
15:31:49[DEBUG] Running formatters on /home/nenikitov/test.md: { "injected" } 15:31:49[INFO] Run injected on /home/nenikitov/test.md 15:31:49[DEBUG] Injected format lua:2:3: { "stylua" } 15:31:49[INFO] Run stylua on /home/nenikitov/test.md.1.lua 15:31:49[DEBUG] Run command: { "stylua", "--search-parent-directories", "--stdin-filepath", "/home/nenikitov/test.md.1.lua", "-" } 15:31:49[DEBUG] stylua exited with code 0
Describe the bug
Latex injected into
.md
doesn't format.It formats correctly inside
.tex
files.What is the severity of this bug?
tolerable (can work around it)
Steps To Reproduce
nvim -u repo.lua /path/to/example-file.md
:w
Expected Behavior
Latex should be formatted using
latexindent
Minimal example file
$$ \begin{bmatrix} 10 \end{bmatrix} $$
Minimal init.lua
Additional context
No response