Automatic scoll down on document refresh (VS Code) - visual-studio-code

Since VS Code can auto-refresh a document when it is changed from outside, I would like to scroll down to the last line automatically.
I'm sure this feature worked on previous versions but now I found no entry in settings to enable it.
It is helpful in order to monitor a log file while been write.
Is there any way to enable this feature?

So I created a VS Code extension for this, it's called autoscrolldown.
Building the world's most expensive tail -f!

Auto Scroll extension does this.

You could use the keybinding to scroll to the bottom of the file:
{
"command": "workbench.action.terminal.scrollToBottom",
"key": "ctrl+end",
"when": "terminalFocus"
}
CTRL-End
I don't see any other way to have the scrolling be automatic when a file refreshes.

Related

Visual Studio Code Keybinding for navigation in Quick Fix contextual menu

After vsCode v1.74 update, I'm having trouble defining custom shortcuts for the Quick Fix contextual menu.
Quickfix Menu
Before, I was able to solve it by following this thread https://github.com/microsoft/vscode/issues/55111
Is anyone experiencing the same problem?
This is what I used for months with no problem.
{
"key": "shift+j",
"when": "codeActionMenuVisible",
"command": "selectPrevCodeAction"
},
{
"key": "shift+k",
"when": "codeActionMenuVisible",
"command": "selectNextCodeAction"
},
To be able to use custom shortcuts for the Quick Fix contextual Menu
I don't know if you filed the github issue selectNextCodeAction custom keybinding not working and revert to old context key ID for code action widget , but it has been resolved by reverting to the previous context key codeActionMenuVisible from the new actionWidgetVisible - which I assume was introduced because there are now code actions/quick fixes in the terminal (but should have at least been called out in the Release Notes).
The fix is due to be released as part of the Recovery Build v.1.74.1 which may be out soon.
[As a side note, this key started life as CodeActionMenuVisible (note the capitalization) before being switched to the typical camel case version later.]

How to remove warning text beside my code in Flutter's Visual Studio Code

I am a new Flutter learner, and this is kinda annoy me, I think the "Problems" tab under is fully understand, I don't want to see warning next to my code. Is there a way I can disable or hide it? Thank you.
Hey, In visual studio code you can do minute changes.
Step1:
Press ctrl+shift+p , a command pallet will open
Step2:
Type settings.json and click on Open Settings (JSON)
a file will open
step3:
Add this lines in that
"editor.codeActionsOnSave": {
"source.fixAll": true
}
**After this whenever you save, const will be added automatically.
Note: Sometimes you might get error because after saving some widgets are prefixed with const but, sometimes when your values in widget get dynamic, there will be a error, so be careful.
disable this line or add source.fixAll to config.json
Perhaps you are using some vscode plugin like https://marketplace.visualstudio.com/items?itemName=usernamehw.errorlens to show code diagnostics.
Though that feature seems very useful to me incase you find that annoying you may disable it by going through your list of extensions.

Disable vscode clear/remove not used code when save file

When I save file, VSCode auto cleans the not used code, How to Disable it? I want to make VSCode not to delete any line of my code.
Go to Visual Studio Code's settings page in JSON format then remove the line
"source.fixAll": true,
this line you will find inside of this object
"editor.codeActionsOnSave": {
},
After finding and testing, it can be configured at Workspace Settings > Go configurartion, override "go.formatOnSave": false, on the right side, disable formatting then the code will not be auto cleaned.
EDIT: Later then I meet this issue .

Unbind ZoomIn in Visual Studio Code

I'm using a Mac and would like to use cmd+= to switch between open windows in VSCode (1.6.1).
By default that key is bound to workbench.action.zoomIn.
I tried following these instructions to unbind that key, but so far have not had success.
In keybindings.json, I have:
{ "key": "cmd+=", "command": "-workbench.action.zoomIn" },
This doesn't seem to have any impact, however, as I still am able to zoom in with cmd+=.
What am I doing wrong here?
Unbinding seems to be broken. You should consider filing a bug here: https://github.com/Microsoft/vscode/issues
would like to use cmd+= to switch between open windows in VSCode
Then you don't need to unbind the current shortcut for workbench.action.zoomIn first. Just create a new keybinding like this one to overwrite the existing one:
{
"key": "cmd+=",
"command": "workbench.action.switchWindow"
}

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