Related Files
A Sublime Text 2/3 plugin to list related files
Details
Installs
- Total 2K
- Win 745
- Mac 1K
- Linux 461
May 13 | May 12 | May 11 | May 10 | May 9 | May 8 | May 7 | May 6 | May 5 | May 4 | May 3 | May 2 | May 1 | Apr 30 | Apr 29 | Apr 28 | Apr 27 | Apr 26 | Apr 25 | Apr 24 | Apr 23 | Apr 22 | Apr 21 | Apr 20 | Apr 19 | Apr 18 | Apr 17 | Apr 16 | Apr 15 | Apr 14 | Apr 13 | Apr 12 | Apr 11 | Apr 10 | Apr 9 | Apr 8 | Apr 7 | Apr 6 | Apr 5 | Apr 4 | Apr 3 | Apr 2 | Apr 1 | Mar 31 | Mar 30 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Sublime Text 3 - Related Files Plugin
This plugin provides a quick list of related files to the currently open file.
My main use case is to list related files under a Ruby on Rails project. For example, for an opened “app/controllers/examples_controller.rb”, related files would be “app/helpers/examples_helper.rb”, “app/views/examples/**”, and “spec/controllers/examples_controller_spec.rb”.
This plugin was inspired by the existing Open Related and Rails Related Files.
I wanted something between the two of them (a quick list of results that could be setup for any kinds of projects, not only Rails), so I created my own.
Key Shortcut
The default shortcut is mapped to “ctrl+super+p”. To change it to something more suitable for your needs, you can easily change that by copying the following and replacing the “keys” to your desired key combination:
{ "keys": ["ctrl+super+p"], "command": "related_files"}
Configuration
The plugins comes configured to lookup Rails related files, but you can add your own setups. Let's see an existing example:
// Test/specs for ruby files
".+\/(app|lib)\/(.+).rb":
[
"spec/$2_spec.rb",
"test/$2_test.rb"
]
The configuration has two parts: the key, which is a regular expression to match against the currently open file, and a list of globs to map the related files.
You can use the $1, $2, etc. on the glob strings to be replace by the extracted parts from the regex.
In addition to global configs, you can also have per project configs. To add that, in a sublime project file (project-name.sublime-project), add this:
{
"settings":
{
"RelatedFiles": {
"patterns": {
// you project patterns
}
}
}
}