mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-04-02 19:11:53 +00:00
language/typst: migrate to conform/nvim-lint
This commit is contained in:
parent
6f5738da0c
commit
d45763f7e2
1 changed files with 7 additions and 19 deletions
|
@ -9,7 +9,6 @@
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) nullOr enum either attrsOf listOf package str;
|
inherit (lib.types) nullOr enum either attrsOf listOf package str;
|
||||||
inherit (lib.attrsets) attrNames;
|
inherit (lib.attrsets) attrNames;
|
||||||
inherit (lib.generators) mkLuaInline;
|
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.nvim.lua) expToLua toLuaObject;
|
inherit (lib.nvim.lua) expToLua toLuaObject;
|
||||||
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption;
|
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption;
|
||||||
|
@ -61,26 +60,10 @@
|
||||||
formats = {
|
formats = {
|
||||||
typstfmt = {
|
typstfmt = {
|
||||||
package = pkgs.typstfmt;
|
package = pkgs.typstfmt;
|
||||||
nullConfig = ''
|
|
||||||
table.insert(
|
|
||||||
ls_sources,
|
|
||||||
null_ls.builtins.formatting.typstfmt.with({
|
|
||||||
command = "${cfg.format.package}/bin/typstfmt",
|
|
||||||
})
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
# https://github.com/Enter-tainer/typstyle
|
# https://github.com/Enter-tainer/typstyle
|
||||||
typstyle = {
|
typstyle = {
|
||||||
package = pkgs.typstyle;
|
package = pkgs.typstyle;
|
||||||
nullConfig = ''
|
|
||||||
table.insert(
|
|
||||||
ls_sources,
|
|
||||||
null_ls.builtins.formatting.typstfmt.with({
|
|
||||||
command = "${cfg.format.package}/bin/typstyle",
|
|
||||||
})
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
@ -176,8 +159,13 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
(mkIf cfg.format.enable {
|
||||||
vim.lsp.null-ls.enable = true;
|
vim.formatter.conform-nvim = {
|
||||||
vim.lsp.null-ls.sources.typst-format = formats.${cfg.format.type}.nullConfig;
|
enable = true;
|
||||||
|
setupOpts.formatters_by_ft.typst = [cfg.format.type];
|
||||||
|
setupOpts.formatters.${cfg.format.type} = {
|
||||||
|
command = getExe cfg.format.package;
|
||||||
|
};
|
||||||
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
(mkIf cfg.lsp.enable {
|
||||||
|
|
Loading…
Add table
Reference in a new issue