mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-01 19:11:15 +00:00
add conform.nvim & nvim-lint
This commit is contained in:
parent
ecbaecfeac
commit
0ff9476eae
11 changed files with 174 additions and 0 deletions
34
flake.lock
34
flake.lock
|
@ -396,6 +396,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"plugin-conform-nvim": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1726168403,
|
||||||
|
"narHash": "sha256-AWgG+16Bh/xu50pU78mKIcQy9MKzWF1YKdbEt5jX0WQ=",
|
||||||
|
"owner": "stevearc",
|
||||||
|
"repo": "conform.nvim",
|
||||||
|
"rev": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "stevearc",
|
||||||
|
"repo": "conform.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"plugin-copilot-cmp": {
|
"plugin-copilot-cmp": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -1133,6 +1149,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"plugin-nvim-lint": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1727002360,
|
||||||
|
"narHash": "sha256-mg3IqNfIeWimasYEHilqv4Yx67hTHBubq19nLTNrjLk=",
|
||||||
|
"owner": "mfussenegger",
|
||||||
|
"repo": "nvim-lint",
|
||||||
|
"rev": "968a35d54b3a4c1ce66609cf80b14d4ae44fe77f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "mfussenegger",
|
||||||
|
"repo": "nvim-lint",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"plugin-nvim-lspconfig": {
|
"plugin-nvim-lspconfig": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -1800,6 +1832,7 @@
|
||||||
"plugin-cmp-vsnip": "plugin-cmp-vsnip",
|
"plugin-cmp-vsnip": "plugin-cmp-vsnip",
|
||||||
"plugin-codewindow-nvim": "plugin-codewindow-nvim",
|
"plugin-codewindow-nvim": "plugin-codewindow-nvim",
|
||||||
"plugin-comment-nvim": "plugin-comment-nvim",
|
"plugin-comment-nvim": "plugin-comment-nvim",
|
||||||
|
"plugin-conform-nvim": "plugin-conform-nvim",
|
||||||
"plugin-copilot-cmp": "plugin-copilot-cmp",
|
"plugin-copilot-cmp": "plugin-copilot-cmp",
|
||||||
"plugin-copilot-lua": "plugin-copilot-lua",
|
"plugin-copilot-lua": "plugin-copilot-lua",
|
||||||
"plugin-crates-nvim": "plugin-crates-nvim",
|
"plugin-crates-nvim": "plugin-crates-nvim",
|
||||||
|
@ -1846,6 +1879,7 @@
|
||||||
"plugin-nvim-dap-ui": "plugin-nvim-dap-ui",
|
"plugin-nvim-dap-ui": "plugin-nvim-dap-ui",
|
||||||
"plugin-nvim-docs-view": "plugin-nvim-docs-view",
|
"plugin-nvim-docs-view": "plugin-nvim-docs-view",
|
||||||
"plugin-nvim-lightbulb": "plugin-nvim-lightbulb",
|
"plugin-nvim-lightbulb": "plugin-nvim-lightbulb",
|
||||||
|
"plugin-nvim-lint": "plugin-nvim-lint",
|
||||||
"plugin-nvim-lspconfig": "plugin-nvim-lspconfig",
|
"plugin-nvim-lspconfig": "plugin-nvim-lspconfig",
|
||||||
"plugin-nvim-navbuddy": "plugin-nvim-navbuddy",
|
"plugin-nvim-navbuddy": "plugin-nvim-navbuddy",
|
||||||
"plugin-nvim-navic": "plugin-nvim-navic",
|
"plugin-nvim-navic": "plugin-nvim-navic",
|
||||||
|
|
12
flake.nix
12
flake.nix
|
@ -187,6 +187,18 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Formatters
|
||||||
|
plugin-conform-nvim = {
|
||||||
|
url = "github:stevearc/conform.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Diagnostics
|
||||||
|
plugin-nvim-lint = {
|
||||||
|
url = "github:mfussenegger/nvim-lint";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
# Copying/Registers
|
# Copying/Registers
|
||||||
plugin-registers = {
|
plugin-registers = {
|
||||||
url = "github:tversteeg/registers.nvim";
|
url = "github:tversteeg/registers.nvim";
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
"dashboard"
|
"dashboard"
|
||||||
"debugger"
|
"debugger"
|
||||||
"filetree"
|
"filetree"
|
||||||
|
"formatter"
|
||||||
"git"
|
"git"
|
||||||
"languages"
|
"languages"
|
||||||
"lsp"
|
"lsp"
|
||||||
|
|
3
modules/plugins/diagnostics/default.nix
Normal file
3
modules/plugins/diagnostics/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
imports = [./nvim-lint];
|
||||||
|
}
|
20
modules/plugins/diagnostics/nvim-lint/config.nix
Normal file
20
modules/plugins/diagnostics/nvim-lint/config.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
|
cfg = config.vim.diagnostics.nvim-lint;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = ["nvim-lint"];
|
||||||
|
pluginRC.nvim-lint = entryAnywhere ''
|
||||||
|
require("lint").setup(${toLuaObject cfg.setupOpts})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/diagnostics/nvim-lint/default.nix
Normal file
6
modules/plugins/diagnostics/nvim-lint/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./nvim-lint.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
36
modules/plugins/diagnostics/nvim-lint/nvim-lint.nix
Normal file
36
modules/plugins/diagnostics/nvim-lint/nvim-lint.nix
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
|
inherit (lib.types) attrs attrsOf listOf str;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
in {
|
||||||
|
options.vim.diagnostics.nvim-lint = {
|
||||||
|
enable = mkEnableOption "asynchronous linter plugin for Neovim [nvim-lint]";
|
||||||
|
setupOpts = mkPluginSetupOption "conform.nvim" {
|
||||||
|
linters_by_ft = mkOption {
|
||||||
|
type = attrsOf (listOf str);
|
||||||
|
default = {};
|
||||||
|
example = {
|
||||||
|
text = ["vale"];
|
||||||
|
markdown = ["vale"];
|
||||||
|
};
|
||||||
|
description = ''
|
||||||
|
Map of filetype to formatters. This option takes a set of
|
||||||
|
`key = value` format where the `value will` be converted
|
||||||
|
to its Lua equivalent. You are responsible for passing the
|
||||||
|
correct Nix data types to generate a correct Lua value that
|
||||||
|
conform is able to accept.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
default_format_opts = mkOption {
|
||||||
|
type = attrs;
|
||||||
|
default = {lsp_format = "fallback";};
|
||||||
|
description = "Default values when calling `conform.format()`";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
20
modules/plugins/formatter/conform-nvim/config.nix
Normal file
20
modules/plugins/formatter/conform-nvim/config.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
|
cfg = config.vim.formatter.conform-nvim;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = ["conform-nvim"];
|
||||||
|
pluginRC.conform-nvim = entryAnywhere ''
|
||||||
|
require("conform").setup(${toLuaObject cfg.setupOpts})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
33
modules/plugins/formatter/conform-nvim/conform-nvim.nix
Normal file
33
modules/plugins/formatter/conform-nvim/conform-nvim.nix
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
|
inherit (lib.types) attrs;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
in {
|
||||||
|
options.vim.formatter.conform-nvim = {
|
||||||
|
enable = mkEnableOption "lightweight yet powerful formatter plugin for Neovim [conform-nvim]";
|
||||||
|
setupOpts = mkPluginSetupOption "conform.nvim" {
|
||||||
|
formatters_by_ft = mkOption {
|
||||||
|
type = attrs;
|
||||||
|
default = {};
|
||||||
|
example = literalExpression "lua = [\"${pkgs.stylua}/bin/stylua\"]";
|
||||||
|
description = ''
|
||||||
|
Map of filetype to formatters. This option takes a set of
|
||||||
|
`key = value` format where the `value will` be converted
|
||||||
|
to its Lua equivalent. You are responsible for passing the
|
||||||
|
correct Nix data types to generate a correct Lua value that
|
||||||
|
conform is able to accept.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
default_format_opts = mkOption {
|
||||||
|
type = attrs;
|
||||||
|
default = {lsp_format = "fallback";};
|
||||||
|
description = "Default values when calling `conform.format()`";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/formatter/conform-nvim/default.nix
Normal file
6
modules/plugins/formatter/conform-nvim/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./conform-nvim.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
3
modules/plugins/formatter/default.nix
Normal file
3
modules/plugins/formatter/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
imports = [./conform-nvim];
|
||||||
|
}
|
Loading…
Reference in a new issue