mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-02-03 02:15:50 +00:00
Some checks failed
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Treewide Checks / Validate flake (push) Waiting to run
Treewide Checks / Check formatting (push) Waiting to run
Treewide Checks / Check source tree for typos (push) Waiting to run
Treewide Checks / Validate documentation builds (push) Waiting to run
Treewide Checks / Validate documentation builds-1 (push) Waiting to run
Treewide Checks / Validate documentation builds-2 (push) Waiting to run
Treewide Checks / Validate documentation builds-3 (push) Waiting to run
Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
* codewindow: allow opening on setup codewindow: allow opening on setup * release notes: add line codewindow: allow opening on setup * codewindow: clean * buildfix: fix rafs wrong code suggestion --------- Co-authored-by: Soliprem <73885403+Soliprem@users.noreply.github.com> Co-authored-by: raf <raf@notashelf.dev> Co-authored-by: Ching Pei Yang <59727193+horriblename@users.noreply.github.com>
40 lines
1.1 KiB
Nix
40 lines
1.1 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
options,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkIf mkMerge;
|
|
inherit (lib.nvim.dag) entryAnywhere;
|
|
inherit (lib.nvim.lua) toLuaObject;
|
|
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding pushDownDefault;
|
|
|
|
cfg = config.vim.minimap.codewindow;
|
|
|
|
mappingDefinitions = options.vim.minimap.codewindow.mappings;
|
|
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
|
in {
|
|
config = mkIf cfg.enable {
|
|
vim = {
|
|
startPlugins = [
|
|
"codewindow-nvim"
|
|
];
|
|
|
|
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")
|
|
];
|
|
|
|
binds.whichKey.register = pushDownDefault {
|
|
"<leader>m" = "+Minimap";
|
|
};
|
|
|
|
pluginRC.codewindow = entryAnywhere ''
|
|
local codewindow = require('codewindow')
|
|
codewindow.setup(${toLuaObject cfg.setupOpts})
|
|
'';
|
|
};
|
|
};
|
|
}
|