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,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding;
|
||||
|
||||
cfg = config.vim.lsp;
|
||||
|
||||
self = import ./otter.nix {inherit lib;};
|
||||
mappingDefinitions = self.options.vim.lsp.otter.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.otter.mappings mappingDefinitions;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.otter.enable) {
|
||||
vim = {
|
||||
startPlugins = ["otter"];
|
||||
|
||||
pluginRC.trouble = entryAnywhere ''
|
||||
-- Enable Otter
|
||||
maps.normal = mkMerge [
|
||||
(mkSetBinding mappings.toggle "<cmd>lua require'otter'.activate()<CR>")
|
||||
];
|
||||
|
||||
pluginRC.otter = entryAnywhere ''
|
||||
-- Enable otter diagnostics viewer
|
||||
require("otter").setup {}
|
||||
'';
|
||||
};
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
otter = {
|
||||
enable = mkEnableOption "trouble lsp for markup languages";
|
||||
};
|
||||
};
|
||||
{
|
||||
imports = [
|
||||
./otter.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
||||
|
|
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