mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-27 07:26:46 +00:00
created otter file
This commit is contained in:
parent
3275ab221a
commit
d61aba1e12
3 changed files with 31 additions and 11 deletions
|
@ -3,17 +3,26 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding;
|
||||||
|
|
||||||
cfg = config.vim.lsp;
|
cfg = config.vim.lsp;
|
||||||
|
|
||||||
|
self = import ./otter.nix {inherit lib;};
|
||||||
|
mappingDefinitions = self.options.vim.lsp.otter.mappings;
|
||||||
|
mappings = addDescriptionsToMappings cfg.otter.mappings mappingDefinitions;
|
||||||
in {
|
in {
|
||||||
config = mkIf (cfg.enable && cfg.otter.enable) {
|
config = mkIf (cfg.enable && cfg.otter.enable) {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = ["otter"];
|
startPlugins = ["otter"];
|
||||||
|
|
||||||
pluginRC.trouble = entryAnywhere ''
|
maps.normal = mkMerge [
|
||||||
-- Enable Otter
|
(mkSetBinding mappings.toggle "<cmd>lua require'otter'.activate()<CR>")
|
||||||
|
];
|
||||||
|
|
||||||
|
pluginRC.otter = entryAnywhere ''
|
||||||
|
-- Enable otter diagnostics viewer
|
||||||
require("otter").setup {}
|
require("otter").setup {}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
{lib, ...}: let
|
{
|
||||||
inherit (lib.options) mkEnableOption;
|
imports = [
|
||||||
in {
|
./otter.nix
|
||||||
options.vim.lsp = {
|
./config.nix
|
||||||
otter = {
|
];
|
||||||
enable = mkEnableOption "trouble lsp for markup languages";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
14
modules/plugins/lsp/otter/otter.nix
Normal file
14
modules/plugins/lsp/otter/otter.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkEnableOption;
|
||||||
|
inherit (lib.nvim.binds) mkMappingOption;
|
||||||
|
in {
|
||||||
|
options.vim.lsp = {
|
||||||
|
trouble = {
|
||||||
|
enable = mkEnableOption "Otter LSP Injector";
|
||||||
|
|
||||||
|
mappings = {
|
||||||
|
toggle = mkMappingOption "Activate LSP on Cursor Position [otter]" "<leader>oa";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue