Show hidden NodeModules folder in VSCode - visual-studio-code

Currently node modules folder in vscode is hidden, I would like to show this folder in VSCode.
Is there any specific setting in vscode to achieve this?

Explorer View
If node_modules is hidden in your explorer view, then you probably have a pattern that's matching that directory in your settings. Go to settings, search for files.exclude and ensure that you haven't excluded the directory in user settings and/or workspace settings.
Search Results
If you want search results to include node_modules by default, you'll need to remove the pattern from the search.exclude setting. Note that search.exclude inherits all glob patterns from the files.exclude setting.
If you simply want specific searches to include node_modules, but don't want it included by default, there's a gear icon that you can toggle in the search view (go to the search view, toggle the search details using the ... icon, click the gear icon in the "files to exclude" input field).

To make the other answers more explicit, in order to unhide the node_modules contents for one project only, create a file named .vscode/settings.json in the project folder if it's not there yet and add these settings:
{
"files.exclude": {
"**/node_modules": false
},
"search.exclude": {
"**/node_modules": false
}
}
Note that the setting under "search.exclude" is required to re-include these files in the search, otherwise VSCode will inherit the "files.exclude" patterns defined in the user settings, which probably contain a line like "**/node_modules": true.
If you rather wish to unhide node_modules for all projects, open Preferences > Settings, be sure to select the User setting tab rather than the Workspace tab, then go to Text Editor > Files > Exclude and remove the line that contains node_modules.

In mac
Code --> Preferences --> Settings --> Features --> Exclude --> Add Pattern / Remove

If you have .vscode folder in your directory then open settings.json file in this folder and replace "**/node_modules": true to "**/node_modules": false.

In addition to the correct answers above you can also use the context menu.
If you add node_modules into your directory you can see the folder in your solution.

I had the opposite problem and clicking 'enable' here went back to excluding them. You can toggle this behavior with the settings icon.

Related

vscode: Search in a directory which is outside the workspace

I want to search in a directory which is outside my workspace.
Steps:
I open a file which is outside my workspace.
Now I want to search in the directory which contains this file.
I use "Reveal in Explorer" and try to use the breadcrumbs, but I see no way to search in the directory.
I use Go, but AFAIK this should not matter for this question.
As it happens another extension I wrote makes this pretty easy: Find and Transform.
It adds three context menu entries:
Search in this Folder
Search in this File
Search in the Results Files (if there has been a previous search with results)
You can right-click on any tab or editor body and select Search in this Folder and it will populate the files to include input box of a search with that file's parent folder path.
And if you have any text selected, the query field will be populated with that selection (even if it is just a cursor in a word).
You could also just right-click on that tab and chose Copy Path, paste that into the files to include input of a Search and then delete the last part of the path back to the folder.

Is there a way to highlight the file I'm currently working on in the vscode explorer sidebar?

I have a lot of files in my root folder, and I'd like to be able to easily pinpoint where the current file is located in the VScode Explorer sidebar.
The "File: Reveal Active File in Side Bar" command is almost what I need: it opens the Explorer sidebar and highlights the current root folder with a blue box. However, the entire root folder is highlighted, not the specific file, so I still have to hunt for it amid all the other subdirectories and files in that tree.
Is there a command or set of commands I could use to achieve this? Alternately, is there a setting I could change that keeps the active file highlighted in the sidebar all the time? I'd just like some sort of indicator to see exactly where in the tree my active file is located.
add in settings.json
"workbench.colorCustomizations": {
"list.inactiveSelectionBackground": "#fffb17",
}
A small tip: in this picture:
please click "1" once, and then click "2" twice.
ctrl+shift+E
try it!
is there a setting I could change that keeps the active file highlighted in the sidebar all the time? I'd just like some sort of indicator to see exactly where in the tree my active file is located.
Was searching for this myself when I discovered the solution.
It sounds like what OP is looking for is Auto Reveal. Open your Settings: File > Preferences > Settings (or for a pc shortcut hold ctrl and press ,) and search for "explorer". Then under Explorer: Auto Reveal, select True or focusNoScroll.
With this option on, when you have multiple files open, each from different folders or projects, clicking on each tab (thereby making it the "active" file, which is what OP wanted) will automatically highlight the file in the Explorer column to the left of the editor.

Hide hidden(dot) files in github atom editor

I am very new to Github Atom editor. It always shows hidden files such as .git, .sass in the side pane.
How to hide hidden files(dot files) in atom editor's side pane.
Edit > Preferences > Packages
In the field below "Installed Packages" type: "Tree View". This package has a few settings you can toggle, "Hide Ignored Names" is what you're looking for.
It's a really buried setting, not sure why.
You can also add it to your config:
'tree-view':
'hideIgnoredNames': true
From the menu bar go to Edit > Preferences > Packages type in the filter "tree-view" click on the "Settings" button of this package and then check the "Hide Ignored Names" choice.
Now go to Edit > Preferences > Core . In the Ignored Names box enter .* this will hide all the files/folders which are usually hidden in other file explorers.
If you want to hide normal files/folders just add them to this box separated by a Comma , for example : .*, Videos, Music
You can configure Atom to ignore specific files by customizing the "Ignored Names" list Atom > Preferences > Settings > Core Settings > Ignored Names. Just add any file or directory to the list.
Important: to activate the Ignored Names list setting, so Atom ignores the files you configured, ensure that Hide Ignored Names is enabled under menu Atom > Preferences > Settings > Tree View > Hide Ignored Names.
There are many ways to customize atom. Check out the official Customizing Atom Page.
As stated above, Application menu > Preferences… > select Packages in the sidebar, search for "Tree View", click the Settings button > check Hide Ignored Names.
And now with pictures:
just click on the i key in the tree view window
Click on the tree view from main window, type i on keyboard to toggle visibility of version control ignored files.
In addition to all of the above info...
If you would like to hide all hidden files from the tree view:
Go to the core settings page and under "Ignored Names" enter .*
This will hide all files starting with a .

How do I compare two files using Eclipse? Is there any option provided by Eclipse?

How do I compare two files using Eclipse?
(Currently I am using WinMerge.)
To compare two files in Eclipse, first select them in the Project Explorer / Package Explorer / Navigator with control-click. Now right-click on one of the files, and the following context menu will appear. Select Compare With / Each Other.
Just select all of the files you want to compare, then open the context menu (Right-Click on the file) and choose Compare With, Then select each other..
If one or both of the files you wish to compare isn't in an Eclipse project:
Open the Quick Access search box
Linux/Windows: Ctrl+3
Mac: ⌘+3
Type compare and select Compare With Other Resource
Select the files to compare → OK
You can also create a keyboard shortcut for Compare With Other Resource by going to Window → Preferences → General → Keys
Other than using the Navigator/Proj Explorer and choosing files and doing 'Compare With'->'Each other'... I prefer opening both files in Eclipse and using 'Compare With'->'Opened Editor'->(pick the opened tab)...
You can get this feature via the AnyEdit eclipse plugin located here (you can use Install Software via Eclipse->Help->Install New Software screen):
http://andrei.gmxhome.de/eclipse/
If your compairing javascript you might find it not displaying.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=509820
Here is a workround...
Window > Preferences > Compare/Patch > General Tab
Deselect checkbox next to "Open structure compare automatically"
Compare with Other Resource – The Easy Way using Eclipse (no additional plugin required)
To assign a keyboard shortcut to the feature, go to Window > Preferences > General > Keys, look for the command Compare with Other Resource and assign it to a keyboard shortcut of your liking. See How to manage keyboard shortcuts in Eclipse for more details on configuring shortcuts.
Tip: Alternatively, you could press Ctrl+3 (for Quick Access) and search for Compare with Other Resource. This way you don’t have to configure a shortcut but you’ll have to search for the command every time in Quick Access.
Once the shortcut is assigned, you need to select the source file from the Package Explorer, Project Explorer or Navigator. The easiest way to do this from an open editor is to assign a shortcut to instantly show the file in the Package Explorer or, if it’s not open, to open it quickly using the keyboard.
Now press the keyboard shortcut you assigned to Compare with Other Resource and the following (non-modal) dialog should appear:
Troubleshooting: If the dialog doesn’t appear, it’s probably because you haven’t selected a file in either the Package Explorer or another view that allows file selection. Make sure a file is selected and make sure you haven’t selected the class in the Package Explorer rather than the actual Java file.
Now you can select the second file in the Package Explorer and drag and drop it onto the dialog. Click OK and the comparison editor should display, comparing the two selected files.
Tip: See the post on using shortcuts for common SVN commands for tips on how to navigate the comparison editor with the keyboard.
Comparing External Files
Using the Compare with Other Resource dialog, you can compare a workspace file with an external file or even compare two external files with each other.
Comparing a workspace file with an external file is easy: Once you’ve opened the dialog from a selected file, instead of dragging and dropping another workspace file, tick External File in the Right pane and then Browse to a file on your filesystem.
To compare two external files, you have to start the dialog again from a selected workspace file (choose an arbitrary file). Once open, select External File in the Left pane and Browse to your file then do the same for the Right pane.
Please refer this page for more details: http://www.eclipseonetips.com/2013/09/19/compare-two-workspace-or-external-files-in-eclipse/
If you have Beyond Compare installed, the ContextQuickie eclipse plugin has an option to enable it to be selected from the context menu displayed when you right-click a file.
Install from:
https://github.com/ContextQuickie/ContextQuickie/wiki/Installation
After install, activate Beyond Compare menu items via Window->Preferences->Context Quickie->check 'Enable Beyond Compare'.

In Eclipse, hide files ending in tilde `~`

Eclipse, by default, hides files that begin with . in the Package Explorer, Navigator, and other file views (e.g. .classpath, .settings, etc). Is it possible to hide files which end in ~ (e.g. somefile.txt~).
Yes, these are Emacs backup files, created while using both Eclipse and Emacs on the same project.
In the package explorer toolbar, there should be an icon that makes a dropdown menu appear; in that menu, select "Filters…".
Edit: see this link for an example of the icon, denoted the 'Menu button'
use backup-directory-alist in your emacs config to stash away the emacs backups in a different directory
In the Mars release, for the project you want to filter files on:
Project > properties > Resource/Resource Filters, Add Filter...
In the Add Resource Filter dialog:
Select "Exclude all"
Select "Files"
Set "All Children" to true
Filter values: "Name" "matches" "*~"
Reference: http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-97.htm