From 2c3a00e96abc8c078d7d383d227805ad2df75be4 Mon Sep 17 00:00:00 2001 From: Ian J Sikes Date: Sun, 29 Sep 2024 21:58:19 -0400 Subject: [PATCH 01/11] Fix typo in tutor ch 13.5 (#11765) It said "split" instead of "swap" --- runtime/tutor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/tutor b/runtime/tutor index 98b9f3af1..d24f83d5e 100644 --- a/runtime/tutor +++ b/runtime/tutor @@ -1462,7 +1462,7 @@ letters! that is not good grammar. you can fix this. Still from hello2, press Ctrl-w H to swap with the split on the left: now hello2 is on the left and the tutor is on the top - right. After Ctrl-w you can use HJKL to split with the buffer + right. After Ctrl-w you can use HJKL to swap with the buffer on the left / below / above / on the right. Move back to the tutor split, and press Ctrl-w o to only keep From dd45ae128994bf6ee194d0d542ac1d533e77ae46 Mon Sep 17 00:00:00 2001 From: Dmitriy Sokolov Date: Mon, 30 Sep 2024 04:58:54 +0300 Subject: [PATCH 02/11] languages.toml: recognize ldtk files (#11793) --- languages.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/languages.toml b/languages.toml index 1918fcc32..2c2da34d6 100644 --- a/languages.toml +++ b/languages.toml @@ -446,6 +446,8 @@ file-types = [ { glob = ".watchmanconfig" }, "avsc", { glob = ".prettierrc" }, + "ldtk", + "ldtkl", ] language-servers = [ "vscode-json-language-server" ] auto-format = true From 48b89d4dcfde20aebb08a1d79aa14ab3fb559f30 Mon Sep 17 00:00:00 2001 From: Axlefublr <101342105+Axlefublr@users.noreply.github.com> Date: Mon, 30 Sep 2024 09:59:03 +0800 Subject: [PATCH 03/11] fix: fish builtin functions are highlighted as such (#11792) * fix: fish builtin functions are highlighted as such * fix: single-character commands recognized as builtins ???? how did that query even happen * fix: update builtins to fish 3.7.1 * fix: add back `alias` and `isatty` they are builtins, but aren't reported by builtin -n for some reason --- runtime/queries/fish/highlights.scm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/runtime/queries/fish/highlights.scm b/runtime/queries/fish/highlights.scm index 4235cdd62..27d509a00 100644 --- a/runtime/queries/fish/highlights.scm +++ b/runtime/queries/fish/highlights.scm @@ -101,19 +101,19 @@ ] ) -; non-builtin command names -(command name: (word) @function) - -; derived from builtin -n (fish 3.2.2) +; derived from builtin -n (fish 3.7.1) (command name: [ - (word) @function.builtin - (#match? @function.builtin "^(\.|:|_|alias|argparse|bg|bind|block|breakpoint|builtin|cd|command|commandline|complete|contains|count|disown|echo|emit|eval|exec|exit|fg|functions|history|isatty|jobs|math|printf|pwd|random|read|realpath|set|set_color|source|status|string|test|time|type|ulimit|wait)$") - ] + (word) @function.builtin + (#any-of? @function.builtin "abbr" "alias" "and" "argparse" "begin" "bg" "bind" "block" "break" "breakpoint" "builtin" "case" "cd" "command" "commandline" "complete" "contains" "continue" "count" "disown" "echo" "else" "emit" "end" "eval" "exec" "exit" "false" "fg" "for" "function" "functions" "history" "if" "isatty" "jobs" "math" "not" "or" "path" "printf" "pwd" "random" "read" "realpath" "return" "set" "set_color" "source" "status" "string" "switch" "test" "time" "true" "type" "ulimit" "wait" "while") + ] ) (test_command "test" @function.builtin) +; non-builtin command names +(command name: (word) @function) + ;; Functions (function_definition ["function" "end"] @keyword.function) From 8cdce9212ccf579c70ac3fc5710594030a5759a2 Mon Sep 17 00:00:00 2001 From: chtenb Date: Mon, 30 Sep 2024 03:59:31 +0200 Subject: [PATCH 04/11] Improve tree-sitter-subtree (#11663) * Make unnamed nodes visible in subtree view * Refine command description * Update generated docs * Update unit test expected output --- book/src/generated/typable-cmd.md | 2 +- helix-core/src/syntax.rs | 26 ++++++++++++++------------ helix-term/src/commands/typed.rs | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/book/src/generated/typable-cmd.md b/book/src/generated/typable-cmd.md index f48e1490a..7d3622256 100644 --- a/book/src/generated/typable-cmd.md +++ b/book/src/generated/typable-cmd.md @@ -72,7 +72,7 @@ | `:sort` | Sort ranges in selection. | | `:rsort` | Sort ranges in selection in reverse order. | | `:reflow` | Hard-wrap the current selection of lines to a given width. | -| `:tree-sitter-subtree`, `:ts-subtree` | Display tree sitter subtree under cursor, primarily for debugging queries. | +| `:tree-sitter-subtree`, `:ts-subtree` | Display the smallest tree-sitter subtree that spans the primary selection, primarily for debugging queries. | | `:config-reload` | Refresh user config. | | `:config-open` | Open the user config.toml file. | | `:config-open-workspace` | Open the workspace config.toml file. | diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 7be512f52..7de6ddf44 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -2692,6 +2692,8 @@ fn pretty_print_tree_impl( } write!(fmt, "({}", node.kind())?; + } else { + write!(fmt, " \"{}\"", node.kind())?; } // Handle children. @@ -2950,7 +2952,7 @@ mod test { #[test] fn test_pretty_print() { let source = r#"// Hello"#; - assert_pretty_print("rust", source, "(line_comment)", 0, source.len()); + assert_pretty_print("rust", source, "(line_comment \"//\")", 0, source.len()); // A large tree should be indented with fields: let source = r#"fn main() { @@ -2960,16 +2962,16 @@ mod test { "rust", source, concat!( - "(function_item\n", + "(function_item \"fn\"\n", " name: (identifier)\n", - " parameters: (parameters)\n", - " body: (block\n", + " parameters: (parameters \"(\" \")\")\n", + " body: (block \"{\"\n", " (expression_statement\n", " (macro_invocation\n", - " macro: (identifier)\n", - " (token_tree\n", - " (string_literal\n", - " (string_content)))))))", + " macro: (identifier) \"!\"\n", + " (token_tree \"(\"\n", + " (string_literal \"\"\"\n", + " (string_content) \"\"\") \")\")) \";\") \"}\"))", ), 0, source.len(), @@ -2981,7 +2983,7 @@ mod test { // Error nodes are printed as errors: let source = r#"}{"#; - assert_pretty_print("rust", source, "(ERROR)", 0, source.len()); + assert_pretty_print("rust", source, "(ERROR \"}\" \"{\")", 0, source.len()); // Fields broken under unnamed nodes are determined correctly. // In the following source, `object` belongs to the `singleton_method` @@ -2996,11 +2998,11 @@ mod test { "ruby", source, concat!( - "(singleton_method\n", - " object: (self)\n", + "(singleton_method \"def\"\n", + " object: (self) \".\"\n", " name: (identifier)\n", " body: (body_statement\n", - " (true)))" + " (true)) \"end\")" ), 0, source.len(), diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 7ad0369fc..68ba9bab5 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -3032,7 +3032,7 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[ TypableCommand { name: "tree-sitter-subtree", aliases: &["ts-subtree"], - doc: "Display tree sitter subtree under cursor, primarily for debugging queries.", + doc: "Display the smallest tree-sitter subtree that spans the primary selection, primarily for debugging queries.", fun: tree_sitter_subtree, signature: CommandSignature::none(), }, From 5ffd4ae5292c1154619230dc9b74eefb25001f04 Mon Sep 17 00:00:00 2001 From: chtenb Date: Mon, 30 Sep 2024 04:01:36 +0200 Subject: [PATCH 05/11] Add undocumented keybindings to book (#11662) --- book/src/keymap.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/book/src/keymap.md b/book/src/keymap.md index e7ae6ae47..71ae5e31f 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -145,6 +145,9 @@ Normal mode is the default mode when you launch helix. You can return to it from | `Alt-i`, `Alt-down` | Shrink syntax tree object selection (**TS**) | `shrink_selection` | | `Alt-p`, `Alt-left` | Select previous sibling node in syntax tree (**TS**) | `select_prev_sibling` | | `Alt-n`, `Alt-right` | Select next sibling node in syntax tree (**TS**) | `select_next_sibling` | +| `Alt-a` | Select all sibling nodes in syntax tree (**TS**) | `select_all_siblings` | +| `Alt-e` | Move to end of parent node in syntax tree (**TS**) | `move_parent_node_end` | +| `Alt-b` | Move to start of parent node in syntax tree (**TS**) | `move_parent_node_start` | ### Search From 24f24299f27efbf5fb4ce02dfc7e77cd036035f7 Mon Sep 17 00:00:00 2001 From: RoloEdits Date: Sun, 29 Sep 2024 19:01:49 -0700 Subject: [PATCH 06/11] feat(languages): add `superhtml` as lsp for `html` (#11609) --- book/src/generated/lang-support.md | 2 +- languages.toml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 8a8c9fa83..f035b5ec5 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -87,7 +87,7 @@ | hocon | ✓ | ✓ | ✓ | | | hoon | ✓ | | | | | hosts | ✓ | | | | -| html | ✓ | | | `vscode-html-language-server` | +| html | ✓ | | | `vscode-html-language-server`, `superhtml` | | hurl | ✓ | ✓ | ✓ | | | hyprlang | ✓ | | ✓ | | | idris | | | | `idris2-lsp` | diff --git a/languages.toml b/languages.toml index 2c2da34d6..ed3f89660 100644 --- a/languages.toml +++ b/languages.toml @@ -94,6 +94,7 @@ solc = { command = "solc", args = ["--lsp"] } sourcekit-lsp = { command = "sourcekit-lsp" } svlangserver = { command = "svlangserver", args = [] } swipl = { command = "swipl", args = [ "-g", "use_module(library(lsp_server))", "-g", "lsp_server:main", "-t", "halt", "--", "stdio" ] } +superhtml = { command = "superhtml", args = ["lsp"]} tailwindcss-ls = { command = "tailwindcss-language-server", args = ["--stdio"] } taplo = { command = "taplo", args = ["lsp", "stdio"] } templ = { command = "templ", args = ["lsp"] } @@ -841,7 +842,7 @@ scope = "text.html.basic" injection-regex = "html" file-types = ["html", "htm", "shtml", "xhtml", "xht", "jsp", "asp", "aspx", "jshtm", "volt", "rhtml", "cshtml"] block-comment-tokens = { start = "" } -language-servers = [ "vscode-html-language-server" ] +language-servers = [ "vscode-html-language-server", "superhtml" ] auto-format = true indent = { tab-width = 2, unit = " " } From 5975e5360071beda9e4e3af2fca5883a569ae071 Mon Sep 17 00:00:00 2001 From: David Else <12832280+David-Else@users.noreply.github.com> Date: Mon, 30 Sep 2024 03:02:02 +0100 Subject: [PATCH 07/11] Add vale language server (#11636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Blaž Hrastnik --- languages.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/languages.toml b/languages.toml index ed3f89660..d6591fb28 100644 --- a/languages.toml +++ b/languages.toml @@ -102,6 +102,7 @@ terraform-ls = { command = "terraform-ls", args = ["serve"] } texlab = { command = "texlab" } typespec = { command = "tsp-server", args = ["--stdio"] } vala-language-server = { command = "vala-language-server" } +vale-ls = { command = "vale-ls" } vhdl_ls = { command = "vhdl_ls", args = [] } vlang-language-server = { command = "v-analyzer" } vscode-css-language-server = { command = "vscode-css-language-server", args = ["--stdio"], config = { provideFormatter = true, css = { validate = { enable = true } } } } @@ -3807,5 +3808,4 @@ language-servers = ["circom-lsp"] [[grammar]] name = "circom" -source = { git = "https://github.com/Decurity/tree-sitter-circom", rev = "02150524228b1e6afef96949f2d6b7cc0aaf999e" } - +source = { git = "https://github.com/Decurity/tree-sitter-circom", rev = "02150524228b1e6afef96949f2d6b7cc0aaf999e" } \ No newline at end of file From e1cacd149c10033e168284f2e49de70ae548f6f1 Mon Sep 17 00:00:00 2001 From: Oren Mittman Date: Sun, 29 Sep 2024 22:02:19 -0400 Subject: [PATCH 08/11] chore: add "ui.virtual.jump-label" to gruber-darker theme (#11547) --- runtime/themes/gruber-darker.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/themes/gruber-darker.toml b/runtime/themes/gruber-darker.toml index 4737f52f7..4ae0404e8 100644 --- a/runtime/themes/gruber-darker.toml +++ b/runtime/themes/gruber-darker.toml @@ -67,6 +67,7 @@ "ui.virtual.ruler" = { bg = "bg1" } "ui.virtual.inlay-hint" = { fg = "bg7" } "ui.virtual.wrap" = { fg = "bg2" } +"ui.virtual.jump-label" = { fg = "red3", modifiers = ["bold"] } "diagnostic.warning" = { underline = { color = "orange1", style = "dashed" } } "diagnostic.error" = { underline = { color = "red3", style = "dashed" } } From 42453786a0530d0d0bb26e6420e1631939cb04b9 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Sun, 29 Sep 2024 21:06:24 -0500 Subject: [PATCH 09/11] add key concepts to usage.md (#11485) --- book/src/usage.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/book/src/usage.md b/book/src/usage.md index 859cb6709..a22a18492 100644 --- a/book/src/usage.md +++ b/book/src/usage.md @@ -7,3 +7,27 @@ can be accessed via the command `hx --tutor` or `:tutor`. > 💡 Currently, not all functionality is fully documented, please refer to the > [key mappings](./keymap.md) list. +## Modes + +Helix is a modal editor, meaning it has different modes for different tasks. The main modes are: + +* [Normal mode](./keymap.md#normal-mode): For navigation and editing commands. This is the default mode. +* [Insert mode](./keymap.md#insert-mode): For typing text directly into the document. Access by typing `i` in normal mode. +* [Select/extend mode](./keymap.md#select--extend-mode): For making selections and performing operations on them. Access by typing `v` in normal mode. + +## Buffers + +Buffers are in-memory representations of files. You can have multiple buffers open at once. Use [pickers](./pickers.md) or commands like `:buffer-next` and `:buffer-previous` to open buffers or switch between them. + +## Selection-first editing + +Inspired by [Kakoune](http://kakoune.org/), Helix follows the `selection → action` model. This means that whatever you are going to act on (a word, a paragraph, a line, etc.) is selected first and the action itself (delete, change, yank, etc.) comes second. A cursor is simply a single width selection. + +## Multiple selections + +Also inspired by Kakoune, multiple selections are a core mode of interaction in Helix. For example, the standard way of replacing multiple instance of a word is to first select all instances (so there is one selection per instance) and then use the change action (`c`) to edit them all at the same time. + +## Motions + +Motions are commands that move the cursor or modify selections. They're used for navigation and text manipulation. Examples include `w` to move to the next word, or `f` to find a character. See the [Movement](./keymap.md#movement) section of the keymap for more motions. + From d103248cb847fca4f7b0b11691d4c7ff6582b588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Krienb=C3=BChl?= Date: Mon, 30 Sep 2024 04:06:33 +0200 Subject: [PATCH 10/11] Small bogster theme improvements (#11353) * Add a distinct jump-label to bogster theme * Make the primary label visible in the bogster theme --- runtime/themes/bogster.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/themes/bogster.toml b/runtime/themes/bogster.toml index f7d08daa9..9d360e821 100644 --- a/runtime/themes/bogster.toml +++ b/runtime/themes/bogster.toml @@ -59,8 +59,10 @@ "ui.text.focus" = { fg = "bogster-fg1", modifiers= ["bold"] } "ui.virtual.whitespace" = "bogster-base5" "ui.virtual.ruler" = { bg = "bogster-base0" } +"ui.virtual.jump-label" = { fg = "bogster-base0", bg = "bogster-yellow", modifiers = [ "bold" ] } -"ui.selection" = { bg = "bogster-base3" } +"ui.selection" = { bg = "bogster-base2" } +"ui.selection.primary" = { bg = "bogster-base3" } "ui.cursor.match" = { fg = "bogster-base3", bg = "bogster-orange" } "ui.cursor" = { fg = "bogster-base5", modifiers = ["reversed"] } From e5dd60f794d055a01bee284ef923564936ebbe90 Mon Sep 17 00:00:00 2001 From: offsetcyan Date: Mon, 30 Sep 2024 03:06:45 +0100 Subject: [PATCH 11/11] Add Erlang Language Platform (ELP) support to Erlang (#11499) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add ELP LSP to Erlang * generate docs --------- Co-authored-by: Blaž Hrastnik --- book/src/generated/lang-support.md | 2 +- languages.toml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index f035b5ec5..79f3a6964 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -49,7 +49,7 @@ | elvish | ✓ | | | `elvish` | | env | ✓ | ✓ | | | | erb | ✓ | | | | -| erlang | ✓ | ✓ | | `erlang_ls` | +| erlang | ✓ | ✓ | | `erlang_ls`, `elp` | | esdl | ✓ | | | | | fidl | ✓ | | | | | fish | ✓ | ✓ | ✓ | | diff --git a/languages.toml b/languages.toml index d6591fb28..806aa815e 100644 --- a/languages.toml +++ b/languages.toml @@ -33,6 +33,7 @@ dot-language-server = { command = "dot-language-server", args = ["--stdio"] } earthlyls = { command = "earthlyls" } elixir-ls = { command = "elixir-ls", config = { elixirLS.dialyzerEnabled = false } } elm-language-server = { command = "elm-language-server" } +elp = { command = "elp", args = ["server"] } elvish = { command = "elvish", args = ["-lsp"] } erlang-ls = { command = "erlang_ls" } forc = { command = "forc", args = ["lsp"] } @@ -1800,7 +1801,7 @@ roots = ["rebar.config"] shebangs = ["escript"] comment-token = "%%" indent = { tab-width = 4, unit = " " } -language-servers = [ "erlang-ls" ] +language-servers = [ "erlang-ls", "elp" ] [[grammar]] name = "erlang" @@ -3808,4 +3809,4 @@ language-servers = ["circom-lsp"] [[grammar]] name = "circom" -source = { git = "https://github.com/Decurity/tree-sitter-circom", rev = "02150524228b1e6afef96949f2d6b7cc0aaf999e" } \ No newline at end of file +source = { git = "https://github.com/Decurity/tree-sitter-circom", rev = "02150524228b1e6afef96949f2d6b7cc0aaf999e" }