Compare commits

...

13 Commits

Author SHA1 Message Date
Michael Davis
feaf58bcb3
Merge 9c108b5486 into 239262e094 2024-11-20 15:59:11 -06:00
Mark Stosberg
239262e094
docs: Document what directory file_picker opens from (#10816) 2024-11-20 15:58:50 -06:00
Eduardo Rittner Coelho
23600e3ecb
Add correct source file for TypableCommandList (#11839)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2024-11-20 15:58:24 -06:00
Sam Kagan
287e412780
docs(keymap): add select_all_children (#11972)
Co-authored-by: Sam Kagan <skagan@nrao.edu>
2024-11-20 15:58:00 -06:00
stefanvi
bc18dc2c0c
Pluralize 'parenthesis' in the tutorial (#12015) 2024-11-20 15:57:42 -06:00
Sebastian Dörner
3fd7ca334e
Add support for textproto language. (#11874) 2024-11-20 15:57:30 -06:00
Oren Mittman
6373027c9e
chore: add "ui.virtual.jump-label" to serika-dark theme (#11911) 2024-11-20 15:57:15 -06:00
dependabot[bot]
f06f481ad9
build(deps): bump the rust-dependencies group with 5 updates (#12088)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-20 15:56:56 -06:00
dependabot[bot]
a219d5aabb
build(deps): bump unicode-general-category from 0.6.0 to 1.0.0 (#12089)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-20 11:41:07 -06:00
Michael Davis
d489c03c4f helix-term: Use workspace thiserror dep 2024-11-20 11:40:45 -06:00
dependabot[bot]
f621423e7d build(deps): bump thiserror from 1.0.64 to 2.0.3
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.64 to 2.0.3.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.64...2.0.3)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-20 11:40:45 -06:00
dependabot[bot]
35802cb025
build(deps): bump which from 6.0.3 to 7.0.0 (#12090)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-20 11:40:00 -06:00
Michael Davis
9c108b5486
Support bindings with the Super (Cmd/Win/Meta) modifier
Terminals which support the enhanced keyboard protocol send events for
keys pressed with the Super modifier (Windows/Linux key or the Command
key). The only changes that are needed to support this in Helix are:

* Mapping the modifier from crossterm's KeyModifiers to Helix's
  KeyModifiers.
* Representing and parsing the modifier from the KeyEvent text
  representation.
* Documenting the ability to remap it.

When writing keybindings, use 'Meta-', 'Cmd-' or 'Win-' which are all
synonymous. For example:

    [keys.normal]
    Cmd-s = ":write"

will trigger for the Windows or Linux keys and the Command key plus 's'.
2024-07-06 10:49:27 -04:00
17 changed files with 250 additions and 115 deletions

134
Cargo.lock generated
View File

@ -136,9 +136,9 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53"
[[package]]
name = "cc"
version = "1.1.37"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf"
checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47"
dependencies = [
"shlex",
]
@ -383,7 +383,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7199d965852c3bac31f779ef99cbb4537f80e952e2d6aa0ffeb30cce00f4f46e"
dependencies = [
"libc",
"thiserror",
"thiserror 1.0.69",
"winapi",
]
@ -522,7 +522,7 @@ dependencies = [
"gix-worktree",
"once_cell",
"smallvec",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -535,7 +535,7 @@ dependencies = [
"gix-date",
"gix-utils",
"itoa",
"thiserror",
"thiserror 1.0.69",
"winnow",
]
@ -552,7 +552,7 @@ dependencies = [
"gix-trace",
"kstring",
"smallvec",
"thiserror",
"thiserror 1.0.69",
"unicode-bom",
]
@ -562,7 +562,7 @@ version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10f78312288bd02052be5dbc2ecbc342c9f4eb791986d86c0a5c06b92dc72efa"
dependencies = [
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -571,7 +571,7 @@ version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c28b58ba04f0c004722344390af9dbc85888fbb84be1981afb934da4114d4cf"
dependencies = [
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -597,7 +597,7 @@ dependencies = [
"gix-features",
"gix-hash",
"memmap2",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -616,7 +616,7 @@ dependencies = [
"memchr",
"once_cell",
"smallvec",
"thiserror",
"thiserror 1.0.69",
"unicode-bom",
"winnow",
]
@ -631,7 +631,7 @@ dependencies = [
"bstr",
"gix-path",
"libc",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -643,7 +643,7 @@ dependencies = [
"bstr",
"itoa",
"jiff",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -664,7 +664,7 @@ dependencies = [
"gix-traverse",
"gix-worktree",
"imara-diff",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -684,7 +684,7 @@ dependencies = [
"gix-trace",
"gix-utils",
"gix-worktree",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -700,7 +700,7 @@ dependencies = [
"gix-path",
"gix-ref",
"gix-sec",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -718,7 +718,7 @@ dependencies = [
"once_cell",
"prodash",
"sha1_smol",
"thiserror",
"thiserror 1.0.69",
"walkdir",
]
@ -740,7 +740,7 @@ dependencies = [
"gix-trace",
"gix-utils",
"smallvec",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -773,7 +773,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "952c3a29f1bc1007cc901abce7479943abfa42016db089de33d0a4fa3c85bfe8"
dependencies = [
"faster-hex",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -825,7 +825,7 @@ dependencies = [
"memmap2",
"rustix",
"smallvec",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -836,7 +836,7 @@ checksum = "5102acdf4acae2644e38dbbd18cdfba9597a218f7d85f810fe5430207e03c2de"
dependencies = [
"gix-tempfile",
"gix-utils",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -855,7 +855,7 @@ dependencies = [
"gix-validate",
"itoa",
"smallvec",
"thiserror",
"thiserror 1.0.69",
"winnow",
]
@ -877,7 +877,7 @@ dependencies = [
"gix-quote",
"parking_lot",
"tempfile",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -895,7 +895,7 @@ dependencies = [
"gix-path",
"memmap2",
"smallvec",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -907,7 +907,7 @@ dependencies = [
"bstr",
"faster-hex",
"gix-trace",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -920,7 +920,7 @@ dependencies = [
"gix-trace",
"home",
"once_cell",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -935,7 +935,7 @@ dependencies = [
"gix-config-value",
"gix-glob",
"gix-path",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -946,7 +946,7 @@ checksum = "f89f9a1525dcfd9639e282ea939f5ab0d09d93cf2b90c1fc6104f1b9582a8e49"
dependencies = [
"bstr",
"gix-utils",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -966,7 +966,7 @@ dependencies = [
"gix-utils",
"gix-validate",
"memmap2",
"thiserror",
"thiserror 1.0.69",
"winnow",
]
@ -981,7 +981,7 @@ dependencies = [
"gix-revision",
"gix-validate",
"smallvec",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -996,7 +996,7 @@ dependencies = [
"gix-hash",
"gix-object",
"gix-revwalk",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -1011,7 +1011,7 @@ dependencies = [
"gix-hashtable",
"gix-object",
"smallvec",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -1046,7 +1046,7 @@ dependencies = [
"gix-pathspec",
"gix-worktree",
"portable-atomic",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -1061,7 +1061,7 @@ dependencies = [
"gix-pathspec",
"gix-refspec",
"gix-url",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -1098,7 +1098,7 @@ dependencies = [
"gix-object",
"gix-revwalk",
"smallvec",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -1110,7 +1110,7 @@ dependencies = [
"bstr",
"gix-features",
"gix-path",
"thiserror",
"thiserror 1.0.69",
"url",
]
@ -1132,7 +1132,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e187b263461bc36cea17650141567753bc6207d036cedd1de6e81a52f277ff68"
dependencies = [
"bstr",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@ -1263,7 +1263,7 @@ dependencies = [
"log",
"serde",
"serde_json",
"thiserror",
"thiserror 2.0.3",
"tokio",
]
@ -1319,7 +1319,7 @@ dependencies = [
"serde",
"serde_json",
"slotmap",
"thiserror",
"thiserror 2.0.3",
"tokio",
"tokio-stream",
]
@ -1392,7 +1392,7 @@ dependencies = [
"smallvec",
"tempfile",
"termini",
"thiserror",
"thiserror 2.0.3",
"tokio",
"tokio-stream",
"toml",
@ -1459,7 +1459,7 @@ dependencies = [
"serde_json",
"slotmap",
"tempfile",
"thiserror",
"thiserror 2.0.3",
"tokio",
"tokio-stream",
"toml",
@ -1755,9 +1755,9 @@ dependencies = [
[[package]]
name = "libc"
version = "0.2.162"
version = "0.2.164"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398"
checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f"
[[package]]
name = "libloading"
@ -1911,9 +1911,9 @@ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
[[package]]
name = "open"
version = "5.3.0"
version = "5.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61a877bf6abd716642a53ef1b89fb498923a4afca5c754f9050b4d081c05c4b3"
checksum = "3ecd52f0b8d15c40ce4820aa251ed5de032e5d91fab27f7db2f40d42a8bdf69c"
dependencies = [
"is-wsl",
"libc",
@ -2128,9 +2128,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
[[package]]
name = "rustix"
version = "0.38.40"
version = "0.38.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0"
checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6"
dependencies = [
"bitflags",
"errno",
@ -2182,9 +2182,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.132"
version = "1.0.133"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03"
checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377"
dependencies = [
"itoa",
"memchr",
@ -2398,18 +2398,38 @@ dependencies = [
[[package]]
name = "thiserror"
version = "1.0.64"
version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84"
checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
dependencies = [
"thiserror-impl",
"thiserror-impl 1.0.69",
]
[[package]]
name = "thiserror"
version = "2.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa"
dependencies = [
"thiserror-impl 2.0.3",
]
[[package]]
name = "thiserror-impl"
version = "1.0.64"
version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3"
checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "thiserror-impl"
version = "2.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568"
dependencies = [
"proc-macro2",
"quote",
@ -2551,9 +2571,9 @@ checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217"
[[package]]
name = "unicode-general-category"
version = "0.6.0"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2281c8c1d221438e373249e065ca4989c4c36952c211ff21a0ee91c44a3869e7"
checksum = "24adfe8311434967077a6adff125729161e6e4934d76f6b7c55318ac5c9246d3"
[[package]]
name = "unicode-ident"
@ -2691,9 +2711,9 @@ checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484"
[[package]]
name = "which"
version = "6.0.3"
version = "7.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f"
checksum = "c9cad3279ade7346b96e38731a641d7343dd6a53d55083dd54eadfa5a1b38c6b"
dependencies = [
"either",
"home",

View File

@ -41,7 +41,7 @@ package.helix-term.opt-level = 2
tree-sitter = { version = "0.22" }
nucleo = "0.5.0"
slotmap = "1.0.7"
thiserror = "1.0"
thiserror = "2.0"
[workspace.package]
version = "24.7.0"

View File

@ -204,6 +204,7 @@
| task | ✓ | | | |
| tcl | ✓ | | ✓ | |
| templ | ✓ | | | `templ` |
| textproto | ✓ | ✓ | ✓ | |
| tfvars | ✓ | | ✓ | `terraform-ls` |
| thrift | ✓ | | | |
| todotxt | ✓ | | | |

View File

@ -112,42 +112,43 @@ #### Shell
### Selection manipulation
| Key | Description | Command |
| ----- | ----------- | ------- |
| `s` | Select all regex matches inside selections | `select_regex` |
| `S` | Split selection into sub selections on regex matches | `split_selection` |
| `Alt-s` | Split selection on newlines | `split_selection_on_newline` |
| `Alt-minus` | Merge selections | `merge_selections` |
| `Alt-_` | Merge consecutive selections | `merge_consecutive_selections` |
| `&` | Align selection in columns | `align_selections` |
| `_` | Trim whitespace from the selection | `trim_selections` |
| `;` | Collapse selection onto a single cursor | `collapse_selection` |
| `Alt-;` | Flip selection cursor and anchor | `flip_selections` |
| `Alt-:` | Ensures the selection is in forward direction | `ensure_selections_forward` |
| `,` | Keep only the primary selection | `keep_primary_selection` |
| `Alt-,` | Remove the primary selection | `remove_primary_selection` |
| `C` | Copy selection onto the next line (Add cursor below) | `copy_selection_on_next_line` |
| `Alt-C` | Copy selection onto the previous line (Add cursor above) | `copy_selection_on_prev_line` |
| `(` | Rotate main selection backward | `rotate_selections_backward` |
| `)` | Rotate main selection forward | `rotate_selections_forward` |
| `Alt-(` | Rotate selection contents backward | `rotate_selection_contents_backward` |
| `Alt-)` | Rotate selection contents forward | `rotate_selection_contents_forward` |
| `%` | Select entire file | `select_all` |
| `x` | Select current line, if already selected, extend to next line | `extend_line_below` |
| `X` | Extend selection to line bounds (line-wise selection) | `extend_to_line_bounds` |
| `Alt-x` | Shrink selection to line bounds (line-wise selection) | `shrink_to_line_bounds` |
| `J` | Join lines inside selection | `join_selections` |
| `Alt-J` | Join lines inside selection and select the inserted space | `join_selections_space` |
| `K` | Keep selections matching the regex | `keep_selections` |
| `Alt-K` | Remove selections matching the regex | `remove_selections` |
| `Ctrl-c` | Comment/uncomment the selections | `toggle_comments` |
| `Alt-o`, `Alt-up` | Expand selection to parent syntax node (**TS**) | `expand_selection` |
| `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` |
| Key | Description | Command |
| ----- | ----------- | ------- |
| `s` | Select all regex matches inside selections | `select_regex` |
| `S` | Split selection into sub selections on regex matches | `split_selection` |
| `Alt-s` | Split selection on newlines | `split_selection_on_newline` |
| `Alt-minus` | Merge selections | `merge_selections` |
| `Alt-_` | Merge consecutive selections | `merge_consecutive_selections` |
| `&` | Align selection in columns | `align_selections` |
| `_` | Trim whitespace from the selection | `trim_selections` |
| `;` | Collapse selection onto a single cursor | `collapse_selection` |
| `Alt-;` | Flip selection cursor and anchor | `flip_selections` |
| `Alt-:` | Ensures the selection is in forward direction | `ensure_selections_forward` |
| `,` | Keep only the primary selection | `keep_primary_selection` |
| `Alt-,` | Remove the primary selection | `remove_primary_selection` |
| `C` | Copy selection onto the next line (Add cursor below) | `copy_selection_on_next_line` |
| `Alt-C` | Copy selection onto the previous line (Add cursor above) | `copy_selection_on_prev_line` |
| `(` | Rotate main selection backward | `rotate_selections_backward` |
| `)` | Rotate main selection forward | `rotate_selections_forward` |
| `Alt-(` | Rotate selection contents backward | `rotate_selection_contents_backward` |
| `Alt-)` | Rotate selection contents forward | `rotate_selection_contents_forward` |
| `%` | Select entire file | `select_all` |
| `x` | Select current line, if already selected, extend to next line | `extend_line_below` |
| `X` | Extend selection to line bounds (line-wise selection) | `extend_to_line_bounds` |
| `Alt-x` | Shrink selection to line bounds (line-wise selection) | `shrink_to_line_bounds` |
| `J` | Join lines inside selection | `join_selections` |
| `Alt-J` | Join lines inside selection and select the inserted space | `join_selections_space` |
| `K` | Keep selections matching the regex | `keep_selections` |
| `Alt-K` | Remove selections matching the regex | `remove_selections` |
| `Ctrl-c` | Comment/uncomment the selections | `toggle_comments` |
| `Alt-o`, `Alt-up` | Expand selection to parent syntax node (**TS**) | `expand_selection` |
| `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-I`, `Alt-Shift-down`| Select all children nodes in syntax tree (**TS**) | `select_all_children` |
| `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
@ -281,7 +282,7 @@ #### Space mode
| Key | Description | Command |
| ----- | ----------- | ------- |
| `f` | Open file picker | `file_picker` |
| `f` | Open file picker at LSP workspace root | `file_picker` |
| `F` | Open file picker at current working directory | `file_picker_in_current_directory` |
| `b` | Open buffer picker | `buffer_picker` |
| `j` | Open jumplist picker | `jumplist_picker` |

View File

@ -50,8 +50,22 @@ # create a new minor mode bound to `+`
## Special keys and modifiers
Ctrl, Shift and Alt modifiers are encoded respectively with the prefixes
`C-`, `S-` and `A-`. Special keys are encoded as follows:
Ctrl, Shift and Alt modifiers are encoded respectively with the prefixes `C-`, `S-` and `A-`.
The [Super key](https://en.wikipedia.org/wiki/Super_key_(keyboard_button)) - the Windows/Linux
key or the Command key on Mac keyboards - is also supported when using a terminal emulator that
supports the [enhanced keyboard protocol](https://github.com/helix-editor/helix/wiki/Terminal-Support#enhanced-keyboard-protocol).
The super key is encoded with prefixes `Meta-`, `Cmd-` or `Win-`. These are all synonyms for the
super modifier - binding a key with a `Win-` modifier will mean it can be used with the
Windows/Linux key or the Command key.
```toml
[keys.normal]
C-s = ":write" # Ctrl and 's' to write
Cmd-s = ":write" # Cmd or Win or Meta and 's' to write
```
Special keys are encoded as follows:
| Key name | Representation |
| --- | --- |
@ -83,10 +97,11 @@ ## Commands
keys and used for movement and editing. A list of static commands is
available in the [Keymap](./keymap.html) documentation and in the source code
in [`helix-term/src/commands.rs`](https://github.com/helix-editor/helix/blob/master/helix-term/src/commands.rs)
at the invocation of `static_commands!` macro and the `TypableCommandList`.
at the invocation of `static_commands!` macro.
* Typable commands: commands that can be executed from command mode (`:`), for
example `:write!`. See the [Commands](./commands.html) documentation for a
list of available typeable commands.
list of available typeable commands or the `TypableCommandList` declaration in
the source code at [`helix-term/src/commands/typed.rs`](https://github.com/helix-editor/helix/blob/master/helix-term/src/commands/typed.rs).
* Macros: sequences of keys that are executed in order. These keybindings
start with `@` and then list any number of keys to be executed. For example
`@miw` can be used to select the surrounding word. For now, macro keybindings

View File

@ -29,7 +29,7 @@ unicode-segmentation = "1.12"
# For now lets lock the version to avoid rendering glitches
# when installing without `--locked`
unicode-width = "=0.1.12"
unicode-general-category = "0.6"
unicode-general-category = "1.0"
slotmap.workspace = true
tree-sitter.workspace = true
once_cell = "1.20"

View File

@ -23,7 +23,7 @@ license = "MIT"
[dependencies]
bitflags = "2.6.0"
serde = { version = "1.0.215", features = ["derive"] }
serde_json = "1.0.132"
serde_json = "1.0.133"
serde_repr = "0.1"
url = {version = "2.5.3", features = ["serde"]}

View File

@ -15,7 +15,7 @@ homepage.workspace = true
dunce = "1.0"
etcetera = "0.8"
ropey = { version = "1.6.1", default-features = false }
which = "6.0"
which = "7.0"
regex-cursor = "0.1.4"
bitflags = "2.6"

View File

@ -56,10 +56,10 @@ ignore = "0.4"
pulldown-cmark = { version = "0.12", default-features = false }
# file type detection
content_inspector = "0.2.4"
thiserror = "1.0"
thiserror.workspace = true
# opening URLs
open = "5.3.0"
open = "5.3.1"
url = "2.5.3"
# config
@ -74,7 +74,7 @@ grep-searcher = "0.1.14"
[target.'cfg(not(windows))'.dependencies] # https://github.com/vorner/signal-hook/issues/100
signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] }
libc = "0.2.162"
libc = "0.2.164"
[target.'cfg(target_os = "macos")'.dependencies]
crossterm = { version = "0.28", features = ["event-stream", "use-dev-tty", "libc"] }

View File

@ -162,7 +162,12 @@ pub(crate) mod keys {
impl fmt::Display for KeyEvent {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result {
f.write_fmt(format_args!(
"{}{}{}",
"{}{}{}{}",
if self.modifiers.contains(KeyModifiers::SUPER) {
"Meta-"
} else {
""
},
if self.modifiers.contains(KeyModifiers::SHIFT) {
"S-"
} else {
@ -312,6 +317,10 @@ fn width(&self) -> usize {
if self.modifiers.contains(KeyModifiers::CONTROL) {
width += 2;
}
if self.modifiers.contains(KeyModifiers::SUPER) {
// "-Meta"
width += 5;
}
width
}
@ -396,6 +405,7 @@ fn from_str(s: &str) -> Result<Self, Self::Err> {
"S" => KeyModifiers::SHIFT,
"A" => KeyModifiers::ALT,
"C" => KeyModifiers::CONTROL,
"Meta" | "Cmd" | "Win" => KeyModifiers::SUPER,
_ => return Err(anyhow!("Invalid key modifier '{}-'", token)),
};
@ -709,6 +719,28 @@ fn parsing_modified_keys() {
modifiers: KeyModifiers::NONE
}
);
assert_eq!(
str::parse::<KeyEvent>("Meta-c").unwrap(),
KeyEvent {
code: KeyCode::Char('c'),
modifiers: KeyModifiers::SUPER
}
);
assert_eq!(
str::parse::<KeyEvent>("Win-s").unwrap(),
KeyEvent {
code: KeyCode::Char('s'),
modifiers: KeyModifiers::SUPER
}
);
assert_eq!(
str::parse::<KeyEvent>("Cmd-d").unwrap(),
KeyEvent {
code: KeyCode::Char('d'),
modifiers: KeyModifiers::SUPER
}
);
}
#[test]

View File

@ -7,6 +7,7 @@ pub struct KeyModifiers: u8 {
const SHIFT = 0b0000_0001;
const CONTROL = 0b0000_0010;
const ALT = 0b0000_0100;
const SUPER = 0b0000_1000;
const NONE = 0b0000_0000;
}
}
@ -27,6 +28,9 @@ fn from(key_modifiers: KeyModifiers) -> Self {
if key_modifiers.contains(KeyModifiers::ALT) {
result.insert(CKeyModifiers::ALT);
}
if key_modifiers.contains(KeyModifiers::SUPER) {
result.insert(CKeyModifiers::SUPER);
}
result
}
@ -48,6 +52,9 @@ fn from(val: crossterm::event::KeyModifiers) -> Self {
if val.contains(CKeyModifiers::ALT) {
result.insert(KeyModifiers::ALT);
}
if val.contains(CKeyModifiers::SUPER) {
result.insert(KeyModifiers::SUPER);
}
result
}

View File

@ -344,6 +344,19 @@ indent = { tab-width = 2, unit = " " }
name = "protobuf"
source = { git = "https://github.com/yusdacra/tree-sitter-protobuf", rev = "19c211a01434d9f03efff99f85e19f967591b175"}
[[language]]
name = "textproto"
file-types = ["txtpb", "textpb", "textproto"]
comment-token = "#"
scope = "source.textproto"
indent = { tab-width = 2, unit = " " }
formatter = { command = "txtpbfmt" }
auto-format = true
[[grammar]]
name = "textproto"
source = { git = "https://github.com/PorterAtGoogle/tree-sitter-textproto", rev = "568471b80fd8793d37ed01865d8c2208a9fefd1b"}
[[language]]
name = "elixir"
scope = "source.elixir"

View File

@ -0,0 +1,22 @@
(string) @string
(field_name) @variable.other.member
(comment) @comment
(number) @constant.numeric
; covers e.g. booleans and "inf"
(scalar_value (identifier)) @constant
; Covers "-inf"
(scalar_value (signed_identifier)) @constant.numeric
[
(open_squiggly)
(close_squiggly)
(open_square)
(close_square)
(open_arrow)
(close_arrow)
] @punctuation.bracket
"," @punctuation.delimiter

View File

@ -0,0 +1,11 @@
[
(message_value)
(message_list)
(scalar_list)
] @indent
[
(close_arrow)
(close_square)
(close_squiggly)
] @outdent

View File

@ -0,0 +1,12 @@
(message_field
(_) @entry.inside) @entry.around
(scalar_field
(_) @entry.inside) @entry.around
(message_list
(_) @entry.around)
(scalar_list
(_) @entry.around)

View File

@ -53,6 +53,7 @@
"ui.virtual.whitespace" = "bg2"
"ui.virtual.ruler" = { bg = "grey2" }
"ui.virtual.inlay-hint" = { fg = "grey2", modifiers = ["italic"] }
"ui.virtual.jump-label" = { fg = "nasty-red", modifiers = ["bold"] }
"hint" = "blue"
"info" = "aqua"

View File

@ -1223,7 +1223,7 @@ letters! that is not good grammar. you can fix this.
to the matching ). You can do the same on the line below: for example
move to ], and press mm to jump to [ .
--> you can (jump between matching parenthesis)
--> you can (jump between matching parentheses)
--> or between matching [ square brackets ]
--> now { you know the drill: this works with brackets too }
@ -1238,19 +1238,19 @@ letters! that is not good grammar. you can fix this.
pair of brackets or other delimiters. In the lines below:
- move to the --> line, put your cursor in normal mode at any
location between the parenthesis, for example at 'x', and press
mi( or mi) to select the whole content inside the parenthesis
(parenthesis excluded). As usual, you can then do anything you want
location between the parentheses, for example at 'x', and press
mi( or mi) to select the whole content inside the parentheses
(parentheses excluded). As usual, you can then do anything you want
with the selection (for example, press c to change it)
--> outside and (inside x parenthesis) - and outside again
--> outside and (inside x parentheses) - and outside again
Test below that you can do the same with [], or {}, or with
nested combinations of these (this will act on the immediately
surrounding matching pair). This also works with "" and similar
--> test [ with square brackets ] !
--> try ( with nested [ pairs of ( parenthesis) and "brackets" ])
--> try ( with nested [ pairs of ( parentheses) and "brackets" ])
=================================================================
= 12.3 USING MATCH MODE SELECT AROUND =
@ -1284,7 +1284,7 @@ letters! that is not good grammar. you can fix this.
move in normal mode the cursor to the start of select, then enter
selection mode with v , then select the 4 next words with 4e ),
* ii) press ms( or ms) to surround the selection with a pair of
parenthesis.
parentheses.
--> so, select all of this, and surround it with ()
@ -1304,9 +1304,9 @@ letters! that is not good grammar. you can fix this.
command. On the line below, move the cursor anywhere
within the pair of (), for example to the 'x', then from there,
in normal mode, press md( or md) to delete the surrounding
pair of parenthesis.
pair of parentheses.
--> delete (the x pair of parenthesis) from within!
--> delete (the x pair of parentheses) from within!
You can naturally delete other kinds of surroundings: