dotfiles.nix/home/kakoune.nix

112 lines
2.3 KiB
Nix

{ pkgs, ... }: {
home.packages = with pkgs; [
kak-lsp
];
programs.kakoune = {
enable = true;
config = {
autoReload = "yes";
# colorScheme = "tokyonight";
hooks = [
# smarttab hooks
{
name = "BufOpenFile";
option = ".*";
commands = "expandtab";
}
{
name = "BufNewFile";
option = ".*";
commands = "expandtab";
}
{
name = "WinSetOption";
option = "filetype=(makefile)";
commands = "noexpandtab";
}
{
name = "ModuleLoaded";
option = "smarttab";
commands = ''
set-option global softtabstop %opt{indentwidth}
'';
}
# lsp hooks
{
name = "WinSetOption";
option = "filetype=(haskell)";
commands = ''
lsp-enable-window
'';
}
# general hooks
{
name = "WinSetOption";
option = "filetype=(haskell|nix)";
commands = ''
set-option window indentwidth 2
'';
}
];
indentWidth = 4;
keyMappings = [
{
key = "<c-a-p>";
effect = ": fzf-mode<ret>";
mode = "normal";
docstring = "Open fzf-mode with ctrl-alt-p";
}
{
key = "<c-p>";
effect = ": fzf-mode<ret>f<ret>";
mode = "normal";
docstring = "Open fzf-mode file dialog with ctrl-p";
}
{
key = "<c-b>";
effect = ": fzf-mode<ret>b<ret>";
mode = "normal";
docstring = "Open fzf-mode buffer dialog with ctrl-b";
}
];
numberLines.enable = true;
numberLines.highlightCursor = true;
numberLines.relative = true;
scrollOff.columns = 4;
scrollOff.lines = 2;
showMatching = true;
showWhitespace.enable = true;
ui.enableMouse = true;
};
extraConfig = ''
eval %sh{${pkgs.kak-lsp}/bin/kak-lsp --kakoune -s $kak_session}
'';
plugins = with pkgs.kakounePlugins; [
active-window-kak
auto-pairs-kak
connect-kak
fzf-kak
kak-lsp
kakboard
kakoune-state-save
kakoune-vertical-selection
pkgs.smarttab-kak
# needs luar
pkgs.luar
tabs-kak
];
};
}