Skip to content

Commit 394c5d5

Browse files
authored
Merge pull request #102 from FluxxField/dev
Dev
2 parents 56c117e + 18b34f3 commit 394c5d5

8 files changed

Lines changed: 1099 additions & 15 deletions

File tree

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -319,31 +319,31 @@ Word and line motions stay single-window by default. See [Customizing Motions](#
319319

320320
## Customizing Motions
321321

322-
Individual motions can be tweaked by passing a table instead of `true`. For example, make `f`/`F` work across multiple lines:
322+
Every motion is **Collector -> Extractor -> Filter -> Visualizer -> Action**. Swap any part:
323323

324324
```lua
325325
presets = {
326326
search = {
327-
f = { filter = "filter_words_after_cursor" },
328-
F = { filter = "filter_words_before_cursor" },
327+
f = { filter = "filter_words_after_cursor" }, -- make f multiline
328+
F = { filter = "filter_words_before_cursor" }, -- make F multiline
329329
},
330330
}
331331
```
332332

333-
Add multi-window to find motions:
333+
Here's a taste of what you can change with a single override:
334334

335-
```lua
336-
presets = {
337-
search = {
338-
f = {
339-
filter = "filter_words_after_cursor",
340-
metadata = { motion_state = { multi_window = true } },
341-
},
342-
},
343-
}
344-
```
335+
| I want to... | Change this | Example override |
336+
|-------------------------------------|---------------|----------------------------------------------|
337+
| Make `f` single-char | extractor | `extractor = "text_search_1_char"` |
338+
| Make `f` multiline | filter | `filter = "filter_words_after_cursor"` |
339+
| Make `f` a live search | extractor | `extractor = "live_search"` |
340+
| Jump to camelCase boundaries | metadata | `word_pattern = [[\v(\u\l+\|\l+\|\u+\|\d+)]]` |
341+
| Make word jump bidirectional | filter | `filter = "filter_words_around_cursor"` |
342+
| Delete without moving cursor | action | `action = "remote_delete"` |
343+
| Make any motion cross-window | metadata | `multi_window = true` |
344+
| Auto-jump to closest target | filter | `filter = "first_target"` |
345345

346-
You can override any motion property: `extractor`, `filter`, `visualizer`, `action`, `modes`, etc.
346+
See the [Recipes](https://github.com/FluxxField/smart-motion.nvim/wiki/Recipes) guide for 20+ practical examples, or [Advanced Recipes](https://github.com/FluxxField/smart-motion.nvim/wiki/Advanced-Recipes) for treesitter motions, custom text objects, and composable operators.
347347

348348
---
349349

@@ -425,6 +425,8 @@ See [Configuration](https://github.com/FluxxField/smart-motion.nvim/wiki/Configu
425425
## Documentation
426426

427427
- [Presets Guide](https://github.com/FluxxField/smart-motion.nvim/wiki/Presets): every preset explained in detail
428+
- [Recipes](https://github.com/FluxxField/smart-motion.nvim/wiki/Recipes): customize built-in motions with practical examples
429+
- [Advanced Recipes](https://github.com/FluxxField/smart-motion.nvim/wiki/Advanced-Recipes): treesitter motions, text objects, and composable operators
428430
- [Migration Guide](https://github.com/FluxxField/smart-motion.nvim/wiki/Migration): coming from flash, leap, hop, or mini.jump
429431
- [Advanced Features](https://github.com/FluxxField/smart-motion.nvim/wiki/Advanced-Features): flow state, operator-pending, multi-window, history browser
430432
- [Building Custom Motions](https://github.com/FluxxField/smart-motion.nvim/wiki/Building-Custom-Motions): create your own with the pipeline API

0 commit comments

Comments
 (0)