mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-05 18:40:53 +00:00
Merge branch 'main' into update-npins
This commit is contained in:
commit
bc93de25a0
13 changed files with 184 additions and 14 deletions
|
|
@ -13,6 +13,9 @@ isMaximal: {
|
||||||
logFile = "/tmp/nvim.log";
|
logFile = "/tmp/nvim.log";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# vim.opts and vim.options are aliased
|
||||||
|
opts.expandtab = true;
|
||||||
|
|
||||||
spellcheck = {
|
spellcheck = {
|
||||||
enable = true;
|
enable = true;
|
||||||
programmingWordlist.enable = isMaximal;
|
programmingWordlist.enable = isMaximal;
|
||||||
|
|
@ -77,6 +80,7 @@ isMaximal: {
|
||||||
tex.enable = isMaximal;
|
tex.enable = isMaximal;
|
||||||
|
|
||||||
# Language modules that are not as common.
|
# Language modules that are not as common.
|
||||||
|
openscad.enable = false;
|
||||||
arduino.enable = false;
|
arduino.enable = false;
|
||||||
assembly.enable = false;
|
assembly.enable = false;
|
||||||
astro.enable = false;
|
astro.enable = false;
|
||||||
|
|
|
||||||
|
|
@ -259,6 +259,11 @@
|
||||||
- Add `languages.fluent` using the official plugin. This only provides
|
- Add `languages.fluent` using the official plugin. This only provides
|
||||||
highlighting.
|
highlighting.
|
||||||
|
|
||||||
|
- Add `languages.openscad` using
|
||||||
|
[`openscad-lsp`](https://github.com/Leathong/openscad-LSP). This currently
|
||||||
|
relies on neovim builtin syntax for highlighting, and the lsp for formatting
|
||||||
|
and diagnostics.
|
||||||
|
|
||||||
- Added Debugging support to `languages.php`.
|
- Added Debugging support to `languages.php`.
|
||||||
|
|
||||||
- Added Formatting support to `languages.php` via
|
- Added Formatting support to `languages.php` via
|
||||||
|
|
@ -279,6 +284,9 @@
|
||||||
- Added neovim theme `gruber-darker`
|
- Added neovim theme `gruber-darker`
|
||||||
<https://github.com/blazkowolf/gruber-darker.nvim>.
|
<https://github.com/blazkowolf/gruber-darker.nvim>.
|
||||||
|
|
||||||
|
- Added coverage support (`vim.utility.crazy-coverage`) via
|
||||||
|
[`crazy-coverage.nvim`](https://github.com/mr-u0b0dy/crazy-coverage.nvim).
|
||||||
|
|
||||||
[vagahbond](https://github.com/vagahbond): [codewindow.nvim]:
|
[vagahbond](https://github.com/vagahbond): [codewindow.nvim]:
|
||||||
https://github.com/gorbit99/codewindow.nvim
|
https://github.com/gorbit99/codewindow.nvim
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,11 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Alias vim.options as vim.opts.
|
||||||
|
# This is a convenience for people using frameworks like flake-parts or Den that use lib.types.deferredModule
|
||||||
|
# and users would set `vim.options` but error when Nix confuses it with Nix Module's options-definitions.
|
||||||
|
imports = [(lib.mkAliasOptionModule ["vim" "opts"] ["vim" "options"])];
|
||||||
|
|
||||||
config.vim = {
|
config.vim = {
|
||||||
# Set options that were previously interpolated in 'luaConfigRC.basic' as vim.options (vim.o)
|
# Set options that were previously interpolated in 'luaConfigRC.basic' as vim.options (vim.o)
|
||||||
# and 'vim.globals' (vim.g). Future options, if possible, should be added here instead of the
|
# and 'vim.globals' (vim.g). Future options, if possible, should be added here instead of the
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ in {
|
||||||
./make.nix
|
./make.nix
|
||||||
./xml.nix
|
./xml.nix
|
||||||
./fluent.nix
|
./fluent.nix
|
||||||
|
./openscad.nix
|
||||||
|
|
||||||
# This is now a hard deprecation.
|
# This is now a hard deprecation.
|
||||||
(mkRenamedOptionModule ["vim" "languages" "enableLSP"] ["vim" "lsp" "enable"])
|
(mkRenamedOptionModule ["vim" "languages" "enableLSP"] ["vim" "lsp" "enable"])
|
||||||
|
|
|
||||||
62
modules/plugins/languages/openscad.nix
Normal file
62
modules/plugins/languages/openscad.nix
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (builtins) attrNames;
|
||||||
|
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.types) enum listOf;
|
||||||
|
inherit (lib.meta) getExe;
|
||||||
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.openscad;
|
||||||
|
/*
|
||||||
|
There is no Treesitter module for OpenSCAD yet.
|
||||||
|
Luckily vim already ships with a builtin syntax that is used by default.
|
||||||
|
|
||||||
|
The LSP already ships with diagnostics, but there is also an experimental analyzer called sca2d
|
||||||
|
<https://search.nixos.org/packages?channel=unstable&query=sca2d>
|
||||||
|
But it isn't packaged for nvim-lint and would need extra work.
|
||||||
|
*/
|
||||||
|
|
||||||
|
defaultServers = ["openscad-lsp"];
|
||||||
|
servers = {
|
||||||
|
openscad-lsp = {
|
||||||
|
enable = true;
|
||||||
|
cmd = [(getExe pkgs.openscad-lsp) "--stdio"];
|
||||||
|
filetypes = ["openscad"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
options.vim.languages.openscad = {
|
||||||
|
enable = mkEnableOption "OpenSCAD language support";
|
||||||
|
|
||||||
|
lsp = {
|
||||||
|
enable =
|
||||||
|
mkEnableOption "OpenSCAD LSP support"
|
||||||
|
// {
|
||||||
|
default = config.vim.lsp.enable;
|
||||||
|
defaultText = literalExpression "config.vim.lsp.enable";
|
||||||
|
};
|
||||||
|
|
||||||
|
servers = mkOption {
|
||||||
|
type = listOf (enum (attrNames servers));
|
||||||
|
default = defaultServers;
|
||||||
|
description = "OpenSCAD LSP server to use";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.lsp.enable {
|
||||||
|
vim.lsp.servers =
|
||||||
|
mapListToAttrs (n: {
|
||||||
|
name = n;
|
||||||
|
value = servers.${n};
|
||||||
|
})
|
||||||
|
cfg.lsp.servers;
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
@ -4,9 +4,7 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
inherit (lib.nvim.binds) pushDownDefault;
|
inherit (lib.nvim.binds) pushDownDefault;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
|
||||||
|
|
||||||
cfg = config.vim.notes.neorg;
|
cfg = config.vim.notes.neorg;
|
||||||
in {
|
in {
|
||||||
|
|
@ -19,17 +17,21 @@ in {
|
||||||
"nvim-nio"
|
"nvim-nio"
|
||||||
"pathlib-nvim"
|
"pathlib-nvim"
|
||||||
"plenary-nvim"
|
"plenary-nvim"
|
||||||
"neorg"
|
|
||||||
"neorg-telescope"
|
"neorg-telescope"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
lazy.plugins.neorg = {
|
||||||
|
package = "neorg";
|
||||||
|
setupModule = "neorg";
|
||||||
|
inherit (cfg) setupOpts;
|
||||||
|
|
||||||
|
ft = ["norg"];
|
||||||
|
cmd = ["Neorg"];
|
||||||
|
};
|
||||||
|
|
||||||
binds.whichKey.register = pushDownDefault {
|
binds.whichKey.register = pushDownDefault {
|
||||||
"<leader>o" = "+Notes";
|
"<leader>o" = "+Notes";
|
||||||
};
|
};
|
||||||
|
|
||||||
pluginRC.neorg = entryAnywhere ''
|
|
||||||
require('neorg').setup(${toLuaObject cfg.setupOpts})
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,22 +5,32 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
|
||||||
|
|
||||||
cfg = config.vim.notes.obsidian;
|
cfg = config.vim.notes.obsidian;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = [
|
startPlugins = [
|
||||||
"obsidian-nvim"
|
|
||||||
"vim-markdown"
|
"vim-markdown"
|
||||||
"tabular"
|
"tabular"
|
||||||
|
"plenary-nvim"
|
||||||
];
|
];
|
||||||
|
|
||||||
pluginRC.obsidian = entryAnywhere ''
|
lazy.plugins.obsidian-nvim = {
|
||||||
require("obsidian").setup(${toLuaObject cfg.setupOpts})
|
package = "obsidian-nvim";
|
||||||
|
# NOTE: packaged plugin directory is `obsidian.nvim`; loading by the
|
||||||
|
# spec key (`obsidian-nvim`) misses and makes `require("obsidian")`
|
||||||
|
# resolve to a loader function via lzn-auto-require.
|
||||||
|
# I don't love this, but I can't think of anything better
|
||||||
|
load = ''
|
||||||
|
vim.cmd.packadd("obsidian.nvim")
|
||||||
'';
|
'';
|
||||||
|
setupModule = "obsidian";
|
||||||
|
inherit (cfg) setupOpts;
|
||||||
|
|
||||||
|
ft = ["markdown"];
|
||||||
|
cmd = ["Obsidian"];
|
||||||
|
};
|
||||||
|
|
||||||
notes.obsidian.setupOpts = let
|
notes.obsidian.setupOpts = let
|
||||||
# may not be defined
|
# may not be defined
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,32 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim.startPlugins = [pkgs.vimPlugins.conjure];
|
vim.lazy.plugins.conjure = {
|
||||||
|
package = pkgs.vimPlugins.conjure;
|
||||||
|
ft = [
|
||||||
|
"clojure"
|
||||||
|
"fennel"
|
||||||
|
"janet"
|
||||||
|
"hy"
|
||||||
|
"julia"
|
||||||
|
"racket"
|
||||||
|
"scheme"
|
||||||
|
"lua"
|
||||||
|
"lisp"
|
||||||
|
"python"
|
||||||
|
"rust"
|
||||||
|
"sql"
|
||||||
|
"javascript"
|
||||||
|
"typescript"
|
||||||
|
"php"
|
||||||
|
"r"
|
||||||
|
];
|
||||||
|
cmd = [
|
||||||
|
"ConjureSchool"
|
||||||
|
"ConjureEval"
|
||||||
|
"ConjureConnect"
|
||||||
|
"ConjureClientState"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18
modules/plugins/utility/crazy-coverage/config.nix
Normal file
18
modules/plugins/utility/crazy-coverage/config.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
cfg = config.vim.utility.crazy-coverage;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim.startPlugins = ["crazy-coverage"];
|
||||||
|
|
||||||
|
vim.pluginRC.crazy-coverage = entryAnywhere ''
|
||||||
|
require("crazy-coverage").setup(${toLuaObject cfg.setupOpts})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
11
modules/plugins/utility/crazy-coverage/crazy-coverage.nix
Normal file
11
modules/plugins/utility/crazy-coverage/crazy-coverage.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkEnableOption;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
in {
|
||||||
|
options.vim.utility.crazy-coverage = {
|
||||||
|
enable = mkEnableOption "coverage for neovim";
|
||||||
|
|
||||||
|
setupOpts =
|
||||||
|
mkPluginSetupOption "crazy-coverage.nvim" {};
|
||||||
|
};
|
||||||
|
}
|
||||||
6
modules/plugins/utility/crazy-coverage/default.nix
Normal file
6
modules/plugins/utility/crazy-coverage/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
_: {
|
||||||
|
imports = [
|
||||||
|
./crazy-coverage.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -30,5 +30,6 @@
|
||||||
./yanky-nvim
|
./yanky-nvim
|
||||||
./yazi-nvim
|
./yazi-nvim
|
||||||
./undotree
|
./undotree
|
||||||
|
./crazy-coverage
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -394,6 +394,22 @@
|
||||||
"url": "https://github.com/Saecki/crates.nvim/archive/ac9fa498a9edb96dc3056724ff69d5f40b898453.tar.gz",
|
"url": "https://github.com/Saecki/crates.nvim/archive/ac9fa498a9edb96dc3056724ff69d5f40b898453.tar.gz",
|
||||||
"hash": "sha256-jfmST/S9ymwgQ99PTCOlJkk5zaxE5HiDV16TmTISDII="
|
"hash": "sha256-jfmST/S9ymwgQ99PTCOlJkk5zaxE5HiDV16TmTISDII="
|
||||||
},
|
},
|
||||||
|
"crazy-coverage": {
|
||||||
|
"type": "GitRelease",
|
||||||
|
"repository": {
|
||||||
|
"type": "GitHub",
|
||||||
|
"owner": "mr-u0b0dy",
|
||||||
|
"repo": "crazy-coverage.nvim"
|
||||||
|
},
|
||||||
|
"pre_releases": false,
|
||||||
|
"version_upper_bound": null,
|
||||||
|
"release_prefix": null,
|
||||||
|
"submodules": false,
|
||||||
|
"version": "v2.1.0",
|
||||||
|
"revision": "1c9223bdc6f2966be0e5d4dc73c9404003eca5b4",
|
||||||
|
"url": "https://api.github.com/repos/mr-u0b0dy/crazy-coverage.nvim/tarball/refs/tags/v2.1.0",
|
||||||
|
"hash": "sha256-D9hbxvjTbpLv2fXwtKbzFiSgkUj3uNd3YowZ/GrEQjM="
|
||||||
|
},
|
||||||
"csharpls-extended-lsp-nvim": {
|
"csharpls-extended-lsp-nvim": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue