How to maximize a split editor in VS Code? - visual-studio-code

I like the split view mode in VS Code but one thing I can't figure out is how to maximize a split view temporarily.
I would like to be able to maximize a split window (as in on one of the windows of a split) for a moment and then restore the layout when I am done with it.

v1.38 has a new command:
workbench.action.toggleEditorWidths
which can be useful here. It is unbound to a keybinding by default.
Say you bind it like so:
{
"key": "ctrl+alt+b",
"command": "workbench.action.toggleEditorWidths"
}
Then use it once to maximize one of the splits - after that switching focus to either one will maximize that one easily. Basically, using the workbench.action.toggleEditorWidths command once will do the work of manually dragging the separator bar for you.
Before v1.38
From the July 2018 Release Notes: Automated maximize of minimized editors.
To get this to work you have to first manually minimize one of the splits (or editors in an editor group).
Drag the separator bar between the editors as far left (or right) as it will go.
Or use the command View: Maximize Editor Group.
Then clicking in or otherwise focussing (perhaps with workbench.action.focusLeftGroup or similar) the other split will maximize it.
Note: You can always maximize the active editor via View: Maximize Editor Group (workbench.action.minimizeOtherEditors) or reset all editor sizes via View: Reset Editor Group Sizes (workbench.action.evenEditorWidths).

Command + J and Control + B can be used for Mac.
View: Toggle Side Bar Visibility
View: Toggle Panel

Or, Just double click at the file name in the title bar (tab bar) (the one inside your split panel, not the top most one).

Related

Editor in same column as terminal

In VSCode, how do I create a heterogeneous vertical split contained completely within a single column? I would like to define a column such that the terminal is on top, a text editor is on the bottom, and neither this terminal nor this editor intrudes into the other columns. Is that possible?
This will be very easy with vscode1.58, due out this week. Because you can drag a terminal to the editor area.
First create your vertical split so you have two columns. Then just drag a terminal into the upper half of the right-hand split. Then close your Panel (where the terminal was).
Also there are some move the terminal commands you can make keybindings out of:
See more https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_58.md#terminals-in-the-editor-area

Visual Studio Code: multi-column editor layout

When switching to a multi-column layout in VS Code (View > Editor Layout > Two Columns / workbench.action.editorLayoutTwoColumns), is there a way to make the new column split at the currently active file, so that open editors to the right of the current file are put into the new column/group, rather than the new column being empty?
By way of example:
Here I have 4 open editors
When I open a second column, it is empty:
But I'm wondering if there is a way that to get the following at the point of using a multi-column view (relative to the active file I have open at the time):
I guess this shortcut can do that:
shortcut: View:Move Editor into next group
I set the keybinding with "shift+command+left arrow"
There are 4 open editors and the active one is command.md:
I press the shortcut I set, it looks like this:
The active editor is open in the second column at a time.
Hope this information is useful.

VSCODE - TAB right after the word not working as expected

vscode:
version - 1.40.2
On a normal text type file, type Hello and hit TAB.
All i want is when i hit tab vscode should register 2/4 spaces (what i have configured in the settings.json for the specific language) not a single space.
HelloTAB
Expected: Hello****|
Actual: Hello*|
Make sure you have unchecked Editor: Detect Indentation. Checking this option will override the Tab Size configuration. E.g. if the opened file has 1 space tab indentation but you have configured a 4 spaces tab indentation - the tab size will be 1 space.
Ctrl + , to open Settings.json
Enter in "spaces" in search
Uncheck Editor: Detect Indentation
Leave Editor: Insert spaces checked if you want to insert actual spaces instead of a tab (i.e. you need to do 4 backspaces if you made a mistake). Or unchecked it if you want to insert actual tabs.
Also, you can check what is the configured tab size for that particular opened file by looking at the bottom right of your editor:

In VS Code file searching, can I expand (or collapse) all results?

In the Search pane of the program, after I hit Enter, all files are listed, with some expanded to show results in a file, and others collapsed. I'm wondering firstly what determines the expansion of any given file, and secondly what I can do to expand all of them at once.
This question seems closest to mine, but it's about a different IDE, and the key commands it suggests for Windows had no apparent effect: Automatically expand all in Eclipse Search results
See this setting:
Search: Collapse Results in the Settings UI or
search.collapseResults: alwaysExpand in your settings.json file
The options are auto,alwaysCollapse, and alwaysExpand. auto is the default.
auto: Files with less than 10 results are expanded. Others are collapsed.
So you want the alwaysExpand option.
You can also toggle any file expanded/collapsed with the Space key or just expand any collapsed file with RightArrow.
Collapse with LeftArrow and collapse all with Ctrl+LeftArrow. Oddly, there is no expandAll binding or command.
And see https://stackoverflow.com/a/67307225/836330 for a command to collapse all the results that you can set to a keybinding:
workbench.files.action.collapseExplorerFolders as in
{
"key": "alt+l", // whatever you want
"command": "search.action.collapseSearchResults",
"when": "searchViewletFocus" // if you want to limit it when focus is already on the search results area
}
in your keybindings.json.
v1.41 is making expanded search results the default, see https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_41.md#search
Expand all search results by default
Previously, if a full text search returned more than 10 results in a
single file, it would appear collaped in the results tree. However,
this sometimes made finding a particular result difficult, so with
this release all results will appear expanded. You can set
search.collapseResults to auto to revert to the old behaviour.
And see Visual Studio Code - Include context in search results for showing the search results in an editor.
There are two quick ways to expand all at any time:
Click the icon in the top right of the search panel that has a "+" inside a square. This toggles all items expanded/collapsed.
Use the command palette (Cmd-Shift-P) to trigger the "Search: Expand All" command. To make it quicker to access, you can add a custom keyboard shortcut: when looking at the "Expand All" search result in the command palette, click the gear icon next to it and it will take you to an editor for adding a shortcut binding.
Both of these only work for the Search panel though – despite the similarity, they do not work for the "Find All References" results panel.

How to do multiple line editing?

I want to edit multiple lines in eclipse, but I can't find any short cut or Plugin. In Geany I just press ctrl+alt+up/down I can add / edit multiple lines.
Maybe this example can explain what I mean:
var text = "myname";
var addr = "myaddr";
var age = "myage";
I want to edit text above into:
var my_text = "myname";
var my_addr = "myaddr";
var my_age = "myage";
The text above is just a simple example, but sometimes I have many lines of words that I have to edit its prefix.
Press alt + shift + A to Toggle block selection (Toggle block / column selection in the current text editor), this will let you write vertically in eclipse, then you can easily do this.
Go to Window->Preferences.
Find for binding in text box surrounded by red box.
On OS X, the key combination for multi-line edits in Eclipse (or STS) is option/alt+command+A
You can try the following plugin,
https://github.com/caspark/eclipse-multicursor/releases
With this multiple occurrence of same text can be selected and edited. This is similar to multi select functionality available in editors like Sublime and Visual studio code.
The Eclipse 4.24 (June 15 2022) will integrate it (See https://bugs.eclipse.org/bugs/show_bug.cgi?id=576377):
Multi selection down relative to anchor selection (e.g. Ctrl-Alt-J)
Multi selection up relative to anchor selection (e.g. Alt-J)
End multi-selection (e.g. ESC)
Add all matches to multi-selection (e.g. Ctrl-Shift-Alt-J)
Multi caret up (e.g. Ctrl-Alt-Shift-Up)
Multi caret down (e.g. Ctrl-Alt-Shift-Down)
Thanks to eclipse contributor !
The Eclipse 4.22 (Q4 2021) equivalent of Geany would Alt+Click on the lines you want to edit in one go.
Eclipse now supports
Multiple text selection
Support for multiple selection has been added to Text Editors.
Multi selections allow most edit operations (text replacement or insertion, extend selection to next word or to next line, copy/paste...) to apply simultaneously on all ranges.
Multiple strategies are available to enable multi-selections:
Turn a block selection into a multi-selection using the To multi-selection command,
Add a caret with Alt+Click,
Use the new Select All button on the Find/Replace dialog.
So check if this would work in your case.
I know this is an old post, but I still want to share my way of multi select and editing. However this way is restricted to only the same variables across the file. Simply highlight the variable to edit, right click, choose Refactor->Rename. Then edit the variable and it will also edit the same variables across the file. Hope it helps..:)
Press key - { Alt + Shift + A } You will see A [+] symbol in IDE then use this symbol as drag