configure helix

This commit is contained in:
Schrottkatze 2024-04-03 19:04:00 +02:00
parent c1d4aba9c3
commit 9ed3cde274
Signed by: schrottkatze
SSH key fingerprint: SHA256:hXb3t1vINBFCiDCmhRABHX5ocdbLiKyCdKI4HK2Rbbc

View file

@ -3,14 +3,7 @@
pkgs-unstable-small, pkgs-unstable-small,
... ...
}: { }: {
home-manager.users.jade = {pkgs, ...}: let home-manager.users.jade = {pkgs, ...}: {
typstGrammar = pkgs.fetchFromGitHub {
owner = "uben0";
repo = "tree-sitter-typst";
rev = "baddc325e858afff90501dbefa00ecfa28528931";
sha256 = "sha256-XZAgnpb1B8EZ2WXPj/JYSZGsmpKsnDiBFCDF0XjunOM";
};
in {
home = { home = {
sessionVariables.EDITOR = "hx"; sessionVariables.EDITOR = "hx";
packages = [ packages = [
@ -21,11 +14,6 @@
pkgs.typst-lsp pkgs.typst-lsp
]; ];
}; };
home.file = {
".config/helix/runtime/queries" = {
source = "${typstGrammar}/queries";
};
};
programs.helix = { programs.helix = {
enable = true; enable = true;
package = pkgs-unstable-small.helix; package = pkgs-unstable-small.helix;
@ -40,6 +28,8 @@
display-messages = true; display-messages = true;
display-inlay-hints = true; display-inlay-hints = true;
}; };
completion-replace = true;
popup-border = "popup";
shell = ["nu" "-c"]; shell = ["nu" "-c"];
statusline.left = [ statusline.left = [
"mode" "mode"
@ -147,22 +137,11 @@
args = ["--language-server"]; args = ["--language-server"];
}; };
"typst-lsp" = { "typst-lsp" = {
command = "typst-lsp";
config = { config = {
exportPdf = "onType"; exportPdf = "onType";
}; };
}; };
}; };
grammar = [
{
name = "typst";
source = {
git = "https://github.com/uben0/tree-sitter-typst";
rev = "baddc325e858afff90501dbefa00ecfa28528931";
# path = "${typstGrammar}";
};
}
];
language = [ language = [
{ {
name = "nu"; name = "nu";
@ -172,30 +151,6 @@
name = "php"; name = "php";
language-servers = ["psalm"]; language-servers = ["psalm"];
} }
{
name = "typst";
scope = "source.typst";
file-types = ["typ" "typst"];
injection-regex = "typ(st)?";
comment-token = "//";
indent = {
tab-width = 2;
unit = " ";
};
roots = ["typst.toml"];
formatter = {
command = "${pkgs.typstfmt}/bin/typstfmt";
};
auto-format = true;
language-servers = ["typst-lsp"];
auto-pairs = {
"(" = ")";
"{" = "}";
"[" = "]";
"$" = "$";
"\"" = "\"";
};
}
{ {
name = "nix"; name = "nix";
formatter = { formatter = {