I'm looking for a keyboard shortcut for selecting everyting in the current active indent in VS Code, that could be useful for selecting a React or html component for example.
Basically, I'd like to select everything that has an indentation of at least same or more as the highlighted indent guide as shown below in two pictures. This guide line/stripe can be enabled through editor.highlightActiveIndentGuide
When cursor and highlighted indent guide are like below:
keyboard shortcut should select this:
I often find myself trying to select an entire React component which could be 10 lines sometimes, so it'd be pretty handy to have such shortcut. If there is any extension which would let me do it, it could work too.
If it doesn't exist at all, I'll send a feature request.
Look at the editor.action.smartSelect.grow command: Shift-Alt-Right. You just have to hit it twice to do what you want.
Related
Whenever I use autocomplete, VSCode automatically puts whatever I type in a selection, it didn't happen before and it only started happening recently.
Here's what happens:
I type something like this and suggestion comes up:
Then I press enter to auto complete:
All of this is fine, but when I start typing in the quotes:
VSCode automatically puts my text in a selection. This causes multiple problems. Suggestions get disabled in selection and I have to press Esc everytime I want the selection disabled.
Is there any way to fix this?
The question was already answered by #Anton Solomin and #devanil. The issue is VS code auto-suggestion is not working when text is highlighted, because some of your code snippet is preventing quick suggestion by VS code.
So just tell VS code that don't disable quick suggestion if some snippets askes you to do it.
Go to VScode settings page, in settings search bar type editor.suggest.snippetsPreventQuickSuggestions
Uncheck Controls whether an active snippet prevents quick suggestion
The default VS Code keybinding for toggling line comments isn't working in Jupyter Notebooks. The shortcut Ctrl+/ works fine when I use it in .py files, and it seems to work everywhere else as well. But when I am in a *.ipynb file, it just doesn't work. I noticed that when I use the browser VSCode version, the shortcut works in *.ipynb files.
I thought that changing the keybinding to something different might help solve the issue, but to no avail.
I tried recreating my project-environment. I recreated everything in new files, and in new folders. I even tried reinstalling VS Code. Nothing has worked for me.
VS Code Provides a Tool for Troubleshooting this Exact Issue
I have answered questions about VS Code Keyboard Shortcuts
several times, and what I learned from the experience, is that most people seem to prefer hitting there heads against a wall, rather than using the tool that VS Code developers graciously provided for them (or us I mean).
The Tool is named Keyboard Shortcuts Troubleshooter, and it is Toggled ON/OFF via a native VSC command. The command can be found in VS Code's "Quick Input Drop-down Menu". To execute the command, you need to open the Quick Input Menu using the F1 Key. Once the menu opens, your editor will change focus to its text-input, so you don't have to do anything other than simply typing the bold line of text below.
"Developer: Toggle Keyboard Shortcuts Troubleshooting"
While typing an option with the same name as what you are typing will appear in the menu. (PLEASE NOTE: _there are a few troubleshooters, one for keyboard shortcuts, and a couple others that pertain to Notebooks (DO NOT USE ANY TROUBLESHOOTER BUT THE KEYBOARD SHORTCUTS TROUBLESHOOTER).
Once you have found, and selected the "Developer: Toggle Keyboard Shortcuts Troubleshooting" command in the quick menu, the troubleshooter will be active.
PLEASE NOTE: SELECTING THE TROUBLESHOOTER TWICE WILL DEACTIVATE IT AND YOU WILL BE LEFT AT WHERE YOU STARTED.
To view the tool's output, you'll need to change your panel's view from terminal to the Output Console by selecting output at the top of your panel. Vs-code might automatically do this for you though. It didn't use to, but I think it does open the correct output window when you execute the +"Developer: Keyboard Shortcuts Troubleshooting"_ command. If it doesn't, then make sure you select LOG(Window) from the drop-down at the top-right of the Output-console's panel.
With the troubleshooter active, and the output open, use a keybinding (any keybinding) to test it. The output looks like this.
You Should have the Troubleshooter Working, which will give you all the info you need to understand the issue you have.
Bellow I have provided a snippet showing what the Output console looks like when I executed my custom Save-all Keybinding. So that your not completely on your own, your going to want to visit two links, if your able to be self-taught, these links golden.
The first is a guide. I provided this link, because if you can't get your troubleshooter working, this link provides a VS Code documented guide on how to use it. Plus a wealth of other info on this subject. [CLICK HERE]
The second is a Microsoft/VSCode/Wiki. Its covers this topic in a context that's has a little more depth to it. Over all I find this page very helpful, but it is a more advanced resource. [Click Here]
Click on the links that say CLICK HERE, the others go to the generic sites.
This output is for the keys:
[CTRL]+[SHIFT]+[SPACE] [S]
It saves all files when pressed. And this is the output for that keybinding I just described.
> / Received keydown event - modifiers: [ctrl,shift], code: Space, keyCode: 32, key:
> | Converted keydown event - modifiers: [ctrl,shift], code: Space, keyCode: 10 ('Space')
> | Resolving ctrl+shift+[Space]
> \ From 21 keybinding entries, matched chord, when: no when condition, source: user.
> + Ignoring single modifier ctrl due to it being pressed together with other keys.
> / Received keydown event - modifiers: [], code: KeyS, keyCode: 83, key: s
> | Converted keydown event - modifiers: [], code: KeyS, keyCode: 49 ('S')
> | Resolving [KeyS] chorded from ctrl+shift+[Space]
> \ From 1 keybinding entries, matched workbench.action.files.saveFiles, when: no when condition, source: user.
NOTE: "I removed the timestamps from the beggening of the lines to make them shorter."
The issue might be due to some other extension. In my case, this issue was resolved by removing the "Dependency Analytics" extension. Due to this extension, *.ipynb files were picking CVE as cell language mode. I wasn't able to change the cell language mode to Python without removing the extension. Upon removing, the extension, *.ipynb files showed Python as cell language mode and this resolved issues with key bindings as well as with syntax highlighting.
Note: Cell language is the small text that comes on the bottom right of each cell in a ipynb file. This should be Python for key bindings and syntax highlighting to work properly.
I was playing on my vscode configurations and accidentally change some configuration when I want to select the text on my code lines.
For example, when I want to select some lines in my code immediately appears a lot of cursors instead of selecting the text that I wanted. How can I change this configuration? Because a few days ago the selection in VSCode worked properly.
As you can see on the screenshot below, this happens when I try to select those lines :(
Turn off Column Selection Mode
From the main menu: Selection/Column Selection Mode uncheck
or there should be a Column Selection button on the Status Bar to the right that can be disabled.
Usually in Visual Studio Code, if I want to delete or modify a certain word from my file, I can highlight one of the words and then continuously press CTRL+D to highlight the rest of that same word in the file. But, in CLion, I am unable to find the equivalent shortcut.
I've Googled and searched here on StackOverflow but no luck. Maybe this shortcut doesn't exist in CLion? Can anyone confirm?
EDIT: It's also known as "Select next occurence" in other JetBrains products.
EDIT: The answer is ALT+J
it is alt+j in all of jetbrains products
So I just want to hit on a couple of options that you have, because I work with both CLion & VSCode as well, and needed the same exact keybinding in CLion.
KEYBINDING FUNCTIONALITY SEMANTICS
Unfortunately, it appears that no one cares about standardizing semantics when it comes to editor functionality/features, and keybindings. It can make moving from one editor to the next difficult, and flat out something many people just would rather not have to do.
Please Note:
_I am no expert on JetBrains IDE's, I am somewhat of an expert with VSCode though. I say this because, IDK how much JetBrains IDE's vary from one to the next, however, from having CLion, IntelliJ, and Access to Ryder I can tell you that in the standard IDE's the keymappings seem near Identical, but in Ryder, the keybindings are totally different.
DEV ENVIRONMENT
BOUND-KEYS (dev env's default)
SEMANTICS
CLion
ALT+J
"Add Selection for Next Occurrence"
Visual Studio Code
CTRL+D
"editor.action.addSelectionToNextFindMatch"
Visual Studio 2022 (IDE)
SHIFT+ALT+.
"Edit.insertNextMatchingCaret"
the The correct semantics for referring to the functionality you seek in CLion is contingent on the environment that its being implemented in. The following demonstrates how to correctly reference it in both JetBrains & Visual Studio Environments:
Add Selection To Next Find Match Ctrl+D editor.action.addSelectionToNextFindMatch
Once you know the semantics of the functionality that you want to customize, you no longer have to resort to using any editors default key mapping. You asked about, CLion, so I will demonstrate, in an image (or screenshot) below, how you can change the keybinding to be anything you want it to be.
To get to the window you see in the photo navigate by following the steps below.
Starting from the text editor, find the word 'FILE' on the 'MENUBAR' located at the very top of your screen.
Click on 'FILE' to drop open the 'FILE MENU'.
Scan through the __FILE MENU'_s ITEMS, until you see the selectable ITEM named 'SETTINGS' (it will have a wrench icon next to it).
4 Select 'SETTINGS' by left-clicking it, and you'll open the 'SETTINGS MENU' open.
Another 'LIST' will appear on the left side. There will be 'BOLD ITEMS' and regular weighted SUB ITEMS. Find the 'BOLD ITEM' that reads 'KEYMAP'.
Select 'KEYMAP'.
The image above shows the view in my IDE of the keymap menu. You can see a red arrow, as well as a green arrow, in the image.
GREEN ARROW
The green arrow shows where you can change the entire Keymap, as you can see in the image, mine is set to VSCode, and as far as I can tell, every keybinding is the same as in VSCode. You do have to download the VSCode keymap plugin though.
RED ARROW
The red arrow shows where the "Bound Keys" are listed. Right click on the keybinding and you'll see a menu that reads
Add Mouse Shortcut
Add Keyboard Shortcut
Add Abbreviation
"it may also have options for removing keybindings and mouse shortcuts, it all depends on how the keybinding you click on is configured"
To set the keybinding select Add Keyboard shortcut, and set it to what ever you want.
VSCode has breadcrumbs feature that looks like this:
Is it possible to go back one level in these breadcrumbs using a hotkey? So in the case above, I am inside propTypes. I press hotkey and I go to BatchTypesTable.
I can achieve this already by clicking on the breadcrumb itself but I want to have a hotkey to do this.
On MacOS, my keyboard workflow is:
open breadcrmb with shiftcommand.
then navigate the top level with option← and option→
use plain arrows to navigate inside the drop-down list
So, I guess on windows top-level navigation would be alt←?
Relevant VSC documentation here. Although it seems to be incomplete and partially incorrect?