Scrolling the terminal line by line from the keyboard - visual-studio-code

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.

Related

VS Code Ctrl+C has a wrong behaviour

In Visual Studio Code, when i try to use Ctrl+C to copy something, it changes the insert mode instead. There is a blue bar at the bottom of the screen, with all the informations about the file (python interpreter, number of line and column of the cursor, ...) and -INSERT- . When I press Ctrl+C, the -INSERT- switches to -NORMAL- and I can't copy what I highlighted.
I too had this issue. Resolved was by disabling the VIM extension or you can uninstall it too.

How do I switch terminals in Visual Studio code using a keyboard shortcut?

I would like to be able to switch between terminal panes in VSCode using a keyboard shortcut. I am on a Mac.
I have opened keyboard shortcuts (Commandkey+K, Commandkey+S) and found the workbench.action.terminal.focusNextPane setting:
where it states quite clearly what the keyboard shortcut should be (option+command+downarrow or option+command+leftarrow) but neither of those work. They DO work when focus is in the editor and I want to switch between panes there, but not working when the focus in the terminal.
Not sure what I'm doing wrong but I hope I'm missing something obvious. Can anyone explain?
The commands you are looking at (Terminal: Focus Next Pane and Terminal: Focus Previous Pane) are to switch between split terminal panes.
The commands to switch between terminals are:
Terminal: Focus Next Terminal
workbench.action.terminal.focusNext
Terminal: Focus Previous Terminal
workbench.action.terminal.focusPrevious
both of which are unbound by default.

How to make smooth scrolling in VSC terminal?

I'm working in VSC and writting nodejs and I am faced with a scroll problem in long terminal outputs, scroll on the right side of terminal with slider goes too many rows too fast if I use them, so, question is, do we have smooth scroll option in integrated terminal to read output easy and line by line with arrows or we must use another external terminal for that?
Thanks.
In v1.71 smooth scrolling will be improved, see Release Notes: Terminal Smooth Scrolling.
The terminal now supports smooth scrolling which will animate
scrolling over a short period to help orient yourself after scrolling,
like the feature that is also available in the editor and lists. To
enable it set:
json "terminal.integrated.smoothScrolling": true
In vscode v1.42 (early February, 2020) two new commands related to terminal mouse wheel scroll sensitivity will be introduced:
Scrolling sensitivity
The terminal's scrolling sensitivity can now be configured independent
of the editor using the new settings
terminal.integrated.mouseWheelScrollSensitivity and
terminal.integrated.fastScrollSensitivity.
See https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_42.md#scrolling-sensitivity
Thanks to #Sean and #user9811991 in the comments for pointing out that the setting is a multiplier. My terminal normally scroll three lines at a time, to get it to scroll only one line I had to set terminal.integrated.mouseWheelScrollSensitivity to 0.08.
Also see Scrolling the terminal line by line from the keyboard for a keyboard command that scrolls the terminal by one line: workbench.action.terminal.scrollUp Ctrl-Alt-PageUp
Just add these lines into settings.json file and it will take effect instantly.
"terminal.integrated.fastScrollSensitivity" :1 ,
"terminal.integrated.mouseWheelScrollSensitivity":0.1
I've added the values as 0.1 because it was better for me , you can choose your sweet spot.
settings.json file , where you need to add the above answered values
It has been implemented in xterm
To enable smooth scrolling in VSCODE terminal, go to your settings, search for terminal smo and
simply toggle it on:

Is it possible to quickly swap lines in VS Code?

I'm currently experimenting with VS Code, having used Sublime Text 3 for the last five years or so. In Sublime, I could quickly swap two lines by selecting them both and then doing Ctrl+T.
As far as I've been able to find, the only equivalent command in VS Code is Alt+↑/↓, which pushes the selected line either up or down, and would be excruciatingly slow unless the selections are very close to each other.
Is this still true as of 2019? Is this basic functionality really not possible in VS Code?
There is no built-in functionality.
You can use a combination of VS Code's multi-cursor selection and the Swap extension.
Select one line or lines
Select another line/lines while holding down Alt or CMD (for Mac)
Use the extension's swap shortcut
Via keyboard shortcut
Windows: CTRL+ALT+8
Mac: CMD+OPTION+8
Via command palette
"Swap"
You can customize the keyboard shortcut to be same as what you used in Sublime.

Visual Studio Code view command run by last input

I'm trying to figure out which editor command is used when I press keys in different contexts. For example, I want to know which editor command is run when I press DownArrow while the quick fix widget is open, as shown:
How can I find out which command is run when I press a key in VS Code? The Keyboard Shortcuts search-by-key capability does not solve my problem.