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

textobject for nearest quote #3

Open
Konfekt opened this issue Apr 10, 2014 · 2 comments
Open

textobject for nearest quote #3

Konfekt opened this issue Apr 10, 2014 · 2 comments

Comments

@Konfekt
Copy link

Konfekt commented Apr 10, 2014

How about a textobject, let's call it u, going to the quotes closest to the current cursor position.

That is, viu selects everything in between any two curly, single, double or any other kind of quotes.

@reedes
Copy link
Collaborator

reedes commented Apr 10, 2014

I'll look to leverage the move-p/n capability of textobj-user to do this.

See how it's supported in my https://github.com/reedes/vim-textobj-sentence

Thanks for the feedback.

@reedes
Copy link
Collaborator

reedes commented Apr 12, 2014

Doing a bit of testing, I see that viq/vaq will select the previous curly double quoted string, if not already inside one. And viQ/vaQ for the curly singles.

A 'move' configuration looks feasible in my tests, but it's not clear what the pattern or suggested key mapping should be. (My textobj-sentence overrides Vim's default open and close parens for jumping between sentences.)

I'll experiment with a quote-specific move pattern that includes the user-configured double/single along with the straight quotes. It'll likely be orthogonal with textobj-sentence.

Because of http://en.wikipedia.org/wiki/International_variation_in_quotation_marks jumping to (and selecting) arbitrary quoted strings is fraught with ambiguity. There's no single pattern that works.

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

No branches or pull requests

3 participants