mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-10 07:25:30 +00:00
Merge branch 'main' into feature-language-tex
This commit is contained in:
commit
d7a11ad990
16 changed files with 662 additions and 462 deletions
|
|
@ -10,6 +10,7 @@
|
|||
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
|
||||
[render-markdown.nvim]: https://github.com/MeanderingProgrammer/render-markdown.nvim
|
||||
[yanky.nvim]: https://github.com/gbprod/yanky.nvim
|
||||
[yazi.nvim]: https://github.com/mikavilpas/yazi.nvim
|
||||
|
||||
- Add [typst-preview.nvim] under
|
||||
`languages.typst.extensions.typst-preview-nvim`.
|
||||
|
|
@ -46,6 +47,11 @@
|
|||
|
||||
- Add [yanky.nvim] to available plugins, under `vim.utility.yanky-nvim`.
|
||||
|
||||
- Fix plugin `setupOpts` for yanky.nvim and assert if shada is configured as a
|
||||
backend while shada is disabled in Neovim options.
|
||||
|
||||
- Add [yazi.nvim] as a companion plugin for Yazi, the terminal file manager.
|
||||
|
||||
[amadaluzia](https://github.com/amadaluzia):
|
||||
|
||||
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
||||
|
|
@ -154,7 +160,6 @@
|
|||
Inspiration from `vim.languages.clang.dap` implementation.
|
||||
- Add [leetcode.nvim] plugin under `vim.utility.leetcode-nvim`.
|
||||
|
||||
|
||||
[nezia1](https://github.com/nezia1)
|
||||
|
||||
- Add support for [nixd](https://github.com/nix-community/nixd) language server.
|
||||
|
|
@ -165,10 +170,12 @@
|
|||
available plugins, under `vim.utility.multicursors`.
|
||||
- Add [hydra.nvim](https://github.com/nvimtools/hydra.nvim) as dependency for
|
||||
`multicursors.nvim` and lazy loads by default.
|
||||
[folospior](https://github.com/folospior)
|
||||
[folospior](https://github.com/folospior)
|
||||
|
||||
- Fix plugin name for lsp/lspkind.
|
||||
|
||||
- Move `vim-illuminate` to `setupOpts format`
|
||||
|
||||
[iynaix](https://github.com/iynaix)
|
||||
|
||||
- Add lsp options support for [nixd](https://github.com/nix-community/nixd)
|
||||
|
|
@ -180,5 +187,16 @@
|
|||
|
||||
[Libadoxon](https://github.com/Libadoxon)
|
||||
|
||||
- Add [git-conflict](https://github.com/akinsho/git-conflict.nvim) plugin for resolving git conflicts
|
||||
- Add formatters for go: [gofmt](https://go.dev/blog/gofmt), [golines](https://github.com/segmentio/golines) and [gofumpt](https://github.com/mvdan/gofumpt)
|
||||
- Add [git-conflict](https://github.com/akinsho/git-conflict.nvim) plugin for
|
||||
resolving git conflicts
|
||||
- Add formatters for go: [gofmt](https://go.dev/blog/gofmt),
|
||||
[golines](https://github.com/segmentio/golines) and
|
||||
[gofumpt](https://github.com/mvdan/gofumpt)
|
||||
|
||||
[MaxMur](https://github.com/TheMaxMur)
|
||||
|
||||
- Add YAML support under `vim.languages.yaml`.
|
||||
|
||||
[alfarel](https://github.com/alfarelcynthesis):
|
||||
|
||||
- Add missing `yazi.nvim` dependency (`snacks.nvim`).
|
||||
|
|
|
|||
26
flake.lock
generated
26
flake.lock
generated
|
|
@ -5,11 +5,11 @@
|
|||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1733312601,
|
||||
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
|
||||
"lastModified": 1738453229,
|
||||
"narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
|
||||
"rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -38,11 +38,11 @@
|
|||
},
|
||||
"mnw": {
|
||||
"locked": {
|
||||
"lastModified": 1735150973,
|
||||
"narHash": "sha256-OJhcCAoaMMXeD6o4qI/hxBCNELJp4dN8D5LJZc8w8XA=",
|
||||
"lastModified": 1738852285,
|
||||
"narHash": "sha256-8Y1uyE6gGHxdU0Vcx2CMg/dAmDSxJw19aAl3TKbbo54=",
|
||||
"owner": "Gerg-L",
|
||||
"repo": "mnw",
|
||||
"rev": "40cd0b006cc48dffd0f8698ad7f54cf1d56779a6",
|
||||
"rev": "6ae73dc9cb72cea17bcc2e3d4670825f483e80e8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -77,11 +77,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1737370608,
|
||||
"narHash": "sha256-hFA6SmioeqvGW/XvZa9bxniAeulksCOcj3kokdNT/YE=",
|
||||
"lastModified": 1740303746,
|
||||
"narHash": "sha256-XcdiWLEhjJkMxDLKQJ0CCivmYYCvA5MDxu9pMybM5kM=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "300081d0cc72df578b02d914df941b8ec62240e6",
|
||||
"rev": "2d068ae5c6516b2d04562de50a58c682540de9bf",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -93,14 +93,14 @@
|
|||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1733096140,
|
||||
"narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=",
|
||||
"lastModified": 1738452942,
|
||||
"narHash": "sha256-vJzFZGaCpnmo7I6i416HaBLpC+hvcURh/BQwROcGIp8=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz"
|
||||
}
|
||||
},
|
||||
"nmd": {
|
||||
|
|
|
|||
|
|
@ -37,12 +37,6 @@ in {
|
|||
description = "Default list of sources to enable for completion.";
|
||||
};
|
||||
|
||||
cmdline = mkOption {
|
||||
type = nullOr (listOf str);
|
||||
default = [];
|
||||
description = "List of sources to enable for cmdline. Null means use default source list.";
|
||||
};
|
||||
|
||||
providers = mkOption {
|
||||
type = attrsOf providerType;
|
||||
default = {};
|
||||
|
|
@ -63,6 +57,14 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
cmdline = {
|
||||
sources = mkOption {
|
||||
type = nullOr (listOf str);
|
||||
default = [];
|
||||
description = "List of sources to enable for cmdline. Null means use default source list.";
|
||||
};
|
||||
};
|
||||
|
||||
completion = {
|
||||
documentation = {
|
||||
auto_show = mkBool true "Show documentation whenever an item is selected";
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ in {
|
|||
./typst.nix
|
||||
./vala.nix
|
||||
./wgsl.nix
|
||||
./yaml.nix
|
||||
./zig.nix
|
||||
];
|
||||
|
||||
|
|
|
|||
72
modules/plugins/languages/yaml.nix
Normal file
72
modules/plugins/languages/yaml.nix
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.lists) isList;
|
||||
inherit (lib.types) enum either listOf package str;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
|
||||
cfg = config.vim.languages.yaml;
|
||||
|
||||
defaultServer = "yaml-language-server";
|
||||
servers = {
|
||||
yaml-language-server = {
|
||||
package = pkgs.nodePackages.yaml-language-server;
|
||||
lspConfig = ''
|
||||
lspconfig.yamlls.setup {
|
||||
capabilities = capabilities;
|
||||
on_attach = default_on_attach;
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/yaml-language-server", "--stdio"}''
|
||||
},
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.yaml = {
|
||||
enable = mkEnableOption "YAML language support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "YAML treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
|
||||
package = mkGrammarOption pkgs "yaml";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "YAML LSP support" // {default = config.vim.languages.enableLSP;};
|
||||
|
||||
server = mkOption {
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
description = "YAML LSP server to use";
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
description = "YAML LSP server package";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
vim.lsp.lspconfig.sources.yaml-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
@ -57,8 +57,8 @@ in {
|
|||
};
|
||||
|
||||
mappings = {
|
||||
viewToggle = mkMappingOption "Open or close the docs view panel" "lvt";
|
||||
viewUpdate = mkMappingOption "Manually update the docs view panel" "lvu";
|
||||
viewToggle = mkMappingOption "Open or close the docs view panel" "<leader>lvt";
|
||||
viewUpdate = mkMappingOption "Manually update the docs view panel" "<leader>lvu";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,22 +4,20 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.ui.illuminate;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = ["vim-illuminate"];
|
||||
vim = {
|
||||
startPlugins = ["vim-illuminate"];
|
||||
|
||||
vim.pluginRC.vim-illuminate = entryAnywhere ''
|
||||
require('illuminate').configure({
|
||||
filetypes_denylist = {
|
||||
'dirvish',
|
||||
'fugitive',
|
||||
'NvimTree',
|
||||
'TelescopePrompt',
|
||||
},
|
||||
})
|
||||
# vim-illuminate does not have a setup function. It is instead called 'configure'
|
||||
# and does what you expect from a setup function. Wild.
|
||||
pluginRC.vim-illuminate = entryAnywhere ''
|
||||
require('illuminate').configure(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,19 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) listOf str;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
options.vim.ui.illuminate = {
|
||||
enable = mkEnableOption "automatically highlight other uses of the word under the cursor [vim-illuminate]";
|
||||
enable = mkEnableOption ''
|
||||
automatically highlight other uses of the word under the cursor [vim-illuminate]
|
||||
'';
|
||||
|
||||
setupOpts = mkPluginSetupOption "vim-illuminate" {
|
||||
filetypes_denylist = mkOption {
|
||||
type = listOf str;
|
||||
default = ["dirvish" "fugitive" "NvimTree" "TelescopePrompt"];
|
||||
description = "Filetypes to not illuminate, this overrides `filetypes_allowlist`";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
./gestures
|
||||
./icon-picker
|
||||
./images
|
||||
./leetcode-nvim
|
||||
./motion
|
||||
./multicursors
|
||||
./new-file-template
|
||||
|
|
@ -16,6 +17,6 @@
|
|||
./telescope
|
||||
./wakatime
|
||||
./yanky-nvim
|
||||
./leetcode-nvim
|
||||
./yazi-nvim
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
cfg = config.vim.utility.yanky-nvim;
|
||||
usingSqlite = cfg.setupOpts.ring.storage == "sqlite";
|
||||
usingShada = cfg.setupOpts.ring.storage == "shada";
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
|
|
@ -28,5 +29,15 @@ in {
|
|||
require("yanky").setup(${toLuaObject cfg.setupOpts});
|
||||
'';
|
||||
};
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = usingShada && ((config.vim.options.shada or "") == "");
|
||||
message = ''
|
||||
Yanky.nvim is configured to use 'shada' for the storage backend, but shada is disabled
|
||||
in 'vim.options'. Please re-enable shada, or switch to a different backend.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
options.vim.utility.yanky-nvim = {
|
||||
enable = mkEnableOption ''
|
||||
improved Yank and Put functionalities for Neovim [yanky-nvim]
|
||||
'';
|
||||
|
||||
setupOpts = {
|
||||
setupOpts = mkPluginSetupOption "yanky-nvim" {
|
||||
ring.storage = mkOption {
|
||||
type = enum ["shada" "sqlite" "memory"];
|
||||
default = "shada";
|
||||
|
|
@ -15,11 +16,11 @@ in {
|
|||
description = ''
|
||||
storage mode for ring values.
|
||||
|
||||
- shada: this will save pesistantly using Neovim ShaDa feature.
|
||||
- **shada**: this will save pesistantly using Neovim ShaDa feature.
|
||||
This means that history will be persisted between each session of Neovim.
|
||||
- memory: each Neovim instance will have his own history and it will be
|
||||
- **memory**: each Neovim instance will have his own history and it will be
|
||||
lost between sessions.
|
||||
- sqlite: more reliable than `shada`, requires `sqlite.lua` as a dependency.
|
||||
- **sqlite**: more reliable than `shada`, requires `sqlite.lua` as a dependency.
|
||||
nvf will add this dependency to `PATH` automatically.
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
33
modules/plugins/utility/yazi-nvim/config.nix
Normal file
33
modules/plugins/utility/yazi-nvim/config.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
options,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.binds) mkKeymap;
|
||||
|
||||
cfg = config.vim.utility.yazi-nvim;
|
||||
keys = cfg.mappings;
|
||||
|
||||
inherit (options.vim.utility.yazi-nvim) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["snacks-nvim"];
|
||||
lazy.plugins."yazi.nvim" = {
|
||||
package = pkgs.vimPlugins.yazi-nvim;
|
||||
setupModule = "yazi";
|
||||
inherit (cfg) setupOpts;
|
||||
event = ["BufAdd" "VimEnter"];
|
||||
|
||||
keys = [
|
||||
(mkKeymap "n" keys.openYazi "<cmd>Yazi<CR>" {desc = mappings.openYazi.description;})
|
||||
(mkKeymap "n" keys.openYaziDir "<cmd>Yazi cwd<CR>" {desc = mappings.openYaziDir.description;})
|
||||
(mkKeymap "n" keys.yaziToggle "<cmd>Yazi toggle<CR>" {desc = mappings.yaziToggle.description;})
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
6
modules/plugins/utility/yazi-nvim/default.nix
Normal file
6
modules/plugins/utility/yazi-nvim/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./yazi-nvim.nix
|
||||
];
|
||||
}
|
||||
26
modules/plugins/utility/yazi-nvim/yazi-nvim.nix
Normal file
26
modules/plugins/utility/yazi-nvim/yazi-nvim.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) bool;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.utility.yazi-nvim = {
|
||||
enable = mkEnableOption ''
|
||||
companion plugin for the yazi terminal file manager [yazi-nvim]
|
||||
'';
|
||||
|
||||
mappings = {
|
||||
openYazi = mkMappingOption "Open yazi at the current file [yazi.nvim]" "<leader>-";
|
||||
openYaziDir = mkMappingOption "Open the file manager in nvim's working directory [yazi.nvim]" "<leader>cw";
|
||||
yaziToggle = mkMappingOption "Resume the last yazi session [yazi.nvim]" "<c-up>";
|
||||
};
|
||||
|
||||
setupOpts = mkPluginSetupOption "yazi-nvim" {
|
||||
open_for_directories = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Whether to open Yazi instead of netrw";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -172,7 +172,14 @@
|
|||
description = "Lazy-load on colorscheme.";
|
||||
};
|
||||
|
||||
lazy = mkBool false "Lazy-load manually, e.g. using `trigger_load`.";
|
||||
lazy = mkOption {
|
||||
type = nullOr bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Force enable/disable lazy-loading. `null` means only lazy-load if
|
||||
a valid lazy-load condition is set e.g. `cmd`, `ft`, `keys` etc.
|
||||
'';
|
||||
};
|
||||
|
||||
priority = mkOption {
|
||||
type = nullOr int;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue