Add simple completion language server and snippets to helix

This commit is contained in:
Lillian Violet 2024-05-01 23:27:11 +02:00
parent aef17801f6
commit f909759031
2 changed files with 32 additions and 3 deletions

View file

@ -36,14 +36,14 @@
language-id = "python"; language-id = "python";
auto-format = true; auto-format = true;
file-types = ["py"]; file-types = ["py"];
language-servers = ["ruff"]; language-servers = ["ruff" "scls"];
} }
{ {
name = "typst"; name = "typst";
language-id = "typst"; language-id = "typst";
auto-format = false; auto-format = false;
file-types = ["typ"]; file-types = ["typ"];
language-servers = ["typst-lsp"]; language-servers = ["typst-lsp" "scls"];
} }
{ {
name = "rust"; name = "rust";
@ -51,7 +51,16 @@
auto-format = true; auto-format = true;
file-types = ["rs"]; file-types = ["rs"];
roots = ["Cargo.lock"]; roots = ["Cargo.lock"];
language-servers = ["rust-analyzer"]; language-servers = ["rust-analyzer" "scls"];
}
{
name = "stub";
scope = "text.stub";
file-types = [];
shebangs = [];
roots = [];
auto-format = false;
language-servers = ["scls"];
} }
{ {
name = "nix"; name = "nix";
@ -79,7 +88,24 @@
nil = { nil = {
command = "nil"; command = "nil";
}; };
scls = {
command = "simple-completion-language-server";
config = {
max_completion_items = 20;
snippets_first = true;
feature_words = true;
feature_snippets = true;
feature_unicode_input = true;
feature_paths = true;
};
};
}; };
}; };
}; };
home.file = {
"helix" = {
source = ./snippets.toml;
target = ".config/helix/external-snippets.toml";
};
};
} }

View file

@ -0,0 +1,3 @@
[[sources]] # list of sources to load
name = "friendly-snippets" # optional name shown on snippet description
git = "https://github.com/rafamadriz/friendly-snippets.git" # git repo with snippets collections