working emacs

This commit is contained in:
Charlie Root 2024-07-16 21:31:03 +02:00
commit 8ced160207
6 changed files with 71 additions and 23 deletions

View file

@ -1 +1 @@
_: {imports = [./emacs.nix ./helix.nix ./kakoune.nix ./nvf];}
_: {imports = [./emacs.nix ./helix.nix ./kakoune ./nvf];}

View file

@ -48,10 +48,6 @@ in {
# :tools editorconfig
editorconfig-core-c # per-project style config
# :tools lookup & :lang org +roam
sqlite
# :lang latex & :lang org (latex previews)
# :lang beancount
beancount
];
environment.variables.PATH = ["/home/vali/.config/emacs/bin"];

View file

@ -2,17 +2,19 @@
config,
lib,
pkgs,
...
}: let
inherit (config.modules.other.system) username;
cfg = config.modules.editors.kakoune;
inherit (lib) mkIf mkEnableOption;
in {
imports = [./mappings.nix];
options.modules.editors.kakoune.enable = mkEnableOption "kakoune";
config.home-manager.users.${username}.programs.kakoune = mkIf cfg.enable {
enable = true;
config = {
autoComplete = true;
autoReload = true;
autoComplete = ["insert"];
autoReload = "yes";
indentWidth = 4;
tabStop = 4;
incrementalSearch = false;
@ -27,24 +29,26 @@ in {
lines = 4;
columns = 4;
};
wrapLines = {
enable = true;
indent = true;
word = true;
};
ui = {
enableMouse = true;
assistant = "none";
statusLine = "bottom";
wrapLines = {
enable = true;
indent = true;
word = true;
};
};
plugins = with pkgs.kakounePlugins; [
auto-pairs-kak
fzf-kak
powerline-kak
byline-kak
kakoune-lsp
];
};
plugins = with pkgs.kakounePlugins; [
auto-pairs-kak
fzf-kak
powerline-kak
byline-kak
kakoune-lsp
];
# extraConfig = ./kakrc;
};
}

View file

@ -0,0 +1,48 @@
{
config,
lib,
pkgs,
...
}: let
inherit (config.modules.other.system) username;
in {
config.home-manager.users.${username}.programs.kakoune.config.keyMappings = [
{
mode = "normal";
key = "<esc>";
effect = ";,";
docstring = "Press escape to clear highlighted text and collapse cursors";
}
{
mode = "normal";
key = "<c-v>";
effect = ":comment-line<ret>";
docstring = "Comment a line with <c-v>!";
}
{
mode = "normal";
key = "b";
effect = ":db<ret>";
docstring = "close current buffer";
}
{
mode = "normal";
key = "n";
effect = ":bp<ret>";
docstring = "go to next buffer";
}
{
mode = "normal";
key = "m";
effect = ":bn<ret>";
docstring = "go to next buffer";
}
{
mode = "normal";
key = " f";
effect = ":fzf-mode<ret>";
docstring = "open fzf";
}
];
}

View file

@ -66,8 +66,8 @@ in {
additionalRuntimePaths = [
#(mkRuntimeDir "after")
#(mkRuntimeDir "spell")
./runtime/spell
./runtime/after
./runtime
./runtime
];
# while I should be doing this in luaConfigRC below