Skip to content

Commit 3170bf6

Browse files
committed
improv(defaults): backspace instead of tab
A comfortable key with no mnemonic value is a perfectly acceptable default, but an antimnemonic is less so. Closes #165
1 parent a9a9fae commit 3170bf6

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ need to do that.
3131
those are guaranteed non-conflicting letters, disappearing on the next
3232
keypress.
3333
- Else: type the label character. If there are more matches than available
34-
labels, you can switch between groups, using `<space>` and `<tab>`.
34+
labels, you can switch between groups, using `<space>` and `<backspace>`.
3535

3636
Character pairs give you full coverage of the screen:
3737

3838
- `s{char}<space>` jumps to a character before the end of the line.
3939
- `s<space><space>` jumps to any EOL position, including empty lines.
4040

4141
At any stage, `<enter>` consistently jumps to the next available target
42-
(`<tab>` steps back):
42+
(`<backspace>` steps back):
4343

4444
- `s<enter>...` repeats the previous search.
4545
- `s{char}<enter>...` can be used as a multiline substitute for `fFtT` motions.
@@ -144,10 +144,6 @@ See `:h leap-custom-mappings` for more.
144144
-- the default whitespace group.
145145
require('leap').opts.equivalence_classes = { ' \t\r\n', '([{', ')]}', '\'"`' }
146146

147-
-- Override some old defaults - use backspace instead of tab (see issue #165).
148-
require('leap').opts.special_keys.prev_target = '<backspace>'
149-
require('leap').opts.special_keys.prev_group = '<backspace>'
150-
151147
-- Use the traversal keys to repeat the previous motion without explicitly
152148
-- invoking Leap.
153149
require('leap.user').set_repeat_keys('<enter>', '<backspace>')

doc/leap.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ USAGE *leap-usage*
4646
keypress (|leap.opts.safe_labels|). *leap-autojump*
4747

4848
• Else: type the label character. If there are more matches than available
49-
labels, you can switch between groups, using `<space>` and `<tab>`.
49+
labels, you can switch between groups, using `<space>` and `<backspace>`.
5050

5151
If a |language-mapping| ('keymap') is active, Leap waits for keymapped
5252
sequences as needed and searches for the keymapped result as expected.
@@ -77,7 +77,7 @@ be used as a multiline substitute for `fFtT` motions.
7777

7878
If the search is directional, `<enter>` can also traverse through the rest of
7979
the targets, moving on to the next one on each subsequent keypress
80-
(`s<enter><enter>...`). If you overshoot, `<tab>`
80+
(`s<enter><enter>...`). If you overshoot, `<backspace>`
8181
(|leap.opts.special_keys.prev_target|) can revert the jump(s).
8282

8383
There is a convenience function in the `user` module to set keys that behave
@@ -316,9 +316,9 @@ right-hand keys to get a better balance for the whole sequence on average.
316316
`special_keys =` >
317317
{
318318
next_target = '<enter>',
319-
prev_target = '<tab>',
319+
prev_target = { '<backspace>', '<tab>' },
320320
next_group = '<space>',
321-
prev_group = '<tab>',
321+
prev_group = { '<backspace>', '<tab>' },
322322
}
323323
324324
Meta-keys accepted at runtime. Each one can be a table too, with a list of

fnl/leap/opts.fnl

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"J" "K" "L" "H" "O" "D" "W" "E" "I" "M" "B" "U"
1515
"Y" "V" "R" "G" "T" "A" "Q" "P" "C" "X" "Z" "?"]
1616
:special_keys {:next_target "<enter>"
17-
:prev_target "<tab>"
17+
:prev_target ["<backspace>" "<tab>"]
1818
:next_group "<space>"
19-
:prev_group "<tab>"}}
19+
:prev_group ["<backspace>" "<tab>"]}}
2020
; Will be updated by `leap` on invocation.
2121
:current_call {}})
2222

lua/leap/opts.lua

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)