2023-11-26 20:26:49 +00:00
|
|
|
{config, ...}: {
|
2024-02-28 16:06:04 +00:00
|
|
|
home-manager.users.jade = {pkgs, ...}: let
|
|
|
|
typstGrammar = pkgs.fetchFromGitHub {
|
|
|
|
owner = "uben0";
|
|
|
|
repo = "tree-sitter-typst";
|
|
|
|
rev = "baddc325e858afff90501dbefa00ecfa28528931";
|
|
|
|
sha256 = "sha256-XZAgnpb1B8EZ2WXPj/JYSZGsmpKsnDiBFCDF0XjunOM";
|
|
|
|
};
|
|
|
|
in {
|
2023-11-14 11:22:19 +00:00
|
|
|
home = {
|
|
|
|
sessionVariables.EDITOR = "hx";
|
2023-11-26 20:26:49 +00:00
|
|
|
packages = [
|
|
|
|
pkgs.nil
|
2023-12-08 10:49:22 +00:00
|
|
|
pkgs.vscode-langservers-extracted
|
|
|
|
pkgs.nodePackages.typescript-language-server
|
|
|
|
pkgs.emmet-language-server
|
2024-02-28 16:06:04 +00:00
|
|
|
pkgs.typst-lsp
|
2023-11-14 11:22:19 +00:00
|
|
|
];
|
|
|
|
};
|
2024-02-28 16:06:04 +00:00
|
|
|
home.file = {
|
|
|
|
".config/helix/runtime/queries" = {
|
|
|
|
source = "${typstGrammar}/queries";
|
|
|
|
};
|
|
|
|
};
|
2023-11-14 11:22:19 +00:00
|
|
|
programs.helix = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
theme = "gruvbox";
|
|
|
|
editor = {
|
|
|
|
line-number = "relative";
|
2024-02-28 16:06:04 +00:00
|
|
|
bufferline = "multiple";
|
|
|
|
color-modes = true;
|
|
|
|
lsp = {
|
|
|
|
display-messages = true;
|
|
|
|
display-inlay-hints = true;
|
|
|
|
};
|
|
|
|
shell = ["nu" "-c"];
|
|
|
|
idle-timeout = 0;
|
2023-11-22 10:47:26 +00:00
|
|
|
indent-guides = {
|
|
|
|
render = true;
|
|
|
|
character = "│";
|
|
|
|
};
|
|
|
|
whitespace = {
|
|
|
|
render = {
|
|
|
|
space = "all";
|
|
|
|
tab = "all";
|
|
|
|
newline = "none";
|
|
|
|
};
|
|
|
|
characters = {
|
|
|
|
space = "·";
|
|
|
|
nbsp = "⍽";
|
|
|
|
tab = "→";
|
|
|
|
};
|
|
|
|
};
|
2023-11-14 11:22:19 +00:00
|
|
|
};
|
|
|
|
keys.normal = {
|
|
|
|
space."=" = ":fmt";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
languages = {
|
2024-02-28 16:06:04 +00:00
|
|
|
language-server = {
|
|
|
|
"nu-builtin-lsp" = {
|
|
|
|
command = "${config.users.defaultUserShell}/bin/nu";
|
|
|
|
args = ["--lsp"];
|
|
|
|
};
|
|
|
|
"rust-analyzer" = {
|
|
|
|
config = {
|
|
|
|
check.command = "clippy";
|
|
|
|
completion.snippets.custom = {
|
|
|
|
"pub fn" = {
|
|
|
|
prefix = ["pfn" "pubfn"];
|
|
|
|
postfix = ["pfn"];
|
|
|
|
body = [
|
|
|
|
"pub fn $\{receiver\}() {"
|
|
|
|
"\\t$1"
|
|
|
|
"}"
|
|
|
|
];
|
|
|
|
scope = "type";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
"emmet-language-server" = {
|
|
|
|
command = "emmet-language-server";
|
|
|
|
args = ["--stdio"];
|
|
|
|
};
|
|
|
|
# "php" = {
|
|
|
|
# name = "php";
|
|
|
|
# file-types = [ "php" ];
|
|
|
|
# language-server = {
|
|
|
|
# command = "psalm";
|
|
|
|
# args = ["--language-server"];
|
|
|
|
# };
|
|
|
|
# };
|
|
|
|
"typst-lsp" = {
|
|
|
|
command = "typst-lsp";
|
|
|
|
config = {
|
|
|
|
exportPdf = "onType";
|
|
|
|
};
|
2023-11-14 11:22:19 +00:00
|
|
|
};
|
|
|
|
};
|
2024-02-28 16:06:04 +00:00
|
|
|
grammar = [
|
|
|
|
{
|
|
|
|
name = "typst";
|
|
|
|
source = {
|
|
|
|
git = "https://github.com/uben0/tree-sitter-typst";
|
|
|
|
rev = "baddc325e858afff90501dbefa00ecfa28528931";
|
|
|
|
# path = "${typstGrammar}";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2023-11-20 00:29:52 +00:00
|
|
|
language = [
|
|
|
|
{
|
|
|
|
name = "nu";
|
2023-11-26 20:26:49 +00:00
|
|
|
language-servers = ["nu-builtin-lsp"];
|
2023-11-20 00:29:52 +00:00
|
|
|
}
|
2024-02-28 16:06:04 +00:00
|
|
|
{
|
|
|
|
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 = {
|
|
|
|
"(" = ")";
|
|
|
|
"{" = "}";
|
|
|
|
"[" = "]";
|
|
|
|
"$" = "$";
|
|
|
|
"\"" = "\"";
|
|
|
|
};
|
|
|
|
}
|
2023-11-26 20:34:14 +00:00
|
|
|
{
|
|
|
|
name = "nix";
|
|
|
|
formatter = {
|
|
|
|
command = "${pkgs.alejandra}/bin/alejandra";
|
|
|
|
args = ["--quiet"];
|
|
|
|
};
|
|
|
|
auto-format = true;
|
|
|
|
}
|
2023-12-08 10:49:22 +00:00
|
|
|
{
|
|
|
|
name = "html";
|
|
|
|
roots = [".git"];
|
2023-12-15 13:38:15 +00:00
|
|
|
language-servers = ["vscode-html-language-server" "emmet-language-server"];
|
|
|
|
auto-format = false;
|
2023-12-08 10:49:22 +00:00
|
|
|
}
|
2023-11-20 00:29:52 +00:00
|
|
|
];
|
2023-11-14 11:22:19 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|