66 lines
1.7 KiB
Nix
66 lines
1.7 KiB
Nix
{ pkgs, ... }: {
|
|
enable = true;
|
|
defaultEditor = true;
|
|
# plugins = with pkgs; [ kakounePlugins.kak-fzf ];
|
|
config = {
|
|
colorScheme = "tomorrow-night";
|
|
numberLines = {
|
|
enable = true;
|
|
highlightCursor = true;
|
|
};
|
|
indentWidth = 2;
|
|
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 }";
|
|
}
|
|
{
|
|
# When the filetype=markdown option is set (automatically), set word wrap on
|
|
name = "WinSetOption";
|
|
option = "filetype=markdown";
|
|
commands = "set-option window lintcmd \"proselint\"";
|
|
}
|
|
];
|
|
keyMappings = [
|
|
# Define select all
|
|
{
|
|
key = "a";
|
|
mode = "user";
|
|
effect = "*%s<ret>";
|
|
docstring = "Select all";
|
|
}
|
|
# Define usermode yank/copy and paste
|
|
{
|
|
key = "y";
|
|
mode = "user";
|
|
effect = "<a-|> wl-copy<ret>";
|
|
}
|
|
{
|
|
key = "p";
|
|
mode = "user";
|
|
effect = "<a-!> wl-paste -n<ret>";
|
|
}
|
|
{
|
|
key = "P";
|
|
mode = "user";
|
|
effect = "! wl-paste -n<ret>";
|
|
}
|
|
];
|
|
};
|
|
extraConfig = ''
|
|
# highlight trailing whitespace
|
|
add-highlighter global/trailing-whitespace regex '\h+$' 0:Error
|
|
|
|
# don't remove trailing indent
|
|
set global disabled_hooks .*-trim-indent
|
|
source ${pkgs.writeText "kakoune-divider.kak" (builtins.readFile ./kakoune/divider.kak)}
|
|
set-option global divider_face LineNumbers
|
|
divider-on 80
|
|
|
|
eval %sh{kak-lsp --kakoune -s $kak_session}
|
|
lsp-enable
|
|
'';
|
|
}
|