nix-dotfiles/programs/kakoune.nix

47 lines
1.2 KiB
Nix

{ pkgs, ... }: {
enable = true;
defaultEditor = true;
# plugins = with pkgs; [ kakounePlugins.kak-fzf ];
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 }";
}];
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
'';
}