You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
), but there don't seem to be bindings for the motions it allows. This is a very useful thing to have for navigating in argument lists, and would make sense since evil-args is one of the packages in the spacemacs core rather than its own layer. But of course possible key bindings don't grow on trees (and H and L, suggested at https://github.com/wcsmith/evil-args are already taken with standard bindings), so I thought I'd open up an issue to see if this is something that might be doable and worth doing.
And there is vim-jump-args, which I could also see being useful (though I haven't used it myself, being new to both vim and emacs).
In my opinion, evil-forward-arg and evil-backward-arg are similar to the motion of evil-forward-WORD-begin and evil-backward-begin, respectively. This is because usually a good code style has spaces around arguments, e.g.
function_name(arg1, arg2, arg3, arg4)
and W and E work in the same way as evil-args brings to us.
And if there's no spaces around arguments, yes, evil-args would still work fine. But it's probably a better idea to fix the code to make it prettier in this case.
I think the motion evil-jump-out-args might be much more useful here. Often times I found myself was in the middle of some arguments and need a quick way to jump to function name, having a key binding to evil-jump-out-args might be handy. @syl20bnr what do you think? what's the best key for evil-jump-out-args?
Thanks for the suggestion. That works well in most cases, but doesn't work as well when a single argument contains spaces itself, e.g. my_func(a + b, c, d) and so on. So if they could be accommodated they'd certainly be appreciated. Of course, if not it's no big deal, since anyone who needs them can add their own binding. Just a thought.
And now that you mention it, evil-jump-out-args could also be useful for things like foo(a, [1, 2, 3], x, y).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!
I noticed that evil-args is configured to bind
a
as the argument text object (spacemacs/spacemacs/packages.el
Lines 799 to 805 in d56a2b0
And there is vim-jump-args, which I could also see being useful (though I haven't used it myself, being new to both vim and emacs).
Ping @danielwuz and @syl20bnr , who were behind the PR to add evil-args.
The text was updated successfully, but these errors were encountered: