Visual Studio: how to make pressing tab key indent the whole line - visual-studio

Is there a way to configure a keyboard shortcut in Visual Studio such that tab (or some other key combo) indent the whole line (rather than insert a tab character/spaces at the cursor)?
Trying to determine whether Visual Studio is the dream editor
EDIT
I'm an experienced VS user, I know about the standard behavior, just curious whether it can be configured with the interesting tab behavior described in the link.

Increase indent:
Select / highlight line(s) or press Home
Press tab
Decrease indent:
Select / highlight line(s) or press Home
Press shift + tab
If you want to add a shortcut to do the same from anywhere in the line without selecting it then you can add a shortcut in Options -> Environment -> Keyboard. There'll be a list of commands including Edit.IncreaseLineIndent and Edit.DecreaseLineIndent. I couldn't find a good key combination for a shortcut though which wasn't already being used for something else. You can't use just tab by itself.

Related

How is right curly brace supposed to be typed in VS2017 editor? [duplicate]

A recent update to Visual Studio has introduced a new or updated shortcut key that on my non-English keyboard allowed me to create closing curly braces (AltGr+shift+*). This shortcut still works as expected outside of VS (e.g. in notepad) but in VS it is now associated to some text selection command (like select text from the cursor position to the bottom of the file).
How can I find the offending shortcut key command among the hundreds in VS? I remembered the existence of a VS add-in that allowed printing out all currently set shortcut keys to attempt generating a list I could quickly search through but I failed at finding it.
This has been driving me crazy for the last week. I tried to disable ReSharper, to reset the keybindings, to repair Visual Studio, all to no avail, I haven't been able to type closing curly braces since then. It never occurred to me that a new shortcut could have been introduced hijacking the keypress until reading your question.
To check if there's a rogue shortcut hijacking your keypresses, open the keyboard options screen using the Tools → Options → Environment → Keyboard menus and click inside the "Press shortcut keys" field (it doesn't matter which command is selected):
Then press the affected keys combination, the combination will appear in the "Press shortcut keys" field and the associated commands - if any is - will be listed in the "Shortcut currently used by" drop-down:
To remove the shortcuts you need to search for every entry listed in the drop-down by typing the command name in the "Show command containing" field, selecting the entry in the filtered list, and removing every entry listed in the "Shortcuts for the selected commands" drop-down by clicking the "Remove" button.

Recent Visual Studio update introduced shortcut used to create closing curly brace on my keyboard: how to find offending command?

A recent update to Visual Studio has introduced a new or updated shortcut key that on my non-English keyboard allowed me to create closing curly braces (AltGr+shift+*). This shortcut still works as expected outside of VS (e.g. in notepad) but in VS it is now associated to some text selection command (like select text from the cursor position to the bottom of the file).
How can I find the offending shortcut key command among the hundreds in VS? I remembered the existence of a VS add-in that allowed printing out all currently set shortcut keys to attempt generating a list I could quickly search through but I failed at finding it.
This has been driving me crazy for the last week. I tried to disable ReSharper, to reset the keybindings, to repair Visual Studio, all to no avail, I haven't been able to type closing curly braces since then. It never occurred to me that a new shortcut could have been introduced hijacking the keypress until reading your question.
To check if there's a rogue shortcut hijacking your keypresses, open the keyboard options screen using the Tools → Options → Environment → Keyboard menus and click inside the "Press shortcut keys" field (it doesn't matter which command is selected):
Then press the affected keys combination, the combination will appear in the "Press shortcut keys" field and the associated commands - if any is - will be listed in the "Shortcut currently used by" drop-down:
To remove the shortcuts you need to search for every entry listed in the drop-down by typing the command name in the "Show command containing" field, selecting the entry in the filtered list, and removing every entry listed in the "Shortcuts for the selected commands" drop-down by clicking the "Remove" button.

Navigate to open files / open tabs

Problem: Some times I have many tabs open and finding a tab is not easy and fast.
Question: Is there any shortcut in visual studio or resharper that allow us to find a tab by typing part of file/tab name?
Example: Something like Navigate-> Recent files... of resharper:
Looking up the ReSharper 2017.2 Help - Navigation and Search I could not find any hint about navigating through active files.
Visual Studio allows you to navigate through all open tabs by using Ctrl + Tab. This allows you to switch trough all open tabs ordered by their latest use. Use Ctrl + Tab again for forward and Ctrl + Shift + Tab for backward navigation. But as you already mentioned with a lots of open tabs it could be slow stepping through all active files.
What I personally do in your situation, when trying to find a open tab or any kind of class/file/member, is to use the Ctrl + T shortcut. This opens the Go to Everything/Type … popup, which allows you to search for anything within you solution.
To find an item in your solution by the item's name
To use the unified access to all search results, press Ctrl+T to display a pop-up where you can start typing and find everything in your solution that matches your input.
If you want to limit your search to types (classes, interfaces, structs or enums), press Ctrl+T twice.
If you want to find anything by a plain textual match, press Ctrl+T three times.
If you want to search symbols (types, methods, properties, fields, and so on) - press Shift+Alt+T.
You can also limit the search to files in your solution by pressing Ctrl+Shift+T.
from ReSharper Help - Navigation by Name
More Shortcuts: Resharper - Default Keyboard Shortcut Schemes
Yoy can try set shortcut to open window with active tabs: Options -> KeyBoard -> Window.Windows
It will look something like this

Rearrange Code shortcut in Resharper doesn't work in VS2015

When I try to use the shortcut for moving lines up/down (Ctrl+Alt+Shift+↑/↓), it highlights the code and shows the tooltip message "Use Up/Down to move text line" but nothing happens. If however I try the same command via the menu bar (Resharper > Edit > Rearrange Code > Move Up) it moves the selected lines as expected.
I used to use this feature all the time so I find this bug very annoying. Apparantly, others also experience this (see comments for Resharper move line up down not working) but I haven't been able to find a solution for it. Resetting keyboard layouts and reapplying VS keyboard schemes doesn't work.
Has anyone been able to resolve this issue?
[EDIT]
Reason of this is issue (when you are logging to machine with VS and Resharper via Remote Desktop) is that Ctrl-Alt-Left Arrow/Ctrl-Alt-Right Arrow combinations are not sent to your virtual machine
There are two workarounds:
My first soultion (change combination see below)
You can use AutoHotKey script as stated in thread:
https://superuser.com/questions/327866/remote-desktop-sending-ctrl-alt-left-arrow-ctrl-alt-right-arrow-to-the-remote-p
[/EDIT]
Reason is
duplication of the same hotkeys which could be found in 'Shortcut currently used by:' combobox
Fix is
I described process for _MoveRight shortcut - for other shortcuts it works the same
STEP 1 Check for conflicting changes
seeImage
go to Tool --> Options --> Keyboard
in field 'Show commands containing' find your command (moveright in example)
click in field 'Press shortcut keys' press ALT + RIGHT ARROW
in field Shortcut currently used by you will find conflicting shortcut -
Edit.CompleteWord...
STEP 2 Now we need to delete this shortcut
in field 'Show commands containing' write Edit.CompleteWord
you should see ALT + RIGHT ARROW shortcut in field 'Shortcuts for selected command
click Remove button
STEP 3 Now we need to add our shortcut to _MoveRight function
in field 'Show commands containing' find your command (moveright in example)
click in field 'Press shortcut keys' press ALT + RIGHT ARROW
click Assign

visual studio shell F# keyboard shortcuts

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.

Resources