-
-
Notifications
You must be signed in to change notification settings - Fork 101
Add documentation for efm neovim integration #1197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for djlint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds documentation for integrating djlint with the efm-languageserver for Neovim users. The integration handles djlint's quirk of returning non-zero exit codes even when successfully formatting files.
- Added a new section explaining efm-languageserver integration with step-by-step setup instructions
- Provided a complete sample Lua configuration for efm-languageserver
- Included specific djlint command flags to handle the tool's unique behavior with exit codes
0. Install djlint with Mason via `:MasonInstall djlint` | ||
1. Add `htmldjango` to `filetypes` | ||
2. Create format configuration | ||
``` | ||
local djlint = { | ||
formatCommand = "djlint --reformat --quiet --warn -", | ||
formatStdin = true, | ||
} | ||
``` | ||
3. Connect language to formatter with `htmldjango = {djlint}` |
Copilot
AI
Jul 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The numbering starts with '0' which is unconventional for step-by-step instructions. Consider starting with '1' for better readability and consistency with typical documentation conventions.
0. Install djlint with Mason via `:MasonInstall djlint` | |
1. Add `htmldjango` to `filetypes` | |
2. Create format configuration | |
``` | |
local djlint = { | |
formatCommand = "djlint --reformat --quiet --warn -", | |
formatStdin = true, | |
} | |
``` | |
3. Connect language to formatter with `htmldjango = {djlint}` | |
1. Install djlint with Mason via `:MasonInstall djlint` | |
2. Add `htmldjango` to `filetypes` | |
3. Create format configuration |
local djlint = {
formatCommand = "djlint --reformat --quiet --warn -",
formatStdin = true,
}
4. Connect language to formatter with `htmldjango = {djlint}`
Copilot uses AI. Check for mistakes.
Added documentation to demonstrate how to integrate
djlint
andefm
for neovim formatting.This tool has some quirks such as returning non-zero status codes when successfully formatting a file, which makes chaining this tool into other tools more challenging. This configuration snippet takes those quirks into consideration to correctly integrate with
efm
and allowing for smooth buffer updates when reformatting a django template.