Is there a way to make Matlab color matching parentheses?
A = max(B(:,3))
where the function parentheses for max() should have the same color, as well as the indexing parentheses B(:,3) having a different one.
Well this is not a full answer to the question, but it made me change one of my settings, so for what it's worth:
By default in MATLAB editor when you click on a parenthesis, an underscore appears under this parenthesis and the matching one. This can be changed in the settings so that instead of having an underscore, your matching parenthesis will be highlighted, which I find clearer:
Select "Highlight" for the "Match on arrow key" option.
It's gonna look like that:
Related
This is a question about the Matlab editor. I have several recurrent texts in my script such as:
e_{pos}=%.3f, e_{vel}=%.3f\n
I want to remove the curly brackets around these terms, so I use the Find/Replace dialog to replace \{(\w+)\} with $1:
But, the editor inserts a literal $1 instead of the matched text (vel or pos). I know some editors use different characters than $ so I also tried \1 and #1 but they did not work either. The documentation does not mention it.
So, is it possible to replace a matched group in the Matlab editor? How can I do it?
Note: I am not asking for the Matlab code to do this, I want to do it in the editor.
Thank you!
When double-clicking a number:
100%: selects "100" (good)
100px: selects "100px" (bad)
To more rapidly change number values, it would be great if VS Code could ignore units of measure when double-clicking a number like it does with symbols.
This seems like a feature that would be part of Editor: Word Separators, but it looks like you can only add single characters to the list.
Does anyone know if it's possible to change this? Thanks!
With the extension Select By you can specify with an regular expression what you consider a "word" and with a keybinding you are faster than using the mouse in selecting.
Use the surround property, see the link.
I found a lot about changing the text within parentheses or brackets in ms word (ctrl+H and then setting options through the format), but how can we change the format (color) of parentheses or brackets itself, at all occurrences?
This is not a programming question. As such, it is off-topic here.
That said, a single wildcard Find/Replace is all you need, where:
Find = [\(\[\{\}\]\)]
Replace = ^&
and you set the replacement font attributes to whatever you want.
The above will replace all parentheses, braces and square brackets.
Here's a quick way,
I am showing in WPS Office you can follow the same in Ms Word
First hit Ctrl + H and Search for the Paranthesis or Brackets you want one at a time each.
Hover your cursor in the Replace with Section and Click on Format >> Font
You will see Font color section the in Replace Font Window
Select the color of your choice and click Ok
Click on Replace All
I hope this will help you out fixing your issues
Is the behavior of Expand/Collapse Selection customizable? I want quotes to not be selected with an expansion. Also want to use other delimiters like periods, etc.
If a file isn't saved yet Expanding doesn't stop at quotes, but instead selects the entire line. Is this how Expansion is supposed to work with unsaved files?
I doubt the "Expand Select" command is customizable. Shift-Alt-RightArrow It is what it is.
However there is a nice extension that may act the way you want. Look at Expand Region. It will progressively expand or contract the region selected. If within a quoted portion, the first expansion will not select the quotes. It expands by region though, i.e., like scope. So it will not necessarily expand only to the end of the current line if that is what you are looking for.
Currently my eclipse formatter formats a multiline function call like this:
someObject.doSomething(
some().long().chain().of().methods()
);
But what I want is for eclipse to align the closing bracket with the method call:
someObject.doSomething(
some().long().chain().of().methods()
);
I have tried playing around with new line and wrapping rules in the code formatter but haven't been able to achieve this. What would be the solution?
After some time of digging I found a similar question which has an accepted answer but seems not to answer the same question:
Can the Eclipse formatter be configured to indent multiple lines between parenthesis properly?
The author of this question also states:
Edit: I found the settings for "Line Wrapping" -> "Default indentation
for wrapped lines" and "Default indentation for array initializes" and
have set them to "1" instead of "0". That is better for the array
initializers, but still doesn't indent closing parethesis to match the
opening parenthesis the way that I want it to:
The latest proposal on this does not take into account the closing );, but the first expression.
See Eclipse 4.23 (Q1 2022):
Method invocation wrapping indentation
It turns out it's not obvious how to indent a wrapped method invocation when the preceding expression itself is complex enough to also be wrapped into multiple lines.
Should the indentation be added to the existing indentation at the end of the expression, or just reset and assume that only the indentation of expression's first line matters?
Previously only the former behavior was available, now there's a setting to choose the latter.
The checkbox called Indent from the base expression's first line is located in the Line Wrapping > Wrapping settings > Function calls section, right under the Qualified invocations setting.