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
Surround a text/word with special characters #1307
Comments
Woah!!! We need this, but this looks to be better suited as an extension really. It should have some kind of modifier key though because I sometimes would like to replace a word with a special character. Maybe |
@bpasero Ben, start with you here since this sounds like a mark down feature. I think there is no underlying support needed in the editor to make this happen. |
Hello guys, its a mark down "native" feature. Thanks |
Yes, this is similar to the plugin for the brackets IDE. Very useful for wrapping html elements around selected text. http://www.granneman.com/webdev/editors/brackets/extensions/surround/ +1 from me! |
Great in any language for quotes/brackets/parens. User expects to be able to overwrite text by highlighting and typing, so @hashhar's suggestion is on the right track. Alt might not work right on Mac, since it's already used by the system to insert special characters (like ÷«“‘ªº). But other modifier(s) should. |
Need this! |
Maybe someone can take a look at how they implemented the surround with quotes to get an idea to extend it. I think after v1.6 we could select text and press EDIT: Found it. https://github.com/Microsoft/vscode/blob/c80de308d5ac76d9db02c0a9a2c9ac3417071af5/src/vs/editor/common/commands/surroundSelectionCommand.ts EDIT 2: See this for learning how to achieve this currently. Currently this feature is available when
|
What I would want is full The far dream would have us be able to declare an arbitrary punctuation pair and use that like we can now with Most of this functionality could be hidden behind a shortcut like |
Was suprised to see the behaviour for markdown files concerning surrounding selected text with the typed character is different from say js, html, css, ... files. Was this by design intended to exclude md files from this behaviour? |
Parity with Visual Studio would be great here. I know it can be an extension, but IMHO this should be built in or a pre-installed extension. |
How can I enable this feature in markdown files? Which command implements this? |
I just pushed 8fbad6e which adds this feature for markdown. To use it, select some text in markdown and trigger the Here's the reason a snipped based approach was selected and how other extensions/languages can implement this sort of functionality: For basic surround logic, extensions can use the However, in testing, I was concerned that "Insert bold text": {
"prefix": "bold",
"body": "**${1:${TM_SELECTED_TEXT}}**$0",
"description": "Insert bold text"
}, Any extension can contribute snippets that make use of this pattern. Feel free to submit a PR if you would like any of the other markdown snippets to use the surround logic as well Please let me know if you have any questions or concerns about the current approach |
Surround a text/word with special characters by selecting it and pressing the special character.
example:
The text was updated successfully, but these errors were encountered: