Skip to content

Commit

Permalink
Add jump-mode section in the configuration book
Browse files Browse the repository at this point in the history
  • Loading branch information
semin-park authored and Omnikar committed Nov 8, 2023
1 parent ee862ef commit d1f5881
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
20 changes: 20 additions & 0 deletions book/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,23 @@ wrap-indicator = "" # set wrap-indicator to "" to hide it
|------------|-------------|---------|
| `enable` | If set to true, then when the cursor is in a position with non-whitespace to its left, instead of inserting a tab, it will run `move_parent_node_end`. If there is only whitespace to the left, then it inserts a tab as normal. With the default bindings, to explicitly insert a tab character, press Shift-tab. | `true` |
| `supersede-menu` | Normally, when a menu is on screen, such as when auto complete is triggered, the tab key is bound to cycling through the items. This means when menus are on screen, one cannot use the tab key to trigger the `smart-tab` command. If this option is set to true, the `smart-tab` command always takes precedence, which means one cannot use the tab key to cycle through menu items. One of the other bindings must be used instead, such as arrow keys or `C-n`/`C-p`. | `false` |

### `[editor.jump-mode]` Section

Options for jump mode. If you are already familiar with vim/nvim's [easymotion](https://github.com/easymotion/vim-easymotion), [hop](https://github.com/phaazon/hop.nvim), [leap](https://github.com/ggandor/leap.nvim) etc, you
can think of jump mode as the equivalent in helix.

| Key | Description | Default |
| --- | --- | --- |
| `dim-during-jump` | Whether to dim the view when in jump mode. | `true` |
| `num-chars-before-label` | How many characters the user should type before labelling the targets. | `1` |
| `jump-keys` | Keys used in labels. Should be ascii characters. | `"jwetovxqpdygfblzhckisuranm"` |

Example:

```toml
[editor.jump-mode]
dim-during-jump = true
num-chars-before-label = 2
jump-keys = "laskdjfhgpmoinqzubwxyvecrt"
```
2 changes: 1 addition & 1 deletion book/src/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ Jumps to various locations.
| `j` | Move down textual (instead of visual) line | `move_line_down` |
| `k` | Move up textual (instead of visual) line | `move_line_up` |
| `w` | Word-wise jump mode | `jump_to_identifier_label` |
| `/` | Character search jump mode | `jump_to_char_label` |
| `/` | Character or string search jump mode | `jump_to_str_label` |

#### Match mode

Expand Down
3 changes: 1 addition & 2 deletions helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ use helix_core::{
syntax::{self, Highlight, HighlightEvent},
text_annotations::TextAnnotations,
unicode::width::UnicodeWidthStr,
visual_offset_from_block, Change, Position, Range, RopeSlice, Selection,
Transaction,
visual_offset_from_block, Change, Position, Range, RopeSlice, Selection, Transaction,
};
use helix_view::{
document::{Mode, SavePoint, SCRATCH_BUFFER_NAME},
Expand Down

0 comments on commit d1f5881

Please sign in to comment.