-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Next & Last Object Motion #6353
Comments
https://github.com/wellle/targets.vim We should just port this, sounds like what you're asking for and more. “Just” |
@TheBB - Oh wow, I didn't know that existed. But yes! A port of that would be fantastic. It really is tremendously useful. |
behold: https://github.com/noctuid/targets.el. Courtesy of @noctuid, the master of evil. But it is not ready yet. (although I'm using it for precisely the case stated by the thread opener and it is working wonderfully already). And you don't have to even use Enjoy. |
@ninrod - Thanks so much for sharing this! It is, indeed, exactly what I was looking for. Perhaps when it's done it can be pulled into Spacemacs =) |
No problem. Here's how I use it: (use-package avy
:ensure t
:config
(use-package targets
:load-path "lisp/ninrod/targets.el"
:init
(setq targets-user-text-objects '((pipe "|" nil separator)
(paren "(" ")" pair :more-keys "b")
(bracket "[" "]" pair :more-keys "r")
(curly "{" "}" pair :more-keys "c")))
:config
(targets-setup t
:inside-key nil
:around-key nil
:remote-key nil))) this package will be a big hit on the evil community. @noctuid is packing a lot of awesome features in it. stay tuned. |
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! |
This may already exist for emacs, but I haven't been able to find anything on it.
In Vim, there is a snippet from Steve Losh that provides motion for next and last text objects. As an example of how this works:
If the cursor was on the character indicated, the user could press
c i n (
and the result would be:Where that command sequence is
change-in-next-(
. So just as you usually havechange-in-(
andchange-around-(
, for example, it understands the concept ofnext
andlast
instances of those text objects for motion.You can see the code that does this here: https://github.com/bhilburn/dotfiles/blob/master/vim/vimrc#L1313
The text was updated successfully, but these errors were encountered: