mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
Merge branch 'main' into clipboard-module
This commit is contained in:
commit
89f1c02f04
7 changed files with 98 additions and 0 deletions
|
@ -130,6 +130,18 @@ in {
|
|||
};
|
||||
};
|
||||
};
|
||||
markview-nvim = {
|
||||
enable =
|
||||
mkEnableOption ""
|
||||
// {
|
||||
description = ''
|
||||
[markview.nvim]: https://github.com/OXY2DEV/markview.nvim
|
||||
|
||||
[markview.nvim] - a hackable markdown, Typst, latex, html(inline) & YAML previewer
|
||||
'';
|
||||
};
|
||||
setupOpts = mkPluginSetupOption "markview-nvim" {};
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
|
@ -175,6 +187,13 @@ in {
|
|||
'';
|
||||
})
|
||||
|
||||
(mkIf cfg.extensions.markview-nvim.enable {
|
||||
vim.startPlugins = ["markview-nvim"];
|
||||
vim.pluginRC.markview-nvim = entryAnywhere ''
|
||||
require("markview").setup(${toLuaObject cfg.extensions.markview-nvim.setupOpts})
|
||||
'';
|
||||
})
|
||||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.diagnostics.nvim-lint = {
|
||||
enable = true;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
imports = [
|
||||
# treesitter extras
|
||||
./ts-context
|
||||
./ts-textobjects
|
||||
|
||||
./treesitter.nix
|
||||
./config.nix
|
||||
|
|
23
modules/plugins/treesitter/ts-textobjects/config.nix
Normal file
23
modules/plugins/treesitter/ts-textobjects/config.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
|
||||
inherit (config.vim) treesitter;
|
||||
cfg = treesitter.textobjects;
|
||||
in {
|
||||
config = mkIf (treesitter.enable && cfg.enable) {
|
||||
vim = {
|
||||
startPlugins = ["nvim-treesitter-textobjects"];
|
||||
|
||||
# set up treesitter-textobjects after Treesitter, whose config we're adding to.
|
||||
pluginRC.treesitter-textobjects = entryAfter ["treesitter"] ''
|
||||
require("nvim-treesitter.configs").setup({textobjects = ${toLuaObject cfg.setupOpts}})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/treesitter/ts-textobjects/default.nix
Normal file
6
modules/plugins/treesitter/ts-textobjects/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./textobjects.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
21
modules/plugins/treesitter/ts-textobjects/textobjects.nix
Normal file
21
modules/plugins/treesitter/ts-textobjects/textobjects.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
options.vim.treesitter.textobjects = {
|
||||
enable = mkEnableOption "Treesitter textobjects";
|
||||
setupOpts =
|
||||
mkPluginSetupOption "treesitter-textobjects" {}
|
||||
// {
|
||||
example = {
|
||||
select = {
|
||||
enable = true;
|
||||
lookahead = true;
|
||||
keymaps = {
|
||||
af = "@function.outer";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue