Update kakoune and lsp

This commit is contained in:
xenia 2024-06-12 22:09:20 +02:00
parent e8c73318a1
commit d66439f80f
5 changed files with 58 additions and 302 deletions

View File

@ -1,9 +1,6 @@
hook global WinSetOption .* %{
remove-highlighter global/show-ws
add-highlighter global/show-ws show-whitespaces -tabpad ' '
face global Whitespace rgb:3c3836+f
}
add-highlighter global/ show-matching
@ -81,52 +78,6 @@ map global lsp '"' ':lsp-clear-references<ret>' -docstring "Clear references"
face global Reference white,rgb:550055
face global ReferenceBind white,rgb:552200
# tree-sitter
tree-always-highlight
set-option global tree_highlight_style ",rgb:404040"
declare-user-mode tree
map global normal 't' ":enter-user-mode tree<ret>"
map global normal '<tab>' ":enter-user-mode tree<ret>"
map global normal 'T' ":enter-user-mode -lock tree<ret>"
map -docstring "select node" global tree 'n' ":tree-select-node<ret>"
map -docstring "select parent" global tree 'k' ":tree-select-parent-node<ret>"
map -docstring "select children" global tree 'C' ":tree-select-children<ret>"
map -docstring "select children of type" global tree 'c' ":enter-user-mode tree-children<ret>"
map -docstring "select next node of type" global tree 'l' ":enter-user-mode tree-next<ret>"
map -docstring "select previous node of type" global tree 'h' ":enter-user-mode tree-prev<ret>"
map -docstring "show sexp" global tree 's' ":tree-node-sexp<ret>"
map -docstring "enable highlighting" global tree '"' ":tree-always-highlight<ret>"
map -docstring "disable highlighting" global tree '&' ":tree-always-highlight-disable<ret>"
declare-user-mode tree-children
declare-user-mode tree-next
declare-user-mode tree-prev
declare-user-mode tree-quickjump
map global normal 'f' ":enter-user-mode tree-quickjump<ret>"
map global normal 'F' ":enter-user-mode tree-next<ret>"
map global normal '<a-f>' ":enter-user-mode tree-children<ret>"
evaluate-commands %sh{
echo "i,identifier
t,type
c,call
a,arguments
s,statement
d,declaration
n,number
b,block
\",string" |
while IFS=, read -r cmd group ; do
echo "map -docstring '$group child' global tree-children '$cmd' ':tree-select-children $group<ret>'"
echo "map -docstring 'next $group' global tree-next '$cmd' ':tree-select-next-node $group<ret>'"
echo "map -docstring 'previous $group' global tree-prev '$cmd' ':tree-select-previous-node $group<ret>'"
echo "map -docstring 'quickjump to $group' global tree-quickjump '$cmd' ':tree-quickjump $group<ret>'"
done
}
#TODO
@ -173,6 +124,9 @@ face global Information rgb:44ccee+b
face global MatchingChar ,rgb:665c54+bF
# for LSP
face global DiagnosticInfo DiagnosticError
## Filetype formatting

View File

@ -2,7 +2,7 @@
"nodes": {
"agda": {
"inputs": {
"flake-utils": "flake-utils_6",
"flake-utils": "flake-utils_3",
"nixpkgs": [
"rachel",
"nixpkgs"
@ -47,7 +47,7 @@
"cornelis": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils_7",
"flake-utils": "flake-utils_4",
"nixpkgs": [
"rachel",
"nixpkgs"
@ -120,15 +120,12 @@
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"lastModified": 1678901627,
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
"type": "github"
},
"original": {
@ -139,14 +136,14 @@
},
"flake-utils_4": {
"inputs": {
"systems": "systems_4"
"systems": "systems_3"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
@ -157,7 +154,7 @@
},
"flake-utils_5": {
"inputs": {
"systems": "systems_5"
"systems": "systems_4"
},
"locked": {
"lastModified": 1694529238,
@ -174,59 +171,8 @@
}
},
"flake-utils_6": {
"locked": {
"lastModified": 1678901627,
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_7": {
"inputs": {
"systems": "systems_6"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_8": {
"inputs": {
"systems": "systems_7"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_9": {
"inputs": {
"systems": "systems_8"
"systems": "systems_5"
},
"locked": {
"lastModified": 1694529238,
@ -293,11 +239,11 @@
]
},
"locked": {
"lastModified": 1717362972,
"narHash": "sha256-lFgQ8R/K9TSf3hguXObzh6DPB8d3no/lfXWSLy8O+eI=",
"lastModified": 1718222105,
"narHash": "sha256-3hyVDQNIue0N505XlUGu9piUBlOYMPWaUk/iycVgNsU=",
"ref": "refs/heads/main",
"rev": "2266acf5cc14dc2f1aeb190e6adfef870ecaa7b8",
"revCount": 10138,
"rev": "2da2cf21138f7de8e4238049f7bb3cdd97db9286",
"revCount": 10457,
"type": "git",
"url": "https://githug.xyz/xenia/kakoune.git"
},
@ -306,29 +252,6 @@
"url": "https://githug.xyz/xenia/kakoune.git"
}
},
"kak-tree": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay",
"tree-sitters": "tree-sitters"
},
"locked": {
"lastModified": 1703888912,
"narHash": "sha256-Je77Ju5kbeiEviRweGANm6JzK4EXC/5sZJjFo6S37GE=",
"ref": "refs/heads/main",
"rev": "d80739e62df7f788f0c8a009dbcf9d503e71de76",
"revCount": 35,
"type": "git",
"url": "https://githug.xyz/xenia/kak-tree.git"
},
"original": {
"type": "git",
"url": "https://githug.xyz/xenia/kak-tree.git"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
@ -351,16 +274,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1681358109,
"narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=",
"owner": "NixOS",
"lastModified": 1717144377,
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9",
"rev": "805a384895c696f802a9bf5bf4720f37385df547",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"owner": "nixos",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
@ -382,36 +305,6 @@
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1697009197,
"narHash": "sha256-viVRhBTFT8fPJTb1N3brQIpFZnttmwo3JVKNuWRVc3s=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "01441e14af5e29c9d27ace398e6dd0b293e25a54",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1717144377,
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "805a384895c696f802a9bf5bf4720f37385df547",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1711703276,
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
@ -457,33 +350,13 @@
"ansi-utils": "ansi-utils",
"home-manager": "home-manager",
"kak": "kak",
"kak-tree": "kak-tree",
"nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs",
"rachel": "rachel",
"unambig-path": "unambig-path",
"unispect": "unispect"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1699669856,
"narHash": "sha256-OIb0WAoEMUA1EH70AwpWabdEpvYt/kJChBnb7XiXAJs=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "efd15e11c8954051a47679e7718b4c2a9b68ce27",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"slippi-desktop": {
"flake": false,
"locked": {
@ -502,7 +375,7 @@
},
"ssbm-nix": {
"inputs": {
"nixpkgs": "nixpkgs_4",
"nixpkgs": "nixpkgs_2",
"slippi-desktop": "slippi-desktop"
},
"locked": {
@ -594,73 +467,9 @@
"type": "github"
}
},
"systems_6": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_7": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_8": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tree-sitters": {
"inputs": {
"flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1703163600,
"narHash": "sha256-moGQSMrkzP+3P20Nkx3DIkL2R/rK5/KSakuF4JvPuGw=",
"ref": "refs/heads/main",
"rev": "b43f5ecea195346d4488da3a2f85e7b67360a137",
"revCount": 5,
"type": "git",
"url": "https://githug.xyz/xenia/tree-sitters"
},
"original": {
"type": "git",
"url": "https://githug.xyz/xenia/tree-sitters"
}
},
"unambig-path": {
"inputs": {
"flake-utils": "flake-utils_8",
"flake-utils": "flake-utils_5",
"nixpkgs": [
"nixpkgs"
]
@ -681,7 +490,7 @@
},
"unispect": {
"inputs": {
"flake-utils": "flake-utils_9",
"flake-utils": "flake-utils_6",
"nixpkgs": [
"nixpkgs"
]

View File

@ -17,10 +17,6 @@
url = "git+https://githug.xyz/xenia/kakoune.git";
inputs.nixpkgs.follows = "nixpkgs";
};
kak-tree = {
url = "git+https://githug.xyz/xenia/kak-tree.git";
inputs.nixpkgs.follows = "nixpkgs";
};
unispect = {
url = "git+https://git@githug.xyz/xenia/unispect";
inputs.nixpkgs.follows = "nixpkgs";
@ -39,7 +35,7 @@
};
};
outputs = { self, nixpkgs, home-manager, nix-darwin, kak, kak-tree, unispect, ansi-utils, unambig-path, rachel }:
outputs = { self, nixpkgs, home-manager, nix-darwin, kak, unispect, ansi-utils, unambig-path, rachel }:
let
xdg-runtime-dir = "/tmp/xdg-rt";
@ -51,7 +47,6 @@
unispect = unispect.packages.${system}.unispect;
ansi-utils = ansi-utils.packages.${system};
unambig-path = unambig-path.packages.${system}.unambig-path;
kak-tree = kak-tree.packages.${system}.kak-tree;
};
mkPC = {system, pkgs} : import ./home/graphical.nix {
inherit pkgs xdg-runtime-dir;

View File

@ -1,7 +1,7 @@
{ pkgs, username, home-dir, prompt-color, xdg-runtime-dir, kak-pkg, kak-tree, unispect, ansi-utils, unambig-path }:
{ pkgs, username, home-dir, prompt-color, xdg-runtime-dir, kak-pkg, unispect, ansi-utils, unambig-path }:
let
kak = import ./kak.nix { kak = kak-pkg; inherit pkgs kak-tree; };
kak = import ./kak.nix { kak = kak-pkg; inherit pkgs; };
extras = import ./extras.nix pkgs;
@ -30,7 +30,7 @@ in rec {
# Programming languages
jq
rink numbat
gleam erlang glas
gleam erlang
ghc
( python311.withPackages (ps: with ps; [
numpy matplotlib sympy scipy pandas jupyter
@ -44,7 +44,6 @@ in rec {
# nodePackages.typescript
# nodePackages.typescript-language-server
rust-analyzer
zulip-term
# (extras.challtools python311Packages)

View File

@ -1,4 +1,4 @@
{ pkgs, kak, kak-lsp ? pkgs.kak-lsp, kak-tree }:
{ pkgs, kak, kak-lsp ? pkgs.kak-lsp }:
with pkgs; let
kakoune-mirror = kakouneUtils.buildKakounePluginFrom2Nix {
pname = "kakoune-mirror";
@ -32,46 +32,46 @@ with pkgs; let
# NOTE: kak-lsp must be in packages
kakoune-lsp = kakouneUtils.buildKakounePluginFrom2Nix {
pname = "kak-lsp";
pname = "kakoune-lsp";
version = "latest";
src = fetchFromGitHub {
owner = "kak-lsp";
repo = "kak-lsp";
rev = "v14.2.0";
sha256 = "sha256-U4eqIzvYzUfwprVpPHV/OFPKiBXK4/5z2p8kknX2iME=";
owner = "kakoune-lsp";
repo = "kakoune-lsp";
rev = "v17.0.1";
sha256 = "sha256-uXKquAjfytUn/Q0kx+0BGRQTkVMQ9rMRnTCy622upag=";
};
meta.homepage = "https://github.com/kak-lsp/kak-lsp/";
meta.homepage = "https://github.com/kakoune-lsp/kakoune-lsp/";
};
kak-lsp-config-file = writeText "kak-lsp.toml" ''
file_watch_support = false
snippet_support = true
verbosity = 2
[language.haskell]
[language_server.haskell]
filetypes = ["haskell"]
roots = ["Setup.hs", "stack.yaml", "*.cabal"]
command = "haskell-language-server-wrapper"
roots = ["hie.yaml", "cabal.project", "Setup.hs", "stack.yaml", "*.cabal"]
command = "${pkgs.haskell-language-server}/bin/haskell-language-server-wrapper"
args = ["--lsp"]
[language.python]
[language_server.python]
filetypes = ["python"]
roots = ["requirements.txt", "setup.py", ".git", ".hg"]
command = "pylsp"
offset_encoding = "utf-8"
roots = ["requirements.txt", "setup.py", ".git"]
command = "pylsp" # use system pylsp
[language.rust]
[language_server.rust]
filetypes = ["rust"]
roots = ["Cargo.toml"]
command = "rust-analyzer"
command = "${pkgs.rust-analyzer}/bin/rust-analyzer"
[language.c]
filetypes = ["c"]
roots = ["compile_commands.json"]
command = "clangd"
[language.gleam]
[language_server.gleam]
filetypes = ["gleam"]
roots = ["gleam.toml"]
command = "glas"
command = "${pkgs.glas}/bin/glas"
[language_server.english]
filetypes = ["markdown", "latex"]
roots = []
command = "${pkgs.ltex-ls}/bin/ltex-ls"
'';
kak-lsp-config-line = "set global lsp_cmd \"${kak-lsp}/bin/kak-lsp -s %val{session} --config ${kak-lsp-config-file} --log /tmp/kak-lsp.log\"";
@ -89,7 +89,6 @@ in
kakoune-verilog
kakoune-lsp
kak-tree
];
config = {