feat: cooklang

Also reformats using the RFC

Signed-off-by: jolheiser <git@jolheiser.com>
main
jolheiser 2024-09-25 15:24:56 -05:00
parent e3791ad55c
commit a6f4760ef5
No known key found for this signature in database
1 changed files with 159 additions and 44 deletions

View File

@ -1,5 +1,13 @@
{pkgs ? import <nixpkgs> {}}: { {
ignore = [".idea/" "result" "node_modules/" "dist/"]; pkgs ? import <nixpkgs> { },
}:
{
ignore = [
".idea/"
"result"
"node_modules/"
"dist/"
];
settings = { settings = {
theme = "catppuccin_mocha_transparent"; theme = "catppuccin_mocha_transparent";
editor = { editor = {
@ -43,33 +51,61 @@
S-right = "goto_next_buffer"; S-right = "goto_next_buffer";
S-left = "goto_previous_buffer"; S-left = "goto_previous_buffer";
C-b = ":buffer-close"; C-b = ":buffer-close";
C-s = ["select_all" "select_regex"]; C-s = [
"select_all"
"select_regex"
];
C-j = "shrink_selection"; C-j = "shrink_selection";
C-k = "expand_selection"; C-k = "expand_selection";
C-l = "select_next_sibling"; C-l = "select_next_sibling";
C-a = "select_all"; C-a = "select_all";
C-u = ["half_page_up" "align_view_center"]; C-u = [
C-d = ["half_page_down" "align_view_center"]; "half_page_up"
"align_view_center"
];
C-d = [
"half_page_down"
"align_view_center"
];
"{" = ["goto_prev_paragraph" "collapse_selection"]; "{" = [
"}" = ["goto_next_paragraph" "collapse_selection"]; "goto_prev_paragraph"
"collapse_selection"
];
"}" = [
"goto_next_paragraph"
"collapse_selection"
];
"0" = "goto_line_start"; "0" = "goto_line_start";
"$" = "goto_line_end"; "$" = "goto_line_end";
"^" = "goto_first_nonwhitespace"; "^" = "goto_first_nonwhitespace";
G = "goto_file_end"; G = "goto_file_end";
"%" = "match_brackets"; "%" = "match_brackets";
V = ["select_mode" "extend_to_line_bounds"]; V = [
C = ["collapse_selection" "extend_to_line_end" "change_selection"]; "select_mode"
D = ["extend_to_line_end" "delete_selection"]; "extend_to_line_bounds"
];
C = [
"collapse_selection"
"extend_to_line_end"
"change_selection"
];
D = [
"extend_to_line_end"
"delete_selection"
];
S = "surround_add"; S = "surround_add";
d = { d = {
d = ["extend_to_line_bounds" "delete_selection"]; d = [
t = ["extend_till_char"]; "extend_to_line_bounds"
s = ["surround_delete"]; "delete_selection"
i = ["select_textobject_inner"]; ];
a = ["select_textobject_around"]; t = [ "extend_till_char" ];
s = [ "surround_delete" ];
i = [ "select_textobject_inner" ];
a = [ "select_textobject_around" ];
}; };
x = "delete_selection"; x = "delete_selection";
@ -88,16 +124,40 @@
"collapse_selection" "collapse_selection"
]; ];
w = ["move_next_word_start" "move_char_right" "collapse_selection"]; w = [
e = ["move_next_word_end" "collapse_selection"]; "move_next_word_start"
b = ["move_prev_word_start" "collapse_selection"]; "move_char_right"
"collapse_selection"
];
e = [
"move_next_word_end"
"collapse_selection"
];
b = [
"move_prev_word_start"
"collapse_selection"
];
i = ["insert_mode" "collapse_selection"]; i = [
a = ["append_mode" "collapse_selection"]; "insert_mode"
"collapse_selection"
];
a = [
"append_mode"
"collapse_selection"
];
esc = ["collapse_selection" "keep_primary_selection"]; esc = [
"collapse_selection"
"keep_primary_selection"
];
};
insert = {
esc = [
"collapse_selection"
"normal_mode"
];
}; };
insert = {esc = ["collapse_selection" "normal_mode"];};
select = { select = {
space = { space = {
j = { j = {
@ -105,28 +165,60 @@
c = ":pipe jq -c"; c = ":pipe jq -c";
}; };
}; };
"{" = ["extend_to_line_bounds" "goto_prev_paragraph"]; "{" = [
"}" = ["extend_to_line_bounds" "goto_next_paragraph"]; "extend_to_line_bounds"
"goto_prev_paragraph"
];
"}" = [
"extend_to_line_bounds"
"goto_next_paragraph"
];
"0" = "goto_line_start"; "0" = "goto_line_start";
"$" = "goto_line_end"; "$" = "goto_line_end";
"^" = "goto_first_nonwhitespace"; "^" = "goto_first_nonwhitespace";
G = "goto_file_end"; G = "goto_file_end";
D = ["extend_to_line_bounds" "delete_selection" "normal_mode"]; D = [
C = ["goto_line_start" "extend_to_line_bounds" "change_selection"]; "extend_to_line_bounds"
"delete_selection"
"normal_mode"
];
C = [
"goto_line_start"
"extend_to_line_bounds"
"change_selection"
];
"%" = "match_brackets"; "%" = "match_brackets";
S = "surround_add"; S = "surround_add";
i = "select_textobject_inner"; i = "select_textobject_inner";
a = "select_textobject_around"; a = "select_textobject_around";
tab = ["insert_mode" "collapse_selection"]; tab = [
C-a = ["append_mode" "collapse_selection"]; "insert_mode"
"collapse_selection"
];
C-a = [
"append_mode"
"collapse_selection"
];
k = ["extend_line_up" "extend_to_line_bounds"]; k = [
j = ["extend_line_down" "extend_to_line_bounds"]; "extend_line_up"
"extend_to_line_bounds"
];
j = [
"extend_line_down"
"extend_to_line_bounds"
];
d = ["yank_main_selection_to_clipboard" "delete_selection"]; d = [
x = ["yank_main_selection_to_clipboard" "delete_selection"]; "yank_main_selection_to_clipboard"
"delete_selection"
];
x = [
"yank_main_selection_to_clipboard"
"delete_selection"
];
y = [ y = [
"yank_main_selection_to_clipboard" "yank_main_selection_to_clipboard"
"normal_mode" "normal_mode"
@ -143,7 +235,11 @@
p = "replace_selections_with_clipboard"; p = "replace_selections_with_clipboard";
P = "paste_clipboard_before"; P = "paste_clipboard_before";
esc = ["collapse_selection" "keep_primary_selection" "normal_mode"]; esc = [
"collapse_selection"
"keep_primary_selection"
"normal_mode"
];
}; };
}; };
}; };
@ -153,7 +249,10 @@
name = "go"; name = "go";
formatter = { formatter = {
command = "sh"; command = "sh";
args = ["-c" "set -o pipefail; ${gotools}/bin/goimports | ${gofumpt}/bin/gofumpt"]; args = [
"-c"
"set -o pipefail; ${gotools}/bin/goimports | ${gofumpt}/bin/gofumpt"
];
}; };
} }
{ {
@ -161,7 +260,10 @@
auto-format = true; auto-format = true;
formatter = with python311Packages; { formatter = with python311Packages; {
command = "${black}/bin/black"; command = "${black}/bin/black";
args = ["--quiet" "-"]; args = [
"--quiet"
"-"
];
}; };
} }
{ {
@ -169,7 +271,7 @@
auto-format = true; auto-format = true;
formatter = { formatter = {
command = "${nixfmt-rfc-style}/bin/nixfmt"; command = "${nixfmt-rfc-style}/bin/nixfmt";
args = ["-q"]; args = [ "-q" ];
}; };
} }
{ {
@ -177,7 +279,7 @@
auto-format = true; auto-format = true;
formatter = { formatter = {
command = "${templ}/bin/templ"; command = "${templ}/bin/templ";
args = ["fmt"]; args = [ "fmt" ];
}; };
} }
{ {
@ -190,7 +292,7 @@
auto-format = true; auto-format = true;
formatter = { formatter = {
command = "${dhall}/bin/dhall"; command = "${dhall}/bin/dhall";
args = ["format"]; args = [ "format" ];
}; };
} }
{ {
@ -198,36 +300,49 @@
auto-format = true; auto-format = true;
formatter = { formatter = {
command = "${jsonnet}/bin/jsonnetfmt"; command = "${jsonnet}/bin/jsonnetfmt";
args = ["-"]; args = [ "-" ];
}; };
} }
{
name = "cooklang";
scope = "source.cook";
injection-regex = "cook";
file-types = [ "cook" ];
}
]; ];
language-server = { language-server = {
nil.config.nil.nix.flake.autoEvalInputs = true; nil.config.nil.nix.flake.autoEvalInputs = true;
gpt = { gpt = {
command = "${helix-gpt}"; command = "${helix-gpt}";
args = ["--handler=codeium"]; args = [ "--handler=codeium" ];
}; };
}; };
}; };
themes = { themes = {
catppuccin_frappe_transparent = { catppuccin_frappe_transparent = {
inherits = "catppuccin_frappe"; inherits = "catppuccin_frappe";
"ui.background" = {}; "ui.background" = { };
}; };
catppuccin_latte_transparent = { catppuccin_latte_transparent = {
inherits = "catppuccin_latte"; inherits = "catppuccin_latte";
"ui.background" = {}; "ui.background" = { };
}; };
catppuccin_macchiato_transparent = { catppuccin_macchiato_transparent = {
inherits = "catppuccin_macchiato"; inherits = "catppuccin_macchiato";
"ui.background" = {}; "ui.background" = { };
}; };
catppuccin_mocha_transparent = { catppuccin_mocha_transparent = {
inherits = "catppuccin_mocha"; inherits = "catppuccin_mocha";
"ui.background" = {}; "ui.background" = { };
}; };
}; };
grammars = [ grammars = [
{
name = "cooklang";
url = "https://github.com/jolheiser/tree-sitter-cooklang";
rev = "a87b94729c0e4276a3e7b9fdccf497c268a2e1b8";
sha256 = "sha256-j6WD1+WVTLlq0x0WkFWWR8JHYk2jObSRDNEz6SUWovw=";
queries = "queries";
}
]; ];
} }