Closed ghost closed 9 years ago
Actually, this was exactly what I had planned to implement to solve #10. User-defined [regex] symbol groups. Additionally, each symbol group can be differently scoped.
For instance: (add-to-list 'evil-snipe-symbol-groups '("[" "[[{(]" buffer))
would make searches for sa[
jump to the next instance of a[
, a{
or a(
anywhere in the entire buffer. The third parameter would be take anything that evil-snipe-scope
accepts, or can be omitted to use the default scope.
I haven't implemented it yet, but that's the plan.
And done. I haven't implemented symbol-group specific scopes, so right now it only takes character => regex pattern, like so:
(add-to-list 'evil-snipe-symbol-groups '(?[ "[[{(]"))
This should also fix/address #10
Shouldn't this be?
(add-to-list 'evil-snipe-symbol-groups '(?\[ "[[{(]"))
Yes, it should. My mistake!
Ok, then you might have to correct the docstring for evil-snipe-symbol-groups
.
How would you add the opposite, i.e. ]
matches ])}
? No regex I produce seem work (which isn't strange since ]
closes the regex brackets. I couldn't get escaping it to work either. (]|)|})
did not do the trick either....
How would you add the opposite, i.e. ] matches ])}?
(add-to-list 'evil-snipe-symbol-groups '(?\] "[]})]"))
Brilliant, thanks.
Ok, then you might have to correct the docstring for evil-snipe-symbol-groups.
And done. Also, I've discovered a bug: symbol groups are ignored when repeating searches. I'm on that now.
I'm now unable to repeat searches with fFtT
. Anyone else have the same problem?
At all? Just in case this is a MELPA issue, could you check out evil-snipe.el and tell me if you have 1.6.2 or 1.6.3?
(A quick way to get to that file is to do M-x describe-function RET evil-snipe-s
and clicking the "evil-snipe.el" link in the help buffer.)
;; Version: 20150301.2131
;; X-Original-Version: 1.6.2
But this might be something wrong with the config on my end. When calling M-x evil-snipe-override-mode
it works.
Is evil-snipe-override-evil
set to t?
Also: you seem to be one version behind (the latest was 1.6.3, pushed ~15 minutes ago). I just bumped it to 1.6.4 a second ago. I'm not sure how often MELPA checks for changes though.
I'm not sure how often MELPA checks for changes though.
In my experience MELPA updates every 10-30 minutes.
This works for me now with the new version. Thanks.
This is slightly related to the idea of symbol groups #10 . Another idea might be to have a char for regexes, for example
æ
, the key to the left of the right pinky. Then the key coming after theæ
would stand for a user defined regex.I would use it like this:
sæf
to search with the regex (defined by me in a dotfile)^def \w+):
.This way I could quickly find all python function definitions with
sæfsss
(I always forget the function names). Another one could besæp
to find@property
, etc.I would probably create a different regex map for the different language modes.
This is probably more of a poweruser feature, but just throwing it out there. You could even have a crowd-configured library of useful regexes like yasnippet.