Every time I try to copy something in VSCode on my mac with the commands command + c the cursor changes from a line to a block and automatically goes into NORMAL mode as displayed at the bottom of the window like this image linked here. Whenever I press the button s on my mac, it returns to INSERT Mode, and the cursor is a line again. I have been trying to resolve this issue for some time, but I am unsure where I could fix this in my settings.
You are in Vim keymaps.
Check extensions, you should be able to find Vim installed and enabled there. Disable or uninstall this extension if you do not need it.
When I want to complete a Command with tab in vscode, after completing the Command I don't receive any suggest from intellisense inside of parentheses or double quotes. (It seems that after auto-completion, the text in parentheses is selected and therefore no suggestion is received.
Of course, this problem is solved after moving the text cursor, but this slows down the coding)
enter image description here
Is it possible to scroll the terminal using the keyboard in Visual Studio Code line by line? I often find I need to look back in the REPL and using the mouse is pretty unergonomic.
If you search for scroll in the keyboard shortcuts you will see a few that apply to the terminal, including
Ctrl-Alt-PageUp
that will scroll the terminal up by a line. You could always rebind that if you wish.
In visual studio code, if you press ctrl + c on a blank line, with nothing highlighted, it copies the blank line.
I thought there may was an option to disable this, but haven't been able to find it.
You should be able to do this by configuring the option editor.emptySelectionClipboard to false.
There is an extension for it:
https://marketplace.visualstudio.com/items?itemName=usernamehw.do-not-copy-empty
I want to run the select code of python in VScode. Till now, I have to copy the code and paste it in the terminal below to run. The system is mac OS.
So is there any way to run the code directly after I selected the code? For example, like the shortcuts.
Thanks.
There is no default keybindings for command "Run Selected Text in Active Terminal", but you can create one.
Press Ctrl+K, Ctrl+S to open File → Preferences → Keyboard Shortcuts.
Search for workbench.action.terminal.runSelectedText in keybindings.
Press the icon on the left to open a windnow with this message "Press desired key combination..." and make your choice. (I've pressed Ctrl+Alt+R - as this combination was not used yet.)
Press Enter to store your keybinding.
Tested on VSCode 1.30.2 on Windows 10 Pro.
#yanachen, this is now possible in VS Code. All you need to do is:
1. Ensure python is running in the VS Code terminal window
2. Select the text you wish to execute in python
3. Invoke the command 'workbench.action.terminal.runSelectedText' as defined in the following link:
https://code.visualstudio.com/docs/editor/integrated-terminal#_key-bindings
Now it's supported by default shortcut "shift" + "enter".
select the proper code snippet
press "shift" + "enter"
Here is the setting for running selection in "interactive window."
In my VS Code (version 1.56.2), I do the following things: go to Settings, search for interactive window, in the resulting left panel choose Jupyter, and finally check the box next to Jupyter: Send selection to interactive window. That's it. One more step for some users (including me) is to modify the keybinding for running selection to your preference. For example, got to keyboard shortcuts, type run selection, you should see a list of keybindings and you may need to redefine them if conflicts exist.
Some language specific extensions have already an existing keybinding.
On Windows, for the PowerShell extension it is currently F8 to run the selected text.
Install the vscode extension Node.js Exec. then select the block of code you want to run and press f8. worked for me.