Replies: 4 comments
|
Hey @edlandm, thanks for the detailed writeup and working implementation! Really cool to see someone leveraging the collector/extractor API like this. The use case is solid, filetypes without treesitter parsers (like fugitive's gitcommit) are a real gap right now, and having a single keymap that adapts per-filetype instead of scattering mappings across ftplugin files is a much better UX. I like the layered approach:
This is something I'd be interested in adding as a built-in collector. The core idea fits naturally into the existing architecture. It's essentially a filetype-aware wrapper around the treesitter collector with a pattern-matching escape hatch. A few things I'd want to think through for a built-in version:
Thanks for putting this together! It's a great proof of concept and exactly the kind of feedback that helps shape the plugin. I'll keep this open as I think through the design. I will start playing around and thinking about this today and comment some more on what I add and explore. Thanks again |
|
Update: This is now built into the plugin on the Your writeup and working proof of concept directly shaped the design. I want to walk through what I built, why I made the choices I did, and where this can go. The Problem You IdentifiedYour core insight was that smart-motion's pipeline is powerful, but it assumes treesitter is always available. That's not true for:
Your solution bundled two things into one collector: pattern matching (the regex-based collection) and filetype routing (choosing the right strategy per filetype). I split these into two independent modules because each solves a distinct problem and is useful on its own. What I Built1. The
|
|
Hey this is awesome! This is exactly why I wanted to bring it to you and leverage your overall vision for the plugin rather than just letting the idea stay with my hack. |
Uh oh!
There was an error while loading. Please reload this page.
I'm loving this plugin and how configurable it is. I especially like the treesitter integration, but I found myself wanting a way to provide a fallback for filetypes that don't have treesitter parsers.

Simple example: The fugitive.vim
gitcommitfiletype. I wanted to be quickly yank my modified filepaths:I made this custom Collector that allows me to specify patterns as well as override the treesitter metadata for a given filetype. In practice I have a central "quick-yank" mapping that targets all of the most likely patterns without needing a different mapping definition for each filetype (ie defining a mapping in each ftplugin file).
It also allows me to define custom treesitter queries for filetypes like sql (specifically I'm using a plsql parser d that don't have a lot of the most common node types.
Here's a minimal config with my implementation. Stylistically it's likely not exactly how you would do it, but I wanted to introduce the concept in case its something you think is worth adding to the plugin.
Cheers!
All reactions