Different behavior between g* and *

Frank Fischer frank-fischer at shadow-soft.de
Mon Feb 24 22:14:26 CET 2014


Am 21.02.2014 23:11, schrieb Sanel Zukan:
> On 02/20/14,Frank Fischer wrote:
>> Interestingly in my tests it is the other way around, * selecting the
>> whole symbol and g* selecting one part of the word---but only
>> `evil-symbol-word-search` is non-nil. This difference is certainly not
>> expected behaviour (so it's a bug).
> 
> Ahh, in my case 'evil-symbol-word-search' was nil (which is AFAIK
> default); after setting it to 't', it reversed behavior which is like
> in Vim. I'm curious, why 'evil-symbol-word-search' wasn't set to t by
> default?

Historical reasons and consistency: a word is what w or e move over, and
what the [:word:] regexp matches. That might not be a good choice,
however ;)


>> I'm currently working on some larger modifications in Evil's internal
>> motion stuff. One thing that will (probably) be implemented is the
>> possibility to make 'word' motions work on Emacs 'symbols' rather than
>> Emacs 'words', which is usually closer to Vim.
> 
> This will be highly welcomed :) Will this make completion (C-n/C-p)
> smarter? I noticed if I have e.g. 'foo' (foo inside quotes), Evil
> doesn't know to complete foo, unless word is started with quote
> (e.g. 'fo).

I'm not sure, probably not without additional steps (IIRC Evil just
calls `dabbrev-expand`). However, completion is somehow out of the scope
of Evil. There are several completion packages out there and some of
them might work much better than the current one (just bind the
corresponding functions to C-p and C-n).

Best regards,
Frank





More information about the implementations-list mailing list