related

Navigate quickly between files in your project, such as header/source files, based on a set of configurable rules

nick125

12,732

13

0.3.5

MIT

GitHub

Related for Atom

Related is a port of the sublime-related-files plugin for Atom.

Related provides a quick way to access files that are "related" to the file currently opened. For example, Related includes a set of patterns for switching between C/C++/Objective-C source and header files.

Related in action

What is a "related" file?

The relationship between files is defined through a set of patterns. For example,

"lib/(.+).coffee": [
  "spec/$1-spec.coffee"
]

provides a mapping from a CoffeeScript file (through a matcher) in lib/ to a unit test in spec/ (through a result) -- that is, if I currently have the file lib/foo.coffee open and the file spec/foo-spec.coffee exists, Related will show it as a file to jump to. Each pattern can have multiple results, and a single file can match multiple patterns.

Creating files

Related allows you to optionally create related files by specifying the 'create' flag at the end of your result. For example, with the currently open file "lib/foo.coffee",

"lib/(.+).coffee": [
  "spec/$1-spec.coffee#create"
]

would prompt you to create "spec/foo-spec.coffee" if it doesn't already exist.

Keymapping

By default, Related uses ctrl+shift+r.

Configuration

Related includes a limited default pattern set, but there are some additional examples in the examples/ directory. To add a pattern, see the "Edit related patterns" options under the Packages -> Related menu.

Related provides the following configuration options: