From 182b26bebcaa7d36421365473ac5a0eff113e01d Mon Sep 17 00:00:00 2001 From: Rich Robinson Date: Wed, 24 Jul 2024 15:14:46 +0100 Subject: [PATCH 1/5] Fix typos in 2-character label jump Tutor entry (#11298) --- runtime/tutor | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/tutor b/runtime/tutor index f5162c5c..431d24f8 100644 --- a/runtime/tutor +++ b/runtime/tutor @@ -997,12 +997,12 @@ lines. of 2 highlighted characters to jump to the corresponding label, or use ESC to drop the labels. - The 2-character labels allow to quickly jump to any location + The 2-character labels allow you to quickly jump to any location in the viewable selection. 1. Move the cursor to the start of the line marked '-->' below. 2. Press gw to enable the 2-character labels, and then the two - characters that replace the two leters he at the start of + characters that replace the two letters he at the start of here to jump to the corresponding word. --> This is just a simple line of text. @@ -1023,8 +1023,8 @@ lines. * Press Ctrl-i and Ctrl-o to go forward and backward in the jumplist. - * Type gw to enable 2-characters labels, and any 2 characters - to jump to the corresponding label, or ESC to drop the labels. + * Type gw to enable 2-character labels, and any 2 characters to + jump to the corresponding label, or ESC to drop the labels. From 9d21b8fa85e8ff8bacc073875fc27eb007484f06 Mon Sep 17 00:00:00 2001 From: 1adept <69433209+1adept@users.noreply.github.com> Date: Wed, 24 Jul 2024 16:34:34 +0200 Subject: [PATCH 2/5] just module extension (#11286) Co-authored-by: adept --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 87783b3d..5103cee3 100644 --- a/languages.toml +++ b/languages.toml @@ -3073,7 +3073,7 @@ source = { git = "https://github.com/lefp/tree-sitter-opencl", rev = "8e1d24a570 [[language]] name = "just" scope = "source.just" -file-types = [{ glob = "justfile" }, { glob = "Justfile" }, { glob = ".justfile" }, { glob = ".Justfile" }] +file-types = ["just", { glob = "justfile" }, { glob = "Justfile" }, { glob = ".justfile" }, { glob = ".Justfile" }] injection-regex = "just" comment-token = "#" indent = { tab-width = 4, unit = " " } From 7c5e5f4e412f65e123fe1e1fbc802229d1a303ae Mon Sep 17 00:00:00 2001 From: RoloEdits Date: Wed, 24 Jul 2024 08:34:20 -0700 Subject: [PATCH 3/5] fix(lsp): `find_completion_range` off-by-one (#11266) --- helix-lsp/src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index ec89e1f8..4a27802d 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -284,10 +284,8 @@ pub mod util { if replace_mode { end += text .chars_at(cursor) - .skip(1) .take_while(|ch| chars::char_is_word(*ch)) - .count() - + 1; + .count(); } (start, end) } From 5d3f05cbe148fce050cab40aa9e718dd8917258c Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Wed, 24 Jul 2024 12:25:00 -0400 Subject: [PATCH 4/5] Document use of filter columns in pickers (#11218) * Document use of filter columns in pickers. Filtering on columns was implemented in #9647. The only documentation I could find on this feature was the PR itself, and the video demo used a different syntax. * Note that column filters are space-separated. * Note that picker filters can be abbreviated. * Specify correct picker in docs. * Clarify picker filter prefix shortenting. Co-authored-by: Michael Davis * Move picker docs to their own section. * Update book/src/pickers.md Co-authored-by: Michael Davis * Improve docs on picker registers, keybinds, and syntax. * Clarify wording around picker queries. Co-authored-by: Michael Davis --------- Co-authored-by: Ryan Roden-Corrent Co-authored-by: Michael Davis --- book/src/SUMMARY.md | 1 + book/src/keymap.md | 2 ++ book/src/pickers.md | 11 +++++++++++ 3 files changed, 14 insertions(+) create mode 100644 book/src/pickers.md diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md index 027b885a..e6be2ebc 100644 --- a/book/src/SUMMARY.md +++ b/book/src/SUMMARY.md @@ -10,6 +10,7 @@ - [Surround](./surround.md) - [Textobjects](./textobjects.md) - [Syntax aware motions](./syntax-aware-motions.md) + - [Pickers](./pickers.md) - [Keymap](./keymap.md) - [Commands](./commands.md) - [Language support](./lang-support.md) diff --git a/book/src/keymap.md b/book/src/keymap.md index 402b83ef..0e60f282 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -436,6 +436,8 @@ you to selectively add search terms to your selections. ## Picker Keys to use within picker. Remapping currently not supported. +See the documentation page on [pickers](./pickers.md) for more info. +[Prompt](#prompt) keybinds also work in pickers, except where they conflict with picker keybinds. | Key | Description | | ----- | ------------- | diff --git a/book/src/pickers.md b/book/src/pickers.md new file mode 100644 index 00000000..993d7146 --- /dev/null +++ b/book/src/pickers.md @@ -0,0 +1,11 @@ +## Using pickers + +Helix has a variety of pickers, which are interactive windows used to select various kinds of items. These include a file picker, global search picker, and more. Most pickers are accessed via keybindings in [space mode](./keymap.md#space-mode). Pickers have their own [keymap](./keymap.md#picker) for navigation. + +### Filtering Picker Results + +Most pickers perform fuzzy matching using [fzf syntax](https://github.com/junegunn/fzf?tab=readme-ov-file#search-syntax). Two exceptions are the global search picker, which uses regex, and the workspace symbol picker, which passes search terms to the LSP. Note that OR operations (`|`) are not currently supported. + +If a picker shows multiple columns, you may apply the filter to a specific column by prefixing the column name with `%`. Column names can be shortened to any prefix, so `%p`, `%pa` or `%pat` all mean the same as `%path`. For example, a query of `helix %p .toml$ !lang` in the global search picker searches for the term "helix" within files with paths ending in ".toml" but not including "lang". + +You can insert the contents of a [register](./registers.md) using `Ctrl-r` followed by a register name. For example, one could insert the currently selected text using `Ctrl-r`-`.`, or the directory of the current file using `Ctrl-r`-`%` followed by `Ctrl-w` to remove the last path section. The global search picker will use the contents of the [search register](./registers.md#default-registers) if you press `Enter` without typing a filter. For example, pressing `*`-`Space-/`-`Enter` will start a global search for the currently selected text. From ef4a4ff3c558afff0917633876f11b586899934d Mon Sep 17 00:00:00 2001 From: Luca Saccarola <96259932+saccarosium@users.noreply.github.com> Date: Wed, 24 Jul 2024 18:25:25 +0200 Subject: [PATCH 5/5] Make bash completion behave normally (#11246) --- contrib/completion/hx.bash | 42 +++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/contrib/completion/hx.bash b/contrib/completion/hx.bash index 62ca029b..1b102017 100644 --- a/contrib/completion/hx.bash +++ b/contrib/completion/hx.bash @@ -2,23 +2,31 @@ # Bash completion script for Helix editor _hx() { - # $1 command name - # $2 word being completed - # $3 word preceding + local cur prev languages + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD - 1]}" - case "$3" in - -g | --grammar) - COMPREPLY="$(compgen -W 'fetch build' -- $2)" - ;; - --health) - local languages=$(hx --health |tail -n '+7' |awk '{print $1}' |sed 's/\x1b\[[0-9;]*m//g') - COMPREPLY="$(compgen -W """$languages""" -- $2)" - ;; - *) - COMPREPLY="$(compgen -fd -W "-h --help --tutor -V --version -v -vv -vvv --health -g --grammar --vsplit --hsplit -c --config --log" -- """$2""")" - ;; - esac + case "$prev" in + -g | --grammar) + COMPREPLY=($(compgen -W 'fetch build' -- "$cur")) + return 0 + ;; + --health) + languages=$(hx --health | tail -n '+7' | awk '{print $1}' | sed 's/\x1b\[[0-9;]*m//g') + COMPREPLY=($(compgen -W """$languages""" -- "$cur")) + return 0 + ;; + esac - local IFS=$'\n' - COMPREPLY=($COMPREPLY) + case "$2" in + -*) + COMPREPLY=($(compgen -W "-h --help --tutor -V --version -v -vv -vvv --health -g --grammar --vsplit --hsplit -c --config --log" -- """$2""")) + return 0 + ;; + *) + COMPREPLY=($(compgen -fd -- """$2""")) + return 0 + ;; + esac } && complete -o filenames -F _hx hx