Related
I have been coding in vb.net for last 15 days . But facing problem when i want to navigate between if else .
As in c#/c++ to know the closing brace we generally use cntrl +] . Is there any equivalent shortcut present in vb.net ?
Please help since its really takes some time to get the corresponding else for if (specially when we have nested if and we are searching for else which correspond to 1st if .)
Thanks in advance .
There are more than 140 shortcut keys in Visual Studio, and they are defined by YOU. If you goto Tools>>Options and then go under Environment>>Keyboard, you will see all the shortcuts based on your laungauge preference. This link might help you VS Shortcuts but I couldn't find the shortcut you were talking about. You might have to look at each shortcut under the C# options until you find the key-combination you are looking for, then you will know the NAME of the command. Then, look at the VB settings and see what it is there, or define it if not already.
We cant navigate in vs 2008 or any earlier version . But from vs 2010 when we double click on any keyword it displays the rest keyword linked with it .
Select the keyword "If' and highlight it, then press Ctrl+Shift+Up or Ctrl+Shift+Down to switch between if and else block.
Select the keyword "If' it will highlight all 'if' 'else' keywords related to this, then press Ctrl+Shift+Up or Ctrl+Shift+Down to switch between if and else block.
I'm trying to create a toolbar in Catia. This toolbar (based on a VBA form) will have buttons which should start Catia Commands (among other things). One of the commands I'm trying to start is the "Constraint" command (which should allow you to place dimension to sketch elements in the Sketcher Workbench).
I looked in the command list (view->commands list...) and found "Constraint" for the dimensioning tool and "Constraint..." for the "Constraint box" (which opens a box where you can set geometrical constraints, which is not what I want). I tried with this (the simplest case):
Sub CATMain()
CATIA.StartCommand ("Constraint")
End Sub
and I also tried writing "c:Constraint" in Catia's command field at the bottom of the window.
None of these attempts give me the Constraint command I'm looking for. Instead I get "Unavailable Command" but if I select the sketch element I want to constrain I get the "Constraint box".
How do I start the "Constraint" command (used for dimensions) from VBA instead of the "Constraint Box"?
Regards,
Christian
EDIT: Fixed some minor spelling mistakes
Be careful that starting commands by name is locale-dependant. It means you should type "Constraint" in an english CATIA, "Contrainte" in french, etc...
Here is a good article on StartCommand, giving a few ways to find command names : http://v5vb.wordpress.com/2010/01/20/startcommand/
By the way, I tried both english and french and on my CATIA R20, it actually launches the command (waiting to select an element to constraint.)
Be careful to be :
in sketcher
with no other command running
If you only want to get the constraint command available all the time, just do a shortcut for it.
Open Sketch->Right Click on any bar -> Customize -> Commands Tab -> Select the command -> Show Properties -> Assign Shortcut.
Example, assign F6 to "Constraint" and that would be equal to:
Sub CATMain()
CATIA.StartCommand ("Constraint")
End Sub
If you want actually constraint two geometrical elements through vba, this is other matter. Say if you need more info on this.
your question is quite unclear, what do you want to achieve in fact with constraints? additionally "Constraint" function doesn't have any dialog attached to it, but "Constraints defined in dialog box" does, in order to make any of them to do any action, you have to pre-select some geometry on which is possible to make such constraint first
you dont need to customize anything, those functions by default have icons defined so you can always use them with start command, if you are in correct workbench of course, as constraint function exists on different levels, part, product, sketch..
If I select a variable (not just any string) in my code, all other instances of that variable get a stroke (white outline) around them:
Is there a keyboard shortcut that will let me select all of those instances of the variable and edit them all at once?
Things I've Tried:
⌘D, ⌘K, and ⌘U lets me select them one-by-one, but I have to manually exclude the non-variable string matches:
And using Ctrl⌘G simply selects all the string matches:
Clearly, Sublime is able to differentiate between variable and string matches. Is there no way to select just the variable matches?
Put the cursor in the variable.
Note: the key is to start with an empty selection. Don't highlight; just put your cursor there.
Press ⌘D as needed. Not on a Mac? Use CtrlD.
Didn't work? Try again, making sure to start with nothing selected.
More commands:
Find All: Ctrl⌘G selects all occurences at once. Not on a Mac? AltF3
Undo Selection: ⌘U steps backwards. Not on a Mac? CtrlU
Quick Skip Next: ⌘K⌘D skips the next occurence. Not on a Mac? CtrlKCtrlD
Sublime Docs
I know the question is about Macs, but I got here searching the answer for Ubuntu, so I guess my answer could be useful to someone.
Easy way to do it: AltF3.
Despite much effort, I have not found a built-in or plugin-assisted way to do what you're trying to do. I completely agree that it should be possible, as the program can distinguish foo from buffoon when you first highlight it, but no one seems to know a way of doing it.
However, here are some useful key combos for selecting words in Sublime Text 2:
Ctrl⌘G - selects all occurrences of the current word (AltF3 on Windows/Linux)
⌘D - selects the next instance of the current word (CtrlD)
⌘K,⌘D - skips the current instance and goes on to select the next one (CtrlK,CtrlD)
⌘U - "soft undo", moves back to the previous selection (CtrlU)
⌘E, ⌘H - uses the current selection as the "Find" field in Find and Replace (CtrlE,CtrlH)
This worked for me. Put your cursor at the beginning of the word you want to replace, then
CtrlK, CtrlD, CtrlD ...
That should select as many instances of the word as you like, then you can just type the replacement.
The Magic is, you have to start with an empty selection, so put your cursor in front of the word/character you want to multi-select and press Ctrl+D .
To me, this is the biggest mistake in Sublime. Alt+F3 is hard to reach/remember, and Ctrl+Shift+G makes no sense considering Ctrl+D is "add next instance to selection".
Add this to your User Key Bindings (Preferences > Key Bindings):
{ "keys": ["ctrl+shift+d"], "command": "find_all_under" },
Now you can highlight something, press Ctrl+Shift+D, and it will add every other instance in the file to the selection.
As user1767754 said, the key here is to not make any selection initially.
Just place the cursor inside the variable name, don't double click to select it. For single character variables, place the cursor at the front or end of the variable to not make any selection initially.
Now keep hitting Cmd+D for next variable selection or Ctrl+Cmd+G for selecting all variables at once. It will magically select only the variables.
It's mentioned by #watsonic that in Sublime Text 3 on macOS, starting with an empty selection, simply ⌃⌘G (AltF3 on Windows) does the trick, instead of ⌘D + ⌃⌘G in Sublime Text 2.
At this moment, 2020-10-17, if you select a text element and hit CTRL+SHIFT+ALT+M it will highlight every instance within the code chunk.
Just in case anyone else stumbled on this question while looking for a way to replace a string across multiple files, it is Command+Shift+F
I have a notebook with various sections which I would like to contract (i.e show only the title of the section/subsection etc...) and expand as needed to reveal more or less of the content of the various parts (as done in the help section of Mathematica for instance).
I see the function OpenerView creates the icon but appears not to be suited for the purpose.
How do I accomplish that?
From the menu, try "Format->Option Inspector" and select "Selected Notebook" from the drop-down menu. Then in the search box type "opener", and make sure the "ShowGroupOpener" is checked. Then put the parts of your document into "Sections", "Subsections" etc. using the "Format->Style" menu options.
The blue brackets on the right side of the page are cell brackets. They show you want can or will be collapsed. Double click the one that surrounds the block you wish to collapse, or select the section and press: Ctrl+'
If you wish to expand or collapse all of the sections within a section or notebook, select the range you want to affect (Ctrl+a to select all), then use:
Ctrl+Shift+[ to open
Ctrl+Shift+] to close
In the menu Cell>Grouping if Manual Grouping rather than Automatic Grouping is selected, then the sections you want to collapse may not actually be grouped. You can see what is grouped or not, by the blue brackets on the right side of the Notebook. This is what I attempted to allude to above. If you change the setting to Automatic Grouping, or group the cells manually using Ctrl+Shift+g, you should see the brackets indicate the group, and the commands above should work.
If you refer to this post,
https://mathematica.stackexchange.com/questions/265/easiest-way-to-use-showgroupopener-in-mathematica
it will likely have your answer. To enter the expression for the cell, use Cell | Show Expression. There you can turn on the ShowGroupHeader option.
In IntelliJ 10.5 I have "Highlight usages of element at caret" enabled. When a variable/method/etc is selected, is there a way to move to the next and previous occurrence? I'm looking for the equivalent of Control-K in Eclipse.
Edit: Shortcut to navigate between highlighted usages simply moves to the next text occurrence, which is different than moving to the next occurrence of the variable/method/etc. If I have the variable foo selected, I want to navigate to the next occurrence of foo and not any piece of text called "foo" (including "foo" in comments, method names, etc).
Also, pressing F3 seems to be buggy. When I press F3, it sometimes searches using the previous searched text and not the currently highlighted text.
F3 or shift+F3
ctrl+c, ctrl+f, enter or up and down arrows
ctrl+alt+F7
Added this in case people don't look at your edit.
It's not currently possible, see my question: Shortcut to navigate between highlighted usages.
I even created an issue IDEA-70523 addressing this feature, please vote for it if you can't live without it like me :-).
Install Identifier Highlighter Reloaded and use Alt + Shift + Up/Down (can be redefined in Keymap settings) :)
After you give it a shot and notice the 'hey, the highlight stays there after I move my cursor out of it' annoyance, consider upvoting this issue :)
In the Mac OS, you can navigate to next highlighted usage by press control + option + up/down arrow.
Vote this request up for make them implement the feature.
http://youtrack.jetbrains.com/issue/IDEA-59638
I found something thay may more suite your needs : alt + mouse-wheel up/down.
It goes to previous / next occurrence of identifier under caret.
Shortcut name is "Go to next highlighted element usage".
I usually do the following:
Highlight the word
Cmd + F (it will highlight all the matches in file)
Cmd + G (next match)
Cmd + Shift + G (previous match)
I could not get any of IntelliJ's native options for Find Next/Previous to behave like in Eclipse. Find Word at Caret comes close, but it only allows you to slurp and find the next word, not previous.
Identifier Highlighter Reloaded also does not behave like Eclipse.
I wrote an IntelliJ plugin to reproduce the exact behavior as in Eclipse. You can find it here: https://plugins.jetbrains.com/plugin/10635-quick-find-plugin
Look for next occurrence # Keymap
^G = "select" the variable that you want to search for
[shift]⌘G = [previous]next occurrence of selected variable
All credits to #Igor Wojda for his comment in the accepted answer.
(AFAIK, limiting search scope to only variable/method is not possible)
For text based match and quick jump:
Simply place the cursor over the desired word to be searched
Press Ctrl+F3
For further down/up search, simply use
F3/Shift+F3 respectively
in Intellij shortcut for this action, it's not defined.
but you can define it like this:
Ctrl+ Alt + S
search " highlighted usage"
then you can set a shortcut for that.
Ctrl+Alt+Up and Ctrl+Alt+Down navigates to the next and previous usages of a highlighted variable in IntelliJ.
I use this functionality of navigating to the next usage of a variable in a file by hot in Visual Studio all the time (Ctrl+Shift+Up and Ctrl+Shift+Down) and was looking for the equivalent in IntelliJ