How to duplicate selected editor in vs code? - visual-studio-code

I would like the same functionality as for tabs in browser. I didn't find any related extension in marketplace and any command from vs code pallet.

There's nothing that exactly mirrors the "Duplicate" functionality from (for example) Chrome, but you can open the same file side-by-side (or top-and-bottom) in two editors using the "Split" functionality. Right-click on the tab and choose one of the "split" options (each will open the second copy in a different place), or refer to the answer linked below for screenshots and several alternative ways to invoke the "split" command.
How do I open the same file side by side in a single Visual Studio Code session

Related

How to LIST all occurrences of a string in VSCode?

Some text editors and IDEs have this feature that LISTS all the occurrences of a string and displays them as a list.
I have Googled this feature for VSCode, but what I got was mostly 'how to SELECT all occurrences'.
What I want is something like this (Notepad++):
One way to get this is to use the bundled ripgrep that comes with VS Code. You can find it under this path inside the folder your VS Code is installed to:
/resources/app/node_modules.asar.unpacked/#vscode/ripgrep/bin/rg
Just open a terminal pane in VS Code with a console of your choice and invoke that ripgrep executable with whatever query is appropriate for the search you want to perform.
You can read more about ripgrep and how to use it on its GitHub page: https://github.com/BurntSushi/ripgrep.

VSCode: Any possibility to have a second, workspace-independent file explorer in the side panel?

I am looking for a way to open files in vscode that do not belong to the currently active workspace (and should not belong to it, this is not about multi-root-workspaces).
The ideal solution I could imagine would be a second explorer-panel that allows to browse the whole filesystem-tree and open files from it just like the built in explorer.
Is there maybe an extension for that I haven't found yet?

How to set each tab to a specific directory in VS Code?

Recently I switched from sublime to vscode.
In some cases I want to open multiple projects/folders, and the feature called 'Multi-root Workspaces' works to some extent. But I want to have one large project tab for each individual project,and each project can have many small file tabs. A picture is worth a thousand words, so this is the result i want to see:
Please take the gif below for a reference, which was made here by bpasero.
VS Code originally did not support tabs for each dir/project. We used to have multiple windows for different dir/projects.
Multi-dir feature was well discussed in this issue. This feature was added and explained in the doc Multi-root Workspaces.
But it is not exactly the same with some other editors.

How do I share the search pattern across editors in VS Code?

VS Code: 1.23.1
OS: OSX 10.12.6
If I have two different editors open (I think that's the term for two different windows, each of which could have multiple tabs, and could also be workspaces), and I run Find... in one window, the search text and settings (e.g. Match Case, Match Whole Word) in the other window are unaffected. I'd like to find a way so that these are always linked, they're always kept in sync. Is there a setting or an extension to do this? I could not find one. Thanks!
That does not seem to be possible, as each Windows has its own GUI states (including the current find search pattern)
This is similar to issue 10121 "Allow for floating windows" where Terminal or Debug Console would be applied to all opened editor windows instead of being tied to the current one.
For now, those GUI elements (including Find) are specific to the current opened editor, not sharing their state with other VSCode windows.

How to quickly find files or symbols in a project in visual studio code?

Here's a demonstration of the feature in IntelliJ (https://www.youtube.com/watch?v=EtnI2doW6XE)?
In case the video isn't viewable, basically the user presses a key-combo, and a dialog box pops up that will reactively response and filter based on the string the user starts to type in. It will show classes and files (and much more) matching what you've typed in. I won't go in to all the details, as I'm not looking for an exact match to this functionality -- I'd be happy if it just searched based on file name for starters! Anything to prevent me from having to browse for a filename in the project Explorer to open the file in vs code when I want to switch to the given file.
I saw How do I search for files in Visual Studio Code? - for me (on Linux) Ctrl-E just shows the file I currently have open under the project explorer (useful sometimes, but not what I'm looking for).
Cmd + P opens a search bar for files (doc),
Cmd + T opens a search bar for symbols (doc),
Are you just looking for CTRL-P That brings up a file list. Which is searchable. You can then tab down and right arrow opens up that file. Enter will open a split editor on the file.
Also, if you CTR-p and then type ? you will get a list of keys you can hit such as to "Go to Symbols" and much more in your file or workspace.
And look at CTRL-R it probably does exactly what you are looking for as far as files go.