0

I want to keep my cursor position while vertical scrolling in all situations. Ctrl+Up/Dn shortcuts preserve while current selected/highlighted line is within Text Editor view. Once it moves out, the cursor jumps to first (Dn) or last (Up) position in Text Editor.

Use example: Writing code - peeking up/down the text editor with keyboard - continuing to write code at the same location/line.

The current VS Code default behavior for Ctrl+Up/Dn does this, while offering shortcut customization to get VS Community behavior. Is there a command or keybinding.json alternative I can use for VIsual Studio Community to achieve this behavior?

I searched multiple settings, enabled General - Settings - Enable virtual space, searched Environment -> Keyboard -> Show commands containing "Scroll" or "EmacsScroll" etc, but haven't been successful. I don't think a macro could solve this satisfactorily.

EDIT: Corrected wrongly termed "horizontal" scrolling to "vertical"

pun11
  • 157
  • 1
  • 11
  • The same(similar) command in Visual Studio is also `ScrollLineUp` or `ScrollLineDown`(using `Ctrl + Up Arrow` or `Ctrl + Down Arrow`), but they are not work as the same as in Visual Studio Code. You can suggest this feature(improvement) to Visual Studio Product Team in [Developer Community](https://developercommunity.visualstudio.com/report?space=8&entry=suggestion&q=MultiBinding). – 大陸北方網友 Mar 10 '21 at 08:49
  • @KyleWang VS Code offers a workaround - you can edit its keybindings.json file. I mentioned it already in my question, it is well explained here https://stackoverflow.com/questions/49997089/vscode-how-to-set-that-when-i-press-ctrl-up-or-down-arrow-the-cursor-move-wi#50003375. Is there a similar solution in VS Community? – pun11 Mar 10 '21 at 11:28
  • I’m afraid, as far as I know, there isn’t a similar feature in Visual Studio. In Visual Studio you can set this option “apply the following additional keyboard mapping scheme” to “Visual Studio Code” from Tools > Options > Environment > Keyboard, but it seems apply the default `keybindings.json` file of VS Code, you can try to change the default `keybindings.json` file if it is possible and see if it works. – 大陸北方網友 Mar 11 '21 at 09:39

0 Answers0