mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-03-07 17:26:00 +00:00
Compare commits
29 commits
09bd743ad6
...
1476d4c957
| Author | SHA1 | Date | |
|---|---|---|---|
|
1476d4c957 |
|||
|
1966bd2586 |
|||
|
c52a2641d2 |
|||
|
14cf7fc9b8 |
|||
|
a315c01ff0 |
|||
|
ba22aa662a |
|||
|
a81aa0f691 |
|||
|
26edb440af |
|||
|
325eae4a75 |
|||
|
|
0dc687c6b3 |
||
|
aff5214a94 |
|||
|
|
bd265fee7e |
||
|
4d0d1884a0 |
|||
|
|
98780ec92d |
||
|
|
7a2c7c2396 |
||
|
074fcde9b4 |
|||
|
|
8bdbbe33e8 |
||
|
d5824f2d8f |
|||
|
|
ef5cf386c1 |
||
|
|
544c2c99ea |
||
|
9da5d51740 |
|||
|
|
047e2fba12 |
||
|
|
92854bd0ea |
||
|
|
7db4da419e |
||
|
7ec2619375 |
|||
|
26a95cdd76 |
|||
|
ebcaf4e01e |
|||
|
|
a0de0646f6 |
||
|
|
8a7796d7e9 |
33 changed files with 701 additions and 308 deletions
|
|
@ -92,6 +92,7 @@ isMaximal: {
|
|||
ruby.enable = false;
|
||||
fsharp.enable = false;
|
||||
just.enable = false;
|
||||
make.enable = false;
|
||||
qml.enable = false;
|
||||
jinja.enable = false;
|
||||
tailwind.enable = false;
|
||||
|
|
@ -204,6 +205,7 @@ isMaximal: {
|
|||
smart-splits.enable = isMaximal;
|
||||
undotree.enable = isMaximal;
|
||||
nvim-biscuits.enable = isMaximal;
|
||||
grug-far-nvim.enable = isMaximal;
|
||||
|
||||
motion = {
|
||||
hop.enable = true;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,12 @@
|
|||
- The `setupOpts.mappings` options were also removed. Use the built-in Neovim
|
||||
settings (nvf's {option}`vim.keymaps`)
|
||||
|
||||
[Snoweuph](https://github.com/snoweuph)
|
||||
|
||||
- Fix `vim.assistant.codecompanion-nvim.setupOpts.display.diff.provider` to only
|
||||
allow valid options. `default` is no longer valid. `inline` and `split` are
|
||||
two new valid options.
|
||||
|
||||
## Changelog {#sec-release-0-9-changelog}
|
||||
|
||||
[taylrfnt](https://github.com/taylrfnt)
|
||||
|
|
@ -50,6 +56,10 @@
|
|||
treesitter grammars were changed to prefer `grammarPlugins` over
|
||||
`builtGrammars`.
|
||||
|
||||
[NotAShelf](https://github.com/notashelf):
|
||||
|
||||
- Lazyload noice.nvim and nvim-web-devicons on `DeferredUIEnter`
|
||||
|
||||
[jfeo](https://github.com/jfeo):
|
||||
|
||||
[ccc.nvim]: https://github.com/uga-rosa/ccc.nvim
|
||||
|
|
@ -166,10 +176,35 @@
|
|||
|
||||
- Added [`golangci-lint`](https://golangci-lint.run/) for more diagnostics.
|
||||
|
||||
- Added Makefile support via `languages.make`.
|
||||
|
||||
- Added Debugging support to `languages.php`.
|
||||
|
||||
- Added Formatting support to `languages.php` via
|
||||
[PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer).
|
||||
|
||||
- Didn't Add
|
||||
[`syntax-gaslighting`](https://github.com/NotAShelf/syntax-gaslighting.nvim),
|
||||
you're crazy.
|
||||
|
||||
[vagahbond](https://github.com/vagahbond): [codewindow.nvim]:
|
||||
https://github.com/gorbit99/codewindow.nvim
|
||||
|
||||
- Add [codewindow.nvim] plugin in `vim.assistant.codewindow` with `enable` and
|
||||
`setupOpts`
|
||||
|
||||
[irobot](https://github.com/irobot):
|
||||
|
||||
- Fix non-functional `vim.keymaps.*.noremap`. Now, setting it to false is
|
||||
equivalent to `:lua vim.keymap.set(..., { remap = true })`
|
||||
|
||||
[kazimazi](https://github.com/kazimazi):
|
||||
|
||||
- Added [`grug-far.nvim`](https://github.com/MagicDuck/grug-far.nvim) the find
|
||||
and replace tool for neovim.
|
||||
|
||||
[Ladas552](https://github.com/Ladas552)
|
||||
|
||||
- Changed `withRuby` to not be enabled by default
|
||||
|
||||
<!-- vim: set textwidth=80: -->
|
||||
|
|
|
|||
18
flake.lock
generated
18
flake.lock
generated
|
|
@ -23,11 +23,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1768135262,
|
||||
"narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=",
|
||||
"lastModified": 1769996383,
|
||||
"narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac",
|
||||
"rev": "57928607ea566b5db3ad13af0e57e921e6b12381",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -38,11 +38,11 @@
|
|||
},
|
||||
"mnw": {
|
||||
"locked": {
|
||||
"lastModified": 1768701608,
|
||||
"narHash": "sha256-kSvWF3Xt2HW9hmV5V7i8PqeWJIBUKmuKoHhOgj3Znzs=",
|
||||
"lastModified": 1770419553,
|
||||
"narHash": "sha256-b1XqsH7AtVf2dXmq2iyRr2NC1yG7skY7Z6N2MpWHlK4=",
|
||||
"owner": "Gerg-L",
|
||||
"repo": "mnw",
|
||||
"rev": "20d63a8a1ae400557c770052a46a9840e768926b",
|
||||
"rev": "2aaffa8030d0b262176146adbb6b0e6374ce2957",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -74,11 +74,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1769461804,
|
||||
"narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=",
|
||||
"lastModified": 1771008912,
|
||||
"narHash": "sha256-gf2AmWVTs8lEq7z/3ZAsgnZDhWIckkb+ZnAo5RzSxJg=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "bfc1b8a4574108ceef22f02bafcf6611380c100d",
|
||||
"rev": "a82ccc39b39b621151d6732718e3e250109076fa",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -3,17 +3,18 @@
|
|||
stdenv,
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
rust-jemalloc-sys,
|
||||
writeShellScriptBin,
|
||||
}:
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "blink-cmp";
|
||||
version = "1.8.0";
|
||||
version = "1.9.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Saghen";
|
||||
repo = "blink.cmp";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-JjlcPj7v9J+v1SDBYIub6jFEslLhZGHmsipV1atUAFo=";
|
||||
hash = "sha256-GgodXdWpQoF2z1g1/WvnSpfuhskw0aMcOoyZM5l66q8=";
|
||||
};
|
||||
|
||||
forceShare = [
|
||||
|
|
@ -31,6 +32,16 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||
mv "$out/lib" "$out/target/release"
|
||||
'';
|
||||
|
||||
# From the blink.cmp flake
|
||||
buildInputs = lib.optionals stdenv.hostPlatform.isAarch64 [rust-jemalloc-sys];
|
||||
|
||||
# NOTE: The only change in frizbee 0.7.0 was nixpkgs incompatible rust semantic changes
|
||||
# Patch just reverts https://github.com/saghen/blink.cmp/commit/cc824ec85b789a54d05241389993c6ab8c040810
|
||||
# Taken from Nixpkgs' blink.cmp derivation, available under the MIT license
|
||||
cargoPatches = [
|
||||
./patches/0001-pin-frizbee.patch
|
||||
];
|
||||
|
||||
cargoHash = "sha256-Qdt8O7IGj2HySb1jxsv3m33ZxJg96Ckw26oTEEyQjfs=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
|
|
|||
29
flake/pkgs/by-name/blink-cmp/patches/0001-pin-frizbee.patch
Normal file
29
flake/pkgs/by-name/blink-cmp/patches/0001-pin-frizbee.patch
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
diff --git a/Cargo.lock b/Cargo.lock
|
||||
index 35bb10e..71c79eb 100644
|
||||
--- a/Cargo.lock
|
||||
+++ b/Cargo.lock
|
||||
@@ -144,9 +144,9 @@ checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
|
||||
|
||||
[[package]]
|
||||
name = "frizbee"
|
||||
-version = "0.7.0"
|
||||
+version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
-checksum = "4d024031f1a5bc5f19917baa0b618f1067610e35ba23e9f105653fcb27e74f5c"
|
||||
+checksum = "c3365720de81dac18e889afa72f5907aa061c975548da68e2400c056ebc94aec"
|
||||
dependencies = [
|
||||
"multiversion",
|
||||
"rayon",
|
||||
diff --git a/Cargo.toml b/Cargo.toml
|
||||
index 392d1bb..c776c7d 100644
|
||||
--- a/Cargo.toml
|
||||
+++ b/Cargo.toml
|
||||
@@ -9,7 +9,7 @@ crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
regex = "1.11.2"
|
||||
-frizbee = "0.7.0"
|
||||
+frizbee = "0.6.0"
|
||||
mlua = { version = "0.11.3", features = ["module", "luajit"] }
|
||||
thiserror = "2.0.16"
|
||||
blake3 = "1.8.2"
|
||||
|
|
@ -3,6 +3,8 @@
|
|||
fetchFromGitHub,
|
||||
nodejs,
|
||||
pnpm_9,
|
||||
pnpmConfigHook,
|
||||
fetchPnpmDeps,
|
||||
pins,
|
||||
}: let
|
||||
pin = pins.prettier-plugin-astro;
|
||||
|
|
@ -17,7 +19,8 @@ in
|
|||
sha256 = pin.hash;
|
||||
};
|
||||
|
||||
pnpmDeps = pnpm_9.fetchDeps {
|
||||
pnpmDeps = fetchPnpmDeps {
|
||||
pnpm = pnpm_9;
|
||||
inherit (finalAttrs) pname src;
|
||||
fetcherVersion = 2;
|
||||
hash = "sha256-K7pIWLkIIbUKDIcysfEtcf/eVMX9ZgyFHdqcuycHCNE=";
|
||||
|
|
@ -25,7 +28,9 @@ in
|
|||
|
||||
nativeBuildInputs = [
|
||||
nodejs
|
||||
pnpm_9.configHook
|
||||
(pnpmConfigHook.overrideAttrs {
|
||||
propagatedBuildInputs = [pnpm_9];
|
||||
})
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
# such as spellchecking, mappings, and the init script (init.vim).
|
||||
neovim = map (p: ./neovim + "/${p}") [
|
||||
"init"
|
||||
"mappings"
|
||||
];
|
||||
|
||||
# Individual plugin modules, separated by the type of plugin.
|
||||
|
|
|
|||
|
|
@ -5,8 +5,10 @@
|
|||
./clipboard.nix
|
||||
./debug.nix
|
||||
./diagnostics.nix
|
||||
./filetype.nix
|
||||
./highlight.nix
|
||||
./lsp.nix
|
||||
./mappings.nix
|
||||
./spellcheck.nix
|
||||
./util.nix
|
||||
];
|
||||
|
|
|
|||
123
modules/neovim/init/filetype.nix
Normal file
123
modules/neovim/init/filetype.nix
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkOption;
|
||||
inherit (lib.types) nullOr either oneOf attrsOf str listOf submodule ints;
|
||||
inherit (lib.nvim.types) luaInline;
|
||||
inherit (lib.nvim.dag) entryBefore;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim;
|
||||
|
||||
# vim.filetype.add() is quite robust, but this makes for a very
|
||||
# complex type that we have to handle. It takes a string, a Lua function
|
||||
# or a dictionary with the priority of the extension.
|
||||
ftOptionType = attrsOf (oneOf [
|
||||
str # "filetype"
|
||||
luaInline # `function(path, bufnr) ... end`
|
||||
|
||||
# { 'dosini', { priority = 10 } },
|
||||
(listOf (either (either str luaInline) (submodule (submodule {
|
||||
options = {
|
||||
priority = mkOption {
|
||||
type = ints.unsigned;
|
||||
description = ''
|
||||
`vim.filetype.add()` can take an optional priority value to resolve
|
||||
conflicts where a filetype is registered by multiple patterns. When
|
||||
priority is specified, file with the higher priority value will be
|
||||
matched first on conflict.
|
||||
'';
|
||||
};
|
||||
};
|
||||
}))))
|
||||
]);
|
||||
in {
|
||||
options.vim.filetype = mkOption {
|
||||
type = submodule {
|
||||
options = {
|
||||
extension = mkOption {
|
||||
type = nullOr ftOptionType;
|
||||
default = null;
|
||||
description = "register a new filetype by extension";
|
||||
};
|
||||
|
||||
filename = mkOption {
|
||||
type = nullOr ftOptionType;
|
||||
default = null;
|
||||
description = "register a new filetype by file name";
|
||||
};
|
||||
|
||||
pattern = mkOption {
|
||||
type = nullOr ftOptionType;
|
||||
default = null;
|
||||
description = "register a new filetype by pattern";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
default = {};
|
||||
example = {
|
||||
filename = {
|
||||
".foorc" = "toml";
|
||||
"/etc/foo/config" = "toml";
|
||||
"todo.txt" = "todotxt";
|
||||
};
|
||||
|
||||
pattern = {
|
||||
".*%.scm" = "query";
|
||||
".*README.(%a+)" = ''
|
||||
function(path, bufnr, ext)
|
||||
if ext == 'md' then
|
||||
return 'markdown'
|
||||
elseif ext == 'rst' then
|
||||
return 'rst'
|
||||
end
|
||||
end,
|
||||
'';
|
||||
};
|
||||
|
||||
extension = {
|
||||
mdx = "markdown";
|
||||
bar = lib.generators.mkLuaInline ''
|
||||
{
|
||||
bar = function(path, bufnr)
|
||||
if some_condition() then
|
||||
return 'barscript', function(bufnr)
|
||||
-- Set a buffer variable
|
||||
vim.b[bufnr].barscript_version = 2
|
||||
end
|
||||
end
|
||||
return 'bar'
|
||||
end,
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
description = ''
|
||||
Additional filetypes to be registered through `vim.filetype.add()`
|
||||
|
||||
Filetype mappings can be added either by extension or by filename. The
|
||||
key can be either the "tail" or the full file path. The full file path
|
||||
is checked first, followed by the file name. If a match is not found
|
||||
using the filename, then the filename is matched against the list of
|
||||
Lua patterns (sorted by priority) until a match is found.
|
||||
|
||||
If a pattern matching does not find a filetype, then the file extension
|
||||
is used.
|
||||
|
||||
See `:h vim.filetype.add()` for more details.
|
||||
'';
|
||||
};
|
||||
|
||||
config = {
|
||||
# XXX: some plugins can be loaded on filetype, and unless the filetypes
|
||||
# are registered first, chances are custom filetypes will not be usable
|
||||
# for lazy-loading on ft.
|
||||
vim.luaConfigRC.filetype = entryBefore ["lazyConfigs"] ''
|
||||
vim.filetype.add(${toLuaObject cfg.filetype})
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -1,19 +1,31 @@
|
|||
{lib, ...}: let
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkMerge;
|
||||
inherit (lib.options) mkOption literalMD;
|
||||
inherit (lib.types) either str listOf attrsOf nullOr submodule;
|
||||
inherit (lib.attrsets) mapAttrsToList;
|
||||
inherit (lib.lists) flatten;
|
||||
inherit (lib.trivial) pipe;
|
||||
inherit (lib.nvim.config) mkBool;
|
||||
|
||||
mapConfigOptions = {
|
||||
desc = mkOption {
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "A description of this keybind, to be shown in which-key, if you have it enabled.";
|
||||
description = ''
|
||||
Description for the keybind, to be shown in which-key, if you have enabled
|
||||
in the module system.
|
||||
'';
|
||||
};
|
||||
|
||||
action = mkOption {
|
||||
type = str;
|
||||
description = "The command to execute.";
|
||||
};
|
||||
|
||||
lua = mkBool false ''
|
||||
If true, `action` is considered to be lua code.
|
||||
Thus, it will not be wrapped in `""`.
|
||||
|
|
@ -55,6 +67,22 @@
|
|||
});
|
||||
default = {};
|
||||
};
|
||||
|
||||
legacyMapModes = {
|
||||
normal = ["n"];
|
||||
insert = ["i"];
|
||||
select = ["s"];
|
||||
visual = ["v"];
|
||||
terminal = ["t"];
|
||||
normalVisualOp = ["n" "v" "o"];
|
||||
visualOnly = ["n" "x"];
|
||||
operator = ["o"];
|
||||
insertCommand = ["i" "c"];
|
||||
lang = ["l"];
|
||||
command = ["c"];
|
||||
};
|
||||
|
||||
cfg = config.vim;
|
||||
in {
|
||||
options.vim = {
|
||||
keymaps = mkOption {
|
||||
|
|
@ -94,4 +122,27 @@ in {
|
|||
command = legacyMapOption "command-line";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
vim.keymaps = mkMerge [
|
||||
(
|
||||
pipe cfg.maps
|
||||
[
|
||||
(mapAttrsToList (
|
||||
oldMode: keybinds:
|
||||
mapAttrsToList (
|
||||
key: bind:
|
||||
bind
|
||||
// {
|
||||
inherit key;
|
||||
mode = legacyMapModes.${oldMode};
|
||||
}
|
||||
)
|
||||
keybinds
|
||||
))
|
||||
flatten
|
||||
]
|
||||
)
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -3,11 +3,6 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkMerge;
|
||||
inherit (lib.trivial) pipe;
|
||||
inherit (lib.attrsets) mapAttrsToList;
|
||||
inherit (lib.lists) flatten;
|
||||
|
||||
legacyMapModes = {
|
||||
normal = ["n"];
|
||||
insert = ["i"];
|
||||
|
|
@ -24,26 +19,4 @@
|
|||
|
||||
cfg = config.vim;
|
||||
in {
|
||||
config = {
|
||||
vim.keymaps = mkMerge [
|
||||
(
|
||||
pipe cfg.maps
|
||||
[
|
||||
(mapAttrsToList (
|
||||
oldMode: keybinds:
|
||||
mapAttrsToList (
|
||||
key: bind:
|
||||
bind
|
||||
// {
|
||||
inherit key;
|
||||
mode = legacyMapModes.${oldMode};
|
||||
}
|
||||
)
|
||||
keybinds
|
||||
))
|
||||
flatten
|
||||
]
|
||||
)
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@ in {
|
|||
};
|
||||
|
||||
provider = mkOption {
|
||||
type = enum ["default" "mini_diff"];
|
||||
default = "default";
|
||||
type = enum ["inline" "split" "mini_diff"];
|
||||
default = "inline";
|
||||
description = "The preferred kind of provider.";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ in {
|
|||
./yaml.nix
|
||||
./ruby.nix
|
||||
./just.nix
|
||||
./make.nix
|
||||
./xml.nix
|
||||
|
||||
# This is now a hard deprecation.
|
||||
|
|
|
|||
93
modules/plugins/languages/make.nix
Normal file
93
modules/plugins/languages/make.nix
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) listOf enum;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.make;
|
||||
|
||||
defaultFormat = ["bake"];
|
||||
formats = {
|
||||
bake = {
|
||||
command = "${pkgs.mbake}/bin/mbake";
|
||||
};
|
||||
};
|
||||
|
||||
defaultDiagnosticsProvider = ["checkmake"];
|
||||
diagnosticsProviders = {
|
||||
checkmake = {
|
||||
config = {
|
||||
cmd = getExe pkgs.checkmake;
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.make = {
|
||||
enable = mkEnableOption "Make support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Make treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "make";
|
||||
};
|
||||
|
||||
format = {
|
||||
enable = mkEnableOption "Make formatting" // {default = config.vim.languages.enableFormat;};
|
||||
type = mkOption {
|
||||
description = "make formatter to use";
|
||||
type = listOf (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
enable = mkEnableOption "extra Make diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
||||
types = diagnostics {
|
||||
langDesc = "Make";
|
||||
inherit diagnosticsProviders;
|
||||
inherit defaultDiagnosticsProvider;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter = {
|
||||
enable = true;
|
||||
grammars = [cfg.treesitter.package];
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
formatters_by_ft.make = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.diagnostics.nvim-lint = {
|
||||
enable = true;
|
||||
linters_by_ft.make = cfg.extraDiagnostics.types;
|
||||
linters =
|
||||
mkMerge (map (name: {${name} = diagnosticsProviders.${name}.config;})
|
||||
cfg.extraDiagnostics.types);
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
@ -4,11 +4,12 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (builtins) attrNames toString;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.types) enum int attrs listOf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
|
|
@ -64,6 +65,21 @@
|
|||
root_markers = ["composer.json" ".git"];
|
||||
};
|
||||
};
|
||||
|
||||
defaultFormat = ["php_cs_fixer"];
|
||||
formats = {
|
||||
php_cs_fixer = {
|
||||
/*
|
||||
Using 8.4 instead of 8.5 because of compatibility:
|
||||
```logs
|
||||
2026-02-08 00:42:23[ERROR] Formatter 'php_cs_fixer' error: PHP CS Fixer 3.87.2
|
||||
PHP runtime: 8.5.2
|
||||
PHP CS Fixer currently supports PHP syntax only up to PHP 8.4, current PHP version: 8.5.2.
|
||||
```
|
||||
*/
|
||||
command = "${pkgs.php84Packages.php-cs-fixer}/bin/php-cs-fixer";
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.php = {
|
||||
enable = mkEnableOption "PHP language support";
|
||||
|
|
@ -82,6 +98,38 @@ in {
|
|||
description = "PHP LSP server to use";
|
||||
};
|
||||
};
|
||||
|
||||
format = {
|
||||
enable = mkEnableOption "PHP formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
description = "PHP formatter to use";
|
||||
type = listOf (enum (attrNames formats));
|
||||
default = defaultFormat;
|
||||
};
|
||||
};
|
||||
|
||||
dap = {
|
||||
enable = mkEnableOption "Enable PHP Debug Adapter" // {default = config.vim.languages.enableDAP;};
|
||||
xdebug = {
|
||||
adapter = mkOption {
|
||||
type = attrs;
|
||||
default = {
|
||||
type = "executable";
|
||||
command = "${pkgs.nodePackages_latest.nodejs}/bin/node";
|
||||
args = [
|
||||
"${pkgs.vscode-extensions.xdebug.php-debug}/share/vscode/extensions/xdebug.php-debug/out/phpDebug.js"
|
||||
];
|
||||
};
|
||||
description = "XDebug adapter to use for nvim-dap";
|
||||
};
|
||||
port = mkOption {
|
||||
type = int;
|
||||
default = 9003;
|
||||
description = "Port to use for XDebug";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
|
|
@ -98,5 +146,39 @@ in {
|
|||
})
|
||||
cfg.lsp.servers;
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
formatters_by_ft.php = cfg.format.type;
|
||||
formatters =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = formats.${name};
|
||||
})
|
||||
cfg.format.type;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.dap.enable {
|
||||
vim = {
|
||||
debugger.nvim-dap = {
|
||||
enable = true;
|
||||
sources.php-debugger = ''
|
||||
dap.adapters.xdebug = ${toLuaObject cfg.dap.xdebug.adapter}
|
||||
dap.configurations.php = {
|
||||
{
|
||||
type = 'xdebug',
|
||||
request = 'launch',
|
||||
name = 'Listen for XDebug',
|
||||
port = ${toString cfg.dap.xdebug.port},
|
||||
},
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.lists) optionals;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.ui.noice;
|
||||
tscfg = config.vim.treesitter;
|
||||
|
|
@ -16,16 +14,15 @@
|
|||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"noice-nvim"
|
||||
"nui-nvim"
|
||||
];
|
||||
|
||||
startPlugins = ["nui-nvim"];
|
||||
treesitter.grammars = optionals tscfg.addDefaultGrammars defaultGrammars;
|
||||
|
||||
pluginRC.noice-nvim = entryAnywhere ''
|
||||
require("noice").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
lazy.plugins.noice-nvim = {
|
||||
package = "noice-nvim";
|
||||
setupModule = "noice";
|
||||
event = ["DeferredUIEnter"];
|
||||
inherit (cfg) setupOpts;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
./harpoon
|
||||
./icon-picker
|
||||
./images
|
||||
./grug-far-nvim
|
||||
./leetcode-nvim
|
||||
./mkdir
|
||||
./motion
|
||||
|
|
|
|||
21
modules/plugins/utility/grug-far-nvim/config.nix
Normal file
21
modules/plugins/utility/grug-far-nvim/config.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
|
||||
cfg = config.vim.utility.grug-far-nvim;
|
||||
in {
|
||||
config = {
|
||||
vim.lazy.plugins.grug-far-nvim = mkIf cfg.enable {
|
||||
package = "grug-far-nvim";
|
||||
cmd = [
|
||||
"GrugFar"
|
||||
"GrugFarWithin"
|
||||
];
|
||||
setupModule = "grug-far";
|
||||
setupOpts = cfg.setupOpts;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./grug-far-nvim.nix
|
||||
./config.nix
|
||||
./options.nix
|
||||
];
|
||||
}
|
||||
9
modules/plugins/utility/grug-far-nvim/grug-far-nvim.nix
Normal file
9
modules/plugins/utility/grug-far-nvim/grug-far-nvim.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
options.vim.utility.grug-far-nvim = {
|
||||
enable = mkEnableOption "grug-far";
|
||||
setupOpts = mkPluginSetupOption "grug-far" {};
|
||||
};
|
||||
}
|
||||
|
|
@ -18,5 +18,6 @@ in {
|
|||
./nvim-web-devicons
|
||||
./rainbow-delimiters
|
||||
./tiny-devicons-auto-colors
|
||||
./syntax-gaslighting
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,18 +4,17 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.visuals.nvim-web-devicons;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["nvim-web-devicons"];
|
||||
|
||||
pluginRC.nvim-web-devicons = entryAnywhere ''
|
||||
require("nvim-web-devicons").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
lazy.plugins.nvim-web-devicons = {
|
||||
package = "nvim-web-devicons";
|
||||
setupModule = "nvim-web-devicons";
|
||||
event = ["DeferredUIEnter"];
|
||||
inherit (cfg) setupOpts;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.modules) mkRenamedOptionModule;
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) nullOr attrsOf attrs enum;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
|
|
@ -16,27 +16,27 @@ in {
|
|||
variant = mkOption {
|
||||
type = nullOr (enum ["light" "dark"]);
|
||||
default = null;
|
||||
description = "Set the light or dark variant manually, instead of relying on `background`";
|
||||
description = ''
|
||||
Set the light or dark variant manually, instead of relying on `background`
|
||||
'';
|
||||
};
|
||||
|
||||
override = mkOption {
|
||||
type = attrsOf attrs;
|
||||
default = {};
|
||||
example = literalExpression ''
|
||||
{
|
||||
zsh = {
|
||||
name = "Zsh";
|
||||
icon = "";
|
||||
color = "#428850";
|
||||
cterm_color = "65";
|
||||
};
|
||||
}
|
||||
'';
|
||||
example = {
|
||||
zsh = {
|
||||
name = "Zsh";
|
||||
icon = "";
|
||||
color = "#428850";
|
||||
cterm_color = "65";
|
||||
};
|
||||
};
|
||||
description = ''
|
||||
Your personal icon overrides.
|
||||
|
||||
You can specify color or cterm_color instead of specifying
|
||||
both of them. DevIcon will be appended to `name`
|
||||
You can specify color or `cterm_color` instead of specifying both of
|
||||
them. `DevIcon` will be appended to `name`
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
|||
20
modules/plugins/visuals/syntax-gaslighting/config.nix
Normal file
20
modules/plugins/visuals/syntax-gaslighting/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.visuals.syntax-gaslighting;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["syntax-gaslighting"];
|
||||
pluginRC.colorful-menu-nvim = entryAnywhere ''
|
||||
require("syntax-gaslighting").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
6
modules/plugins/visuals/syntax-gaslighting/default.nix
Normal file
6
modules/plugins/visuals/syntax-gaslighting/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./syntax-gaslighting.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) str nullOr listOf bool;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
options.vim.visuals = {
|
||||
syntax-gaslighting = {
|
||||
enable = mkEnableOption "Thats no even a real option, you're crazy.";
|
||||
|
||||
setupOpts = mkPluginSetupOption "syntax-gaslighting" {
|
||||
messages = mkOption {
|
||||
type = nullOr (listOf str);
|
||||
default = null;
|
||||
description = "Custom messages for gaslighting.";
|
||||
};
|
||||
|
||||
merge_messages = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Merge user messages with the default ones.
|
||||
If disabled, the messages table will override default messages.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
inherit (lib.trivial) flip;
|
||||
inherit (builtins) filter isString hasAttr getAttr;
|
||||
|
||||
getPin = flip getAttr (pkgs.callPackages ../../../npins/sources.nix {});
|
||||
getPin = flip getAttr (inputs.mnw.lib.npinsToPluginsAttrs pkgs ../../../npins/sources.json);
|
||||
|
||||
# Build a Vim plugin with the given name and arguments.
|
||||
buildPlug = attrs: let
|
||||
|
|
|
|||
|
|
@ -106,16 +106,9 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
# This defaults to `true` in the wrapper
|
||||
# and since we pass this value to the wrapper
|
||||
# with an inherit, it should be `true` here as well
|
||||
withRuby =
|
||||
mkEnableOption ''
|
||||
Ruby support in the Neovim wrapper.
|
||||
''
|
||||
// {
|
||||
default = true;
|
||||
};
|
||||
withRuby = mkEnableOption ''
|
||||
Ruby support in the Neovim wrapper
|
||||
'';
|
||||
|
||||
withNodeJs = mkEnableOption ''
|
||||
NodeJS support in the Neovim wrapper
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ in {
|
|||
|
||||
getOpts = keymap: {
|
||||
inherit (keymap) desc silent nowait script expr unique noremap;
|
||||
remap = !keymap.noremap;
|
||||
};
|
||||
|
||||
toLuaKeymap = bind: "vim.keymap.set(${toLuaObject bind.mode}, ${toLuaObject bind.key}, ${toLuaObject (getAction bind)}, ${toLuaObject (getOpts bind)})";
|
||||
|
|
|
|||
|
|
@ -643,6 +643,19 @@
|
|||
"url": "https://github.com/ellisonleao/glow.nvim/archive/5d5954b2f22e109d4a6eba8b2618c5b96e4ee7a2.tar.gz",
|
||||
"hash": "sha256-CvBcmVWBgI+m+PS7p7PmsiPtTEfqx2kpIzz4mImONIc="
|
||||
},
|
||||
"grug-far-nvim": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "MagicDuck",
|
||||
"repo": "grug-far.nvim"
|
||||
},
|
||||
"branch": "main",
|
||||
"submodules": false,
|
||||
"revision": "275dbedc96e61a6b8d1dfb28ba51586ddd233dcf",
|
||||
"url": "https://github.com/MagicDuck/grug-far.nvim/archive/275dbedc96e61a6b8d1dfb28ba51586ddd233dcf.tar.gz",
|
||||
"hash": "sha256-qn1BTNCX0Sm158Lv5JfHThqlJX9ualCIlc+RCjWa+t8="
|
||||
},
|
||||
"gruvbox": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
|
|
@ -2116,9 +2129,9 @@
|
|||
},
|
||||
"branch": "master",
|
||||
"submodules": false,
|
||||
"revision": "b8221e42cf7287c4dcde81f232f58d7b947c210d",
|
||||
"url": "https://github.com/nvim-tree/nvim-web-devicons/archive/b8221e42cf7287c4dcde81f232f58d7b947c210d.tar.gz",
|
||||
"hash": "sha256-lVrakFrpIP9lp7sMfMb33KeMPIkcn1qBFVytJzKCfuE="
|
||||
"revision": "746ffbb17975ebd6c40142362eee1b0249969c5c",
|
||||
"url": "https://github.com/nvim-tree/nvim-web-devicons/archive/746ffbb17975ebd6c40142362eee1b0249969c5c.tar.gz",
|
||||
"hash": "sha256-jXWBPcfLwSkWQ/eRbxVDWC7kFOODSsCRmzC3rHKQLhQ="
|
||||
},
|
||||
"obsidian-nvim": {
|
||||
"type": "GitRelease",
|
||||
|
|
@ -2528,6 +2541,19 @@
|
|||
"url": "https://github.com/supermaven-inc/supermaven-nvim/archive/07d20fce48a5629686aefb0a7cd4b25e33947d50.tar.gz",
|
||||
"hash": "sha256-1z3WKIiikQqoweReUyK5O8MWSRN5y95qcxM6qzlKMME="
|
||||
},
|
||||
"syntax-gaslighting": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "NotAShelf",
|
||||
"repo": "syntax-gaslighting.nvim"
|
||||
},
|
||||
"branch": "main",
|
||||
"submodules": false,
|
||||
"revision": "4cee4c0550e82b31e07424e0c44379920d716d79",
|
||||
"url": "https://github.com/NotAShelf/syntax-gaslighting.nvim/archive/4cee4c0550e82b31e07424e0c44379920d716d79.tar.gz",
|
||||
"hash": "sha256-sRg6UlK4hQubxf3ycGnMLi+tNvX3zvKgnHYVuZgmvOc="
|
||||
},
|
||||
"tabular": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
|
|
|
|||
|
|
@ -1,115 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
fetchurl,
|
||||
fetchgit,
|
||||
fetchzip,
|
||||
}:
|
||||
builtins.mapAttrs
|
||||
(
|
||||
name: spec: let
|
||||
mayOverride = name: path: let
|
||||
envVarName = "NPINS_OVERRIDE_${saneName}";
|
||||
saneName = builtins.concatStringsSep "_" (
|
||||
builtins.concatLists (
|
||||
builtins.filter (x: builtins.isList x && x != [""]) (builtins.split "([a-zA-Z0-9]*)" name)
|
||||
)
|
||||
);
|
||||
ersatz = builtins.getEnv envVarName;
|
||||
in
|
||||
if ersatz == ""
|
||||
then path
|
||||
else
|
||||
# this turns the string into an actual Nix path (for both absolute and
|
||||
# relative paths)
|
||||
builtins.trace "Overriding path of \"${name}\" with \"${ersatz}\" due to set \"${envVarName}\"" (
|
||||
if builtins.substring 0 1 ersatz == "/"
|
||||
then /. + ersatz
|
||||
else /. + builtins.getEnv "PWD" + "/${ersatz}"
|
||||
);
|
||||
|
||||
path =
|
||||
rec {
|
||||
GitRelease = Git;
|
||||
Channel = Tarball;
|
||||
|
||||
Git =
|
||||
if spec.url != null && !spec.submodules
|
||||
then Tarball
|
||||
else
|
||||
fetchgit (
|
||||
let
|
||||
repo = spec.repository;
|
||||
url =
|
||||
{
|
||||
Git = repo.url;
|
||||
GitHub = "https://github.com/${repo.owner}/${repo.repo}.git";
|
||||
GitLab = "${repo.server}/${repo.repo_path}.git";
|
||||
Forgejo = "${repo.server}/${repo.owner}/${repo.repo}.git";
|
||||
}
|
||||
.${
|
||||
repo.type
|
||||
} or (throw "Unrecognized repository type ${repo.type}");
|
||||
in {
|
||||
name = let
|
||||
matched = builtins.match "^.*/([^/]*)(\\.git)?$" url;
|
||||
appendShort =
|
||||
if (builtins.match "[a-f0-9]*" spec.revision) != null
|
||||
then "-${builtins.substring 0 7 spec.revision}"
|
||||
else "";
|
||||
in "${
|
||||
if matched == null
|
||||
then "source"
|
||||
else builtins.head matched
|
||||
}${appendShort}";
|
||||
inherit url;
|
||||
|
||||
rev = spec.revision;
|
||||
inherit (spec) hash;
|
||||
fetchSubmodules = spec.submodules;
|
||||
}
|
||||
);
|
||||
|
||||
PyPi = fetchurl {
|
||||
inherit (spec) url hash;
|
||||
};
|
||||
|
||||
Tarball = fetchzip {
|
||||
inherit (spec) url hash;
|
||||
extension = "tar";
|
||||
};
|
||||
}
|
||||
.${
|
||||
spec.type
|
||||
} or (builtins.throw "Unknown source type ${spec.type}");
|
||||
|
||||
version =
|
||||
if spec ? revision
|
||||
then builtins.substring 0 8 spec.revision
|
||||
else "0";
|
||||
in
|
||||
spec
|
||||
// {
|
||||
name = "${name}-${version}";
|
||||
pname = name;
|
||||
inherit version;
|
||||
outPath =
|
||||
(
|
||||
# Override logic won't do anything if we're in pure eval
|
||||
if builtins ? currentSystem
|
||||
then mayOverride name path
|
||||
else path
|
||||
).overrideAttrs
|
||||
{
|
||||
pname = name;
|
||||
name = "${name}-${version}";
|
||||
inherit version;
|
||||
};
|
||||
}
|
||||
)
|
||||
(
|
||||
let
|
||||
json = lib.importJSON ./sources.json;
|
||||
in
|
||||
assert lib.assertMsg (json.version == 7) "Unsupported format version ${toString json.version} in sources.json. Try running `npins upgrade`";
|
||||
json.pins
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue