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:
parent
055c67056d
commit
8544cd0920
10 changed files with 282 additions and 0 deletions
4
tests/modules/programs/lapce/default.nix
Normal file
4
tests/modules/programs/lapce/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
lapce-example-keymaps = ./example-keymaps.nix;
|
||||
lapce-example-settings = ./example-settings.nix;
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
[[keymaps]]
|
||||
command = "open_log_file"
|
||||
key = "Ctrl+Shift+L"
|
||||
18
tests/modules/programs/lapce/example-keymaps.nix
Normal file
18
tests/modules/programs/lapce/example-keymaps.nix
Normal 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}
|
||||
'';
|
||||
}
|
||||
17
tests/modules/programs/lapce/example-settings-expected.toml
Normal file
17
tests/modules/programs/lapce/example-settings-expected.toml
Normal 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
|
||||
34
tests/modules/programs/lapce/example-settings.nix
Normal file
34
tests/modules/programs/lapce/example-settings.nix
Normal 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}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue