Skip to content
Related plugin for Atom editor
CoffeeScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
keymaps
lib
menus
resources
styles
.gitattributes
.gitignore
CHANGELOG.md
LICENSE.md
README.md
coffeelint.json
package.json
related.gif

README.md

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:

  • openSingleItemAutomatically - If only a single existing file matches the pattern, automatically open it instead of prompting
  • onlyShowCreateIfNoResults - Only offer to create files if there are no other existing results.
You can’t perform that action at this time.