mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-19 10:59:49 +01: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
|
{lib, ...}: let
|
||||||
inherit (lib) mkEnableOption mkMappingOption;
|
inherit (lib.options) mkEnableOption;
|
||||||
|
inherit (lib.nvim.binds) mkMappingOption;
|
||||||
in {
|
in {
|
||||||
options.vim.minimap.codewindow = {
|
options.vim.minimap.codewindow = {
|
||||||
enable = mkEnableOption "codewindow plugin for minimap view";
|
enable = mkEnableOption "codewindow plugin for minimap view";
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: 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;
|
cfg = config.vim.minimap.codewindow;
|
||||||
|
|
||||||
|
@ -13,26 +15,28 @@
|
||||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim.startPlugins = [
|
vim = {
|
||||||
"codewindow-nvim"
|
startPlugins = [
|
||||||
];
|
"codewindow-nvim"
|
||||||
|
];
|
||||||
|
|
||||||
vim.maps.normal = mkMerge [
|
maps.normal = mkMerge [
|
||||||
(mkSetLuaBinding mappings.open "require('codewindow').open_minimap")
|
(mkSetLuaBinding mappings.open "require('codewindow').open_minimap")
|
||||||
(mkSetLuaBinding mappings.close "require('codewindow').close_minimap")
|
(mkSetLuaBinding mappings.close "require('codewindow').close_minimap")
|
||||||
(mkSetLuaBinding mappings.toggle "require('codewindow').toggle_minimap")
|
(mkSetLuaBinding mappings.toggle "require('codewindow').toggle_minimap")
|
||||||
(mkSetLuaBinding mappings.toggleFocus "require('codewindow').toggle_focus")
|
(mkSetLuaBinding mappings.toggleFocus "require('codewindow').toggle_focus")
|
||||||
];
|
];
|
||||||
|
|
||||||
vim.binds.whichKey.register = pushDownDefault {
|
binds.whichKey.register = pushDownDefault {
|
||||||
"<leader>m" = "+Minimap";
|
"<leader>m" = "+Minimap";
|
||||||
|
};
|
||||||
|
|
||||||
|
luaConfigRC.codewindow = entryAnywhere ''
|
||||||
|
local codewindow = require('codewindow')
|
||||||
|
codewindow.setup({
|
||||||
|
exclude_filetypes = { 'NvimTree', 'orgagenda', 'Alpha'},
|
||||||
|
})
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
vim.luaConfigRC.codewindow = nvim.dag.entryAnywhere ''
|
|
||||||
local codewindow = require('codewindow')
|
|
||||||
codewindow.setup({
|
|
||||||
exclude_filetypes = { 'NvimTree', 'orgagenda', 'Alpha'},
|
|
||||||
})
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
_: {
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./codewindow.nix
|
./codewindow.nix
|
||||||
./config.nix
|
./config.nix
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{...}: {
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./minimap-vim
|
./minimap-vim
|
||||||
./codewindow
|
./codewindow
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
|
||||||
config,
|
config,
|
||||||
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkIf pushDownDefault;
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.binds) pushDownDefault;
|
||||||
|
|
||||||
cfg = config.vim.minimap.minimap-vim;
|
cfg = config.vim.minimap.minimap-vim;
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
_: {
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./minimap-vim.nix
|
./minimap-vim.nix
|
||||||
./config.nix
|
./config.nix
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
{
|
{lib, ...}: let
|
||||||
config,
|
inherit (lib.options) mkEnableOption;
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib) mkEnableOption;
|
|
||||||
in {
|
in {
|
||||||
options.vim.minimap.minimap-vim = {
|
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