Zoom/focus on a region/part of file in vscode? - visual-studio-code

Let's say I have a giant markdown file and want to edit one section, or a giant python file and want to edit one function. Is there any way to bring out that region of the file into a separate editor?
Desiderata:
Find (⌘F) and "add selection to next find match" (⌘D) should only go over focused contents.
Changes should appear in original file in the filesystem for version control purposes.
No text outside of focused section is visible anywhere.
Bad solutions:
'Fold all & unfold one' works ok in markdown, but e.g. if there is section text at a parent section, then there is no way to hide it. And ⌘F goes outside of it.
A temp file clutters the git logs if I commit as I go.
Extension keywords (no results):
File window
File region
Zoom to part of file
(Iterm2 has a feature like this for focusing on the last command output.)

It seems there is no good solution as of May 2021.

Related

What does the four horizontal lines symbol mean in vs code and does it mean my gitignore is not setup?

When you create a new file without an extension in VS Code you get four horizontal lines stacked on top of one another; the bottom and the third one up is shorter than the others.
What type of file is this?
And when I setup a react-app, the .gitignore has the four-line icon by it instead of the git logo. Does this mean my gitignore isn't working? and if so, what can I do about this?
If you mean this symbol:
The icons next to filenames indicate what sort of file VSCode thinks they are. JavaScript files show JS, JSX files show the React symbol, and so on.
The lines icon mentioned in your question looks to just be the default icon for any file extension VSCode doesn't recognize - it also occurs for text files (which is what the icon looks to represent) and files that end in the nonsense extension .foobar, for example.
It's only an icon - if you've set up your Git repository properly (or run something that sets one up for you), the icon that VSCode chooses will not affect your app.

VS Code - search for two different things in two files

In VS Code how do I search for one thing in one file, while at the same time searching for a different thing in a different file?
Using the normal Find when I try to search for something in a second file it overwrites any find I am doing in a previous file.
I see that the Search functionality enables me to open a search in an editor, but this functionality doesn't seem at all useful to me.
There is no obvious way to run a search on a specific file short of manually copy/pasting the file path into the advanced search options.
The editor that the search results open in contains adjacent context lines, which if you have a large number of results makes it useless as a simple list of search hits.
The editor that the search results open in is not editable, making it useless as an editor.
I need a list of results for each of two searches on two files.
Item 1 can be handled with an extension I wrote: Find and Transform. You could make a keybinding that opens the Search Panel with the current filename (or any file/folder/etc.) added to the files to include input. Actually I added a context menu command to the editor, or any editor tab or an editor in the Explorer to do just this.
Item 2. The search editor number of context lines is configurable and will remember your last setting.
Item 3. There is an extension, Search Editor: Apply Changes which can apply any changes you make in a search editor to those files.

How to: Go to file (#) Go to for symbol in the same dialog

I am missing this feature from Sublime Text so much. Go to Symbol in Workspace feels so close to it and yet so far away.This is very useful in the following examples:
You have many classes that have the same symbol/function name, Pre-filtering the file lets you jump to the exact definition very fast
You know the name of the file, but you are not sure about the exact symbol/function name. Fuzzy searching it is super fast
You want to quickly preview the available symbols/functions in a given file
Here is a sample video demonstrating this feature in Sublime Text:
https://youtu.be/48f3N0hCaBU?t=109
If this is not currently possible, is it possible to implement as extension?
This is being added in v1.44. See https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_44.md#navigate-from-files-into-symbols
You can now continue to navigate into symbols of a file result simply
by typing #. For the file that is currently selected, all symbols will
appear and the editor will open in the background to reveal the active
symbol.
I created an extension that provide similar functionality:
https://marketplace.visualstudio.com/items?itemName=Cmacu.gotoanything

Multiple editor windows with multiple tabs

Very often I work with multiple projects in MATLAB and have a group of files for each project that I access at one time. Having all files of all projects open causes a lot of clutter in the workspace. One can do this for one single set of files by docking which is well known.
Is there a way to tab projects, or have multiple MATLAB editors (for each project) open with multiple tabs in each (with the projects files). The question can be found here too. In the same vein, are there other code editors which can be used to perform the same?
Project1
file 1.m
file 2.m
file 3.m
file 4.m
Project2
file 1.m
file 2.m
file 3.m
file 4.m
Either in the same window, or in different windows.
Unfortunately I don't believe MATLAB can do that kind of project/file management for you, which is why I use Sublime Text 2. It's perfect for that kind of project/file management... and not to mention the awesome shortcuts and quick editing tools to help you code faster.
Check them out: http://www.sublimetext.com/. The one drawback is that it's nagware. It is free to use, provided you can bare the popups to buy a copy of the software every now and then. Once you buy it, the popups go away. Give it a try and see how it goes!
If someone still need a solution for that-
You can just drag a tab of one file to the side, or bottom of the space of the editor, like that:
And the result will be:
Now you can drag in the same way other tabs to the new tabs group, and you have two separate tabs groups (but one Editor window..). You can of course drag the middle edge line to the right-end, and work fully only with the first group, or drag it to the left-end and work fully with the second one.
Note for one drawback here- if the line is in one of the ends, you don't see the tabs status and files names of the hidden group, and if you forget that you opened some file there and try to open it again, you will not see it opened, or any change in the IDE, because the control goes to the already opened tab but you not see it.

ms-word template named-styles conversion

In MS Word 2010, when I apply a dotx template to a docx files and different styles exist in the two docs, how can I map a list of styles from the former to a list of differently-named styles from the latter?
Let me clarify the issue.
I have a dotx style file with a few standard styles (ex. heading1, caption etc.) and a few other styles (ex. blockquote, superfigure etc.). I must use this template and cannot change nor add any names there.
I have a document preparation system (ex. pandoc, orgmode) that outputs a docx file. When I compare some of the styles used in this docx I see they have a different name compared to the previous dotx, yet the "meaning" is the same. For example the "blockquote" of the dotx should be applied to the parts of the docx that are marked as "quotedtext".
SO, how can I tell MS Word 2010 to apply the dotx style to my docx mapping "blockquote" to "quotedtext"? Any alternative solution using different tecnologies like xls transform or similar stuff?
Any hint would be really appreciated
In the Home tab, click the widget (little arrow in the corner) of the Styles group to display the Styles pane. Click the Manage Styles icon at the bottom, then the Import/Export button at the bottom-left.
In this dialog you can Copy styles across documents or templates, Rename and Delete them. If the other document or template is not open, click Close File (the right button) then Open File (the button-text changes to this).
Unfortunately, you cannot just switch one style for another (at least, not from here; see below). However, I believe the process of Copy, Rename and Delete could achieve the same effect.
Alternatively, press Ctrl-H for the Replace dialog and press the More>> button. Place the cursor in the 'Find What' box, then Format at the bottom-left, and Style... Choose the style you want to replace. Do the same in the 'Replace with' box. However, the style you want to replace with needs to be available in the current document. Use the sequence outlined above to first bring across the styles you need into the current document. A quick way to bring in all the styles from the other document or template is to copy content from this doc/template to the bottom of the current document, deleting it later.
It is also possible to use the Styles dialog (mentioned above) to modify styles, changing the Style Based on property. However, I wouldn't recommend this approach. You will need to be very thorough and be fully aware of the consequences of the cascade; that is, how each modification affects other styles in the document.
If you need to go through this process for a large number of styles then use the macro recorder. You'll then need to modify the generated code, putting it in a loop.