Skip to content

Commit 3bf6265

Browse files
authored
Merge pull request #125 from FluxxField/fix/remove-explicit-dt-presets
fix: remove explicit dt/dT/ct/cT/yt/yT presets so t/T user overrides work
2 parents e4da0a8 + 93a3d32 commit 3bf6265

3 files changed

Lines changed: 10 additions & 88 deletions

File tree

lua/smart-motion/presets.lua

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -241,32 +241,6 @@ function presets.delete(exclude)
241241
},
242242
},
243243
},
244-
dt = {
245-
collector = "lines",
246-
extractor = "text_search_2_char_until",
247-
filter = "filter_words_on_cursor_line_after_cursor",
248-
visualizer = "hint_start",
249-
action = "delete",
250-
map = true,
251-
modes = { "n" },
252-
metadata = {
253-
label = "Delete Until Searched Text After Cursor",
254-
description = "Deletes until the searched for text after the cursor",
255-
},
256-
},
257-
dT = {
258-
collector = "lines",
259-
extractor = "text_search_2_char_until",
260-
filter = "filter_words_on_cursor_line_before_cursor",
261-
visualizer = "hint_start",
262-
action = "delete",
263-
map = true,
264-
modes = { "n" },
265-
metadata = {
266-
label = "Delete Until Searched Text Before Cursor",
267-
description = "Deletes until the searched for text before the cursor",
268-
},
269-
},
270244
rdw = {
271245
collector = "lines",
272246
extractor = "words",
@@ -317,32 +291,6 @@ function presets.yank(exclude)
317291
},
318292
},
319293
},
320-
yt = {
321-
collector = "lines",
322-
extractor = "text_search_2_char_until",
323-
filter = "filter_words_on_cursor_line_after_cursor",
324-
visualizer = "hint_start",
325-
action = "yank_until",
326-
map = true,
327-
modes = { "n" },
328-
metadata = {
329-
label = "Yank Until Searched Text After Cursor",
330-
description = "Yank until the searched for text after the cursor",
331-
},
332-
},
333-
yT = {
334-
collector = "lines",
335-
extractor = "text_search_2_char_until",
336-
filter = "filter_words_on_cursor_line_before_cursor",
337-
visualizer = "hint_start",
338-
action = "yank_until",
339-
map = true,
340-
modes = { "n" },
341-
metadata = {
342-
label = "Yank Until Searched Text Before Cursor",
343-
description = "Yank until the searched for text before the cursor",
344-
},
345-
},
346294
ryw = {
347295
collector = "lines",
348296
extractor = "words",
@@ -393,32 +341,6 @@ function presets.change(exclude)
393341
},
394342
},
395343
},
396-
ct = {
397-
collector = "lines",
398-
extractor = "text_search_2_char_until",
399-
filter = "filter_words_on_cursor_line_after_cursor",
400-
visualizer = "hint_start",
401-
action = "change_until",
402-
map = true,
403-
modes = { "n" },
404-
metadata = {
405-
label = "Change Until Searched Text After Cursor",
406-
description = "Change until the searched for text after the cursor",
407-
},
408-
},
409-
cT = {
410-
collector = "lines",
411-
extractor = "text_search_2_char_until",
412-
filter = "filter_words_on_cursor_line_before_cursor",
413-
visualizer = "hint_start",
414-
action = "change_until",
415-
map = true,
416-
modes = { "n" },
417-
metadata = {
418-
label = "Change Until Searched Text Before Cursor",
419-
description = "Change until the searched for text",
420-
},
421-
},
422344
}, exclude)
423345
end
424346

lua/smart-motion/types.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
---@alias SmartMotionPresetKey.Words "w" | "b" | "e" | "ge"
4747
---@alias SmartMotionPresetKey.Lines "j" | "k"
4848
---@alias SmartMotionPresetKey.Search "s" | "S" | "f" | "F" | "t" | "T" | "gs"
49-
---@alias SmartMotionPresetKey.Delete "d" | "dt" | "dT" | "df" | "dF" | "rdw" | "rdl"
50-
---@alias SmartMotionPresetKey.Yank "y" | "yt" | "yT" | "yf" | "yF" | "ryw" | "ryl"
51-
---@alias SmartMotionPresetKey.Change "c" | "ct" | "cT" | "cf" | "cF"
49+
---@alias SmartMotionPresetKey.Delete "d" | "rdw" | "rdl"
50+
---@alias SmartMotionPresetKey.Yank "y" | "ryw" | "ryl"
51+
---@alias SmartMotionPresetKey.Change "c"
5252
---@alias SmartMotionPresetKey.Treesitter "]]" | "[[" | "]c" | "[c" | "]b" | "[b" | "daa" | "caa" | "yaa" | "dfn" | "cfn" | "yfn" | "saa" | "gS" | "R"
5353
---@alias SmartMotionPresetKey.Misc "." | "gmd" | "gmy" | "gQf" | "gQd" | "gQe" | "gQg" | "gTf" | "gTd" | "gTe" | "gTg"
5454
---@alias SmartMotionPresetKey.Diagnostics "]d" | "[d" | "]e" | "[e"

tests/operators.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
-- SmartMotion Playground: Operator Motions
2-
-- Presets: d, dt, dT, rdw, rdl, y, yt, yT, ryw, ryl, c, ct, cT, p, P
2+
-- Presets: d, rdw, rdl, y, ryw, ryl, c, p, P
33
-- operator-pending: >w, gUw, =j, gqj, etc.
44
--
55
-- INSTRUCTIONS:
66
-- d → composable delete: press d, then a second motion (w/e/j/k/]]/etc.)
77
-- y → composable yank: press y, then a second motion
88
-- c → composable change: press c, then a second motion
9-
-- dt → delete until: type a char, delete from cursor to just before match
10-
-- dT → delete until backward
11-
-- yt → yank until: type a char, yank from cursor to just before match
12-
-- yT → yank until backward
13-
-- ct → change until: type a char, change from cursor to just before match
14-
-- cT → change until backward
9+
-- dt → composable: d + t motion (delete until char via inference)
10+
-- dT → composable: d + T motion (delete until backward via inference)
11+
-- yt → composable: y + t motion (yank until char via inference)
12+
-- yT → composable: y + T motion (yank until backward via inference)
13+
-- ct → composable: c + t motion (change until char via inference)
14+
-- cT → composable: c + T motion (change until backward via inference)
1515
-- rdw → remote delete word: pick a word label anywhere, delete that word
1616
-- rdl → remote delete line: pick a line label, delete that entire line
1717
-- ryw → remote yank word: pick a word label, yank it

0 commit comments

Comments
 (0)