How can I show dotfiles in Textmate 2? - text-editor

I recently upgraded to Textmate 2 and now my dotfiles are not showing up in the file browser. Obviously, this is important when working with stuff like .htaccess files.
Is there a way to enable this feature?

Quick solution
Move the focus to the file browser (⌥⌘⇥) and show invisibles (⌥⌘i)(key names: option/alt+command/windows+i/eye). All invisible files will appear in the file browser. Press ⌥⌘i again to hide them.
Permanent solution
If you want to always show some dotfiles (for instance .htaccess), you can either add them in Preferences > Projects > Include files matching…
or add the list of files you want to show to the include array in one of:
~/Library/Application Support/TextMate/Global.tmProperties (same as using Preferences)
~/.tm_properties (global)
.tm_properties (inside a specific directory/project)
You can add all dotfiles (.*) but I don't recommend it since it can be a lot of clutter.
That said, you can also exclude files with the exclude array.

You can modify the behavior of the file browser via the config file ~/.tm_properties
To list all dotfiles and directories, you can set:
include = "{$include,.*}"
If you want to exclude some of those, for example the .git directory, modify the exclude variable:
exclude = "{$exclude,.git}"
There are many more options, check the Textmate site as an entry point for whats possible: http://blog.macromates.com/2011/git-style-configuration/

You can do this in the preferences of Textmate 2.
Navigate to: Textmate -> Preferences -> Projects. You should see two fields, one for including files, and one for excluding. I replaced the value of "Include files matching" with {*,.*} so it includes all normal and hidden files. I then just add the hidden files I want to exclude to the "Exclude files matching" field, such as .git and .DS_Store.

Related

Can I filter sidebar directories by name (in sublime text 3) to quickly find node module, for example?

Here is my example, where I could have some input to filter directory subfolders.
The direct answer to the question is that this is not possible; the list of files and folders in the side bar is controlled by what folders you add and the settings that you include/exclude files and folders from within those folders. In theory you could try to modify the settings to change what appears in the side bar, but every time those settings change the file catalog needs to be rebuilt, which is something that can take some time (particularly in something with a large node_modules folder). It also causes all of the folders in the side bar to fold up.
The expected workflow is more designed around working with files than with working with groups of folders and that workflow centers around the Goto Anything panel. Choosing Goto > Goto Anything in the menu will open a panel showing you a list of every file that is currently contained in the side bar (except binary files).
The panel can filter text via fuzzy matching using as many search terms as you want (in any order you want) and will move the most likely matches closer to the top of the list. It also learns over time what files you pick when you use certain filters.
For your use case here you can open the panel and use a filter like node_modules or nmod/ to filter to files in the node_modules/ directory, acorn/ to see only files that exist in folders that match acorn, or a combination. You can also include fragments of filenames like lodash/ indjs to bring the index.js of the `lodash/ package to the top of the list.
The best way to get a feel for how this works is to play with it a little bit. Note also that the context menu in open files has a Reveal in side bar command that will focus the side bar on that file, which can be a handy way to see the other siblings of files you have open.

how do I exclude tmp files in Sublime "Go to Anything"?

I've tried this but it doesn't seem to work:
{
// index_exclude_patterns indicate which files won't be indexed.
"index_exclude_patterns": ["tmp/*", "*.cache", "*.log"],
}
Perhaps I need to reindex? But I don't know how to do that...
Your issue is that the index is used to collect symbols for Goto Definition and has no effect on the list of files that are presented to you when you use Goto Anything. So adding those folders to the list of files to exclude in indexing doesn't stop you from seeing them in the file list.
Goto Anything offers you all of the files that are currently contained in your project (if you're using one) or all open folders, excluding any files that it considers to be binary, so in order to stop files from appearing in the Goto Anything panel you need to either have them removed from the project or considered to be binary.
The folder_exclude_patterns and file_exclude_patterns settings allow you to indicate what folder and file patterns respectively should not be considered part of the project. Extending those settings would remove the files from the sidebar and thus from Goto Anything.
If you want to be able to still see the files in the sidebar but not be offered the ability to jump to them with Goto Anything, you can modify the binary_file_patterns setting. That tells Sublime what files are considered to be binary, which will stop it from showing them in the Goto Anything panel or searching them via Find in Files but will still show them in the sidebar for you to manually open.
folder_exclude_patterns and file_exclude_patterns can be used in your sublime-project file (if you're using one) so that they can be set on a project by project basis. binary_file_patterns only works as a global setting, however.
Either way, you probably want to base your custom settings on the defaults or you may accidentally have files appear in your project that are currently being hidden.

How to search only in currently open files in vscode?

I usually work on larger projects with many files that would contain the search query. So I would open the files I want to modify and do a find/replace across all currently opened files. Can this be done in vs code?
The feature I'm looking for is implemented in Notepad++, but I'd prefer not to have to switch editors for this task.
For me somehow it works just by typing ./ in the files to exclude field.
The ability to search only in the open editors is in the Stable Build v1.55.
As you can see, the icon is at the end of the files to include input so you will have to have that showing (click the three dots ... just below the search options if files to include is not already showing).
"Search: target particular set of files #20530" located here: https://github.com/Microsoft/vscode/issues/20530
Is tracking a search "scope" such as "all open files".
Hit Ctrl + Shift + F and enable the icon at the end of the 'file to include' text field
I don't think there's a way to do this. You can make a feature request on github. I think an extension could do it though.
There is a checkbox for this in the "files to include" field since version 1.55 (march 2021).
The answer was already mentioned (and accepted above) indeed typing ./ in the files to exclude box of the search window will allow you to only search in open files.
However the response mentioned that he was unsure why this worked. VSCode allows you to exclude all files in a directory by writing the directory in the exclude box. The directory . is the directory where VSCode is opened ie the root directory. The filter ./ excludes all files in the VSCodes root directory so all files are excluded. However opened files ignore any exclude filter. So if you exclude all files only the opened files will be searched.
The best way to find something you are searching for within a specific file in vs code would be:
Ctrl + p then pressing # on the search bar.
It will give you a list of all functions on the file, which makes it easier to track something down.
As an alternative to using Visual Studio Code itself, you can just search the file contents within the folder where unsaved files open in Visual Studio Code are located. This would be in one of these locations depending on which OS you are running:
Linux: /tmp/ (someone else running Linux can verify this)
macOS: ~/Library/Application\ Support/Code/Backups/
Windows: %APPDATA%\Code\User\
This extension is what I use for this purpose.
You may need to change the keybinding if there is a conflict.

vim: netrw to skip searching directory

When use :Ex to search files under a current project, I would like to search to skip certain directories. The netrm document says that "g:netrm_list_hide" option can be used to achieve this, but my experiments with the options shows it only applies to the filename but not the directory name.
The google search also yields no solution to this. Does anyone know a workaround?
Taken from http://vim.1045645.n5.nabble.com/Hiding-Subversion-directories-within-netrw-td1167827.html
To hide directory names just add a trailing slash when you list them. For example to hide the directory .git/ use the following.
let g:netrw_list_hide='^\.git/$'

Exclude files by wildcard through Tortoise SVN shell menu

I am using Tortoise SVN 1.6.16 in Windows 7. If I have a certain file type I want to exclude from future commits, I thought I could just go find a file of that type within my working folder, then right click it, and select "TortoiseSVN->Delete and Add to Ignore List->*.ext" where ext is the file extension of the file I clicked, as shown in the image below.
However, when I do this, it only excludes that specific file, and the next time I commit, all other files of that type still come up in the list to commit.
Am I doing something wrong? How can I just tell Tortoise or SVN to ignore all files of a certain type from future commits?
I had the same hunch as #Stefan: that you were probably seeing files in subdirectories and thinking those should have also been ignored even though you only applied the ignore to a single folder.
So if that is in fact the case, here is the recipe:
When you want to ignore files or patterns from a single directory:
Use the convenience menu command to add to the ignore list.
When you want to ignore files or patterns from a subtree:
Open the subversion properties (TortoiseSVN >> Properties) of the root of the subtree. Add or edit an entry for the svn:ignore keyword. The illustration shows an example where I have specified to ignore an obj subfolder as well as all files with a .user or .bak extension.
The secret, though, is in the specification--when you define the patterns to ignore, select the recursive choice as indicated here:
Unfortunately, there is one catch to this method: In my example, I had previously specified to ignore obj and *.user and I was adding just the *.bak pattern. When I apply recursively, it does not apply just the change (*.bak) but everything in the svn:ignore keyword (obj, *.user, and *.bak) to all subfolders. That may or may not be what you want, so be aware of it.
It ignores all bat files right, but not recursively! It only ignores them in the folder you added it to the ignore list.
You could also use Tortoise's global ignore pattern (if it's applicable to all your working copies):
TortoiseSVN -> Settings
General
Fill out the "Global ignore pattern" field, such as adding "*.ext" at the end of it, separating entries with a space.

Resources