dotfiles.nix/home/kakoune.nix

106 lines
2.3 KiB
Nix
Raw Normal View History

2022-07-21 02:19:32 +00:00
{ pkgs, ... }: {
2022-07-21 04:38:26 +00:00
home.packages = [ pkgs.kak-lsp ];
2022-07-04 14:46:52 +00:00
programs.kakoune = {
enable = true;
2022-07-21 04:38:26 +00:00
2022-07-21 02:19:32 +00:00
config = {
2022-07-21 04:38:26 +00:00
autoReload = "yes";
colorScheme = "tokyonight";
2022-07-21 23:51:23 +00:00
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}
'';
}
{
name = "WinSetOption";
option = "filetype=(haskell)";
commands = ''
lsp-enable-window
'';
}
{
name = "WinSetOption";
option = "filetype=(haskell|nix)";
commands = ''
set-option window indentwidth 2
'';
}
];
indentWidth = 4;
2022-07-21 04:38:26 +00:00
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";
}
{
2022-07-21 23:51:23 +00:00
key = "<c-b>";
effect = ": fzf-mode<ret>b<ret>";
mode = "normal";
docstring = "Open fzf-mode buffer dialog with ctrl-b";
2022-07-21 04:38:26 +00:00
}
];
numberLines.enable = true;
numberLines.highlightCursor = true;
numberLines.relative = true;
scrollOff.columns = 4;
scrollOff.lines = 2;
showMatching = true;
2022-07-21 23:51:23 +00:00
showWhitespace.enable = true;
2022-07-21 04:38:26 +00:00
ui.enableMouse = true;
2022-07-21 02:19:32 +00:00
};
2022-07-21 04:38:26 +00:00
extraConfig = ''
eval %sh{${pkgs.kak-lsp}/bin/kak-lsp --kakoune -s $kak_session}
'';
2022-07-21 02:19:32 +00:00
plugins = with pkgs.kakounePlugins; [
active-window-kak
auto-pairs-kak
fzf-kak
kak-lsp
kakboard
kakoune-state-save
kakoune-vertical-selection
2022-07-21 23:51:23 +00:00
pkgs.smarttab-kak
2022-07-21 02:19:32 +00:00
# needs luar
2022-07-21 23:51:23 +00:00
pkgs.luar
tabs-kak
2022-07-21 02:19:32 +00:00
];
2022-07-04 14:46:52 +00:00
};
}