Skip to content

Commit

Permalink
docs: recommend equivalence classes for brackets and quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
ggandor committed Mar 15, 2024
1 parent 323d7cd commit 812604b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ For further customization, see `:h leap-custom-mappings`.
<summary>Suggested additional tweaks</summary>

```lua
-- Define equivalence classes for brackets and quotes, in addition to
-- the default whitespace group.
require('leap').opts.equivalence_classes = { ' \t\r\n', '([{', ')]}', '\'"`' }

-- Override some old defaults - use backspace instead of tab (see issue #165).
require('leap').opts.special_keys.prev_target = '<backspace>'
require('leap').opts.special_keys.prev_group = '<backspace>'
Expand Down
7 changes: 4 additions & 3 deletions doc/leap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,11 @@ Available options~
A character in search patterns will match any other in its equivalence
class. The sets can either be defined as strings or tables.

Example: `{ ' \t\r\n', ')]}', '([{', '\'"' }`

Example - whitespace, brackets, and quotes: >lua
{ ' \t\r\n', '([{', ')]}', '\'"`' }
<
Note: Make sure to have a set containing `\n` if you want to be able to
target characters at the end of the line.
target empty lines and characters at the end of the line.

Note: Non-mutual aliases are not possible in Leap, for the same reason
that supporting |smartcase| is not possible: we would need to show two
Expand Down

0 comments on commit 812604b

Please sign in to comment.