Is there a way to autoclose brackets and quotes in IPython.
Just like in RStudio when you type an opening bracket like [ it automatically types the closing bracket ] and moves the cursor inside the brackets. Same thing with quotes.
Possible, probably not too hard, but not trivial. Might need to update the underlying library (in progress), and to dig in CodeMirror doc to see if there is already such an option. If you are interested in diving in the code/submit Patch I would suggest asking for directions on the ML / on github.
Related
I am getting annoyed by the autocompletion of the <> brackets in VSCode for Rust. While it might be useful when specifying generic types, it really bothers me when it autocompletes ">" for my smaller than operators.
I know I can disable autoclosing brackets completely, but is there a way to specify which of them should be considered brackets? I have installed the Rust extension, and without it, this is not a problem.
Angular brackets were added to autoClosingPairs in this pull request on the premise that Rust developers write generics more than comparison logic. This choice was re-discussed here tp no avail. It seems that there is no way to differentiate between generics and comparisons with vscode's current configuration options. However, there are two ways to remove this behaviour manually. One is to disable auto closing for all brackets by adding this line to your settings.json:
"editor.autoClosingBrackets": "never"
The other solution is to disable autoclosing for only angular brackets by removing the rust extension's configuration locally:
// .vscode/extensions/rust-lang.rust-x.x.x/language-configuration.json
"autoClosingPairs": [
{ "open": "<", "close": ">" },
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ remove this line
]
Is there a way to highlight brackets when the cursor is anywhere within the enclosing brackets? Default settings highlight it only when I place the cursor near the brackets.
Yes, there is now a way by default, in VSCode 1.40 (October 2019):
Improvements to bracket matching
Previously, VS Code would only highlight matching brackets when the cursor was next to a bracket character.
Now VS Code will always highlight enclosing brackets if they exist.
We have also adjusted our Go to Bracket and Select to Bracket actions to use enclosing brackets.
It is improved and supported natively with VSCode 1.60 (Aug. 2021):
Bracket pair colorization can be enabled by setting "editor.bracketPairColorization.enabled": true.
All colors are themeable and up to six colors can be configured.
VS Code only supports bracket matching when the cursor is near the opening or closing bracket. Maybe an extension would help highlight the enclosing brackets wherever you are in the code but I haven't been able to find one.
If you just want to quickly find matching brackets, braces, parens, etc. you could try Bracket Pair Colorizer or Rainbow Brackets.
Also maybe you will like VSCode extension "Blockman", it highlights nested code blocks. (I am the author of Blockman)
With release 1.60 (September 2021), VS Code now has bracket pair colorization built in, indicating all matching brackets by color.
This feature can be enabled by adding this line to settings.json:
"editor.bracketPairColorization.enabled": true
I am using Version: 1.63.2(MacOS). Default bracket highlight feature was not working for me. In case, someone face similar issue, set it true.
"editor.matchBrackets": true,
I want to add square bracket in org mode links' description, for example:
[[http://www.example.com][ Array[i] ]]
Is there a way to escape the brackets [ and ] ? Someone mentioned URL-encoding, but it's not compatible. Besides, looking for the URL-encoding of a character is time consuming.
I suspect that Org doesn't support this.
Org's link structure documentation makes no mention of escaping square brackets in link descriptions.
If you use org-insert-link (bound to C-c C-l by default) and try to use square brackets in your link text, Org converts them to braces:
[[http://www.example.com/][Array{i}]]
You should be able to use a Unicode character that looks like a square bracket inside your link text, but I haven't found a reasonable character to use. The closest I found were SQUARE IMAGE OF (⊏) and SQUARE ORIGINAL OF (⊐), which do indeed work:
[[http://www.example.com/][Array⊏i⊐]]
I found that using org-mode Macros to insert the ASCII codes for the square brackets works. I have posted the solution on Emacs Stackexchange.
I just switched from Textmate 2 to Sublime Text 2. I figured that typing single quotes or brackets would automatically generate a second quote or bracket with the cursor in between ("auto-pairing" is what they call it, Textmate2 does this by default) but this isn't happening.
I see that in the preferences->settings-Default there is some JSON configuration that would seem to be doing what I need but this is not the case. I haven't changed any of this default configuration.
Could someone help me add to my preferences->settings-User the configuration I need to enable auto-pairing for all the common tags, i.e., "'{[(?
Right now I'm working on a client's laptop and running Sublime Text 2 portable version from my flash drive. No additional packages installed, default settings. Everything works as expected:
When I type a single or double quote, brackets, square or curly brackets it adds a closing one and puts cursor in the middle.
When I select smth and press any of mentioned above keys it surrounds selection with pair of appropriate quotes or brackets.
Check your Settings>Default, look for this:
// Controls auto pairing of quotes, brackets etc
"auto_match_enabled": true,
It's near line 89 or so.
Not a direct answer to your question..but I have installed a few plugins in ST2 and auto-pairing works fine.
I am not sure which plugin is responsible for it. Let me know if you would like me to share the list of plugins.
A few days back I felt this question to be dumb and dint post it here, but after even after searching a lot I dint find a proper solution.
For those of you who used TextEdit (on Mac), they will perfectly know what I am talking about.
While coding I just want to put quotes or parentheses over a word or a line.To do this I'll have to move back to the starting of the word, open the quote and then go to the ending of the word and close it.
Is there a plugin or so in eclipse where I can just surround the current selection with quotes or parenthesis ?? I am not talking about quick fix (Ctrl + 1). It can be used for much complex templates.
You can do that with a custom template, so for example if you want to create this template for java, you can do :
Preferences ---> Java ---> Templates
Create a new template and call it quote, then type this as pattern :
"${word_selection}"${cursor}
Save it and Apply.
After that you can use that template selecting the text you want to quote then press CTRL + SPACE and then chose quote.
Same thing for parenthesis :
(${word_selection})${cursor}