Disable automatic suggestions popping up in VSCode - visual-studio-code

Background
VSCode shows suggestions whenever I move the cursor into a function signature. I'm finding this very disruptive, as I use Vim keybindings and it interrupts my ability to move around a file quickly.
I'm looking for a way to configure VSCode to only show suggestions when I press the hotkeys, which my keybindings.json defines as CMD + .
What I've tried so far
I've added these lines to my settings.json but they did not solve my issue:
"editor.quickSuggestions": {
"other": false,
"comments": false,
"strings": false,
},
Am I missing something?

Related

How To Quick Fix Most Recent Problem in Visual Studio Code

Between a Code Spell Checker, grammar checking for LaTeX, or refactoring extensions for Python, I get a lot of those blue squiggly lines underneath my code, the ones where you can Quick Fix, by pressing Ctrl + ., and it opens a small menu with options to choose from. I have looking at this very popular article about writing LaTeX in Vim, where you can have a command that Quick Fixes the most recent issue. Is there anyway to do this in VSCode; if yes, anyway to bind to a key binding for easy use?
VSCode 1.71 (Aug. 2022) might help.
See issue 7512
Would be nice if instead of pressing ⌘+. then Enter to apply the quick fix, you could just press ⌘+. two times in a row.
Then, pressing it again could move the cursor to the next (quick fixable) issue, so you could repeatedly fix everything by just pressing ⌘+. several times in a row.
This issue includes:
With the new code action widget, custom keybindings can be utilized to enter the top selected quickfix immediately.
[
{
"key": "ctrl+k",
"when": "CodeActionMenuVisible",
"command": "focusPreviousCodeAction"
},
{
"key": "ctrl+j",
"when": "CodeActionMenuVisible",
"command": "focusNextCodeAction"
},
{
"key": "ctrl+.",
"when": "CodeActionMenuVisible",
"command": "onEnterSelectCodeAction"
},
]
The latter half of this issue, regarding pressing again to move to the next error, is something we can take a look at!
This has been implemented, and released to VSCode Insiders today.

Can't disable suggestions in Visual Studio code

I've been trying to disable suggestions in VSC by changing the following in settings.json, but it hasnt works for me. What am I doing wrong?
// OPTIONAL WORD WRAPPING
// Controls if lines should wrap. The lines will wrap at min(editor.wrappingColumn, viewportWidthInColumns).
"editor.wordWrap": "off",
// Controls the indentation of wrapped lines. Can be one of 'none', 'same' or 'indent'.
"editor.wrappingIndent": "none",
// TURN OFF AUTOCOMPLETION
// Controls if quick suggestions should show up or not while typing
"editor.quickSuggestions": false,
// Controls the delay in ms after which quick suggestions will show up
"editor.quickSuggestionsDelay": 90,
// Enables parameter hints
"editor.parameterHints": false,
// Controls if the editor should automatically close brackets after opening them
"editor.autoClosingBrackets": false,
// Controls if the editor should automatically format the line after typing
"editor.formatOnType": false,
// Controls if suggestions should automatically show up when typing trigger characters
"editor.suggestOnTriggerCharacters": false,
// Controls if suggestions should be accepted 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions.
"editor.acceptSuggestionOnEnter": "off"
}```
I just copy pasted your settings into my settings.json file and hit save. It worked for me, no more intellisense. Did you edit the file with VS Code and then hit "save" ? If it didn't work, then maybe try reinstalling vs code and try again. My bet is that you didn't save. Also, I opened the file by first going into settings and then clicking on one of the selections that said "edit in settings.json." Another thing that I had to do was after I hit save on the settings.json I also had to go back into settings and manually uncheck all of these options:
search for "suggestions"
Try adding this line to settings.json. Not a permanent fix, but can act as a temporary one.
The line:
"editor.suggestOnTriggerCharacters": false

VS Code: How to disable function hover pop-up without disabling anything else, and preferably to only activate on demand with a keyboard shortcut?

Haven't figured out how to do this yet after multiple web and Settings searches, and not finding this asked already here.
I tried "editor.hover": false, but it just puts a green squiggly underline under it saying it's an unknown configuration setting.
If I make a function call in say a .php file, then inadvertently hover over it, it pops up an un-called-for box obscuring what I'm reading or blocking what I meant to click.
I'd like to be able to stop this and only have it activate on-demand with a keyboard shortcut, but without disabling other features.
The only setting that works on version 1.29.1 is:
"editor.hover.enabled": false,
This is the only combination that worked for me:
"editor.parameterHints": false,
"editor.hover": false,
"editor.quickSuggestions": false,

Override <ALT> to toggle menu bar on VS CODE

What I want to achieve is as follows:
Disable ALT to show menu bar by toggle-menu-bar completely.
-> Potentially map ALT to a NULL action?
Use a different shortcut to toggle-menu-bar.
Is there a way to achieve this?
On Ubuntu I needed this two settings in settings.json :
"window.titleBarStyle": "custom",
"window.customMenuBarAltFocus": false
(VS Code restart might be required)
Related:
https://github.com/microsoft/vscode/issues/84227
https://code.visualstudio.com/updates/v1_36#_disable-alt-key-focus-of-the-custom-menu-bar
My only solution is to set menu always hidden to prevent interfering with alt-hotkeys. But enabling mnemonics still allows you to reveal it by pressing Alt+F for example.
I have tried this on Win10, and adding these 3 lines to settings.json will work for me, while the latest upvoted answer will make the Menu bar hidden, which is not what we want.
"window.titleBarStyle": "custom",
"window.customMenuBarAltFocus": false,
"window.enableMenuBarMnemonics": false,
I'm using v1.25.1 and the setting to disable ALT menu selection is "window.enableMenuBarMnemonics": false. You can keep the menu visible.
This fixed it for me (I'm using Linux)
"window.titleBarStyle": "custom"
The solution is to set menu always hidden to prevent interfering with alt-hotkeys. But enabling mnemonics still allows you to reveal it by pressing Alt+F for example.
This can be achieved with "window.menuBarVisibility": "hidden", "window.enableMenuBarMnemonics": true in settings.json. The enableMenuBarMnemonics seem to be the default and hence unnecssary.
To access menu, press Alt-F or Alt-E, or Alt-whatever
This answer originates from Dmitriy Botov's answer
and my comment on it
As in Dmitriy Botov answer, adding those lines
"window.customMenuBarAltFocus": false,
"window.enableMenuBarMnemonics": false,
"window.menuBarVisibility": "hidden",
to the config works, but when I toggle the menu bar with e.g. alt+f the menu stays open.
If I use the toggle menu bar command/keybind the setting of "window.menuBarVisibility": "hidden" will be changed to "window.menuBarVisibility": "classic" and then to "window.menuBarVisibility": "toggle" which enables showing the menu bar on alt key again.
However, I'm using the Settings Cycler extension and build a command with it that does the job for me:
1. in settings.json add:
"settings.cycle": [{
"id": "toggleMenuBar",
"values":[
{ "window.menuBarVisibility": "hidden" },
{ "window.menuBarVisibility": "visible" }
]
}
],
2. Set a keybind for the new command:
{
"key": "alt+shift+w",
"command": "settings.cycle.toggleMenuBar",
}
This shows the menu bar and removes the "toggle on alt key" functionality when hidden.
Tested on vscode 1.60.0
Just "window.menuBarVisibility": "hidden" works.
open setting from File --> Preferences --> Settings and in searchBox type menu bar
in Result you can turn off it and whatever you want to doenter image description here

Turn Off Whole Line Copy in Visual Studio Code

I'm trying to disable the function in Visual Studio Code where if you don't have a selection highlighted, ctrl+c copies the entire line. I have never tried to do this on purpose, but I am always doing it accidentally when I hit ctrl+c instead of ctrl+v.
Here's what I have tried, which seems like it should work:
Under File->Preferences->Keyboard Shortcuts, there is the default setting:
{ "key": "ctrl+c", "command": "editor.action.clipboardCopyAction",
"when": "editorTextFocus" },
I have attempted to change this, so that it only copies when something is selected, by placing the following in my keybindings.json file:
{ "key": "ctrl+c", "command": "-editor.action.clipboardCopyAction"},
{ "key": "ctrl+c", "command": "editor.action.clipboardCopyAction",
"when": "editorHasSelection" }
I think this should clear the previous binding before re-binding the copy action to only function when something is actually selected. HOWEVER, it doesn't work. The editor still copies a whole line when nothing is selected. If I only have the first line in there, it successfully removes the binding completely, so I know it's doing something, but the "when" tag doesn't seem to be functioning the way it should.
Is there any way to get the editor to do what I want?
In Settings enter the following line:
"editor.emptySelectionClipboard": false
That should do exactly what you want.
Because this comes up on Google as a popular answer...
FYI this is also now a setting in the Settings GUI, search the settings for "empty selection" and it'll narrow it down. Untick to disable and praise your chosen deity.
Even after applying the "editor.emptySelectionClipboard": false setting the problem would persist. I had to remove/edit the project specific settings in the .vscode/ folder within the project folder.