Palette library integrated + polybar and alacritty
This commit is contained in:
parent
a61bfe3c50
commit
ef5b48d142
17 changed files with 1090 additions and 214 deletions
|
|
@ -2,7 +2,34 @@
|
|||
let
|
||||
nixpkgs = import <nixpkgs> {};
|
||||
kakCmd = "kak";
|
||||
in {
|
||||
|
||||
rustPlugins = with pkgs; [
|
||||
cargo
|
||||
cargo-watch
|
||||
clippy
|
||||
rust-analyzer
|
||||
rustup
|
||||
];
|
||||
pythonPlugins = with pkgs.python38Packages; [
|
||||
pyls-black
|
||||
python-language-server
|
||||
];
|
||||
nixPlugins = with pkgs; [
|
||||
rnix-lsp
|
||||
];
|
||||
spellingPlugins = with pkgs; [
|
||||
aspell
|
||||
aspellDicts.en
|
||||
aspellDicts.en-computers
|
||||
aspellDicts.en-science
|
||||
aspellDicts.it
|
||||
];
|
||||
dataFormats = with pkgs; [
|
||||
# yaml-language-server
|
||||
];
|
||||
|
||||
in
|
||||
{
|
||||
home.sessionVariables = {
|
||||
EDITOR = kakCmd;
|
||||
VISUAL = kakCmd;
|
||||
|
|
@ -11,8 +38,8 @@ in {
|
|||
programs.zsh.shellAliases = { k = kakCmd; };
|
||||
|
||||
programs.kakoune = {
|
||||
enable = true;
|
||||
config = {
|
||||
enable = true;
|
||||
config = {
|
||||
colorScheme = "nord";
|
||||
tabStop = 2;
|
||||
indentWidth = 2;
|
||||
|
|
@ -36,54 +63,58 @@ in {
|
|||
};
|
||||
keyMappings = [
|
||||
{ mode = "normal"; docstring = "Open file"; key = "<c-o>"; effect = ":edit<space>"; }
|
||||
{ mode = "user"; docstring = "Code actions"; key = "a"; effect = ":lsp-code-actions<ret>"; }
|
||||
{ mode = "user"; docstring = "Comment block"; key = "b"; effect = ":comment-block<ret>"; }
|
||||
{ mode = "user"; docstring = "Comment line"; key = "l"; effect = ":comment-line<ret>"; }
|
||||
{ mode = "user"; docstring = "Show hover info"; key = "q"; effect = ":lsp-hover<ret>"; }
|
||||
{ mode = "user"; docstring = "Jump to definition"; key = "d"; effect = ":lsp-definition<ret>"; }
|
||||
{ mode = "user"; docstring = "List project diagnostics"; key = "i"; effect = ":lsp-diagnostics<ret>"; }
|
||||
{ mode = "user"; docstring = "Jump to type definition"; key = "t"; effect = ":lsp-type-definition<ret>"; }
|
||||
{ mode = "user"; docstring = "Code actions"; key = "a"; effect = ":lsp-code-actions<ret>"; }
|
||||
{ mode = "user"; docstring = "Format code"; key = "F"; effect = ":lsp-formatting-sync<ret>"; }
|
||||
{ mode = "user"; docstring = "Spellcheck"; key = "s"; effect = ":spell "; }
|
||||
{ mode = "user"; docstring = "Spellcheck English"; key = "S"; effect = ":spell en<ret>"; }
|
||||
{ mode = "user"; docstring = "Copy to clipboard"; key = "y"; effect = "<a-|>${pkgs.xclip}/bin/xclip -i -selection clipboard<ret>"; }
|
||||
{ mode = "user"; docstring = "Paste from clipboard (before)"; key = "p"; effect = "!${pkgs.xclip}/bin/xclip -selection clipboard -o<ret>"; }
|
||||
{ mode = "user"; docstring = "Format code"; key = "F"; effect = ":lsp-formatting-sync<ret>"; }
|
||||
{ mode = "user"; docstring = "Jump to definition"; key = "d"; effect = ":lsp-definition<ret>"; }
|
||||
{ mode = "user"; docstring = "Jump to type definition"; key = "t"; effect = ":lsp-type-definition<ret>"; }
|
||||
{ mode = "user"; docstring = "List project diagnostics"; key = "i"; effect = ":lsp-diagnostics<ret>"; }
|
||||
{ mode = "user"; docstring = "Paste from clipboard (after)"; key = "P"; effect = "<a-!>${pkgs.xclip}/bin/xclip -selection clipboard -o<ret>"; }
|
||||
{ mode = "user"; docstring = "Paste from clipboard (before)"; key = "p"; effect = "!${pkgs.xclip}/bin/xclip -selection clipboard -o<ret>"; }
|
||||
{ mode = "user"; docstring = "Show hover info"; key = "q"; effect = ":lsp-hover<ret>"; }
|
||||
{ mode = "user"; docstring = "Spellcheck English"; key = "S"; effect = ":spell en<ret>"; }
|
||||
{ mode = "user"; docstring = "Spellcheck"; key = "s"; effect = ":spell "; }
|
||||
];
|
||||
hooks = [
|
||||
{ name = "WinSetOption"; option = "filetype=(rust|python|c|cpp|latex|javascript|go|nix)"; commands = builtins.concatStringsSep "\n" [ "lsp-enable-window" ]; }
|
||||
# { name = "BufCreate"; option = ".*"; commands = "editorconfig-load"; }
|
||||
{ name = "ModuleLoaded"; option = "powerline"; commands = builtins.concatStringsSep "\n" [ "powerline-enable" ]; }
|
||||
{ name = "ModuleLoaded"; option = "auto-pairs"; commands = "auto-pairs-enable"; }
|
||||
{ name = "InsertCompletionShow"; option = ".*"; commands = builtins.concatStringsSep "\n" [ "map window insert <tab> <c-n>" "map window insert <s-tab> <c-p>" ]; }
|
||||
{ name = "BufCreate"; option = ".*"; commands = "editorconfig-load"; }
|
||||
{ name = "InsertCompletionHide"; option = ".*"; commands = builtins.concatStringsSep "\n" [ "unmap window insert <tab> <c-n>" "unmap window insert <s-tab> <c-p>" ]; }
|
||||
{ name = "InsertCompletionShow"; option = ".*"; commands = builtins.concatStringsSep "\n" [ "map window insert <tab> <c-n>" "map window insert <s-tab> <c-p>" ]; }
|
||||
{ name = "ModuleLoaded"; option = "auto-pairs"; commands = "auto-pairs-enable"; }
|
||||
{ name = "ModuleLoaded"; option = "powerline"; commands = builtins.concatStringsSep "\n" [ "powerline-enable" ]; }
|
||||
{ name = "WinSetOption"; option = "filetype=(rust|python|c|cpp|latex|javascript|go|nix)"; commands = builtins.concatStringsSep "\n" [ "lsp-enable-window" ]; }
|
||||
];
|
||||
};
|
||||
extraConfig = builtins.concatStringsSep "\n" [
|
||||
extraConfig = builtins.concatStringsSep "\n" [
|
||||
"# Custom commands"
|
||||
"define-command -docstring 'save and quit' x 'write-all; quit' # Save and quit with 'x'"
|
||||
"add-highlighter global/ regex \\h+$ 0:Error # Highlight trailing spaces"
|
||||
"eval %sh{kak-lsp --kakoune -s \$kak_session} # Start kak-lsp"
|
||||
"require-module prelude"
|
||||
"# require-module auto-pairs"
|
||||
"require-module connect"
|
||||
"require-module connect-broot"
|
||||
"require-module connect-lf"
|
||||
"require-module connect-rofi"
|
||||
"require-module powerline"
|
||||
];
|
||||
plugins = (with pkgs; [
|
||||
aspell
|
||||
aspellDicts.en
|
||||
aspellDicts.en-computers
|
||||
aspellDicts.en-science
|
||||
aspellDicts.it
|
||||
kak-lsp
|
||||
kakounePlugins.powerline-kak
|
||||
rnix-lsp
|
||||
]) ++ (with nixpkgs; [
|
||||
# kakounePlugins.kak-lsp
|
||||
# kakounePlugins.prelude-kak
|
||||
# kakounePlugins.auto-pairs-kak
|
||||
]);
|
||||
];
|
||||
plugins = (
|
||||
with pkgs; [
|
||||
broot
|
||||
lf
|
||||
editorconfig-core-c
|
||||
kakounePlugins.auto-pairs-kak
|
||||
kakounePlugins.kak-lsp
|
||||
kakounePlugins.powerline-kak
|
||||
kakounePlugins.prelude-kak
|
||||
]
|
||||
) ++ (
|
||||
with nixpkgs; [
|
||||
kakounePlugins.connect-kak
|
||||
]
|
||||
) ++ rustPlugins ++ pythonPlugins ++ nixPlugins ++ spellingPlugins ++ dataFormats;
|
||||
};
|
||||
|
||||
xdg.configFile."kak-lsp/kak-lsp.toml".source = ../configs/kak-lsp/kak-lsp.toml;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue