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

Support open/close pairs #15

Open
GlenPerkins opened this issue May 14, 2019 · 2 comments
Open

Support open/close pairs #15

GlenPerkins opened this issue May 14, 2019 · 2 comments
Labels

Comments

@GlenPerkins
Copy link

I'd love to be able to use this to make smart/curly quotes an option in text files. Straight quotes convert to curly and vice-versa.

This would of course require more logic, because the char inserted at the beginning would differ from the one at the end, but that additional logic would enable such things as <>, {}, [], and ().

And if your code doesn't require single-char strings, it would also enable more open/close pairs that the user could specify per filetype: {{ }}, , etc.

@jeremychone
Copy link
Contributor

Interesting feature. That would be on a different key map, like a "cmd + {" kind of thing, right?

@GlenPerkins
Copy link
Author

Yes, maybe cycling through quotes with one command and cycling through <{[( with another.

BUT, I'm probably combining too many things. My primary interest (in addition to writing code) is to be able to use VS Code to write natural language, such as a blog post, user manual, article, book, etc. These need to use proper ("smart/curly") quotes and apostrophes, which you can get from any word processor, but then you have to copy back and forth to keep it in your git repo...a mess. So what I'm looking for is an easy way to use smart ("curly") quotes easily within VS Code. Ideally, it would be smart enough to do the whole job, toggling between:
"That's a 'problem', I'd say." <> ”That‘s a ’problem‘, I‘d say.”
with a selection and keystroke.

This isn't your responsibility, of course, but a simpler tool that just cycled (user-specified) matched-pair delimiters, ex:
'foo' -> ‘foo’ -> "foo" -> “foo” -> foo -> (repeat)
would be very convenient, and you are already pretty close to doing it. It would be especially nice if it had an extra bit of intelligence so that it treated [alpha]['|’][alpha] as an apostrophe, NOT a delimiter, and simply converted an apostrophe between delimiters to curly when the outside delimiters were curly and straight otherwise. There will always be uncommon cases where, for example, you cut off the front of a word and need an apostrophe (ex: ’tis ’round ’bout 4am), but those edge cases are where you ignore the convenient tool and just edit manually.

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

No branches or pull requests

2 participants