Block selecting text or selecting multiple text at once - visual-studio

Does Visual Studio (any version) offer the ability to select text in either a block or select several snippets at once, to either change or delete? To be clear I'm referring to the actual text-editor interface.

you can certainly do block selection by hold down the Alt key while doing a selection

Go to opening or closing brace and press Ctrl+Shift+].

Related

Disable chordal hotkeys so I can use a custom hotkey

How can I disable all default shortcuts that use key chords? I am trying to add custom shortcuts, but they do not work because there are dozens of shortcuts that use the keys that I want to use as 'key chords.'
I suppose I could find which ones use my keys and go through one by one to remove them, but that would be extremely tedious, since I can only view the command that use it in the 'used by' dropdown, which only shows a few commands at once. I would have to write each of those down, search for them individually, and then remove all the shortcut assignments associated with them.
The shortcuts I intend to use are "ctrl + R" and "ctrl + T", and map them to VS's 'Comment out selected lines' and 'Uncomment out selected lines' functions.
You can go ahead and assign CtrlR to Edit.CommentSelection. Under "Use new shortcut in:", select Text Editor. Visual Studio will automatically remove all hotkey key sequences that begin with CtrlR in the Text Editor context.
I had a similar problem (at VS 2017 (Left Arrow) was pressed. Waiting for second key of chord) and found Resharper's experimental Shortcuts Live View feature invaluable in reporting what actual shortcut had been assigned and are currently active. With that you can identify where a chordal kay has been assigned, and remove it. If you're using the latest Resharper, press the left Ctrl key three times in text editor.

Does Visual Studio or Resharper have an auto-completion overwrite feature similar to Eclipse?

Sometimes I'll have classes/methods/variables with similar naming. For example, GetABar() and GetAFooWithABar() (assuming for the sake of example that these aren't horrible names to begin with).
I get into situations where I want to change one of the calls from the former to the latter, and when I start typing in the middle of the name, I'll get an auto-complete suggestion. If I select the suggestion, the following results:
GetAFooWithABarABar()
In Eclipse, there's a handy feature called completion overwrite which you can set as a default, or select on the fly by holding down Ctrl when you select the suggested term. Does Visual Studio or Resharper have a similar feature?
In ReSharper, you get a different result if you complete with Enter or Tab. If you hit Enter, it will insert the text, as you describe above. But if you hit Tab, it will replace the text to the right of the text caret, and should give you the result you're after.

Select only one character by mouse in Visual Studio 2013?

How can I enable to select only one character by mouse in Visual Studio 2013?
It's comfortable after a typo to select it by mouse, but here I must select at least two or three characters to make a selection for editing.
edit:
to be clear let's say the cursor is already far away from that typo and VS have default setting with added opencv. Still it won't select only one character, I must click, hold, move for at least three to make a selection (or more rows).
It's already enabled and you shouldn't modify anything. Visual Studio does not interfere with mouse settings and you should be able to use it just like you would with any other text editor.
I know it is annoying!
To select a single character
double click it with the left mouse.
If the character is in a word, unfortunately,
you will have to click in front of the character, then holding shift select past the character.
It's a pity you only got rude responses.
Not a very good solution but will still help your workflow if you are used to selecting a single character via the mouse :)

Bookmarks in Visual Studio editor

I'm looking for a plugin/addin for Visual Studio in order to bookmark a line of code.
For example bookmark line xx in file yy with mark "(1)" with keyboard shortcut alt+1 and then just pressing ctrl+1 in order to move to the line (1).
Is there anything like this?
Thanks!
Built-in:
CTRL+K, CTRL+K Create a bookmark
CTRL+K, CTRL+N Next Bookmark
CTRL+K, CTRL+P Previous Bookmark
A better solution to standard bookmarks...
Go to Tools/Options/Environment/Task List and add a new tag to record them. I wanted to use the phrase MARK but this word is too common in my code, so I'm using BOOKMARK set as low priority.
Whenever I want to leave a bookmark I just type //BOOKMARK: this is a bookmark, and that's it, simple!
To view them just open the Task List window and sort by priority or description and scroll down.
This is hugely better than standard bookmarks because they ...
are 'pinned' with the actual code and don't drift
can be shared with your own multiple environments and with other developers
are never lost if you suffer a problem with Visual Studio
are still searchable and readable in other editors eg notepad
you could create different tags to group different types of bookmarks together

Textmate tab and de-tab selected block

Recently switched to Textmate on Mac for coding. On PC when ever I want to tab in or out a block of code I just highlight and press tab or shift+tab to move it in our out. It's very useful when you are adding an extra loop or conditional statement to a block of code to keep everything tidy and neatly indented.
On Textmate however when I try this it just replaces my selected text with a tab. So is there a way to do tab and de-tab lines of code in textmate?
Indent: Alt+Tab
Un-Indent: Shift+Alt+Tab
the hotkey is command-left bracket to move left and command-right bracket to move right
(the buttons next to 'p')
heres a link to more hotkeys and such
http://projects.serenity.de/textmate/tutorials/basics/
You can use Shift+Tab to decrease indent; You just need to make and assign a macro. You can reuse this technique to accomplish a great many things.
Enter some text, and intend them, this is mostly for feedback.
Click the Record Macro Button
Use ⇧+⌥+⇥ (aka; Shift + Option + Tab) to decrease the indentation.
Click the record button to stop recording the macro.
Use the Edit menu or ⌃+⌘+M to save your macro;
Saving will prompt you to create a new bundle*, or add your macro to an existing bundle.
Add a Key Equivalent by clicking in the field and pressing ⇧+⇥
Your bundle-macro should look like the one below, simply Save and you're done! TextMate will now decrease indent on ⇧+⇥
*: (as noted by u/PatrickT) Sadly the create new bundle functionality has not yet been implemented, and you must choose to add to an existing bundle. You can still create a bundle via Bundles -> Edit Bundles then Command + N.
As an alternative, you can change the keybindings, see Link
Here is what I did:
Install Link
Go to File -> Open -> User Key Bindings, this will create/edit ~/Libary/KeyBindings/DefaultKeyBinding.dict
Add a binding, for the action enter shiftRight: (indent) manually (this is a TextMate specific action and not in the pre-populated actions list)
Choose a shortcut, I used cmd+alt+right
Do the same for the action shiftLeft: (un-indent, I used cmd+alt+left)
Save and then restart TextMate
I used a shortcut with arrow keys as my right hand is already on the arrow keys when I am selecting multiple lines, so this is a good fit.
The reason why I did it was because I have a german keyboard and alt+tab/alt+shift+tab don't work for me since I am using Witch for app-switching using these exact shortcuts.
EDIT: cmd+alt+left/right don't work when you have multiple tabs open, as they are used for navigate to next or previous tab in TextMate... seems this cannot be changed or overridden (I tried Setting Shortcut Keys in Textmate). Looking for an alternative shortcut now.

Resources