mirror of
https://github.com/nix-community/nixvim.git
synced 2025-12-14 13:01:12 +01:00
treewide: remove with lib;
This commit is contained in:
parent
cd0443e166
commit
629f9d75f8
67 changed files with 276 additions and 338 deletions
|
|
@ -1,7 +1,4 @@
|
|||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{ lib, ... }:
|
||||
let
|
||||
# The keys are the option name in nixvim (under plugins.julia-cell.keymaps)
|
||||
# cmd: Such that the mapping action is ':JuliaCell${cmd}<CR>'
|
||||
|
|
@ -33,14 +30,13 @@ let
|
|||
};
|
||||
};
|
||||
in
|
||||
with lib;
|
||||
lib.nixvim.plugins.mkVimPlugin {
|
||||
name = "julia-cell";
|
||||
package = "vim-julia-cell";
|
||||
globalPrefix = "julia_cell_";
|
||||
description = "A Vim plugin for executing Julia code cells.";
|
||||
|
||||
maintainers = [ maintainers.GaetanLepage ];
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
settingsOptions = {
|
||||
delimit_cells_by =
|
||||
|
|
@ -58,25 +54,25 @@ lib.nixvim.plugins.mkVimPlugin {
|
|||
|
||||
extraOptions = {
|
||||
keymaps = {
|
||||
silent = mkOption {
|
||||
type = types.bool;
|
||||
silent = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Whether julia-cell keymaps should be silent";
|
||||
default = false;
|
||||
};
|
||||
}
|
||||
// (mapAttrs (
|
||||
name: value: lib.nixvim.mkNullOrOption types.str "Keymap for ${value.desc}."
|
||||
// (lib.mapAttrs (
|
||||
name: value: lib.nixvim.mkNullOrOption lib.types.str "Keymap for ${value.desc}."
|
||||
) mappings);
|
||||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
keymaps = flatten (
|
||||
mapAttrsToList (
|
||||
keymaps = lib.flatten (
|
||||
lib.mapAttrsToList (
|
||||
name: value:
|
||||
let
|
||||
key = cfg.keymaps.${name};
|
||||
in
|
||||
optional (key != null) {
|
||||
lib.optional (key != null) {
|
||||
mode = "n";
|
||||
inherit key;
|
||||
action = ":JuliaCell${value.cmd}<CR>";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue