How do I select all text in vistual studio code? - visual-studio-code

In visual studio code (1.29.1) ctrl+a doesn't do anything for me. I checked keyboard shortcuts and it's mapped to a few select all actions (editor.action.selectAll, etc.) but when I'm in a file and press it nothing happens. How do I select all text in the current file in visual studio code?

Thanks for the comments, it make me realize it must be an environmental issue. Turns out if you have any mapping starting with a key combination that will lock that mapping to the key combo and you can't use it for anything else.
To make save all ctrl+shift+s I had to re-map save as and I mapped it to ctrl+a+s, so everytime I hit ctrl+a it just waiting for second key. In the status bar at the bottom of my editor it said something like "Ctrl+a detected, waiting for second keystroke", which means Ctrl+a won't work on its own. I re-mapped Save As to some unused key combo and it fixed select all.

This question was luckily answered on another thread
I'll post the OG answer here, nonetheless.
Most new comers to VS-Code could resolve this issue with the 2nd method provided by the OG answer:
Goto File > Preferences > Keyboard Shortcuts
in the search bar type this Select All
There's should a couple of results, you'll obviously want the "Select All" result
right click on his line and click on Change When Expression
a textbox would be highlight for you to fill in text. type editorFocus
press enter and done!
The OG answer provides image if you need to confirm that you're doing it right.
side-note: This issue bugged for more than 3 years and is the main reason my I used VS-Community over VS-Code.
So it's nice to finally be able to work normally in this very robust customizable IDE text-editor.

Related

VSCode Type Hint toggle display

How can I toggle on and off the display of Type hints in VS Code? For example, I've got the code .remoteOf(ClassServiceClient.class) and what I see is .remoteOf(CLAZZ:ClassServiceClient.class) but I can't actually select or seem to interact with the CLAZZ word.
How do I toggle this on and off? It seems useful in certain situations, but it just makes me think I typoed something.
I'm sure this has been asked before, but I haven't been able to come up with a word that seems to describe this feature.
This feature is called Inlay Hints and can be found under the Editor section.
After this, I've gone from displaying clazz:#Log4J2 to #Log4J2, and have enabled the option to display this hint by holding down a set of keys, ctrl + alt by default on Windows.

VSCode: I want to remove annoying info message bar

Is there any way to completely remove this message popup or move it to somewhere?
I already know why this message comes, but I do not want to disturb my activity with annoying info popup.
When it pops up it hides the document tab, so I have to close it every single time. (I do not want to know how to fix this particular error message, this screenshot is just an example.)
It's very annoying and I've searched around for a way to remove it, but the answers keep saying how to fix that particular error and not how to hide the popup itself.
Press ESC.
I agree that this is really annoying. VS Code is all about high-speed workflow and not having to interact with anything except your code via keyboard. Everything has key chords, e.g. CTRL-P and CTRL-SHIFT-P. So having to stop what I'm doing, go to the mouse, and dismiss this popup, whenever a background task feels like completing (and not even really then, because the popup actually appears some short time later) just so I can get visual confirmation of which file I'm currently coding in, to refocus my work after being distracted by the same popup, is really awkward. They are in a stupid location and don't even fade away after time like well-behaved toasts.
That said, I think that's really two parts; the distraction, and relatively high workflow cost to dismiss.
It helped me a lot to learn that it can be dismissed quickly and easily with the ESC key. The other half the problem I still haven't solved, but hope that helps you.
In the screenshot it shows trying to validate PHP.
In a VS Code window select File > Preferences > User Settings
An editor will open on the left called Default Settings and on the right with a file called settings.json
In the right side editor you can add settings that will override those found in the left-hand-side one.
Between the braces type:
// Whether php validation is enabled or not.
"php.validate.enable": false,
Then save the document.
VS Code will no longer attempt to validate PHP files.
You can override any of the defaults using this method.
You can use the same technique for each Workspace (or project folder) using File > Preferences > Workspace Settings
You can't disable the alert bar in general as VS Code needs to tell you things and doesn't (thankfully) use modal dialogs to communicate.
Go to File > preferences > settings
Then add this to your user settings
"editor.parameterHints": false
You may want to try adding the line
"extensions.ignoreRecommendations": true
to your VS Code settings file (which you can easily reach with the keystroke (CMD + ,) on a Mac OS X or macOS system.)
Solution: User Preferences > change "editor.parameterHints": true to "editor.parameterHints": false
This will at least remove the obstructive boxes that appear above the cursor.

How to disable Ctrl-Click in VS Code

I want to know if it's possible to remove the key bind on Ctrl-Click for the goToDefinition (F12) editor action.
This is so annoying, every time i try to Ctrl+C/V it trigger and go to the definition cause I'm holding Ctrl while I'm highlighting the code with my mouse.
I have search for it on google but all y can change is the F12 key bind for goToDefinition which is not what I want.
--- Update
This is the feature I want to disable
I need to remove the ctrl+click key bind.
Even if I replace it, it doesn't work.
-- Update 2
I finally found something on the subject Here
But for me it doesn't work at all.
-- Update 3
Created a new issue on GitHub (#7827)
Look at it if you wanna see the update on the request.
At the time of writing (2022) you can turn off this with workaround by setting following setting to 'ctrlCmd'.
How to open setting page in vs code?
Ctrl+Shift+P and enter open setting (UI)
Note that if you are also looking for Ctrl+Click for word selection, it is still not possible. See my another answer.
And yea, the dreaded (and famous) issue #3310 is never really happened, even after 6 years.
There is a VS Code feature request for this on GitHub, under the more general heading Allow customization of mouse shortcuts.
Anyone interested in this VS Code feature should comment/vote there. (The Ctrl-click-specific GitHub posts have been closed off and linked to this one. Ex. #16974)
Add the following lines in keybingings.json to disable (actually override default behaviour) mouse+ click
[
{ "key": "ctrl+[mouse button]", "command": "cursorWordLeft",
"when": "editorTextFocus" }
]
To open key bindings file, traverse
File > Preferences > Keyboard Shortcuts

Remove auto-completion with Enter key in Kate text editor

In Kate text editor, one can auto complete using either the Tab or the Enter key.
I find auto-completion with the Enter key disruptive, because often you really do mean what you say, and want to go to a new line. Who knew.
How can I disable only the Enter key auto-completion without removing the Tab auto-completion?
You CAN'T do that.
From https://bugs.kde.org/show_bug.cgi?id=316413:
Sorry, but auto-complete really works ok the way it is. If we alter that behavior, we will get many more reports about that than with the current way.
And then:
You can deactivate the auto completion in the settings. Then you can invoke it manually. If that doesn't help, then yes, Kate is perhaps not the best choice, sorry.
So it seems, from the developers' own mouth, that Enter can't be turned off. You can turn off autocomplete as a whole, or if you don't like that, you can find another text editor. Or you can edit the source code yourself, after all it's Open Source.
The developers like it as it is, and have no intention of making the behavior configurable.
I've seen a workaround in this article that works for me:
go to: Settings->Configure Keyboard Shortcuts. Then change the Action:
"Insert Smart Newline to Enter instead of Shift+Enter.

Validate Autocomplete in Eclipse

Coming from Visual Studio and starting a project in Java, I realized I couldn't cope with having to press ctrl+space to have the autocomplete panel show up. An easy workaround was to set all keyboard characters to be trigger characters for autocompletion.
My only problem is that, when presented with autocomplete suggestions, a single press on the space bar will write the first proposition. In situations where I'm happy with the suggestions, that's just fine. In situations where I actually want to use what I wrote down initially, I have to press 'escape' first to remove the autocomplete panel before I can press 'space' safely.
Netbeans doesn't use the space bar as a validating key for autocompletion (only 'enter' does that) and I like that behavior. Any way to replicate it in Eclipse?
Thanks in advance for your answers!
EDIT: I should have mentioned I'm using Eclipse on the Mac.
Guillaume
I have the same problem with Eclipse Indigo on Windows XP actually. Coming from intellij idea, I also felt the need to set the whole keyboard to trigger auto-complete.
A quick proof that SPACE key does accept suggestions : type inte on a new line. If the auto-complete menu shows, press SPACE. It goes for Integer.
If anyone knows how to set the SPACE key to "ignore suggestions", it would be great, because the escape key on my keyboard is also too far away :)
Thanks
Edit : actually the best would be to have only the ENTER key validating, because ';' and '(' also seem to validate
I just tried to reproduce your behavior, but couldn't. Here is the configuration I have (and the steps I have done to reproduce):
I have installed Indigo (current version of Eclipse, version number 3.7).
I did not change any configuration there, this is what is the default:
Under Window > Preferences > Java > Editor > Content Assist, I have the following settings:
Completion inserts (instead of overwrite)
Insert single proposal automatically (which is ok most of the time)
not insert common prefix automatically
I have a simple class, go down to a method, and do the following steps:
Enter this.no and wait some time. Sometimes I have to press CTRL + SPACE, sometimes not.
Proposal pops up which includes notify and notifyAll.
I press SPACE and a space is inserted in the text, the autocomplete suggestions are closed without inserting anything.
I do not know if older versions of eclipse have the same behavior.