VS: Shortcut to delete word - visual-studio

I've been looking all over, but can't find the following shortcut:
Does MSVC 2022 have a shortcut, either builtin or via an extensions, to delete the word under the cursor?
I know that Ctrl+Del deletes from the cursor to the end of the word. Ctrl+Backspace deletes from the cursor to the beginning of the word. Ctrl+w selects the current word. But, I can't find deleting the word under the cursor in just one shortcut. I usually do Ctrl+w, followed by backspace.
Another shortcut I wish it had, but which I'm pretty sure it doesn't, is jumping to the vertical and/or horizontal middle of the text window. This is to complement Ctrl+PageUp/PageDown, which jump to the top and bottom of the text window.

Related

Is there any way of using normal keyboard text selection with a terminal on MacOS?

For the last ~10 years I've been used to manipulating text with the alt/⇧/⌘ keys. For instance, alt+← to jump back a word instead, alt+⇧+← to select that word, ⌘+→ to jump to the end of line, etc.
I understand that terminals have different conventions and historically came first, but I'm used to these shortcuts, they work great and work everywhere else. Is there any way of getting the same controls for selecting and manipulating text in the terminal?
I have seen the following questions:
How to move the cursor word by word in the OS X Terminal
How do I clear/delete the current line in terminal?
But they only address moving the cursor, and not selection.
Depending on the macOS version - your default shell may be zsh.
Shortcuts options are ctrl + a/e to move to beginning/end of line and esc + W/B to move one word backward/forward
Other popular alternatives are -
a. bash - with the shortcuts listed in the answer by #Hossein Amiri
b. iterm2 - From - https://coderwall.com/p/a8uxma/zsh-iterm2-osx-shortcuts
Put this in your .zshrc
bindkey "[D" backward-word
bindkey "[C" forward-word
bindkey "^[a" beginning-of-line
bindkey "^[e" end-of-line
And set iterm preferences.
Moving the cursor:
Ctrl+A Go to the beginning of the line (Home)
Ctrl+E Go to the End of the line (End)
Hold the Option key option and click on the current line = Jump Backwards
Ctrl+P Previous command (Up arrow)
Ctrl+N Next command (Down arrow)
Hold the Option key option and click on a previous line = Jump upwards
Ctrl+F Forward one character
Ctrl+B Backward one character
Alt+B Back (left) one word or use Option+→
Alt+F Forward (right) one word or use Option+←
Ctrl+xx Toggle between the start of line and current cursor position
More information : https://ss64.com/osx/syntax-bashkeyboard.html
You can't, I've beed looking for long time. This is why people use iTerm they have more flexibility with keyboard only.
https://iterm2.com/features.html
Copy Mode
Use the keyboard to make and modify selections.

Position caret at start of line when clicking to the left of a line?

In Visual Studio 2017 (and possibly older versions as well, I don't know), clicking immediately to the left of a line of code selects the line. I find this to be an incredibly annoying "feature" that makes it very difficult to position the caret at the start of the line, requiring very accurate cursor aim.
Is there a way to disable this such that clicking to the left of a line simply positions the caret at the start of the line?

How do I get my cursor to jump to the last character on a line?

This problem has not always been around, and I can find no option in VS or ReSharper to correct it, but when I use the mouse to place the cursor on a shortish line of code, and I place the cursor near the end of the line, in whitespace, it stays there, instead of jumping back to the last character on the line.
You can uncheck the option Texteditor -> All Languages -> General -> Enable virtual space in Visual Studio. This way your cursor will always be placed at the last character of a line when you click anywhere in the whitespace area at the end of a line.
Note however if your line ends with whitespaces you actually typed in, it will place the cursor after the last actual whitespace of that line. Use Ctrl + Left Arrow to jump to the last actual character of that line.
You can use Alt + Backspace to quickly delete all whitespaces at the end of a line.

Visual Studio - move cursor to out of closing brace keyboard shortcut?

Given the following code example
someMethod(②someArgument①);③
I know moving the cursor from position ①->② shortcut is CTRL+], is there a ①->③ shortcut.
Is there a keyboard shortcut that escapes the brace when cursor is just left of brace (Not with End key).
In Eclipse, It can easily work with Tab key.
(In Visual Studio) - Try Ctrl+Shift+] - That seems to select text to where you might need to be, but if you press the ] again, by itself, it deselects, but leaves the cursor where you appear to want it.
Is that what you're looking for?

Visual Studio: Is there a keyboard shortcut for search in the current line?

When editing code in VS, I typically use Ctrl+G to move to the line number that I want. It would be really nice if there's another keyboard shortcut that would allow me to move to the word that I want on that same line as well regardless of the cursor's position.
Example:
Say, I just moved to this line:
quint32 beamNum; // Number of beams
and say I want to move to the word "Number"
typically I have to press Ctrl+→ a few times (in this case exactly 4) to get to the word that I want. Imho, this is not fast enough.
I did try using Ctrl+F but it doesnt work for all cases because sometimes I want to search backward and if "Search Up" is not checked, it then becomes too slow.
Just wondering if anyone knows of such shortcut, if one exists.
So, Ctrl+G will take you to the first column of the line. Then, you can press Ctrl+I (not an L) to begin an incremental search. Now, start typing the word that you are looking for (case sensitive) and the IDE will move to the first match of what you're typing. Hit Enter to end the incremental search.

Resources