"Open Document" VS menu equivalent in Eclipse? - visual-studio

I am starting to use Eclipse for C++ developing after years with Visual Studio. I am used to right-click a filename in an include-Statement and then click "Open Document" to jump to this file. Does something like this exist in Eclipse CDT?
Thanks.

Using the mouse: Ctrl + MouseClick
Using the keyboard: F3
Both also work to jump to definition or declaration of a symbol.
Furthermore, you can use Ctrl +Tab to switch between a cpp file and its header. ("Toggle Source/Header")
The keyboard shortcuts are also shown in the context menu in the editor, there are many more very useful like F4 for type hierarchy or Ctrl-Alt-H for Call Graph.
Eclipse also ships with alternative key bindings to be similar to Visual Studio or Emacs. (Window->Preferences->General->Keys ---> Scheme)

Related

Is it possible to implement a "Vim" toggle in Visual Studio?

Ie, specify [ctrl][alt]+v or something...and that would instance vim inside that text editor window... because that would be really cool.
And/Or: is there a way to do it yourself, if you wanted to? Ie, can you attach custom functions to the keyboard keys and whatnot? I noticed that a lot of the Add-Ins seem to be able to kindof accomplish that level of customizability...
There are a few projects that incorporate vim keybindings directly into the Visual Studio editor.
Here's one: VsVim
I'm using VsVim
You download the plugin from the link above, double click on it and it will be installed in all VisualStudios you have installed in your computer.
About toggling VIM in VisualStudio:
I don't think you can enable/disable it per tab or file openned: either is enabled or disabled in all files.
What you could do is this: add a new shortcut to enable or disable it when you need it.
Tools -> Options... -> Environment -> Keyboard
On the "Show commands containing" input type "VsVim.ToggleEnabled". For me this command wasn't bind it with anything. I added the shortcut
Ctrl Q, Ctrl V

How to switch between header and implementation in VS2010?

Is it any keyboard shortcut or free addon in Visual Studio 2010 that allows to switch between header (C/C++ .h file) and implementation (C/C++ .cpp file)?
MS added this feature in Visual Studio 2013. It's a default keyboard shortcut Ctrl + K, Ctrl + O
To clarify: Keep Ctrl pressed, type K, type O, release Ctrl.
You can find the command this maps to from the customize-keyboard options as well (tested for VS2015):
Visual Studio does not have a built-in keyboard shortcut to switch back and forth. A macro is by far your best bet if you want to automate this with a single keyboard shortcut. For a list of suggested options, see the answers to a previous question.
The add-in Visual Assist X provides this feature with the shortcut Alt+O (however, add-ins are not supported by the Express editions of Visual Studio).
If you're trying to avoid using a macro, there is an alternative way to achieve a similar result, although it is a two-click process:
To switch from header to implementation:
Right-click a.cpp file and choose "Go To Header File" from the context menu.
To switch from implementation to header:
Right-click an identifier declared in the header and choose "Go To Definition" from the context menu.
My workaround to this problem is a bit unorthodox but it might help others, so I'll share.
I use the window list. And I thought it would annoy the heck out of me doing it this way, but I've actually gotten quite used to it. It continues to apply, even in Visual Studio 2012, so I'm offering it as yet another alternative.
Once both the .cpp and .h files are open, I switch between them like this...
To switch from .cpp to .h: Alt+W, W, Down Arrow, Enter
To switch from .h to .cpp: Alt+W, W, Up Arrow, Enter
You can actually hold down the Alt key while pressing the W the second time, effectively making it: Alt+W, Alt+W, Down Arrow, Enter (You don't have to release the Alt key until you type the arrow key)
This works because the .cpp and .h files are typically adjacent alphabetically in the window list. It also works for .c and .h for the same reason. Breaking it down: Alt+W goes to the "Window" menu, and the second W activates the "Windows..." window list viewer. The active window will be selected in the list box, so pressing the up or down arrow key will move to the document that is before or after alphabetically, which is almost always the corresponding .h/.cpp file.
As yet another alternative, I should also mention that if you place the .cpp and .h files beside each other in the window tabs, then you can use: Ctrl+Alt+Page Up, and Ctrl+Alt+Page Down to switch between adjacent tabs in the tabbed window list.
I realize that you have to "prepare" by having both documents open, and this is less than ideal, but I typically have all my documents open anyway, and I use the Alt+W, W shortcut a lot.
Such shortcut key is added in CodeMaid. CodeMaid is an open source Visual Studio extension
Ctrl + M then ,
http://visualstudiogallery.msdn.microsoft.com/76293c4d-8c16-4f4a-aee6-21f83a571496/
In VS2010 - The keyboard shortcut "EditorContextMenu.CodeWindow.GoToHeaderFile" does the same thing as the right click menu. Unfortunately it doesn't work as a toggle to switch back again. (Though, you can use ctrl - to go navigate back if you started in the cpp).

xcode function menu keyboard shortcut

I'm somewhat new to XCode and am very accustomed to using Visual Assist with Visual Studio. In XCode, I see the function menu above the text editor but can't seem to find a keyboard shortcut to pop it down. It seems to require a mouse click. It would be nice to have as this is yet another tool for better code navigation and is easily accomplished with Visual Assist using Alt-m.
Anyone know the magic incantation for XCode?
Ctrl + 6 opens the function menu for me.
Take a look under View > Editor for some related shortcuts. (See note below)
Unsurprisingly, you can start typing the name of the function to select it, instead of using the arrow keys.
I'm using Xcode 4, by the way.
NOTE:
The program CheatSheet lets you see a list of all keyboard shortcuts in the current program by holding down the command key (⌘) for 2 seconds.
Control 2
should do the trick

Visual Studio Window Shortcut Wonkyness

I've been diligently memorizing VS 2010 shortcuts based on the cheatsheats on Scott Guthries blog.
The shortcuts in the cheatsheet for WIndows dont match my setup e.g. Ctrl W,C is the cheatsheet shortcut to open the class viewer but mine is Ctrl + SHift, C. Maybe this is because my 08 settings got picked up at some point.
I've changed the shortcuts for viewing windows to match the cheat sheet (Ctrl + W,...) however most of the time Ctrl+W,... isn't working for me, whereas the previously defined shortcuts still work. If I go into the keyboard mappings I can see the shortcuts under global are Ctrl+W.
Anyone got any ideas?
Try going to Tools -> Options -> General -> Keyboard, focus the textbox labelled "Press shortcut keys" and pressing Ctrl+W. The dropdown list beneath it will show all corresponding actions. Action mappings are contextual -- they depend on what has the focus. Furthermore, 'Global' actions only apply if a more localised mapping does not exist. Check for anything applied to 'Text Editor'. If it exists and you don't want it, remove it by digging the action out in the 'Show commands containing' textbox above and clicking 'Remove'.
Also, do you have ReSharper installed? I love R#, but it uses Ctrl+W so the series of shortcuts you're referring to aren't available without being remapped or changing the R# keystroke (which I wouldn't personally, as I use it all the time.)

Is there a shortcut key to switch between split panes in visual studio/management studio?

When I have a file open in visual studio/sql server management studio and have it split in to two panes, I'd like to be able to switch between the panes without having to reach for the mouse. Does anyone know if a shortcut key exists for this?
F6 is your friend.
I think you can assign this by going to Tools -> Options -> Keyboard and searching for SplitPane. You should be able to assign shortcut keys for the following values:
Window.NextSplitPane
Window.PreviousSplitPane
CTRL+F6 will cycle through your files and across panes.
In SSMS: right-click toolbars, customize. Under categories, select Window, then under Commands select "Next Split Pane". Drag to toolbar. Right-click and change name to "Next Split P&ane". You can now use alt-a to change split pane.
On Microsoft SQL Server Management Studio (SSMS) 2012, I figured out that it is the combination of Ctrl+Shift+UpArrow(or DownArrow). :-)
This was not easy for me for some reason. This method finally worked (similar to Steve Dignan's answer above but I don't have enough rep to comment yet).
In VS 2012, Tools, Options, Environment, Keyboard.
"Apply the following additional keyboard scheme" set to "Visual C# 2005".
"Use new shortcut in" set to 'Global'.
Enter "splitpane" in "Show commands containing" to get only the 2 desired commands.
Select the first one and remove any shortcuts already assigned.
Click inside the "Press shortcut keys" box and use "Ctrl + Alt + Up Arrow" for prev and down arrow for next.
If either of those shortcut chords are currently used by something else, you may need to search on that command and remove it from there. Then come back to the split pane commands and Assign.
Don't forget to close VS before you open another instance of it.
For Visual Studio 2010 (maybe others as well) F6 will work to jump between split panes if Tools -> Options -> Keyboard does not use the Visual C# 2005 keyboard layout additionally (which was the case for me for I-don't-know-why reasons - maybe I said yes to an installer/first-start question a long time ago).
Of course you will no longer be able to build your project with F6 afterwards. ;-)
For Visual Studio 2012: Tools -> Options -> Keyboard -> search by Window.Split and add a new shortcut.

Resources