gcmt / wildfire.vim

Smart selection of the closest text object
MIT License
611 stars 19 forks source link

Can you point out the differences between wildfire.vim and vim-expand-region? #8

Closed pgilad closed 10 years ago

pgilad commented 10 years ago

Just wondering what the differences are, it would probably be a best solution to join forces if they are the same, no?

I'm not representing anyone, just coming from someone who wonders what package to use.

vim-expand-region: https://github.com/terryma/vim-expand-region

If there are differences, I think it's important to highlight them so that users who (like me) are considering which package to use can decide.

gcmt commented 10 years ago

Hi Gilad, you're right, these plugins do exactly the same thing; it seems that I've somewhat reinvented the wheel. However, below is a list of the things that (at first glance) seem to differ from vim-expand-region:

albertnetymk commented 10 years ago

Have been using vim-expand-region for a while before finding wildfire. Trying to find out the difference as well. Thank you for summarizing the difference already, but it would be great if the item 1, 2, and 4 could be elaborated, with one example possibly.

robcsi commented 10 years ago

1.What I've noticed is that vim-expand-region can't select the n-th closest text object, while wildfire can.

  1. Wildfire doesn't select a word when standing on it, when the word is in a line without quotes, while vim-expand-region selects a word when first pressing '+'.
  2. vim-expand-region selects a whitespace-delimited text object first inside "-s for example, rather than the content of the "-s. So it goes outside the "-s and only after a few +s does it select the inside of the " (this is the first case gcmt mentions). Wildfire selects the inside of the "s first.
ches commented 9 years ago

This capability may have been added since this thread, but one advantage for Wildfire is that you can simultaneously use multiple sets of text objects in one filetype with different mappings—as far I can tell so far, with vim-expand-region you're limited to a global dictionary and one global dict per-filetype. In a Lisp-y language (which is probably where these plugins are most valuable), it might be really handy to have two mappings, one that includes "inside" text objects, and the other with "around" mappings.

VER might have an API to allow this, but it's not documented.