add neovim plugin (#59)

This commit is contained in:
Josh Thomas 2025-01-03 08:55:54 -06:00 committed by GitHub
parent d9d0f4ee87
commit accb8fdfb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 176 additions and 65 deletions

View file

@ -0,0 +1,27 @@
local M = {}
M.defaults = {
cmd = { "djls", "serve" },
filetypes = { "django-html", "htmldjango", "python" },
root_dir = function(fname)
local util = require("lspconfig.util")
local root = util.root_pattern("manage.py", "pyproject.toml")(fname)
return root or vim.fn.getcwd()
end,
settings = {},
}
function M.setup(opts)
opts = vim.tbl_deep_extend("force", M.defaults, opts or {})
local configs = require("lspconfig.configs")
if not configs.djls then
configs.djls = {
default_config = opts,
}
end
require("lspconfig").djls.setup(opts)
end
return M