Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Implement basic separator targets from `targets.vim`

Open rwblickhan opened this issue 1 year ago • 1 comments
trafficstars

What this PR does / why we need it:

This adds basic separator text objects from targets.vim. In particular, it supports the basic i/a behavior for all separators supported by targets.vim. This PR notably does not implement:

  • I or A behavior to select inside-without-whitespace or around-including-trailing
    • These are complicated by visual mode — I and A immediately fire ActionGoToInsertVisualLineModeCommand when in visual / visual line / visual block mode. That said, i and a seem more broadly useful — for instance, mini.ai actually only implements those two!
  • Next/last separators
  • Expanding selections
    • Arguably all of these should be subclasses of ExpandingSelection, but that feels out-of-scope for this basic PR (and anyway targets.vim doesn't support that either as far as I can tell). I welcome someone else to refactor 😉

Which issue(s) this PR fixes

Implements a bit more of #601.

Special notes for your reviewer:

rwblickhan avatar Jul 12 '24 01:07 rwblickhan

Would love to see this merged — particularly helpful for removing bar() in foo.bar().baz()...

max-sixty avatar Sep 10 '24 18:09 max-sixty