visual studio shell F# keyboard shortcuts - visual-studio

I've started using F# with the visual studio shell and I like the capability to be able to send lines to fsi by highlighting them, but the alt+Enter shortcut is really awkward and I would be much happier with this being on shift+Enter. (mainly since shift+ up/down arrow is select lines already)
Does anyone know how to change this? Thanks.

You can alter the keyboard mappings within Visual Studio. If you go to Tools -> Options -> Environment -> Keyboard, you'll see a window like the image below.
In order to check existing bindings, place the cursor in the "Press shortcut keys:" box and hit "Shft+Enter". You'll then see any potential conflicts in the drop-down box as shown.
In the example below, I'm searching through Global, which means shortcuts for anything in the application. You can switch it to be just the console or whatever you like.
Once you're happy with the shortcut you want to use, you need to select the command from the window containing all of the Action.* lines and then press Assign.

So I don't mean to be trite, but have you tried mapping the key?
So for F# Interactive I see Alt+Enter mapped to:
ClassViewContextMenus.ClassViewMultiselectProjectreferencesItems.Properties
Have your tried mapping Shift+Enter (or whatever) to that command?
Tools->Options->Environment->Keyboard
You should be able to get it all working from there.

Related

key bindings visual studio 2013 to switch tabs

I was wondering if there are any hotkeys by default key bindings I can add to Visual Studio 2013 to switch tabs. I know you can ctrl+tab and shift+ctrl+tab to go forward and backwards in VS13's list of open tabs, but I prefer i Xcode or sublime text where you can just cmd+shift+] or cmd+shift+[ to go to the right tab or left tab respectively. Does anyone know if there is a way for this? I can't seem to find one. Thanks.
I guess you can do it. I don't know why I couldn't find this before:
http://www.jetbrains.com/resharper/webhelp/Configuring_Keyboard_Shortcuts.html
Keyboard shortcuts in VS can be configured in Tools -> Options -> Environment -> Keyboard. You can find commands either by searching for their name ("Show commands containing:") or by pressing a known shortcut and seeing which commands it's mapped to ("Press shortcut keys:").
It looks like you need to set Window.NextDocumentNav and Window.PreviousDocumentNav.

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

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.)

How to assign keyboard shortcut to open a solution folder from visual studio?

I'm trying to assign a keyboard shortcut to open a solution folder (the one you get when right click on solution name) from Visual Studio. Looking in keyboard options in Options didn't help (searched for "folder", for "open" etc.)
Have I missed something ?
This is it:
ProjectandSolutionContextMenus.Project.OpenFolderInWindowsExplorer
It works, but I'm sure how you get the solution selected first?
Please let us know if you can solve it elegantly, I'm interested because I don't currently use AnhkSVN or VisualSVN, I prefer TortoiseSVN, but it would be nice to open the solution folder since that's normally the root.
You can assign a keyboard shortcut to a macro using this example
Assigning a Keyboard Shortcut to Macro in VS
Last time I forgot to mention one
important thing - how to assign a
keyboard shortcut to your macro. Often
you don’t need any button for your
macro, the shortcut is enough. Or you
can have both. As I already wrote,
macro is similar to any named command.
So to assign a shortcut to it:
Go to menu Tools - Options… and select Environment - Keyboard.
alt text http://www.helixoft.com/blog/wp-content/uploaded/keyboard_options.png
Find your macro in the list of commands. All macro names start with
“Macro.”. To filter out other commands
enter your macro name in the Show
commands containing field. If your
macro is named test as in our example
then type test. Select your macro.
Go to Press shortcut key(s) field and press your shortcut. If the
shortcut is already in use, you will
see it. Press Assign button.
Remember that you cannot change or
assign the shortcut if you are using
predefined keyboard mapping scheme.
You will be warned in this case. You
must create a copy of current scheme
and use that copy. Press Save As…
button under Keyboard mapping
scheme and give it some name. Then
select this new scheme.
There probably isn't a keyboard shortcut defined for that, but Visual Studio has excellent macro support, and you can create your own macro to do that.
There's a Macro Recorder feature that you can use. This MSDN article explains how to use the Macro Recorder.

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