I know it's simple to do in C#, but what is the command to jump between If/End If marks in VB.Net like you can jump between braces in C#?
(C#-version of this Question: Go to Matching Brace in Visual Studio?)
If you're using Visual Studio 2010, you can use Ctrl+Shift+Up and Ctrl+Shift+Down to jump between highlighted references and keywords.
Since these are If blocks, the IDE will highlight the Then keyword as well, so just tap Up/Down twice in rapid succession. Up/down wraps, so if you really want to save a keypress, hit the key in the "wrong" direction to get where you want.
I've resorted to putting the opening curly-bracket in a comment just after the THEN and a matching closing curly-bracket in a comment before the EndIf. This is a ghetto way of allowing VI to match the start/end of the block using % keystroke.
A more elegant way would be to use some sort of IDE that understands the block concept in the language you are editing. Sometimes this feature is called a "folding editor" as per http://en.wikipedia.org/wiki/Folding_editor
As I saw else marked when my caret stood at an if (in PHP code), https://google.com/search?q=jump+between+if+and+else+in+vscode brought me here, and patching together various hints led me to the following commands, bound in Visual Studio Code aka VSCode
# Command Palette (⌘+⇧+P # macOS)
Go to Previous Symbol Highlight
Go to Next Symbol Highlight
Reverse engineered default F7 / ⇧+F7 # keybindings.json:
{
"key": "f7",
"command": "editor.action.wordHighlight.next",
"when": "editorTextFocus && hasWordHighlights"
},
{
"key": "shift+f7",
"command": "editor.action.wordHighlight.prev",
"when": "editorTextFocus && hasWordHighlights"
},
To fit the right hand over a numpad keyboard, and having a lot of combinations bound to other commands, my keybindings.json (syntax is .jsonc - JSON with Comments) adds:
{
"key": "ctrl+numpad_subtract",
"command": "editor.action.wordHighlight.prev" // "Go to Previous Symbol Highlight"
},
{
"key": "ctrl+numpad_add",
"command": "editor.action.wordHighlight.next" // "Go to Next Symbol Highlight"
},
Related
I've found solutions on hotkeys Edit - Wrap - etc menu, and View - Word Wrap toggle. But not View - Word Wrap Column - etc menu items. Also tried to find plugins, nothing ...
https://www.sublimetext.com/docs/3/key_bindings.html
Currently there is no compiled list of all built-in commands. The
names of many commands can be found by looking at the Default ({PLATFORM_NAME}).sublime-keymap files in the Default/ package.
If you open the console with Ctrl` and enter
sublime.log_commands(True)
it will print the command for every. single. thing. you. do. Change the True to False to turn it off.
At any rate, for View → Word Wrap Column → 80, for example, it prints
command: set_setting {"setting": "wrap_width", "value": 80}
To set the keyboard shortcut, open your .sublime-keymap file and add the following:
{ "keys": ["ctrl+alt+shift+8"],
"command": "set_setting",
"args": {"setting": "wrap_width", "value": 80}
}
You can of course change the keys to whatever you want.
In Visual Studio Code, Ctrl+f activates the Find widget. I use vscode on Windows 10 (ssh into 'nix) and separately on the Ubuntu 18.04 Linux distro (w/Gnome Shell), when using the integrated terminal. I expected Ctrl+f to step one character forward in the CLI, as is typical on many Linux terminals, within vscode. How do I accomplish this?
I'd additionally like to maintain the find functionality, if possible, though with a different binding.
Because my search in SO retrieved little, I'm posting the solution and references I found for the community.
After searching several links via Google, I found straightforward documentation to solve this problem at https://vscode.readthedocs.io/en/latest/editor/integrated-terminal/.
The solution, in summary:
Open up Preferences: Open Keyboard Shortcuts, e.g. Ctrl+Shift+p and typing keyboard and then enter or return.
Type Ctrl+f in the Keyboard Shortcuts search bar and find the "Terminal: Focus Find Widget" line. Mine looks like this:
Click the pencil icon to alter the keybinding. One available for me was Ctrl+Alt+f.
Note: the following is pasted from the docs for easy reference.
Or, in your keybindings.json change:
{ "key": "ctrl+f", "command": "-workbench.action.terminal.focusFindWidget",
"when": "terminalFocus" },
to something like this:
{ "key": "ctrl+alt+f", "command": "-workbench.action.terminal.focusFindWidget",
"when": "terminalFocus" },
I also had to add this to my settings.json to make it work (VSCode version 1.62.0):
"terminal.integrated.commandsToSkipShell": [
"-workbench.action.terminal.focusFind"
]
In my VSCode v1.58.2, it now looks like this:
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+alt+f",
"command": "workbench.action.terminal.focusFind",
"when": "terminalFindFocused && terminalProcessSupported || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+f",
"command": "-workbench.action.terminal.focusFind",
"when": "terminalFindFocused && terminalProcessSupported || terminalFocus && terminalProcessSupported"
}
]
In VS with Resharper, there's the command ctrlw that will select the whole word at cursor and then, when pressed repeatedly, extend the selection to the brackets, then include them too, then to the next outer brackets etc.
What is the name of the command for that in Visual Studio Code?
The shrink/expand selection commands should be what you are looking for. The command names are editor.action.smartSelect.grow (default keybinding shift+alt+right) and editor.action.smartSelect.shrink (default keybinding shift+alt+left).
i use alt+s for editor.action.smartSelect.grow.
{
"key": "alt+s",
"command": "editor.action.smartSelect.grow",
"when": "editorTextFocus"
}
In Visual Studio Code, File > Preferences > Keyboard Shortcuts Menu, I can override default bindings in keybindings.json. But how can I add multiple bindings on a key? I wan't to do something like save as well as format code on press of ctrl+s
{ "key": "ctrl+s","command": "workbench.action.files.save,editor.action.format" }
Is this doable?
As far as I know that is currently not possible as the first keyboard shortcut that matches wins (searched from bottom to top) and no further shortcuts are evaluated - from the docs:
When a key is pressed:
the rules are evaluated from bottom to top.
the first rule that matches, both the key and in terms of when, is accepted.
no more rules are processed.
if a rule is found and has a command set, the command is executed.
That said, it seems that someone had the same desire and wrote an extension for that - see gyuha.format-on-save
However I did not test that extension myself so I can't tell you how well it works
Use the when clause as shown here where I hook up ctrl+enter to only case where .py[thon] script editor extension is active which is similar to the ctrl+enter file | preferences | keyboard shortcuts enabled by .R script editor extension.
[
{
"key": "ctrl+enter",
"command": "python.execSelectionInTerminal",
"when": "editorTextFocus && editorLangId == 'python'"
}
]
I know it's simple to do in C#, but what is the command to jump between If/End If marks in VB.Net like you can jump between braces in C#?
(C#-version of this Question: Go to Matching Brace in Visual Studio?)
If you're using Visual Studio 2010, you can use Ctrl+Shift+Up and Ctrl+Shift+Down to jump between highlighted references and keywords.
Since these are If blocks, the IDE will highlight the Then keyword as well, so just tap Up/Down twice in rapid succession. Up/down wraps, so if you really want to save a keypress, hit the key in the "wrong" direction to get where you want.
I've resorted to putting the opening curly-bracket in a comment just after the THEN and a matching closing curly-bracket in a comment before the EndIf. This is a ghetto way of allowing VI to match the start/end of the block using % keystroke.
A more elegant way would be to use some sort of IDE that understands the block concept in the language you are editing. Sometimes this feature is called a "folding editor" as per http://en.wikipedia.org/wiki/Folding_editor
As I saw else marked when my caret stood at an if (in PHP code), https://google.com/search?q=jump+between+if+and+else+in+vscode brought me here, and patching together various hints led me to the following commands, bound in Visual Studio Code aka VSCode
# Command Palette (⌘+⇧+P # macOS)
Go to Previous Symbol Highlight
Go to Next Symbol Highlight
Reverse engineered default F7 / ⇧+F7 # keybindings.json:
{
"key": "f7",
"command": "editor.action.wordHighlight.next",
"when": "editorTextFocus && hasWordHighlights"
},
{
"key": "shift+f7",
"command": "editor.action.wordHighlight.prev",
"when": "editorTextFocus && hasWordHighlights"
},
To fit the right hand over a numpad keyboard, and having a lot of combinations bound to other commands, my keybindings.json (syntax is .jsonc - JSON with Comments) adds:
{
"key": "ctrl+numpad_subtract",
"command": "editor.action.wordHighlight.prev" // "Go to Previous Symbol Highlight"
},
{
"key": "ctrl+numpad_add",
"command": "editor.action.wordHighlight.next" // "Go to Next Symbol Highlight"
},