nix-dotfiles/programs/kakoune.nix

48 lines
1.2 KiB
Nix
Raw Normal View History

{
enable = true;
defaultEditor = true;
config = {
colorScheme = "tomorrow-night";
numberLines = {
enable = true;
highlightCursor = true;
};
hooks = [
{
# When the filetype=latex option is set in a buffer context (automatically), add a new hook to build the latex file on write
name = "BufSetOption";
option = "filetype=latex";
commands = "hook buffer BufWritePost .* %{ texlab-build }";
}
];
2024-03-24 23:18:13 -04:00
keyMappings = [
# Define usermode yank/copy and paste
{
key = "y";
mode = "user";
effect = "<a-|> wl-copy<ret>";
}
{
key = "p";
mode = "user";
effect = "<a-!> wl-paste<ret>;d"; # ;d at the end since newline inserted
}
{
key = "P";
mode = "user";
effect = "! wl-paste<ret>;d"; # ;d at the end since newline inserted
}
];
};
extraConfig = ''
# highlight trailing whitespace
add-highlighter global/trailing-whitespace regex '\h+$' 0:Error
# don't remove trailing indent
set global disabled_hooks .*-trim-indent
eval %sh{kak-lsp --kakoune -s $kak_session}
lsp-enable
'';
}