mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-14 16:55:57 +01:00
Compare commits
6 commits
32fe0ff5a7
...
fad8b00a0a
Author | SHA1 | Date | |
---|---|---|---|
|
fad8b00a0a | ||
|
b2eafaf8d6 | ||
|
dfd9172371 | ||
|
f29664626b | ||
|
085d5d304a | ||
|
4efc5d89d0 |
3 changed files with 11 additions and 4 deletions
|
@ -186,7 +186,12 @@
|
||||||
keys = mkOption {
|
keys = mkOption {
|
||||||
description = "Lazy-load on key mapping";
|
description = "Lazy-load on key mapping";
|
||||||
default = null;
|
default = null;
|
||||||
type = nullOr (oneOf [str (listOf lznKeysSpec) (listOf str)]); # TODO: support lz.n.KeysSpec
|
type = nullOr (oneOf [str (listOf lznKeysSpec) (listOf str)]);
|
||||||
|
example = ''
|
||||||
|
keys = [
|
||||||
|
{lhs = "<leader>s"; rhs = ":NvimTreeToggle<cr>"; desc = "Toggle NvimTree"}
|
||||||
|
]
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: enabled, beforeAll, colorscheme, priority, load
|
# TODO: enabled, beforeAll, colorscheme, priority, load
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
inherit (builtins) filter;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.nvim.binds) mkBinding;
|
inherit (lib.nvim.binds) mkBinding;
|
||||||
|
@ -32,7 +33,7 @@ in {
|
||||||
inherit (cfg) setupOpts;
|
inherit (cfg) setupOpts;
|
||||||
cmd = ["NvimTreeClipboard" "NvimTreeClose" "NvimTreeCollapse" "NvimTreeCollapseKeepBuffers" "NvimTreeFindFile" "NvimTreeFindFileToggle" "NvimTreeFocus" "NvimTreeHiTest" "NvimTreeOpen" "NvimTreeRefresh" "NvimTreeResize" "NvimTreeToggle"];
|
cmd = ["NvimTreeClipboard" "NvimTreeClose" "NvimTreeCollapse" "NvimTreeCollapseKeepBuffers" "NvimTreeFindFile" "NvimTreeFindFileToggle" "NvimTreeFocus" "NvimTreeHiTest" "NvimTreeOpen" "NvimTreeRefresh" "NvimTreeResize" "NvimTreeToggle"];
|
||||||
|
|
||||||
keys = [
|
keys = filter ({lhs, ...}: lhs != null) [
|
||||||
(mkNormalBinding cfg.mappings.toggle ":NvimTreeToggle<cr>" mappings.toggle.description)
|
(mkNormalBinding cfg.mappings.toggle ":NvimTreeToggle<cr>" mappings.toggle.description)
|
||||||
(mkNormalBinding cfg.mappings.refresh ":NvimTreeRefresh<cr>" mappings.refresh.description)
|
(mkNormalBinding cfg.mappings.refresh ":NvimTreeRefresh<cr>" mappings.refresh.description)
|
||||||
(mkNormalBinding cfg.mappings.findFile ":NvimTreeFindFile<cr>" mappings.findFile.description)
|
(mkNormalBinding cfg.mappings.findFile ":NvimTreeFindFile<cr>" mappings.findFile.description)
|
||||||
|
@ -53,6 +54,7 @@ in {
|
||||||
|
|
||||||
${
|
${
|
||||||
optionalString cfg.openOnSetup ''
|
optionalString cfg.openOnSetup ''
|
||||||
|
require('lz.n').trigger_load("nvim-tree-lua")
|
||||||
-- autostart behaviour
|
-- autostart behaviour
|
||||||
-- Open on startup has been deprecated
|
-- Open on startup has been deprecated
|
||||||
-- see https://github.com/nvim-tree/nvim-tree.lua/wiki/Open-At-Startup
|
-- see https://github.com/nvim-tree/nvim-tree.lua/wiki/Open-At-Startup
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryBefore;
|
||||||
cfg = config.vim.lazy;
|
cfg = config.vim.lazy;
|
||||||
|
|
||||||
toLuzLznKeySpec = {
|
toLuzLznKeySpec = {
|
||||||
|
@ -49,7 +49,7 @@ in {
|
||||||
|
|
||||||
optPlugins = mapAttrsToList (_: plugin: plugin.package) cfg.plugins;
|
optPlugins = mapAttrsToList (_: plugin: plugin.package) cfg.plugins;
|
||||||
|
|
||||||
luaConfigRC.lzn-load = entryAnywhere ''
|
luaConfigRC.lzn-load = entryBefore ["pluginConfigs"] ''
|
||||||
require('lz.n').load(${toLuaObject lznSpecs})
|
require('lz.n').load(${toLuaObject lznSpecs})
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue