mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-03-07 09:16:01 +00:00
Compare commits
No commits in common. "866b983c4047b87bcdca6ab3673ed7bd602f0251" and "39813f03226d0c603a85458d2bdf27e947b593da" have entirely different histories.
866b983c40
...
39813f0322
6 changed files with 13 additions and 91 deletions
|
|
@ -93,7 +93,7 @@ isMaximal: {
|
|||
fsharp.enable = false;
|
||||
just.enable = false;
|
||||
qml.enable = false;
|
||||
jinja.enable = false;
|
||||
|
||||
tailwind.enable = false;
|
||||
svelte.enable = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -132,9 +132,6 @@
|
|||
|
||||
- Added [sqruff](https://github.com/quarylabs/sqruff) support to `languages.sql`
|
||||
|
||||
- Lazy-load `crates.nvim` plugin when using
|
||||
`vim.languages.rust.extensions.crates-nvim.enable`
|
||||
|
||||
- Added [Pyrefly](https://pyrefly.org/) and [zuban](https://zubanls.com/)
|
||||
support to `languages.python`
|
||||
|
||||
|
|
@ -142,14 +139,9 @@
|
|||
[Tombi](https://tombi-toml.github.io/tombi/) language server, linter, and
|
||||
formatter.
|
||||
|
||||
- Added Jinja support via `languages.jinja`
|
||||
|
||||
- Added [hlargs.nvim](https://github.com/m-demare/hlargs.nvim) support as
|
||||
`visuals.hlargs-nvim`.
|
||||
|
||||
- Lazy-load `nvim-autopairs` plugin when using
|
||||
`vim.autopairs.nvim-autopairs.enable`
|
||||
|
||||
[Machshev](https://github.com/machshev):
|
||||
|
||||
- Added `ruff` and `ty` LSP support for Python under `programs.python`.
|
||||
|
|
|
|||
|
|
@ -4,14 +4,17 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.autopairs.nvim-autopairs;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.lazy.plugins.nvim-autopairs = {
|
||||
package = "nvim-autopairs";
|
||||
setupModule = "nvim-autopairs";
|
||||
setupOpts = cfg.setupOpts;
|
||||
event = ["InsertEnter"];
|
||||
vim = {
|
||||
startPlugins = ["nvim-autopairs"];
|
||||
pluginRC.autopairs = entryAnywhere ''
|
||||
require('nvim-autopairs').setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ in {
|
|||
./html.nix
|
||||
./haskell.nix
|
||||
./java.nix
|
||||
./jinja.nix
|
||||
./json.nix
|
||||
./lua.nix
|
||||
./markdown.nix
|
||||
|
|
|
|||
|
|
@ -1,65 +0,0 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) enum listOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.jinja;
|
||||
defaultServers = ["jinja-lsp"];
|
||||
servers = {
|
||||
jinja-lsp = {
|
||||
enable = true;
|
||||
cmd = [(getExe pkgs.jinja-lsp)];
|
||||
filetypes = ["jinja"];
|
||||
root_markers = [
|
||||
".git"
|
||||
];
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.jinja = {
|
||||
enable = mkEnableOption "Jinja template language support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Jinja treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "jinja";
|
||||
inlinePackage = mkGrammarOption pkgs "jinja_inline";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "Jinja LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
description = "Jinja LSP server to use";
|
||||
type = listOf (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [
|
||||
cfg.treesitter.package
|
||||
cfg.treesitter.inlinePackage
|
||||
];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.servers =
|
||||
mapListToAttrs (n: {
|
||||
name = n;
|
||||
value = servers.${n};
|
||||
})
|
||||
cfg.lsp.servers;
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
@ -228,17 +228,10 @@ in {
|
|||
(mkIf cfg.extensions.crates-nvim.enable {
|
||||
vim = mkMerge [
|
||||
{
|
||||
lazy.plugins.crates-nvim = {
|
||||
package = "crates-nvim";
|
||||
setupModule = "crates";
|
||||
setupOpts = cfg.extensions.crates-nvim.setupOpts;
|
||||
event = [
|
||||
{
|
||||
event = "BufRead";
|
||||
pattern = "Cargo.toml";
|
||||
}
|
||||
];
|
||||
};
|
||||
startPlugins = ["crates-nvim"];
|
||||
pluginRC.rust-crates = entryAnywhere ''
|
||||
require("crates").setup(${toLuaObject cfg.extensions.crates-nvim.setupOpts})
|
||||
'';
|
||||
}
|
||||
];
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue