Retab kak config

This commit is contained in:
Riley Apeldoorn 2022-05-23 13:17:26 +02:00
parent f398775552
commit 11e08fc437
3 changed files with 157 additions and 167 deletions

View file

@ -17,15 +17,15 @@ in
with lib; { with lib; {
options.riley = { options.riley.kak = {
kak.enable = (mkEnableOption "kakoune editor") // { default = true; }; enable = (mkEnableOption "kakoune editor") // { default = true; };
kak.rust = mkEnableOption "Rust support in Kakoune"; rust = mkEnableOption "Rust support in Kakoune";
kak.ts = mkEnableOption "TypeScript support in Kakoune"; ts = mkEnableOption "TypeScript support in Kakoune";
kak.haskell = mkEnableOption "Haskell support in Kakoune"; haskell = mkEnableOption "Haskell support in Kakoune";
kak.python = mkEnableOption "Python 3.9 support in Kakoune"; python = mkEnableOption "Python 3.9 support in Kakoune";
kak.nix = (mkEnableOption "Nix support in Kakoune") // { default = true; }; nix = (mkEnableOption "Nix support in Kakoune") // { default = true; };
}; };

View file

@ -99,6 +99,9 @@ let semantic-tokens =
in (symlinkJoin { in (symlinkJoin {
name = "kak-lsp-${kak-lsp.version}";
nativeBuildInputs = [ makeWrapper ];
paths = with kakounePlugins; [ paths = with kakounePlugins; [
# The language server client # The language server client
@ -113,9 +116,8 @@ in (symlinkJoin {
++ (optional python python39Packages.python-lsp-server) ++ (optional python python39Packages.python-lsp-server)
++ (optional rust rust-analyzer); ++ (optional rust rust-analyzer);
name = "kak-lsp-${kak-lsp.version}";
nativeBuildInputs = [ makeWrapper ];
postBuild = '' postBuild = ''
wrapProgram $out/bin/kak-lsp --add-flags "--config $out/share/kak-lsp/kak-lsp.toml" wrapProgram $out/bin/kak-lsp --add-flags "--config $out/share/kak-lsp/kak-lsp.toml"
''; '';
}) })

View file

@ -30,14 +30,8 @@ let keybinds = ''
lsp-inlay-diagnostics-enable window lsp-inlay-diagnostics-enable window
hook window ModeChange .*:.*:insert %{ hook window ModeChange .*:.*:insert %{ remove-highlighter window/lsp_diagnostics }
remove-highlighter window/lsp_diagnostics hook window ModeChange .*:insert:normal %{ lsp-inlay-diagnostics-enable window }
}
hook window ModeChange .*:insert:normal %{
lsp-inlay-diagnostics-enable window
}
''; '';
# Implies `ide-init`. Adds code actions and hover. # Implies `ide-init`. Adds code actions and hover.
@ -59,9 +53,7 @@ let keybinds = ''
hook window -group semtok NormalIdle .* lsp-semantic-tokens hook window -group semtok NormalIdle .* lsp-semantic-tokens
hook window -group semtok InsertIdle .* lsp-semantic-tokens hook window -group semtok InsertIdle .* lsp-semantic-tokens
hook -once -always window WinSetOption filetype=.* %{ hook -once -always window WinSetOption filetype=.* %{ remove-hooks window semtok }
remove-hooks window semtok
}
map global normal <a-down> ': lsp-next-function<ret>' map global normal <a-down> ': lsp-next-function<ret>'
map global normal <a-up> ': lsp-previous-function<ret>' map global normal <a-up> ': lsp-previous-function<ret>'
@ -148,13 +140,11 @@ in pkgs.writeTextFile (rec {
name = "kakrc.kak"; name = "kakrc.kak";
destination = "/share/kak/autoload/${name}"; destination = "/share/kak/autoload/${name}";
text = '' text = ''
colorscheme colors; colorscheme colors;
set global tabstop 4
add-highlighter global/ number-lines -separator ' ' -hlcursor add-highlighter global/ number-lines -separator ' ' -hlcursor
set global tabstop 4
face global InlayHint rgb:828282 face global InlayHint rgb:828282
face global InlayDiagnosticWarning rgb:a39e31+f face global InlayDiagnosticWarning rgb:a39e31+f
face global InlayDiagnosticError rgb:ad494f+f face global InlayDiagnosticError rgb:ad494f+f
@ -169,8 +159,6 @@ in pkgs.writeTextFile (rec {
${rust-config} ${rust-config}
${nix-config} ${nix-config}
hook global KakBegin .* %{ hook global KakBegin .* %{ cursorline }
cursorline
}
''; '';
}) })