Skip to content
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

Moving through variable segments #8

Open
JosephFerano opened this issue Jan 4, 2014 · 6 comments
Open

Moving through variable segments #8

JosephFerano opened this issue Jan 4, 2014 · 6 comments

Comments

@JosephFerano
Copy link

It would be nice to move forwards and back by variable segments . I just got into vim and vimscript, I looked at the code for a while and read the documentation but couldn't really figure it out. I saw that it would require setting move-n-function and move-p-function but I wasn't sure how to set up a keybinding and how to set up the dictionaries like that.

@Julian
Copy link
Owner

Julian commented Jan 4, 2014

Hrm, I forgot to even check if vim-textobj-user gave us this for free :).

Yeah, this'd be nice to have – I'd have to read through a bit myself to figure out how to get this done.

@JosephFerano
Copy link
Author

JosephFerano commented Jan 4, 2014

Yeah, if you want to skype chat, I can kind of go over what I've already found out, I'm just way too new to vim and vimscript, so it's going to take me way much longer to figure out.

@agilmor
Copy link

agilmor commented Jun 3, 2018

Is there a way to use variable-segment in a similar way as targets.vim does with nl, and also with [count]?
I mean:

  • selecting the next variable segment by: inv or anv
  • selecting the last / previous variable segment by: ilv or alv
  • selecting the Nth next variable segment by 2inv (N is 2 here)

Thanks!

PS: I'm not sure if this issue is the totally about my question, but it's too related to create a new one?

@dylan-chong
Copy link

How about ]v and [v for movement options?

@hbarcelos
Copy link

hbarcelos commented Apr 6, 2021

While there is no support for movements with this plugin, one can combine it with CamelCaseMotion to do the trick.

Add this unimpaired-style mappings to your .vimrc:

" call camelcasemotion#CreateMotionMappings('<leader>') <----- MAKE SURE TO NOT CALL THIS FUNCTION
nmap <silent> ]v <Plug>CamelCaseMotion_w
vmap <silent> ]v <Plug>CamelCaseMotion_w
nmap <silent> [v <Plug>CamelCaseMotion_b
vmap <silent> [v <Plug>CamelCaseMotion_b

Other than that, the textobj defined by this plugin are far superior to the ones that could be used in CamelCaseMotion.

@raine
Copy link

raine commented Dec 9, 2022

@hbarcelos Perfect, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants