lapce: add module (#5752)

Adds the 'programs.lapce' module for configuring lapce text editor.
Options for settings, plugins and keymaps are available.
This commit is contained in:
Timon Schelling 2025-02-01 14:03:26 +01:00 committed by GitHub
parent 055c67056d
commit 8544cd0920
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 282 additions and 0 deletions

View file

@ -0,0 +1,4 @@
{
lapce-example-keymaps = ./example-keymaps.nix;
lapce-example-settings = ./example-settings.nix;
}

View file

@ -0,0 +1,3 @@
[[keymaps]]
command = "open_log_file"
key = "Ctrl+Shift+L"

View file

@ -0,0 +1,18 @@
{ config, ... }:
{
programs.lapce = {
enable = true;
package = config.lib.test.mkStubPackage { };
keymaps = [{
command = "open_log_file";
key = "Ctrl+Shift+L";
}];
};
nmt.script = ''
assertFileContent \
home-files/.config/lapce-stable/keymaps.toml \
${./example-keymaps-expected.toml}
'';
}

View file

@ -0,0 +1,17 @@
[core]
color-theme = "Custom"
custom-titlebar = false
icon-theme = "Material Icons"
[editor]
bracket-pair-colorization = true
cursor-surrounding-lines = 4
font-family = "FiraCode Nerd Bold Font, monospace"
font-size = 22
highlight-matching-brackets = true
render-whitespace = "all"
tab-width = 2
[ui]
font-size = 20
open-editors-visible = false

View file

@ -0,0 +1,34 @@
{ config, ... }:
{
programs.lapce = {
enable = true;
package = config.lib.test.mkStubPackage { };
settings = {
core = {
custom-titlebar = false;
color-theme = "Custom";
icon-theme = "Material Icons";
};
editor = {
font-family = "FiraCode Nerd Bold Font, monospace";
font-size = 22;
tab-width = 2;
cursor-surrounding-lines = 4;
render-whitespace = "all";
bracket-pair-colorization = true;
highlight-matching-brackets = true;
};
ui = {
font-size = 20;
open-editors-visible = false;
};
};
};
nmt.script = ''
assertFileContent \
home-files/.config/lapce-stable/settings.toml \
${./example-settings-expected.toml}
'';
}