Is there a command to move the current line to the top of the current window, similar to the Brief editor Ctrl-T? - visual-studio-code

Brief (if anyone remembers that far back) had a command (Ctrl-T) that recentered the window such that the current line moved to the top of the window. Ctrl-B recentered the window such that the current line moved to to the bottom of the window. Is there such a command in vscode?
If there is no command, is there an extension that provides that functionality?
I use vscode to write C# and C++ code.

Not exactly your request, but really close :
https://github.com/kaiwood/vscode-center-editor-window
You can centered your window with the shorcut ctr+L
There is a pull request to add an offset.
EDIT
Something that do exactly what you want :
https://github.com/pmattei/place-window-vscode

Related

How do I make the output window's content always scroll to the bottom?

I came from PyCharm, and starting in VSCode, when I print a lot of content in the output window in VSCode, the output window will stay from the output of the last executed content, and I need to scroll all the way down to see the last part of the new output content.
Is there a way I can set it up so the output window will automatically go to the bottom of the output content? I have googled and searched stackoverflow, without any luck.
Here is some visual to show what I mean
I need to manually scroll down to see the last content
Two things to try:
In your second screenshot, there is a padlock in the top right of your output window. That enables/disables auto scrolling. You currently have is disabled. Try enabling it.
There is a setting called output.smartScroll - I wonder if disabling that might achieve what you want (if you are clicking in the output box at least).

VSCode - Open terminals in a separate window

in VSCode is it possible to open the terminals in a separate window?
So far my research has pointed to a resounding NO but Im curious if anyone has a solution?
Move terminals between windows
It's now possible to move terminals between windows by detaching via
Terminal: Detach Session in one and attaching to another with
Terminal: Attach to Session. In the future this should help enable
cross-window drag and drop!
Lots of changes in v1.58: https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_58.md#terminals-in-the-editor-area
For v1.59 moving the terminal changes - including dragging and dropping onto another window, see https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_59.md#drag-and-drop-terminals-across-windows
Drag and drop terminals across windows
Drag terminals from the tabs
list or editor area of one window into the tabs list, editor area, or
panel of another window.
Terminals in the editor area
Terminals can now be created in or moved to the editor area, enabling a multi-dimensional grid layout that persists and remains visible regardless of panel state.
To use terminals in the editor area, there are several options:
Create via the Create Terminal in Editor Area command.
Move a terminal from the panel to the editor by dragging and dropping from the tabs list.
Running Move Terminal into Editor Area with a terminal focused.
Moving into the editor area via the terminal tab context menu action.
The new terminal.integrated.defaultLocation setting can be set to editor to direct newly created terminals to the editor area by default.
Please Try:
File > Open New Window
Ctrl+Shift+P > Terminal: Create New Terminal in Editor Area
You can add keybinding to the commands as per your convenience.
i think that the OP wants to create a separate window for the terminal but still have the separated terminal linked to the code editor in the original window (that's what i want too). so that when you run the code in the editor the output is shown in the terminal in the separate window. but if you simply open up a new window of vscode and either open a terminal there or drag and drop the terminal from the original window into the new window, the new terminal is not the same session of the terminal. it is a separate independent unconnected terminal. running the code in the editor does not show output in the new separate terminal. all you have achieved is creating a new unconnected terminal. which you could have just accomplished by opening up a regular terminal window i.e. the one from windows os main menu, no need even to use vscode.
This answer is now outdated. See this answer for instructions on moving terminal panes between VS Code windows. This answer still works but is no longer a necessary workaround.
You can't detach the panes in VSCode, which IMO is a bit of a pain since Visual Studio can detach panes all day long.
There is a workaround though, you can open a new window in VSCode and maximize the terminal pane in that window.
One reason you'd want to do this is to have the Python terminal on a second monitor while still being able to use Python interactively (shift+enter way). Attaching/detaching didn't work for me, nor can you open separate terminals.
What you can do is simply resize your one window across the screen borders! Then right click on the terminal tab/header and click Move panel to the left and voila!
Try Сtrl+Shift+c.
For me, it opens the folder the script is within in a command prompt window.
Create a new window by going to File → New Window.
Open up a new terminal inside of it.
Go to your folder (cd your\projectfolder\path).
And here you are, you have a terminal for your project inside it's own seperate window.
You can change the terminal to be side-by-side instead of below the editor. And then make your window very wide. It is almost as good as having two windows.
Right click on the TERMINAL tab.
Select "Move Views to Side Panel"
Make your window very wide
It seems VS Code allows you to detach the terminal window, but it then will not show the output from the editor of the window you detached it from.
I have spent a while searching, and there is really no workaround other than to just run whatever file you are trying to debug from a separate terminal from the same CWD. This also means you will need to save the file in the window you are editing the file in every time you want to run it. huge pain.
If you are using PowerShell inside the VSCode terminal, why don't you use the PowerShell console from the start menu. It's basically equivalent to using the terminal in separate windows. Hope it helps.Sample

VS Code search inside the editor without rollover

If I search inside the actual editor of VS Code without an match below the current line, VS Code rollover the search from the top of the page.
How can I disable this?
One thing you can do instead of disabling this (which I don't thing this is configurable) is to use ctrl+U. It's soft undo, moves the cursor back to it's previous location. This is particularly useful when you need to move down in a long file to copy a variable or function name and then go back to your original position. So when vscode goes to the top of the page, put the cursor there, and then press ctrl+U to go back to the previous line you where editing.

Open windows and load specific buffers in emacs lisp

I'm working on my .emacs configuration for clojure development.
What I want to happen is whenever I open a file called "project.clj" if there is no open buffer called "swank", split the window first horizontally then split the right side vertically. Then from the project.clj buffer run (clojure-jack-in) to start the REPL and (shell) to load a bash shell. When all of this is done I'd like the project.clj file to be in the left window, the shell to be in the top right window, and the REPL to be in the bottom right window.
Also if there's a way to get speedbar to open in a specified window rather than in a new frame, that would be awesome.
I guess my question is: is there a way to specify which window new buffers are opened in?
Ok, how about this answer via ibuffer or via grid-files-sq or GridLayout and (more unrelatedly) desktop remembering suggestions

Is there a way to center the current line vertically in the Eclipse editor?

I am looking for a functionality similar to Ctrl-l in Emacs. What it does is, for example, if you are editing the second-last line in the visible editor window and you hit Ctrl-L, the current line will move to the center of the editor screen.
This works regardless of the file end.
Most of the time, if one is creating a new file, they would be at the last line, adding more content to the file. Continually staring at the bottom of the screen is hurting my neck.
Go to Window > Preferences > General > Keys
Filter the commands to find 'Recenter'
Add preferred binding (I have Ctrl+Shift+B)
Select 'Editing Text' in the When dropdown.
Edit: unfortunately, if the cursor is at the end of the file, and you try to "recenter", it won't work because there is nothing left to show below the cursor.