mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-26 15:06:45 +00:00
modules/minimap: switch to explicit lib calls
This commit is contained in:
parent
c488f0490f
commit
f6db808bfc
7 changed files with 34 additions and 32 deletions
|
@ -1,5 +1,6 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkMappingOption;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.minimap.codewindow = {
|
||||
enable = mkEnableOption "codewindow plugin for minimap view";
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetLuaBinding nvim pushDownDefault;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding pushDownDefault;
|
||||
|
||||
cfg = config.vim.minimap.codewindow;
|
||||
|
||||
|
@ -13,26 +15,28 @@
|
|||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = [
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"codewindow-nvim"
|
||||
];
|
||||
|
||||
vim.maps.normal = mkMerge [
|
||||
maps.normal = mkMerge [
|
||||
(mkSetLuaBinding mappings.open "require('codewindow').open_minimap")
|
||||
(mkSetLuaBinding mappings.close "require('codewindow').close_minimap")
|
||||
(mkSetLuaBinding mappings.toggle "require('codewindow').toggle_minimap")
|
||||
(mkSetLuaBinding mappings.toggleFocus "require('codewindow').toggle_focus")
|
||||
];
|
||||
|
||||
vim.binds.whichKey.register = pushDownDefault {
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>m" = "+Minimap";
|
||||
};
|
||||
|
||||
vim.luaConfigRC.codewindow = nvim.dag.entryAnywhere ''
|
||||
luaConfigRC.codewindow = entryAnywhere ''
|
||||
local codewindow = require('codewindow')
|
||||
codewindow.setup({
|
||||
exclude_filetypes = { 'NvimTree', 'orgagenda', 'Alpha'},
|
||||
})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./codewindow.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{...}: {
|
||||
{
|
||||
imports = [
|
||||
./minimap-vim
|
||||
./codewindow
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf pushDownDefault;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.binds) pushDownDefault;
|
||||
|
||||
cfg = config.vim.minimap.minimap-vim;
|
||||
in {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./minimap-vim.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption;
|
||||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
in {
|
||||
options.vim.minimap.minimap-vim = {
|
||||
enable = mkEnableOption "minimap-vim plugin for minimap view";
|
||||
enable = mkEnableOption "minimap view [minimap-vim]";
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue